@scalar/agent-chat 0.2.1 → 0.2.3

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 (256) hide show
  1. package/dist/App.vue.d.ts +6 -1
  2. package/dist/App.vue.d.ts.map +1 -1
  3. package/dist/Chat.vue.d.ts.map +1 -1
  4. package/dist/Tooltip-Cm82QgNj.js +575 -0
  5. package/dist/__vite-optional-peer-dep_stream-markdown_markstream-vue_false-sdjmOmXd.js +5 -0
  6. package/dist/__vite-optional-peer-dep_stream-monaco_markstream-vue_false-HdL4xm5U.js +5 -0
  7. package/dist/__vite-optional-peer-dep_vue-i18n_markstream-vue_false-B9Pwe5kz.js +5 -0
  8. package/dist/_basePickBy-hHD8tMGb.js +151 -0
  9. package/dist/_baseUniq-DTF1wuF6.js +614 -0
  10. package/dist/arc-Dw2RQerU.js +83 -0
  11. package/dist/architecture-U656AL7Q-B00Z9eXr.js +36 -0
  12. package/dist/architectureDiagram-VXUJARFQ-BtOffFaM.js +4662 -0
  13. package/dist/blockDiagram-VD42YOAC-BUqFMMQe.js +2261 -0
  14. package/dist/c4Diagram-YG6GDRKO-NrM1YcpG.js +1579 -0
  15. package/dist/channel-105myCGU.js +5 -0
  16. package/dist/chunk-4BX2VUAB-TAxJli7C.js +8 -0
  17. package/dist/chunk-55IACEB6-VXFJ4bz5.js +8 -0
  18. package/dist/chunk-B4BG7PRW-CZDQpfj5.js +1375 -0
  19. package/dist/chunk-DI55MBZ5-D3l7TA-E.js +1370 -0
  20. package/dist/chunk-FMBD7UC4-BMXFm8I3.js +19 -0
  21. package/dist/chunk-QN33PNHL-BOUpbpWp.js +19 -0
  22. package/dist/chunk-QZHKN3VN-C-TEEx05.js +15 -0
  23. package/dist/chunk-TZMSLE5B-BUiROKNR.js +64 -0
  24. package/dist/classDiagram-2ON5EDUG-HQET4ybK.js +16 -0
  25. package/dist/classDiagram-v2-WZHVMYZB-HQET4ybK.js +16 -0
  26. package/dist/clone-CIIO71O9.js +8 -0
  27. package/dist/components/ApprovalSection.vue.d.ts.map +1 -1
  28. package/dist/components/PaymentSection.vue.d.ts +9 -0
  29. package/dist/components/PaymentSection.vue.d.ts.map +1 -0
  30. package/dist/components/RequestPreview.vue.d.ts.map +1 -1
  31. package/dist/components/ResponseBody/ResponseBody.vue.d.ts +1 -1
  32. package/dist/components/ResponseBody/ResponseBodyPreview.vue.d.ts +1 -1
  33. package/dist/cose-bilkent-S5V4N54A-CMsF4n-5.js +2609 -0
  34. package/dist/cytoscape.esm-DfdJODL8.js +18735 -0
  35. package/dist/dagre-6UL2VRFP-DqzdQ6Qg.js +444 -0
  36. package/dist/defaultLocale-BEa-49Qz.js +171 -0
  37. package/dist/diagram-PSM6KHXK-1xyGntw2.js +531 -0
  38. package/dist/diagram-QEK2KX5R-DdZdlAm1.js +217 -0
  39. package/dist/diagram-S2PKOQOG-C80Eo2jp.js +142 -0
  40. package/dist/erDiagram-Q2GNP2WA-DFVRrMXT.js +841 -0
  41. package/dist/flowDiagram-NV44I4VS-D9QK_qqB.js +1620 -0
  42. package/dist/ganttDiagram-LVOFAZNH-Bo1NTkeQ.js +2506 -0
  43. package/dist/gitGraph-F6HP7TQM-C5hdgcgO.js +27 -0
  44. package/dist/gitGraphDiagram-NY62KEGX-BZqnqZh6.js +699 -0
  45. package/dist/graph-Dth4IhEK.js +247 -0
  46. package/dist/helpers.d.ts +1 -1
  47. package/dist/hooks/useSearch.d.ts.map +1 -1
  48. package/dist/index-BOvT43H8.js +111780 -0
  49. package/dist/index.d.ts +1 -1
  50. package/dist/index.js +2 -3
  51. package/dist/index2-B36B-gt0.js +69 -0
  52. package/dist/index3-CtIyYUnG.js +70 -0
  53. package/dist/index4-Dzz91Ao2.js +537 -0
  54. package/dist/index5-Bmz0gMSP.js +590 -0
  55. package/dist/index6-DMB3qTSV.js +196 -0
  56. package/dist/info-NVLQJR56-azt5obk5.js +27 -0
  57. package/dist/infoDiagram-ER5ION4S-DD4Jtctm.js +24 -0
  58. package/dist/infographic_markstream-vue_false-BfsmcXxk.js +5 -0
  59. package/dist/init-DjUOC4st.js +16 -0
  60. package/dist/journeyDiagram-XKPGCS4Q-CXL6UO0r.js +834 -0
  61. package/dist/kanban-definition-3W4ZIXB7-B57do5Wg.js +719 -0
  62. package/dist/katex-SsTUIUTC.js +11688 -0
  63. package/dist/layout-7TCY8eA2.js +1332 -0
  64. package/dist/linear-DSm5i91N.js +625 -0
  65. package/dist/mermaid-parser.core-CUQWpAMM.js +12746 -0
  66. package/dist/mermaid.core-QjuzH7xx.js +14164 -0
  67. package/dist/mhchem-XHl7cef5.js +2306 -0
  68. package/dist/mindmap-definition-VGOIOE7T-DAQyGNAM.js +784 -0
  69. package/dist/ordinal-DfAQgscy.js +61 -0
  70. package/dist/package.json +2 -2
  71. package/dist/packet-BFZMPI3H-CixuxAEA.js +27 -0
  72. package/dist/pie-7BOR55EZ-D3cgnzR1.js +32 -0
  73. package/dist/pieDiagram-ADFJNKIX-BqxgYwrL.js +161 -0
  74. package/dist/quadrantDiagram-AYHSOK5B-CQ4v-9Hh.js +1022 -0
  75. package/dist/radar-NHE76QYJ-DhV0Od_M.js +27 -0
  76. package/dist/registry/add-documents-to-store.d.ts +3 -2
  77. package/dist/registry/add-documents-to-store.d.ts.map +1 -1
  78. package/dist/requirementDiagram-UZGBJVZJ-ncWNAgFi.js +850 -0
  79. package/dist/safeRaf-I3a3-dyJ.js +10 -0
  80. package/dist/sankeyDiagram-TZEHDZUN-yCR2_cH5.js +810 -0
  81. package/dist/sequenceDiagram-WL72ISMW-DZ7wqFyd.js +2511 -0
  82. package/dist/state/state.d.ts +7 -3
  83. package/dist/state/state.d.ts.map +1 -1
  84. package/dist/stateDiagram-FKZM4ZOC-Dra68Tzi.js +263 -0
  85. package/dist/stateDiagram-v2-4FDKWEC3-CARbPECD.js +16 -0
  86. package/dist/style.css +1 -12713
  87. package/dist/timeline-definition-IT6M3QCI-DEbG9QIM.js +795 -0
  88. package/dist/treemap-KMMF4GRG-CQbPsyWe.js +81 -0
  89. package/dist/views/Chat/Chat.vue.d.ts.map +1 -1
  90. package/dist/views/Chat/Messages/ExecuteRequestTool.vue.d.ts +1 -1
  91. package/dist/views/Chat/Messages/ExecuteRequestTool.vue.d.ts.map +1 -1
  92. package/dist/views/Chat/Messages/GetMiniOpenAPIDocTool.vue.d.ts +1 -1
  93. package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue.d.ts +1 -1
  94. package/dist/views/PromptForm.vue.d.ts.map +1 -1
  95. package/dist/views/Start.vue.d.ts.map +1 -1
  96. package/dist/xychartDiagram-PRI3JC2R-C94Pu8hL.js +1340 -0
  97. package/package.json +1 -1
  98. package/dist/App.vue.js +0 -29
  99. package/dist/App.vue.js.map +0 -1
  100. package/dist/App.vue2.js +0 -5
  101. package/dist/App.vue2.js.map +0 -1
  102. package/dist/Chat.vue.js +0 -55
  103. package/dist/Chat.vue.js.map +0 -1
  104. package/dist/Chat.vue2.js +0 -5
  105. package/dist/Chat.vue2.js.map +0 -1
  106. package/dist/_virtual/_plugin-vue_export-helper.js +0 -11
  107. package/dist/_virtual/_plugin-vue_export-helper.js.map +0 -1
  108. package/dist/components/ApprovalSection.vue.js +0 -8
  109. package/dist/components/ApprovalSection.vue.js.map +0 -1
  110. package/dist/components/ApprovalSection.vue2.js +0 -47
  111. package/dist/components/ApprovalSection.vue2.js.map +0 -1
  112. package/dist/components/AutosendPaused.vue.js +0 -15
  113. package/dist/components/AutosendPaused.vue.js.map +0 -1
  114. package/dist/components/ContextItem.vue.js +0 -8
  115. package/dist/components/ContextItem.vue.js.map +0 -1
  116. package/dist/components/ContextItem.vue2.js +0 -22
  117. package/dist/components/ContextItem.vue2.js.map +0 -1
  118. package/dist/components/Endpoint.vue.js +0 -8
  119. package/dist/components/Endpoint.vue.js.map +0 -1
  120. package/dist/components/Endpoint.vue2.js +0 -98
  121. package/dist/components/Endpoint.vue2.js.map +0 -1
  122. package/dist/components/ErrorMessage.vue.js +0 -8
  123. package/dist/components/ErrorMessage.vue.js.map +0 -1
  124. package/dist/components/ErrorMessage.vue2.js +0 -28
  125. package/dist/components/ErrorMessage.vue2.js.map +0 -1
  126. package/dist/components/LoadingMiniOpenAPIDoc.vue.js +0 -16
  127. package/dist/components/LoadingMiniOpenAPIDoc.vue.js.map +0 -1
  128. package/dist/components/LoadingOpenAPISpecsSummary.vue.js +0 -16
  129. package/dist/components/LoadingOpenAPISpecsSummary.vue.js.map +0 -1
  130. package/dist/components/Logo.vue.js +0 -25
  131. package/dist/components/Logo.vue.js.map +0 -1
  132. package/dist/components/RequestApproved.vue.js +0 -15
  133. package/dist/components/RequestApproved.vue.js.map +0 -1
  134. package/dist/components/RequestFailed.vue.js +0 -26
  135. package/dist/components/RequestFailed.vue.js.map +0 -1
  136. package/dist/components/RequestPreview.vue.js +0 -9
  137. package/dist/components/RequestPreview.vue.js.map +0 -1
  138. package/dist/components/RequestPreview.vue2.js +0 -150
  139. package/dist/components/RequestPreview.vue2.js.map +0 -1
  140. package/dist/components/RequestRejected.vue.js +0 -24
  141. package/dist/components/RequestRejected.vue.js.map +0 -1
  142. package/dist/components/RequestSuccess.vue.js +0 -15
  143. package/dist/components/RequestSuccess.vue.js.map +0 -1
  144. package/dist/components/ResponseBody/ResponseBody.vue.js +0 -45
  145. package/dist/components/ResponseBody/ResponseBody.vue.js.map +0 -1
  146. package/dist/components/ResponseBody/ResponseBody.vue2.js +0 -5
  147. package/dist/components/ResponseBody/ResponseBody.vue2.js.map +0 -1
  148. package/dist/components/ResponseBody/ResponseBodyInfo.vue.js +0 -17
  149. package/dist/components/ResponseBody/ResponseBodyInfo.vue.js.map +0 -1
  150. package/dist/components/ResponseBody/ResponseBodyPreview.vue.js +0 -8
  151. package/dist/components/ResponseBody/ResponseBodyPreview.vue.js.map +0 -1
  152. package/dist/components/ResponseBody/ResponseBodyPreview.vue2.js +0 -73
  153. package/dist/components/ResponseBody/ResponseBodyPreview.vue2.js.map +0 -1
  154. package/dist/components/ResponseBody/ResponseBodyRaw.vue.js +0 -23
  155. package/dist/components/ResponseBody/ResponseBodyRaw.vue.js.map +0 -1
  156. package/dist/components/ResponseBody/ResponseBodyRaw.vue2.js +0 -5
  157. package/dist/components/ResponseBody/ResponseBodyRaw.vue2.js.map +0 -1
  158. package/dist/components/ResponseBody/ResponseBodyToggle.vue.js +0 -30
  159. package/dist/components/ResponseBody/ResponseBodyToggle.vue.js.map +0 -1
  160. package/dist/components/ResponseBody/ResponseBodyToggle.vue2.js +0 -5
  161. package/dist/components/ResponseBody/ResponseBodyToggle.vue2.js.map +0 -1
  162. package/dist/components/ResponseBody/helpers/media-types.js +0 -134
  163. package/dist/components/ResponseBody/helpers/media-types.js.map +0 -1
  164. package/dist/components/ResponseBody/helpers/process-response-body.js +0 -63
  165. package/dist/components/ResponseBody/helpers/process-response-body.js.map +0 -1
  166. package/dist/components/SearchPopover.vue.js +0 -8
  167. package/dist/components/SearchPopover.vue.js.map +0 -1
  168. package/dist/components/SearchPopover.vue2.js +0 -78
  169. package/dist/components/SearchPopover.vue2.js.map +0 -1
  170. package/dist/components/SendingRequest.vue.js +0 -26
  171. package/dist/components/SendingRequest.vue.js.map +0 -1
  172. package/dist/components/Suggestion.vue.js +0 -8
  173. package/dist/components/Suggestion.vue.js.map +0 -1
  174. package/dist/components/Suggestion.vue2.js +0 -28
  175. package/dist/components/Suggestion.vue2.js.map +0 -1
  176. package/dist/components/TestRequestButton.vue.js +0 -8
  177. package/dist/components/TestRequestButton.vue.js.map +0 -1
  178. package/dist/components/TestRequestButton.vue2.js +0 -37
  179. package/dist/components/TestRequestButton.vue2.js.map +0 -1
  180. package/dist/helpers.js +0 -201
  181. package/dist/helpers.js.map +0 -1
  182. package/dist/hooks/useChatApprovals.js +0 -25
  183. package/dist/hooks/useChatApprovals.js.map +0 -1
  184. package/dist/hooks/useChatOperationBlocks.js +0 -29
  185. package/dist/hooks/useChatOperationBlocks.js.map +0 -1
  186. package/dist/hooks/useChatScroll.js +0 -22
  187. package/dist/hooks/useChatScroll.js.map +0 -1
  188. package/dist/hooks/useSearch.js +0 -36
  189. package/dist/hooks/useSearch.js.map +0 -1
  190. package/dist/index.js.map +0 -1
  191. package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/api.js +0 -12
  192. package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/api.js.map +0 -1
  193. package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/core.js +0 -67
  194. package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/core.js.map +0 -1
  195. package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/errors.js +0 -25
  196. package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/errors.js.map +0 -1
  197. package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/parse.js +0 -64
  198. package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/parse.js.map +0 -1
  199. package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/regexes.js +0 -8
  200. package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/regexes.js.map +0 -1
  201. package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/schemas.js +0 -181
  202. package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/schemas.js.map +0 -1
  203. package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/util.js +0 -85
  204. package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/util.js.map +0 -1
  205. package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/versions.js +0 -9
  206. package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/versions.js.map +0 -1
  207. package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/mini/schemas.js +0 -61
  208. package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/mini/schemas.js.map +0 -1
  209. package/dist/registry/add-documents-to-store.js +0 -42
  210. package/dist/registry/add-documents-to-store.js.map +0 -1
  211. package/dist/state/state.js +0 -112
  212. package/dist/state/state.js.map +0 -1
  213. package/dist/views/Chat/Chat.vue.js +0 -8
  214. package/dist/views/Chat/Chat.vue.js.map +0 -1
  215. package/dist/views/Chat/Chat.vue2.js +0 -84
  216. package/dist/views/Chat/Chat.vue2.js.map +0 -1
  217. package/dist/views/Chat/Messages/ExecuteRequestTool.vue.js +0 -8
  218. package/dist/views/Chat/Messages/ExecuteRequestTool.vue.js.map +0 -1
  219. package/dist/views/Chat/Messages/ExecuteRequestTool.vue2.js +0 -39
  220. package/dist/views/Chat/Messages/ExecuteRequestTool.vue2.js.map +0 -1
  221. package/dist/views/Chat/Messages/GetMiniOpenAPIDocTool.vue.js +0 -8
  222. package/dist/views/Chat/Messages/GetMiniOpenAPIDocTool.vue.js.map +0 -1
  223. package/dist/views/Chat/Messages/GetMiniOpenAPIDocTool.vue2.js +0 -65
  224. package/dist/views/Chat/Messages/GetMiniOpenAPIDocTool.vue2.js.map +0 -1
  225. package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue.js +0 -32
  226. package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue.js.map +0 -1
  227. package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue2.js +0 -5
  228. package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue2.js.map +0 -1
  229. package/dist/views/Chat/Messages/Text.vue.js +0 -21
  230. package/dist/views/Chat/Messages/Text.vue.js.map +0 -1
  231. package/dist/views/Chat/Messages/Text.vue2.js +0 -5
  232. package/dist/views/Chat/Messages/Text.vue2.js.map +0 -1
  233. package/dist/views/Layout.vue.js +0 -8
  234. package/dist/views/Layout.vue.js.map +0 -1
  235. package/dist/views/Layout.vue2.js +0 -28
  236. package/dist/views/Layout.vue2.js.map +0 -1
  237. package/dist/views/PromptForm.vue.js +0 -8
  238. package/dist/views/PromptForm.vue.js.map +0 -1
  239. package/dist/views/PromptForm.vue2.js +0 -182
  240. package/dist/views/PromptForm.vue2.js.map +0 -1
  241. package/dist/views/Settings/Auth.vue.js +0 -66
  242. package/dist/views/Settings/Auth.vue.js.map +0 -1
  243. package/dist/views/Settings/Auth.vue2.js +0 -5
  244. package/dist/views/Settings/Auth.vue2.js.map +0 -1
  245. package/dist/views/Settings/DocSettings.vue.js +0 -8
  246. package/dist/views/Settings/DocSettings.vue.js.map +0 -1
  247. package/dist/views/Settings/DocSettings.vue2.js +0 -50
  248. package/dist/views/Settings/DocSettings.vue2.js.map +0 -1
  249. package/dist/views/Settings/Settings.vue.js +0 -9
  250. package/dist/views/Settings/Settings.vue.js.map +0 -1
  251. package/dist/views/Settings/Settings.vue2.js +0 -78
  252. package/dist/views/Settings/Settings.vue2.js.map +0 -1
  253. package/dist/views/Start.vue.js +0 -8
  254. package/dist/views/Start.vue.js.map +0 -1
  255. package/dist/views/Start.vue2.js +0 -56
  256. package/dist/views/Start.vue2.js.map +0 -1
@@ -0,0 +1,1332 @@
1
+ import { G as g } from "./graph-Dth4IhEK.js";
2
+ import { b as Te, p as ce, q as le, g as X, e as ee, l as F, o as Me, s as Ie, c as Se, u as je, d as f, i as m, f as C, v as x, r as I } from "./_baseUniq-DTF1wuF6.js";
3
+ import { f as O, b as he, a as Fe, c as Ve, d as Ae, t as V, m as w, e as P, h as ve, g as z, l as T, i as Be } from "./_basePickBy-hHD8tMGb.js";
4
+ import { aX as Ge, aY as Ye, aZ as De, aN as $e, a_ as qe, aR as pe, aQ as we, a$ as We, aM as $, ar as Xe, aT as ze, at as Ue, b0 as q } from "./mermaid.core-QjuzH7xx.js";
5
+ function He(e) {
6
+ return Ge(Ye(e, void 0, O), e + "");
7
+ }
8
+ var Ze = 1, Je = 4;
9
+ function Qe(e) {
10
+ return Te(e, Ze | Je);
11
+ }
12
+ function Ke(e, n) {
13
+ return e == null ? e : De(e, ce(n), $e);
14
+ }
15
+ function en(e, n) {
16
+ return e && le(e, ce(n));
17
+ }
18
+ function nn(e, n) {
19
+ return e > n;
20
+ }
21
+ function S(e, n) {
22
+ var r = {};
23
+ return n = X(n), le(e, function(t, a, i) {
24
+ qe(r, a, n(t, a, i));
25
+ }), r;
26
+ }
27
+ function y(e) {
28
+ return e && e.length ? he(e, pe, nn) : void 0;
29
+ }
30
+ function U(e, n) {
31
+ return e && e.length ? he(e, X(n), Fe) : void 0;
32
+ }
33
+ function rn(e, n) {
34
+ var r = e.length;
35
+ for (e.sort(n); r--; )
36
+ e[r] = e[r].value;
37
+ return e;
38
+ }
39
+ function tn(e, n) {
40
+ if (e !== n) {
41
+ var r = e !== void 0, t = e === null, a = e === e, i = ee(e), o = n !== void 0, u = n === null, d = n === n, s = ee(n);
42
+ if (!u && !s && !i && e > n || i && o && d && !u && !s || t && o && d || !r && d || !a)
43
+ return 1;
44
+ if (!t && !i && !s && e < n || s && r && a && !t && !i || u && r && a || !o && a || !d)
45
+ return -1;
46
+ }
47
+ return 0;
48
+ }
49
+ function an(e, n, r) {
50
+ for (var t = -1, a = e.criteria, i = n.criteria, o = a.length, u = r.length; ++t < o; ) {
51
+ var d = tn(a[t], i[t]);
52
+ if (d) {
53
+ if (t >= u)
54
+ return d;
55
+ var s = r[t];
56
+ return d * (s == "desc" ? -1 : 1);
57
+ }
58
+ }
59
+ return e.index - n.index;
60
+ }
61
+ function on(e, n, r) {
62
+ n.length ? n = F(n, function(i) {
63
+ return we(i) ? function(o) {
64
+ return Me(o, i.length === 1 ? i[0] : i);
65
+ } : i;
66
+ }) : n = [pe];
67
+ var t = -1;
68
+ n = F(n, We(X));
69
+ var a = Ve(e, function(i, o, u) {
70
+ var d = F(n, function(s) {
71
+ return s(i);
72
+ });
73
+ return { criteria: d, index: ++t, value: i };
74
+ });
75
+ return rn(a, function(i, o) {
76
+ return an(i, o, r);
77
+ });
78
+ }
79
+ function un(e, n) {
80
+ return Ae(e, n, function(r, t) {
81
+ return Ie(e, t);
82
+ });
83
+ }
84
+ var M = He(function(e, n) {
85
+ return e == null ? {} : un(e, n);
86
+ }), dn = Math.ceil, sn = Math.max;
87
+ function fn(e, n, r, t) {
88
+ for (var a = -1, i = sn(dn((n - e) / (r || 1)), 0), o = Array(i); i--; )
89
+ o[++a] = e, e += r;
90
+ return o;
91
+ }
92
+ function cn(e) {
93
+ return function(n, r, t) {
94
+ return t && typeof t != "number" && $(n, r, t) && (r = t = void 0), n = V(n), r === void 0 ? (r = n, n = 0) : r = V(r), t = t === void 0 ? n < r ? 1 : -1 : V(t), fn(n, r, t);
95
+ };
96
+ }
97
+ var E = cn(), R = Xe(function(e, n) {
98
+ if (e == null)
99
+ return [];
100
+ var r = n.length;
101
+ return r > 1 && $(e, n[0], n[1]) ? n = [] : r > 2 && $(n[0], n[1], n[2]) && (n = [n[0]]), on(e, Se(n), []);
102
+ }), ln = 0;
103
+ function H(e) {
104
+ var n = ++ln;
105
+ return je(e) + n;
106
+ }
107
+ function hn(e, n, r) {
108
+ for (var t = -1, a = e.length, i = n.length, o = {}; ++t < a; ) {
109
+ var u = t < i ? n[t] : void 0;
110
+ r(o, e[t], u);
111
+ }
112
+ return o;
113
+ }
114
+ function vn(e, n) {
115
+ return hn(e || [], n || [], ze);
116
+ }
117
+ class pn {
118
+ constructor() {
119
+ var n = {};
120
+ n._next = n._prev = n, this._sentinel = n;
121
+ }
122
+ dequeue() {
123
+ var n = this._sentinel, r = n._prev;
124
+ if (r !== n)
125
+ return ne(r), r;
126
+ }
127
+ enqueue(n) {
128
+ var r = this._sentinel;
129
+ n._prev && n._next && ne(n), n._next = r._next, r._next._prev = n, r._next = n, n._prev = r;
130
+ }
131
+ toString() {
132
+ for (var n = [], r = this._sentinel, t = r._prev; t !== r; )
133
+ n.push(JSON.stringify(t, wn)), t = t._prev;
134
+ return "[" + n.join(", ") + "]";
135
+ }
136
+ }
137
+ function ne(e) {
138
+ e._prev._next = e._next, e._next._prev = e._prev, delete e._next, delete e._prev;
139
+ }
140
+ function wn(e, n) {
141
+ if (e !== "_next" && e !== "_prev")
142
+ return n;
143
+ }
144
+ var bn = Ue(1);
145
+ function mn(e, n) {
146
+ if (e.nodeCount() <= 1)
147
+ return [];
148
+ var r = yn(e, n || bn), t = gn(r.graph, r.buckets, r.zeroIdx);
149
+ return O(
150
+ w(t, function(a) {
151
+ return e.outEdges(a.v, a.w);
152
+ })
153
+ );
154
+ }
155
+ function gn(e, n, r) {
156
+ for (var t = [], a = n[n.length - 1], i = n[0], o; e.nodeCount(); ) {
157
+ for (; o = i.dequeue(); )
158
+ A(e, n, r, o);
159
+ for (; o = a.dequeue(); )
160
+ A(e, n, r, o);
161
+ if (e.nodeCount()) {
162
+ for (var u = n.length - 2; u > 0; --u)
163
+ if (o = n[u].dequeue(), o) {
164
+ t = t.concat(A(e, n, r, o, !0));
165
+ break;
166
+ }
167
+ }
168
+ }
169
+ return t;
170
+ }
171
+ function A(e, n, r, t, a) {
172
+ var i = a ? [] : void 0;
173
+ return f(e.inEdges(t.v), function(o) {
174
+ var u = e.edge(o), d = e.node(o.v);
175
+ a && i.push({ v: o.v, w: o.w }), d.out -= u, W(n, r, d);
176
+ }), f(e.outEdges(t.v), function(o) {
177
+ var u = e.edge(o), d = o.w, s = e.node(d);
178
+ s.in -= u, W(n, r, s);
179
+ }), e.removeNode(t.v), i;
180
+ }
181
+ function yn(e, n) {
182
+ var r = new g(), t = 0, a = 0;
183
+ f(e.nodes(), function(u) {
184
+ r.setNode(u, { v: u, in: 0, out: 0 });
185
+ }), f(e.edges(), function(u) {
186
+ var d = r.edge(u.v, u.w) || 0, s = n(u), c = d + s;
187
+ r.setEdge(u.v, u.w, c), a = Math.max(a, r.node(u.v).out += s), t = Math.max(t, r.node(u.w).in += s);
188
+ });
189
+ var i = E(a + t + 3).map(function() {
190
+ return new pn();
191
+ }), o = t + 1;
192
+ return f(r.nodes(), function(u) {
193
+ W(i, o, r.node(u));
194
+ }), { graph: r, buckets: i, zeroIdx: o };
195
+ }
196
+ function W(e, n, r) {
197
+ r.out ? r.in ? e[r.out - r.in + n].enqueue(r) : e[e.length - 1].enqueue(r) : e[0].enqueue(r);
198
+ }
199
+ function kn(e) {
200
+ var n = e.graph().acyclicer === "greedy" ? mn(e, r(e)) : xn(e);
201
+ f(n, function(t) {
202
+ var a = e.edge(t);
203
+ e.removeEdge(t), a.forwardName = t.name, a.reversed = !0, e.setEdge(t.w, t.v, a, H("rev"));
204
+ });
205
+ function r(t) {
206
+ return function(a) {
207
+ return t.edge(a).weight;
208
+ };
209
+ }
210
+ }
211
+ function xn(e) {
212
+ var n = [], r = {}, t = {};
213
+ function a(i) {
214
+ Object.prototype.hasOwnProperty.call(t, i) || (t[i] = !0, r[i] = !0, f(e.outEdges(i), function(o) {
215
+ Object.prototype.hasOwnProperty.call(r, o.w) ? n.push(o) : a(o.w);
216
+ }), delete r[i]);
217
+ }
218
+ return f(e.nodes(), a), n;
219
+ }
220
+ function En(e) {
221
+ f(e.edges(), function(n) {
222
+ var r = e.edge(n);
223
+ if (r.reversed) {
224
+ e.removeEdge(n);
225
+ var t = r.forwardName;
226
+ delete r.reversed, delete r.forwardName, e.setEdge(n.w, n.v, r, t);
227
+ }
228
+ });
229
+ }
230
+ function L(e, n, r, t) {
231
+ var a;
232
+ do
233
+ a = H(t);
234
+ while (e.hasNode(a));
235
+ return r.dummy = n, e.setNode(a, r), a;
236
+ }
237
+ function On(e) {
238
+ var n = new g().setGraph(e.graph());
239
+ return f(e.nodes(), function(r) {
240
+ n.setNode(r, e.node(r));
241
+ }), f(e.edges(), function(r) {
242
+ var t = n.edge(r.v, r.w) || { weight: 0, minlen: 1 }, a = e.edge(r);
243
+ n.setEdge(r.v, r.w, {
244
+ weight: t.weight + a.weight,
245
+ minlen: Math.max(t.minlen, a.minlen)
246
+ });
247
+ }), n;
248
+ }
249
+ function be(e) {
250
+ var n = new g({ multigraph: e.isMultigraph() }).setGraph(e.graph());
251
+ return f(e.nodes(), function(r) {
252
+ e.children(r).length || n.setNode(r, e.node(r));
253
+ }), f(e.edges(), function(r) {
254
+ n.setEdge(r, e.edge(r));
255
+ }), n;
256
+ }
257
+ function re(e, n) {
258
+ var r = e.x, t = e.y, a = n.x - r, i = n.y - t, o = e.width / 2, u = e.height / 2;
259
+ if (!a && !i)
260
+ throw new Error("Not possible to find intersection inside of the rectangle");
261
+ var d, s;
262
+ return Math.abs(i) * o > Math.abs(a) * u ? (i < 0 && (u = -u), d = u * a / i, s = u) : (a < 0 && (o = -o), d = o, s = o * i / a), { x: r + d, y: t + s };
263
+ }
264
+ function j(e) {
265
+ var n = w(E(me(e) + 1), function() {
266
+ return [];
267
+ });
268
+ return f(e.nodes(), function(r) {
269
+ var t = e.node(r), a = t.rank;
270
+ m(a) || (n[a][t.order] = r);
271
+ }), n;
272
+ }
273
+ function Ln(e) {
274
+ var n = P(
275
+ w(e.nodes(), function(r) {
276
+ return e.node(r).rank;
277
+ })
278
+ );
279
+ f(e.nodes(), function(r) {
280
+ var t = e.node(r);
281
+ ve(t, "rank") && (t.rank -= n);
282
+ });
283
+ }
284
+ function Nn(e) {
285
+ var n = P(
286
+ w(e.nodes(), function(i) {
287
+ return e.node(i).rank;
288
+ })
289
+ ), r = [];
290
+ f(e.nodes(), function(i) {
291
+ var o = e.node(i).rank - n;
292
+ r[o] || (r[o] = []), r[o].push(i);
293
+ });
294
+ var t = 0, a = e.graph().nodeRankFactor;
295
+ f(r, function(i, o) {
296
+ m(i) && o % a !== 0 ? --t : t && f(i, function(u) {
297
+ e.node(u).rank += t;
298
+ });
299
+ });
300
+ }
301
+ function te(e, n, r, t) {
302
+ var a = {
303
+ width: 0,
304
+ height: 0
305
+ };
306
+ return arguments.length >= 4 && (a.rank = r, a.order = t), L(e, "border", a, n);
307
+ }
308
+ function me(e) {
309
+ return y(
310
+ w(e.nodes(), function(n) {
311
+ var r = e.node(n).rank;
312
+ if (!m(r))
313
+ return r;
314
+ })
315
+ );
316
+ }
317
+ function Pn(e, n) {
318
+ var r = { lhs: [], rhs: [] };
319
+ return f(e, function(t) {
320
+ n(t) ? r.lhs.push(t) : r.rhs.push(t);
321
+ }), r;
322
+ }
323
+ function _n(e, n) {
324
+ return n();
325
+ }
326
+ function Cn(e) {
327
+ function n(r) {
328
+ var t = e.children(r), a = e.node(r);
329
+ if (t.length && f(t, n), Object.prototype.hasOwnProperty.call(a, "minRank")) {
330
+ a.borderLeft = [], a.borderRight = [];
331
+ for (var i = a.minRank, o = a.maxRank + 1; i < o; ++i)
332
+ ae(e, "borderLeft", "_bl", r, a, i), ae(e, "borderRight", "_br", r, a, i);
333
+ }
334
+ }
335
+ f(e.children(), n);
336
+ }
337
+ function ae(e, n, r, t, a, i) {
338
+ var o = { width: 0, height: 0, rank: i, borderType: n }, u = a[n][i - 1], d = L(e, "border", o, r);
339
+ a[n][i] = d, e.setParent(d, t), u && e.setEdge(u, d, { weight: 1 });
340
+ }
341
+ function Rn(e) {
342
+ var n = e.graph().rankdir.toLowerCase();
343
+ (n === "lr" || n === "rl") && ge(e);
344
+ }
345
+ function Tn(e) {
346
+ var n = e.graph().rankdir.toLowerCase();
347
+ (n === "bt" || n === "rl") && Mn(e), (n === "lr" || n === "rl") && (In(e), ge(e));
348
+ }
349
+ function ge(e) {
350
+ f(e.nodes(), function(n) {
351
+ ie(e.node(n));
352
+ }), f(e.edges(), function(n) {
353
+ ie(e.edge(n));
354
+ });
355
+ }
356
+ function ie(e) {
357
+ var n = e.width;
358
+ e.width = e.height, e.height = n;
359
+ }
360
+ function Mn(e) {
361
+ f(e.nodes(), function(n) {
362
+ B(e.node(n));
363
+ }), f(e.edges(), function(n) {
364
+ var r = e.edge(n);
365
+ f(r.points, B), Object.prototype.hasOwnProperty.call(r, "y") && B(r);
366
+ });
367
+ }
368
+ function B(e) {
369
+ e.y = -e.y;
370
+ }
371
+ function In(e) {
372
+ f(e.nodes(), function(n) {
373
+ G(e.node(n));
374
+ }), f(e.edges(), function(n) {
375
+ var r = e.edge(n);
376
+ f(r.points, G), Object.prototype.hasOwnProperty.call(r, "x") && G(r);
377
+ });
378
+ }
379
+ function G(e) {
380
+ var n = e.x;
381
+ e.x = e.y, e.y = n;
382
+ }
383
+ function Sn(e) {
384
+ e.graph().dummyChains = [], f(e.edges(), function(n) {
385
+ jn(e, n);
386
+ });
387
+ }
388
+ function jn(e, n) {
389
+ var r = n.v, t = e.node(r).rank, a = n.w, i = e.node(a).rank, o = n.name, u = e.edge(n), d = u.labelRank;
390
+ if (i !== t + 1) {
391
+ e.removeEdge(n);
392
+ var s = void 0, c, l;
393
+ for (l = 0, ++t; t < i; ++l, ++t)
394
+ u.points = [], s = {
395
+ width: 0,
396
+ height: 0,
397
+ edgeLabel: u,
398
+ edgeObj: n,
399
+ rank: t
400
+ }, c = L(e, "edge", s, "_d"), t === d && (s.width = u.width, s.height = u.height, s.dummy = "edge-label", s.labelpos = u.labelpos), e.setEdge(r, c, { weight: u.weight }, o), l === 0 && e.graph().dummyChains.push(c), r = c;
401
+ e.setEdge(r, a, { weight: u.weight }, o);
402
+ }
403
+ }
404
+ function Fn(e) {
405
+ f(e.graph().dummyChains, function(n) {
406
+ var r = e.node(n), t = r.edgeLabel, a;
407
+ for (e.setEdge(r.edgeObj, t); r.dummy; )
408
+ a = e.successors(n)[0], e.removeNode(n), t.points.push({ x: r.x, y: r.y }), r.dummy === "edge-label" && (t.x = r.x, t.y = r.y, t.width = r.width, t.height = r.height), n = a, r = e.node(n);
409
+ });
410
+ }
411
+ function Z(e) {
412
+ var n = {};
413
+ function r(t) {
414
+ var a = e.node(t);
415
+ if (Object.prototype.hasOwnProperty.call(n, t))
416
+ return a.rank;
417
+ n[t] = !0;
418
+ var i = P(
419
+ w(e.outEdges(t), function(o) {
420
+ return r(o.w) - e.edge(o).minlen;
421
+ })
422
+ );
423
+ return (i === Number.POSITIVE_INFINITY || // return value of _.map([]) for Lodash 3
424
+ i === void 0 || // return value of _.map([]) for Lodash 4
425
+ i === null) && (i = 0), a.rank = i;
426
+ }
427
+ f(e.sources(), r);
428
+ }
429
+ function _(e, n) {
430
+ return e.node(n.w).rank - e.node(n.v).rank - e.edge(n).minlen;
431
+ }
432
+ function ye(e) {
433
+ var n = new g({ directed: !1 }), r = e.nodes()[0], t = e.nodeCount();
434
+ n.setNode(r, {});
435
+ for (var a, i; Vn(n, e) < t; )
436
+ a = An(n, e), i = n.hasNode(a.v) ? _(e, a) : -_(e, a), Bn(n, e, i);
437
+ return n;
438
+ }
439
+ function Vn(e, n) {
440
+ function r(t) {
441
+ f(n.nodeEdges(t), function(a) {
442
+ var i = a.v, o = t === i ? a.w : i;
443
+ !e.hasNode(o) && !_(n, a) && (e.setNode(o, {}), e.setEdge(t, o, {}), r(o));
444
+ });
445
+ }
446
+ return f(e.nodes(), r), e.nodeCount();
447
+ }
448
+ function An(e, n) {
449
+ return U(n.edges(), function(r) {
450
+ if (e.hasNode(r.v) !== e.hasNode(r.w))
451
+ return _(n, r);
452
+ });
453
+ }
454
+ function Bn(e, n, r) {
455
+ f(e.nodes(), function(t) {
456
+ n.node(t).rank += r;
457
+ });
458
+ }
459
+ function ke(e, n, r) {
460
+ we(n) || (n = [n]);
461
+ var t = (e.isDirected() ? e.successors : e.neighbors).bind(e), a = [], i = {};
462
+ return f(n, function(o) {
463
+ if (!e.hasNode(o))
464
+ throw new Error("Graph does not have node: " + o);
465
+ xe(e, o, r === "post", i, t, a);
466
+ }), a;
467
+ }
468
+ function xe(e, n, r, t, a, i) {
469
+ Object.prototype.hasOwnProperty.call(t, n) || (t[n] = !0, r || i.push(n), f(a(n), function(o) {
470
+ xe(e, o, r, t, a, i);
471
+ }), r && i.push(n));
472
+ }
473
+ function Gn(e, n) {
474
+ return ke(e, n, "post");
475
+ }
476
+ function Yn(e, n) {
477
+ return ke(e, n, "pre");
478
+ }
479
+ k.initLowLimValues = Q;
480
+ k.initCutValues = J;
481
+ k.calcCutValue = Ee;
482
+ k.leaveEdge = Le;
483
+ k.enterEdge = Ne;
484
+ k.exchangeEdges = Pe;
485
+ function k(e) {
486
+ e = On(e), Z(e);
487
+ var n = ye(e);
488
+ Q(n), J(n, e);
489
+ for (var r, t; r = Le(n); )
490
+ t = Ne(n, e, r), Pe(n, e, r, t);
491
+ }
492
+ function J(e, n) {
493
+ var r = Gn(e, e.nodes());
494
+ r = r.slice(0, r.length - 1), f(r, function(t) {
495
+ Dn(e, n, t);
496
+ });
497
+ }
498
+ function Dn(e, n, r) {
499
+ var t = e.node(r), a = t.parent;
500
+ e.edge(r, a).cutvalue = Ee(e, n, r);
501
+ }
502
+ function Ee(e, n, r) {
503
+ var t = e.node(r), a = t.parent, i = !0, o = n.edge(r, a), u = 0;
504
+ return o || (i = !1, o = n.edge(a, r)), u = o.weight, f(n.nodeEdges(r), function(d) {
505
+ var s = d.v === r, c = s ? d.w : d.v;
506
+ if (c !== a) {
507
+ var l = s === i, h = n.edge(d).weight;
508
+ if (u += l ? h : -h, qn(e, r, c)) {
509
+ var v = e.edge(r, c).cutvalue;
510
+ u += l ? -v : v;
511
+ }
512
+ }
513
+ }), u;
514
+ }
515
+ function Q(e, n) {
516
+ arguments.length < 2 && (n = e.nodes()[0]), Oe(e, {}, 1, n);
517
+ }
518
+ function Oe(e, n, r, t, a) {
519
+ var i = r, o = e.node(t);
520
+ return n[t] = !0, f(e.neighbors(t), function(u) {
521
+ Object.prototype.hasOwnProperty.call(n, u) || (r = Oe(e, n, r, u, t));
522
+ }), o.low = i, o.lim = r++, a ? o.parent = a : delete o.parent, r;
523
+ }
524
+ function Le(e) {
525
+ return z(e.edges(), function(n) {
526
+ return e.edge(n).cutvalue < 0;
527
+ });
528
+ }
529
+ function Ne(e, n, r) {
530
+ var t = r.v, a = r.w;
531
+ n.hasEdge(t, a) || (t = r.w, a = r.v);
532
+ var i = e.node(t), o = e.node(a), u = i, d = !1;
533
+ i.lim > o.lim && (u = o, d = !0);
534
+ var s = C(n.edges(), function(c) {
535
+ return d === oe(e, e.node(c.v), u) && d !== oe(e, e.node(c.w), u);
536
+ });
537
+ return U(s, function(c) {
538
+ return _(n, c);
539
+ });
540
+ }
541
+ function Pe(e, n, r, t) {
542
+ var a = r.v, i = r.w;
543
+ e.removeEdge(a, i), e.setEdge(t.v, t.w, {}), Q(e), J(e, n), $n(e, n);
544
+ }
545
+ function $n(e, n) {
546
+ var r = z(e.nodes(), function(a) {
547
+ return !n.node(a).parent;
548
+ }), t = Yn(e, r);
549
+ t = t.slice(1), f(t, function(a) {
550
+ var i = e.node(a).parent, o = n.edge(a, i), u = !1;
551
+ o || (o = n.edge(i, a), u = !0), n.node(a).rank = n.node(i).rank + (u ? o.minlen : -o.minlen);
552
+ });
553
+ }
554
+ function qn(e, n, r) {
555
+ return e.hasEdge(n, r);
556
+ }
557
+ function oe(e, n, r) {
558
+ return r.low <= n.lim && n.lim <= r.lim;
559
+ }
560
+ function Wn(e) {
561
+ switch (e.graph().ranker) {
562
+ case "network-simplex":
563
+ ue(e);
564
+ break;
565
+ case "tight-tree":
566
+ zn(e);
567
+ break;
568
+ case "longest-path":
569
+ Xn(e);
570
+ break;
571
+ default:
572
+ ue(e);
573
+ }
574
+ }
575
+ var Xn = Z;
576
+ function zn(e) {
577
+ Z(e), ye(e);
578
+ }
579
+ function ue(e) {
580
+ k(e);
581
+ }
582
+ function Un(e) {
583
+ var n = L(e, "root", {}, "_root"), r = Hn(e), t = y(x(r)) - 1, a = 2 * t + 1;
584
+ e.graph().nestingRoot = n, f(e.edges(), function(o) {
585
+ e.edge(o).minlen *= a;
586
+ });
587
+ var i = Zn(e) + 1;
588
+ f(e.children(), function(o) {
589
+ _e(e, n, a, i, t, r, o);
590
+ }), e.graph().nodeRankFactor = a;
591
+ }
592
+ function _e(e, n, r, t, a, i, o) {
593
+ var u = e.children(o);
594
+ if (!u.length) {
595
+ o !== n && e.setEdge(n, o, { weight: 0, minlen: r });
596
+ return;
597
+ }
598
+ var d = te(e, "_bt"), s = te(e, "_bb"), c = e.node(o);
599
+ e.setParent(d, o), c.borderTop = d, e.setParent(s, o), c.borderBottom = s, f(u, function(l) {
600
+ _e(e, n, r, t, a, i, l);
601
+ var h = e.node(l), v = h.borderTop ? h.borderTop : l, p = h.borderBottom ? h.borderBottom : l, b = h.borderTop ? t : 2 * t, N = v !== p ? 1 : a - i[o] + 1;
602
+ e.setEdge(d, v, {
603
+ weight: b,
604
+ minlen: N,
605
+ nestingEdge: !0
606
+ }), e.setEdge(p, s, {
607
+ weight: b,
608
+ minlen: N,
609
+ nestingEdge: !0
610
+ });
611
+ }), e.parent(o) || e.setEdge(n, d, { weight: 0, minlen: a + i[o] });
612
+ }
613
+ function Hn(e) {
614
+ var n = {};
615
+ function r(t, a) {
616
+ var i = e.children(t);
617
+ i && i.length && f(i, function(o) {
618
+ r(o, a + 1);
619
+ }), n[t] = a;
620
+ }
621
+ return f(e.children(), function(t) {
622
+ r(t, 1);
623
+ }), n;
624
+ }
625
+ function Zn(e) {
626
+ return I(
627
+ e.edges(),
628
+ function(n, r) {
629
+ return n + e.edge(r).weight;
630
+ },
631
+ 0
632
+ );
633
+ }
634
+ function Jn(e) {
635
+ var n = e.graph();
636
+ e.removeNode(n.nestingRoot), delete n.nestingRoot, f(e.edges(), function(r) {
637
+ var t = e.edge(r);
638
+ t.nestingEdge && e.removeEdge(r);
639
+ });
640
+ }
641
+ function Qn(e, n, r) {
642
+ var t = {}, a;
643
+ f(r, function(i) {
644
+ for (var o = e.parent(i), u, d; o; ) {
645
+ if (u = e.parent(o), u ? (d = t[u], t[u] = o) : (d = a, a = o), d && d !== o) {
646
+ n.setEdge(d, o);
647
+ return;
648
+ }
649
+ o = u;
650
+ }
651
+ });
652
+ }
653
+ function Kn(e, n, r) {
654
+ var t = er(e), a = new g({ compound: !0 }).setGraph({ root: t }).setDefaultNodeLabel(function(i) {
655
+ return e.node(i);
656
+ });
657
+ return f(e.nodes(), function(i) {
658
+ var o = e.node(i), u = e.parent(i);
659
+ (o.rank === n || o.minRank <= n && n <= o.maxRank) && (a.setNode(i), a.setParent(i, u || t), f(e[r](i), function(d) {
660
+ var s = d.v === i ? d.w : d.v, c = a.edge(s, i), l = m(c) ? 0 : c.weight;
661
+ a.setEdge(s, i, { weight: e.edge(d).weight + l });
662
+ }), Object.prototype.hasOwnProperty.call(o, "minRank") && a.setNode(i, {
663
+ borderLeft: o.borderLeft[n],
664
+ borderRight: o.borderRight[n]
665
+ }));
666
+ }), a;
667
+ }
668
+ function er(e) {
669
+ for (var n; e.hasNode(n = H("_root")); ) ;
670
+ return n;
671
+ }
672
+ function nr(e, n) {
673
+ for (var r = 0, t = 1; t < n.length; ++t)
674
+ r += rr(e, n[t - 1], n[t]);
675
+ return r;
676
+ }
677
+ function rr(e, n, r) {
678
+ for (var t = vn(
679
+ r,
680
+ w(r, function(s, c) {
681
+ return c;
682
+ })
683
+ ), a = O(
684
+ w(n, function(s) {
685
+ return R(
686
+ w(e.outEdges(s), function(c) {
687
+ return { pos: t[c.w], weight: e.edge(c).weight };
688
+ }),
689
+ "pos"
690
+ );
691
+ })
692
+ ), i = 1; i < r.length; ) i <<= 1;
693
+ var o = 2 * i - 1;
694
+ i -= 1;
695
+ var u = w(new Array(o), function() {
696
+ return 0;
697
+ }), d = 0;
698
+ return f(
699
+ // @ts-expect-error
700
+ a.forEach(function(s) {
701
+ var c = s.pos + i;
702
+ u[c] += s.weight;
703
+ for (var l = 0; c > 0; )
704
+ c % 2 && (l += u[c + 1]), c = c - 1 >> 1, u[c] += s.weight;
705
+ d += s.weight * l;
706
+ })
707
+ ), d;
708
+ }
709
+ function tr(e) {
710
+ var n = {}, r = C(e.nodes(), function(u) {
711
+ return !e.children(u).length;
712
+ }), t = y(
713
+ w(r, function(u) {
714
+ return e.node(u).rank;
715
+ })
716
+ ), a = w(E(t + 1), function() {
717
+ return [];
718
+ });
719
+ function i(u) {
720
+ if (!ve(n, u)) {
721
+ n[u] = !0;
722
+ var d = e.node(u);
723
+ a[d.rank].push(u), f(e.successors(u), i);
724
+ }
725
+ }
726
+ var o = R(r, function(u) {
727
+ return e.node(u).rank;
728
+ });
729
+ return f(o, i), a;
730
+ }
731
+ function ar(e, n) {
732
+ return w(n, function(r) {
733
+ var t = e.inEdges(r);
734
+ if (t.length) {
735
+ var a = I(
736
+ t,
737
+ function(i, o) {
738
+ var u = e.edge(o), d = e.node(o.v);
739
+ return {
740
+ sum: i.sum + u.weight * d.order,
741
+ weight: i.weight + u.weight
742
+ };
743
+ },
744
+ { sum: 0, weight: 0 }
745
+ );
746
+ return {
747
+ v: r,
748
+ barycenter: a.sum / a.weight,
749
+ weight: a.weight
750
+ };
751
+ } else
752
+ return { v: r };
753
+ });
754
+ }
755
+ function ir(e, n) {
756
+ var r = {};
757
+ f(e, function(a, i) {
758
+ var o = r[a.v] = {
759
+ indegree: 0,
760
+ in: [],
761
+ out: [],
762
+ vs: [a.v],
763
+ i
764
+ };
765
+ m(a.barycenter) || (o.barycenter = a.barycenter, o.weight = a.weight);
766
+ }), f(n.edges(), function(a) {
767
+ var i = r[a.v], o = r[a.w];
768
+ !m(i) && !m(o) && (o.indegree++, i.out.push(r[a.w]));
769
+ });
770
+ var t = C(r, function(a) {
771
+ return !a.indegree;
772
+ });
773
+ return or(t);
774
+ }
775
+ function or(e) {
776
+ var n = [];
777
+ function r(i) {
778
+ return function(o) {
779
+ o.merged || (m(o.barycenter) || m(i.barycenter) || o.barycenter >= i.barycenter) && ur(i, o);
780
+ };
781
+ }
782
+ function t(i) {
783
+ return function(o) {
784
+ o.in.push(i), --o.indegree === 0 && e.push(o);
785
+ };
786
+ }
787
+ for (; e.length; ) {
788
+ var a = e.pop();
789
+ n.push(a), f(a.in.reverse(), r(a)), f(a.out, t(a));
790
+ }
791
+ return w(
792
+ C(n, function(i) {
793
+ return !i.merged;
794
+ }),
795
+ function(i) {
796
+ return M(i, ["vs", "i", "barycenter", "weight"]);
797
+ }
798
+ );
799
+ }
800
+ function ur(e, n) {
801
+ var r = 0, t = 0;
802
+ e.weight && (r += e.barycenter * e.weight, t += e.weight), n.weight && (r += n.barycenter * n.weight, t += n.weight), e.vs = n.vs.concat(e.vs), e.barycenter = r / t, e.weight = t, e.i = Math.min(n.i, e.i), n.merged = !0;
803
+ }
804
+ function dr(e, n) {
805
+ var r = Pn(e, function(c) {
806
+ return Object.prototype.hasOwnProperty.call(c, "barycenter");
807
+ }), t = r.lhs, a = R(r.rhs, function(c) {
808
+ return -c.i;
809
+ }), i = [], o = 0, u = 0, d = 0;
810
+ t.sort(sr(!!n)), d = de(i, a, d), f(t, function(c) {
811
+ d += c.vs.length, i.push(c.vs), o += c.barycenter * c.weight, u += c.weight, d = de(i, a, d);
812
+ });
813
+ var s = { vs: O(i) };
814
+ return u && (s.barycenter = o / u, s.weight = u), s;
815
+ }
816
+ function de(e, n, r) {
817
+ for (var t; n.length && (t = T(n)).i <= r; )
818
+ n.pop(), e.push(t.vs), r++;
819
+ return r;
820
+ }
821
+ function sr(e) {
822
+ return function(n, r) {
823
+ return n.barycenter < r.barycenter ? -1 : n.barycenter > r.barycenter ? 1 : e ? r.i - n.i : n.i - r.i;
824
+ };
825
+ }
826
+ function Ce(e, n, r, t) {
827
+ var a = e.children(n), i = e.node(n), o = i ? i.borderLeft : void 0, u = i ? i.borderRight : void 0, d = {};
828
+ o && (a = C(a, function(p) {
829
+ return p !== o && p !== u;
830
+ }));
831
+ var s = ar(e, a);
832
+ f(s, function(p) {
833
+ if (e.children(p.v).length) {
834
+ var b = Ce(e, p.v, r, t);
835
+ d[p.v] = b, Object.prototype.hasOwnProperty.call(b, "barycenter") && cr(p, b);
836
+ }
837
+ });
838
+ var c = ir(s, r);
839
+ fr(c, d);
840
+ var l = dr(c, t);
841
+ if (o && (l.vs = O([o, l.vs, u]), e.predecessors(o).length)) {
842
+ var h = e.node(e.predecessors(o)[0]), v = e.node(e.predecessors(u)[0]);
843
+ Object.prototype.hasOwnProperty.call(l, "barycenter") || (l.barycenter = 0, l.weight = 0), l.barycenter = (l.barycenter * l.weight + h.order + v.order) / (l.weight + 2), l.weight += 2;
844
+ }
845
+ return l;
846
+ }
847
+ function fr(e, n) {
848
+ f(e, function(r) {
849
+ r.vs = O(
850
+ r.vs.map(function(t) {
851
+ return n[t] ? n[t].vs : t;
852
+ })
853
+ );
854
+ });
855
+ }
856
+ function cr(e, n) {
857
+ m(e.barycenter) ? (e.barycenter = n.barycenter, e.weight = n.weight) : (e.barycenter = (e.barycenter * e.weight + n.barycenter * n.weight) / (e.weight + n.weight), e.weight += n.weight);
858
+ }
859
+ function lr(e) {
860
+ var n = me(e), r = se(e, E(1, n + 1), "inEdges"), t = se(e, E(n - 1, -1, -1), "outEdges"), a = tr(e);
861
+ fe(e, a);
862
+ for (var i = Number.POSITIVE_INFINITY, o, u = 0, d = 0; d < 4; ++u, ++d) {
863
+ hr(u % 2 ? r : t, u % 4 >= 2), a = j(e);
864
+ var s = nr(e, a);
865
+ s < i && (d = 0, o = Qe(a), i = s);
866
+ }
867
+ fe(e, o);
868
+ }
869
+ function se(e, n, r) {
870
+ return w(n, function(t) {
871
+ return Kn(e, t, r);
872
+ });
873
+ }
874
+ function hr(e, n) {
875
+ var r = new g();
876
+ f(e, function(t) {
877
+ var a = t.graph().root, i = Ce(t, a, r, n);
878
+ f(i.vs, function(o, u) {
879
+ t.node(o).order = u;
880
+ }), Qn(t, r, i.vs);
881
+ });
882
+ }
883
+ function fe(e, n) {
884
+ f(n, function(r) {
885
+ f(r, function(t, a) {
886
+ e.node(t).order = a;
887
+ });
888
+ });
889
+ }
890
+ function vr(e) {
891
+ var n = wr(e);
892
+ f(e.graph().dummyChains, function(r) {
893
+ for (var t = e.node(r), a = t.edgeObj, i = pr(e, n, a.v, a.w), o = i.path, u = i.lca, d = 0, s = o[d], c = !0; r !== a.w; ) {
894
+ if (t = e.node(r), c) {
895
+ for (; (s = o[d]) !== u && e.node(s).maxRank < t.rank; )
896
+ d++;
897
+ s === u && (c = !1);
898
+ }
899
+ if (!c) {
900
+ for (; d < o.length - 1 && e.node(s = o[d + 1]).minRank <= t.rank; )
901
+ d++;
902
+ s = o[d];
903
+ }
904
+ e.setParent(r, s), r = e.successors(r)[0];
905
+ }
906
+ });
907
+ }
908
+ function pr(e, n, r, t) {
909
+ var a = [], i = [], o = Math.min(n[r].low, n[t].low), u = Math.max(n[r].lim, n[t].lim), d, s;
910
+ d = r;
911
+ do
912
+ d = e.parent(d), a.push(d);
913
+ while (d && (n[d].low > o || u > n[d].lim));
914
+ for (s = d, d = t; (d = e.parent(d)) !== s; )
915
+ i.push(d);
916
+ return { path: a.concat(i.reverse()), lca: s };
917
+ }
918
+ function wr(e) {
919
+ var n = {}, r = 0;
920
+ function t(a) {
921
+ var i = r;
922
+ f(e.children(a), t), n[a] = { low: i, lim: r++ };
923
+ }
924
+ return f(e.children(), t), n;
925
+ }
926
+ function br(e, n) {
927
+ var r = {};
928
+ function t(a, i) {
929
+ var o = 0, u = 0, d = a.length, s = T(i);
930
+ return f(i, function(c, l) {
931
+ var h = gr(e, c), v = h ? e.node(h).order : d;
932
+ (h || c === s) && (f(i.slice(u, l + 1), function(p) {
933
+ f(e.predecessors(p), function(b) {
934
+ var N = e.node(b), K = N.order;
935
+ (K < o || v < K) && !(N.dummy && e.node(p).dummy) && Re(r, b, p);
936
+ });
937
+ }), u = l + 1, o = v);
938
+ }), i;
939
+ }
940
+ return I(n, t), r;
941
+ }
942
+ function mr(e, n) {
943
+ var r = {};
944
+ function t(i, o, u, d, s) {
945
+ var c;
946
+ f(E(o, u), function(l) {
947
+ c = i[l], e.node(c).dummy && f(e.predecessors(c), function(h) {
948
+ var v = e.node(h);
949
+ v.dummy && (v.order < d || v.order > s) && Re(r, h, c);
950
+ });
951
+ });
952
+ }
953
+ function a(i, o) {
954
+ var u = -1, d, s = 0;
955
+ return f(o, function(c, l) {
956
+ if (e.node(c).dummy === "border") {
957
+ var h = e.predecessors(c);
958
+ h.length && (d = e.node(h[0]).order, t(o, s, l, u, d), s = l, u = d);
959
+ }
960
+ t(o, s, o.length, d, i.length);
961
+ }), o;
962
+ }
963
+ return I(n, a), r;
964
+ }
965
+ function gr(e, n) {
966
+ if (e.node(n).dummy)
967
+ return z(e.predecessors(n), function(r) {
968
+ return e.node(r).dummy;
969
+ });
970
+ }
971
+ function Re(e, n, r) {
972
+ if (n > r) {
973
+ var t = n;
974
+ n = r, r = t;
975
+ }
976
+ Object.prototype.hasOwnProperty.call(e, n) || Object.defineProperty(e, n, {
977
+ enumerable: !0,
978
+ configurable: !0,
979
+ value: {},
980
+ writable: !0
981
+ });
982
+ var a = e[n];
983
+ Object.defineProperty(a, r, {
984
+ enumerable: !0,
985
+ configurable: !0,
986
+ value: !0,
987
+ writable: !0
988
+ });
989
+ }
990
+ function yr(e, n, r) {
991
+ if (n > r) {
992
+ var t = n;
993
+ n = r, r = t;
994
+ }
995
+ return !!e[n] && Object.prototype.hasOwnProperty.call(e[n], r);
996
+ }
997
+ function kr(e, n, r, t) {
998
+ var a = {}, i = {}, o = {};
999
+ return f(n, function(u) {
1000
+ f(u, function(d, s) {
1001
+ a[d] = d, i[d] = d, o[d] = s;
1002
+ });
1003
+ }), f(n, function(u) {
1004
+ var d = -1;
1005
+ f(u, function(s) {
1006
+ var c = t(s);
1007
+ if (c.length) {
1008
+ c = R(c, function(b) {
1009
+ return o[b];
1010
+ });
1011
+ for (var l = (c.length - 1) / 2, h = Math.floor(l), v = Math.ceil(l); h <= v; ++h) {
1012
+ var p = c[h];
1013
+ i[s] === s && d < o[p] && !yr(r, s, p) && (i[p] = s, i[s] = a[s] = a[p], d = o[p]);
1014
+ }
1015
+ }
1016
+ });
1017
+ }), { root: a, align: i };
1018
+ }
1019
+ function xr(e, n, r, t, a) {
1020
+ var i = {}, o = Er(e, n, r, a), u = a ? "borderLeft" : "borderRight";
1021
+ function d(l, h) {
1022
+ for (var v = o.nodes(), p = v.pop(), b = {}; p; )
1023
+ b[p] ? l(p) : (b[p] = !0, v.push(p), v = v.concat(h(p))), p = v.pop();
1024
+ }
1025
+ function s(l) {
1026
+ i[l] = o.inEdges(l).reduce(function(h, v) {
1027
+ return Math.max(h, i[v.v] + o.edge(v));
1028
+ }, 0);
1029
+ }
1030
+ function c(l) {
1031
+ var h = o.outEdges(l).reduce(function(p, b) {
1032
+ return Math.min(p, i[b.w] - o.edge(b));
1033
+ }, Number.POSITIVE_INFINITY), v = e.node(l);
1034
+ h !== Number.POSITIVE_INFINITY && v.borderType !== u && (i[l] = Math.max(i[l], h));
1035
+ }
1036
+ return d(s, o.predecessors.bind(o)), d(c, o.successors.bind(o)), f(t, function(l) {
1037
+ i[l] = i[r[l]];
1038
+ }), i;
1039
+ }
1040
+ function Er(e, n, r, t) {
1041
+ var a = new g(), i = e.graph(), o = _r(i.nodesep, i.edgesep, t);
1042
+ return f(n, function(u) {
1043
+ var d;
1044
+ f(u, function(s) {
1045
+ var c = r[s];
1046
+ if (a.setNode(c), d) {
1047
+ var l = r[d], h = a.edge(l, c);
1048
+ a.setEdge(l, c, Math.max(o(e, s, d), h || 0));
1049
+ }
1050
+ d = s;
1051
+ });
1052
+ }), a;
1053
+ }
1054
+ function Or(e, n) {
1055
+ return U(x(n), function(r) {
1056
+ var t = Number.NEGATIVE_INFINITY, a = Number.POSITIVE_INFINITY;
1057
+ return Ke(r, function(i, o) {
1058
+ var u = Cr(e, o) / 2;
1059
+ t = Math.max(i + u, t), a = Math.min(i - u, a);
1060
+ }), t - a;
1061
+ });
1062
+ }
1063
+ function Lr(e, n) {
1064
+ var r = x(n), t = P(r), a = y(r);
1065
+ f(["u", "d"], function(i) {
1066
+ f(["l", "r"], function(o) {
1067
+ var u = i + o, d = e[u], s;
1068
+ if (d !== n) {
1069
+ var c = x(d);
1070
+ s = o === "l" ? t - P(c) : a - y(c), s && (e[u] = S(d, function(l) {
1071
+ return l + s;
1072
+ }));
1073
+ }
1074
+ });
1075
+ });
1076
+ }
1077
+ function Nr(e, n) {
1078
+ return S(e.ul, function(r, t) {
1079
+ if (n)
1080
+ return e[n.toLowerCase()][t];
1081
+ var a = R(w(e, t));
1082
+ return (a[1] + a[2]) / 2;
1083
+ });
1084
+ }
1085
+ function Pr(e) {
1086
+ var n = j(e), r = q(br(e, n), mr(e, n)), t = {}, a;
1087
+ f(["u", "d"], function(o) {
1088
+ a = o === "u" ? n : x(n).reverse(), f(["l", "r"], function(u) {
1089
+ u === "r" && (a = w(a, function(l) {
1090
+ return x(l).reverse();
1091
+ }));
1092
+ var d = (o === "u" ? e.predecessors : e.successors).bind(e), s = kr(e, a, r, d), c = xr(e, a, s.root, s.align, u === "r");
1093
+ u === "r" && (c = S(c, function(l) {
1094
+ return -l;
1095
+ })), t[o + u] = c;
1096
+ });
1097
+ });
1098
+ var i = Or(e, t);
1099
+ return Lr(t, i), Nr(t, e.graph().align);
1100
+ }
1101
+ function _r(e, n, r) {
1102
+ return function(t, a, i) {
1103
+ var o = t.node(a), u = t.node(i), d = 0, s;
1104
+ if (d += o.width / 2, Object.prototype.hasOwnProperty.call(o, "labelpos"))
1105
+ switch (o.labelpos.toLowerCase()) {
1106
+ case "l":
1107
+ s = -o.width / 2;
1108
+ break;
1109
+ case "r":
1110
+ s = o.width / 2;
1111
+ break;
1112
+ }
1113
+ if (s && (d += r ? s : -s), s = 0, d += (o.dummy ? n : e) / 2, d += (u.dummy ? n : e) / 2, d += u.width / 2, Object.prototype.hasOwnProperty.call(u, "labelpos"))
1114
+ switch (u.labelpos.toLowerCase()) {
1115
+ case "l":
1116
+ s = u.width / 2;
1117
+ break;
1118
+ case "r":
1119
+ s = -u.width / 2;
1120
+ break;
1121
+ }
1122
+ return s && (d += r ? s : -s), s = 0, d;
1123
+ };
1124
+ }
1125
+ function Cr(e, n) {
1126
+ return e.node(n).width;
1127
+ }
1128
+ function Rr(e) {
1129
+ e = be(e), Tr(e), en(Pr(e), function(n, r) {
1130
+ e.node(r).x = n;
1131
+ });
1132
+ }
1133
+ function Tr(e) {
1134
+ var n = j(e), r = e.graph().ranksep, t = 0;
1135
+ f(n, function(a) {
1136
+ var i = y(
1137
+ w(a, function(o) {
1138
+ return e.node(o).height;
1139
+ })
1140
+ );
1141
+ f(a, function(o) {
1142
+ e.node(o).y = t + i / 2;
1143
+ }), t += i + r;
1144
+ });
1145
+ }
1146
+ function it(e, n) {
1147
+ var r = _n;
1148
+ r("layout", () => {
1149
+ var t = r(" buildLayoutGraph", () => Dr(e));
1150
+ r(" runLayout", () => Mr(t, r)), r(" updateInputGraph", () => Ir(e, t));
1151
+ });
1152
+ }
1153
+ function Mr(e, n) {
1154
+ n(" makeSpaceForEdgeLabels", () => $r(e)), n(" removeSelfEdges", () => Qr(e)), n(" acyclic", () => kn(e)), n(" nestingGraph.run", () => Un(e)), n(" rank", () => Wn(be(e))), n(" injectEdgeLabelProxies", () => qr(e)), n(" removeEmptyRanks", () => Nn(e)), n(" nestingGraph.cleanup", () => Jn(e)), n(" normalizeRanks", () => Ln(e)), n(" assignRankMinMax", () => Wr(e)), n(" removeEdgeLabelProxies", () => Xr(e)), n(" normalize.run", () => Sn(e)), n(" parentDummyChains", () => vr(e)), n(" addBorderSegments", () => Cn(e)), n(" order", () => lr(e)), n(" insertSelfEdges", () => Kr(e)), n(" adjustCoordinateSystem", () => Rn(e)), n(" position", () => Rr(e)), n(" positionSelfEdges", () => et(e)), n(" removeBorderNodes", () => Jr(e)), n(" normalize.undo", () => Fn(e)), n(" fixupEdgeLabelCoords", () => Hr(e)), n(" undoCoordinateSystem", () => Tn(e)), n(" translateGraph", () => zr(e)), n(" assignNodeIntersects", () => Ur(e)), n(" reversePoints", () => Zr(e)), n(" acyclic.undo", () => En(e));
1155
+ }
1156
+ function Ir(e, n) {
1157
+ f(e.nodes(), function(r) {
1158
+ var t = e.node(r), a = n.node(r);
1159
+ t && (t.x = a.x, t.y = a.y, n.children(r).length && (t.width = a.width, t.height = a.height));
1160
+ }), f(e.edges(), function(r) {
1161
+ var t = e.edge(r), a = n.edge(r);
1162
+ t.points = a.points, Object.prototype.hasOwnProperty.call(a, "x") && (t.x = a.x, t.y = a.y);
1163
+ }), e.graph().width = n.graph().width, e.graph().height = n.graph().height;
1164
+ }
1165
+ var Sr = ["nodesep", "edgesep", "ranksep", "marginx", "marginy"], jr = { ranksep: 50, edgesep: 20, nodesep: 50, rankdir: "tb" }, Fr = ["acyclicer", "ranker", "rankdir", "align"], Vr = ["width", "height"], Ar = { width: 0, height: 0 }, Br = ["minlen", "weight", "width", "height", "labeloffset"], Gr = {
1166
+ minlen: 1,
1167
+ weight: 1,
1168
+ width: 0,
1169
+ height: 0,
1170
+ labeloffset: 10,
1171
+ labelpos: "r"
1172
+ }, Yr = ["labelpos"];
1173
+ function Dr(e) {
1174
+ var n = new g({ multigraph: !0, compound: !0 }), r = D(e.graph());
1175
+ return n.setGraph(
1176
+ q({}, jr, Y(r, Sr), M(r, Fr))
1177
+ ), f(e.nodes(), function(t) {
1178
+ var a = D(e.node(t));
1179
+ n.setNode(t, Be(Y(a, Vr), Ar)), n.setParent(t, e.parent(t));
1180
+ }), f(e.edges(), function(t) {
1181
+ var a = D(e.edge(t));
1182
+ n.setEdge(
1183
+ t,
1184
+ q({}, Gr, Y(a, Br), M(a, Yr))
1185
+ );
1186
+ }), n;
1187
+ }
1188
+ function $r(e) {
1189
+ var n = e.graph();
1190
+ n.ranksep /= 2, f(e.edges(), function(r) {
1191
+ var t = e.edge(r);
1192
+ t.minlen *= 2, t.labelpos.toLowerCase() !== "c" && (n.rankdir === "TB" || n.rankdir === "BT" ? t.width += t.labeloffset : t.height += t.labeloffset);
1193
+ });
1194
+ }
1195
+ function qr(e) {
1196
+ f(e.edges(), function(n) {
1197
+ var r = e.edge(n);
1198
+ if (r.width && r.height) {
1199
+ var t = e.node(n.v), a = e.node(n.w), i = { rank: (a.rank - t.rank) / 2 + t.rank, e: n };
1200
+ L(e, "edge-proxy", i, "_ep");
1201
+ }
1202
+ });
1203
+ }
1204
+ function Wr(e) {
1205
+ var n = 0;
1206
+ f(e.nodes(), function(r) {
1207
+ var t = e.node(r);
1208
+ t.borderTop && (t.minRank = e.node(t.borderTop).rank, t.maxRank = e.node(t.borderBottom).rank, n = y(n, t.maxRank));
1209
+ }), e.graph().maxRank = n;
1210
+ }
1211
+ function Xr(e) {
1212
+ f(e.nodes(), function(n) {
1213
+ var r = e.node(n);
1214
+ r.dummy === "edge-proxy" && (e.edge(r.e).labelRank = r.rank, e.removeNode(n));
1215
+ });
1216
+ }
1217
+ function zr(e) {
1218
+ var n = Number.POSITIVE_INFINITY, r = 0, t = Number.POSITIVE_INFINITY, a = 0, i = e.graph(), o = i.marginx || 0, u = i.marginy || 0;
1219
+ function d(s) {
1220
+ var c = s.x, l = s.y, h = s.width, v = s.height;
1221
+ n = Math.min(n, c - h / 2), r = Math.max(r, c + h / 2), t = Math.min(t, l - v / 2), a = Math.max(a, l + v / 2);
1222
+ }
1223
+ f(e.nodes(), function(s) {
1224
+ d(e.node(s));
1225
+ }), f(e.edges(), function(s) {
1226
+ var c = e.edge(s);
1227
+ Object.prototype.hasOwnProperty.call(c, "x") && d(c);
1228
+ }), n -= o, t -= u, f(e.nodes(), function(s) {
1229
+ var c = e.node(s);
1230
+ c.x -= n, c.y -= t;
1231
+ }), f(e.edges(), function(s) {
1232
+ var c = e.edge(s);
1233
+ f(c.points, function(l) {
1234
+ l.x -= n, l.y -= t;
1235
+ }), Object.prototype.hasOwnProperty.call(c, "x") && (c.x -= n), Object.prototype.hasOwnProperty.call(c, "y") && (c.y -= t);
1236
+ }), i.width = r - n + o, i.height = a - t + u;
1237
+ }
1238
+ function Ur(e) {
1239
+ f(e.edges(), function(n) {
1240
+ var r = e.edge(n), t = e.node(n.v), a = e.node(n.w), i, o;
1241
+ r.points ? (i = r.points[0], o = r.points[r.points.length - 1]) : (r.points = [], i = a, o = t), r.points.unshift(re(t, i)), r.points.push(re(a, o));
1242
+ });
1243
+ }
1244
+ function Hr(e) {
1245
+ f(e.edges(), function(n) {
1246
+ var r = e.edge(n);
1247
+ if (Object.prototype.hasOwnProperty.call(r, "x"))
1248
+ switch ((r.labelpos === "l" || r.labelpos === "r") && (r.width -= r.labeloffset), r.labelpos) {
1249
+ case "l":
1250
+ r.x -= r.width / 2 + r.labeloffset;
1251
+ break;
1252
+ case "r":
1253
+ r.x += r.width / 2 + r.labeloffset;
1254
+ break;
1255
+ }
1256
+ });
1257
+ }
1258
+ function Zr(e) {
1259
+ f(e.edges(), function(n) {
1260
+ var r = e.edge(n);
1261
+ r.reversed && r.points.reverse();
1262
+ });
1263
+ }
1264
+ function Jr(e) {
1265
+ f(e.nodes(), function(n) {
1266
+ if (e.children(n).length) {
1267
+ var r = e.node(n), t = e.node(r.borderTop), a = e.node(r.borderBottom), i = e.node(T(r.borderLeft)), o = e.node(T(r.borderRight));
1268
+ r.width = Math.abs(o.x - i.x), r.height = Math.abs(a.y - t.y), r.x = i.x + r.width / 2, r.y = t.y + r.height / 2;
1269
+ }
1270
+ }), f(e.nodes(), function(n) {
1271
+ e.node(n).dummy === "border" && e.removeNode(n);
1272
+ });
1273
+ }
1274
+ function Qr(e) {
1275
+ f(e.edges(), function(n) {
1276
+ if (n.v === n.w) {
1277
+ var r = e.node(n.v);
1278
+ r.selfEdges || (r.selfEdges = []), r.selfEdges.push({ e: n, label: e.edge(n) }), e.removeEdge(n);
1279
+ }
1280
+ });
1281
+ }
1282
+ function Kr(e) {
1283
+ var n = j(e);
1284
+ f(n, function(r) {
1285
+ var t = 0;
1286
+ f(r, function(a, i) {
1287
+ var o = e.node(a);
1288
+ o.order = i + t, f(o.selfEdges, function(u) {
1289
+ L(
1290
+ e,
1291
+ "selfedge",
1292
+ {
1293
+ width: u.label.width,
1294
+ height: u.label.height,
1295
+ rank: o.rank,
1296
+ order: i + ++t,
1297
+ e: u.e,
1298
+ label: u.label
1299
+ },
1300
+ "_se"
1301
+ );
1302
+ }), delete o.selfEdges;
1303
+ });
1304
+ });
1305
+ }
1306
+ function et(e) {
1307
+ f(e.nodes(), function(n) {
1308
+ var r = e.node(n);
1309
+ if (r.dummy === "selfedge") {
1310
+ var t = e.node(r.e.v), a = t.x + t.width / 2, i = t.y, o = r.x - a, u = t.height / 2;
1311
+ e.setEdge(r.e, r.label), e.removeNode(n), r.label.points = [
1312
+ { x: a + 2 * o / 3, y: i - u },
1313
+ { x: a + 5 * o / 6, y: i - u },
1314
+ { x: a + o, y: i },
1315
+ { x: a + 5 * o / 6, y: i + u },
1316
+ { x: a + 2 * o / 3, y: i + u }
1317
+ ], r.label.x = r.x, r.label.y = r.y;
1318
+ }
1319
+ });
1320
+ }
1321
+ function Y(e, n) {
1322
+ return S(M(e, n), Number);
1323
+ }
1324
+ function D(e) {
1325
+ var n = {};
1326
+ return f(e, function(r, t) {
1327
+ n[t.toLowerCase()] = r;
1328
+ }), n;
1329
+ }
1330
+ export {
1331
+ it as l
1332
+ };