@gobing-ai/spur 0.3.8 → 0.3.9

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 (123) hide show
  1. package/README.md +18 -2
  2. package/{spur-cli/config → config}/rules/boundary/sp-runtime-path.yaml +5 -0
  3. package/package.json +4 -3
  4. package/spur.js +30 -5
  5. package/web/_astro/BoardApp.Bcfvp2GH.js +1 -0
  6. package/web/_astro/BoardApp.DjpO2XHn.js +178 -0
  7. package/web/_astro/BoardApp.t7x-dYDo.css +1 -0
  8. package/web/_astro/TaskDetail.DilpuD7R.js +1 -0
  9. package/web/_astro/arc.KcqIior8.js +1 -0
  10. package/web/_astro/architectureDiagram-3BPJPVTR.BTFU70BY.js +36 -0
  11. package/web/_astro/blockDiagram-GPEHLZMM.apx49Oy9.js +132 -0
  12. package/web/_astro/c4Diagram-AAUBKEIU.BM-J4juX.js +10 -0
  13. package/web/_astro/channel.vSp82e1U.js +1 -0
  14. package/web/_astro/chunk-2J33WTMH.K6z7IYZU.js +1 -0
  15. package/web/_astro/chunk-4BX2VUAB.BDYhxKa0.js +1 -0
  16. package/web/_astro/chunk-55IACEB6.BnNOxqnI.js +1 -0
  17. package/web/_astro/chunk-727SXJPM.DNeg6N7v.js +206 -0
  18. package/web/_astro/chunk-AQP2D5EJ.BjILBkba.js +231 -0
  19. package/web/_astro/chunk-FMBD7UC4.DQ5UvvsV.js +15 -0
  20. package/web/_astro/chunk-ND2GUHAM.Yn1OvRJs.js +1 -0
  21. package/web/_astro/chunk-QZHKN3VN.UErqHgqw.js +1 -0
  22. package/web/_astro/classDiagram-4FO5ZUOK.BmjVF7iZ.js +1 -0
  23. package/web/_astro/classDiagram-v2-Q7XG4LA2.BmjVF7iZ.js +1 -0
  24. package/web/_astro/client.CdFpTatq.js +9 -0
  25. package/web/_astro/cose-bilkent-S5V4N54A.iKBxnkbb.js +1 -0
  26. package/web/_astro/cytoscape.esm.D3_iZ_3b.js +321 -0
  27. package/web/_astro/dagre-BM42HDAG.OwnCCrs6.js +4 -0
  28. package/web/_astro/defaultLocale.CrowFXzY.js +1 -0
  29. package/web/_astro/diagram-2AECGRRQ.DCdcffxE.js +43 -0
  30. package/web/_astro/diagram-5GNKFQAL.Ai-LvmVW.js +10 -0
  31. package/web/_astro/diagram-KO2AKTUF.B6e21QDN.js +3 -0
  32. package/web/_astro/diagram-LMA3HP47.oPfqy1fq.js +24 -0
  33. package/web/_astro/diagram-OG6HWLK6.Dh5QRDCE.js +24 -0
  34. package/web/_astro/erDiagram-TEJ5UH35.DpBiOcO3.js +85 -0
  35. package/web/_astro/flowDiagram-I6XJVG4X.NbMxFlVk.js +162 -0
  36. package/web/_astro/ganttDiagram-6RSMTGT7.JgZ3fDME.js +292 -0
  37. package/web/_astro/gitGraphDiagram-PVQCEYII.oMjFeZRt.js +106 -0
  38. package/web/_astro/graph.D2o_JWn5.js +1 -0
  39. package/web/_astro/index.A0eX93qW.js +1 -0
  40. package/web/_astro/index.CA3GTZM6.css +1 -0
  41. package/web/_astro/infoDiagram-5YYISTIA.kaio3YzK.js +2 -0
  42. package/web/_astro/init.Gi6I4Gst.js +1 -0
  43. package/web/_astro/ishikawaDiagram-YF4QCWOH.CXQfMyeF.js +70 -0
  44. package/web/_astro/journeyDiagram-JHISSGLW.AvNKMzx6.js +139 -0
  45. package/web/_astro/kanban-definition-UN3LZRKU.kv3cZGdE.js +89 -0
  46. package/web/_astro/katex.HP8lGamR.js +257 -0
  47. package/web/_astro/layout.DNLMvjEt.js +1 -0
  48. package/web/_astro/linear.CfLoHWjz.js +1 -0
  49. package/web/_astro/mermaid.core.BSV8pBn-.js +301 -0
  50. package/web/_astro/mindmap-definition-RKZ34NQL.CbL_3b32.js +96 -0
  51. package/web/_astro/ordinal.BYWQX77i.js +1 -0
  52. package/web/_astro/pieDiagram-4H26LBE5.5BXdOLRb.js +30 -0
  53. package/web/_astro/quadrantDiagram-W4KKPZXB.krXYbhlh.js +7 -0
  54. package/web/_astro/requirementDiagram-4Y6WPE33.COO4LapZ.js +84 -0
  55. package/web/_astro/sankeyDiagram-5OEKKPKP.BvL0Jbdx.js +40 -0
  56. package/web/_astro/sequenceDiagram-3UESZ5HK.Dk7Tu15E.js +162 -0
  57. package/web/_astro/stateDiagram-AJRCARHV.Cqh_KmEW.js +1 -0
  58. package/web/_astro/stateDiagram-v2-BHNVJYJU.WapPgDCy.js +1 -0
  59. package/web/_astro/timeline-definition-PNZ67QCA.CEVdiX0n.js +120 -0
  60. package/web/_astro/vennDiagram-CIIHVFJN.Cd9A63eF.js +34 -0
  61. package/web/_astro/wardley-L42UT6IY.DEiaHiIT.js +161 -0
  62. package/web/_astro/wardleyDiagram-YWT4CUSO.B7nGP61E.js +78 -0
  63. package/web/_astro/xychartDiagram-2RQKCTM6.Bq8CHmxC.js +7 -0
  64. package/web/favicon.svg +4 -0
  65. package/web/index.html +2 -0
  66. /package/{spur-cli/config → config}/config.example.yaml +0 -0
  67. /package/{spur-cli/config → config}/plugins/.gitkeep +0 -0
  68. /package/{spur-cli/config → config}/rules/README.md +0 -0
  69. /package/{spur-cli/config → config}/rules/boundary/config-loading-ownership.yaml +0 -0
  70. /package/{spur-cli/config → config}/rules/boundary/dao-boundary.yaml +0 -0
  71. /package/{spur-cli/config → config}/rules/boundary/planning-folder-hardcode.yaml +0 -0
  72. /package/{spur-cli/config → config}/rules/boundary/sp-no-vendor-refs.yaml +0 -0
  73. /package/{spur-cli/config → config}/rules/migration/rg-dialect.yaml +0 -0
  74. /package/{spur-cli/config → config}/rules/quality/coverage-gate.yaml +0 -0
  75. /package/{spur-cli/config → config}/rules/quality/tsdoc-exports.yaml +0 -0
  76. /package/{spur-cli/config → config}/rules/recommended-post-check.yaml +0 -0
  77. /package/{spur-cli/config → config}/rules/recommended-pre-check.yaml +0 -0
  78. /package/{spur-cli/config → config}/rules/rg-migration.yaml +0 -0
  79. /package/{spur-cli/config → config}/rules/strict/http-boundaries.yaml +0 -0
  80. /package/{spur-cli/config → config}/rules/strict/rule-files-structural.yaml +0 -0
  81. /package/{spur-cli/config → config}/rules/strict/runtime-boundaries.yaml +0 -0
  82. /package/{spur-cli/config → config}/rules/strict-check.yaml +0 -0
  83. /package/{spur-cli/config → config}/rules/structure/protected-files.yaml +0 -0
  84. /package/{spur-cli/config → config}/rules/structure/test-focus-skip.yaml +0 -0
  85. /package/{spur-cli/config → config}/rules/structure/test-location.yaml +0 -0
  86. /package/{spur-cli/config → config}/rules/surface/check-cli-surface.yaml +0 -0
  87. /package/{spur-cli/config → config}/rules/typescript/bun-tooling.yaml +0 -0
  88. /package/{spur-cli/config → config}/rules/typescript/guarded-happy-dom-register.yaml +0 -0
  89. /package/{spur-cli/config → config}/rules/typescript/happy-dom-teardown.yaml +0 -0
  90. /package/{spur-cli/config → config}/rules/typescript/no-biome-suppressions.yaml +0 -0
  91. /package/{spur-cli/config → config}/rules/typescript/no-debugger.yaml +0 -0
  92. /package/{spur-cli/config → config}/rules/typescript/no-leaky-module-mocks.yaml +0 -0
  93. /package/{spur-cli/config → config}/rules/typescript/no-module-scope-import-calls.yaml +0 -0
  94. /package/{spur-cli/config → config}/rules/typescript/no-unmocked-module-eval-side-effects.yaml +0 -0
  95. /package/{spur-cli/config → config}/rules/typescript/output-boundaries.yaml +0 -0
  96. /package/{spur-cli/config → config}/rules/ui/ui-import-boundary.yaml +0 -0
  97. /package/{spur-cli/config → config}/tasks/section-matrix.yaml +0 -0
  98. /package/{spur-cli/config → config}/templates/AGENTS.md +0 -0
  99. /package/{spur-cli/config → config}/templates/bdd/checklist.md +0 -0
  100. /package/{spur-cli/config → config}/templates/bdd/gherkin.md +0 -0
  101. /package/{spur-cli/config → config}/templates/docs/00_ADR.md +0 -0
  102. /package/{spur-cli/config → config}/templates/docs/01_PRD.md +0 -0
  103. /package/{spur-cli/config → config}/templates/docs/02_ROADMAP.md +0 -0
  104. /package/{spur-cli/config → config}/templates/docs/03_ARCHITECTURE.md +0 -0
  105. /package/{spur-cli/config → config}/templates/docs/04_DESIGN.md +0 -0
  106. /package/{spur-cli/config → config}/templates/docs/05_FEATURES.md +0 -0
  107. /package/{spur-cli/config → config}/templates/docs/99_PROJECT_CONSTITUTION.md +0 -0
  108. /package/{spur-cli/config → config}/templates/feature/default.md +0 -0
  109. /package/{spur-cli/config → config}/templates/task/brainstorm.md +0 -0
  110. /package/{spur-cli/config → config}/templates/task/feature-impl.md +0 -0
  111. /package/{spur-cli/config → config}/templates/task/issue.md +0 -0
  112. /package/{spur-cli/config → config}/templates/task/meta.md +0 -0
  113. /package/{spur-cli/config → config}/templates/task/review.md +0 -0
  114. /package/{spur-cli/config → config}/templates/task/standard.md +0 -0
  115. /package/{spur-cli/config → config}/workflows/basic.yaml +0 -0
  116. /package/{spur-cli/config → config}/workflows/docs-pipeline.yaml +0 -0
  117. /package/{spur-cli/config → config}/workflows/feature-dev.yaml +0 -0
  118. /package/{spur-cli/config → config}/workflows/feature-lifecycle.yaml +0 -0
  119. /package/{spur-cli/config → config}/workflows/idea-pipeline.yaml +0 -0
  120. /package/{spur-cli/config → config}/workflows/planning-pipeline.yaml +0 -0
  121. /package/{spur-cli/config → config}/workflows/task-lifecycle.yaml +0 -0
  122. /package/{spur-cli/config → config}/workflows/task-pipeline.yaml +0 -0
  123. /package/{spur-cli/config → config}/workflows/wrapup-pipeline.yaml +0 -0
@@ -0,0 +1 @@
1
+ @media(prefers-color-scheme:dark){.wmde-markdown,.wmde-markdown-var{color-scheme:dark;--color-prettylights-syntax-comment: #8b949e;--color-prettylights-syntax-constant: #79c0ff;--color-prettylights-syntax-entity: #d2a8ff;--color-prettylights-syntax-storage-modifier-import: #c9d1d9;--color-prettylights-syntax-entity-tag: #7ee787;--color-prettylights-syntax-keyword: #ff7b72;--color-prettylights-syntax-string: #a5d6ff;--color-prettylights-syntax-variable: #ffa657;--color-prettylights-syntax-brackethighlighter-unmatched: #f85149;--color-prettylights-syntax-invalid-illegal-text: #f0f6fc;--color-prettylights-syntax-invalid-illegal-bg: #8e1519;--color-prettylights-syntax-carriage-return-text: #f0f6fc;--color-prettylights-syntax-carriage-return-bg: #b62324;--color-prettylights-syntax-string-regexp: #7ee787;--color-prettylights-syntax-markup-list: #f2cc60;--color-prettylights-syntax-markup-heading: #1f6feb;--color-prettylights-syntax-markup-italic: #c9d1d9;--color-prettylights-syntax-markup-bold: #c9d1d9;--color-prettylights-syntax-markup-deleted-text: #ffdcd7;--color-prettylights-syntax-markup-deleted-bg: #67060c;--color-prettylights-syntax-markup-inserted-text: #aff5b4;--color-prettylights-syntax-markup-inserted-bg: #033a16;--color-prettylights-syntax-markup-changed-text: #ffdfb6;--color-prettylights-syntax-markup-changed-bg: #5a1e02;--color-prettylights-syntax-markup-ignored-text: #c9d1d9;--color-prettylights-syntax-markup-ignored-bg: #1158c7;--color-prettylights-syntax-meta-diff-range: #d2a8ff;--color-prettylights-syntax-brackethighlighter-angle: #8b949e;--color-prettylights-syntax-sublimelinter-gutter-mark: #484f58;--color-prettylights-syntax-constant-other-reference-link: #a5d6ff;--color-fg-default: #c9d1d9;--color-fg-muted: #8b949e;--color-fg-subtle: #484f58;--color-canvas-default: #0d1117;--color-canvas-subtle: #161b22;--color-border-default: #30363d;--color-border-muted: #21262d;--color-neutral-muted: rgba(110, 118, 129, .4);--color-accent-fg: #58a6ff;--color-accent-emphasis: #1f6feb;--color-attention-subtle: rgba(187, 128, 9, .15);--color-danger-fg: #f85149;--color-danger-emphasis: #da3633;--color-attention-fg: #d29922;--color-attention-emphasis: #9e6a03;--color-done-fg: #a371f7;--color-done-emphasis: #8957e5;--color-success-fg: #3fb950;--color-success-emphasis: #238636;--color-copied-active-bg: #2e9b33}}@media(prefers-color-scheme:light){.wmde-markdown,.wmde-markdown-var{color-scheme:light;--color-prettylights-syntax-comment: #6e7781;--color-prettylights-syntax-constant: #0550ae;--color-prettylights-syntax-entity: #8250df;--color-prettylights-syntax-storage-modifier-import: #24292f;--color-prettylights-syntax-entity-tag: #116329;--color-prettylights-syntax-keyword: #cf222e;--color-prettylights-syntax-string: #0a3069;--color-prettylights-syntax-variable: #953800;--color-prettylights-syntax-brackethighlighter-unmatched: #82071e;--color-prettylights-syntax-invalid-illegal-text: #f6f8fa;--color-prettylights-syntax-invalid-illegal-bg: #82071e;--color-prettylights-syntax-carriage-return-text: #f6f8fa;--color-prettylights-syntax-carriage-return-bg: #cf222e;--color-prettylights-syntax-string-regexp: #116329;--color-prettylights-syntax-markup-list: #3b2300;--color-prettylights-syntax-markup-heading: #0550ae;--color-prettylights-syntax-markup-italic: #24292f;--color-prettylights-syntax-markup-bold: #24292f;--color-prettylights-syntax-markup-deleted-text: #82071e;--color-prettylights-syntax-markup-deleted-bg: #ffebe9;--color-prettylights-syntax-markup-inserted-text: #116329;--color-prettylights-syntax-markup-inserted-bg: #dafbe1;--color-prettylights-syntax-markup-changed-text: #953800;--color-prettylights-syntax-markup-changed-bg: #ffd8b5;--color-prettylights-syntax-markup-ignored-text: #eaeef2;--color-prettylights-syntax-markup-ignored-bg: #0550ae;--color-prettylights-syntax-meta-diff-range: #8250df;--color-prettylights-syntax-brackethighlighter-angle: #57606a;--color-prettylights-syntax-sublimelinter-gutter-mark: #8c959f;--color-prettylights-syntax-constant-other-reference-link: #0a3069;--color-fg-default: #24292f;--color-fg-muted: #57606a;--color-fg-subtle: #6e7781;--color-canvas-default: #ffffff;--color-canvas-subtle: #f6f8fa;--color-border-default: #d0d7de;--color-border-muted: hsl(210, 18%, 87%);--color-neutral-muted: rgba(175, 184, 193, .2);--color-accent-fg: #0969da;--color-accent-emphasis: #0969da;--color-attention-subtle: #fff8c5;--color-danger-fg: #d1242f;--color-danger-emphasis: #cf222e;--color-attention-fg: #9a6700;--color-attention-emphasis: #9a6700;--color-done-fg: #8250df;--color-done-emphasis: #8250df;--color-success-fg: #1a7f37;--color-success-emphasis: #1f883d;--color-copied-active-bg: #2e9b33}}[data-color-mode*=dark] .wmde-markdown,[data-color-mode*=dark] .wmde-markdown-var,.wmde-markdown-var[data-color-mode*=dark],.wmde-markdown[data-color-mode*=dark],body[data-color-mode*=dark]{color-scheme:dark;--color-prettylights-syntax-comment: #8b949e;--color-prettylights-syntax-constant: #79c0ff;--color-prettylights-syntax-entity: #d2a8ff;--color-prettylights-syntax-storage-modifier-import: #c9d1d9;--color-prettylights-syntax-entity-tag: #7ee787;--color-prettylights-syntax-keyword: #ff7b72;--color-prettylights-syntax-string: #a5d6ff;--color-prettylights-syntax-variable: #ffa657;--color-prettylights-syntax-brackethighlighter-unmatched: #f85149;--color-prettylights-syntax-invalid-illegal-text: #f0f6fc;--color-prettylights-syntax-invalid-illegal-bg: #8e1519;--color-prettylights-syntax-carriage-return-text: #f0f6fc;--color-prettylights-syntax-carriage-return-bg: #b62324;--color-prettylights-syntax-string-regexp: #7ee787;--color-prettylights-syntax-markup-list: #f2cc60;--color-prettylights-syntax-markup-heading: #1f6feb;--color-prettylights-syntax-markup-italic: #c9d1d9;--color-prettylights-syntax-markup-bold: #c9d1d9;--color-prettylights-syntax-markup-deleted-text: #ffdcd7;--color-prettylights-syntax-markup-deleted-bg: #67060c;--color-prettylights-syntax-markup-inserted-text: #aff5b4;--color-prettylights-syntax-markup-inserted-bg: #033a16;--color-prettylights-syntax-markup-changed-text: #ffdfb6;--color-prettylights-syntax-markup-changed-bg: #5a1e02;--color-prettylights-syntax-markup-ignored-text: #c9d1d9;--color-prettylights-syntax-markup-ignored-bg: #1158c7;--color-prettylights-syntax-meta-diff-range: #d2a8ff;--color-prettylights-syntax-brackethighlighter-angle: #8b949e;--color-prettylights-syntax-sublimelinter-gutter-mark: #484f58;--color-prettylights-syntax-constant-other-reference-link: #a5d6ff;--color-fg-default: #c9d1d9;--color-fg-muted: #8b949e;--color-fg-subtle: #484f58;--color-canvas-default: #0d1117;--color-canvas-subtle: #161b22;--color-border-default: #30363d;--color-border-muted: #21262d;--color-neutral-muted: rgba(110, 118, 129, .4);--color-accent-fg: #58a6ff;--color-accent-emphasis: #1f6feb;--color-attention-subtle: rgba(187, 128, 9, .15);--color-danger-fg: #f85149}[data-color-mode*=light] .wmde-markdown,[data-color-mode*=light] .wmde-markdown-var,.wmde-markdown-var[data-color-mode*=light],.wmde-markdown[data-color-mode*=light],body[data-color-mode*=light]{color-scheme:light;--color-prettylights-syntax-comment: #6e7781;--color-prettylights-syntax-constant: #0550ae;--color-prettylights-syntax-entity: #8250df;--color-prettylights-syntax-storage-modifier-import: #24292f;--color-prettylights-syntax-entity-tag: #116329;--color-prettylights-syntax-keyword: #cf222e;--color-prettylights-syntax-string: #0a3069;--color-prettylights-syntax-variable: #953800;--color-prettylights-syntax-brackethighlighter-unmatched: #82071e;--color-prettylights-syntax-invalid-illegal-text: #f6f8fa;--color-prettylights-syntax-invalid-illegal-bg: #82071e;--color-prettylights-syntax-carriage-return-text: #f6f8fa;--color-prettylights-syntax-carriage-return-bg: #cf222e;--color-prettylights-syntax-string-regexp: #116329;--color-prettylights-syntax-markup-list: #3b2300;--color-prettylights-syntax-markup-heading: #0550ae;--color-prettylights-syntax-markup-italic: #24292f;--color-prettylights-syntax-markup-bold: #24292f;--color-prettylights-syntax-markup-deleted-text: #82071e;--color-prettylights-syntax-markup-deleted-bg: #ffebe9;--color-prettylights-syntax-markup-inserted-text: #116329;--color-prettylights-syntax-markup-inserted-bg: #dafbe1;--color-prettylights-syntax-markup-changed-text: #953800;--color-prettylights-syntax-markup-changed-bg: #ffd8b5;--color-prettylights-syntax-markup-ignored-text: #eaeef2;--color-prettylights-syntax-markup-ignored-bg: #0550ae;--color-prettylights-syntax-meta-diff-range: #8250df;--color-prettylights-syntax-brackethighlighter-angle: #57606a;--color-prettylights-syntax-sublimelinter-gutter-mark: #8c959f;--color-prettylights-syntax-constant-other-reference-link: #0a3069;--color-fg-default: #24292f;--color-fg-muted: #57606a;--color-fg-subtle: #6e7781;--color-canvas-default: #ffffff;--color-canvas-subtle: #f6f8fa;--color-border-default: #d0d7de;--color-border-muted: hsl(210, 18%, 87%);--color-neutral-muted: rgba(175, 184, 193, .2);--color-accent-fg: #0969da;--color-accent-emphasis: #0969da;--color-attention-subtle: #fff8c5;--color-danger-fg: #cf222e}.wmde-markdown{-webkit-text-size-adjust:100%;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Noto Sans,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:16px;line-height:1.5;word-wrap:break-word;color:var(--color-fg-default);background-color:var(--color-canvas-default)}.wmde-markdown details,.wmde-markdown figcaption,.wmde-markdown figure{display:block}.wmde-markdown summary{display:list-item}.wmde-markdown [hidden]{display:none!important}.wmde-markdown a{background-color:transparent;color:var(--color-accent-fg);text-decoration:none}.wmde-markdown a:active,.wmde-markdown a:hover{outline-width:0}.wmde-markdown abbr[title]{border-bottom:none;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.wmde-markdown b,.wmde-markdown strong{font-weight:600}.wmde-markdown dfn{font-style:italic}.wmde-markdown h1{margin:.67em 0;font-weight:600;padding-bottom:.3em;font-size:2em;border-bottom:1px solid var(--color-border-muted)}.wmde-markdown mark{background-color:var(--color-attention-subtle);color:var(--color-text-primary)}.wmde-markdown small{font-size:90%}.wmde-markdown sub,.wmde-markdown sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}.wmde-markdown sub{bottom:-.25em}.wmde-markdown sup{top:-.5em}.wmde-markdown img{display:inline-block;border-style:none;max-width:100%;box-sizing:content-box;background-color:var(--color-canvas-default)}.wmde-markdown code,.wmde-markdown kbd,.wmde-markdown pre,.wmde-markdown samp{font-family:monospace,monospace;font-size:1em}.wmde-markdown figure{margin:1em 40px}.wmde-markdown hr{box-sizing:content-box;overflow:hidden;background:transparent;border:0;border-bottom:1px solid var(--color-border-muted);height:.25em;padding:0;margin:24px 0;background-color:var(--color-border-default)}.wmde-markdown input{font:inherit;margin:0;overflow:visible;font-family:inherit;font-size:inherit;line-height:inherit}.wmde-markdown [type=button],.wmde-markdown [type=reset],.wmde-markdown [type=submit]{-webkit-appearance:button}.wmde-markdown [type=button]::-moz-focus-inner,.wmde-markdown [type=reset]::-moz-focus-inner,.wmde-markdown [type=submit]::-moz-focus-inner{border-style:none;padding:0}.wmde-markdown [type=button]:-moz-focusring,.wmde-markdown [type=reset]:-moz-focusring,.wmde-markdown [type=submit]:-moz-focusring{outline:1px dotted ButtonText}.wmde-markdown [type=checkbox],.wmde-markdown [type=radio]{box-sizing:border-box;padding:0}.wmde-markdown [type=number]::-webkit-inner-spin-button,.wmde-markdown [type=number]::-webkit-outer-spin-button{height:auto}.wmde-markdown [type=search]{-webkit-appearance:textfield;outline-offset:-2px}.wmde-markdown [type=search]::-webkit-search-cancel-button,.wmde-markdown [type=search]::-webkit-search-decoration{-webkit-appearance:none}.wmde-markdown ::-webkit-input-placeholder{color:inherit;opacity:.54}.wmde-markdown ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}.wmde-markdown a:hover{text-decoration:underline}.wmde-markdown hr:before{display:table;content:""}.wmde-markdown hr:after{display:table;clear:both;content:""}.wmde-markdown table{border-spacing:0;border-collapse:collapse;display:block;width:-webkit-max-content;width:max-content;max-width:100%}.wmde-markdown td,.wmde-markdown th{padding:0}.wmde-markdown details summary{cursor:pointer}.wmde-markdown details:not([open])>*:not(summary){display:none!important}.wmde-markdown kbd{display:inline-block;padding:3px 5px;font:11px ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;line-height:10px;color:var(--color-fg-default);vertical-align:middle;background-color:var(--color-canvas-subtle);border:solid 1px var(--color-neutral-muted);border-bottom-color:var(--color-neutral-muted);border-radius:6px;box-shadow:inset 0 -1px 0 var(--color-neutral-muted)}.wmde-markdown h1,.wmde-markdown h2,.wmde-markdown h3,.wmde-markdown h4,.wmde-markdown h5,.wmde-markdown h6{margin-top:24px;margin-bottom:16px;font-weight:600;line-height:1.25}.wmde-markdown h2{font-weight:600;padding-bottom:.3em;font-size:1.5em;border-bottom:1px solid var(--color-border-muted)}.wmde-markdown h3{font-weight:600;font-size:1.25em}.wmde-markdown h4{font-weight:600;font-size:1em}.wmde-markdown h5{font-weight:600;font-size:.875em}.wmde-markdown h6{font-weight:600;font-size:.85em;color:var(--color-fg-muted)}.wmde-markdown p{margin-top:0;margin-bottom:10px}.wmde-markdown blockquote{margin:0;padding:0 1em;color:var(--color-fg-muted);border-left:.25em solid var(--color-border-default)}.wmde-markdown ul,.wmde-markdown ol{margin-top:0;margin-bottom:0;padding-left:2em}.wmde-markdown ol ol,.wmde-markdown ul ol{list-style-type:lower-roman}.wmde-markdown ul ul ol,.wmde-markdown ul ol ol,.wmde-markdown ol ul ol,.wmde-markdown ol ol ol{list-style-type:lower-alpha}.wmde-markdown dd{margin-left:0}.wmde-markdown tt,.wmde-markdown code{font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;font-size:12px}.wmde-markdown pre{margin-top:0;margin-bottom:0;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;font-size:12px;word-wrap:normal}.wmde-markdown .octicon{display:inline-block;overflow:visible!important;vertical-align:text-bottom;fill:currentColor}.wmde-markdown ::placeholder{color:var(--color-fg-subtle);opacity:1}.wmde-markdown input::-webkit-outer-spin-button,.wmde-markdown input::-webkit-inner-spin-button{margin:0;-webkit-appearance:none;appearance:none}.wmde-markdown [data-catalyst]{display:block}.wmde-markdown:before{display:table;content:""}.wmde-markdown:after{display:table;clear:both;content:""}.wmde-markdown>*:first-child{margin-top:0!important}.wmde-markdown>*:last-child{margin-bottom:0!important}.wmde-markdown a:not([href]){color:inherit;text-decoration:none}.wmde-markdown .absent{color:var(--color-danger-fg)}.wmde-markdown a.anchor{float:left;padding-right:4px;margin-left:-20px;line-height:1}.wmde-markdown .anchor:focus{outline:none}.wmde-markdown p,.wmde-markdown blockquote,.wmde-markdown ul,.wmde-markdown ol,.wmde-markdown dl,.wmde-markdown table,.wmde-markdown pre,.wmde-markdown details{margin-top:0;margin-bottom:16px}.wmde-markdown blockquote>:first-child{margin-top:0}.wmde-markdown blockquote>:last-child{margin-bottom:0}.wmde-markdown sup>a:before{content:"["}.wmde-markdown sup>a:after{content:"]"}.wmde-markdown h1 .octicon-link,.wmde-markdown h2 .octicon-link,.wmde-markdown h3 .octicon-link,.wmde-markdown h4 .octicon-link,.wmde-markdown h5 .octicon-link,.wmde-markdown h6 .octicon-link{color:var(--color-fg-default);vertical-align:middle;visibility:hidden}.wmde-markdown h1:hover .anchor,.wmde-markdown h2:hover .anchor,.wmde-markdown h3:hover .anchor,.wmde-markdown h4:hover .anchor,.wmde-markdown h5:hover .anchor,.wmde-markdown h6:hover .anchor{text-decoration:none}.wmde-markdown h1:hover .anchor .octicon-link,.wmde-markdown h2:hover .anchor .octicon-link,.wmde-markdown h3:hover .anchor .octicon-link,.wmde-markdown h4:hover .anchor .octicon-link,.wmde-markdown h5:hover .anchor .octicon-link,.wmde-markdown h6:hover .anchor .octicon-link{visibility:visible}.wmde-markdown h1 tt,.wmde-markdown h1 code,.wmde-markdown h2 tt,.wmde-markdown h2 code,.wmde-markdown h3 tt,.wmde-markdown h3 code,.wmde-markdown h4 tt,.wmde-markdown h4 code,.wmde-markdown h5 tt,.wmde-markdown h5 code,.wmde-markdown h6 tt,.wmde-markdown h6 code{padding:0 .2em;font-size:inherit}.wmde-markdown ul.no-list,.wmde-markdown ol.no-list{padding:0;list-style-type:none}.wmde-markdown ol[type="1"]{list-style-type:decimal}.wmde-markdown ol[type=a]{list-style-type:lower-alpha}.wmde-markdown ol[type=i]{list-style-type:lower-roman}.wmde-markdown div>ol:not([type]){list-style-type:decimal}.wmde-markdown ul ul,.wmde-markdown ul ol,.wmde-markdown ol ol,.wmde-markdown ol ul{margin-top:0;margin-bottom:0}.wmde-markdown li>p{margin-top:16px}.wmde-markdown li+li{margin-top:.25em}.wmde-markdown dl{padding:0}.wmde-markdown dl dt{padding:0;margin-top:16px;font-size:1em;font-style:italic;font-weight:600}.wmde-markdown dl dd{padding:0 16px;margin-bottom:16px}.wmde-markdown table th{font-weight:600}.wmde-markdown table th,.wmde-markdown table td{padding:6px 13px;border:1px solid var(--color-border-default)}.wmde-markdown table tr{background-color:var(--color-canvas-default);border-top:1px solid var(--color-border-muted)}.wmde-markdown table tr:nth-child(2n){background-color:var(--color-canvas-subtle)}.wmde-markdown table img{background-color:transparent}.wmde-markdown img[align=right]{padding-left:20px}.wmde-markdown img[align=left]{padding-right:20px}.wmde-markdown .emoji{max-width:none;vertical-align:text-top;background-color:transparent}.wmde-markdown span.frame{display:block;overflow:hidden}.wmde-markdown span.frame>span{display:block;float:left;width:auto;padding:7px;margin:13px 0 0;overflow:hidden;border:1px solid var(--color-border-default)}.wmde-markdown span.frame span img{display:block;float:left}.wmde-markdown span.frame span span{display:block;padding:5px 0 0;clear:both;color:var(--color-fg-default)}.wmde-markdown span.align-center{display:block;overflow:hidden;clear:both}.wmde-markdown span.align-center>span{display:block;margin:13px auto 0;overflow:hidden;text-align:center}.wmde-markdown span.align-center span img{margin:0 auto;text-align:center}.wmde-markdown span.align-right{display:block;overflow:hidden;clear:both}.wmde-markdown span.align-right>span{display:block;margin:13px 0 0;overflow:hidden;text-align:right}.wmde-markdown span.align-right span img{margin:0;text-align:right}.wmde-markdown span.float-left{display:block;float:left;margin-right:13px;overflow:hidden}.wmde-markdown span.float-left span{margin:13px 0 0}.wmde-markdown span.float-right{display:block;float:right;margin-left:13px;overflow:hidden}.wmde-markdown span.float-right>span{display:block;margin:13px auto 0;overflow:hidden;text-align:right}.wmde-markdown code,.wmde-markdown tt{padding:.2em .4em;margin:0;font-size:85%;background-color:var(--color-neutral-muted);border-radius:6px}.wmde-markdown code br,.wmde-markdown tt br{display:none}.wmde-markdown del code{text-decoration:inherit}.wmde-markdown pre code{font-size:100%}.wmde-markdown pre>code{padding:0;margin:0;word-break:normal;white-space:pre;background:transparent;border:0}.wmde-markdown pre{font-size:85%;line-height:1.45;background-color:var(--color-canvas-subtle);border-radius:6px}.wmde-markdown pre code,.wmde-markdown pre tt{display:inline;max-width:auto;padding:0;margin:0;overflow:visible;line-height:inherit;word-wrap:normal;background-color:transparent;border:0}.wmde-markdown pre>code{padding:16px;overflow:auto;display:block}.wmde-markdown pre>code::-webkit-scrollbar{background:transparent;width:8px;height:8px}.wmde-markdown pre>code::-webkit-scrollbar-thumb{background:var(--color-fg-muted);border-radius:10px}.wmde-markdown .csv-data td,.wmde-markdown .csv-data th{padding:5px;overflow:hidden;font-size:12px;line-height:1;text-align:left;white-space:nowrap}.wmde-markdown .csv-data .blob-num{padding:10px 8px 9px;text-align:right;background:var(--color-canvas-default);border:0}.wmde-markdown .csv-data tr{border-top:0}.wmde-markdown .csv-data th{font-weight:600;background:var(--color-canvas-subtle);border-top:0}.wmde-markdown .footnotes{font-size:12px;color:var(--color-fg-muted);border-top:1px solid var(--color-border-default)}.wmde-markdown .footnotes ol{padding-left:16px}.wmde-markdown .footnotes li{position:relative}.wmde-markdown .footnotes li:target:before{position:absolute;inset:-8px -8px -8px -24px;pointer-events:none;content:"";border:2px solid var(--color-accent-emphasis);border-radius:6px}.wmde-markdown .footnotes li:target{color:var(--color-fg-default)}.wmde-markdown .footnotes .data-footnote-backref g-emoji{font-family:monospace}.wmde-markdown .task-list-item{list-style-type:none}.wmde-markdown .task-list-item label{font-weight:400}.wmde-markdown .task-list-item.enabled label{cursor:pointer}.wmde-markdown .task-list-item+.wmde-markdown .task-list-item{margin-top:3px}.wmde-markdown .task-list-item .handle{display:none}.wmde-markdown .task-list-item-checkbox,.wmde-markdown .contains-task-list input[type=checkbox]{margin:0 .2em .25em -1.6em;vertical-align:middle}.wmde-markdown .contains-task-list:dir(rtl) .task-list-item-checkbox,.wmde-markdown .contains-task-list:dir(rtl) input[type=checkbox]{margin:0 -1.6em .25em .2em}.wmde-markdown ::-webkit-calendar-picker-indicator{filter:invert(50%)}.wmde-markdown pre{position:relative}.wmde-markdown pre .copied{visibility:hidden;display:flex;position:absolute;cursor:pointer;color:var(--color-fg-default);top:6px;right:6px;border-radius:5px;background:var(--color-border-default);padding:6px;font-size:12px;transition:all .3s}.wmde-markdown pre .copied .octicon-copy{display:block}.wmde-markdown pre .copied .octicon-check{display:none}.wmde-markdown pre:hover .copied{visibility:visible}.wmde-markdown pre:hover .copied:hover{background:var(--color-prettylights-syntax-entity-tag);color:var(--color-canvas-default)}.wmde-markdown pre:hover .copied:active,.wmde-markdown pre .copied.active{background:var(--color-copied-active-bg);color:var(--color-canvas-default)}.wmde-markdown pre .active .octicon-copy{display:none}.wmde-markdown pre .active .octicon-check{display:block}.wmde-markdown .markdown-alert{padding:.5rem 1em;color:inherit;margin-bottom:16px;border-left:.25em solid var(--borderColor-default, var(--color-border-default))}.wmde-markdown .markdown-alert>:last-child{margin-bottom:0!important}.wmde-markdown .markdown-alert .markdown-alert-title{display:flex;align-items:center;line-height:1;font-weight:500;font-size:14px}.wmde-markdown .markdown-alert .markdown-alert-title svg.octicon{margin-right:var(--base-size-8, 8px)!important}.wmde-markdown .markdown-alert.markdown-alert-note{border-left-color:var(--borderColor-accent-emphasis, var(--color-accent-emphasis))}.wmde-markdown .markdown-alert.markdown-alert-note .markdown-alert-title{color:var(--fgColor-accent, var(--color-accent-fg))}.wmde-markdown .markdown-alert.markdown-alert-tip{border-left-color:var(--borderColor-success-emphasis, var(--color-success-emphasis))}.wmde-markdown .markdown-alert.markdown-alert-tip .markdown-alert-title{color:var(--fgColor-success, var(--color-success-fg))}.wmde-markdown .markdown-alert.markdown-alert-important{border-left-color:var(--borderColor-done-emphasis, var(--color-done-emphasis))}.wmde-markdown .markdown-alert.markdown-alert-important .markdown-alert-title{color:var(--fgColor-done, var(--color-done-fg))}.wmde-markdown .markdown-alert.markdown-alert-warning{border-left-color:var(--borderColor-attention-emphasis, var(--color-attention-emphasis))}.wmde-markdown .markdown-alert.markdown-alert-warning .markdown-alert-title{color:var(--fgColor-attention, var(--color-attention-fg))}.wmde-markdown .markdown-alert.markdown-alert-caution{border-left-color:var(--borderColor-danger-emphasis, var(--color-danger-emphasis))}.wmde-markdown .markdown-alert.markdown-alert-caution .markdown-alert-title{color:var(--fgColor-danger, var(--color-danger-fg))}.wmde-markdown .highlight-line{background-color:var(--color-neutral-muted)}.wmde-markdown .code-line.line-number:before{display:inline-block;width:1rem;text-align:right;margin-right:16px;color:var(--color-fg-subtle);content:attr(line);white-space:nowrap}.wmde-markdown .token.comment,.wmde-markdown .token.prolog,.wmde-markdown .token.doctype,.wmde-markdown .token.cdata{color:var(--color-prettylights-syntax-comment)}.wmde-markdown .token.namespace{opacity:.7}.wmde-markdown .token.property,.wmde-markdown .token.tag,.wmde-markdown .token.selector,.wmde-markdown .token.constant,.wmde-markdown .token.symbol,.wmde-markdown .token.deleted{color:var(--color-prettylights-syntax-entity-tag)}.wmde-markdown .token.maybe-class-name{color:var(--color-prettylights-syntax-variable)}.wmde-markdown .token.property-access,.wmde-markdown .token.operator,.wmde-markdown .token.boolean,.wmde-markdown .token.number,.wmde-markdown .token.selector .token.class,.wmde-markdown .token.attr-name,.wmde-markdown .token.string,.wmde-markdown .token.char,.wmde-markdown .token.builtin{color:var(--color-prettylights-syntax-constant)}.wmde-markdown .token.deleted{color:var(--color-prettylights-syntax-markup-deleted-text)}.wmde-markdown .code-line .token.deleted{background-color:var(--color-prettylights-syntax-markup-deleted-bg)}.wmde-markdown .token.inserted{color:var(--color-prettylights-syntax-markup-inserted-text)}.wmde-markdown .code-line .token.inserted{background-color:var(--color-prettylights-syntax-markup-inserted-bg)}.wmde-markdown .token.variable{color:var(--color-prettylights-syntax-constant)}.wmde-markdown .token.entity,.wmde-markdown .token.url,.wmde-markdown .language-css .token.string,.wmde-markdown .style .token.string,.wmde-markdown .token.color,.wmde-markdown .token.atrule,.wmde-markdown .token.attr-value,.wmde-markdown .token.function,.wmde-markdown .token.class-name{color:var(--color-prettylights-syntax-string)}.wmde-markdown .token.rule,.wmde-markdown .token.regex,.wmde-markdown .token.important,.wmde-markdown .token.keyword{color:var(--color-prettylights-syntax-keyword)}.wmde-markdown .token.coord{color:var(--color-prettylights-syntax-meta-diff-range)}.wmde-markdown .token.important,.wmde-markdown .token.bold{font-weight:700}.wmde-markdown .token.italic{font-style:italic}.wmde-markdown .token.entity{cursor:help}.w-md-editor-area{overflow:auto;border-radius:5px}.w-md-editor-text{min-height:100%;position:relative;text-align:left;white-space:pre-wrap;word-break:keep-all;overflow-wrap:break-word;box-sizing:border-box;padding:10px;margin:0;font-size:14px!important;line-height:18px!important;font-variant-ligatures:common-ligatures}.w-md-editor-text-pre,.w-md-editor-text-input,.w-md-editor-text>.w-md-editor-text-pre{margin:0;border:0;background:none;box-sizing:inherit;display:inherit;font-family:inherit;font-family:var(--md-editor-font-family)!important;font-size:inherit;font-style:inherit;font-variant-ligatures:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;tab-size:inherit;text-indent:inherit;text-rendering:inherit;text-transform:inherit;white-space:inherit;overflow-wrap:inherit;word-break:inherit;word-break:normal;padding:0}.w-md-editor-text-pre{position:relative;margin:0!important;pointer-events:none;background-color:transparent!important}.w-md-editor-text-pre>code{padding:0!important;font-family:var(--md-editor-font-family)!important;font-size:14px!important;line-height:18px!important}.w-md-editor-text-input{position:absolute;top:0;left:0;height:100%;width:100%;resize:none;color:inherit;overflow:hidden;outline:0;padding:inherit;-webkit-font-smoothing:antialiased;-webkit-text-fill-color:transparent}.w-md-editor-text-input:empty{-webkit-text-fill-color:inherit!important}.w-md-editor-text-pre,.w-md-editor-text-input{word-wrap:pre;word-break:break-word;white-space:pre-wrap}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.w-md-editor-text-input{color:transparent!important}.w-md-editor-text-input::selection{background-color:#accef7!important;color:transparent!important}}.w-md-editor-text-pre .punctuation{color:var(--color-prettylights-syntax-comment, #8b949e)!important}.w-md-editor-text-pre .token.url,.w-md-editor-text-pre .token.content{color:var(--color-prettylights-syntax-constant, #0550ae)!important}.w-md-editor-text-pre .token.title.important{color:var(--color-prettylights-syntax-markup-bold, #24292f)}.w-md-editor-text-pre .token.code-block .function{color:var(--color-prettylights-syntax-entity, #8250df)}.w-md-editor-text-pre .token.bold{font-weight:unset!important}.w-md-editor-text-pre .token.title{line-height:unset!important;font-size:unset!important;font-weight:unset!important}.w-md-editor-text-pre .token.code.keyword{color:var(--color-prettylights-syntax-constant, #0550ae)!important}.w-md-editor-text-pre .token.strike,.w-md-editor-text-pre .token.strike .content{color:var(--color-prettylights-syntax-markup-deleted-text, #82071e)!important}.w-md-editor-toolbar-child{position:absolute;border-radius:3px;box-shadow:0 0 0 1px var(--md-editor-box-shadow-color),0 0 0 var(--md-editor-box-shadow-color),0 1px 1px var(--md-editor-box-shadow-color);background-color:var(--md-editor-background-color);z-index:1;display:none}.w-md-editor-toolbar-child.active{display:block}.w-md-editor-toolbar-child .w-md-editor-toolbar{border-bottom:0;padding:3px;border-radius:3px}.w-md-editor-toolbar-child .w-md-editor-toolbar ul>li{display:block}.w-md-editor-toolbar-child .w-md-editor-toolbar ul>li button{width:-webkit-fill-available;height:initial;box-sizing:border-box;padding:3px 4px 2px;margin:0}.w-md-editor-toolbar{border-bottom:1px solid var(--md-editor-box-shadow-color);background-color:var(--md-editor-background-color);padding:3px;display:flex;justify-content:space-between;align-items:center;border-radius:3px 3px 0 0;-webkit-user-select:none;user-select:none;flex-wrap:wrap}.w-md-editor-toolbar.bottom{border-bottom:0px;border-top:1px solid var(--md-editor-box-shadow-color);border-radius:0 0 3px 3px}.w-md-editor-toolbar ul,.w-md-editor-toolbar li{margin:0;padding:0;list-style:none;line-height:initial}.w-md-editor-toolbar li{display:inline-block;font-size:14px}.w-md-editor-toolbar li+li{margin:0}.w-md-editor-toolbar li>button{border:none;height:20px;line-height:14px;background:none;padding:4px;margin:0 1px;border-radius:2px;text-transform:none;font-weight:400;overflow:visible;outline:none;cursor:pointer;transition:all .3s;white-space:nowrap;color:var(--color-fg-default)}.w-md-editor-toolbar li>button:hover,.w-md-editor-toolbar li>button:focus{background-color:var(--color-neutral-muted);color:var(--color-accent-fg)}.w-md-editor-toolbar li>button:active{background-color:var(--color-neutral-muted);color:var(--color-danger-fg)}.w-md-editor-toolbar li>button:disabled{color:var(--md-editor-box-shadow-color);cursor:not-allowed}.w-md-editor-toolbar li>button:disabled:hover{background-color:transparent;color:var(--md-editor-box-shadow-color)}.w-md-editor-toolbar li.active>button{color:var(--color-accent-fg);background-color:var(--color-neutral-muted)}.w-md-editor-toolbar-divider{height:14px;width:1px;margin:-3px 3px 0!important;vertical-align:middle;background-color:var(--md-editor-box-shadow-color)}.w-md-editor-bar{position:absolute;cursor:s-resize;right:0;bottom:0;margin-top:-11px;margin-right:0;width:14px;z-index:3;height:10px;border-radius:0 0 3px;-webkit-user-select:none;user-select:none}.w-md-editor-bar svg{display:block;margin:0 auto}.w-md-editor{text-align:left;border-radius:3px;padding-bottom:1px;position:relative;color:var(--color-fg-default);--md-editor-font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;--md-editor-background-color: var(--color-canvas-default, #ffffff);--md-editor-box-shadow-color: var(--color-border-default, #d0d7de);box-shadow:0 0 0 1px var(--md-editor-box-shadow-color),0 0 0 var(--md-editor-box-shadow-color),0 1px 1px var(--md-editor-box-shadow-color);background-color:var(--md-editor-background-color);font-family:Helvetica Neue,Helvetica,Arial,sans-serif;display:flex;flex-direction:column}.w-md-editor.w-md-editor-rtl{direction:rtl!important;text-align:right!important}.w-md-editor.w-md-editor-rtl .w-md-editor-preview{right:unset!important;left:0;text-align:right!important;box-shadow:inset -1px 0 0 0 var(--md-editor-box-shadow-color)}.w-md-editor.w-md-editor-rtl .w-md-editor-text{text-align:right!important}.w-md-editor-toolbar{height:-webkit-fit-content;height:fit-content}.w-md-editor-content{height:100%;overflow:auto;position:relative;border-radius:0 0 3px}.w-md-editor .copied{display:none!important}.w-md-editor-input{width:50%;height:100%}.w-md-editor-text-pre>code{word-break:break-word!important;white-space:pre-wrap!important}.w-md-editor-preview{width:50%;box-sizing:border-box;box-shadow:inset 1px 0 0 0 var(--md-editor-box-shadow-color);position:absolute;padding:10px 20px;overflow:auto;top:0;right:0;bottom:0;border-radius:0 0 5px;display:flex;flex-direction:column}.w-md-editor-preview .anchor{display:none}.w-md-editor-preview .contains-task-list li.task-list-item{list-style:none}.w-md-editor-show-preview .w-md-editor-input{width:0%;overflow:hidden;background-color:var(--md-editor-background-color)}.w-md-editor-show-preview .w-md-editor-preview{width:100%;box-shadow:inset 0 0}.w-md-editor-show-edit .w-md-editor-input{width:100%}.w-md-editor-show-edit .w-md-editor-preview{width:0%;padding:0}.w-md-editor-fullscreen{overflow:hidden;position:fixed;z-index:99999;inset:0;height:100%!important}.w-md-editor-fullscreen .w-md-editor-content{height:100%}
@@ -0,0 +1 @@
1
+ import{u as re,d as m,j as e,t as O,b as l,B as E,L as le,M as ie,c as ce,S as de,C as oe}from"./BoardApp.DjpO2XHn.js";import{r as n}from"./index.A0eX93qW.js";const xe={backlog:["refine","start","cancel"],todo:["plan","run","decompose","add-subtask","link-feature","block","cancel"],wip:["run","add-subtask","link-feature","block","cancel"],testing:["verify","complete","block","cancel"],blocked:["refine","unblock","cancel"],done:["reopen"],cancelled:[]},D={refine:"Refine",plan:"Plan",run:"Run",verify:"Verify",decompose:"Decompose","add-subtask":"+ Subtask","link-feature":"Link Feature",start:"Start",complete:"Complete",reopen:"Reopen",block:"Block",unblock:"Unblock",cancel:"Cancel"},ue={start:"todo",complete:"done",reopen:"wip",block:"blocked",unblock:"todo",cancel:"cancelled"},g=["backlog","todo","wip","testing","done"],pe=new Set(["blocked","cancelled"]);function he({task:a,onTransition:z,onClose:M}){const[f,h]=n.useState(""),[j,o]=n.useState(""),[L,u]=n.useState("preview"),[A,B]=n.useState(!1),[v,T]=n.useState(!1),[i,H]=n.useState({}),[b,U]=n.useState(!1),[w,I]=n.useState(null),[V,x]=n.useState(!1),[c,p]=n.useState(null),[_,W]=n.useState("claude"),[F,Y]=n.useState(!1),{setTasks:q}=re(),N=a?.wbs;if(n.useEffect(()=>{if(!N){h(""),o(""),u("preview");return}let s=!1;return B(!0),m.task.show({wbs:N}).then(t=>{if(s)return;const{content:d,frontmatter:r}=t.data;h(d),o(d),H(r)}).catch(t=>{if(s)return;const d=t instanceof Error?t.message:"Failed to load task body";typeof window<"u"&&window.dispatchEvent(new CustomEvent("api-error",{detail:{message:d}}))}).finally(()=>{s||B(!1)}),()=>{s=!0}},[N]),!a)return e.jsx("div",{className:"flex items-center justify-center h-full text-spur-text-muted text-sm",children:"Select a task to view details"});const G=()=>{o(f),u("edit")},J=()=>{o(f),u("preview")},Q=async()=>{T(!0);try{await m.task.body({wbs:a.wbs,body:j}),h(j),u("preview");const t=(await m.task.show({wbs:a.wbs})).data.content;h(t),o(t)}catch(s){o(f),u("preview");const t=s instanceof Error?s.message:"Save failed";typeof window<"u"&&window.dispatchEvent(new CustomEvent("api-error",{detail:{message:t}}))}finally{T(!1)}},X=s=>{const t=ue[s];if(t!==void 0){if(s==="cancel"&&a){x(!0);return}a&&z(a.wbs,t);return}p(s)},Z=async()=>{if(!(!c||!a)){I(c),p(null);try{await m.task.action({wbs:a.wbs,action:c,channel:_,skipDeps:F});const s=await m.task.list({});q(s.data??[])}catch(s){const t=s instanceof Error?s.message:"Action failed";typeof window<"u"&&window.dispatchEvent(new CustomEvent("api-error",{detail:{message:t}}))}finally{I(null)}}},ee=s=>{const t=g.indexOf(s);return t>=0?t:-1},P=s=>{if(!s)return"";try{const t=new Date(s);return Number.isNaN(t.getTime())?"":t.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return""}},R=s=>{if(!s)return"";try{const t=new Date(s);if(Number.isNaN(t.getTime()))return"";const d=Date.now()-t.getTime(),r=Math.floor(d/864e5);return r===0?"today":r===1?"yesterday":r<30?`${r}d ago`:r<365?`${Math.floor(r/30)}mo ago`:`${Math.floor(r/365)}y ago`}catch{return""}},y=Array.isArray(i.tags)?i.tags:[],k=P(i.created_at),se=R(i.created_at),C=P(i.updated_at),te=R(i.updated_at),$=ee(a.status),K=i.estimated_hours,S=i.impl_progress,ae=["planning","design","implementation","review","testing"],ne=s=>s==="done"?"bg-green-500":s==="in_progress"?"bg-amber-500":"bg-gray-400";return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3 p-3 border-b border-spur-border shrink-0",children:[e.jsxs("div",{className:"flex flex-col gap-1 overflow-hidden",children:[e.jsxs("h3",{className:"text-sm font-semibold text-spur-text truncate",children:[a.wbs," — ",a.name]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1","data-testid":"header-chips",children:[e.jsxs("span",{className:"px-2 py-0.5 rounded-full border border-spur-border text-xs text-spur-text-muted","data-testid":"status-pill",children:[O(a.status)," ",a.status]}),a.priority&&e.jsx("span",{className:"px-2 py-0.5 rounded-full bg-spur-accent/15 text-xs text-spur-accent",children:a.priority}),a.featureId&&e.jsx("span",{className:"px-2 py-0.5 rounded-full bg-spur-info/15 text-xs text-spur-info",children:a.featureId}),y.map(s=>e.jsx("span",{className:"px-2 py-0.5 rounded-full border border-spur-border text-xs text-spur-text-muted",children:s},s))]})]}),e.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-1 shrink-0",children:[(xe[a.status]??[]).map(s=>e.jsx(l,{variant:s==="cancel"?"error":"accent",size:"xs",onClick:()=>X(s),disabled:w===s,"aria-label":D[s],children:w===s?"…":D[s]},s)),M&&e.jsx(l,{variant:"ghost",size:"xs",className:"text-spur-text-muted",onClick:M,"aria-label":"Close detail",children:"✕"})]})]}),e.jsxs("div",{className:"border-b border-spur-border shrink-0",children:[e.jsxs("button",{type:"button",onClick:()=>U(s=>!s),className:"flex items-center justify-between w-full p-3 text-xs font-semibold text-spur-text-muted uppercase tracking-wide hover:text-spur-text transition-colors","aria-expanded":b,children:[e.jsx("span",{children:"Metadata"}),e.jsxs("svg",{className:`w-3 h-3 transition-transform ${b?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[e.jsx("title",{children:b?"Collapse metadata":"Expand metadata"}),e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})]})]}),b&&e.jsxs("div",{className:"px-3 pb-3 space-y-3",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-xs text-spur-text-muted block mb-1.5",children:"Status"}),e.jsxs("span",{className:"text-sm text-spur-text","data-testid":"metadata-status",children:[O(a.status)," ",a.status]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-xs text-spur-text-muted block mb-1.5",children:"Progress"}),S?e.jsx("div",{className:"space-y-1",children:ae.map(s=>{const t=S[s]??"pending";return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-[10px] text-spur-text-muted w-20 shrink-0",children:s}),e.jsx("div",{className:"flex-1 h-1.5 rounded-full bg-spur-border overflow-hidden",children:e.jsx("div",{className:`h-full rounded-full ${ne(t)}`,style:{width:t==="done"?"100%":t==="in_progress"?"50%":"0%"}})}),e.jsx("span",{className:"text-[10px] text-spur-text-muted w-16 shrink-0",children:t})]},s)})}):pe.has(a.status)?e.jsx(E,{variant:"warning",size:"xs",children:a.status}):e.jsx("div",{className:"flex items-center gap-1",children:g.map((s,t)=>{const d=t<=$,r=t===$;return e.jsxs("div",{className:"flex items-center gap-1 flex-1 last:flex-none",children:[e.jsx("div",{className:`h-1.5 rounded-full flex-1 ${d?"bg-spur-accent":"bg-spur-border"} ${r?"ring-1 ring-spur-accent/50":""}`,title:s}),t<g.length-1&&e.jsx("span",{className:"text-[10px] text-spur-text-muted w-0"})]},s)})}),!S&&e.jsx("div",{className:"flex justify-between mt-0.5",children:g.map(s=>e.jsx("span",{className:"text-[10px] text-spur-text-muted",children:s},s))})]}),(k||C)&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("span",{className:"text-xs text-spur-text-muted block",children:"Dates"}),k&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[e.jsx("span",{className:"text-spur-text-muted w-14 shrink-0",children:"Created"}),e.jsx("span",{className:"text-spur-text",children:k}),e.jsxs("span",{className:"text-spur-text-muted",children:["(",se,")"]})]}),C&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[e.jsx("span",{className:"text-spur-text-muted w-14 shrink-0",children:"Updated"}),e.jsx("span",{className:"text-spur-text",children:C}),e.jsxs("span",{className:"text-spur-text-muted",children:["(",te,")"]})]})]}),y.length>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-xs text-spur-text-muted block mb-1.5",children:"Tags"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:y.map(s=>e.jsx(E,{variant:"outline",size:"xs",className:"text-spur-text-muted",children:s},s))})]}),e.jsxs("div",{className:"space-y-1.5",children:[a.priority&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[e.jsx("span",{className:"text-spur-text-muted w-14 shrink-0",children:"Priority"}),e.jsx(E,{variant:"outline",size:"xs",children:a.priority})]}),K!==void 0&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[e.jsx("span",{className:"text-spur-text-muted w-14 shrink-0",children:"Est. Hours"}),e.jsxs("span",{className:"text-spur-text",children:[K,"h"]})]}),a.featureId&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[e.jsx("span",{className:"text-spur-text-muted w-14 shrink-0",children:"Feature"}),e.jsx("span",{className:"text-spur-text",children:a.featureId})]}),e.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[e.jsx("span",{className:"text-spur-text-muted w-14 shrink-0",children:"File"}),e.jsx("span",{className:"text-spur-text font-mono truncate",children:a.filePath})]})]})]})]}),e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden p-3","data-testid":"task-body-section",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2 shrink-0",children:[e.jsx("span",{className:"text-xs font-semibold text-spur-text-muted uppercase tracking-wide",children:"Body"}),e.jsx("div",{className:"flex gap-1",children:L==="preview"?e.jsx(l,{variant:"ghost",size:"xs",onClick:G,disabled:A,"aria-label":"Edit body",children:"Edit"}):e.jsxs(e.Fragment,{children:[e.jsx(l,{variant:"primary",size:"xs",onClick:Q,disabled:v,"aria-label":"Save body",children:v?"Saving…":"Save"}),e.jsx(l,{variant:"ghost",size:"xs",onClick:J,disabled:v,"aria-label":"Cancel edit",children:"Cancel"})]})})]}),A?e.jsxs("div",{className:"flex items-center gap-2 text-sm text-spur-text-muted",children:[e.jsx(le,{size:"xs",className:"text-spur-accent"}),"Loading body…"]}):L==="edit"?e.jsx("div",{className:"flex-1 min-h-0","data-testid":"body-editor",children:e.jsx(ie,{value:j,onChange:s=>o(s??""),height:"100%","data-color-mode":"light"})}):e.jsx("div",{className:"flex-1 overflow-y-auto","data-testid":"body-preview",children:e.jsx(ce,{source:f})})]}),V&&e.jsx("div",{role:"presentation",className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",onClick:()=>x(!1),onKeyDown:s=>{s.key==="Escape"&&x(!1)},children:e.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":"Confirm cancel task",className:"bg-spur-surface border border-spur-border rounded-lg shadow-xl p-4 mx-4 max-w-xs w-full",onClick:s=>s.stopPropagation(),onKeyDown:s=>{s.key==="Escape"&&x(!1)},children:[e.jsxs("p",{className:"text-sm text-spur-text mb-4",children:["Cancel task ",e.jsx("strong",{children:a.wbs}),"? This marks it as cancelled and cannot be undone from the board."]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(l,{variant:"ghost",size:"xs",onClick:()=>x(!1),children:"Keep"}),e.jsx(l,{variant:"error",size:"xs",onClick:()=>{x(!1),z(a.wbs,"cancelled")},children:"Cancel task"})]})]})}),c&&a&&e.jsx("div",{role:"presentation",className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",onClick:()=>p(null),onKeyDown:s=>{s.key==="Escape"&&p(null)},children:e.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":`Configure ${c} action`,className:"bg-spur-surface border border-spur-border rounded-lg shadow-xl p-4 mx-4 max-w-sm w-full",onClick:s=>s.stopPropagation(),children:[e.jsxs("h4",{className:"text-sm font-semibold text-spur-text mb-3",children:[D[c]??c," — Select Channel"]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(de,{variant:"bordered",size:"sm",className:"w-full bg-spur-bg text-spur-text",value:_,onChange:s=>W(s.target.value),children:["claude","codex","gemini","pi","opencode","antigravity","openclaw"].map(s=>e.jsx("option",{value:s,children:s},s))}),e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx(oe,{size:"xs",checked:F,onChange:s=>Y(s.target.checked)}),e.jsx("span",{className:"text-xs text-spur-text",children:"Skip dependencies"})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 mt-4",children:[e.jsx(l,{variant:"ghost",size:"xs",onClick:()=>p(null),children:"Cancel"}),e.jsx(l,{variant:"primary",size:"xs",onClick:Z,children:w===c?"Dispatching…":"Dispatch"})]})]})})]})}export{he as default};
@@ -0,0 +1 @@
1
+ import{bk as ln,aO as an,H as k,b7 as w,F as G,ah as un,W as y,bc as tn,b8 as C,aI as _,c as rn,m as o,aG as on,j as sn,d as fn}from"./mermaid.core.BSV8pBn-.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,j,I,v,A,H,a){var q=j-l,i=I-h,n=H-v,d=a-A,u=d*q-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*q,h+u*i]}function Q(l,h,j,I,v,A,H){var a=l-j,q=h-I,i=(H?A:-A)/C(a*a+q*q),n=i*q,d=-i*a,u=l+n,s=h+d,f=j+n,c=I+d,S=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,D=(g<0?-1:1)*C(on(0,T*T*R-P*P)),E=(P*g-m*D)/R,F=(-P*m-g*D)/R,b=(P*g+m*D)/R,p=(-P*m+g*D)/R,x=E-S,e=F-t,r=b-S,W=p-t;return x*x+e*e>r*r+W*W&&(E=b,F=p),{cx:E,cy:F,x01:-n,y01:-d,x11:E*(v/T-1),y11:F*(v/T-1)}}function hn(){var l=cn,h=yn,j=G(0),I=null,v=gn,A=dn,H=mn,a=null,q=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=A.apply(this,arguments)-un,S=rn(c-f),t=c>f;if(a||(a=n=q()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(S>tn-y)a.moveTo(s*k(f),s*w(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*k(c),u*w(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=S,D=S,E=H.apply(this,arguments)/2,F=E>y&&(I?+I.apply(this,arguments):C(u*u+s*s)),b=_(rn(s-u)/2,+j.apply(this,arguments)),p=b,x=b,e,r;if(F>y){var W=sn(F/u*w(E)),J=sn(F/s*w(E));(P-=W*2)>y?(W*=t?1:-1,R+=W,T-=W):(P=0,R=T=(f+c)/2),(D-=J*2)>y?(J*=t?1:-1,m+=J,g-=J):(D=0,m=g=(f+c)/2)}var z=s*k(m),B=s*w(m),K=u*k(T),L=u*w(T);if(b>y){var M=s*k(g),N=s*w(g),U=u*k(R),V=u*w(R),O;if(S<an)if(O=pn(z,B,U,V,M,N,K,L)){var X=z-O[0],Y=B-O[1],Z=M-O[0],$=N-O[1],nn=1/w(fn((X*Z+Y*$)/(C(X*X+Y*Y)*C(Z*Z+$*$)))/2),en=C(O[0]*O[0]+O[1]*O[1]);p=_(b,(u-en)/(nn-1)),x=_(b,(s-en)/(nn+1))}else p=x=0}D>y?x>y?(e=Q(U,V,z,B,s,x,t),r=Q(M,N,K,L,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<b?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(z,B),a.arc(0,0,s,m,g,!t)):a.moveTo(z,B),!(u>y)||!(P>y)?a.lineTo(K,L):p>y?(e=Q(K,L,M,N,u,-p,t),r=Q(z,B,U,V,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<b?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-an/2;return[k(d)*n,w(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:G(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:G(+n),i):h},i.cornerRadius=function(n){return arguments.length?(j=typeof n=="function"?n:G(+n),i):j},i.padRadius=function(n){return arguments.length?(I=n==null?null:typeof n=="function"?n:G(+n),i):I},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:G(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:G(+n),i):A},i.padAngle=function(n){return arguments.length?(H=typeof n=="function"?n:G(+n),i):H},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};
@@ -0,0 +1,36 @@
1
+ import{b as dt,a_ as $e,b5 as Ze,aD as Re,b0 as ke,a2 as qe,b2 as Qe,a5 as Je,a1 as Ke,a$ as je,t as _e,s as tr,a3 as er,S as rr,a4 as ye,I as Ee,a8 as ve,aY as ir,aZ as ar,a6 as nr,aT as or,bh as sr}from"./mermaid.core.BSV8pBn-.js";import{p as hr}from"./chunk-4BX2VUAB.BDYhxKa0.js";import{p as lr}from"./wardley-L42UT6IY.DEiaHiIT.js";import{c as Se}from"./cytoscape.esm.D3_iZ_3b.js";import{g as fr}from"./index.A0eX93qW.js";var se={exports:{}},he={exports:{}},le={exports:{}},cr=le.exports,we;function gr(){return we||(we=1,(function(C,G){(function(U,L){C.exports=L()})(cr,function(){return(function(w){var U={};function L(u){if(U[u])return U[u].exports;var h=U[u]={i:u,l:!1,exports:{}};return w[u].call(h.exports,h,h.exports,L),h.l=!0,h.exports}return L.m=w,L.c=U,L.i=function(u){return u},L.d=function(u,h,a){L.o(u,h)||Object.defineProperty(u,h,{configurable:!1,enumerable:!0,get:a})},L.n=function(u){var h=u&&u.__esModule?function(){return u.default}:function(){return u};return L.d(h,"a",h),h},L.o=function(u,h){return Object.prototype.hasOwnProperty.call(u,h)},L.p="",L(L.s=28)})([(function(w,U,L){function u(){}u.QUALITY=1,u.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,u.DEFAULT_INCREMENTAL=!1,u.DEFAULT_ANIMATION_ON_LAYOUT=!0,u.DEFAULT_ANIMATION_DURING_LAYOUT=!1,u.DEFAULT_ANIMATION_PERIOD=50,u.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,u.DEFAULT_GRAPH_MARGIN=15,u.NODE_DIMENSIONS_INCLUDE_LABELS=!1,u.SIMPLE_NODE_SIZE=40,u.SIMPLE_NODE_HALF_SIZE=u.SIMPLE_NODE_SIZE/2,u.EMPTY_COMPOUND_NODE_SIZE=40,u.MIN_EDGE_LENGTH=1,u.WORLD_BOUNDARY=1e6,u.INITIAL_WORLD_BOUNDARY=u.WORLD_BOUNDARY/1e3,u.WORLD_CENTER_X=1200,u.WORLD_CENTER_Y=900,w.exports=u}),(function(w,U,L){var u=L(2),h=L(8),a=L(9);function e(f,r,v){u.call(this,v),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=v,this.bendpoints=[],this.source=f,this.target=r}e.prototype=Object.create(u.prototype);for(var i in u)e[i]=u[i];e.prototype.getSource=function(){return this.source},e.prototype.getTarget=function(){return this.target},e.prototype.isInterGraph=function(){return this.isInterGraph},e.prototype.getLength=function(){return this.length},e.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},e.prototype.getBendpoints=function(){return this.bendpoints},e.prototype.getLca=function(){return this.lca},e.prototype.getSourceInLca=function(){return this.sourceInLca},e.prototype.getTargetInLca=function(){return this.targetInLca},e.prototype.getOtherEnd=function(f){if(this.source===f)return this.target;if(this.target===f)return this.source;throw"Node is not incident with this edge"},e.prototype.getOtherEndInGraph=function(f,r){for(var v=this.getOtherEnd(f),t=r.getGraphManager().getRoot();;){if(v.getOwner()==r)return v;if(v.getOwner()==t)break;v=v.getOwner().getParent()}return null},e.prototype.updateLength=function(){var f=new Array(4);this.isOverlapingSourceAndTarget=h.getIntersection(this.target.getRect(),this.source.getRect(),f),this.isOverlapingSourceAndTarget||(this.lengthX=f[0]-f[2],this.lengthY=f[1]-f[3],Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},e.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},w.exports=e}),(function(w,U,L){function u(h){this.vGraphObject=h}w.exports=u}),(function(w,U,L){var u=L(2),h=L(10),a=L(13),e=L(0),i=L(16),f=L(5);function r(t,s,o,c){o==null&&c==null&&(c=s),u.call(this,c),t.graphManager!=null&&(t=t.graphManager),this.estimatedSize=h.MIN_VALUE,this.inclusionTreeDepth=h.MAX_VALUE,this.vGraphObject=c,this.edges=[],this.graphManager=t,o!=null&&s!=null?this.rect=new a(s.x,s.y,o.width,o.height):this.rect=new a}r.prototype=Object.create(u.prototype);for(var v in u)r[v]=u[v];r.prototype.getEdges=function(){return this.edges},r.prototype.getChild=function(){return this.child},r.prototype.getOwner=function(){return this.owner},r.prototype.getWidth=function(){return this.rect.width},r.prototype.setWidth=function(t){this.rect.width=t},r.prototype.getHeight=function(){return this.rect.height},r.prototype.setHeight=function(t){this.rect.height=t},r.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},r.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},r.prototype.getCenter=function(){return new f(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},r.prototype.getLocation=function(){return new f(this.rect.x,this.rect.y)},r.prototype.getRect=function(){return this.rect},r.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},r.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},r.prototype.setRect=function(t,s){this.rect.x=t.x,this.rect.y=t.y,this.rect.width=s.width,this.rect.height=s.height},r.prototype.setCenter=function(t,s){this.rect.x=t-this.rect.width/2,this.rect.y=s-this.rect.height/2},r.prototype.setLocation=function(t,s){this.rect.x=t,this.rect.y=s},r.prototype.moveBy=function(t,s){this.rect.x+=t,this.rect.y+=s},r.prototype.getEdgeListToNode=function(t){var s=[],o=this;return o.edges.forEach(function(c){if(c.target==t){if(c.source!=o)throw"Incorrect edge source!";s.push(c)}}),s},r.prototype.getEdgesBetween=function(t){var s=[],o=this;return o.edges.forEach(function(c){if(!(c.source==o||c.target==o))throw"Incorrect edge source and/or target";(c.target==t||c.source==t)&&s.push(c)}),s},r.prototype.getNeighborsList=function(){var t=new Set,s=this;return s.edges.forEach(function(o){if(o.source==s)t.add(o.target);else{if(o.target!=s)throw"Incorrect incidency!";t.add(o.source)}}),t},r.prototype.withChildren=function(){var t=new Set,s,o;if(t.add(this),this.child!=null)for(var c=this.child.getNodes(),l=0;l<c.length;l++)s=c[l],o=s.withChildren(),o.forEach(function(T){t.add(T)});return t},r.prototype.getNoOfChildren=function(){var t=0,s;if(this.child==null)t=1;else for(var o=this.child.getNodes(),c=0;c<o.length;c++)s=o[c],t+=s.getNoOfChildren();return t==0&&(t=1),t},r.prototype.getEstimatedSize=function(){if(this.estimatedSize==h.MIN_VALUE)throw"assert failed";return this.estimatedSize},r.prototype.calcEstimatedSize=function(){return this.child==null?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},r.prototype.scatter=function(){var t,s,o=-e.INITIAL_WORLD_BOUNDARY,c=e.INITIAL_WORLD_BOUNDARY;t=e.WORLD_CENTER_X+i.nextDouble()*(c-o)+o;var l=-e.INITIAL_WORLD_BOUNDARY,T=e.INITIAL_WORLD_BOUNDARY;s=e.WORLD_CENTER_Y+i.nextDouble()*(T-l)+l,this.rect.x=t,this.rect.y=s},r.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var t=this.getChild();if(t.updateBounds(!0),this.rect.x=t.getLeft(),this.rect.y=t.getTop(),this.setWidth(t.getRight()-t.getLeft()),this.setHeight(t.getBottom()-t.getTop()),e.NODE_DIMENSIONS_INCLUDE_LABELS){var s=t.getRight()-t.getLeft(),o=t.getBottom()-t.getTop();this.labelWidth&&(this.labelPosHorizontal=="left"?(this.rect.x-=this.labelWidth,this.setWidth(s+this.labelWidth)):this.labelPosHorizontal=="center"&&this.labelWidth>s?(this.rect.x-=(this.labelWidth-s)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(s+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(o+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>o?(this.rect.y-=(this.labelHeight-o)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(o+this.labelHeight))}}},r.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==h.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},r.prototype.transform=function(t){var s=this.rect.x;s>e.WORLD_BOUNDARY?s=e.WORLD_BOUNDARY:s<-e.WORLD_BOUNDARY&&(s=-e.WORLD_BOUNDARY);var o=this.rect.y;o>e.WORLD_BOUNDARY?o=e.WORLD_BOUNDARY:o<-e.WORLD_BOUNDARY&&(o=-e.WORLD_BOUNDARY);var c=new f(s,o),l=t.inverseTransformPoint(c);this.setLocation(l.x,l.y)},r.prototype.getLeft=function(){return this.rect.x},r.prototype.getRight=function(){return this.rect.x+this.rect.width},r.prototype.getTop=function(){return this.rect.y},r.prototype.getBottom=function(){return this.rect.y+this.rect.height},r.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},w.exports=r}),(function(w,U,L){var u=L(0);function h(){}for(var a in u)h[a]=u[a];h.MAX_ITERATIONS=2500,h.DEFAULT_EDGE_LENGTH=50,h.DEFAULT_SPRING_STRENGTH=.45,h.DEFAULT_REPULSION_STRENGTH=4500,h.DEFAULT_GRAVITY_STRENGTH=.4,h.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,h.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,h.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,h.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,h.COOLING_ADAPTATION_FACTOR=.33,h.ADAPTATION_LOWER_NODE_LIMIT=1e3,h.ADAPTATION_UPPER_NODE_LIMIT=5e3,h.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,h.MAX_NODE_DISPLACEMENT=h.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,h.MIN_REPULSION_DIST=h.DEFAULT_EDGE_LENGTH/10,h.CONVERGENCE_CHECK_PERIOD=100,h.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,h.MIN_EDGE_LENGTH=1,h.GRID_CALCULATION_CHECK_PERIOD=10,w.exports=h}),(function(w,U,L){function u(h,a){h==null&&a==null?(this.x=0,this.y=0):(this.x=h,this.y=a)}u.prototype.getX=function(){return this.x},u.prototype.getY=function(){return this.y},u.prototype.setX=function(h){this.x=h},u.prototype.setY=function(h){this.y=h},u.prototype.getDifference=function(h){return new DimensionD(this.x-h.x,this.y-h.y)},u.prototype.getCopy=function(){return new u(this.x,this.y)},u.prototype.translate=function(h){return this.x+=h.width,this.y+=h.height,this},w.exports=u}),(function(w,U,L){var u=L(2),h=L(10),a=L(0),e=L(7),i=L(3),f=L(1),r=L(13),v=L(12),t=L(11);function s(c,l,T){u.call(this,T),this.estimatedSize=h.MIN_VALUE,this.margin=a.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=c,l!=null&&l instanceof e?this.graphManager=l:l!=null&&l instanceof Layout&&(this.graphManager=l.graphManager)}s.prototype=Object.create(u.prototype);for(var o in u)s[o]=u[o];s.prototype.getNodes=function(){return this.nodes},s.prototype.getEdges=function(){return this.edges},s.prototype.getGraphManager=function(){return this.graphManager},s.prototype.getParent=function(){return this.parent},s.prototype.getLeft=function(){return this.left},s.prototype.getRight=function(){return this.right},s.prototype.getTop=function(){return this.top},s.prototype.getBottom=function(){return this.bottom},s.prototype.isConnected=function(){return this.isConnected},s.prototype.add=function(c,l,T){if(l==null&&T==null){var g=c;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(g)>-1)throw"Node already in graph!";return g.owner=this,this.getNodes().push(g),g}else{var d=c;if(!(this.getNodes().indexOf(l)>-1&&this.getNodes().indexOf(T)>-1))throw"Source or target not in graph!";if(!(l.owner==T.owner&&l.owner==this))throw"Both owners must be this graph!";return l.owner!=T.owner?null:(d.source=l,d.target=T,d.isInterGraph=!1,this.getEdges().push(d),l.edges.push(d),T!=l&&T.edges.push(d),d)}},s.prototype.remove=function(c){var l=c;if(c instanceof i){if(l==null)throw"Node is null!";if(!(l.owner!=null&&l.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var T=l.edges.slice(),g,d=T.length,N=0;N<d;N++)g=T[N],g.isInterGraph?this.graphManager.remove(g):g.source.owner.remove(g);var b=this.nodes.indexOf(l);if(b==-1)throw"Node not in owner node list!";this.nodes.splice(b,1)}else if(c instanceof f){var g=c;if(g==null)throw"Edge is null!";if(!(g.source!=null&&g.target!=null))throw"Source and/or target is null!";if(!(g.source.owner!=null&&g.target.owner!=null&&g.source.owner==this&&g.target.owner==this))throw"Source and/or target owner is invalid!";var A=g.source.edges.indexOf(g),S=g.target.edges.indexOf(g);if(!(A>-1&&S>-1))throw"Source and/or target doesn't know this edge!";g.source.edges.splice(A,1),g.target!=g.source&&g.target.edges.splice(S,1);var b=g.source.owner.getEdges().indexOf(g);if(b==-1)throw"Not in owner's edge list!";g.source.owner.getEdges().splice(b,1)}},s.prototype.updateLeftTop=function(){for(var c=h.MAX_VALUE,l=h.MAX_VALUE,T,g,d,N=this.getNodes(),b=N.length,A=0;A<b;A++){var S=N[A];T=S.getTop(),g=S.getLeft(),c>T&&(c=T),l>g&&(l=g)}return c==h.MAX_VALUE?null:(N[0].getParent().paddingLeft!=null?d=N[0].getParent().paddingLeft:d=this.margin,this.left=l-d,this.top=c-d,new v(this.left,this.top))},s.prototype.updateBounds=function(c){for(var l=h.MAX_VALUE,T=-h.MAX_VALUE,g=h.MAX_VALUE,d=-h.MAX_VALUE,N,b,A,S,V,X=this.nodes,k=X.length,D=0;D<k;D++){var _=X[D];c&&_.child!=null&&_.updateBounds(),N=_.getLeft(),b=_.getRight(),A=_.getTop(),S=_.getBottom(),l>N&&(l=N),T<b&&(T=b),g>A&&(g=A),d<S&&(d=S)}var n=new r(l,g,T-l,d-g);l==h.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),X[0].getParent().paddingLeft!=null?V=X[0].getParent().paddingLeft:V=this.margin,this.left=n.x-V,this.right=n.x+n.width+V,this.top=n.y-V,this.bottom=n.y+n.height+V},s.calculateBounds=function(c){for(var l=h.MAX_VALUE,T=-h.MAX_VALUE,g=h.MAX_VALUE,d=-h.MAX_VALUE,N,b,A,S,V=c.length,X=0;X<V;X++){var k=c[X];N=k.getLeft(),b=k.getRight(),A=k.getTop(),S=k.getBottom(),l>N&&(l=N),T<b&&(T=b),g>A&&(g=A),d<S&&(d=S)}var D=new r(l,g,T-l,d-g);return D},s.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},s.prototype.getEstimatedSize=function(){if(this.estimatedSize==h.MIN_VALUE)throw"assert failed";return this.estimatedSize},s.prototype.calcEstimatedSize=function(){for(var c=0,l=this.nodes,T=l.length,g=0;g<T;g++){var d=l[g];c+=d.calcEstimatedSize()}return c==0?this.estimatedSize=a.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=c/Math.sqrt(this.nodes.length),this.estimatedSize},s.prototype.updateConnected=function(){var c=this;if(this.nodes.length==0){this.isConnected=!0;return}var l=new t,T=new Set,g=this.nodes[0],d,N,b=g.withChildren();for(b.forEach(function(D){l.push(D),T.add(D)});l.length!==0;){g=l.shift(),d=g.getEdges();for(var A=d.length,S=0;S<A;S++){var V=d[S];if(N=V.getOtherEndInGraph(g,this),N!=null&&!T.has(N)){var X=N.withChildren();X.forEach(function(D){l.push(D),T.add(D)})}}}if(this.isConnected=!1,T.size>=this.nodes.length){var k=0;T.forEach(function(D){D.owner==c&&k++}),k==this.nodes.length&&(this.isConnected=!0)}},w.exports=s}),(function(w,U,L){var u,h=L(1);function a(e){u=L(6),this.layout=e,this.graphs=[],this.edges=[]}a.prototype.addRoot=function(){var e=this.layout.newGraph(),i=this.layout.newNode(null),f=this.add(e,i);return this.setRootGraph(f),this.rootGraph},a.prototype.add=function(e,i,f,r,v){if(f==null&&r==null&&v==null){if(e==null)throw"Graph is null!";if(i==null)throw"Parent node is null!";if(this.graphs.indexOf(e)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(e),e.parent!=null)throw"Already has a parent!";if(i.child!=null)throw"Already has a child!";return e.parent=i,i.child=e,e}else{v=f,r=i,f=e;var t=r.getOwner(),s=v.getOwner();if(!(t!=null&&t.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(s!=null&&s.getGraphManager()==this))throw"Target not in this graph mgr!";if(t==s)return f.isInterGraph=!1,t.add(f,r,v);if(f.isInterGraph=!0,f.source=r,f.target=v,this.edges.indexOf(f)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(f),!(f.source!=null&&f.target!=null))throw"Edge source and/or target is null!";if(!(f.source.edges.indexOf(f)==-1&&f.target.edges.indexOf(f)==-1))throw"Edge already in source and/or target incidency list!";return f.source.edges.push(f),f.target.edges.push(f),f}},a.prototype.remove=function(e){if(e instanceof u){var i=e;if(i.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(i==this.rootGraph||i.parent!=null&&i.parent.graphManager==this))throw"Invalid parent node!";var f=[];f=f.concat(i.getEdges());for(var r,v=f.length,t=0;t<v;t++)r=f[t],i.remove(r);var s=[];s=s.concat(i.getNodes());var o;v=s.length;for(var t=0;t<v;t++)o=s[t],i.remove(o);i==this.rootGraph&&this.setRootGraph(null);var c=this.graphs.indexOf(i);this.graphs.splice(c,1),i.parent=null}else if(e instanceof h){if(r=e,r==null)throw"Edge is null!";if(!r.isInterGraph)throw"Not an inter-graph edge!";if(!(r.source!=null&&r.target!=null))throw"Source and/or target is null!";if(!(r.source.edges.indexOf(r)!=-1&&r.target.edges.indexOf(r)!=-1))throw"Source and/or target doesn't know this edge!";var c=r.source.edges.indexOf(r);if(r.source.edges.splice(c,1),c=r.target.edges.indexOf(r),r.target.edges.splice(c,1),!(r.source.owner!=null&&r.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(r.source.owner.getGraphManager().edges.indexOf(r)==-1)throw"Not in owner graph manager's edge list!";var c=r.source.owner.getGraphManager().edges.indexOf(r);r.source.owner.getGraphManager().edges.splice(c,1)}},a.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},a.prototype.getGraphs=function(){return this.graphs},a.prototype.getAllNodes=function(){if(this.allNodes==null){for(var e=[],i=this.getGraphs(),f=i.length,r=0;r<f;r++)e=e.concat(i[r].getNodes());this.allNodes=e}return this.allNodes},a.prototype.resetAllNodes=function(){this.allNodes=null},a.prototype.resetAllEdges=function(){this.allEdges=null},a.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},a.prototype.getAllEdges=function(){if(this.allEdges==null){var e=[],i=this.getGraphs();i.length;for(var f=0;f<i.length;f++)e=e.concat(i[f].getEdges());e=e.concat(this.edges),this.allEdges=e}return this.allEdges},a.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},a.prototype.setAllNodesToApplyGravitation=function(e){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=e},a.prototype.getRoot=function(){return this.rootGraph},a.prototype.setRootGraph=function(e){if(e.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=e,e.parent==null&&(e.parent=this.layout.newNode("Root node"))},a.prototype.getLayout=function(){return this.layout},a.prototype.isOneAncestorOfOther=function(e,i){if(!(e!=null&&i!=null))throw"assert failed";if(e==i)return!0;var f=e.getOwner(),r;do{if(r=f.getParent(),r==null)break;if(r==i)return!0;if(f=r.getOwner(),f==null)break}while(!0);f=i.getOwner();do{if(r=f.getParent(),r==null)break;if(r==e)return!0;if(f=r.getOwner(),f==null)break}while(!0);return!1},a.prototype.calcLowestCommonAncestors=function(){for(var e,i,f,r,v,t=this.getAllEdges(),s=t.length,o=0;o<s;o++){if(e=t[o],i=e.source,f=e.target,e.lca=null,e.sourceInLca=i,e.targetInLca=f,i==f){e.lca=i.getOwner();continue}for(r=i.getOwner();e.lca==null;){for(e.targetInLca=f,v=f.getOwner();e.lca==null;){if(v==r){e.lca=v;break}if(v==this.rootGraph)break;if(e.lca!=null)throw"assert failed";e.targetInLca=v.getParent(),v=e.targetInLca.getOwner()}if(r==this.rootGraph)break;e.lca==null&&(e.sourceInLca=r.getParent(),r=e.sourceInLca.getOwner())}if(e.lca==null)throw"assert failed"}},a.prototype.calcLowestCommonAncestor=function(e,i){if(e==i)return e.getOwner();var f=e.getOwner();do{if(f==null)break;var r=i.getOwner();do{if(r==null)break;if(r==f)return r;r=r.getParent().getOwner()}while(!0);f=f.getParent().getOwner()}while(!0);return f},a.prototype.calcInclusionTreeDepths=function(e,i){e==null&&i==null&&(e=this.rootGraph,i=1);for(var f,r=e.getNodes(),v=r.length,t=0;t<v;t++)f=r[t],f.inclusionTreeDepth=i,f.child!=null&&this.calcInclusionTreeDepths(f.child,i+1)},a.prototype.includesInvalidEdge=function(){for(var e,i=[],f=this.edges.length,r=0;r<f;r++)e=this.edges[r],this.isOneAncestorOfOther(e.source,e.target)&&i.push(e);for(var r=0;r<i.length;r++)this.remove(i[r]);return!1},w.exports=a}),(function(w,U,L){var u=L(12);function h(){}h.calcSeparationAmount=function(a,e,i,f){if(!a.intersects(e))throw"assert failed";var r=new Array(2);this.decideDirectionsForOverlappingNodes(a,e,r),i[0]=Math.min(a.getRight(),e.getRight())-Math.max(a.x,e.x),i[1]=Math.min(a.getBottom(),e.getBottom())-Math.max(a.y,e.y),a.getX()<=e.getX()&&a.getRight()>=e.getRight()?i[0]+=Math.min(e.getX()-a.getX(),a.getRight()-e.getRight()):e.getX()<=a.getX()&&e.getRight()>=a.getRight()&&(i[0]+=Math.min(a.getX()-e.getX(),e.getRight()-a.getRight())),a.getY()<=e.getY()&&a.getBottom()>=e.getBottom()?i[1]+=Math.min(e.getY()-a.getY(),a.getBottom()-e.getBottom()):e.getY()<=a.getY()&&e.getBottom()>=a.getBottom()&&(i[1]+=Math.min(a.getY()-e.getY(),e.getBottom()-a.getBottom()));var v=Math.abs((e.getCenterY()-a.getCenterY())/(e.getCenterX()-a.getCenterX()));e.getCenterY()===a.getCenterY()&&e.getCenterX()===a.getCenterX()&&(v=1);var t=v*i[0],s=i[1]/v;i[0]<s?s=i[0]:t=i[1],i[0]=-1*r[0]*(s/2+f),i[1]=-1*r[1]*(t/2+f)},h.decideDirectionsForOverlappingNodes=function(a,e,i){a.getCenterX()<e.getCenterX()?i[0]=-1:i[0]=1,a.getCenterY()<e.getCenterY()?i[1]=-1:i[1]=1},h.getIntersection2=function(a,e,i){var f=a.getCenterX(),r=a.getCenterY(),v=e.getCenterX(),t=e.getCenterY();if(a.intersects(e))return i[0]=f,i[1]=r,i[2]=v,i[3]=t,!0;var s=a.getX(),o=a.getY(),c=a.getRight(),l=a.getX(),T=a.getBottom(),g=a.getRight(),d=a.getWidthHalf(),N=a.getHeightHalf(),b=e.getX(),A=e.getY(),S=e.getRight(),V=e.getX(),X=e.getBottom(),k=e.getRight(),D=e.getWidthHalf(),_=e.getHeightHalf(),n=!1,m=!1;if(f===v){if(r>t)return i[0]=f,i[1]=o,i[2]=v,i[3]=X,!1;if(r<t)return i[0]=f,i[1]=T,i[2]=v,i[3]=A,!1}else if(r===t){if(f>v)return i[0]=s,i[1]=r,i[2]=S,i[3]=t,!1;if(f<v)return i[0]=c,i[1]=r,i[2]=b,i[3]=t,!1}else{var p=a.height/a.width,E=e.height/e.width,y=(t-r)/(v-f),I=void 0,M=void 0,R=void 0,W=void 0,x=void 0,Q=void 0;if(-p===y?f>v?(i[0]=l,i[1]=T,n=!0):(i[0]=c,i[1]=o,n=!0):p===y&&(f>v?(i[0]=s,i[1]=o,n=!0):(i[0]=g,i[1]=T,n=!0)),-E===y?v>f?(i[2]=V,i[3]=X,m=!0):(i[2]=S,i[3]=A,m=!0):E===y&&(v>f?(i[2]=b,i[3]=A,m=!0):(i[2]=k,i[3]=X,m=!0)),n&&m)return!1;if(f>v?r>t?(I=this.getCardinalDirection(p,y,4),M=this.getCardinalDirection(E,y,2)):(I=this.getCardinalDirection(-p,y,3),M=this.getCardinalDirection(-E,y,1)):r>t?(I=this.getCardinalDirection(-p,y,1),M=this.getCardinalDirection(-E,y,3)):(I=this.getCardinalDirection(p,y,2),M=this.getCardinalDirection(E,y,4)),!n)switch(I){case 1:W=o,R=f+-N/y,i[0]=R,i[1]=W;break;case 2:R=g,W=r+d*y,i[0]=R,i[1]=W;break;case 3:W=T,R=f+N/y,i[0]=R,i[1]=W;break;case 4:R=l,W=r+-d*y,i[0]=R,i[1]=W;break}if(!m)switch(M){case 1:Q=A,x=v+-_/y,i[2]=x,i[3]=Q;break;case 2:x=k,Q=t+D*y,i[2]=x,i[3]=Q;break;case 3:Q=X,x=v+_/y,i[2]=x,i[3]=Q;break;case 4:x=V,Q=t+-D*y,i[2]=x,i[3]=Q;break}}return!1},h.getCardinalDirection=function(a,e,i){return a>e?i:1+i%4},h.getIntersection=function(a,e,i,f){if(f==null)return this.getIntersection2(a,e,i);var r=a.x,v=a.y,t=e.x,s=e.y,o=i.x,c=i.y,l=f.x,T=f.y,g=void 0,d=void 0,N=void 0,b=void 0,A=void 0,S=void 0,V=void 0,X=void 0,k=void 0;return N=s-v,A=r-t,V=t*v-r*s,b=T-c,S=o-l,X=l*c-o*T,k=N*S-b*A,k===0?null:(g=(A*X-S*V)/k,d=(b*V-N*X)/k,new u(g,d))},h.angleOfVector=function(a,e,i,f){var r=void 0;return a!==i?(r=Math.atan((f-e)/(i-a)),i<a?r+=Math.PI:f<e&&(r+=this.TWO_PI)):f<e?r=this.ONE_AND_HALF_PI:r=this.HALF_PI,r},h.doIntersect=function(a,e,i,f){var r=a.x,v=a.y,t=e.x,s=e.y,o=i.x,c=i.y,l=f.x,T=f.y,g=(t-r)*(T-c)-(l-o)*(s-v);if(g===0)return!1;var d=((T-c)*(l-r)+(o-l)*(T-v))/g,N=((v-s)*(l-r)+(t-r)*(T-v))/g;return 0<d&&d<1&&0<N&&N<1},h.findCircleLineIntersections=function(a,e,i,f,r,v,t){var s=(i-a)*(i-a)+(f-e)*(f-e),o=2*((a-r)*(i-a)+(e-v)*(f-e)),c=(a-r)*(a-r)+(e-v)*(e-v)-t*t,l=o*o-4*s*c;if(l>=0){var T=(-o+Math.sqrt(o*o-4*s*c))/(2*s),g=(-o-Math.sqrt(o*o-4*s*c))/(2*s),d=null;return T>=0&&T<=1?[T]:g>=0&&g<=1?[g]:d}else return null},h.HALF_PI=.5*Math.PI,h.ONE_AND_HALF_PI=1.5*Math.PI,h.TWO_PI=2*Math.PI,h.THREE_PI=3*Math.PI,w.exports=h}),(function(w,U,L){function u(){}u.sign=function(h){return h>0?1:h<0?-1:0},u.floor=function(h){return h<0?Math.ceil(h):Math.floor(h)},u.ceil=function(h){return h<0?Math.floor(h):Math.ceil(h)},w.exports=u}),(function(w,U,L){function u(){}u.MAX_VALUE=2147483647,u.MIN_VALUE=-2147483648,w.exports=u}),(function(w,U,L){var u=(function(){function r(v,t){for(var s=0;s<t.length;s++){var o=t[s];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(v,o.key,o)}}return function(v,t,s){return t&&r(v.prototype,t),s&&r(v,s),v}})();function h(r,v){if(!(r instanceof v))throw new TypeError("Cannot call a class as a function")}var a=function(v){return{value:v,next:null,prev:null}},e=function(v,t,s,o){return v!==null?v.next=t:o.head=t,s!==null?s.prev=t:o.tail=t,t.prev=v,t.next=s,o.length++,t},i=function(v,t){var s=v.prev,o=v.next;return s!==null?s.next=o:t.head=o,o!==null?o.prev=s:t.tail=s,v.prev=v.next=null,t.length--,v},f=(function(){function r(v){var t=this;h(this,r),this.length=0,this.head=null,this.tail=null,v?.forEach(function(s){return t.push(s)})}return u(r,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(t,s){return e(s.prev,a(t),s,this)}},{key:"insertAfter",value:function(t,s){return e(s,a(t),s.next,this)}},{key:"insertNodeBefore",value:function(t,s){return e(s.prev,t,s,this)}},{key:"insertNodeAfter",value:function(t,s){return e(s,t,s.next,this)}},{key:"push",value:function(t){return e(this.tail,a(t),null,this)}},{key:"unshift",value:function(t){return e(null,a(t),this.head,this)}},{key:"remove",value:function(t){return i(t,this)}},{key:"pop",value:function(){return i(this.tail,this).value}},{key:"popNode",value:function(){return i(this.tail,this)}},{key:"shift",value:function(){return i(this.head,this).value}},{key:"shiftNode",value:function(){return i(this.head,this)}},{key:"get_object_at",value:function(t){if(t<=this.length()){for(var s=1,o=this.head;s<t;)o=o.next,s++;return o.value}}},{key:"set_object_at",value:function(t,s){if(t<=this.length()){for(var o=1,c=this.head;o<t;)c=c.next,o++;c.value=s}}}]),r})();w.exports=f}),(function(w,U,L){function u(h,a,e){this.x=null,this.y=null,h==null&&a==null&&e==null?(this.x=0,this.y=0):typeof h=="number"&&typeof a=="number"&&e==null?(this.x=h,this.y=a):h.constructor.name=="Point"&&a==null&&e==null&&(e=h,this.x=e.x,this.y=e.y)}u.prototype.getX=function(){return this.x},u.prototype.getY=function(){return this.y},u.prototype.getLocation=function(){return new u(this.x,this.y)},u.prototype.setLocation=function(h,a,e){h.constructor.name=="Point"&&a==null&&e==null?(e=h,this.setLocation(e.x,e.y)):typeof h=="number"&&typeof a=="number"&&e==null&&(parseInt(h)==h&&parseInt(a)==a?this.move(h,a):(this.x=Math.floor(h+.5),this.y=Math.floor(a+.5)))},u.prototype.move=function(h,a){this.x=h,this.y=a},u.prototype.translate=function(h,a){this.x+=h,this.y+=a},u.prototype.equals=function(h){if(h.constructor.name=="Point"){var a=h;return this.x==a.x&&this.y==a.y}return this==h},u.prototype.toString=function(){return new u().constructor.name+"[x="+this.x+",y="+this.y+"]"},w.exports=u}),(function(w,U,L){function u(h,a,e,i){this.x=0,this.y=0,this.width=0,this.height=0,h!=null&&a!=null&&e!=null&&i!=null&&(this.x=h,this.y=a,this.width=e,this.height=i)}u.prototype.getX=function(){return this.x},u.prototype.setX=function(h){this.x=h},u.prototype.getY=function(){return this.y},u.prototype.setY=function(h){this.y=h},u.prototype.getWidth=function(){return this.width},u.prototype.setWidth=function(h){this.width=h},u.prototype.getHeight=function(){return this.height},u.prototype.setHeight=function(h){this.height=h},u.prototype.getRight=function(){return this.x+this.width},u.prototype.getBottom=function(){return this.y+this.height},u.prototype.intersects=function(h){return!(this.getRight()<h.x||this.getBottom()<h.y||h.getRight()<this.x||h.getBottom()<this.y)},u.prototype.getCenterX=function(){return this.x+this.width/2},u.prototype.getMinX=function(){return this.getX()},u.prototype.getMaxX=function(){return this.getX()+this.width},u.prototype.getCenterY=function(){return this.y+this.height/2},u.prototype.getMinY=function(){return this.getY()},u.prototype.getMaxY=function(){return this.getY()+this.height},u.prototype.getWidthHalf=function(){return this.width/2},u.prototype.getHeightHalf=function(){return this.height/2},w.exports=u}),(function(w,U,L){var u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a};function h(){}h.lastID=0,h.createID=function(a){return h.isPrimitive(a)?a:(a.uniqueID!=null||(a.uniqueID=h.getString(),h.lastID++),a.uniqueID)},h.getString=function(a){return a==null&&(a=h.lastID),"Object#"+a},h.isPrimitive=function(a){var e=typeof a>"u"?"undefined":u(a);return a==null||e!="object"&&e!="function"},w.exports=h}),(function(w,U,L){function u(o){if(Array.isArray(o)){for(var c=0,l=Array(o.length);c<o.length;c++)l[c]=o[c];return l}else return Array.from(o)}var h=L(0),a=L(7),e=L(3),i=L(1),f=L(6),r=L(5),v=L(17),t=L(29);function s(o){t.call(this),this.layoutQuality=h.QUALITY,this.createBendsAsNeeded=h.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=h.DEFAULT_INCREMENTAL,this.animationOnLayout=h.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=h.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=h.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=h.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new a(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,o!=null&&(this.isRemoteUse=o)}s.RANDOM_SEED=1,s.prototype=Object.create(t.prototype),s.prototype.getGraphManager=function(){return this.graphManager},s.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},s.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},s.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},s.prototype.newGraphManager=function(){var o=new a(this);return this.graphManager=o,o},s.prototype.newGraph=function(o){return new f(null,this.graphManager,o)},s.prototype.newNode=function(o){return new e(this.graphManager,o)},s.prototype.newEdge=function(o){return new i(null,null,o)},s.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},s.prototype.runLayout=function(){this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters();var o;return this.checkLayoutSuccess()?o=!1:o=this.layout(),h.ANIMATE==="during"?!1:(o&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,o)},s.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},s.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var o=this.graphManager.getAllEdges(),c=0;c<o.length;c++)o[c];for(var l=this.graphManager.getRoot().getNodes(),c=0;c<l.length;c++)l[c];this.update(this.graphManager.getRoot())}},s.prototype.update=function(o){if(o==null)this.update2();else if(o instanceof e){var c=o;if(c.getChild()!=null)for(var l=c.getChild().getNodes(),T=0;T<l.length;T++)update(l[T]);if(c.vGraphObject!=null){var g=c.vGraphObject;g.update(c)}}else if(o instanceof i){var d=o;if(d.vGraphObject!=null){var N=d.vGraphObject;N.update(d)}}else if(o instanceof f){var b=o;if(b.vGraphObject!=null){var A=b.vGraphObject;A.update(b)}}},s.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=h.QUALITY,this.animationDuringLayout=h.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=h.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=h.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=h.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=h.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=h.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},s.prototype.transform=function(o){if(o==null)this.transform(new r(0,0));else{var c=new v,l=this.graphManager.getRoot().updateLeftTop();if(l!=null){c.setWorldOrgX(o.x),c.setWorldOrgY(o.y),c.setDeviceOrgX(l.x),c.setDeviceOrgY(l.y);for(var T=this.getAllNodes(),g,d=0;d<T.length;d++)g=T[d],g.transform(c)}}},s.prototype.positionNodesRandomly=function(o){if(o==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var c,l,T=o.getNodes(),g=0;g<T.length;g++)c=T[g],l=c.getChild(),l==null||l.getNodes().length==0?c.scatter():(this.positionNodesRandomly(l),c.updateBounds())},s.prototype.getFlatForest=function(){for(var o=[],c=!0,l=this.graphManager.getRoot().getNodes(),T=!0,g=0;g<l.length;g++)l[g].getChild()!=null&&(T=!1);if(!T)return o;var d=new Set,N=[],b=new Map,A=[];for(A=A.concat(l);A.length>0&&c;){for(N.push(A[0]);N.length>0&&c;){var S=N[0];N.splice(0,1),d.add(S);for(var V=S.getEdges(),g=0;g<V.length;g++){var X=V[g].getOtherEnd(S);if(b.get(S)!=X)if(!d.has(X))N.push(X),b.set(X,S);else{c=!1;break}}}if(!c)o=[];else{var k=[].concat(u(d));o.push(k);for(var g=0;g<k.length;g++){var D=k[g],_=A.indexOf(D);_>-1&&A.splice(_,1)}d=new Set,b=new Map}}return o},s.prototype.createDummyNodesForBendpoints=function(o){for(var c=[],l=o.source,T=this.graphManager.calcLowestCommonAncestor(o.source,o.target),g=0;g<o.bendpoints.length;g++){var d=this.newNode(null);d.setRect(new Point(0,0),new Dimension(1,1)),T.add(d);var N=this.newEdge(null);this.graphManager.add(N,l,d),c.add(d),l=d}var N=this.newEdge(null);return this.graphManager.add(N,l,o.target),this.edgeToDummyNodes.set(o,c),o.isInterGraph()?this.graphManager.remove(o):T.remove(o),c},s.prototype.createBendpointsFromDummyNodes=function(){var o=[];o=o.concat(this.graphManager.getAllEdges()),o=[].concat(u(this.edgeToDummyNodes.keys())).concat(o);for(var c=0;c<o.length;c++){var l=o[c];if(l.bendpoints.length>0){for(var T=this.edgeToDummyNodes.get(l),g=0;g<T.length;g++){var d=T[g],N=new r(d.getCenterX(),d.getCenterY()),b=l.bendpoints.get(g);b.x=N.x,b.y=N.y,d.getOwner().remove(d)}this.graphManager.add(l,l.source,l.target)}}},s.transform=function(o,c,l,T){if(l!=null&&T!=null){var g=c;if(o<=50){var d=c/l;g-=(c-d)/50*(50-o)}else{var N=c*T;g+=(N-c)/50*(o-50)}return g}else{var b,A;return o<=50?(b=9*c/500,A=c/10):(b=9*c/50,A=-8*c),b*o+A}},s.findCenterOfTree=function(o){var c=[];c=c.concat(o);var l=[],T=new Map,g=!1,d=null;(c.length==1||c.length==2)&&(g=!0,d=c[0]);for(var N=0;N<c.length;N++){var b=c[N],A=b.getNeighborsList().size;T.set(b,b.getNeighborsList().size),A==1&&l.push(b)}var S=[];for(S=S.concat(l);!g;){var V=[];V=V.concat(S),S=[];for(var N=0;N<c.length;N++){var b=c[N],X=c.indexOf(b);X>=0&&c.splice(X,1);var k=b.getNeighborsList();k.forEach(function(n){if(l.indexOf(n)<0){var m=T.get(n),p=m-1;p==1&&S.push(n),T.set(n,p)}})}l=l.concat(S),(c.length==1||c.length==2)&&(g=!0,d=c[0])}return d},s.prototype.setGraphManager=function(o){this.graphManager=o},w.exports=s}),(function(w,U,L){function u(){}u.seed=1,u.x=0,u.nextDouble=function(){return u.x=Math.sin(u.seed++)*1e4,u.x-Math.floor(u.x)},w.exports=u}),(function(w,U,L){var u=L(5);function h(a,e){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}h.prototype.getWorldOrgX=function(){return this.lworldOrgX},h.prototype.setWorldOrgX=function(a){this.lworldOrgX=a},h.prototype.getWorldOrgY=function(){return this.lworldOrgY},h.prototype.setWorldOrgY=function(a){this.lworldOrgY=a},h.prototype.getWorldExtX=function(){return this.lworldExtX},h.prototype.setWorldExtX=function(a){this.lworldExtX=a},h.prototype.getWorldExtY=function(){return this.lworldExtY},h.prototype.setWorldExtY=function(a){this.lworldExtY=a},h.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},h.prototype.setDeviceOrgX=function(a){this.ldeviceOrgX=a},h.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},h.prototype.setDeviceOrgY=function(a){this.ldeviceOrgY=a},h.prototype.getDeviceExtX=function(){return this.ldeviceExtX},h.prototype.setDeviceExtX=function(a){this.ldeviceExtX=a},h.prototype.getDeviceExtY=function(){return this.ldeviceExtY},h.prototype.setDeviceExtY=function(a){this.ldeviceExtY=a},h.prototype.transformX=function(a){var e=0,i=this.lworldExtX;return i!=0&&(e=this.ldeviceOrgX+(a-this.lworldOrgX)*this.ldeviceExtX/i),e},h.prototype.transformY=function(a){var e=0,i=this.lworldExtY;return i!=0&&(e=this.ldeviceOrgY+(a-this.lworldOrgY)*this.ldeviceExtY/i),e},h.prototype.inverseTransformX=function(a){var e=0,i=this.ldeviceExtX;return i!=0&&(e=this.lworldOrgX+(a-this.ldeviceOrgX)*this.lworldExtX/i),e},h.prototype.inverseTransformY=function(a){var e=0,i=this.ldeviceExtY;return i!=0&&(e=this.lworldOrgY+(a-this.ldeviceOrgY)*this.lworldExtY/i),e},h.prototype.inverseTransformPoint=function(a){var e=new u(this.inverseTransformX(a.x),this.inverseTransformY(a.y));return e},w.exports=h}),(function(w,U,L){function u(t){if(Array.isArray(t)){for(var s=0,o=Array(t.length);s<t.length;s++)o[s]=t[s];return o}else return Array.from(t)}var h=L(15),a=L(4),e=L(0),i=L(8),f=L(9);function r(){h.call(this),this.useSmartIdealEdgeLengthCalculation=a.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=a.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=a.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=a.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=a.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*a.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=a.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=a.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=a.MAX_ITERATIONS}r.prototype=Object.create(h.prototype);for(var v in h)r[v]=h[v];r.prototype.initParameters=function(){h.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=a.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},r.prototype.calcIdealEdgeLengths=function(){for(var t,s,o,c,l,T,g,d=this.getGraphManager().getAllEdges(),N=0;N<d.length;N++)t=d[N],s=t.idealLength,t.isInterGraph&&(c=t.getSource(),l=t.getTarget(),T=t.getSourceInLca().getEstimatedSize(),g=t.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(t.idealLength+=T+g-2*e.SIMPLE_NODE_SIZE),o=t.getLca().getInclusionTreeDepth(),t.idealLength+=s*a.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(c.getInclusionTreeDepth()+l.getInclusionTreeDepth()-2*o))},r.prototype.initSpringEmbedder=function(){var t=this.getAllNodes().length;this.incremental?(t>a.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*a.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-a.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>a.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(a.COOLING_ADAPTATION_FACTOR,1-(t-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*(1-a.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*a.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},r.prototype.calcSpringForces=function(){for(var t=this.getAllEdges(),s,o=0;o<t.length;o++)s=t[o],this.calcSpringForce(s,s.idealLength)},r.prototype.calcRepulsionForces=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,o,c,l,T,g=this.getAllNodes(),d;if(this.useFRGridVariant)for(this.totalIterations%a.GRID_CALCULATION_CHECK_PERIOD==1&&t&&this.updateGrid(),d=new Set,o=0;o<g.length;o++)l=g[o],this.calculateRepulsionForceOfANode(l,d,t,s),d.add(l);else for(o=0;o<g.length;o++)for(l=g[o],c=o+1;c<g.length;c++)T=g[c],l.getOwner()==T.getOwner()&&this.calcRepulsionForce(l,T)},r.prototype.calcGravitationalForces=function(){for(var t,s=this.getAllNodesToApplyGravitation(),o=0;o<s.length;o++)t=s[o],this.calcGravitationalForce(t)},r.prototype.moveNodes=function(){for(var t=this.getAllNodes(),s,o=0;o<t.length;o++)s=t[o],s.move()},r.prototype.calcSpringForce=function(t,s){var o=t.getSource(),c=t.getTarget(),l,T,g,d;if(this.uniformLeafNodeSizes&&o.getChild()==null&&c.getChild()==null)t.updateLengthSimple();else if(t.updateLength(),t.isOverlapingSourceAndTarget)return;l=t.getLength(),l!=0&&(T=t.edgeElasticity*(l-s),g=T*(t.lengthX/l),d=T*(t.lengthY/l),o.springForceX+=g,o.springForceY+=d,c.springForceX-=g,c.springForceY-=d)},r.prototype.calcRepulsionForce=function(t,s){var o=t.getRect(),c=s.getRect(),l=new Array(2),T=new Array(4),g,d,N,b,A,S,V;if(o.intersects(c)){i.calcSeparationAmount(o,c,l,a.DEFAULT_EDGE_LENGTH/2),S=2*l[0],V=2*l[1];var X=t.noOfChildren*s.noOfChildren/(t.noOfChildren+s.noOfChildren);t.repulsionForceX-=X*S,t.repulsionForceY-=X*V,s.repulsionForceX+=X*S,s.repulsionForceY+=X*V}else this.uniformLeafNodeSizes&&t.getChild()==null&&s.getChild()==null?(g=c.getCenterX()-o.getCenterX(),d=c.getCenterY()-o.getCenterY()):(i.getIntersection(o,c,T),g=T[2]-T[0],d=T[3]-T[1]),Math.abs(g)<a.MIN_REPULSION_DIST&&(g=f.sign(g)*a.MIN_REPULSION_DIST),Math.abs(d)<a.MIN_REPULSION_DIST&&(d=f.sign(d)*a.MIN_REPULSION_DIST),N=g*g+d*d,b=Math.sqrt(N),A=(t.nodeRepulsion/2+s.nodeRepulsion/2)*t.noOfChildren*s.noOfChildren/N,S=A*g/b,V=A*d/b,t.repulsionForceX-=S,t.repulsionForceY-=V,s.repulsionForceX+=S,s.repulsionForceY+=V},r.prototype.calcGravitationalForce=function(t){var s,o,c,l,T,g,d,N;s=t.getOwner(),o=(s.getRight()+s.getLeft())/2,c=(s.getTop()+s.getBottom())/2,l=t.getCenterX()-o,T=t.getCenterY()-c,g=Math.abs(l)+t.getWidth()/2,d=Math.abs(T)+t.getHeight()/2,t.getOwner()==this.graphManager.getRoot()?(N=s.getEstimatedSize()*this.gravityRangeFactor,(g>N||d>N)&&(t.gravitationForceX=-this.gravityConstant*l,t.gravitationForceY=-this.gravityConstant*T)):(N=s.getEstimatedSize()*this.compoundGravityRangeFactor,(g>N||d>N)&&(t.gravitationForceX=-this.gravityConstant*l*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*T*this.compoundGravityConstant))},r.prototype.isConverged=function(){var t,s=!1;return this.totalIterations>this.maxIterations/3&&(s=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,t||s},r.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},r.prototype.calcNoOfChildrenForAllNodes=function(){for(var t,s=this.graphManager.getAllNodes(),o=0;o<s.length;o++)t=s[o],t.noOfChildren=t.getNoOfChildren()},r.prototype.calcGrid=function(t){var s=0,o=0;s=parseInt(Math.ceil((t.getRight()-t.getLeft())/this.repulsionRange)),o=parseInt(Math.ceil((t.getBottom()-t.getTop())/this.repulsionRange));for(var c=new Array(s),l=0;l<s;l++)c[l]=new Array(o);for(var l=0;l<s;l++)for(var T=0;T<o;T++)c[l][T]=new Array;return c},r.prototype.addNodeToGrid=function(t,s,o){var c=0,l=0,T=0,g=0;c=parseInt(Math.floor((t.getRect().x-s)/this.repulsionRange)),l=parseInt(Math.floor((t.getRect().width+t.getRect().x-s)/this.repulsionRange)),T=parseInt(Math.floor((t.getRect().y-o)/this.repulsionRange)),g=parseInt(Math.floor((t.getRect().height+t.getRect().y-o)/this.repulsionRange));for(var d=c;d<=l;d++)for(var N=T;N<=g;N++)this.grid[d][N].push(t),t.setGridCoordinates(c,l,T,g)},r.prototype.updateGrid=function(){var t,s,o=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),t=0;t<o.length;t++)s=o[t],this.addNodeToGrid(s,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},r.prototype.calculateRepulsionForceOfANode=function(t,s,o,c){if(this.totalIterations%a.GRID_CALCULATION_CHECK_PERIOD==1&&o||c){var l=new Set;t.surrounding=new Array;for(var T,g=this.grid,d=t.startX-1;d<t.finishX+2;d++)for(var N=t.startY-1;N<t.finishY+2;N++)if(!(d<0||N<0||d>=g.length||N>=g[0].length)){for(var b=0;b<g[d][N].length;b++)if(T=g[d][N][b],!(t.getOwner()!=T.getOwner()||t==T)&&!s.has(T)&&!l.has(T)){var A=Math.abs(t.getCenterX()-T.getCenterX())-(t.getWidth()/2+T.getWidth()/2),S=Math.abs(t.getCenterY()-T.getCenterY())-(t.getHeight()/2+T.getHeight()/2);A<=this.repulsionRange&&S<=this.repulsionRange&&l.add(T)}}t.surrounding=[].concat(u(l))}for(d=0;d<t.surrounding.length;d++)this.calcRepulsionForce(t,t.surrounding[d])},r.prototype.calcRepulsionRange=function(){return 0},w.exports=r}),(function(w,U,L){var u=L(1),h=L(4);function a(i,f,r){u.call(this,i,f,r),this.idealLength=h.DEFAULT_EDGE_LENGTH,this.edgeElasticity=h.DEFAULT_SPRING_STRENGTH}a.prototype=Object.create(u.prototype);for(var e in u)a[e]=u[e];w.exports=a}),(function(w,U,L){var u=L(3),h=L(4);function a(i,f,r,v){u.call(this,i,f,r,v),this.nodeRepulsion=h.DEFAULT_REPULSION_STRENGTH,this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}a.prototype=Object.create(u.prototype);for(var e in u)a[e]=u[e];a.prototype.setGridCoordinates=function(i,f,r,v){this.startX=i,this.finishX=f,this.startY=r,this.finishY=v},w.exports=a}),(function(w,U,L){function u(h,a){this.width=0,this.height=0,h!==null&&a!==null&&(this.height=a,this.width=h)}u.prototype.getWidth=function(){return this.width},u.prototype.setWidth=function(h){this.width=h},u.prototype.getHeight=function(){return this.height},u.prototype.setHeight=function(h){this.height=h},w.exports=u}),(function(w,U,L){var u=L(14);function h(){this.map={},this.keys=[]}h.prototype.put=function(a,e){var i=u.createID(a);this.contains(i)||(this.map[i]=e,this.keys.push(a))},h.prototype.contains=function(a){return u.createID(a),this.map[a]!=null},h.prototype.get=function(a){var e=u.createID(a);return this.map[e]},h.prototype.keySet=function(){return this.keys},w.exports=h}),(function(w,U,L){var u=L(14);function h(){this.set={}}h.prototype.add=function(a){var e=u.createID(a);this.contains(e)||(this.set[e]=a)},h.prototype.remove=function(a){delete this.set[u.createID(a)]},h.prototype.clear=function(){this.set={}},h.prototype.contains=function(a){return this.set[u.createID(a)]==a},h.prototype.isEmpty=function(){return this.size()===0},h.prototype.size=function(){return Object.keys(this.set).length},h.prototype.addAllTo=function(a){for(var e=Object.keys(this.set),i=e.length,f=0;f<i;f++)a.push(this.set[e[f]])},h.prototype.size=function(){return Object.keys(this.set).length},h.prototype.addAll=function(a){for(var e=a.length,i=0;i<e;i++){var f=a[i];this.add(f)}},w.exports=h}),(function(w,U,L){function u(){}u.multMat=function(h,a){for(var e=[],i=0;i<h.length;i++){e[i]=[];for(var f=0;f<a[0].length;f++){e[i][f]=0;for(var r=0;r<h[0].length;r++)e[i][f]+=h[i][r]*a[r][f]}}return e},u.transpose=function(h){for(var a=[],e=0;e<h[0].length;e++){a[e]=[];for(var i=0;i<h.length;i++)a[e][i]=h[i][e]}return a},u.multCons=function(h,a){for(var e=[],i=0;i<h.length;i++)e[i]=h[i]*a;return e},u.minusOp=function(h,a){for(var e=[],i=0;i<h.length;i++)e[i]=h[i]-a[i];return e},u.dotProduct=function(h,a){for(var e=0,i=0;i<h.length;i++)e+=h[i]*a[i];return e},u.mag=function(h){return Math.sqrt(this.dotProduct(h,h))},u.normalize=function(h){for(var a=[],e=this.mag(h),i=0;i<h.length;i++)a[i]=h[i]/e;return a},u.multGamma=function(h){for(var a=[],e=0,i=0;i<h.length;i++)e+=h[i];e*=-1/h.length;for(var f=0;f<h.length;f++)a[f]=e+h[f];return a},u.multL=function(h,a,e){for(var i=[],f=[],r=[],v=0;v<a[0].length;v++){for(var t=0,s=0;s<a.length;s++)t+=-.5*a[s][v]*h[s];f[v]=t}for(var o=0;o<e.length;o++){for(var c=0,l=0;l<e.length;l++)c+=e[o][l]*f[l];r[o]=c}for(var T=0;T<a.length;T++){for(var g=0,d=0;d<a[0].length;d++)g+=a[T][d]*r[d];i[T]=g}return i},w.exports=u}),(function(w,U,L){var u=(function(){function i(f,r){for(var v=0;v<r.length;v++){var t=r[v];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(f,t.key,t)}}return function(f,r,v){return r&&i(f.prototype,r),v&&i(f,v),f}})();function h(i,f){if(!(i instanceof f))throw new TypeError("Cannot call a class as a function")}var a=L(11),e=(function(){function i(f,r){h(this,i),(r!==null||r!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var v=void 0;f instanceof a?v=f.size():v=f.length,this._quicksort(f,0,v-1)}return u(i,[{key:"_quicksort",value:function(r,v,t){if(v<t){var s=this._partition(r,v,t);this._quicksort(r,v,s),this._quicksort(r,s+1,t)}}},{key:"_partition",value:function(r,v,t){for(var s=this._get(r,v),o=v,c=t;;){for(;this.compareFunction(s,this._get(r,c));)c--;for(;this.compareFunction(this._get(r,o),s);)o++;if(o<c)this._swap(r,o,c),o++,c--;else return c}}},{key:"_get",value:function(r,v){return r instanceof a?r.get_object_at(v):r[v]}},{key:"_set",value:function(r,v,t){r instanceof a?r.set_object_at(v,t):r[v]=t}},{key:"_swap",value:function(r,v,t){var s=this._get(r,v);this._set(r,v,this._get(r,t)),this._set(r,t,s)}},{key:"_defaultCompareFunction",value:function(r,v){return v>r}}]),i})();w.exports=e}),(function(w,U,L){function u(){}u.svd=function(h){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=h.length,this.n=h[0].length;var a=Math.min(this.m,this.n);this.s=(function(Tt){for(var Ct=[];Tt-- >0;)Ct.push(0);return Ct})(Math.min(this.m+1,this.n)),this.U=(function(Tt){var Ct=function Bt(bt){if(bt.length==0)return 0;for(var zt=[],St=0;St<bt[0];St++)zt.push(Bt(bt.slice(1)));return zt};return Ct(Tt)})([this.m,a]),this.V=(function(Tt){var Ct=function Bt(bt){if(bt.length==0)return 0;for(var zt=[],St=0;St<bt[0];St++)zt.push(Bt(bt.slice(1)));return zt};return Ct(Tt)})([this.n,this.n]);for(var e=(function(Tt){for(var Ct=[];Tt-- >0;)Ct.push(0);return Ct})(this.n),i=(function(Tt){for(var Ct=[];Tt-- >0;)Ct.push(0);return Ct})(this.m),f=!0,r=Math.min(this.m-1,this.n),v=Math.max(0,Math.min(this.n-2,this.m)),t=0;t<Math.max(r,v);t++){if(t<r){this.s[t]=0;for(var s=t;s<this.m;s++)this.s[t]=u.hypot(this.s[t],h[s][t]);if(this.s[t]!==0){h[t][t]<0&&(this.s[t]=-this.s[t]);for(var o=t;o<this.m;o++)h[o][t]/=this.s[t];h[t][t]+=1}this.s[t]=-this.s[t]}for(var c=t+1;c<this.n;c++){if((function(Tt,Ct){return Tt&&Ct})(t<r,this.s[t]!==0)){for(var l=0,T=t;T<this.m;T++)l+=h[T][t]*h[T][c];l=-l/h[t][t];for(var g=t;g<this.m;g++)h[g][c]+=l*h[g][t]}e[c]=h[t][c]}if((function(Tt,Ct){return Ct})(f,t<r))for(var d=t;d<this.m;d++)this.U[d][t]=h[d][t];if(t<v){e[t]=0;for(var N=t+1;N<this.n;N++)e[t]=u.hypot(e[t],e[N]);if(e[t]!==0){e[t+1]<0&&(e[t]=-e[t]);for(var b=t+1;b<this.n;b++)e[b]/=e[t];e[t+1]+=1}if(e[t]=-e[t],(function(Tt,Ct){return Tt&&Ct})(t+1<this.m,e[t]!==0)){for(var A=t+1;A<this.m;A++)i[A]=0;for(var S=t+1;S<this.n;S++)for(var V=t+1;V<this.m;V++)i[V]+=e[S]*h[V][S];for(var X=t+1;X<this.n;X++)for(var k=-e[X]/e[t+1],D=t+1;D<this.m;D++)h[D][X]+=k*i[D]}for(var _=t+1;_<this.n;_++)this.V[_][t]=e[_]}}var n=Math.min(this.n,this.m+1);r<this.n&&(this.s[r]=h[r][r]),this.m<n&&(this.s[n-1]=0),v+1<n&&(e[v]=h[v][n-1]),e[n-1]=0;{for(var m=r;m<a;m++){for(var p=0;p<this.m;p++)this.U[p][m]=0;this.U[m][m]=1}for(var E=r-1;E>=0;E--)if(this.s[E]!==0){for(var y=E+1;y<a;y++){for(var I=0,M=E;M<this.m;M++)I+=this.U[M][E]*this.U[M][y];I=-I/this.U[E][E];for(var R=E;R<this.m;R++)this.U[R][y]+=I*this.U[R][E]}for(var W=E;W<this.m;W++)this.U[W][E]=-this.U[W][E];this.U[E][E]=1+this.U[E][E];for(var x=0;x<E-1;x++)this.U[x][E]=0}else{for(var Q=0;Q<this.m;Q++)this.U[Q][E]=0;this.U[E][E]=1}}for(var z=this.n-1;z>=0;z--){if((function(Tt,Ct){return Tt&&Ct})(z<v,e[z]!==0))for(var Y=z+1;Y<a;Y++){for(var rt=0,B=z+1;B<this.n;B++)rt+=this.V[B][z]*this.V[B][Y];rt=-rt/this.V[z+1][z];for(var O=z+1;O<this.n;O++)this.V[O][Y]+=rt*this.V[O][z]}for(var H=0;H<this.n;H++)this.V[H][z]=0;this.V[z][z]=1}for(var $=n-1,tt=Math.pow(2,-52),ht=Math.pow(2,-966);n>0;){var J=void 0,It=void 0;for(J=n-2;J>=-1&&J!==-1;J--)if(Math.abs(e[J])<=ht+tt*(Math.abs(this.s[J])+Math.abs(this.s[J+1]))){e[J]=0;break}if(J===n-2)It=4;else{var Nt=void 0;for(Nt=n-1;Nt>=J&&Nt!==J;Nt--){var vt=(Nt!==n?Math.abs(e[Nt]):0)+(Nt!==J+1?Math.abs(e[Nt-1]):0);if(Math.abs(this.s[Nt])<=ht+tt*vt){this.s[Nt]=0;break}}Nt===J?It=3:Nt===n-1?It=1:(It=2,J=Nt)}switch(J++,It){case 1:{var it=e[n-2];e[n-2]=0;for(var gt=n-2;gt>=J;gt--){var mt=u.hypot(this.s[gt],it),At=this.s[gt]/mt,Ot=it/mt;this.s[gt]=mt,gt!==J&&(it=-Ot*e[gt-1],e[gt-1]=At*e[gt-1]);for(var Et=0;Et<this.n;Et++)mt=At*this.V[Et][gt]+Ot*this.V[Et][n-1],this.V[Et][n-1]=-Ot*this.V[Et][gt]+At*this.V[Et][n-1],this.V[Et][gt]=mt}}break;case 2:{var Dt=e[J-1];e[J-1]=0;for(var Rt=J;Rt<n;Rt++){var Ht=u.hypot(this.s[Rt],Dt),Ut=this.s[Rt]/Ht,Pt=Dt/Ht;this.s[Rt]=Ht,Dt=-Pt*e[Rt],e[Rt]=Ut*e[Rt];for(var Ft=0;Ft<this.m;Ft++)Ht=Ut*this.U[Ft][Rt]+Pt*this.U[Ft][J-1],this.U[Ft][J-1]=-Pt*this.U[Ft][Rt]+Ut*this.U[Ft][J-1],this.U[Ft][Rt]=Ht}}break;case 3:{var Yt=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[n-1]),Math.abs(this.s[n-2])),Math.abs(e[n-2])),Math.abs(this.s[J])),Math.abs(e[J])),Vt=this.s[n-1]/Yt,F=this.s[n-2]/Yt,P=e[n-2]/Yt,Z=this.s[J]/Yt,K=e[J]/Yt,q=((F+Vt)*(F-Vt)+P*P)/2,at=Vt*P*(Vt*P),ct=0;(function(Tt,Ct){return Tt||Ct})(q!==0,at!==0)&&(ct=Math.sqrt(q*q+at),q<0&&(ct=-ct),ct=at/(q+ct));for(var nt=(Z+Vt)*(Z-Vt)+ct,et=Z*K,j=J;j<n-1;j++){var ut=u.hypot(nt,et),wt=nt/ut,pt=et/ut;j!==J&&(e[j-1]=ut),nt=wt*this.s[j]+pt*e[j],e[j]=wt*e[j]-pt*this.s[j],et=pt*this.s[j+1],this.s[j+1]=wt*this.s[j+1];for(var xt=0;xt<this.n;xt++)ut=wt*this.V[xt][j]+pt*this.V[xt][j+1],this.V[xt][j+1]=-pt*this.V[xt][j]+wt*this.V[xt][j+1],this.V[xt][j]=ut;if(ut=u.hypot(nt,et),wt=nt/ut,pt=et/ut,this.s[j]=ut,nt=wt*e[j]+pt*this.s[j+1],this.s[j+1]=-pt*e[j]+wt*this.s[j+1],et=pt*e[j+1],e[j+1]=wt*e[j+1],j<this.m-1)for(var lt=0;lt<this.m;lt++)ut=wt*this.U[lt][j]+pt*this.U[lt][j+1],this.U[lt][j+1]=-pt*this.U[lt][j]+wt*this.U[lt][j+1],this.U[lt][j]=ut}e[n-2]=nt}break;case 4:{if(this.s[J]<=0){this.s[J]=this.s[J]<0?-this.s[J]:0;for(var ot=0;ot<=$;ot++)this.V[ot][J]=-this.V[ot][J]}for(;J<$&&!(this.s[J]>=this.s[J+1]);){var Lt=this.s[J];if(this.s[J]=this.s[J+1],this.s[J+1]=Lt,J<this.n-1)for(var ft=0;ft<this.n;ft++)Lt=this.V[ft][J+1],this.V[ft][J+1]=this.V[ft][J],this.V[ft][J]=Lt;if(J<this.m-1)for(var st=0;st<this.m;st++)Lt=this.U[st][J+1],this.U[st][J+1]=this.U[st][J],this.U[st][J]=Lt;J++}n--}break}}var Xt={U:this.U,V:this.V,S:this.s};return Xt},u.hypot=function(h,a){var e=void 0;return Math.abs(h)>Math.abs(a)?(e=a/h,e=Math.abs(h)*Math.sqrt(1+e*e)):a!=0?(e=h/a,e=Math.abs(a)*Math.sqrt(1+e*e)):e=0,e},w.exports=u}),(function(w,U,L){var u=(function(){function e(i,f){for(var r=0;r<f.length;r++){var v=f[r];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(i,v.key,v)}}return function(i,f,r){return f&&e(i.prototype,f),r&&e(i,r),i}})();function h(e,i){if(!(e instanceof i))throw new TypeError("Cannot call a class as a function")}var a=(function(){function e(i,f){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,v=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,t=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;h(this,e),this.sequence1=i,this.sequence2=f,this.match_score=r,this.mismatch_penalty=v,this.gap_penalty=t,this.iMax=i.length+1,this.jMax=f.length+1,this.grid=new Array(this.iMax);for(var s=0;s<this.iMax;s++){this.grid[s]=new Array(this.jMax);for(var o=0;o<this.jMax;o++)this.grid[s][o]=0}this.tracebackGrid=new Array(this.iMax);for(var c=0;c<this.iMax;c++){this.tracebackGrid[c]=new Array(this.jMax);for(var l=0;l<this.jMax;l++)this.tracebackGrid[c][l]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return u(e,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var f=1;f<this.jMax;f++)this.grid[0][f]=this.grid[0][f-1]+this.gap_penalty,this.tracebackGrid[0][f]=[!1,!1,!0];for(var r=1;r<this.iMax;r++)this.grid[r][0]=this.grid[r-1][0]+this.gap_penalty,this.tracebackGrid[r][0]=[!1,!0,!1];for(var v=1;v<this.iMax;v++)for(var t=1;t<this.jMax;t++){var s=void 0;this.sequence1[v-1]===this.sequence2[t-1]?s=this.grid[v-1][t-1]+this.match_score:s=this.grid[v-1][t-1]+this.mismatch_penalty;var o=this.grid[v-1][t]+this.gap_penalty,c=this.grid[v][t-1]+this.gap_penalty,l=[s,o,c],T=this.arrayAllMaxIndexes(l);this.grid[v][t]=l[T[0]],this.tracebackGrid[v][t]=[T.includes(0),T.includes(1),T.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var f=[];for(f.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});f[0];){var r=f[0],v=this.tracebackGrid[r.pos[0]][r.pos[1]];v[0]&&f.push({pos:[r.pos[0]-1,r.pos[1]-1],seq1:this.sequence1[r.pos[0]-1]+r.seq1,seq2:this.sequence2[r.pos[1]-1]+r.seq2}),v[1]&&f.push({pos:[r.pos[0]-1,r.pos[1]],seq1:this.sequence1[r.pos[0]-1]+r.seq1,seq2:"-"+r.seq2}),v[2]&&f.push({pos:[r.pos[0],r.pos[1]-1],seq1:"-"+r.seq1,seq2:this.sequence2[r.pos[1]-1]+r.seq2}),r.pos[0]===0&&r.pos[1]===0&&this.alignments.push({sequence1:r.seq1,sequence2:r.seq2}),f.shift()}return this.alignments}},{key:"getAllIndexes",value:function(f,r){for(var v=[],t=-1;(t=f.indexOf(r,t+1))!==-1;)v.push(t);return v}},{key:"arrayAllMaxIndexes",value:function(f){return this.getAllIndexes(f,Math.max.apply(null,f))}}]),e})();w.exports=a}),(function(w,U,L){var u=function(){};u.FDLayout=L(18),u.FDLayoutConstants=L(4),u.FDLayoutEdge=L(19),u.FDLayoutNode=L(20),u.DimensionD=L(21),u.HashMap=L(22),u.HashSet=L(23),u.IGeometry=L(8),u.IMath=L(9),u.Integer=L(10),u.Point=L(12),u.PointD=L(5),u.RandomSeed=L(16),u.RectangleD=L(13),u.Transform=L(17),u.UniqueIDGeneretor=L(14),u.Quicksort=L(25),u.LinkedList=L(11),u.LGraphObject=L(2),u.LGraph=L(6),u.LEdge=L(1),u.LGraphManager=L(7),u.LNode=L(3),u.Layout=L(15),u.LayoutConstants=L(0),u.NeedlemanWunsch=L(27),u.Matrix=L(24),u.SVD=L(26),w.exports=u}),(function(w,U,L){function u(){this.listeners=[]}var h=u.prototype;h.addListener=function(a,e){this.listeners.push({event:a,callback:e})},h.removeListener=function(a,e){for(var i=this.listeners.length;i>=0;i--){var f=this.listeners[i];f.event===a&&f.callback===e&&this.listeners.splice(i,1)}},h.emit=function(a,e){for(var i=0;i<this.listeners.length;i++){var f=this.listeners[i];a===f.event&&f.callback(e)}},w.exports=u})])})})(le)),le.exports}var ur=he.exports,Me;function dr(){return Me||(Me=1,(function(C,G){(function(U,L){C.exports=L(gr())})(ur,function(w){return(()=>{var U={45:((a,e,i)=>{var f={};f.layoutBase=i(551),f.CoSEConstants=i(806),f.CoSEEdge=i(767),f.CoSEGraph=i(880),f.CoSEGraphManager=i(578),f.CoSELayout=i(765),f.CoSENode=i(991),f.ConstraintHandler=i(902),a.exports=f}),806:((a,e,i)=>{var f=i(551).FDLayoutConstants;function r(){}for(var v in f)r[v]=f[v];r.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,r.DEFAULT_RADIAL_SEPARATION=f.DEFAULT_EDGE_LENGTH,r.DEFAULT_COMPONENT_SEPERATION=60,r.TILE=!0,r.TILING_PADDING_VERTICAL=10,r.TILING_PADDING_HORIZONTAL=10,r.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,r.ENFORCE_CONSTRAINTS=!0,r.APPLY_LAYOUT=!0,r.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,r.TREE_REDUCTION_ON_INCREMENTAL=!0,r.PURE_INCREMENTAL=r.DEFAULT_INCREMENTAL,a.exports=r}),767:((a,e,i)=>{var f=i(551).FDLayoutEdge;function r(t,s,o){f.call(this,t,s,o)}r.prototype=Object.create(f.prototype);for(var v in f)r[v]=f[v];a.exports=r}),880:((a,e,i)=>{var f=i(551).LGraph;function r(t,s,o){f.call(this,t,s,o)}r.prototype=Object.create(f.prototype);for(var v in f)r[v]=f[v];a.exports=r}),578:((a,e,i)=>{var f=i(551).LGraphManager;function r(t){f.call(this,t)}r.prototype=Object.create(f.prototype);for(var v in f)r[v]=f[v];a.exports=r}),765:((a,e,i)=>{var f=i(551).FDLayout,r=i(578),v=i(880),t=i(991),s=i(767),o=i(806),c=i(902),l=i(551).FDLayoutConstants,T=i(551).LayoutConstants,g=i(551).Point,d=i(551).PointD,N=i(551).DimensionD,b=i(551).Layout,A=i(551).Integer,S=i(551).IGeometry,V=i(551).LGraph,X=i(551).Transform,k=i(551).LinkedList;function D(){f.call(this),this.toBeTiled={},this.constraints={}}D.prototype=Object.create(f.prototype);for(var _ in f)D[_]=f[_];D.prototype.newGraphManager=function(){var n=new r(this);return this.graphManager=n,n},D.prototype.newGraph=function(n){return new v(null,this.graphManager,n)},D.prototype.newNode=function(n){return new t(this.graphManager,n)},D.prototype.newEdge=function(n){return new s(null,null,n)},D.prototype.initParameters=function(){f.prototype.initParameters.call(this,arguments),this.isSubLayout||(o.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=o.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=l.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=l.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=l.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},D.prototype.initSpringEmbedder=function(){f.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/l.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},D.prototype.layout=function(){var n=T.DEFAULT_CREATE_BENDS_AS_NEEDED;return n&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},D.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(o.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var m=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(I){return m.has(I)});this.graphManager.setAllNodesToApplyGravitation(p)}}else{var n=this.getFlatForest();if(n.length>0)this.positionNodesRadially(n);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var m=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(E){return m.has(E)});this.graphManager.setAllNodesToApplyGravitation(p),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(c.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),o.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},D.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%l.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var n=new Set(this.getAllNodes()),m=this.nodesWithGravity.filter(function(y){return n.has(y)});this.graphManager.setAllNodesToApplyGravitation(m),this.graphManager.updateBounds(),this.updateGrid(),o.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),o.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var p=!this.isTreeGrowing&&!this.isGrowthFinished,E=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(p,E),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},D.prototype.getPositionsData=function(){for(var n=this.graphManager.getAllNodes(),m={},p=0;p<n.length;p++){var E=n[p].rect,y=n[p].id;m[y]={id:y,x:E.getCenterX(),y:E.getCenterY(),w:E.width,h:E.height}}return m},D.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var n=!1;if(l.ANIMATE==="during")this.emit("layoutstarted");else{for(;!n;)n=this.tick();this.graphManager.updateBounds()}},D.prototype.moveNodes=function(){for(var n=this.getAllNodes(),m,p=0;p<n.length;p++)m=n[p],m.calculateDisplacement();Object.keys(this.constraints).length>0&&this.updateDisplacements();for(var p=0;p<n.length;p++)m=n[p],m.move()},D.prototype.initConstraintVariables=function(){var n=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var m=this.graphManager.getAllNodes(),p=0;p<m.length;p++){var E=m[p];this.idToNodeMap.set(E.id,E)}var y=function O(H){for(var $=H.getChild().getNodes(),tt,ht=0,J=0;J<$.length;J++)tt=$[J],tt.getChild()==null?n.fixedNodeSet.has(tt.id)&&(ht+=100):ht+=O(tt);return ht};if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function($){n.fixedNodeSet.add($.nodeId)});for(var m=this.graphManager.getAllNodes(),E,p=0;p<m.length;p++)if(E=m[p],E.getChild()!=null){var I=y(E);I>0&&(E.fixedNodeWeight=I)}}if(this.constraints.relativePlacementConstraint){var M=new Map,R=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(O){n.fixedNodesOnHorizontal.add(O),n.fixedNodesOnVertical.add(O)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var W=this.constraints.alignmentConstraint.vertical,p=0;p<W.length;p++)this.dummyToNodeForVerticalAlignment.set("dummy"+p,[]),W[p].forEach(function(H){M.set(H,"dummy"+p),n.dummyToNodeForVerticalAlignment.get("dummy"+p).push(H),n.fixedNodeSet.has(H)&&n.fixedNodesOnHorizontal.add("dummy"+p)});if(this.constraints.alignmentConstraint.horizontal)for(var x=this.constraints.alignmentConstraint.horizontal,p=0;p<x.length;p++)this.dummyToNodeForHorizontalAlignment.set("dummy"+p,[]),x[p].forEach(function(H){R.set(H,"dummy"+p),n.dummyToNodeForHorizontalAlignment.get("dummy"+p).push(H),n.fixedNodeSet.has(H)&&n.fixedNodesOnVertical.add("dummy"+p)})}if(o.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(O){var H,$,tt;for(tt=O.length-1;tt>=2*O.length/3;tt--)H=Math.floor(Math.random()*(tt+1)),$=O[tt],O[tt]=O[H],O[H]=$;return O},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(O){if(O.left){var H=M.has(O.left)?M.get(O.left):O.left,$=M.has(O.right)?M.get(O.right):O.right;n.nodesInRelativeHorizontal.includes(H)||(n.nodesInRelativeHorizontal.push(H),n.nodeToRelativeConstraintMapHorizontal.set(H,[]),n.dummyToNodeForVerticalAlignment.has(H)?n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(H)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(H).getCenterX())),n.nodesInRelativeHorizontal.includes($)||(n.nodesInRelativeHorizontal.push($),n.nodeToRelativeConstraintMapHorizontal.set($,[]),n.dummyToNodeForVerticalAlignment.has($)?n.nodeToTempPositionMapHorizontal.set($,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get($)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set($,n.idToNodeMap.get($).getCenterX())),n.nodeToRelativeConstraintMapHorizontal.get(H).push({right:$,gap:O.gap}),n.nodeToRelativeConstraintMapHorizontal.get($).push({left:H,gap:O.gap})}else{var tt=R.has(O.top)?R.get(O.top):O.top,ht=R.has(O.bottom)?R.get(O.bottom):O.bottom;n.nodesInRelativeVertical.includes(tt)||(n.nodesInRelativeVertical.push(tt),n.nodeToRelativeConstraintMapVertical.set(tt,[]),n.dummyToNodeForHorizontalAlignment.has(tt)?n.nodeToTempPositionMapVertical.set(tt,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(tt)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(tt,n.idToNodeMap.get(tt).getCenterY())),n.nodesInRelativeVertical.includes(ht)||(n.nodesInRelativeVertical.push(ht),n.nodeToRelativeConstraintMapVertical.set(ht,[]),n.dummyToNodeForHorizontalAlignment.has(ht)?n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(ht)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(ht).getCenterY())),n.nodeToRelativeConstraintMapVertical.get(tt).push({bottom:ht,gap:O.gap}),n.nodeToRelativeConstraintMapVertical.get(ht).push({top:tt,gap:O.gap})}});else{var Q=new Map,z=new Map;this.constraints.relativePlacementConstraint.forEach(function(O){if(O.left){var H=M.has(O.left)?M.get(O.left):O.left,$=M.has(O.right)?M.get(O.right):O.right;Q.has(H)?Q.get(H).push($):Q.set(H,[$]),Q.has($)?Q.get($).push(H):Q.set($,[H])}else{var tt=R.has(O.top)?R.get(O.top):O.top,ht=R.has(O.bottom)?R.get(O.bottom):O.bottom;z.has(tt)?z.get(tt).push(ht):z.set(tt,[ht]),z.has(ht)?z.get(ht).push(tt):z.set(ht,[tt])}});var Y=function(H,$){var tt=[],ht=[],J=new k,It=new Set,Nt=0;return H.forEach(function(vt,it){if(!It.has(it)){tt[Nt]=[],ht[Nt]=!1;var gt=it;for(J.push(gt),It.add(gt),tt[Nt].push(gt);J.length!=0;){gt=J.shift(),$.has(gt)&&(ht[Nt]=!0);var mt=H.get(gt);mt.forEach(function(At){It.has(At)||(J.push(At),It.add(At),tt[Nt].push(At))})}Nt++}}),{components:tt,isFixed:ht}},rt=Y(Q,n.fixedNodesOnHorizontal);this.componentsOnHorizontal=rt.components,this.fixedComponentsOnHorizontal=rt.isFixed;var B=Y(z,n.fixedNodesOnVertical);this.componentsOnVertical=B.components,this.fixedComponentsOnVertical=B.isFixed}}},D.prototype.updateDisplacements=function(){var n=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(B){var O=n.idToNodeMap.get(B.nodeId);O.displacementX=0,O.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var m=this.constraints.alignmentConstraint.vertical,p=0;p<m.length;p++){for(var E=0,y=0;y<m[p].length;y++){if(this.fixedNodeSet.has(m[p][y])){E=0;break}E+=this.idToNodeMap.get(m[p][y]).displacementX}for(var I=E/m[p].length,y=0;y<m[p].length;y++)this.idToNodeMap.get(m[p][y]).displacementX=I}if(this.constraints.alignmentConstraint.horizontal)for(var M=this.constraints.alignmentConstraint.horizontal,p=0;p<M.length;p++){for(var R=0,y=0;y<M[p].length;y++){if(this.fixedNodeSet.has(M[p][y])){R=0;break}R+=this.idToNodeMap.get(M[p][y]).displacementY}for(var W=R/M[p].length,y=0;y<M[p].length;y++)this.idToNodeMap.get(M[p][y]).displacementY=W}}if(this.constraints.relativePlacementConstraint)if(o.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach(function(B){if(!n.fixedNodesOnHorizontal.has(B)){var O=0;n.dummyToNodeForVerticalAlignment.has(B)?O=n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(B)[0]).displacementX:O=n.idToNodeMap.get(B).displacementX,n.nodeToRelativeConstraintMapHorizontal.get(B).forEach(function(H){if(H.right){var $=n.nodeToTempPositionMapHorizontal.get(H.right)-n.nodeToTempPositionMapHorizontal.get(B)-O;$<H.gap&&(O-=H.gap-$)}else{var $=n.nodeToTempPositionMapHorizontal.get(B)-n.nodeToTempPositionMapHorizontal.get(H.left)+O;$<H.gap&&(O+=H.gap-$)}}),n.nodeToTempPositionMapHorizontal.set(B,n.nodeToTempPositionMapHorizontal.get(B)+O),n.dummyToNodeForVerticalAlignment.has(B)?n.dummyToNodeForVerticalAlignment.get(B).forEach(function(H){n.idToNodeMap.get(H).displacementX=O}):n.idToNodeMap.get(B).displacementX=O}}),this.nodesInRelativeVertical.forEach(function(B){if(!n.fixedNodesOnHorizontal.has(B)){var O=0;n.dummyToNodeForHorizontalAlignment.has(B)?O=n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(B)[0]).displacementY:O=n.idToNodeMap.get(B).displacementY,n.nodeToRelativeConstraintMapVertical.get(B).forEach(function(H){if(H.bottom){var $=n.nodeToTempPositionMapVertical.get(H.bottom)-n.nodeToTempPositionMapVertical.get(B)-O;$<H.gap&&(O-=H.gap-$)}else{var $=n.nodeToTempPositionMapVertical.get(B)-n.nodeToTempPositionMapVertical.get(H.top)+O;$<H.gap&&(O+=H.gap-$)}}),n.nodeToTempPositionMapVertical.set(B,n.nodeToTempPositionMapVertical.get(B)+O),n.dummyToNodeForHorizontalAlignment.has(B)?n.dummyToNodeForHorizontalAlignment.get(B).forEach(function(H){n.idToNodeMap.get(H).displacementY=O}):n.idToNodeMap.get(B).displacementY=O}});else{for(var p=0;p<this.componentsOnHorizontal.length;p++){var x=this.componentsOnHorizontal[p];if(this.fixedComponentsOnHorizontal[p])for(var y=0;y<x.length;y++)this.dummyToNodeForVerticalAlignment.has(x[y])?this.dummyToNodeForVerticalAlignment.get(x[y]).forEach(function(H){n.idToNodeMap.get(H).displacementX=0}):this.idToNodeMap.get(x[y]).displacementX=0;else{for(var Q=0,z=0,y=0;y<x.length;y++)if(this.dummyToNodeForVerticalAlignment.has(x[y])){var Y=this.dummyToNodeForVerticalAlignment.get(x[y]);Q+=Y.length*this.idToNodeMap.get(Y[0]).displacementX,z+=Y.length}else Q+=this.idToNodeMap.get(x[y]).displacementX,z++;for(var rt=Q/z,y=0;y<x.length;y++)this.dummyToNodeForVerticalAlignment.has(x[y])?this.dummyToNodeForVerticalAlignment.get(x[y]).forEach(function(H){n.idToNodeMap.get(H).displacementX=rt}):this.idToNodeMap.get(x[y]).displacementX=rt}}for(var p=0;p<this.componentsOnVertical.length;p++){var x=this.componentsOnVertical[p];if(this.fixedComponentsOnVertical[p])for(var y=0;y<x.length;y++)this.dummyToNodeForHorizontalAlignment.has(x[y])?this.dummyToNodeForHorizontalAlignment.get(x[y]).forEach(function($){n.idToNodeMap.get($).displacementY=0}):this.idToNodeMap.get(x[y]).displacementY=0;else{for(var Q=0,z=0,y=0;y<x.length;y++)if(this.dummyToNodeForHorizontalAlignment.has(x[y])){var Y=this.dummyToNodeForHorizontalAlignment.get(x[y]);Q+=Y.length*this.idToNodeMap.get(Y[0]).displacementY,z+=Y.length}else Q+=this.idToNodeMap.get(x[y]).displacementY,z++;for(var rt=Q/z,y=0;y<x.length;y++)this.dummyToNodeForHorizontalAlignment.has(x[y])?this.dummyToNodeForHorizontalAlignment.get(x[y]).forEach(function(J){n.idToNodeMap.get(J).displacementY=rt}):this.idToNodeMap.get(x[y]).displacementY=rt}}}},D.prototype.calculateNodesToApplyGravitationTo=function(){var n=[],m,p=this.graphManager.getGraphs(),E=p.length,y;for(y=0;y<E;y++)m=p[y],m.updateConnected(),m.isConnected||(n=n.concat(m.getNodes()));return n},D.prototype.createBendpoints=function(){var n=[];n=n.concat(this.graphManager.getAllEdges());var m=new Set,p;for(p=0;p<n.length;p++){var E=n[p];if(!m.has(E)){var y=E.getSource(),I=E.getTarget();if(y==I)E.getBendpoints().push(new d),E.getBendpoints().push(new d),this.createDummyNodesForBendpoints(E),m.add(E);else{var M=[];if(M=M.concat(y.getEdgeListToNode(I)),M=M.concat(I.getEdgeListToNode(y)),!m.has(M[0])){if(M.length>1){var R;for(R=0;R<M.length;R++){var W=M[R];W.getBendpoints().push(new d),this.createDummyNodesForBendpoints(W)}}M.forEach(function(x){m.add(x)})}}}if(m.size==n.length)break}},D.prototype.positionNodesRadially=function(n){for(var m=new g(0,0),p=Math.ceil(Math.sqrt(n.length)),E=0,y=0,I=0,M=new d(0,0),R=0;R<n.length;R++){R%p==0&&(I=0,y=E,R!=0&&(y+=o.DEFAULT_COMPONENT_SEPERATION),E=0);var W=n[R],x=b.findCenterOfTree(W);m.x=I,m.y=y,M=D.radialLayout(W,x,m),M.y>E&&(E=Math.floor(M.y)),I=Math.floor(M.x+o.DEFAULT_COMPONENT_SEPERATION)}this.transform(new d(T.WORLD_CENTER_X-M.x/2,T.WORLD_CENTER_Y-M.y/2))},D.radialLayout=function(n,m,p){var E=Math.max(this.maxDiagonalInTree(n),o.DEFAULT_RADIAL_SEPARATION);D.branchRadialLayout(m,null,0,359,0,E);var y=V.calculateBounds(n),I=new X;I.setDeviceOrgX(y.getMinX()),I.setDeviceOrgY(y.getMinY()),I.setWorldOrgX(p.x),I.setWorldOrgY(p.y);for(var M=0;M<n.length;M++){var R=n[M];R.transform(I)}var W=new d(y.getMaxX(),y.getMaxY());return I.inverseTransformPoint(W)},D.branchRadialLayout=function(n,m,p,E,y,I){var M=(E-p+1)/2;M<0&&(M+=180);var R=(M+p)%360,W=R*S.TWO_PI/360,x=y*Math.cos(W),Q=y*Math.sin(W);n.setCenter(x,Q);var z=[];z=z.concat(n.getEdges());var Y=z.length;m!=null&&Y--;for(var rt=0,B=z.length,O,H=n.getEdgesBetween(m);H.length>1;){var $=H[0];H.splice(0,1);var tt=z.indexOf($);tt>=0&&z.splice(tt,1),B--,Y--}m!=null?O=(z.indexOf(H[0])+1)%B:O=0;for(var ht=Math.abs(E-p)/Y,J=O;rt!=Y;J=++J%B){var It=z[J].getOtherEnd(n);if(It!=m){var Nt=(p+rt*ht)%360,vt=(Nt+ht)%360;D.branchRadialLayout(It,n,Nt,vt,y+I,I),rt++}}},D.maxDiagonalInTree=function(n){for(var m=A.MIN_VALUE,p=0;p<n.length;p++){var E=n[p],y=E.getDiagonal();y>m&&(m=y)}return m},D.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},D.prototype.groupZeroDegreeMembers=function(){var n=this,m={};this.memberGroups={},this.idToDummyNode={};for(var p=[],E=this.graphManager.getAllNodes(),y=0;y<E.length;y++){var I=E[y],M=I.getParent();this.getNodeDegreeWithChildren(I)===0&&(M.id==null||!this.getToBeTiled(M))&&p.push(I)}for(var y=0;y<p.length;y++){var I=p[y],R=I.getParent().id;typeof m[R]>"u"&&(m[R]=[]),m[R]=m[R].concat(I)}Object.keys(m).forEach(function(W){if(m[W].length>1){var x="DummyCompound_"+W;n.memberGroups[x]=m[W];var Q=m[W][0].getParent(),z=new t(n.graphManager);z.id=x,z.paddingLeft=Q.paddingLeft||0,z.paddingRight=Q.paddingRight||0,z.paddingBottom=Q.paddingBottom||0,z.paddingTop=Q.paddingTop||0,n.idToDummyNode[x]=z;var Y=n.getGraphManager().add(n.newGraph(),z),rt=Q.getChild();rt.add(z);for(var B=0;B<m[W].length;B++){var O=m[W][B];rt.remove(O),Y.add(O)}}})},D.prototype.clearCompounds=function(){var n={},m={};this.performDFSOnCompounds();for(var p=0;p<this.compoundOrder.length;p++)m[this.compoundOrder[p].id]=this.compoundOrder[p],n[this.compoundOrder[p].id]=[].concat(this.compoundOrder[p].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[p].getChild()),this.compoundOrder[p].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(n,m)},D.prototype.clearZeroDegreeMembers=function(){var n=this,m=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(p){var E=n.idToDummyNode[p];if(m[p]=n.tileNodes(n.memberGroups[p],E.paddingLeft+E.paddingRight),E.rect.width=m[p].width,E.rect.height=m[p].height,E.setCenter(m[p].centerX,m[p].centerY),E.labelMarginLeft=0,E.labelMarginTop=0,o.NODE_DIMENSIONS_INCLUDE_LABELS){var y=E.rect.width,I=E.rect.height;E.labelWidth&&(E.labelPosHorizontal=="left"?(E.rect.x-=E.labelWidth,E.setWidth(y+E.labelWidth),E.labelMarginLeft=E.labelWidth):E.labelPosHorizontal=="center"&&E.labelWidth>y?(E.rect.x-=(E.labelWidth-y)/2,E.setWidth(E.labelWidth),E.labelMarginLeft=(E.labelWidth-y)/2):E.labelPosHorizontal=="right"&&E.setWidth(y+E.labelWidth)),E.labelHeight&&(E.labelPosVertical=="top"?(E.rect.y-=E.labelHeight,E.setHeight(I+E.labelHeight),E.labelMarginTop=E.labelHeight):E.labelPosVertical=="center"&&E.labelHeight>I?(E.rect.y-=(E.labelHeight-I)/2,E.setHeight(E.labelHeight),E.labelMarginTop=(E.labelHeight-I)/2):E.labelPosVertical=="bottom"&&E.setHeight(I+E.labelHeight))}})},D.prototype.repopulateCompounds=function(){for(var n=this.compoundOrder.length-1;n>=0;n--){var m=this.compoundOrder[n],p=m.id,E=m.paddingLeft,y=m.paddingTop,I=m.labelMarginLeft,M=m.labelMarginTop;this.adjustLocations(this.tiledMemberPack[p],m.rect.x,m.rect.y,E,y,I,M)}},D.prototype.repopulateZeroDegreeMembers=function(){var n=this,m=this.tiledZeroDegreePack;Object.keys(m).forEach(function(p){var E=n.idToDummyNode[p],y=E.paddingLeft,I=E.paddingTop,M=E.labelMarginLeft,R=E.labelMarginTop;n.adjustLocations(m[p],E.rect.x,E.rect.y,y,I,M,R)})},D.prototype.getToBeTiled=function(n){var m=n.id;if(this.toBeTiled[m]!=null)return this.toBeTiled[m];var p=n.getChild();if(p==null)return this.toBeTiled[m]=!1,!1;for(var E=p.getNodes(),y=0;y<E.length;y++){var I=E[y];if(this.getNodeDegree(I)>0)return this.toBeTiled[m]=!1,!1;if(I.getChild()==null){this.toBeTiled[I.id]=!1;continue}if(!this.getToBeTiled(I))return this.toBeTiled[m]=!1,!1}return this.toBeTiled[m]=!0,!0},D.prototype.getNodeDegree=function(n){n.id;for(var m=n.getEdges(),p=0,E=0;E<m.length;E++){var y=m[E];y.getSource().id!==y.getTarget().id&&(p=p+1)}return p},D.prototype.getNodeDegreeWithChildren=function(n){var m=this.getNodeDegree(n);if(n.getChild()==null)return m;for(var p=n.getChild().getNodes(),E=0;E<p.length;E++){var y=p[E];m+=this.getNodeDegreeWithChildren(y)}return m},D.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},D.prototype.fillCompexOrderByDFS=function(n){for(var m=0;m<n.length;m++){var p=n[m];p.getChild()!=null&&this.fillCompexOrderByDFS(p.getChild().getNodes()),this.getToBeTiled(p)&&this.compoundOrder.push(p)}},D.prototype.adjustLocations=function(n,m,p,E,y,I,M){m+=E+I,p+=y+M;for(var R=m,W=0;W<n.rows.length;W++){var x=n.rows[W];m=R;for(var Q=0,z=0;z<x.length;z++){var Y=x[z];Y.rect.x=m,Y.rect.y=p,m+=Y.rect.width+n.horizontalPadding,Y.rect.height>Q&&(Q=Y.rect.height)}p+=Q+n.verticalPadding}},D.prototype.tileCompoundMembers=function(n,m){var p=this;this.tiledMemberPack=[],Object.keys(n).forEach(function(E){var y=m[E];if(p.tiledMemberPack[E]=p.tileNodes(n[E],y.paddingLeft+y.paddingRight),y.rect.width=p.tiledMemberPack[E].width,y.rect.height=p.tiledMemberPack[E].height,y.setCenter(p.tiledMemberPack[E].centerX,p.tiledMemberPack[E].centerY),y.labelMarginLeft=0,y.labelMarginTop=0,o.NODE_DIMENSIONS_INCLUDE_LABELS){var I=y.rect.width,M=y.rect.height;y.labelWidth&&(y.labelPosHorizontal=="left"?(y.rect.x-=y.labelWidth,y.setWidth(I+y.labelWidth),y.labelMarginLeft=y.labelWidth):y.labelPosHorizontal=="center"&&y.labelWidth>I?(y.rect.x-=(y.labelWidth-I)/2,y.setWidth(y.labelWidth),y.labelMarginLeft=(y.labelWidth-I)/2):y.labelPosHorizontal=="right"&&y.setWidth(I+y.labelWidth)),y.labelHeight&&(y.labelPosVertical=="top"?(y.rect.y-=y.labelHeight,y.setHeight(M+y.labelHeight),y.labelMarginTop=y.labelHeight):y.labelPosVertical=="center"&&y.labelHeight>M?(y.rect.y-=(y.labelHeight-M)/2,y.setHeight(y.labelHeight),y.labelMarginTop=(y.labelHeight-M)/2):y.labelPosVertical=="bottom"&&y.setHeight(M+y.labelHeight))}})},D.prototype.tileNodes=function(n,m){var p=this.tileNodesByFavoringDim(n,m,!0),E=this.tileNodesByFavoringDim(n,m,!1),y=this.getOrgRatio(p),I=this.getOrgRatio(E),M;return I<y?M=E:M=p,M},D.prototype.getOrgRatio=function(n){var m=n.width,p=n.height,E=m/p;return E<1&&(E=1/E),E},D.prototype.calcIdealRowWidth=function(n,m){var p=o.TILING_PADDING_VERTICAL,E=o.TILING_PADDING_HORIZONTAL,y=n.length,I=0,M=0,R=0;n.forEach(function(B){I+=B.getWidth(),M+=B.getHeight(),B.getWidth()>R&&(R=B.getWidth())});var W=I/y,x=M/y,Q=Math.pow(p-E,2)+4*(W+E)*(x+p)*y,z=(E-p+Math.sqrt(Q))/(2*(W+E)),Y;m?(Y=Math.ceil(z),Y==z&&Y++):Y=Math.floor(z);var rt=Y*(W+E)-E;return R>rt&&(rt=R),rt+=E*2,rt},D.prototype.tileNodesByFavoringDim=function(n,m,p){var E=o.TILING_PADDING_VERTICAL,y=o.TILING_PADDING_HORIZONTAL,I=o.TILING_COMPARE_BY,M={rows:[],rowWidth:[],rowHeight:[],width:0,height:m,verticalPadding:E,horizontalPadding:y,centerX:0,centerY:0};I&&(M.idealRowWidth=this.calcIdealRowWidth(n,p));var R=function(O){return O.rect.width*O.rect.height},W=function(O,H){return R(H)-R(O)};n.sort(function(B,O){var H=W;return M.idealRowWidth?(H=I,H(B.id,O.id)):H(B,O)});for(var x=0,Q=0,z=0;z<n.length;z++){var Y=n[z];x+=Y.getCenterX(),Q+=Y.getCenterY()}M.centerX=x/n.length,M.centerY=Q/n.length;for(var z=0;z<n.length;z++){var Y=n[z];if(M.rows.length==0)this.insertNodeToRow(M,Y,0,m);else if(this.canAddHorizontal(M,Y.rect.width,Y.rect.height)){var rt=M.rows.length-1;M.idealRowWidth||(rt=this.getShortestRowIndex(M)),this.insertNodeToRow(M,Y,rt,m)}else this.insertNodeToRow(M,Y,M.rows.length,m);this.shiftToLastRow(M)}return M},D.prototype.insertNodeToRow=function(n,m,p,E){var y=E;if(p==n.rows.length){var I=[];n.rows.push(I),n.rowWidth.push(y),n.rowHeight.push(0)}var M=n.rowWidth[p]+m.rect.width;n.rows[p].length>0&&(M+=n.horizontalPadding),n.rowWidth[p]=M,n.width<M&&(n.width=M);var R=m.rect.height;p>0&&(R+=n.verticalPadding);var W=0;R>n.rowHeight[p]&&(W=n.rowHeight[p],n.rowHeight[p]=R,W=n.rowHeight[p]-W),n.height+=W,n.rows[p].push(m)},D.prototype.getShortestRowIndex=function(n){for(var m=-1,p=Number.MAX_VALUE,E=0;E<n.rows.length;E++)n.rowWidth[E]<p&&(m=E,p=n.rowWidth[E]);return m},D.prototype.getLongestRowIndex=function(n){for(var m=-1,p=Number.MIN_VALUE,E=0;E<n.rows.length;E++)n.rowWidth[E]>p&&(m=E,p=n.rowWidth[E]);return m},D.prototype.canAddHorizontal=function(n,m,p){if(n.idealRowWidth){var E=n.rows.length-1,y=n.rowWidth[E];return y+m+n.horizontalPadding<=n.idealRowWidth}var I=this.getShortestRowIndex(n);if(I<0)return!0;var M=n.rowWidth[I];if(M+n.horizontalPadding+m<=n.width)return!0;var R=0;n.rowHeight[I]<p&&I>0&&(R=p+n.verticalPadding-n.rowHeight[I]);var W;n.width-M>=m+n.horizontalPadding?W=(n.height+R)/(M+m+n.horizontalPadding):W=(n.height+R)/n.width,R=p+n.verticalPadding;var x;return n.width<m?x=(n.height+R)/m:x=(n.height+R)/n.width,x<1&&(x=1/x),W<1&&(W=1/W),W<x},D.prototype.shiftToLastRow=function(n){var m=this.getLongestRowIndex(n),p=n.rowWidth.length-1,E=n.rows[m],y=E[E.length-1],I=y.width+n.horizontalPadding;if(n.width-n.rowWidth[p]>I&&m!=p){E.splice(-1,1),n.rows[p].push(y),n.rowWidth[m]=n.rowWidth[m]-I,n.rowWidth[p]=n.rowWidth[p]+I,n.width=n.rowWidth[instance.getLongestRowIndex(n)];for(var M=Number.MIN_VALUE,R=0;R<E.length;R++)E[R].height>M&&(M=E[R].height);m>0&&(M+=n.verticalPadding);var W=n.rowHeight[m]+n.rowHeight[p];n.rowHeight[m]=M,n.rowHeight[p]<y.height+n.verticalPadding&&(n.rowHeight[p]=y.height+n.verticalPadding);var x=n.rowHeight[m]+n.rowHeight[p];n.height+=x-W,this.shiftToLastRow(n)}},D.prototype.tilingPreLayout=function(){o.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},D.prototype.tilingPostLayout=function(){o.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},D.prototype.reduceTrees=function(){for(var n=[],m=!0,p;m;){var E=this.graphManager.getAllNodes(),y=[];m=!1;for(var I=0;I<E.length;I++)if(p=E[I],p.getEdges().length==1&&!p.getEdges()[0].isInterGraph&&p.getChild()==null){if(o.PURE_INCREMENTAL){var M=p.getEdges()[0].getOtherEnd(p),R=new N(p.getCenterX()-M.getCenterX(),p.getCenterY()-M.getCenterY());y.push([p,p.getEdges()[0],p.getOwner(),R])}else y.push([p,p.getEdges()[0],p.getOwner()]);m=!0}if(m==!0){for(var W=[],x=0;x<y.length;x++)y[x][0].getEdges().length==1&&(W.push(y[x]),y[x][0].getOwner().remove(y[x][0]));n.push(W),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=n},D.prototype.growTree=function(n){for(var m=n.length,p=n[m-1],E,y=0;y<p.length;y++)E=p[y],this.findPlaceforPrunedNode(E),E[2].add(E[0]),E[2].add(E[1],E[1].source,E[1].target);n.splice(n.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},D.prototype.findPlaceforPrunedNode=function(n){var m,p,E=n[0];if(E==n[1].source?p=n[1].target:p=n[1].source,o.PURE_INCREMENTAL)E.setCenter(p.getCenterX()+n[3].getWidth(),p.getCenterY()+n[3].getHeight());else{var y=p.startX,I=p.finishX,M=p.startY,R=p.finishY,W=0,x=0,Q=0,z=0,Y=[W,Q,x,z];if(M>0)for(var rt=y;rt<=I;rt++)Y[0]+=this.grid[rt][M-1].length+this.grid[rt][M].length-1;if(I<this.grid.length-1)for(var rt=M;rt<=R;rt++)Y[1]+=this.grid[I+1][rt].length+this.grid[I][rt].length-1;if(R<this.grid[0].length-1)for(var rt=y;rt<=I;rt++)Y[2]+=this.grid[rt][R+1].length+this.grid[rt][R].length-1;if(y>0)for(var rt=M;rt<=R;rt++)Y[3]+=this.grid[y-1][rt].length+this.grid[y][rt].length-1;for(var B=A.MAX_VALUE,O,H,$=0;$<Y.length;$++)Y[$]<B?(B=Y[$],O=1,H=$):Y[$]==B&&O++;if(O==3&&B==0)Y[0]==0&&Y[1]==0&&Y[2]==0?m=1:Y[0]==0&&Y[1]==0&&Y[3]==0?m=0:Y[0]==0&&Y[2]==0&&Y[3]==0?m=3:Y[1]==0&&Y[2]==0&&Y[3]==0&&(m=2);else if(O==2&&B==0){var tt=Math.floor(Math.random()*2);Y[0]==0&&Y[1]==0?tt==0?m=0:m=1:Y[0]==0&&Y[2]==0?tt==0?m=0:m=2:Y[0]==0&&Y[3]==0?tt==0?m=0:m=3:Y[1]==0&&Y[2]==0?tt==0?m=1:m=2:Y[1]==0&&Y[3]==0?tt==0?m=1:m=3:tt==0?m=2:m=3}else if(O==4&&B==0){var tt=Math.floor(Math.random()*4);m=tt}else m=H;m==0?E.setCenter(p.getCenterX(),p.getCenterY()-p.getHeight()/2-l.DEFAULT_EDGE_LENGTH-E.getHeight()/2):m==1?E.setCenter(p.getCenterX()+p.getWidth()/2+l.DEFAULT_EDGE_LENGTH+E.getWidth()/2,p.getCenterY()):m==2?E.setCenter(p.getCenterX(),p.getCenterY()+p.getHeight()/2+l.DEFAULT_EDGE_LENGTH+E.getHeight()/2):E.setCenter(p.getCenterX()-p.getWidth()/2-l.DEFAULT_EDGE_LENGTH-E.getWidth()/2,p.getCenterY())}},a.exports=D}),991:((a,e,i)=>{var f=i(551).FDLayoutNode,r=i(551).IMath;function v(s,o,c,l){f.call(this,s,o,c,l)}v.prototype=Object.create(f.prototype);for(var t in f)v[t]=f[t];v.prototype.calculateDisplacement=function(){var s=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementX=s.coolingFactor*s.maxNodeDisplacement*r.sign(this.displacementX)),Math.abs(this.displacementY)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementY=s.coolingFactor*s.maxNodeDisplacement*r.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},v.prototype.propogateDisplacementToChildren=function(s,o){for(var c=this.getChild().getNodes(),l,T=0;T<c.length;T++)l=c[T],l.getChild()==null?(l.displacementX+=s,l.displacementY+=o):l.propogateDisplacementToChildren(s,o)},v.prototype.move=function(){var s=this.graphManager.getLayout();(this.child==null||this.child.getNodes().length==0)&&(this.moveBy(this.displacementX,this.displacementY),s.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY)),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},v.prototype.setPred1=function(s){this.pred1=s},v.prototype.getPred1=function(){return pred1},v.prototype.getPred2=function(){return pred2},v.prototype.setNext=function(s){this.next=s},v.prototype.getNext=function(){return next},v.prototype.setProcessed=function(s){this.processed=s},v.prototype.isProcessed=function(){return processed},a.exports=v}),902:((a,e,i)=>{function f(c){if(Array.isArray(c)){for(var l=0,T=Array(c.length);l<c.length;l++)T[l]=c[l];return T}else return Array.from(c)}var r=i(806),v=i(551).LinkedList,t=i(551).Matrix,s=i(551).SVD;function o(){}o.handleConstraints=function(c){var l={};l.fixedNodeConstraint=c.constraints.fixedNodeConstraint,l.alignmentConstraint=c.constraints.alignmentConstraint,l.relativePlacementConstraint=c.constraints.relativePlacementConstraint;for(var T=new Map,g=new Map,d=[],N=[],b=c.getAllNodes(),A=0,S=0;S<b.length;S++){var V=b[S];V.getChild()==null&&(g.set(V.id,A++),d.push(V.getCenterX()),N.push(V.getCenterY()),T.set(V.id,V))}l.relativePlacementConstraint&&l.relativePlacementConstraint.forEach(function(F){!F.gap&&F.gap!=0&&(F.left?F.gap=r.DEFAULT_EDGE_LENGTH+T.get(F.left).getWidth()/2+T.get(F.right).getWidth()/2:F.gap=r.DEFAULT_EDGE_LENGTH+T.get(F.top).getHeight()/2+T.get(F.bottom).getHeight()/2)});var X=function(P,Z){return{x:P.x-Z.x,y:P.y-Z.y}},k=function(P){var Z=0,K=0;return P.forEach(function(q){Z+=d[g.get(q)],K+=N[g.get(q)]}),{x:Z/P.size,y:K/P.size}},D=function(P,Z,K,q,at){function ct(lt,ot){var Lt=new Set(lt),ft=!0,st=!1,Xt=void 0;try{for(var Tt=ot[Symbol.iterator](),Ct;!(ft=(Ct=Tt.next()).done);ft=!0){var Bt=Ct.value;Lt.add(Bt)}}catch(bt){st=!0,Xt=bt}finally{try{!ft&&Tt.return&&Tt.return()}finally{if(st)throw Xt}}return Lt}var nt=new Map;P.forEach(function(lt,ot){nt.set(ot,0)}),P.forEach(function(lt,ot){lt.forEach(function(Lt){nt.set(Lt.id,nt.get(Lt.id)+1)})});var et=new Map,j=new Map,ut=new v;nt.forEach(function(lt,ot){lt==0?(ut.push(ot),K||(Z=="horizontal"?et.set(ot,g.has(ot)?d[g.get(ot)]:q.get(ot)):et.set(ot,g.has(ot)?N[g.get(ot)]:q.get(ot)))):et.set(ot,Number.NEGATIVE_INFINITY),K&&j.set(ot,new Set([ot]))}),K&&at.forEach(function(lt){var ot=[];if(lt.forEach(function(st){K.has(st)&&ot.push(st)}),ot.length>0){var Lt=0;ot.forEach(function(st){Z=="horizontal"?(et.set(st,g.has(st)?d[g.get(st)]:q.get(st)),Lt+=et.get(st)):(et.set(st,g.has(st)?N[g.get(st)]:q.get(st)),Lt+=et.get(st))}),Lt=Lt/ot.length,lt.forEach(function(st){K.has(st)||et.set(st,Lt)})}else{var ft=0;lt.forEach(function(st){Z=="horizontal"?ft+=g.has(st)?d[g.get(st)]:q.get(st):ft+=g.has(st)?N[g.get(st)]:q.get(st)}),ft=ft/lt.length,lt.forEach(function(st){et.set(st,ft)})}});for(var wt=function(){var ot=ut.shift(),Lt=P.get(ot);Lt.forEach(function(ft){if(et.get(ft.id)<et.get(ot)+ft.gap)if(K&&K.has(ft.id)){var st=void 0;if(Z=="horizontal"?st=g.has(ft.id)?d[g.get(ft.id)]:q.get(ft.id):st=g.has(ft.id)?N[g.get(ft.id)]:q.get(ft.id),et.set(ft.id,st),st<et.get(ot)+ft.gap){var Xt=et.get(ot)+ft.gap-st;j.get(ot).forEach(function(Tt){et.set(Tt,et.get(Tt)-Xt)})}}else et.set(ft.id,et.get(ot)+ft.gap);nt.set(ft.id,nt.get(ft.id)-1),nt.get(ft.id)==0&&ut.push(ft.id),K&&j.set(ft.id,ct(j.get(ot),j.get(ft.id)))})};ut.length!=0;)wt();if(K){var pt=new Set;P.forEach(function(lt,ot){lt.length==0&&pt.add(ot)});var xt=[];j.forEach(function(lt,ot){if(pt.has(ot)){var Lt=!1,ft=!0,st=!1,Xt=void 0;try{for(var Tt=lt[Symbol.iterator](),Ct;!(ft=(Ct=Tt.next()).done);ft=!0){var Bt=Ct.value;K.has(Bt)&&(Lt=!0)}}catch(St){st=!0,Xt=St}finally{try{!ft&&Tt.return&&Tt.return()}finally{if(st)throw Xt}}if(!Lt){var bt=!1,zt=void 0;xt.forEach(function(St,Zt){St.has([].concat(f(lt))[0])&&(bt=!0,zt=Zt)}),bt?lt.forEach(function(St){xt[zt].add(St)}):xt.push(new Set(lt))}}}),xt.forEach(function(lt,ot){var Lt=Number.POSITIVE_INFINITY,ft=Number.POSITIVE_INFINITY,st=Number.NEGATIVE_INFINITY,Xt=Number.NEGATIVE_INFINITY,Tt=!0,Ct=!1,Bt=void 0;try{for(var bt=lt[Symbol.iterator](),zt;!(Tt=(zt=bt.next()).done);Tt=!0){var St=zt.value,Zt=void 0;Z=="horizontal"?Zt=g.has(St)?d[g.get(St)]:q.get(St):Zt=g.has(St)?N[g.get(St)]:q.get(St);var Kt=et.get(St);Zt<Lt&&(Lt=Zt),Zt>st&&(st=Zt),Kt<ft&&(ft=Kt),Kt>Xt&&(Xt=Kt)}}catch(ee){Ct=!0,Bt=ee}finally{try{!Tt&&bt.return&&bt.return()}finally{if(Ct)throw Bt}}var fe=(Lt+st)/2-(ft+Xt)/2,Qt=!0,jt=!1,_t=void 0;try{for(var Jt=lt[Symbol.iterator](),ne;!(Qt=(ne=Jt.next()).done);Qt=!0){var te=ne.value;et.set(te,et.get(te)+fe)}}catch(ee){jt=!0,_t=ee}finally{try{!Qt&&Jt.return&&Jt.return()}finally{if(jt)throw _t}}})}return et},_=function(P){var Z=0,K=0,q=0,at=0;if(P.forEach(function(j){j.left?d[g.get(j.left)]-d[g.get(j.right)]>=0?Z++:K++:N[g.get(j.top)]-N[g.get(j.bottom)]>=0?q++:at++}),Z>K&&q>at)for(var ct=0;ct<g.size;ct++)d[ct]=-1*d[ct],N[ct]=-1*N[ct];else if(Z>K)for(var nt=0;nt<g.size;nt++)d[nt]=-1*d[nt];else if(q>at)for(var et=0;et<g.size;et++)N[et]=-1*N[et]},n=function(P){var Z=[],K=new v,q=new Set,at=0;return P.forEach(function(ct,nt){if(!q.has(nt)){Z[at]=[];var et=nt;for(K.push(et),q.add(et),Z[at].push(et);K.length!=0;){et=K.shift();var j=P.get(et);j.forEach(function(ut){q.has(ut.id)||(K.push(ut.id),q.add(ut.id),Z[at].push(ut.id))})}at++}}),Z},m=function(P){var Z=new Map;return P.forEach(function(K,q){Z.set(q,[])}),P.forEach(function(K,q){K.forEach(function(at){Z.get(q).push(at),Z.get(at.id).push({id:q,gap:at.gap,direction:at.direction})})}),Z},p=function(P){var Z=new Map;return P.forEach(function(K,q){Z.set(q,[])}),P.forEach(function(K,q){K.forEach(function(at){Z.get(at.id).push({id:q,gap:at.gap,direction:at.direction})})}),Z},E=[],y=[],I=!1,M=!1,R=new Set,W=new Map,x=new Map,Q=[];if(l.fixedNodeConstraint&&l.fixedNodeConstraint.forEach(function(F){R.add(F.nodeId)}),l.relativePlacementConstraint&&(l.relativePlacementConstraint.forEach(function(F){F.left?(W.has(F.left)?W.get(F.left).push({id:F.right,gap:F.gap,direction:"horizontal"}):W.set(F.left,[{id:F.right,gap:F.gap,direction:"horizontal"}]),W.has(F.right)||W.set(F.right,[])):(W.has(F.top)?W.get(F.top).push({id:F.bottom,gap:F.gap,direction:"vertical"}):W.set(F.top,[{id:F.bottom,gap:F.gap,direction:"vertical"}]),W.has(F.bottom)||W.set(F.bottom,[]))}),x=m(W),Q=n(x)),r.TRANSFORM_ON_CONSTRAINT_HANDLING){if(l.fixedNodeConstraint&&l.fixedNodeConstraint.length>1)l.fixedNodeConstraint.forEach(function(F,P){E[P]=[F.position.x,F.position.y],y[P]=[d[g.get(F.nodeId)],N[g.get(F.nodeId)]]}),I=!0;else if(l.alignmentConstraint)(function(){var F=0;if(l.alignmentConstraint.vertical){for(var P=l.alignmentConstraint.vertical,Z=function(et){var j=new Set;P[et].forEach(function(pt){j.add(pt)});var ut=new Set([].concat(f(j)).filter(function(pt){return R.has(pt)})),wt=void 0;ut.size>0?wt=d[g.get(ut.values().next().value)]:wt=k(j).x,P[et].forEach(function(pt){E[F]=[wt,N[g.get(pt)]],y[F]=[d[g.get(pt)],N[g.get(pt)]],F++})},K=0;K<P.length;K++)Z(K);I=!0}if(l.alignmentConstraint.horizontal){for(var q=l.alignmentConstraint.horizontal,at=function(et){var j=new Set;q[et].forEach(function(pt){j.add(pt)});var ut=new Set([].concat(f(j)).filter(function(pt){return R.has(pt)})),wt=void 0;ut.size>0?wt=d[g.get(ut.values().next().value)]:wt=k(j).y,q[et].forEach(function(pt){E[F]=[d[g.get(pt)],wt],y[F]=[d[g.get(pt)],N[g.get(pt)]],F++})},ct=0;ct<q.length;ct++)at(ct);I=!0}l.relativePlacementConstraint&&(M=!0)})();else if(l.relativePlacementConstraint){for(var z=0,Y=0,rt=0;rt<Q.length;rt++)Q[rt].length>z&&(z=Q[rt].length,Y=rt);if(z<x.size/2)_(l.relativePlacementConstraint),I=!1,M=!1;else{var B=new Map,O=new Map,H=[];Q[Y].forEach(function(F){W.get(F).forEach(function(P){P.direction=="horizontal"?(B.has(F)?B.get(F).push(P):B.set(F,[P]),B.has(P.id)||B.set(P.id,[]),H.push({left:F,right:P.id})):(O.has(F)?O.get(F).push(P):O.set(F,[P]),O.has(P.id)||O.set(P.id,[]),H.push({top:F,bottom:P.id}))})}),_(H),M=!1;var $=D(B,"horizontal"),tt=D(O,"vertical");Q[Y].forEach(function(F,P){y[P]=[d[g.get(F)],N[g.get(F)]],E[P]=[],$.has(F)?E[P][0]=$.get(F):E[P][0]=d[g.get(F)],tt.has(F)?E[P][1]=tt.get(F):E[P][1]=N[g.get(F)]}),I=!0}}if(I){for(var ht=void 0,J=t.transpose(E),It=t.transpose(y),Nt=0;Nt<J.length;Nt++)J[Nt]=t.multGamma(J[Nt]),It[Nt]=t.multGamma(It[Nt]);var vt=t.multMat(J,t.transpose(It)),it=s.svd(vt);ht=t.multMat(it.V,t.transpose(it.U));for(var gt=0;gt<g.size;gt++){var mt=[d[gt],N[gt]],At=[ht[0][0],ht[1][0]],Ot=[ht[0][1],ht[1][1]];d[gt]=t.dotProduct(mt,At),N[gt]=t.dotProduct(mt,Ot)}M&&_(l.relativePlacementConstraint)}}if(r.ENFORCE_CONSTRAINTS){if(l.fixedNodeConstraint&&l.fixedNodeConstraint.length>0){var Et={x:0,y:0};l.fixedNodeConstraint.forEach(function(F,P){var Z={x:d[g.get(F.nodeId)],y:N[g.get(F.nodeId)]},K=F.position,q=X(K,Z);Et.x+=q.x,Et.y+=q.y}),Et.x/=l.fixedNodeConstraint.length,Et.y/=l.fixedNodeConstraint.length,d.forEach(function(F,P){d[P]+=Et.x}),N.forEach(function(F,P){N[P]+=Et.y}),l.fixedNodeConstraint.forEach(function(F){d[g.get(F.nodeId)]=F.position.x,N[g.get(F.nodeId)]=F.position.y})}if(l.alignmentConstraint){if(l.alignmentConstraint.vertical)for(var Dt=l.alignmentConstraint.vertical,Rt=function(P){var Z=new Set;Dt[P].forEach(function(at){Z.add(at)});var K=new Set([].concat(f(Z)).filter(function(at){return R.has(at)})),q=void 0;K.size>0?q=d[g.get(K.values().next().value)]:q=k(Z).x,Z.forEach(function(at){R.has(at)||(d[g.get(at)]=q)})},Ht=0;Ht<Dt.length;Ht++)Rt(Ht);if(l.alignmentConstraint.horizontal)for(var Ut=l.alignmentConstraint.horizontal,Pt=function(P){var Z=new Set;Ut[P].forEach(function(at){Z.add(at)});var K=new Set([].concat(f(Z)).filter(function(at){return R.has(at)})),q=void 0;K.size>0?q=N[g.get(K.values().next().value)]:q=k(Z).y,Z.forEach(function(at){R.has(at)||(N[g.get(at)]=q)})},Ft=0;Ft<Ut.length;Ft++)Pt(Ft)}l.relativePlacementConstraint&&(function(){var F=new Map,P=new Map,Z=new Map,K=new Map,q=new Map,at=new Map,ct=new Set,nt=new Set;if(R.forEach(function(Gt){ct.add(Gt),nt.add(Gt)}),l.alignmentConstraint){if(l.alignmentConstraint.vertical)for(var et=l.alignmentConstraint.vertical,j=function(yt){Z.set("dummy"+yt,[]),et[yt].forEach(function(Mt){F.set(Mt,"dummy"+yt),Z.get("dummy"+yt).push(Mt),R.has(Mt)&&ct.add("dummy"+yt)}),q.set("dummy"+yt,d[g.get(et[yt][0])])},ut=0;ut<et.length;ut++)j(ut);if(l.alignmentConstraint.horizontal)for(var wt=l.alignmentConstraint.horizontal,pt=function(yt){K.set("dummy"+yt,[]),wt[yt].forEach(function(Mt){P.set(Mt,"dummy"+yt),K.get("dummy"+yt).push(Mt),R.has(Mt)&&nt.add("dummy"+yt)}),at.set("dummy"+yt,N[g.get(wt[yt][0])])},xt=0;xt<wt.length;xt++)pt(xt)}var lt=new Map,ot=new Map,Lt=function(yt){W.get(yt).forEach(function(Mt){var kt=void 0,$t=void 0;Mt.direction=="horizontal"?(kt=F.get(yt)?F.get(yt):yt,F.get(Mt.id)?$t={id:F.get(Mt.id),gap:Mt.gap,direction:Mt.direction}:$t=Mt,lt.has(kt)?lt.get(kt).push($t):lt.set(kt,[$t]),lt.has($t.id)||lt.set($t.id,[])):(kt=P.get(yt)?P.get(yt):yt,P.get(Mt.id)?$t={id:P.get(Mt.id),gap:Mt.gap,direction:Mt.direction}:$t=Mt,ot.has(kt)?ot.get(kt).push($t):ot.set(kt,[$t]),ot.has($t.id)||ot.set($t.id,[]))})},ft=!0,st=!1,Xt=void 0;try{for(var Tt=W.keys()[Symbol.iterator](),Ct;!(ft=(Ct=Tt.next()).done);ft=!0){var Bt=Ct.value;Lt(Bt)}}catch(Gt){st=!0,Xt=Gt}finally{try{!ft&&Tt.return&&Tt.return()}finally{if(st)throw Xt}}var bt=m(lt),zt=m(ot),St=n(bt),Zt=n(zt),Kt=p(lt),fe=p(ot),Qt=[],jt=[];St.forEach(function(Gt,yt){Qt[yt]=[],Gt.forEach(function(Mt){Kt.get(Mt).length==0&&Qt[yt].push(Mt)})}),Zt.forEach(function(Gt,yt){jt[yt]=[],Gt.forEach(function(Mt){fe.get(Mt).length==0&&jt[yt].push(Mt)})});var _t=D(lt,"horizontal",ct,q,Qt),Jt=D(ot,"vertical",nt,at,jt),ne=function(yt){Z.get(yt)?Z.get(yt).forEach(function(Mt){d[g.get(Mt)]=_t.get(yt)}):d[g.get(yt)]=_t.get(yt)},te=!0,ee=!1,Te=void 0;try{for(var ce=_t.keys()[Symbol.iterator](),Ne;!(te=(Ne=ce.next()).done);te=!0){var ge=Ne.value;ne(ge)}}catch(Gt){ee=!0,Te=Gt}finally{try{!te&&ce.return&&ce.return()}finally{if(ee)throw Te}}var Be=function(yt){K.get(yt)?K.get(yt).forEach(function(Mt){N[g.get(Mt)]=Jt.get(yt)}):N[g.get(yt)]=Jt.get(yt)},ue=!0,Le=!1,Ce=void 0;try{for(var de=Jt.keys()[Symbol.iterator](),Ae;!(ue=(Ae=de.next()).done);ue=!0){var ge=Ae.value;Be(ge)}}catch(Gt){Le=!0,Ce=Gt}finally{try{!ue&&de.return&&de.return()}finally{if(Le)throw Ce}}})()}for(var Yt=0;Yt<b.length;Yt++){var Vt=b[Yt];Vt.getChild()==null&&Vt.setCenter(d[g.get(Vt.id)],N[g.get(Vt.id)])}},a.exports=o}),551:(a=>{a.exports=w})},L={};function u(a){var e=L[a];if(e!==void 0)return e.exports;var i=L[a]={exports:{}};return U[a](i,i.exports,u),i.exports}var h=u(45);return h})()})})(he)),he.exports}var vr=se.exports,Oe;function pr(){return Oe||(Oe=1,(function(C,G){(function(U,L){C.exports=L(dr())})(vr,function(w){return(()=>{var U={658:(a=>{a.exports=Object.assign!=null?Object.assign.bind(Object):function(e){for(var i=arguments.length,f=Array(i>1?i-1:0),r=1;r<i;r++)f[r-1]=arguments[r];return f.forEach(function(v){Object.keys(v).forEach(function(t){return e[t]=v[t]})}),e}}),548:((a,e,i)=>{var f=(function(){function t(s,o){var c=[],l=!0,T=!1,g=void 0;try{for(var d=s[Symbol.iterator](),N;!(l=(N=d.next()).done)&&(c.push(N.value),!(o&&c.length===o));l=!0);}catch(b){T=!0,g=b}finally{try{!l&&d.return&&d.return()}finally{if(T)throw g}}return c}return function(s,o){if(Array.isArray(s))return s;if(Symbol.iterator in Object(s))return t(s,o);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),r=i(140).layoutBase.LinkedList,v={};v.getTopMostNodes=function(t){for(var s={},o=0;o<t.length;o++)s[t[o].id()]=!0;var c=t.filter(function(l,T){typeof l=="number"&&(l=T);for(var g=l.parent()[0];g!=null;){if(s[g.id()])return!1;g=g.parent()[0]}return!0});return c},v.connectComponents=function(t,s,o,c){var l=new r,T=new Set,g=[],d=void 0,N=void 0,b=void 0,A=!1,S=1,V=[],X=[],k=function(){var _=t.collection();X.push(_);var n=o[0],m=t.collection();m.merge(n).merge(n.descendants().intersection(s)),g.push(n),m.forEach(function(y){l.push(y),T.add(y),_.merge(y)});for(var p=function(){n=l.shift();var I=t.collection();n.neighborhood().nodes().forEach(function(x){s.intersection(n.edgesWith(x)).length>0&&I.merge(x)});for(var M=0;M<I.length;M++){var R=I[M];if(d=o.intersection(R.union(R.ancestors())),d!=null&&!T.has(d[0])){var W=d.union(d.descendants());W.forEach(function(x){l.push(x),T.add(x),_.merge(x),o.has(x)&&g.push(x)})}}};l.length!=0;)p();if(_.forEach(function(y){s.intersection(y.connectedEdges()).forEach(function(I){_.has(I.source())&&_.has(I.target())&&_.merge(I)})}),g.length==o.length&&(A=!0),!A||A&&S>1){N=g[0],b=N.connectedEdges().length,g.forEach(function(y){y.connectedEdges().length<b&&(b=y.connectedEdges().length,N=y)}),V.push(N.id());var E=t.collection();E.merge(g[0]),g.forEach(function(y){E.merge(y)}),g=[],o=o.difference(E),S++}};do k();while(!A);return c&&V.length>0&&c.set("dummy"+(c.size+1),V),X},v.relocateComponent=function(t,s,o){if(!o.fixedNodeConstraint){var c=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY;if(o.quality=="draft"){var d=!0,N=!1,b=void 0;try{for(var A=s.nodeIndexes[Symbol.iterator](),S;!(d=(S=A.next()).done);d=!0){var V=S.value,X=f(V,2),k=X[0],D=X[1],_=o.cy.getElementById(k);if(_){var n=_.boundingBox(),m=s.xCoords[D]-n.w/2,p=s.xCoords[D]+n.w/2,E=s.yCoords[D]-n.h/2,y=s.yCoords[D]+n.h/2;m<c&&(c=m),p>l&&(l=p),E<T&&(T=E),y>g&&(g=y)}}}catch(x){N=!0,b=x}finally{try{!d&&A.return&&A.return()}finally{if(N)throw b}}var I=t.x-(l+c)/2,M=t.y-(g+T)/2;s.xCoords=s.xCoords.map(function(x){return x+I}),s.yCoords=s.yCoords.map(function(x){return x+M})}else{Object.keys(s).forEach(function(x){var Q=s[x],z=Q.getRect().x,Y=Q.getRect().x+Q.getRect().width,rt=Q.getRect().y,B=Q.getRect().y+Q.getRect().height;z<c&&(c=z),Y>l&&(l=Y),rt<T&&(T=rt),B>g&&(g=B)});var R=t.x-(l+c)/2,W=t.y-(g+T)/2;Object.keys(s).forEach(function(x){var Q=s[x];Q.setCenter(Q.getCenterX()+R,Q.getCenterY()+W)})}}},v.calcBoundingBox=function(t,s,o,c){for(var l=Number.MAX_SAFE_INTEGER,T=Number.MIN_SAFE_INTEGER,g=Number.MAX_SAFE_INTEGER,d=Number.MIN_SAFE_INTEGER,N=void 0,b=void 0,A=void 0,S=void 0,V=t.descendants().not(":parent"),X=V.length,k=0;k<X;k++){var D=V[k];N=s[c.get(D.id())]-D.width()/2,b=s[c.get(D.id())]+D.width()/2,A=o[c.get(D.id())]-D.height()/2,S=o[c.get(D.id())]+D.height()/2,l>N&&(l=N),T<b&&(T=b),g>A&&(g=A),d<S&&(d=S)}var _={};return _.topLeftX=l,_.topLeftY=g,_.width=T-l,_.height=d-g,_},v.calcParentsWithoutChildren=function(t,s){var o=t.collection();return s.nodes(":parent").forEach(function(c){var l=!1;c.children().forEach(function(T){T.css("display")!="none"&&(l=!0)}),l||o.merge(c)}),o},a.exports=v}),816:((a,e,i)=>{var f=i(548),r=i(140).CoSELayout,v=i(140).CoSENode,t=i(140).layoutBase.PointD,s=i(140).layoutBase.DimensionD,o=i(140).layoutBase.LayoutConstants,c=i(140).layoutBase.FDLayoutConstants,l=i(140).CoSEConstants,T=function(d,N){var b=d.cy,A=d.eles,S=A.nodes(),V=A.edges(),X=void 0,k=void 0,D=void 0,_={};d.randomize&&(X=N.nodeIndexes,k=N.xCoords,D=N.yCoords);var n=function(x){return typeof x=="function"},m=function(x,Q){return n(x)?x(Q):x},p=f.calcParentsWithoutChildren(b,A),E=function W(x,Q,z,Y){for(var rt=Q.length,B=0;B<rt;B++){var O=Q[B],H=null;O.intersection(p).length==0&&(H=O.children());var $=void 0,tt=O.layoutDimensions({nodeDimensionsIncludeLabels:Y.nodeDimensionsIncludeLabels});if(O.outerWidth()!=null&&O.outerHeight()!=null)if(Y.randomize)if(!O.isParent())$=x.add(new v(z.graphManager,new t(k[X.get(O.id())]-tt.w/2,D[X.get(O.id())]-tt.h/2),new s(parseFloat(tt.w),parseFloat(tt.h))));else{var ht=f.calcBoundingBox(O,k,D,X);O.intersection(p).length==0?$=x.add(new v(z.graphManager,new t(ht.topLeftX,ht.topLeftY),new s(ht.width,ht.height))):$=x.add(new v(z.graphManager,new t(ht.topLeftX,ht.topLeftY),new s(parseFloat(tt.w),parseFloat(tt.h))))}else $=x.add(new v(z.graphManager,new t(O.position("x")-tt.w/2,O.position("y")-tt.h/2),new s(parseFloat(tt.w),parseFloat(tt.h))));else $=x.add(new v(this.graphManager));if($.id=O.data("id"),$.nodeRepulsion=m(Y.nodeRepulsion,O),$.paddingLeft=parseInt(O.css("padding")),$.paddingTop=parseInt(O.css("padding")),$.paddingRight=parseInt(O.css("padding")),$.paddingBottom=parseInt(O.css("padding")),Y.nodeDimensionsIncludeLabels&&($.labelWidth=O.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,$.labelHeight=O.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,$.labelPosVertical=O.css("text-valign"),$.labelPosHorizontal=O.css("text-halign")),_[O.data("id")]=$,isNaN($.rect.x)&&($.rect.x=0),isNaN($.rect.y)&&($.rect.y=0),H!=null&&H.length>0){var J=void 0;J=z.getGraphManager().add(z.newGraph(),$),W(J,H,z,Y)}}},y=function(x,Q,z){for(var Y=0,rt=0,B=0;B<z.length;B++){var O=z[B],H=_[O.data("source")],$=_[O.data("target")];if(H&&$&&H!==$&&H.getEdgesBetween($).length==0){var tt=Q.add(x.newEdge(),H,$);tt.id=O.id(),tt.idealLength=m(d.idealEdgeLength,O),tt.edgeElasticity=m(d.edgeElasticity,O),Y+=tt.idealLength,rt++}}d.idealEdgeLength!=null&&(rt>0?l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=Y/rt:n(d.idealEdgeLength)?l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=50:l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=d.idealEdgeLength,l.MIN_REPULSION_DIST=c.MIN_REPULSION_DIST=c.DEFAULT_EDGE_LENGTH/10,l.DEFAULT_RADIAL_SEPARATION=c.DEFAULT_EDGE_LENGTH)},I=function(x,Q){Q.fixedNodeConstraint&&(x.constraints.fixedNodeConstraint=Q.fixedNodeConstraint),Q.alignmentConstraint&&(x.constraints.alignmentConstraint=Q.alignmentConstraint),Q.relativePlacementConstraint&&(x.constraints.relativePlacementConstraint=Q.relativePlacementConstraint)};d.nestingFactor!=null&&(l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=d.nestingFactor),d.gravity!=null&&(l.DEFAULT_GRAVITY_STRENGTH=c.DEFAULT_GRAVITY_STRENGTH=d.gravity),d.numIter!=null&&(l.MAX_ITERATIONS=c.MAX_ITERATIONS=d.numIter),d.gravityRange!=null&&(l.DEFAULT_GRAVITY_RANGE_FACTOR=c.DEFAULT_GRAVITY_RANGE_FACTOR=d.gravityRange),d.gravityCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=d.gravityCompound),d.gravityRangeCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=d.gravityRangeCompound),d.initialEnergyOnIncremental!=null&&(l.DEFAULT_COOLING_FACTOR_INCREMENTAL=c.DEFAULT_COOLING_FACTOR_INCREMENTAL=d.initialEnergyOnIncremental),d.tilingCompareBy!=null&&(l.TILING_COMPARE_BY=d.tilingCompareBy),d.quality=="proof"?o.QUALITY=2:o.QUALITY=0,l.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=o.NODE_DIMENSIONS_INCLUDE_LABELS=d.nodeDimensionsIncludeLabels,l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!d.randomize,l.ANIMATE=c.ANIMATE=o.ANIMATE=d.animate,l.TILE=d.tile,l.TILING_PADDING_VERTICAL=typeof d.tilingPaddingVertical=="function"?d.tilingPaddingVertical.call():d.tilingPaddingVertical,l.TILING_PADDING_HORIZONTAL=typeof d.tilingPaddingHorizontal=="function"?d.tilingPaddingHorizontal.call():d.tilingPaddingHorizontal,l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!0,l.PURE_INCREMENTAL=!d.randomize,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=d.uniformNodeDimensions,d.step=="transformed"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!1),d.step=="enforced"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!1),d.step=="cose"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!0),d.step=="all"&&(d.randomize?l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!0),d.fixedNodeConstraint||d.alignmentConstraint||d.relativePlacementConstraint?l.TREE_REDUCTION_ON_INCREMENTAL=!1:l.TREE_REDUCTION_ON_INCREMENTAL=!0;var M=new r,R=M.newGraphManager();return E(R.addRoot(),f.getTopMostNodes(S),M,d),y(M,R,V),I(M,d),M.runLayout(),_};a.exports={coseLayout:T}}),212:((a,e,i)=>{var f=(function(){function d(N,b){for(var A=0;A<b.length;A++){var S=b[A];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(N,S.key,S)}}return function(N,b,A){return b&&d(N.prototype,b),A&&d(N,A),N}})();function r(d,N){if(!(d instanceof N))throw new TypeError("Cannot call a class as a function")}var v=i(658),t=i(548),s=i(657),o=s.spectralLayout,c=i(816),l=c.coseLayout,T=Object.freeze({quality:"default",randomize:!0,animate:!0,animationDuration:1e3,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:"all",samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:1e-7,nodeRepulsion:function(N){return 4500},idealEdgeLength:function(N){return 50},edgeElasticity:function(N){return .45},nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:function(){},stop:function(){}}),g=(function(){function d(N){r(this,d),this.options=v({},T,N)}return f(d,[{key:"run",value:function(){var b=this,A=this.options,S=A.cy,V=A.eles,X=[],k=[],D=void 0,_=[];A.fixedNodeConstraint&&(!Array.isArray(A.fixedNodeConstraint)||A.fixedNodeConstraint.length==0)&&(A.fixedNodeConstraint=void 0),A.alignmentConstraint&&(A.alignmentConstraint.vertical&&(!Array.isArray(A.alignmentConstraint.vertical)||A.alignmentConstraint.vertical.length==0)&&(A.alignmentConstraint.vertical=void 0),A.alignmentConstraint.horizontal&&(!Array.isArray(A.alignmentConstraint.horizontal)||A.alignmentConstraint.horizontal.length==0)&&(A.alignmentConstraint.horizontal=void 0)),A.relativePlacementConstraint&&(!Array.isArray(A.relativePlacementConstraint)||A.relativePlacementConstraint.length==0)&&(A.relativePlacementConstraint=void 0);var n=A.fixedNodeConstraint||A.alignmentConstraint||A.relativePlacementConstraint;n&&(A.tile=!1,A.packComponents=!1);var m=void 0,p=!1;if(S.layoutUtilities&&A.packComponents&&(m=S.layoutUtilities("get"),m||(m=S.layoutUtilities()),p=!0),V.nodes().length>0)if(p){var I=t.getTopMostNodes(A.eles.nodes());if(D=t.connectComponents(S,A.eles,I),D.forEach(function(vt){var it=vt.boundingBox();_.push({x:it.x1+it.w/2,y:it.y1+it.h/2})}),A.randomize&&D.forEach(function(vt){A.eles=vt,X.push(o(A))}),A.quality=="default"||A.quality=="proof"){var M=S.collection();if(A.tile){var R=new Map,W=[],x=[],Q=0,z={nodeIndexes:R,xCoords:W,yCoords:x},Y=[];if(D.forEach(function(vt,it){vt.edges().length==0&&(vt.nodes().forEach(function(gt,mt){M.merge(vt.nodes()[mt]),gt.isParent()||(z.nodeIndexes.set(vt.nodes()[mt].id(),Q++),z.xCoords.push(vt.nodes()[0].position().x),z.yCoords.push(vt.nodes()[0].position().y))}),Y.push(it))}),M.length>1){var rt=M.boundingBox();_.push({x:rt.x1+rt.w/2,y:rt.y1+rt.h/2}),D.push(M),X.push(z);for(var B=Y.length-1;B>=0;B--)D.splice(Y[B],1),X.splice(Y[B],1),_.splice(Y[B],1)}}D.forEach(function(vt,it){A.eles=vt,k.push(l(A,X[it])),t.relocateComponent(_[it],k[it],A)})}else D.forEach(function(vt,it){t.relocateComponent(_[it],X[it],A)});var O=new Set;if(D.length>1){var H=[],$=V.filter(function(vt){return vt.css("display")=="none"});D.forEach(function(vt,it){var gt=void 0;if(A.quality=="draft"&&(gt=X[it].nodeIndexes),vt.nodes().not($).length>0){var mt={};mt.edges=[],mt.nodes=[];var At=void 0;vt.nodes().not($).forEach(function(Ot){if(A.quality=="draft")if(!Ot.isParent())At=gt.get(Ot.id()),mt.nodes.push({x:X[it].xCoords[At]-Ot.boundingbox().w/2,y:X[it].yCoords[At]-Ot.boundingbox().h/2,width:Ot.boundingbox().w,height:Ot.boundingbox().h});else{var Et=t.calcBoundingBox(Ot,X[it].xCoords,X[it].yCoords,gt);mt.nodes.push({x:Et.topLeftX,y:Et.topLeftY,width:Et.width,height:Et.height})}else k[it][Ot.id()]&&mt.nodes.push({x:k[it][Ot.id()].getLeft(),y:k[it][Ot.id()].getTop(),width:k[it][Ot.id()].getWidth(),height:k[it][Ot.id()].getHeight()})}),vt.edges().forEach(function(Ot){var Et=Ot.source(),Dt=Ot.target();if(Et.css("display")!="none"&&Dt.css("display")!="none")if(A.quality=="draft"){var Rt=gt.get(Et.id()),Ht=gt.get(Dt.id()),Ut=[],Pt=[];if(Et.isParent()){var Ft=t.calcBoundingBox(Et,X[it].xCoords,X[it].yCoords,gt);Ut.push(Ft.topLeftX+Ft.width/2),Ut.push(Ft.topLeftY+Ft.height/2)}else Ut.push(X[it].xCoords[Rt]),Ut.push(X[it].yCoords[Rt]);if(Dt.isParent()){var Yt=t.calcBoundingBox(Dt,X[it].xCoords,X[it].yCoords,gt);Pt.push(Yt.topLeftX+Yt.width/2),Pt.push(Yt.topLeftY+Yt.height/2)}else Pt.push(X[it].xCoords[Ht]),Pt.push(X[it].yCoords[Ht]);mt.edges.push({startX:Ut[0],startY:Ut[1],endX:Pt[0],endY:Pt[1]})}else k[it][Et.id()]&&k[it][Dt.id()]&&mt.edges.push({startX:k[it][Et.id()].getCenterX(),startY:k[it][Et.id()].getCenterY(),endX:k[it][Dt.id()].getCenterX(),endY:k[it][Dt.id()].getCenterY()})}),mt.nodes.length>0&&(H.push(mt),O.add(it))}});var tt=m.packComponents(H,A.randomize).shifts;if(A.quality=="draft")X.forEach(function(vt,it){var gt=vt.xCoords.map(function(At){return At+tt[it].dx}),mt=vt.yCoords.map(function(At){return At+tt[it].dy});vt.xCoords=gt,vt.yCoords=mt});else{var ht=0;O.forEach(function(vt){Object.keys(k[vt]).forEach(function(it){var gt=k[vt][it];gt.setCenter(gt.getCenterX()+tt[ht].dx,gt.getCenterY()+tt[ht].dy)}),ht++})}}}else{var E=A.eles.boundingBox();if(_.push({x:E.x1+E.w/2,y:E.y1+E.h/2}),A.randomize){var y=o(A);X.push(y)}A.quality=="default"||A.quality=="proof"?(k.push(l(A,X[0])),t.relocateComponent(_[0],k[0],A)):t.relocateComponent(_[0],X[0],A)}var J=function(it,gt){if(A.quality=="default"||A.quality=="proof"){typeof it=="number"&&(it=gt);var mt=void 0,At=void 0,Ot=it.data("id");return k.forEach(function(Dt){Ot in Dt&&(mt={x:Dt[Ot].getRect().getCenterX(),y:Dt[Ot].getRect().getCenterY()},At=Dt[Ot])}),A.nodeDimensionsIncludeLabels&&(At.labelWidth&&(At.labelPosHorizontal=="left"?mt.x+=At.labelWidth/2:At.labelPosHorizontal=="right"&&(mt.x-=At.labelWidth/2)),At.labelHeight&&(At.labelPosVertical=="top"?mt.y+=At.labelHeight/2:At.labelPosVertical=="bottom"&&(mt.y-=At.labelHeight/2))),mt==null&&(mt={x:it.position("x"),y:it.position("y")}),{x:mt.x,y:mt.y}}else{var Et=void 0;return X.forEach(function(Dt){var Rt=Dt.nodeIndexes.get(it.id());Rt!=null&&(Et={x:Dt.xCoords[Rt],y:Dt.yCoords[Rt]})}),Et==null&&(Et={x:it.position("x"),y:it.position("y")}),{x:Et.x,y:Et.y}}};if(A.quality=="default"||A.quality=="proof"||A.randomize){var It=t.calcParentsWithoutChildren(S,V),Nt=V.filter(function(vt){return vt.css("display")=="none"});A.eles=V.not(Nt),V.nodes().not(":parent").not(Nt).layoutPositions(b,A,J),It.length>0&&It.forEach(function(vt){vt.position(J(vt))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),d})();a.exports=g}),657:((a,e,i)=>{var f=i(548),r=i(140).layoutBase.Matrix,v=i(140).layoutBase.SVD,t=function(o){var c=o.cy,l=o.eles,T=l.nodes(),g=l.nodes(":parent"),d=new Map,N=new Map,b=new Map,A=[],S=[],V=[],X=[],k=[],D=[],_=[],n=[],m=void 0,p=1e8,E=1e-9,y=o.piTol,I=o.samplingType,M=o.nodeSeparation,R=void 0,W=function(){for(var P=0,Z=0,K=!1;Z<R;){P=Math.floor(Math.random()*m),K=!1;for(var q=0;q<Z;q++)if(X[q]==P){K=!0;break}if(!K)X[Z]=P,Z++;else continue}},x=function(P,Z,K){for(var q=[],at=0,ct=0,nt=0,et=void 0,j=[],ut=0,wt=1,pt=0;pt<m;pt++)j[pt]=p;for(q[ct]=P,j[P]=0;ct>=at;){nt=q[at++];for(var xt=A[nt],lt=0;lt<xt.length;lt++)et=N.get(xt[lt]),j[et]==p&&(j[et]=j[nt]+1,q[++ct]=et);D[nt][Z]=j[nt]*M}if(K){for(var ot=0;ot<m;ot++)D[ot][Z]<k[ot]&&(k[ot]=D[ot][Z]);for(var Lt=0;Lt<m;Lt++)k[Lt]>ut&&(ut=k[Lt],wt=Lt)}return wt},Q=function(P){var Z=void 0;if(P){Z=Math.floor(Math.random()*m);for(var q=0;q<m;q++)k[q]=p;for(var at=0;at<R;at++)X[at]=Z,Z=x(Z,at,P)}else{W();for(var K=0;K<R;K++)x(X[K],K,P)}for(var ct=0;ct<m;ct++)for(var nt=0;nt<R;nt++)D[ct][nt]*=D[ct][nt];for(var et=0;et<R;et++)_[et]=[];for(var j=0;j<R;j++)for(var ut=0;ut<R;ut++)_[j][ut]=D[X[ut]][j]},z=function(){for(var P=v.svd(_),Z=P.S,K=P.U,q=P.V,at=Z[0]*Z[0]*Z[0],ct=[],nt=0;nt<R;nt++){ct[nt]=[];for(var et=0;et<R;et++)ct[nt][et]=0,nt==et&&(ct[nt][et]=Z[nt]/(Z[nt]*Z[nt]+at/(Z[nt]*Z[nt])))}n=r.multMat(r.multMat(q,ct),r.transpose(K))},Y=function(){for(var P=void 0,Z=void 0,K=[],q=[],at=[],ct=[],nt=0;nt<m;nt++)K[nt]=Math.random(),q[nt]=Math.random();K=r.normalize(K),q=r.normalize(q);for(var et=E,j=E,ut=void 0;;){for(var wt=0;wt<m;wt++)at[wt]=K[wt];if(K=r.multGamma(r.multL(r.multGamma(at),D,n)),P=r.dotProduct(at,K),K=r.normalize(K),et=r.dotProduct(at,K),ut=Math.abs(et/j),ut<=1+y&&ut>=1)break;j=et}for(var pt=0;pt<m;pt++)at[pt]=K[pt];for(j=E;;){for(var xt=0;xt<m;xt++)ct[xt]=q[xt];if(ct=r.minusOp(ct,r.multCons(at,r.dotProduct(at,ct))),q=r.multGamma(r.multL(r.multGamma(ct),D,n)),Z=r.dotProduct(ct,q),q=r.normalize(q),et=r.dotProduct(ct,q),ut=Math.abs(et/j),ut<=1+y&&ut>=1)break;j=et}for(var lt=0;lt<m;lt++)ct[lt]=q[lt];S=r.multCons(at,Math.sqrt(Math.abs(P))),V=r.multCons(ct,Math.sqrt(Math.abs(Z)))};f.connectComponents(c,l,f.getTopMostNodes(T),d),g.forEach(function(F){f.connectComponents(c,l,f.getTopMostNodes(F.descendants().intersection(l)),d)});for(var rt=0,B=0;B<T.length;B++)T[B].isParent()||N.set(T[B].id(),rt++);var O=!0,H=!1,$=void 0;try{for(var tt=d.keys()[Symbol.iterator](),ht;!(O=(ht=tt.next()).done);O=!0){var J=ht.value;N.set(J,rt++)}}catch(F){H=!0,$=F}finally{try{!O&&tt.return&&tt.return()}finally{if(H)throw $}}for(var It=0;It<N.size;It++)A[It]=[];g.forEach(function(F){for(var P=F.children().intersection(l);P.nodes(":childless").length==0;)P=P.nodes()[0].children().intersection(l);var Z=0,K=P.nodes(":childless")[0].connectedEdges().length;P.nodes(":childless").forEach(function(q,at){q.connectedEdges().length<K&&(K=q.connectedEdges().length,Z=at)}),b.set(F.id(),P.nodes(":childless")[Z].id())}),T.forEach(function(F){var P=void 0;F.isParent()?P=N.get(b.get(F.id())):P=N.get(F.id()),F.neighborhood().nodes().forEach(function(Z){l.intersection(F.edgesWith(Z)).length>0&&(Z.isParent()?A[P].push(b.get(Z.id())):A[P].push(Z.id()))})});var Nt=function(P){var Z=N.get(P),K=void 0;d.get(P).forEach(function(q){c.getElementById(q).isParent()?K=b.get(q):K=q,A[Z].push(K),A[N.get(K)].push(P)})},vt=!0,it=!1,gt=void 0;try{for(var mt=d.keys()[Symbol.iterator](),At;!(vt=(At=mt.next()).done);vt=!0){var Ot=At.value;Nt(Ot)}}catch(F){it=!0,gt=F}finally{try{!vt&&mt.return&&mt.return()}finally{if(it)throw gt}}m=N.size;var Et=void 0;if(m>2){R=m<o.sampleSize?m:o.sampleSize;for(var Dt=0;Dt<m;Dt++)D[Dt]=[];for(var Rt=0;Rt<R;Rt++)n[Rt]=[];return o.quality=="draft"||o.step=="all"?(Q(I),z(),Y(),Et={nodeIndexes:N,xCoords:S,yCoords:V}):(N.forEach(function(F,P){S.push(c.getElementById(P).position("x")),V.push(c.getElementById(P).position("y"))}),Et={nodeIndexes:N,xCoords:S,yCoords:V}),Et}else{var Ht=N.keys(),Ut=c.getElementById(Ht.next().value),Pt=Ut.position(),Ft=Ut.outerWidth();if(S.push(Pt.x),V.push(Pt.y),m==2){var Yt=c.getElementById(Ht.next().value),Vt=Yt.outerWidth();S.push(Pt.x+Ft/2+Vt/2+o.idealEdgeLength),V.push(Pt.y)}return Et={nodeIndexes:N,xCoords:S,yCoords:V},Et}};a.exports={spectralLayout:t}}),579:((a,e,i)=>{var f=i(212),r=function(t){t&&t("layout","fcose",f)};typeof cytoscape<"u"&&r(cytoscape),a.exports=r}),140:(a=>{a.exports=w})},L={};function u(a){var e=L[a];if(e!==void 0)return e.exports;var i=L[a]={exports:{}};return U[a](i,i.exports,u),i.exports}var h=u(579);return h})()})})(se)),se.exports}var yr=pr();const Er=fr(yr);var De={L:"left",R:"right",T:"top",B:"bottom"},xe={L:dt(C=>`${C},${C/2} 0,${C} 0,0`,"L"),R:dt(C=>`0,${C/2} ${C},0 ${C},${C}`,"R"),T:dt(C=>`0,0 ${C},0 ${C/2},${C}`,"T"),B:dt(C=>`${C/2},0 ${C},${C} 0,${C}`,"B")},oe={L:dt((C,G)=>C-G+2,"L"),R:dt((C,G)=>C-2,"R"),T:dt((C,G)=>C-G+2,"T"),B:dt((C,G)=>C-2,"B")},mr=dt(function(C){return Wt(C)?C==="L"?"R":"L":C==="T"?"B":"T"},"getOppositeArchitectureDirection"),Ie=dt(function(C){const G=C;return G==="L"||G==="R"||G==="T"||G==="B"},"isArchitectureDirection"),Wt=dt(function(C){const G=C;return G==="L"||G==="R"},"isArchitectureDirectionX"),qt=dt(function(C){const G=C;return G==="T"||G==="B"},"isArchitectureDirectionY"),me=dt(function(C,G){const w=Wt(C)&&qt(G),U=qt(C)&&Wt(G);return w||U},"isArchitectureDirectionXY"),Tr=dt(function(C){const G=C[0],w=C[1],U=Wt(G)&&qt(w),L=qt(G)&&Wt(w);return U||L},"isArchitecturePairXY"),Nr=dt(function(C){return C!=="LL"&&C!=="RR"&&C!=="TT"&&C!=="BB"},"isValidArchitectureDirectionPair"),pe=dt(function(C,G){const w=`${C}${G}`;return Nr(w)?w:void 0},"getArchitectureDirectionPair"),Lr=dt(function([C,G],w){const U=w[0],L=w[1];return Wt(U)?qt(L)?[C+(U==="L"?-1:1),G+(L==="T"?1:-1)]:[C+(U==="L"?-1:1),G]:Wt(L)?[C+(L==="L"?1:-1),G+(U==="T"?1:-1)]:[C,G+(U==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),Cr=dt(function(C){return C==="LT"||C==="TL"?[1,1]:C==="BL"||C==="LB"?[1,-1]:C==="BR"||C==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),Ar=dt(function(C,G){return me(C,G)?"bend":Wt(C)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),wr=dt(function(C){return C.type==="service"},"isArchitectureService"),Mr=dt(function(C){return C.type==="junction"},"isArchitectureJunction"),Fe=dt(C=>C.data(),"edgeData"),ie=dt(C=>C.data(),"nodeData"),Or=rr.architecture,be=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.elements={},this.diagramId="",this.setAccTitle=ke,this.getAccTitle=qe,this.setDiagramTitle=Qe,this.getDiagramTitle=Je,this.getAccDescription=Ke,this.setAccDescription=je,this.clear()}static{dt(this,"ArchitectureDB")}setDiagramId(C){this.diagramId=C}getDiagramId(){return this.diagramId}clear(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},this.diagramId="",_e()}addService({id:C,icon:G,in:w,title:U,iconText:L}){if(this.registeredIds[C]!==void 0)throw new Error(`The service id [${C}] is already in use by another ${this.registeredIds[C]}`);if(w!==void 0){if(C===w)throw new Error(`The service [${C}] cannot be placed within itself`);if(this.registeredIds[w]===void 0)throw new Error(`The service [${C}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[w]==="node")throw new Error(`The service [${C}]'s parent is not a group`)}this.registeredIds[C]="node",this.nodes[C]={id:C,type:"service",icon:G,iconText:L,title:U,edges:[],in:w}}getServices(){return Object.values(this.nodes).filter(wr)}addJunction({id:C,in:G}){if(this.registeredIds[C]!==void 0)throw new Error(`The junction id [${C}] is already in use by another ${this.registeredIds[C]}`);if(G!==void 0){if(C===G)throw new Error(`The junction [${C}] cannot be placed within itself`);if(this.registeredIds[G]===void 0)throw new Error(`The junction [${C}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds[G]==="node")throw new Error(`The junction [${C}]'s parent is not a group`)}this.registeredIds[C]="node",this.nodes[C]={id:C,type:"junction",edges:[],in:G}}getJunctions(){return Object.values(this.nodes).filter(Mr)}getNodes(){return Object.values(this.nodes)}getNode(C){return this.nodes[C]??null}addGroup({id:C,icon:G,in:w,title:U}){if(this.registeredIds?.[C]!==void 0)throw new Error(`The group id [${C}] is already in use by another ${this.registeredIds[C]}`);if(w!==void 0){if(C===w)throw new Error(`The group [${C}] cannot be placed within itself`);if(this.registeredIds?.[w]===void 0)throw new Error(`The group [${C}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds?.[w]==="node")throw new Error(`The group [${C}]'s parent is not a group`)}this.registeredIds[C]="group",this.groups[C]={id:C,icon:G,title:U,in:w}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:C,rhsId:G,lhsDir:w,rhsDir:U,lhsInto:L,rhsInto:u,lhsGroup:h,rhsGroup:a,title:e}){if(!Ie(w))throw new Error(`Invalid direction given for left hand side of edge ${C}--${G}. Expected (L,R,T,B) got ${String(w)}`);if(!Ie(U))throw new Error(`Invalid direction given for right hand side of edge ${C}--${G}. Expected (L,R,T,B) got ${String(U)}`);if(this.nodes[C]===void 0&&this.groups[C]===void 0)throw new Error(`The left-hand id [${C}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[G]===void 0&&this.groups[G]===void 0)throw new Error(`The right-hand id [${G}] does not yet exist. Please create the service/group before declaring an edge to it.`);const i=this.nodes[C].in,f=this.nodes[G].in;if(h&&i&&f&&i==f)throw new Error(`The left-hand id [${C}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(a&&i&&f&&i==f)throw new Error(`The right-hand id [${G}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const r={lhsId:C,lhsDir:w,lhsInto:L,lhsGroup:h,rhsId:G,rhsDir:U,rhsInto:u,rhsGroup:a,title:e};this.edges.push(r),this.nodes[C]&&this.nodes[G]&&(this.nodes[C].edges.push(this.edges[this.edges.length-1]),this.nodes[G].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}getDataStructures(){if(this.dataStructures===void 0){const C={},G=Object.entries(this.nodes).reduce((a,[e,i])=>(a[e]=i.edges.reduce((f,r)=>{const v=this.getNode(r.lhsId)?.in,t=this.getNode(r.rhsId)?.in;if(v&&t&&v!==t){const s=Ar(r.lhsDir,r.rhsDir);s!=="bend"&&(C[v]??={},C[v][t]=s,C[t]??={},C[t][v]=s)}if(r.lhsId===e){const s=pe(r.lhsDir,r.rhsDir);s&&(f[s]=r.rhsId)}else{const s=pe(r.rhsDir,r.lhsDir);s&&(f[s]=r.lhsId)}return f},{}),a),{}),w=Object.keys(G)[0],U={[w]:1},L=Object.keys(G).reduce((a,e)=>e===w?a:{...a,[e]:1},{}),u=dt(a=>{const e={[a]:[0,0]},i=[a];for(;i.length>0;){const f=i.shift();if(f){U[f]=1,delete L[f];const r=G[f],[v,t]=e[f];Object.entries(r).forEach(([s,o])=>{U[o]||(e[o]=Lr([v,t],s),i.push(o))})}}return e},"BFS"),h=[u(w)];for(;Object.keys(L).length>0;)h.push(u(Object.keys(L)[0]));this.dataStructures={adjList:G,spatialMaps:h,groupAlignments:C}}return this.dataStructures}setElementForId(C,G){this.elements[C]=G}getElementById(C){return this.elements[C]}getConfig(){return tr({...Or,...er().architecture})}getConfigField(C){return this.getConfig()[C]}},Dr=dt((C,G)=>{hr(C,G),C.groups.map(w=>G.addGroup(w)),C.services.map(w=>G.addService({...w,type:"service"})),C.junctions.map(w=>G.addJunction({...w,type:"junction"})),C.edges.map(w=>G.addEdge(w))},"populateDb"),Pe={parser:{yy:void 0},parse:dt(async C=>{const G=await lr("architecture",C);Re.debug(G);const w=Pe.parser?.yy;if(!(w instanceof be))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Dr(G,w)},"parse")},xr=dt(C=>`
2
+ .edge {
3
+ stroke-width: ${C.archEdgeWidth};
4
+ stroke: ${C.archEdgeColor};
5
+ fill: none;
6
+ }
7
+
8
+ .arrow {
9
+ fill: ${C.archEdgeArrowColor};
10
+ }
11
+
12
+ .node-bkg {
13
+ fill: none;
14
+ stroke: ${C.archGroupBorderColor};
15
+ stroke-width: ${C.archGroupBorderWidth};
16
+ stroke-dasharray: 8;
17
+ }
18
+ .node-icon-text {
19
+ display: flex;
20
+ align-items: center;
21
+ }
22
+
23
+ .node-icon-text > div {
24
+ color: #fff;
25
+ margin: 1px;
26
+ height: fit-content;
27
+ text-align: center;
28
+ overflow: hidden;
29
+ display: -webkit-box;
30
+ -webkit-box-orient: vertical;
31
+ }
32
+ `,"getStyles"),Ir=xr,re=dt(C=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${C}</g>`,"wrapIcon"),ae={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:re('<path id="b" data-name="4" d="m20,57.86c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="c" data-name="3" d="m20,45.95c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="d" data-name="2" d="m20,34.05c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse id="e" data-name="1" cx="40" cy="22.14" rx="20" ry="7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="20" y1="57.86" x2="20" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="60" y1="57.86" x2="60" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},server:{body:re('<rect x="17.5" y="17.5" width="45" height="45" rx="2" ry="2" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="32.5" x2="62.5" y2="32.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="47.5" x2="62.5" y2="47.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><g><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g>')},disk:{body:re('<rect x="20" y="15" width="40" height="50" rx="1" ry="1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="14" ry="14.58" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="4" ry="4.17" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m37.51,42.52l-4.83,13.22c-.26.71-1.1,1.02-1.76.64l-4.18-2.42c-.66-.38-.81-1.26-.33-1.84l9.01-10.8c.88-1.05,2.56-.08,2.09,1.2Z" style="fill: #fff; stroke-width: 0px;"/>')},internet:{body:re('<circle cx="40" cy="40" r="22.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="40" y1="17.5" x2="40" y2="62.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="40" x2="62.5" y2="40" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m39.99,17.51c-15.28,11.1-15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m40.01,17.51c15.28,11.1,15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="30.1" x2="60.25" y2="30.1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="49.9" x2="60.25" y2="49.9" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},cloud:{body:re('<path d="m65,47.5c0,2.76-2.24,5-5,5H20c-2.76,0-5-2.24-5-5,0-1.87,1.03-3.51,2.56-4.36-.04-.21-.06-.42-.06-.64,0-2.6,2.48-4.74,5.65-4.97,1.65-4.51,6.34-7.76,11.85-7.76.86,0,1.69.08,2.5.23,2.09-1.57,4.69-2.5,7.5-2.5,6.1,0,11.19,4.38,12.28,10.17,2.14.56,3.72,2.51,3.72,4.83,0,.03,0,.07-.01.1,2.29.46,4.01,2.48,4.01,4.9Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},unknown:sr,blank:{body:re("")}}},Rr=dt(async function(C,G,w,U){const L=w.getConfigField("padding"),u=w.getConfigField("iconSize"),h=u/2,a=u/6,e=a/2;await Promise.all(G.edges().map(async i=>{const{source:f,sourceDir:r,sourceArrow:v,sourceGroup:t,target:s,targetDir:o,targetArrow:c,targetGroup:l,label:T}=Fe(i);let{x:g,y:d}=i[0].sourceEndpoint();const{x:N,y:b}=i[0].midpoint();let{x:A,y:S}=i[0].targetEndpoint();const V=L+4;if(t&&(Wt(r)?g+=r==="L"?-V:V:d+=r==="T"?-V:V+18),l&&(Wt(o)?A+=o==="L"?-V:V:S+=o==="T"?-V:V+18),!t&&w.getNode(f)?.type==="junction"&&(Wt(r)?g+=r==="L"?h:-h:d+=r==="T"?h:-h),!l&&w.getNode(s)?.type==="junction"&&(Wt(o)?A+=o==="L"?h:-h:S+=o==="T"?h:-h),i[0]._private.rscratch){const X=C.insert("g");if(X.insert("path").attr("d",`M ${g},${d} L ${N},${b} L${A},${S} `).attr("class","edge").attr("id",`${U}-${nr(f,s,{prefix:"L"})}`),v){const k=Wt(r)?oe[r](g,a):g-e,D=qt(r)?oe[r](d,a):d-e;X.insert("polygon").attr("points",xe[r](a)).attr("transform",`translate(${k},${D})`).attr("class","arrow")}if(c){const k=Wt(o)?oe[o](A,a):A-e,D=qt(o)?oe[o](S,a):S-e;X.insert("polygon").attr("points",xe[o](a)).attr("transform",`translate(${k},${D})`).attr("class","arrow")}if(T){const k=me(r,o)?"XY":Wt(r)?"X":"Y";let D=0;k==="X"?D=Math.abs(g-A):k==="Y"?D=Math.abs(d-S)/1.5:D=Math.abs(g-A)/2;const _=X.append("g");if(await Ee(_,T,{useHtmlLabels:!1,width:D,classes:"architecture-service-label"},ye()),_.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),k==="X")_.attr("transform","translate("+N+", "+b+")");else if(k==="Y")_.attr("transform","translate("+N+", "+b+") rotate(-90)");else if(k==="XY"){const n=pe(r,o);if(n&&Tr(n)){const m=_.node().getBoundingClientRect(),[p,E]=Cr(n);_.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*p*E*45})`);const y=_.node().getBoundingClientRect();_.attr("transform",`
33
+ translate(${N}, ${b-m.height/2})
34
+ translate(${p*y.width/2}, ${E*y.height/2})
35
+ rotate(${-1*p*E*45}, 0, ${m.height/2})
36
+ `)}}}}}))},"drawEdges"),Sr=dt(async function(C,G,w,U){const u=w.getConfigField("padding")*.75,h=w.getConfigField("fontSize"),e=w.getConfigField("iconSize")/2;await Promise.all(G.nodes().map(async i=>{const f=ie(i);if(f.type==="group"){const{h:r,w:v,x1:t,y1:s}=i.boundingBox(),o=C.append("rect");o.attr("id",`${U}-group-${f.id}`).attr("x",t+e).attr("y",s+e).attr("width",v).attr("height",r).attr("class","node-bkg");const c=C.append("g");let l=t,T=s;if(f.icon){const g=c.append("g");g.html(`<g>${await ve(f.icon,{height:u,width:u,fallbackPrefix:ae.prefix})}</g>`),g.attr("transform","translate("+(l+e+1)+", "+(T+e+1)+")"),l+=u,T+=h/2-1-2}if(f.label){const g=c.append("g");await Ee(g,f.label,{useHtmlLabels:!1,width:v,classes:"architecture-service-label"},ye()),g.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),g.attr("transform","translate("+(l+e+4)+", "+(T+e+2)+")")}w.setElementForId(f.id,o)}}))},"drawGroups"),Fr=dt(async function(C,G,w,U){const L=ye();for(const u of w){const h=G.append("g"),a=C.getConfigField("iconSize");if(u.title){const r=h.append("g");await Ee(r,u.title,{useHtmlLabels:!1,width:a*1.5,classes:"architecture-service-label"},L),r.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),r.attr("transform","translate("+a/2+", "+a+")")}const e=h.append("g");if(u.icon)e.html(`<g>${await ve(u.icon,{height:a,width:a,fallbackPrefix:ae.prefix})}</g>`);else if(u.iconText){e.html(`<g>${await ve("blank",{height:a,width:a,fallbackPrefix:ae.prefix})}</g>`);const t=e.append("g").append("foreignObject").attr("width",a).attr("height",a).append("div").attr("class","node-icon-text").attr("style",`height: ${a}px;`).append("div").html(ir(u.iconText,L)),s=parseInt(window.getComputedStyle(t.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;t.attr("style",`-webkit-line-clamp: ${Math.floor((a-2)/s)};`)}else e.append("path").attr("class","node-bkg").attr("id",`${U}-node-${u.id}`).attr("d",`M0,${a} V5 Q0,0 5,0 H${a-5} Q${a},0 ${a},5 V${a} Z`);h.attr("id",`${U}-service-${u.id}`).attr("class","architecture-service");const{width:i,height:f}=h.node().getBBox();u.width=i,u.height=f,C.setElementForId(u.id,h)}return 0},"drawServices"),br=dt(function(C,G,w,U){w.forEach(L=>{const u=G.append("g"),h=C.getConfigField("iconSize");u.append("g").append("rect").attr("id",`${U}-node-${L.id}`).attr("fill-opacity","0").attr("width",h).attr("height",h),u.attr("class","architecture-junction");const{width:e,height:i}=u._groups[0][0].getBBox();u.width=e,u.height=i,C.setElementForId(L.id,u)})},"drawJunctions");or([{name:ae.prefix,icons:ae}]);Se.use(Er);function Ge(C,G,w){C.forEach(U=>{G.add({group:"nodes",data:{type:"service",id:U.id,icon:U.icon,label:U.title,parent:U.in,width:w.getConfigField("iconSize"),height:w.getConfigField("iconSize")},classes:"node-service"})})}dt(Ge,"addServices");function Ue(C,G,w){C.forEach(U=>{G.add({group:"nodes",data:{type:"junction",id:U.id,parent:U.in,width:w.getConfigField("iconSize"),height:w.getConfigField("iconSize")},classes:"node-junction"})})}dt(Ue,"addJunctions");function Ye(C,G){G.nodes().map(w=>{const U=ie(w);if(U.type==="group")return;U.x=w.position().x,U.y=w.position().y,C.getElementById(U.id).attr("transform","translate("+(U.x||0)+","+(U.y||0)+")")})}dt(Ye,"positionNodes");function Xe(C,G){C.forEach(w=>{G.add({group:"nodes",data:{type:"group",id:w.id,icon:w.icon,label:w.title,parent:w.in},classes:"node-group"})})}dt(Xe,"addGroups");function He(C,G){C.forEach(w=>{const{lhsId:U,rhsId:L,lhsInto:u,lhsGroup:h,rhsInto:a,lhsDir:e,rhsDir:i,rhsGroup:f,title:r}=w,v=me(w.lhsDir,w.rhsDir)?"segments":"straight",t={id:`${U}-${L}`,label:r,source:U,sourceDir:e,sourceArrow:u,sourceGroup:h,sourceEndpoint:e==="L"?"0 50%":e==="R"?"100% 50%":e==="T"?"50% 0":"50% 100%",target:L,targetDir:i,targetArrow:a,targetGroup:f,targetEndpoint:i==="L"?"0 50%":i==="R"?"100% 50%":i==="T"?"50% 0":"50% 100%"};G.add({group:"edges",data:t,classes:v})})}dt(He,"addEdges");function We(C,G,w){const U=dt((a,e)=>Object.entries(a).reduce((i,[f,r])=>{let v=0;const t=Object.entries(r);if(t.length===1)return i[f]=t[0][1],i;for(let s=0;s<t.length-1;s++)for(let o=s+1;o<t.length;o++){const[c,l]=t[s],[T,g]=t[o];if(w[c]?.[T]===e)i[f]??=[],i[f]=[...i[f],...l,...g];else if(c==="default"||T==="default")i[f]??=[],i[f]=[...i[f],...l,...g];else{const N=`${f}-${v++}`;i[N]=l;const b=`${f}-${v++}`;i[b]=g}}return i},{}),"flattenAlignments"),L=G.map(a=>{const e={},i={};return Object.entries(a).forEach(([f,[r,v]])=>{const t=C.getNode(f)?.in??"default";e[v]??={},e[v][t]??=[],e[v][t].push(f),i[r]??={},i[r][t]??=[],i[r][t].push(f)}),{horiz:Object.values(U(e,"horizontal")).filter(f=>f.length>1),vert:Object.values(U(i,"vertical")).filter(f=>f.length>1)}}),[u,h]=L.reduce(([a,e],{horiz:i,vert:f})=>[[...a,...i],[...e,...f]],[[],[]]);return{horizontal:u,vertical:h}}dt(We,"getAlignments");function Ve(C,G){const w=[],U=dt(u=>`${u[0]},${u[1]}`,"posToStr"),L=dt(u=>u.split(",").map(h=>parseInt(h)),"strToPos");return C.forEach(u=>{const h=Object.fromEntries(Object.entries(u).map(([f,r])=>[U(r),f])),a=[U([0,0])],e={},i={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;a.length>0;){const f=a.shift();if(f){e[f]=1;const r=h[f];if(r){const v=L(f);Object.entries(i).forEach(([t,s])=>{const o=U([v[0]+s[0],v[1]+s[1]]),c=h[o];c&&!e[o]&&(a.push(o),w.push({[De[t]]:c,[De[mr(t)]]:r,gap:1.5*G.getConfigField("iconSize")}))})}}}}),w}dt(Ve,"getRelativeConstraints");function ze(C,G,w,U,L,{spatialMaps:u,groupAlignments:h}){return new Promise(a=>{const e=ar("body").append("div").attr("id","cy").attr("style","display:none"),i=Se({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge[label]",style:{label:"data(label)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${L.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${L.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});e.remove(),Xe(w,i),Ge(C,i,L),Ue(G,i,L),He(U,i);const f=We(L,u,h),r=Ve(u,L),v=L.getConfigField("iconSize"),t=L.getConfigField("idealEdgeLengthMultiplier")*v,s=.5*v,o=L.getConfigField("edgeElasticity"),c=i.layout({name:"fcose",quality:"proof",randomize:L.getConfigField("randomize"),nodeSeparation:L.getConfigField("nodeSeparation"),numIter:L.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(l){const[T,g]=l.connectedNodes(),{parent:d}=ie(T),{parent:N}=ie(g);return d===N?t:s},edgeElasticity(l){const[T,g]=l.connectedNodes(),{parent:d}=ie(T),{parent:N}=ie(g);return d===N?o:.001},alignmentConstraint:f,relativePlacementConstraint:r});c.one("layoutstop",()=>{function l(T,g,d,N){let b,A;const{x:S,y:V}=T,{x:X,y:k}=g;A=(N-V+(S-d)*(V-k)/(S-X))/Math.sqrt(1+Math.pow((V-k)/(S-X),2)),b=Math.sqrt(Math.pow(N-V,2)+Math.pow(d-S,2)-Math.pow(A,2));const D=Math.sqrt(Math.pow(X-S,2)+Math.pow(k-V,2));b=b/D;let _=(X-S)*(N-V)-(k-V)*(d-S);switch(!0){case _>=0:_=1;break;case _<0:_=-1;break}let n=(X-S)*(d-S)+(k-V)*(N-V);switch(!0){case n>=0:n=1;break;case n<0:n=-1;break}return A=Math.abs(A)*_,b=b*n,{distances:A,weights:b}}dt(l,"getSegmentWeights"),i.startBatch();for(const T of Object.values(i.edges()))if(T.data?.()){const{x:g,y:d}=T.source().position(),{x:N,y:b}=T.target().position();if(g!==N&&d!==b){const A=T.sourceEndpoint(),S=T.targetEndpoint(),{sourceDir:V}=Fe(T),[X,k]=qt(V)?[A.x,S.y]:[S.x,A.y],{weights:D,distances:_}=l(A,S,X,k);T.style("segment-distances",_),T.style("segment-weights",D)}}i.endBatch(),c.run()}),c.run(),i.ready(l=>{Re.info("Ready",l),a(i)})})}dt(ze,"layoutArchitecture");var Pr=dt(async(C,G,w,U)=>{const L=U.db;L.setDiagramId(G);const u=L.getServices(),h=L.getJunctions(),a=L.getGroups(),e=L.getEdges(),i=L.getDataStructures(),f=$e(G),r=f.append("g");r.attr("class","architecture-edges");const v=f.append("g");v.attr("class","architecture-services");const t=f.append("g");t.attr("class","architecture-groups"),await Fr(L,v,u,G),br(L,v,h,G);const s=await ze(u,h,a,e,L,i);await Rr(r,s,L,G),await Sr(t,s,L,G),Ye(L,s),Ze(void 0,f,L.getConfigField("padding"),L.getConfigField("useMaxWidth"))},"draw"),Gr={draw:Pr},Vr={parser:Pe,get db(){return new be},renderer:Gr,styles:Ir};export{Vr as diagram};