@kabmo-labs/kabmo 0.32.1 → 0.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/index.html +1 -1
- package/dist/client/index.js +805 -637
- package/dist/client/static/js/{CsvGrid-4gx0jevc.js → CsvGrid-vze4m5ag.js} +2 -2
- package/dist/client/static/js/{DocxView-0667nr8h.js → DocxView-jbf21gmh.js} +5 -5
- package/dist/client/static/js/{DrawioView-522v0d0r.js → DrawioView-b52qybx5.js} +2 -2
- package/dist/client/static/js/{ImageView-t8xp60hm.js → ImageView-mdgzj8px.js} +1 -1
- package/dist/client/static/js/LayoutWrapper-3c49dvtt.js +2 -0
- package/dist/client/static/js/Modal-sqp864vd.js +38 -0
- package/dist/client/static/js/{PdfView-3fx172xh.js → PdfView-g06rxqb1.js} +1 -1
- package/dist/client/static/js/{SessionsView-n3agmf5t.js → SessionsView-521adxyr.js} +1 -1
- package/dist/client/static/js/{SheetView-nmrdb1b8.js → SheetView-h8xmsz7q.js} +22 -22
- package/dist/client/static/js/{SvgPreview-0xsc6xam.js → SvgPreview-1j4jvcvz.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-jj31rs62.js → abnfDiagram-O67JEVCF-pasxh4b6.js} +1 -1
- package/dist/client/static/js/architecture-7GRP2DOG-fc9kmq1w.js +1 -0
- package/dist/client/static/js/{architectureDiagram-NJMV4G6O-ay3yr7pf.js → architectureDiagram-NJMV4G6O-ms14g0bm.js} +4 -4
- package/dist/client/static/js/{astro-qgx1r159.js → astro-80bs6hvg.js} +1 -1
- package/dist/client/static/js/bash-b3rwyg5p.js +1 -0
- package/dist/client/static/js/{blockDiagram-BEXU5L5S-4x33e16k.js → blockDiagram-BEXU5L5S-ycn78fcq.js} +4 -4
- package/dist/client/static/js/{c4Diagram-YGBWAQC7-dtb81cgz.js → c4Diagram-YGBWAQC7-vn2gpjfm.js} +5 -5
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-vk5a2n9w.js → classDiagram-v2-NBCMYWYE-fyrm1pr5.js} +5 -5
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-6rbjbe19.js → cose-bilkent-JH36ORCC-ea5nwvgq.js} +1 -1
- package/dist/client/static/js/css-6vj0d308.js +1 -0
- package/dist/client/static/js/cynefin-OW5HDTMX-a4t8992q.js +1 -0
- package/dist/client/static/js/{cynefinDiagram-VND7K2PF-vyjksedr.js → cynefinDiagram-VND7K2PF-j6bsjpre.js} +2 -2
- package/dist/client/static/js/{dagre-6A5THRUB-7hey38z5.js → dagre-6A5THRUB-4smdkwv8.js} +2 -2
- package/dist/client/static/js/{diagram-22UHCM2B-aes06jde.js → diagram-22UHCM2B-9sm4kqwc.js} +19 -19
- package/dist/client/static/js/{diagram-3UASUU5V-3cfkgm3x.js → diagram-3UASUU5V-2h3qxaed.js} +1 -1
- package/dist/client/static/js/{diagram-ATOU4E4O-z8mfhwpy.js → diagram-ATOU4E4O-1981bc94.js} +3 -3
- package/dist/client/static/js/{diagram-CDSNMT55-t4821ctz.js → diagram-CDSNMT55-3vgsxavc.js} +5 -5
- package/dist/client/static/js/{diagram-MLGK6HIB-23yxbfrx.js → diagram-MLGK6HIB-c9gf2r3f.js} +2 -2
- package/dist/client/static/js/{diagram-MPIPVDR6-chhtf7v0.js → diagram-MPIPVDR6-gjqeq92d.js} +2 -2
- package/dist/client/static/js/{dockerfile-5b87ghm7.js → dockerfile-8v935dkn.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-9jejcvfr.js → ebnfDiagram-ZINNZB2B-4vbsgh99.js} +1 -1
- package/dist/client/static/js/{elixir-rpa1g4gy.js → elixir-vcbg60wv.js} +1 -1
- package/dist/client/static/js/{elk-276RUBZZ-xhhtkf58.js → elk-276RUBZZ-nca3t891.js} +1 -1
- package/dist/client/static/js/{erDiagram-OPXOYQCR-mt2apjjb.js → erDiagram-OPXOYQCR-5kfkev03.js} +6 -6
- package/dist/client/static/js/{erlang-6m6tpt72.js → erlang-qt876zrq.js} +1 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-18bdrkv5.js +1 -0
- package/dist/client/static/js/flowDiagram-KWPJA3E3-fg0yqx0h.js +1 -0
- package/dist/client/static/js/{ganttDiagram-FUAMR5RP-8cm7a29w.js → ganttDiagram-FUAMR5RP-mxc73wmq.js} +3 -3
- package/dist/client/static/js/gitGraph-4MIJSDKK-8fa6y40p.js +1 -0
- package/dist/client/static/js/{gitGraphDiagram-X574FWY7-5s0gbnx2.js → gitGraphDiagram-X574FWY7-7en3ag0e.js} +12 -12
- package/dist/client/static/js/graphql-n43pd5fs.js +1 -0
- package/dist/client/static/js/html-dbrwss36.js +1 -0
- package/dist/client/static/js/{index-ye3sr7db.js → index-0vm41je9.js} +4 -4
- package/dist/client/static/js/{index-5y7c62sm.js → index-1b0t1428.js} +5 -5
- package/dist/client/static/js/{index-9sd0vjmh.js → index-1ksg88qf.js} +2 -2
- package/dist/client/static/js/{index-brj8qwa6.js → index-1y9r4frb.js} +2 -2
- package/dist/client/static/js/index-231241f4.js +12 -0
- package/dist/client/static/js/index-2mx9ej4k.css +1 -0
- package/dist/client/static/js/{index-6q80csr0.js → index-2svnq5gg.js} +1 -1
- package/dist/client/static/js/{index-dt7e1328.js → index-354mqqra.js} +2 -2
- package/dist/client/static/js/{index-532btjmp.js → index-3zc1b0dv.js} +2 -2
- package/dist/client/static/js/{index-h06bcfds.js → index-4g46wbdw.js} +1 -1
- package/dist/client/static/js/{index-p7btwjvj.js → index-4qwzxj81.js} +3 -3
- package/dist/client/static/js/{index-3vhznzgr.js → index-52rqxgya.js} +1 -1
- package/dist/client/static/js/index-6sf2vsp2.js +1 -0
- package/dist/client/static/js/{index-xya34x4v.js → index-76zb4m0n.js} +2 -2
- package/dist/client/static/js/{index-jz9fpznk.js → index-7a64yjrm.js} +6 -6
- package/dist/client/static/js/{index-2xj14800.js → index-7y6rpsrp.js} +2 -2
- package/dist/client/static/js/{index-rg8jpbsw.js → index-8acv5b77.js} +2 -2
- package/dist/client/static/js/{index-ay34b398.js → index-a0fmsv1d.js} +19 -19
- package/dist/client/static/js/{index-2gfc25tq.js → index-ag2rmtas.js} +1 -1
- package/dist/client/static/js/{index-sa9cp6km.js → index-ahv9y42z.js} +2 -2
- package/dist/client/static/js/{index-g33knza2.js → index-b29afsjh.js} +1 -1
- package/dist/client/static/js/{index-629kfbcb.js → index-c3ek61zv.js} +2 -2
- package/dist/client/static/js/{index-360d7j0d.js → index-cd65zqba.js} +1 -1
- package/dist/client/static/js/{index-4s8ttfxj.js → index-cgzrpvzj.js} +211 -211
- package/dist/client/static/js/{index-gbfg0anm.js → index-dbe6afkf.js} +2 -2
- package/dist/client/static/js/{index-z4v1xmh1.js → index-ev3yt353.js} +2 -2
- package/dist/client/static/js/{index-ehcpzk5b.js → index-eyfcm0cy.js} +1 -1
- package/dist/client/static/js/{index-a733k69t.js → index-f7jhhqtk.js} +2 -2
- package/dist/client/static/js/{index-hc2jmzpx.js → index-fta1y9pc.js} +65 -65
- package/dist/client/static/js/{index-vd0e25p0.js → index-fvmfge3p.js} +1 -1
- package/dist/client/static/js/{index-a6k2hqke.js → index-g2dyfze9.js} +1 -1
- package/dist/client/static/js/index-h5bn97p6.js +2 -0
- package/dist/client/static/js/{index-7fdp9c7m.js → index-hf52f59k.js} +2 -2
- package/dist/client/static/js/{index-qkscve6n.js → index-j0r5hj0j.js} +2 -2
- package/dist/client/static/js/{index-ejgd8w3s.js → index-j51d5a5m.js} +28 -28
- package/dist/client/static/js/{index-kpspnztv.js → index-jsyekbx9.js} +2 -2
- package/dist/client/static/js/{index-a0bdavdr.js → index-km2zb6wk.js} +2 -2
- package/dist/client/static/js/{index-59jb53v3.js → index-nccwxv0s.js} +2 -2
- package/dist/client/static/js/{index-dnp07j57.js → index-p0nz38bm.js} +1 -1
- package/dist/client/static/js/{index-c0x6s6f7.js → index-pm6xxwz1.js} +2 -2
- package/dist/client/static/js/{index-5x95n3hx.js → index-ptcrwswj.js} +1 -1
- package/dist/client/static/js/{index-fdbfzshx.js → index-ptcwae2n.js} +2 -2
- package/dist/client/static/js/{index-h7pn9qw6.js → index-qckv9nte.js} +2 -2
- package/dist/client/static/js/{index-wzma5n54.js → index-r014brzs.js} +2 -2
- package/dist/client/static/js/{index-xj9649ac.js → index-ray2czf6.js} +7 -7
- package/dist/client/static/js/{index-qnwqaczk.js → index-rs80cwsv.js} +3 -3
- package/dist/client/static/js/{index-pf5sbesf.js → index-rytaa8ca.js} +2 -2
- package/dist/client/static/js/{index-c93sp4yh.js → index-rzxcj7cg.js} +1 -1
- package/dist/client/static/js/{index-a293pdg7.js → index-s7gkkkyz.js} +2 -2
- package/dist/client/static/js/{index-7n68yx6m.js → index-sd66wv26.js} +2 -2
- package/dist/client/static/js/{index-bbggh3f8.js → index-vhqe0y82.js} +2 -2
- package/dist/client/static/js/{index-dq1kdt03.js → index-vy6termr.js} +1 -1
- package/dist/client/static/js/{index-pf7syd7t.js → index-xx6mqpxm.js} +3 -3
- package/dist/client/static/js/{index-z5s27s26.js → index-ybm2x4vh.js} +1 -1
- package/dist/client/static/js/{index-jppt5mgc.js → index-zvfvqvn9.js} +2 -2
- package/dist/client/static/js/info-A6RAGUB7-3hk844f7.js +1 -0
- package/dist/client/static/js/{infoDiagram-VRGFBTTK-3w1yz32c.js → infoDiagram-VRGFBTTK-sef80132.js} +2 -2
- package/dist/client/static/js/ini-j5dyq6gm.js +1 -0
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-ckt471dy.js → ishikawaDiagram-OU5B5YK6-yhvepp1q.js} +6 -6
- package/dist/client/static/js/java-g4dgwbfd.js +1 -0
- package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-kfvn4w7e.js → journeyDiagram-ZHPQQLJL-5w77y95w.js} +5 -5
- package/dist/client/static/js/jsx-7t5ecz9s.js +1 -0
- package/dist/client/static/js/{julia-0j0gsjvc.js → julia-d4j6wgvf.js} +1 -1
- package/dist/client/static/js/{kanban-definition-PNTS6WVX-0q36cm83.js → kanban-definition-PNTS6WVX-02znqtna.js} +6 -6
- package/dist/client/static/js/lua-1g6w30de.js +1 -0
- package/dist/client/static/js/markdown-afx21x8c.js +1 -0
- package/dist/client/static/js/{mermaid.core-b1ssa824.js → mermaid.core-a6e6vck4.js} +6 -6
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-e2ym5en8.js → mindmap-definition-NLK3R4M7-y4n74q9x.js} +8 -8
- package/dist/client/static/js/one-dark-pro-vwhfpzr8.js +1 -0
- package/dist/client/static/js/one-light-y5t9x6zh.js +1 -0
- package/dist/client/static/js/packet-AYTQ26CC-4nj2yy10.js +1 -0
- package/dist/client/static/js/{pegDiagram-GJSIUBJH-t8bbdyhe.js → pegDiagram-GJSIUBJH-pr7ehgzb.js} +1 -1
- package/dist/client/static/js/{perl-7n7e9ncg.js → perl-srptw5vm.js} +1 -1
- package/dist/client/static/js/{php-32vy69vd.js → php-n89g3fk7.js} +1 -1
- package/dist/client/static/js/pie-WAS4IAKB-k7rde3f9.js +1 -0
- package/dist/client/static/js/{pieDiagram-5QR66LMP-envv4brj.js → pieDiagram-5QR66LMP-39wpsk08.js} +2 -2
- package/dist/client/static/js/properties-thd83wey.js +1 -0
- package/dist/client/static/js/python-264ns4xw.js +1 -0
- package/dist/client/static/js/{quadrantDiagram-O4NWA36T-72rk137a.js → quadrantDiagram-O4NWA36T-esm913km.js} +4 -4
- package/dist/client/static/js/r-qw82kkv9.js +1 -0
- package/dist/client/static/js/radar-RG4KPBEZ-513dpw4f.js +1 -0
- package/dist/client/static/js/railroad-74A4TZTK-9bqnst9c.js +1 -0
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-7367d5bv.js +1 -0
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-b806b1mj.js +1 -0
- package/dist/client/static/js/railroad-peg-WCYAUIDC-5a67rwf8.js +1 -0
- package/dist/client/static/js/{railroadDiagram-XR7U4H2S-1ej0f5hr.js → railroadDiagram-XR7U4H2S-wy2mgya6.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-rvdaknpd.js → requirementDiagram-PLB6GJNP-6z9xdgbq.js} +4 -4
- package/dist/client/static/js/{ruby-5ty7fys7.js → ruby-r81ytgcm.js} +1 -1
- package/dist/client/static/js/{rust-2geezrcs.js → rust-frn3szvc.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-nxvhtdaw.js → sankeyDiagram-IPEJSGJF-rtmxk3ys.js} +5 -5
- package/dist/client/static/js/{sass-mey5150f.js → sass-9bxped7y.js} +1 -1
- package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-n5cn5qrt.js → sequenceDiagram-PO4LG4MO-awzcrafg.js} +18 -18
- package/dist/client/static/js/{sizeCapture-INFHLROL-r074kj7s.js → sizeCapture-INFHLROL-03gy196j.js} +1 -1
- package/dist/client/static/js/sql-0e9mnrda.js +1 -0
- package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-vxghxdb0.js → stateDiagram-v2-GCMORJYK-an8v3q5n.js} +3 -3
- package/dist/client/static/js/{svelte-3ewx0hzx.js → svelte-mwtx07d9.js} +1 -1
- package/dist/client/static/js/{swimlanes-2SLR337P-qkkv894p.js → swimlanes-2SLR337P-n9yb4wcs.js} +1 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-nx5nfnf0.js +8 -0
- package/dist/client/static/js/{timeline-definition-EJHVYXUP-5tbq4ex2.js → timeline-definition-EJHVYXUP-jceb575g.js} +4 -4
- package/dist/client/static/js/treeView-Q6P3EWNA-kcy40evb.js +1 -0
- package/dist/client/static/js/treemap-WGGIJYW6-fsrvqxf4.js +1 -0
- package/dist/client/static/js/tsx-nm94hed6.js +1 -0
- package/dist/client/static/js/typescript-0s2t05jj.js +1 -0
- package/dist/client/static/js/{usecaseDiagram-POWQR4AR-6p8hf0b7.js → usecaseDiagram-POWQR4AR-888h3100.js} +39 -39
- package/dist/client/static/js/vennDiagram-UO4OBE2U-wbfz0rzv.js +34 -0
- package/dist/client/static/js/{vue-06rdf4wh.js → vue-c0rtg1wf.js} +1 -1
- package/dist/client/static/js/wardley-WFR3VGLG-36dmxww4.js +1 -0
- package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-km2x4er8.js → wardleyDiagram-VNRHLVJA-rn8c5qf9.js} +4 -4
- package/dist/client/static/js/xml-dz51p1m3.js +1 -0
- package/dist/client/static/js/{xychartDiagram-PMCCYNJV-kr3sgr4m.js → xychartDiagram-PMCCYNJV-8sn1apt6.js} +5 -5
- package/dist/client/static/js/yaml-2cfkd30t.js +1 -0
- package/package.json +4 -1
- package/src/client/components/auth/login-screen/index.tsx +1 -0
- package/src/client/components/common/MarkdownRenderer.tsx +9 -12
- package/src/client/components/common/context-usage-button/McpSection.test.tsx +98 -0
- package/src/client/components/common/context-usage-button/McpSection.tsx +12 -5
- package/src/client/components/common/context-usage-button/SessionStats.tsx +80 -0
- package/src/client/components/common/context-usage-button/index.test.tsx +26 -0
- package/src/client/components/common/context-usage-button/index.tsx +36 -28
- package/src/client/components/common/harness-glyph/brands.ts +8 -0
- package/src/client/components/mobile/LayoutWrapper.tsx +12 -3
- package/src/client/components/mobile/mobile-right-sidebar/FullDiff.tsx +9 -2
- package/src/client/components/settings/Modal.tsx +14 -84
- package/src/client/components/settings/Sidebar.tsx +3 -1
- package/src/client/components/settings/apply-side-effects.test.ts +11 -0
- package/src/client/components/settings/apply-side-effects.ts +7 -0
- package/src/client/components/settings/categories/ChatSettings.test.tsx +1 -1
- package/src/client/components/settings/categories/ChatSettings.tsx +2 -0
- package/src/client/components/settings/categories/ConnectSettings.tsx +105 -0
- package/src/client/components/settings/categories/NotificationSettings.tsx +1 -1
- package/src/client/components/settings/categories/chat-settings/ChangedFilesSection.tsx +79 -0
- package/src/client/components/settings/categories/chat-settings/groups.ts +4 -3
- package/src/client/components/settings/categories/connect-settings/DeviceTable.tsx +145 -0
- package/src/client/components/settings/categories/connect-settings/PairDialog.tsx +160 -0
- package/src/client/components/settings/categories/connect-settings/QrCode.tsx +73 -0
- package/src/client/components/settings/categories/connect-settings/ServerCard.tsx +94 -0
- package/src/client/components/settings/categories/connect-settings/TunnelRow.tsx +127 -0
- package/src/client/components/settings/category-content.tsx +116 -0
- package/src/client/components/workspace/chat-timeline/ChangedFilesSummary.test.tsx +120 -0
- package/src/client/components/workspace/chat-timeline/ChangedFilesSummary.tsx +137 -0
- package/src/client/components/workspace/chat-timeline/MessageList.tsx +33 -1
- package/src/client/components/workspace/chat-timeline/RunFooter.tsx +22 -1
- package/src/client/components/workspace/chat-timeline/TimelineBody.tsx +13 -0
- package/src/client/components/workspace/chat-timeline/index.tsx +1 -1
- package/src/client/components/workspace/diff-panel/Toolbar.tsx +17 -51
- package/src/client/components/workspace/diff-panel/index.tsx +23 -4
- package/src/client/components/workspace/diff-panel/toolbar-git-actions.tsx +94 -0
- package/src/client/components/workspace/editor/Body.tsx +2 -0
- package/src/client/data/settings/omp-schema.json +73 -3
- package/src/client/hooks/chat/timeline/change-stats.ts +57 -0
- package/src/client/hooks/chat/timeline/changed-files-setting.test.ts +31 -0
- package/src/client/hooks/chat/timeline/changed-files-setting.ts +60 -0
- package/src/client/hooks/chat/timeline/session-changes.ts +51 -0
- package/src/client/hooks/connect/use-connect-status.ts +116 -0
- package/src/client/hooks/connect/use-pairing.ts +100 -0
- package/src/client/hooks/ui/clipboard.ts +26 -0
- package/src/client/hooks/ui/notification-events.test.ts +3 -0
- package/src/client/hooks/ui/notification-events.ts +3 -1
- package/src/client/hooks/ui/notification-sound.ts +13 -6
- package/src/client/hooks/ui/ui-sounds.test.ts +15 -0
- package/src/client/hooks/workspace/diff-file.ts +11 -4
- package/src/client/hooks/workspace/file-tabs.ts +13 -4
- package/src/client/hooks/workspace/journal-diff.ts +97 -0
- package/src/client/lib/notifications/native-banner-sound.test.ts +93 -0
- package/src/client/lib/notifications/native-banner-sound.ts +46 -0
- package/src/client/lib/notifications/os.test.ts +14 -5
- package/src/client/lib/notifications/os.ts +8 -0
- package/src/client/tailwind.css +5 -0
- package/src/server/index.ts +2 -0
- package/src/server/lib/assets/font-css.server.test.ts +19 -0
- package/src/server/lib/auth/client-address.test.ts +58 -0
- package/src/server/lib/auth/client-address.ts +37 -3
- package/src/server/lib/auth/guard.ts +31 -4
- package/src/server/lib/auth/rate-limit.test.ts +25 -8
- package/src/server/lib/auth/rate-limit.ts +8 -5
- package/src/server/lib/connect/cloudflared.lifecycle.test.ts +88 -0
- package/src/server/lib/connect/cloudflared.server.test.ts +65 -0
- package/src/server/lib/connect/cloudflared.server.ts +206 -0
- package/src/server/lib/connect/devices.server.ts +192 -0
- package/src/server/lib/connect/identity.server.ts +81 -0
- package/src/server/lib/connect/pairing.server.test.ts +56 -0
- package/src/server/lib/connect/pairing.server.ts +113 -0
- package/src/server/lib/connect/qr.roundtrip.test.ts +106 -0
- package/src/server/lib/connect/qr.server.ts +36 -0
- package/src/server/lib/connect/run.server.ts +101 -0
- package/src/server/lib/connect/status.server.ts +177 -0
- package/src/server/lib/connect/tailscale.server.test.ts +117 -0
- package/src/server/lib/connect/tailscale.server.ts +172 -0
- package/src/server/lib/db/schema.ts +4 -0
- package/src/server/lib/harness/launch-table.ts +10 -0
- package/src/server/lib/omp/session/changes.test.ts +201 -0
- package/src/server/lib/omp/session/changes.ts +313 -0
- package/src/server/lib/omp/session/session-discovery.test.ts +4 -4
- package/src/server/lib/omp/session/sidebar-activity.server.test.ts +6 -2
- package/src/server/lib/omp/session/subagent-presence-scan.ts +54 -0
- package/src/server/lib/omp/session/subagent-presence-store.test.ts +1 -1
- package/src/server/lib/omp/session/subagent-presence.test.ts +115 -0
- package/src/server/lib/omp/session/subagent-presence.ts +12 -3
- package/src/server/lib/omp/session/telemetry/compute.ts +68 -0
- package/src/server/lib/omp/session/telemetry.test.ts +81 -0
- package/src/server/routes/connect/devices.ts +56 -0
- package/src/server/routes/connect/index.ts +15 -0
- package/src/server/routes/connect/pair-page.ts +177 -0
- package/src/server/routes/connect/pair.ts +158 -0
- package/src/server/routes/connect/status.ts +19 -0
- package/src/server/routes/connect/tunnels.ts +76 -0
- package/src/server/routes/health/probe.ts +5 -0
- package/src/server/routes/index.ts +2 -0
- package/src/server/routes/sessions/changes.test.ts +99 -0
- package/src/server/routes/sessions/changes.ts +79 -0
- package/src/server/routes/sessions/index.ts +7 -0
- package/src/shared/lib/chat/duration.ts +34 -0
- package/src/shared/lib/chat/timeline/changed-files.test.ts +121 -0
- package/src/shared/lib/chat/timeline/changed-files.ts +71 -0
- package/src/shared/lib/chat/timeline/fork-anchor.test.ts +3 -0
- package/src/shared/lib/connect/payload.test.ts +144 -0
- package/src/shared/lib/connect/payload.ts +229 -0
- package/src/shared/lib/connect/tier.test.ts +73 -0
- package/src/shared/lib/connect/tier.ts +105 -0
- package/src/shared/lib/connect/types.ts +99 -0
- package/src/shared/lib/format/duration.test.ts +31 -0
- package/src/shared/lib/format/duration.ts +27 -0
- package/src/shared/lib/fs/unified-diff.test.ts +53 -0
- package/src/shared/lib/fs/unified-diff.ts +127 -0
- package/src/shared/lib/harness/brand-color.ts +3 -0
- package/src/shared/lib/harness/catalog.test.ts +13 -0
- package/src/shared/lib/harness/catalog.ts +8 -1
- package/src/shared/lib/harness/fork.ts +4 -2
- package/src/shared/lib/harness/mcp-facts.ts +3 -0
- package/src/shared/lib/harness/provider-facts.ts +14 -0
- package/src/shared/lib/harness/updates.ts +5 -0
- package/src/shared/lib/icons/tint-hues.generated.ts +27 -27
- package/src/shared/lib/markdown/fira-code-fonts.css +65 -6
- package/src/shared/lib/markdown/marked.ts +7 -4
- package/src/shared/lib/markdown/mermaid-actions.test.ts +78 -0
- package/src/shared/lib/markdown/mermaid-actions.ts +45 -0
- package/src/shared/lib/markdown/mermaid.ts +41 -7
- package/src/shared/lib/omp/config/schema.test.ts +4 -2
- package/src/shared/lib/settings/defaults.ts +1 -0
- package/src/shared/lib/settings/sections.ts +6 -1
- package/src/shared/lib/workspace/file-tab-id.ts +9 -0
- package/src/shared/types/context.ts +18 -0
- package/src/shared/types/fs.ts +21 -0
- package/src/shared/types/index.ts +1 -0
- package/src/shared/types/omp/session.ts +6 -0
- package/src/shared/types/session-changes.ts +64 -0
- package/src/shared/types/settings/state.ts +10 -0
- package/dist/client/static/js/LayoutWrapper-xjnveecv.js +0 -2
- package/dist/client/static/js/Modal-k2jr9hc4.js +0 -38
- package/dist/client/static/js/architecture-7GRP2DOG-1y9zvsyt.js +0 -1
- package/dist/client/static/js/bash-m0qjsyy0.js +0 -1
- package/dist/client/static/js/css-t4ngafan.js +0 -1
- package/dist/client/static/js/cynefin-OW5HDTMX-k2188qcq.js +0 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-pdr0qn0n.js +0 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-zvz0mxne.js +0 -1
- package/dist/client/static/js/gitGraph-4MIJSDKK-wmqf046s.js +0 -1
- package/dist/client/static/js/graphql-692h0n2x.js +0 -1
- package/dist/client/static/js/html-pv88ny12.js +0 -1
- package/dist/client/static/js/index-61tm0v57.js +0 -1
- package/dist/client/static/js/index-e94a1en0.css +0 -1
- package/dist/client/static/js/index-kg86e3sy.js +0 -12
- package/dist/client/static/js/index-nmmxb4va.js +0 -2
- package/dist/client/static/js/info-A6RAGUB7-zg3twte6.js +0 -1
- package/dist/client/static/js/ini-cg0a5wm3.js +0 -1
- package/dist/client/static/js/java-vcck089n.js +0 -1
- package/dist/client/static/js/jsx-ht9zyzwa.js +0 -1
- package/dist/client/static/js/lua-ke895s2q.js +0 -1
- package/dist/client/static/js/markdown-gwmsh53r.js +0 -1
- package/dist/client/static/js/one-dark-pro-4geyzhjj.js +0 -1
- package/dist/client/static/js/one-light-tqssjm9t.js +0 -1
- package/dist/client/static/js/packet-AYTQ26CC-3pav51g0.js +0 -1
- package/dist/client/static/js/pie-WAS4IAKB-wqfh7zdk.js +0 -1
- package/dist/client/static/js/properties-mzvvbqg5.js +0 -1
- package/dist/client/static/js/python-3w64wsyd.js +0 -1
- package/dist/client/static/js/r-32re2zwb.js +0 -1
- package/dist/client/static/js/radar-RG4KPBEZ-w7qjdr2g.js +0 -1
- package/dist/client/static/js/railroad-74A4TZTK-rhr99kkj.js +0 -1
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-c4jeea3m.js +0 -1
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-x2ee66ex.js +0 -1
- package/dist/client/static/js/railroad-peg-WCYAUIDC-yw8wjfwg.js +0 -1
- package/dist/client/static/js/sql-g8wcshpc.js +0 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-y81h9n27.js +0 -8
- package/dist/client/static/js/treeView-Q6P3EWNA-ekz05ccs.js +0 -1
- package/dist/client/static/js/treemap-WGGIJYW6-aq6qymjr.js +0 -1
- package/dist/client/static/js/tsx-0p183w2f.js +0 -1
- package/dist/client/static/js/typescript-t9a5jyvv.js +0 -1
- package/dist/client/static/js/vennDiagram-UO4OBE2U-7k5jsxf9.js +0 -34
- package/dist/client/static/js/wardley-WFR3VGLG-z34tj4y3.js +0 -1
- package/dist/client/static/js/xml-81hxjjt4.js +0 -1
- package/dist/client/static/js/yaml-yssayv8a.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t,l,h}from"./index-hc2jmzpx.js";import{Qr}from"./index-xj9649ac.js";import{an,yn}from"./index-c0x6s6f7.js";var q=yn(function(Z,K){(function(w,L){if(typeof Z==="object"&&typeof K==="object")K.exports=L();else if(typeof define==="function"&&define.amd)define([],L);else if(typeof Z==="object")Z.layoutBase=L();else w.layoutBase=L()})(Z,function(){return function(m){var w={};function L(s){if(w[s])return w[s].exports;var r=w[s]={i:s,l:!1,exports:{}};return m[s].call(r.exports,r,r.exports,L),r.l=!0,r.exports}return L.m=m,L.c=w,L.i=function(s){return s},L.d=function(s,r,e){if(!L.o(s,r))Object.defineProperty(s,r,{configurable:!1,enumerable:!0,get:e})},L.n=function(s){var r=s&&s.__esModule?function(){return s.default}:function(){return s};return L.d(r,"a",r),r},L.o=function(s,r){return Object.prototype.hasOwnProperty.call(s,r)},L.p="",L(L.s=26)}([function(m,w,L){function s(){}s.QUALITY=1,s.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,s.DEFAULT_INCREMENTAL=!1,s.DEFAULT_ANIMATION_ON_LAYOUT=!0,s.DEFAULT_ANIMATION_DURING_LAYOUT=!1,s.DEFAULT_ANIMATION_PERIOD=50,s.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,s.DEFAULT_GRAPH_MARGIN=15,s.NODE_DIMENSIONS_INCLUDE_LABELS=!1,s.SIMPLE_NODE_SIZE=40,s.SIMPLE_NODE_HALF_SIZE=s.SIMPLE_NODE_SIZE/2,s.EMPTY_COMPOUND_NODE_SIZE=40,s.MIN_EDGE_LENGTH=1,s.WORLD_BOUNDARY=1e6,s.INITIAL_WORLD_BOUNDARY=s.WORLD_BOUNDARY/1000,s.WORLD_CENTER_X=1200,s.WORLD_CENTER_Y=900,m.exports=s},function(m,w,L){var s=L(2),r=L(8),e=L(9);function i(c,o,y){s.call(this,y),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=y,this.bendpoints=[],this.source=c,this.target=o}i.prototype=Object.create(s.prototype);for(var u in s)i[u]=s[u];i.prototype.getSource=function(){return this.source},i.prototype.getTarget=function(){return this.target},i.prototype.isInterGraph=function(){return this.isInterGraph},i.prototype.getLength=function(){return this.length},i.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},i.prototype.getBendpoints=function(){return this.bendpoints},i.prototype.getLca=function(){return this.lca},i.prototype.getSourceInLca=function(){return this.sourceInLca},i.prototype.getTargetInLca=function(){return this.targetInLca},i.prototype.getOtherEnd=function(c){if(this.source===c)return this.target;else if(this.target===c)return this.source;else throw"Node is not incident with this edge"},i.prototype.getOtherEndInGraph=function(c,o){var y=this.getOtherEnd(c),n=o.getGraphManager().getRoot();while(!0){if(y.getOwner()==o)return y;if(y.getOwner()==n)break;y=y.getOwner().getParent()}return null},i.prototype.updateLength=function(){var c=[,,,,];if(this.isOverlapingSourceAndTarget=r.getIntersection(this.target.getRect(),this.source.getRect(),c),!this.isOverlapingSourceAndTarget){if(this.lengthX=c[0]-c[2],this.lengthY=c[1]-c[3],Math.abs(this.lengthX)<1)this.lengthX=e.sign(this.lengthX);if(Math.abs(this.lengthY)<1)this.lengthY=e.sign(this.lengthY);this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)}},i.prototype.updateLengthSimple=function(){if(this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1)this.lengthX=e.sign(this.lengthX);if(Math.abs(this.lengthY)<1)this.lengthY=e.sign(this.lengthY);this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},m.exports=i},function(m,w,L){function s(r){this.vGraphObject=r}m.exports=s},function(m,w,L){var s=L(2),r=L(10),e=L(13),i=L(0),u=L(16),c=L(4);function o(n,g,f,E){if(f==null&&E==null)E=g;if(s.call(this,E),n.graphManager!=null)n=n.graphManager;if(this.estimatedSize=r.MIN_VALUE,this.inclusionTreeDepth=r.MAX_VALUE,this.vGraphObject=E,this.edges=[],this.graphManager=n,f!=null&&g!=null)this.rect=new e(g.x,g.y,f.width,f.height);else this.rect=new e}o.prototype=Object.create(s.prototype);for(var y in s)o[y]=s[y];o.prototype.getEdges=function(){return this.edges},o.prototype.getChild=function(){return this.child},o.prototype.getOwner=function(){return this.owner},o.prototype.getWidth=function(){return this.rect.width},o.prototype.setWidth=function(n){this.rect.width=n},o.prototype.getHeight=function(){return this.rect.height},o.prototype.setHeight=function(n){this.rect.height=n},o.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},o.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},o.prototype.getCenter=function(){return new c(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},o.prototype.getLocation=function(){return new c(this.rect.x,this.rect.y)},o.prototype.getRect=function(){return this.rect},o.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},o.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},o.prototype.setRect=function(n,g){this.rect.x=n.x,this.rect.y=n.y,this.rect.width=g.width,this.rect.height=g.height},o.prototype.setCenter=function(n,g){this.rect.x=n-this.rect.width/2,this.rect.y=g-this.rect.height/2},o.prototype.setLocation=function(n,g){this.rect.x=n,this.rect.y=g},o.prototype.moveBy=function(n,g){this.rect.x+=n,this.rect.y+=g},o.prototype.getEdgeListToNode=function(n){var g=[],f,E=this;return E.edges.forEach(function(T){if(T.target==n){if(T.source!=E)throw"Incorrect edge source!";g.push(T)}}),g},o.prototype.getEdgesBetween=function(n){var g=[],f,E=this;return E.edges.forEach(function(T){if(!(T.source==E||T.target==E))throw"Incorrect edge source and/or target";if(T.target==n||T.source==n)g.push(T)}),g},o.prototype.getNeighborsList=function(){var n=new Set,g=this;return g.edges.forEach(function(f){if(f.source==g)n.add(f.target);else{if(f.target!=g)throw"Incorrect incidency!";n.add(f.source)}}),n},o.prototype.withChildren=function(){var n=new Set,g,f;if(n.add(this),this.child!=null){var E=this.child.getNodes();for(var T=0;T<E.length;T++)g=E[T],f=g.withChildren(),f.forEach(function(N){n.add(N)})}return n},o.prototype.getNoOfChildren=function(){var n=0,g;if(this.child==null)n=1;else{var f=this.child.getNodes();for(var E=0;E<f.length;E++)g=f[E],n+=g.getNoOfChildren()}if(n==0)n=1;return n},o.prototype.getEstimatedSize=function(){if(this.estimatedSize==r.MIN_VALUE)throw"assert failed";return this.estimatedSize},o.prototype.calcEstimatedSize=function(){if(this.child==null)return this.estimatedSize=(this.rect.width+this.rect.height)/2;else return this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize},o.prototype.scatter=function(){var n,g,f=-i.INITIAL_WORLD_BOUNDARY,E=i.INITIAL_WORLD_BOUNDARY;n=i.WORLD_CENTER_X+u.nextDouble()*(E-f)+f;var T=-i.INITIAL_WORLD_BOUNDARY,N=i.INITIAL_WORLD_BOUNDARY;g=i.WORLD_CENTER_Y+u.nextDouble()*(N-T)+T,this.rect.x=n,this.rect.y=g},o.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var n=this.getChild();if(n.updateBounds(!0),this.rect.x=n.getLeft(),this.rect.y=n.getTop(),this.setWidth(n.getRight()-n.getLeft()),this.setHeight(n.getBottom()-n.getTop()),i.NODE_DIMENSIONS_INCLUDE_LABELS){var g=n.getRight()-n.getLeft(),f=n.getBottom()-n.getTop();if(this.labelWidth>g)this.rect.x-=(this.labelWidth-g)/2,this.setWidth(this.labelWidth);if(this.labelHeight>f){if(this.labelPos=="center")this.rect.y-=(this.labelHeight-f)/2;else if(this.labelPos=="top")this.rect.y-=this.labelHeight-f;this.setHeight(this.labelHeight)}}}},o.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==r.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},o.prototype.transform=function(n){var g=this.rect.x;if(g>i.WORLD_BOUNDARY)g=i.WORLD_BOUNDARY;else if(g<-i.WORLD_BOUNDARY)g=-i.WORLD_BOUNDARY;var f=this.rect.y;if(f>i.WORLD_BOUNDARY)f=i.WORLD_BOUNDARY;else if(f<-i.WORLD_BOUNDARY)f=-i.WORLD_BOUNDARY;var E=new c(g,f),T=n.inverseTransformPoint(E);this.setLocation(T.x,T.y)},o.prototype.getLeft=function(){return this.rect.x},o.prototype.getRight=function(){return this.rect.x+this.rect.width},o.prototype.getTop=function(){return this.rect.y},o.prototype.getBottom=function(){return this.rect.y+this.rect.height},o.prototype.getParent=function(){if(this.owner==null)return null;return this.owner.getParent()},m.exports=o},function(m,w,L){function s(r,e){if(r==null&&e==null)this.x=0,this.y=0;else this.x=r,this.y=e}s.prototype.getX=function(){return this.x},s.prototype.getY=function(){return this.y},s.prototype.setX=function(r){this.x=r},s.prototype.setY=function(r){this.y=r},s.prototype.getDifference=function(r){return new DimensionD(this.x-r.x,this.y-r.y)},s.prototype.getCopy=function(){return new s(this.x,this.y)},s.prototype.translate=function(r){return this.x+=r.width,this.y+=r.height,this},m.exports=s},function(m,w,L){var s=L(2),r=L(10),e=L(0),i=L(6),u=L(3),c=L(1),o=L(13),y=L(12),n=L(11);function g(E,T,N){if(s.call(this,N),this.estimatedSize=r.MIN_VALUE,this.margin=e.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=E,T!=null&&T instanceof i)this.graphManager=T;else if(T!=null&&T instanceof Layout)this.graphManager=T.graphManager}g.prototype=Object.create(s.prototype);for(var f in s)g[f]=s[f];g.prototype.getNodes=function(){return this.nodes},g.prototype.getEdges=function(){return this.edges},g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getParent=function(){return this.parent},g.prototype.getLeft=function(){return this.left},g.prototype.getRight=function(){return this.right},g.prototype.getTop=function(){return this.top},g.prototype.getBottom=function(){return this.bottom},g.prototype.isConnected=function(){return this.isConnected},g.prototype.add=function(E,T,N){if(T==null&&N==null){var v=E;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(v)>-1)throw"Node already in graph!";return v.owner=this,this.getNodes().push(v),v}else{var O=E;if(!(this.getNodes().indexOf(T)>-1&&this.getNodes().indexOf(N)>-1))throw"Source or target not in graph!";if(!(T.owner==N.owner&&T.owner==this))throw"Both owners must be this graph!";if(T.owner!=N.owner)return null;if(O.source=T,O.target=N,O.isInterGraph=!1,this.getEdges().push(O),T.edges.push(O),N!=T)N.edges.push(O);return O}},g.prototype.remove=function(E){var T=E;if(E instanceof u){if(T==null)throw"Node is null!";if(!(T.owner!=null&&T.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";var N=T.edges.slice(),v,O=N.length;for(var D=0;D<O;D++)if(v=N[D],v.isInterGraph)this.graphManager.remove(v);else v.source.owner.remove(v);var R=this.nodes.indexOf(T);if(R==-1)throw"Node not in owner node list!";this.nodes.splice(R,1)}else if(E instanceof c){var v=E;if(v==null)throw"Edge is null!";if(!(v.source!=null&&v.target!=null))throw"Source and/or target is null!";if(!(v.source.owner!=null&&v.target.owner!=null&&v.source.owner==this&&v.target.owner==this))throw"Source and/or target owner is invalid!";var a=v.source.edges.indexOf(v),p=v.target.edges.indexOf(v);if(!(a>-1&&p>-1))throw"Source and/or target doesn't know this edge!";if(v.source.edges.splice(a,1),v.target!=v.source)v.target.edges.splice(p,1);var R=v.source.owner.getEdges().indexOf(v);if(R==-1)throw"Not in owner's edge list!";v.source.owner.getEdges().splice(R,1)}},g.prototype.updateLeftTop=function(){var{MAX_VALUE:E,MAX_VALUE:T}=r,N,v,O,D=this.getNodes(),R=D.length;for(var a=0;a<R;a++){var p=D[a];if(N=p.getTop(),v=p.getLeft(),E>N)E=N;if(T>v)T=v}if(E==r.MAX_VALUE)return null;if(D[0].getParent().paddingLeft!=null)O=D[0].getParent().paddingLeft;else O=this.margin;return this.left=T-O,this.top=E-O,new y(this.left,this.top)},g.prototype.updateBounds=function(E){var T=r.MAX_VALUE,N=-r.MAX_VALUE,v=r.MAX_VALUE,O=-r.MAX_VALUE,D,R,a,p,d,A=this.nodes,I=A.length;for(var C=0;C<I;C++){var M=A[C];if(E&&M.child!=null)M.updateBounds();if(D=M.getLeft(),R=M.getRight(),a=M.getTop(),p=M.getBottom(),T>D)T=D;if(N<R)N=R;if(v>a)v=a;if(O<p)O=p}var G=new o(T,v,N-T,O-v);if(T==r.MAX_VALUE)this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom();if(A[0].getParent().paddingLeft!=null)d=A[0].getParent().paddingLeft;else d=this.margin;this.left=G.x-d,this.right=G.x+G.width+d,this.top=G.y-d,this.bottom=G.y+G.height+d},g.calculateBounds=function(E){var T=r.MAX_VALUE,N=-r.MAX_VALUE,v=r.MAX_VALUE,O=-r.MAX_VALUE,D,R,a,p,d=E.length;for(var A=0;A<d;A++){var I=E[A];if(D=I.getLeft(),R=I.getRight(),a=I.getTop(),p=I.getBottom(),T>D)T=D;if(N<R)N=R;if(v>a)v=a;if(O<p)O=p}var C=new o(T,v,N-T,O-v);return C},g.prototype.getInclusionTreeDepth=function(){if(this==this.graphManager.getRoot())return 1;else return this.parent.getInclusionTreeDepth()},g.prototype.getEstimatedSize=function(){if(this.estimatedSize==r.MIN_VALUE)throw"assert failed";return this.estimatedSize},g.prototype.calcEstimatedSize=function(){var E=0,T=this.nodes,N=T.length;for(var v=0;v<N;v++){var O=T[v];E+=O.calcEstimatedSize()}if(E==0)this.estimatedSize=e.EMPTY_COMPOUND_NODE_SIZE;else this.estimatedSize=E/Math.sqrt(this.nodes.length);return this.estimatedSize},g.prototype.updateConnected=function(){var E=this;if(this.nodes.length==0){this.isConnected=!0;return}var T=new n,N=new Set,v=this.nodes[0],O,D,R=v.withChildren();R.forEach(function(C){T.push(C),N.add(C)});while(T.length!==0){v=T.shift(),O=v.getEdges();var a=O.length;for(var p=0;p<a;p++){var d=O[p];if(D=d.getOtherEndInGraph(v,this),D!=null&&!N.has(D)){var A=D.withChildren();A.forEach(function(C){T.push(C),N.add(C)})}}}if(this.isConnected=!1,N.size>=this.nodes.length){var I=0;if(N.forEach(function(C){if(C.owner==E)I++}),I==this.nodes.length)this.isConnected=!0}},m.exports=g},function(m,w,L){var s,r=L(1);function e(i){s=L(5),this.layout=i,this.graphs=[],this.edges=[]}e.prototype.addRoot=function(){var i=this.layout.newGraph(),u=this.layout.newNode(null),c=this.add(i,u);return this.setRootGraph(c),this.rootGraph},e.prototype.add=function(i,u,c,o,y){if(c==null&&o==null&&y==null){if(i==null)throw"Graph is null!";if(u==null)throw"Parent node is null!";if(this.graphs.indexOf(i)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(i),i.parent!=null)throw"Already has a parent!";if(u.child!=null)throw"Already has a child!";return i.parent=u,u.child=i,i}else{y=c,o=u,c=i;var n=o.getOwner(),g=y.getOwner();if(!(n!=null&&n.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(g!=null&&g.getGraphManager()==this))throw"Target not in this graph mgr!";if(n==g)return c.isInterGraph=!1,n.add(c,o,y);else{if(c.isInterGraph=!0,c.source=o,c.target=y,this.edges.indexOf(c)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(c),!(c.source!=null&&c.target!=null))throw"Edge source and/or target is null!";if(!(c.source.edges.indexOf(c)==-1&&c.target.edges.indexOf(c)==-1))throw"Edge already in source and/or target incidency list!";return c.source.edges.push(c),c.target.edges.push(c),c}}},e.prototype.remove=function(i){if(i instanceof s){var u=i;if(u.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(u==this.rootGraph||u.parent!=null&&u.parent.graphManager==this))throw"Invalid parent node!";var c=[];c=c.concat(u.getEdges());var o,y=c.length;for(var n=0;n<y;n++)o=c[n],u.remove(o);var g=[];g=g.concat(u.getNodes());var f;y=g.length;for(var n=0;n<y;n++)f=g[n],u.remove(f);if(u==this.rootGraph)this.setRootGraph(null);var E=this.graphs.indexOf(u);this.graphs.splice(E,1),u.parent=null}else if(i instanceof r){if(o=i,o==null)throw"Edge is null!";if(!o.isInterGraph)throw"Not an inter-graph edge!";if(!(o.source!=null&&o.target!=null))throw"Source and/or target is null!";if(!(o.source.edges.indexOf(o)!=-1&&o.target.edges.indexOf(o)!=-1))throw"Source and/or target doesn't know this edge!";var E=o.source.edges.indexOf(o);if(o.source.edges.splice(E,1),E=o.target.edges.indexOf(o),o.target.edges.splice(E,1),!(o.source.owner!=null&&o.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(o.source.owner.getGraphManager().edges.indexOf(o)==-1)throw"Not in owner graph manager's edge list!";var E=o.source.owner.getGraphManager().edges.indexOf(o);o.source.owner.getGraphManager().edges.splice(E,1)}},e.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},e.prototype.getGraphs=function(){return this.graphs},e.prototype.getAllNodes=function(){if(this.allNodes==null){var i=[],u=this.getGraphs(),c=u.length;for(var o=0;o<c;o++)i=i.concat(u[o].getNodes());this.allNodes=i}return this.allNodes},e.prototype.resetAllNodes=function(){this.allNodes=null},e.prototype.resetAllEdges=function(){this.allEdges=null},e.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},e.prototype.getAllEdges=function(){if(this.allEdges==null){var i=[],u=this.getGraphs(),c=u.length;for(var o=0;o<u.length;o++)i=i.concat(u[o].getEdges());i=i.concat(this.edges),this.allEdges=i}return this.allEdges},e.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},e.prototype.setAllNodesToApplyGravitation=function(i){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=i},e.prototype.getRoot=function(){return this.rootGraph},e.prototype.setRootGraph=function(i){if(i.getGraphManager()!=this)throw"Root not in this graph mgr!";if(this.rootGraph=i,i.parent==null)i.parent=this.layout.newNode("Root node")},e.prototype.getLayout=function(){return this.layout},e.prototype.isOneAncestorOfOther=function(i,u){if(!(i!=null&&u!=null))throw"assert failed";if(i==u)return!0;var c=i.getOwner(),o;do{if(o=c.getParent(),o==null)break;if(o==u)return!0;if(c=o.getOwner(),c==null)break}while(!0);c=u.getOwner();do{if(o=c.getParent(),o==null)break;if(o==i)return!0;if(c=o.getOwner(),c==null)break}while(!0);return!1},e.prototype.calcLowestCommonAncestors=function(){var i,u,c,o,y,n=this.getAllEdges(),g=n.length;for(var f=0;f<g;f++){if(i=n[f],u=i.source,c=i.target,i.lca=null,i.sourceInLca=u,i.targetInLca=c,u==c){i.lca=u.getOwner();continue}o=u.getOwner();while(i.lca==null){i.targetInLca=c,y=c.getOwner();while(i.lca==null){if(y==o){i.lca=y;break}if(y==this.rootGraph)break;if(i.lca!=null)throw"assert failed";i.targetInLca=y.getParent(),y=i.targetInLca.getOwner()}if(o==this.rootGraph)break;if(i.lca==null)i.sourceInLca=o.getParent(),o=i.sourceInLca.getOwner()}if(i.lca==null)throw"assert failed"}},e.prototype.calcLowestCommonAncestor=function(i,u){if(i==u)return i.getOwner();var c=i.getOwner();do{if(c==null)break;var o=u.getOwner();do{if(o==null)break;if(o==c)return o;o=o.getParent().getOwner()}while(!0);c=c.getParent().getOwner()}while(!0);return c},e.prototype.calcInclusionTreeDepths=function(i,u){if(i==null&&u==null)i=this.rootGraph,u=1;var c,o=i.getNodes(),y=o.length;for(var n=0;n<y;n++)if(c=o[n],c.inclusionTreeDepth=u,c.child!=null)this.calcInclusionTreeDepths(c.child,u+1)},e.prototype.includesInvalidEdge=function(){var i,u=this.edges.length;for(var c=0;c<u;c++)if(i=this.edges[c],this.isOneAncestorOfOther(i.source,i.target))return!0;return!1},m.exports=e},function(m,w,L){var s=L(0);function r(){}for(var e in s)r[e]=s[e];r.MAX_ITERATIONS=2500,r.DEFAULT_EDGE_LENGTH=50,r.DEFAULT_SPRING_STRENGTH=0.45,r.DEFAULT_REPULSION_STRENGTH=4500,r.DEFAULT_GRAVITY_STRENGTH=0.4,r.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,r.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,r.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,r.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,r.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,r.DEFAULT_COOLING_FACTOR_INCREMENTAL=0.3,r.COOLING_ADAPTATION_FACTOR=0.33,r.ADAPTATION_LOWER_NODE_LIMIT=1000,r.ADAPTATION_UPPER_NODE_LIMIT=5000,r.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,r.MAX_NODE_DISPLACEMENT=r.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,r.MIN_REPULSION_DIST=r.DEFAULT_EDGE_LENGTH/10,r.CONVERGENCE_CHECK_PERIOD=100,r.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=0.1,r.MIN_EDGE_LENGTH=1,r.GRID_CALCULATION_CHECK_PERIOD=10,m.exports=r},function(m,w,L){var s=L(12);function r(){}r.calcSeparationAmount=function(e,i,u,c){if(!e.intersects(i))throw"assert failed";var o=[,,];if(this.decideDirectionsForOverlappingNodes(e,i,o),u[0]=Math.min(e.getRight(),i.getRight())-Math.max(e.x,i.x),u[1]=Math.min(e.getBottom(),i.getBottom())-Math.max(e.y,i.y),e.getX()<=i.getX()&&e.getRight()>=i.getRight())u[0]+=Math.min(i.getX()-e.getX(),e.getRight()-i.getRight());else if(i.getX()<=e.getX()&&i.getRight()>=e.getRight())u[0]+=Math.min(e.getX()-i.getX(),i.getRight()-e.getRight());if(e.getY()<=i.getY()&&e.getBottom()>=i.getBottom())u[1]+=Math.min(i.getY()-e.getY(),e.getBottom()-i.getBottom());else if(i.getY()<=e.getY()&&i.getBottom()>=e.getBottom())u[1]+=Math.min(e.getY()-i.getY(),i.getBottom()-e.getBottom());var y=Math.abs((i.getCenterY()-e.getCenterY())/(i.getCenterX()-e.getCenterX()));if(i.getCenterY()===e.getCenterY()&&i.getCenterX()===e.getCenterX())y=1;var n=y*u[0],g=u[1]/y;if(u[0]<g)g=u[0];else n=u[1];u[0]=-1*o[0]*(g/2+c),u[1]=-1*o[1]*(n/2+c)},r.decideDirectionsForOverlappingNodes=function(e,i,u){if(e.getCenterX()<i.getCenterX())u[0]=-1;else u[0]=1;if(e.getCenterY()<i.getCenterY())u[1]=-1;else u[1]=1},r.getIntersection2=function(e,i,u){var c=e.getCenterX(),o=e.getCenterY(),y=i.getCenterX(),n=i.getCenterY();if(e.intersects(i))return u[0]=c,u[1]=o,u[2]=y,u[3]=n,!0;var g=e.getX(),f=e.getY(),E=e.getRight(),T=e.getX(),N=e.getBottom(),v=e.getRight(),O=e.getWidthHalf(),D=e.getHeightHalf(),R=i.getX(),a=i.getY(),p=i.getRight(),d=i.getX(),A=i.getBottom(),I=i.getRight(),C=i.getWidthHalf(),M=i.getHeightHalf(),G=!1,F=!1;if(c===y){if(o>n)return u[0]=c,u[1]=f,u[2]=y,u[3]=A,!1;else if(o<n)return u[0]=c,u[1]=N,u[2]=y,u[3]=a,!1}else if(o===n){if(c>y)return u[0]=g,u[1]=o,u[2]=p,u[3]=n,!1;else if(c<y)return u[0]=E,u[1]=o,u[2]=R,u[3]=n,!1}else{var P=e.height/e.width,b=i.height/i.width,U=(n-o)/(y-c),x=void 0,S=void 0,Y=void 0,X=void 0,H=void 0,_=void 0;if(-P===U)if(c>y)u[0]=T,u[1]=N,G=!0;else u[0]=E,u[1]=f,G=!0;else if(P===U)if(c>y)u[0]=g,u[1]=f,G=!0;else u[0]=v,u[1]=N,G=!0;if(-b===U)if(y>c)u[2]=d,u[3]=A,F=!0;else u[2]=p,u[3]=a,F=!0;else if(b===U)if(y>c)u[2]=R,u[3]=a,F=!0;else u[2]=I,u[3]=A,F=!0;if(G&&F)return!1;if(c>y)if(o>n)x=this.getCardinalDirection(P,U,4),S=this.getCardinalDirection(b,U,2);else x=this.getCardinalDirection(-P,U,3),S=this.getCardinalDirection(-b,U,1);else if(o>n)x=this.getCardinalDirection(-P,U,1),S=this.getCardinalDirection(-b,U,3);else x=this.getCardinalDirection(P,U,2),S=this.getCardinalDirection(b,U,4);if(!G)switch(x){case 1:X=f,Y=c+-D/U,u[0]=Y,u[1]=X;break;case 2:Y=v,X=o+O*U,u[0]=Y,u[1]=X;break;case 3:X=N,Y=c+D/U,u[0]=Y,u[1]=X;break;case 4:Y=T,X=o+-O*U,u[0]=Y,u[1]=X;break}if(!F)switch(S){case 1:_=a,H=y+-M/U,u[2]=H,u[3]=_;break;case 2:H=I,_=n+C*U,u[2]=H,u[3]=_;break;case 3:_=A,H=y+M/U,u[2]=H,u[3]=_;break;case 4:H=d,_=n+-C*U,u[2]=H,u[3]=_;break}}return!1},r.getCardinalDirection=function(e,i,u){if(e>i)return u;else return 1+u%4},r.getIntersection=function(e,i,u,c){if(c==null)return this.getIntersection2(e,i,u);var{x:o,y}=e,{x:n,y:g}=i,{x:f,y:E}=u,{x:T,y:N}=c,v=void 0,O=void 0,D=void 0,R=void 0,a=void 0,p=void 0,d=void 0,A=void 0,I=void 0;if(D=g-y,a=o-n,d=n*y-o*g,R=N-E,p=f-T,A=T*E-f*N,I=D*p-R*a,I===0)return null;return v=(a*A-p*d)/I,O=(R*d-D*A)/I,new s(v,O)},r.angleOfVector=function(e,i,u,c){var o=void 0;if(e!==u){if(o=Math.atan((c-i)/(u-e)),u<e)o+=Math.PI;else if(c<i)o+=this.TWO_PI}else if(c<i)o=this.ONE_AND_HALF_PI;else o=this.HALF_PI;return o},r.doIntersect=function(e,i,u,c){var{x:o,y}=e,{x:n,y:g}=i,{x:f,y:E}=u,{x:T,y:N}=c,v=(n-o)*(N-E)-(T-f)*(g-y);if(v===0)return!1;else{var O=((N-E)*(T-o)+(f-T)*(N-y))/v,D=((y-g)*(T-o)+(n-o)*(N-y))/v;return 0<O&&O<1&&0<D&&D<1}},r.HALF_PI=0.5*Math.PI,r.ONE_AND_HALF_PI=1.5*Math.PI,r.TWO_PI=2*Math.PI,r.THREE_PI=3*Math.PI,m.exports=r},function(m,w,L){function s(){}s.sign=function(r){if(r>0)return 1;else if(r<0)return-1;else return 0},s.floor=function(r){return r<0?Math.ceil(r):Math.floor(r)},s.ceil=function(r){return r<0?Math.floor(r):Math.ceil(r)},m.exports=s},function(m,w,L){function s(){}s.MAX_VALUE=2147483647,s.MIN_VALUE=-2147483648,m.exports=s},function(m,w,L){var s=function(){function o(y,n){for(var g=0;g<n.length;g++){var f=n[g];if(f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f)f.writable=!0;Object.defineProperty(y,f.key,f)}}return function(y,n,g){if(n)o(y.prototype,n);if(g)o(y,g);return y}}();function r(o,y){if(!(o instanceof y))throw TypeError("Cannot call a class as a function")}var e=function(y){return{value:y,next:null,prev:null}},i=function(y,n,g,f){if(y!==null)y.next=n;else f.head=n;if(g!==null)g.prev=n;else f.tail=n;return n.prev=y,n.next=g,f.length++,n},u=function(y,n){var{prev:g,next:f}=y;if(g!==null)g.next=f;else n.head=f;if(f!==null)f.prev=g;else n.tail=g;return y.prev=y.next=null,n.length--,y},c=function(){function o(y){var n=this;if(r(this,o),this.length=0,this.head=null,this.tail=null,y!=null)y.forEach(function(g){return n.push(g)})}return s(o,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(n,g){return i(g.prev,e(n),g,this)}},{key:"insertAfter",value:function(n,g){return i(g,e(n),g.next,this)}},{key:"insertNodeBefore",value:function(n,g){return i(g.prev,n,g,this)}},{key:"insertNodeAfter",value:function(n,g){return i(g,n,g.next,this)}},{key:"push",value:function(n){return i(this.tail,e(n),null,this)}},{key:"unshift",value:function(n){return i(null,e(n),this.head,this)}},{key:"remove",value:function(n){return u(n,this)}},{key:"pop",value:function(){return u(this.tail,this).value}},{key:"popNode",value:function(){return u(this.tail,this)}},{key:"shift",value:function(){return u(this.head,this).value}},{key:"shiftNode",value:function(){return u(this.head,this)}},{key:"get_object_at",value:function(n){if(n<=this.length()){var g=1,f=this.head;while(g<n)f=f.next,g++;return f.value}}},{key:"set_object_at",value:function(n,g){if(n<=this.length()){var f=1,E=this.head;while(f<n)E=E.next,f++;E.value=g}}}]),o}();m.exports=c},function(m,w,L){function s(r,e,i){if(this.x=null,this.y=null,r==null&&e==null&&i==null)this.x=0,this.y=0;else if(typeof r=="number"&&typeof e=="number"&&i==null)this.x=r,this.y=e;else if(r.constructor.name=="Point"&&e==null&&i==null)i=r,this.x=i.x,this.y=i.y}s.prototype.getX=function(){return this.x},s.prototype.getY=function(){return this.y},s.prototype.getLocation=function(){return new s(this.x,this.y)},s.prototype.setLocation=function(r,e,i){if(r.constructor.name=="Point"&&e==null&&i==null)i=r,this.setLocation(i.x,i.y);else if(typeof r=="number"&&typeof e=="number"&&i==null)if(parseInt(r)==r&&parseInt(e)==e)this.move(r,e);else this.x=Math.floor(r+0.5),this.y=Math.floor(e+0.5)},s.prototype.move=function(r,e){this.x=r,this.y=e},s.prototype.translate=function(r,e){this.x+=r,this.y+=e},s.prototype.equals=function(r){if(r.constructor.name=="Point"){var e=r;return this.x==e.x&&this.y==e.y}return this==r},s.prototype.toString=function(){return new s().constructor.name+"[x="+this.x+",y="+this.y+"]"},m.exports=s},function(m,w,L){function s(r,e,i,u){if(this.x=0,this.y=0,this.width=0,this.height=0,r!=null&&e!=null&&i!=null&&u!=null)this.x=r,this.y=e,this.width=i,this.height=u}s.prototype.getX=function(){return this.x},s.prototype.setX=function(r){this.x=r},s.prototype.getY=function(){return this.y},s.prototype.setY=function(r){this.y=r},s.prototype.getWidth=function(){return this.width},s.prototype.setWidth=function(r){this.width=r},s.prototype.getHeight=function(){return this.height},s.prototype.setHeight=function(r){this.height=r},s.prototype.getRight=function(){return this.x+this.width},s.prototype.getBottom=function(){return this.y+this.height},s.prototype.intersects=function(r){if(this.getRight()<r.x)return!1;if(this.getBottom()<r.y)return!1;if(r.getRight()<this.x)return!1;if(r.getBottom()<this.y)return!1;return!0},s.prototype.getCenterX=function(){return this.x+this.width/2},s.prototype.getMinX=function(){return this.getX()},s.prototype.getMaxX=function(){return this.getX()+this.width},s.prototype.getCenterY=function(){return this.y+this.height/2},s.prototype.getMinY=function(){return this.getY()},s.prototype.getMaxY=function(){return this.getY()+this.height},s.prototype.getWidthHalf=function(){return this.width/2},s.prototype.getHeightHalf=function(){return this.height/2},m.exports=s},function(m,w,L){var s=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function r(){}r.lastID=0,r.createID=function(e){if(r.isPrimitive(e))return e;if(e.uniqueID!=null)return e.uniqueID;return e.uniqueID=r.getString(),r.lastID++,e.uniqueID},r.getString=function(e){if(e==null)e=r.lastID;return"Object#"+e},r.isPrimitive=function(e){var i=typeof e>"u"?"undefined":s(e);return e==null||i!="object"&&i!="function"},m.exports=r},function(m,w,L){function s(f){if(Array.isArray(f)){for(var E=0,T=Array(f.length);E<f.length;E++)T[E]=f[E];return T}else return Array.from(f)}var r=L(0),e=L(6),i=L(3),u=L(1),c=L(5),o=L(4),y=L(17),n=L(27);function g(f){if(n.call(this),this.layoutQuality=r.QUALITY,this.createBendsAsNeeded=r.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=r.DEFAULT_INCREMENTAL,this.animationOnLayout=r.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=r.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=r.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=r.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new e(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,f!=null)this.isRemoteUse=f}g.RANDOM_SEED=1,g.prototype=Object.create(n.prototype),g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},g.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},g.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},g.prototype.newGraphManager=function(){var f=new e(this);return this.graphManager=f,f},g.prototype.newGraph=function(f){return new c(null,this.graphManager,f)},g.prototype.newNode=function(f){return new i(this.graphManager,f)},g.prototype.newEdge=function(f){return new u(null,null,f)},g.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},g.prototype.runLayout=function(){if(this.isLayoutFinished=!1,this.tilingPreLayout)this.tilingPreLayout();this.initParameters();var f;if(this.checkLayoutSuccess())f=!1;else f=this.layout();if(r.ANIMATE==="during")return!1;if(f){if(!this.isSubLayout)this.doPostLayout()}if(this.tilingPostLayout)this.tilingPostLayout();return this.isLayoutFinished=!0,f},g.prototype.doPostLayout=function(){if(!this.incremental)this.transform();this.update()},g.prototype.update2=function(){if(this.createBendsAsNeeded)this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges();if(!this.isRemoteUse){var f,E=this.graphManager.getAllEdges();for(var T=0;T<E.length;T++)f=E[T];var N,v=this.graphManager.getRoot().getNodes();for(var T=0;T<v.length;T++)N=v[T];this.update(this.graphManager.getRoot())}},g.prototype.update=function(f){if(f==null)this.update2();else if(f instanceof i){var E=f;if(E.getChild()!=null){var T=E.getChild().getNodes();for(var N=0;N<T.length;N++)update(T[N])}if(E.vGraphObject!=null){var v=E.vGraphObject;v.update(E)}}else if(f instanceof u){var O=f;if(O.vGraphObject!=null){var D=O.vGraphObject;D.update(O)}}else if(f instanceof c){var R=f;if(R.vGraphObject!=null){var a=R.vGraphObject;a.update(R)}}},g.prototype.initParameters=function(){if(!this.isSubLayout)this.layoutQuality=r.QUALITY,this.animationDuringLayout=r.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=r.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=r.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=r.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=r.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=r.DEFAULT_UNIFORM_LEAF_NODE_SIZES;if(this.animationDuringLayout)this.animationOnLayout=!1},g.prototype.transform=function(f){if(f==null)this.transform(new o(0,0));else{var E=new y,T=this.graphManager.getRoot().updateLeftTop();if(T!=null){E.setWorldOrgX(f.x),E.setWorldOrgY(f.y),E.setDeviceOrgX(T.x),E.setDeviceOrgY(T.y);var N=this.getAllNodes(),v;for(var O=0;O<N.length;O++)v=N[O],v.transform(E)}}},g.prototype.positionNodesRandomly=function(f){if(f==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else{var E,T,N=f.getNodes();for(var v=0;v<N.length;v++)if(E=N[v],T=E.getChild(),T==null)E.scatter();else if(T.getNodes().length==0)E.scatter();else this.positionNodesRandomly(T),E.updateBounds()}},g.prototype.getFlatForest=function(){var f=[],E=!0,T=this.graphManager.getRoot().getNodes(),N=!0;for(var v=0;v<T.length;v++)if(T[v].getChild()!=null)N=!1;if(!N)return f;var O=new Set,D=[],R=new Map,a=[];a=a.concat(T);while(a.length>0&&E){D.push(a[0]);while(D.length>0&&E){var p=D[0];D.splice(0,1),O.add(p);var d=p.getEdges();for(var v=0;v<d.length;v++){var A=d[v].getOtherEnd(p);if(R.get(p)!=A)if(!O.has(A))D.push(A),R.set(A,p);else{E=!1;break}}}if(!E)f=[];else{var I=[].concat(s(O));f.push(I);for(var v=0;v<I.length;v++){var C=I[v],M=a.indexOf(C);if(M>-1)a.splice(M,1)}O=new Set,R=new Map}}return f},g.prototype.createDummyNodesForBendpoints=function(f){var E=[],T=f.source,N=this.graphManager.calcLowestCommonAncestor(f.source,f.target);for(var v=0;v<f.bendpoints.length;v++){var O=this.newNode(null);O.setRect(new Point(0,0),new Dimension(1,1)),N.add(O);var D=this.newEdge(null);this.graphManager.add(D,T,O),E.add(O),T=O}var D=this.newEdge(null);if(this.graphManager.add(D,T,f.target),this.edgeToDummyNodes.set(f,E),f.isInterGraph())this.graphManager.remove(f);else N.remove(f);return E},g.prototype.createBendpointsFromDummyNodes=function(){var f=[];f=f.concat(this.graphManager.getAllEdges()),f=[].concat(s(this.edgeToDummyNodes.keys())).concat(f);for(var E=0;E<f.length;E++){var T=f[E];if(T.bendpoints.length>0){var N=this.edgeToDummyNodes.get(T);for(var v=0;v<N.length;v++){var O=N[v],D=new o(O.getCenterX(),O.getCenterY()),R=T.bendpoints.get(v);R.x=D.x,R.y=D.y,O.getOwner().remove(O)}this.graphManager.add(T,T.source,T.target)}}},g.transform=function(f,E,T,N){if(T!=null&&N!=null){var v=E;if(f<=50){var O=E/T;v-=(E-O)/50*(50-f)}else{var D=E*N;v+=(D-E)/50*(f-50)}return v}else{var R,a;if(f<=50)R=9*E/500,a=E/10;else R=9*E/50,a=-8*E;return R*f+a}},g.findCenterOfTree=function(f){var E=[];E=E.concat(f);var T=[],N=new Map,v=!1,O=null;if(E.length==1||E.length==2)v=!0,O=E[0];for(var D=0;D<E.length;D++){var R=E[D],a=R.getNeighborsList().size;if(N.set(R,R.getNeighborsList().size),a==1)T.push(R)}var p=[];p=p.concat(T);while(!v){var d=[];d=d.concat(p),p=[];for(var D=0;D<E.length;D++){var R=E[D],A=E.indexOf(R);if(A>=0)E.splice(A,1);var I=R.getNeighborsList();I.forEach(function(G){if(T.indexOf(G)<0){var F=N.get(G),P=F-1;if(P==1)p.push(G);N.set(G,P)}})}if(T=T.concat(p),E.length==1||E.length==2)v=!0,O=E[0]}return O},g.prototype.setGraphManager=function(f){this.graphManager=f},m.exports=g},function(m,w,L){function s(){}s.seed=1,s.x=0,s.nextDouble=function(){return s.x=Math.sin(s.seed++)*1e4,s.x-Math.floor(s.x)},m.exports=s},function(m,w,L){var s=L(4);function r(e,i){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}r.prototype.getWorldOrgX=function(){return this.lworldOrgX},r.prototype.setWorldOrgX=function(e){this.lworldOrgX=e},r.prototype.getWorldOrgY=function(){return this.lworldOrgY},r.prototype.setWorldOrgY=function(e){this.lworldOrgY=e},r.prototype.getWorldExtX=function(){return this.lworldExtX},r.prototype.setWorldExtX=function(e){this.lworldExtX=e},r.prototype.getWorldExtY=function(){return this.lworldExtY},r.prototype.setWorldExtY=function(e){this.lworldExtY=e},r.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},r.prototype.setDeviceOrgX=function(e){this.ldeviceOrgX=e},r.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},r.prototype.setDeviceOrgY=function(e){this.ldeviceOrgY=e},r.prototype.getDeviceExtX=function(){return this.ldeviceExtX},r.prototype.setDeviceExtX=function(e){this.ldeviceExtX=e},r.prototype.getDeviceExtY=function(){return this.ldeviceExtY},r.prototype.setDeviceExtY=function(e){this.ldeviceExtY=e},r.prototype.transformX=function(e){var i=0,u=this.lworldExtX;if(u!=0)i=this.ldeviceOrgX+(e-this.lworldOrgX)*this.ldeviceExtX/u;return i},r.prototype.transformY=function(e){var i=0,u=this.lworldExtY;if(u!=0)i=this.ldeviceOrgY+(e-this.lworldOrgY)*this.ldeviceExtY/u;return i},r.prototype.inverseTransformX=function(e){var i=0,u=this.ldeviceExtX;if(u!=0)i=this.lworldOrgX+(e-this.ldeviceOrgX)*this.lworldExtX/u;return i},r.prototype.inverseTransformY=function(e){var i=0,u=this.ldeviceExtY;if(u!=0)i=this.lworldOrgY+(e-this.ldeviceOrgY)*this.lworldExtY/u;return i},r.prototype.inverseTransformPoint=function(e){var i=new s(this.inverseTransformX(e.x),this.inverseTransformY(e.y));return i},m.exports=r},function(m,w,L){function s(n){if(Array.isArray(n)){for(var g=0,f=Array(n.length);g<n.length;g++)f[g]=n[g];return f}else return Array.from(n)}var r=L(15),e=L(7),i=L(0),u=L(8),c=L(9);function o(){r.call(this),this.useSmartIdealEdgeLengthCalculation=e.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.idealEdgeLength=e.DEFAULT_EDGE_LENGTH,this.springConstant=e.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=e.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=e.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=e.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=e.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=e.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*e.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=e.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=e.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=e.MAX_ITERATIONS}o.prototype=Object.create(r.prototype);for(var y in r)o[y]=r[y];o.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=e.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},o.prototype.calcIdealEdgeLengths=function(){var n,g,f,E,T,N,v=this.getGraphManager().getAllEdges();for(var O=0;O<v.length;O++)if(n=v[O],n.idealLength=this.idealEdgeLength,n.isInterGraph){if(f=n.getSource(),E=n.getTarget(),T=n.getSourceInLca().getEstimatedSize(),N=n.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation)n.idealLength+=T+N-2*i.SIMPLE_NODE_SIZE;g=n.getLca().getInclusionTreeDepth(),n.idealLength+=e.DEFAULT_EDGE_LENGTH*e.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(f.getInclusionTreeDepth()+E.getInclusionTreeDepth()-2*g)}},o.prototype.initSpringEmbedder=function(){var n=this.getAllNodes().length;if(this.incremental){if(n>e.ADAPTATION_LOWER_NODE_LIMIT)this.coolingFactor=Math.max(this.coolingFactor*e.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(n-e.ADAPTATION_LOWER_NODE_LIMIT)/(e.ADAPTATION_UPPER_NODE_LIMIT-e.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-e.COOLING_ADAPTATION_FACTOR));this.maxNodeDisplacement=e.MAX_NODE_DISPLACEMENT_INCREMENTAL}else{if(n>e.ADAPTATION_LOWER_NODE_LIMIT)this.coolingFactor=Math.max(e.COOLING_ADAPTATION_FACTOR,1-(n-e.ADAPTATION_LOWER_NODE_LIMIT)/(e.ADAPTATION_UPPER_NODE_LIMIT-e.ADAPTATION_LOWER_NODE_LIMIT)*(1-e.COOLING_ADAPTATION_FACTOR));else this.coolingFactor=1;this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=e.MAX_NODE_DISPLACEMENT}this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},o.prototype.calcSpringForces=function(){var n=this.getAllEdges(),g;for(var f=0;f<n.length;f++)g=n[f],this.calcSpringForce(g,g.idealLength)},o.prototype.calcRepulsionForces=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,f,E,T,N,v=this.getAllNodes(),O;if(this.useFRGridVariant){if(this.totalIterations%e.GRID_CALCULATION_CHECK_PERIOD==1&&n)this.updateGrid();O=new Set;for(f=0;f<v.length;f++)T=v[f],this.calculateRepulsionForceOfANode(T,O,n,g),O.add(T)}else for(f=0;f<v.length;f++){T=v[f];for(E=f+1;E<v.length;E++){if(N=v[E],T.getOwner()!=N.getOwner())continue;this.calcRepulsionForce(T,N)}}},o.prototype.calcGravitationalForces=function(){var n,g=this.getAllNodesToApplyGravitation();for(var f=0;f<g.length;f++)n=g[f],this.calcGravitationalForce(n)},o.prototype.moveNodes=function(){var n=this.getAllNodes(),g;for(var f=0;f<n.length;f++)g=n[f],g.move()},o.prototype.calcSpringForce=function(n,g){var f=n.getSource(),E=n.getTarget(),T,N,v,O;if(this.uniformLeafNodeSizes&&f.getChild()==null&&E.getChild()==null)n.updateLengthSimple();else if(n.updateLength(),n.isOverlapingSourceAndTarget)return;if(T=n.getLength(),T==0)return;N=this.springConstant*(T-g),v=N*(n.lengthX/T),O=N*(n.lengthY/T),f.springForceX+=v,f.springForceY+=O,E.springForceX-=v,E.springForceY-=O},o.prototype.calcRepulsionForce=function(n,g){var f=n.getRect(),E=g.getRect(),T=[,,],N=[,,,,],v,O,D,R,a,p,d;if(f.intersects(E)){u.calcSeparationAmount(f,E,T,e.DEFAULT_EDGE_LENGTH/2),p=2*T[0],d=2*T[1];var A=n.noOfChildren*g.noOfChildren/(n.noOfChildren+g.noOfChildren);n.repulsionForceX-=A*p,n.repulsionForceY-=A*d,g.repulsionForceX+=A*p,g.repulsionForceY+=A*d}else{if(this.uniformLeafNodeSizes&&n.getChild()==null&&g.getChild()==null)v=E.getCenterX()-f.getCenterX(),O=E.getCenterY()-f.getCenterY();else u.getIntersection(f,E,N),v=N[2]-N[0],O=N[3]-N[1];if(Math.abs(v)<e.MIN_REPULSION_DIST)v=c.sign(v)*e.MIN_REPULSION_DIST;if(Math.abs(O)<e.MIN_REPULSION_DIST)O=c.sign(O)*e.MIN_REPULSION_DIST;D=v*v+O*O,R=Math.sqrt(D),a=this.repulsionConstant*n.noOfChildren*g.noOfChildren/D,p=a*v/R,d=a*O/R,n.repulsionForceX-=p,n.repulsionForceY-=d,g.repulsionForceX+=p,g.repulsionForceY+=d}},o.prototype.calcGravitationalForce=function(n){var g,f,E,T,N,v,O,D;if(g=n.getOwner(),f=(g.getRight()+g.getLeft())/2,E=(g.getTop()+g.getBottom())/2,T=n.getCenterX()-f,N=n.getCenterY()-E,v=Math.abs(T)+n.getWidth()/2,O=Math.abs(N)+n.getHeight()/2,n.getOwner()==this.graphManager.getRoot()){if(D=g.getEstimatedSize()*this.gravityRangeFactor,v>D||O>D)n.gravitationForceX=-this.gravityConstant*T,n.gravitationForceY=-this.gravityConstant*N}else if(D=g.getEstimatedSize()*this.compoundGravityRangeFactor,v>D||O>D)n.gravitationForceX=-this.gravityConstant*T*this.compoundGravityConstant,n.gravitationForceY=-this.gravityConstant*N*this.compoundGravityConstant},o.prototype.isConverged=function(){var n,g=!1;if(this.totalIterations>this.maxIterations/3)g=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2;return n=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,n||g},o.prototype.animate=function(){if(this.animationDuringLayout&&!this.isSubLayout)if(this.notAnimatedIterations==this.animationPeriod)this.update(),this.notAnimatedIterations=0;else this.notAnimatedIterations++},o.prototype.calcNoOfChildrenForAllNodes=function(){var n,g=this.graphManager.getAllNodes();for(var f=0;f<g.length;f++)n=g[f],n.noOfChildren=n.getNoOfChildren()},o.prototype.calcGrid=function(n){var g=0,f=0;g=parseInt(Math.ceil((n.getRight()-n.getLeft())/this.repulsionRange)),f=parseInt(Math.ceil((n.getBottom()-n.getTop())/this.repulsionRange));var E=Array(g);for(var T=0;T<g;T++)E[T]=Array(f);for(var T=0;T<g;T++)for(var N=0;N<f;N++)E[T][N]=[];return E},o.prototype.addNodeToGrid=function(n,g,f){var E=0,T=0,N=0,v=0;E=parseInt(Math.floor((n.getRect().x-g)/this.repulsionRange)),T=parseInt(Math.floor((n.getRect().width+n.getRect().x-g)/this.repulsionRange)),N=parseInt(Math.floor((n.getRect().y-f)/this.repulsionRange)),v=parseInt(Math.floor((n.getRect().height+n.getRect().y-f)/this.repulsionRange));for(var O=E;O<=T;O++)for(var D=N;D<=v;D++)this.grid[O][D].push(n),n.setGridCoordinates(E,T,N,v)},o.prototype.updateGrid=function(){var n,g,f=this.getAllNodes();this.grid=this.calcGrid(this.graphManager.getRoot());for(n=0;n<f.length;n++)g=f[n],this.addNodeToGrid(g,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},o.prototype.calculateRepulsionForceOfANode=function(n,g,f,E){if(this.totalIterations%e.GRID_CALCULATION_CHECK_PERIOD==1&&f||E){var T=new Set;n.surrounding=[];var N,v=this.grid;for(var O=n.startX-1;O<n.finishX+2;O++)for(var D=n.startY-1;D<n.finishY+2;D++)if(!(O<0||D<0||O>=v.length||D>=v[0].length))for(var R=0;R<v[O][D].length;R++){if(N=v[O][D][R],n.getOwner()!=N.getOwner()||n==N)continue;if(!g.has(N)&&!T.has(N)){var a=Math.abs(n.getCenterX()-N.getCenterX())-(n.getWidth()/2+N.getWidth()/2),p=Math.abs(n.getCenterY()-N.getCenterY())-(n.getHeight()/2+N.getHeight()/2);if(a<=this.repulsionRange&&p<=this.repulsionRange)T.add(N)}}n.surrounding=[].concat(s(T))}for(O=0;O<n.surrounding.length;O++)this.calcRepulsionForce(n,n.surrounding[O])},o.prototype.calcRepulsionRange=function(){return 0},m.exports=o},function(m,w,L){var s=L(1),r=L(7);function e(u,c,o){s.call(this,u,c,o),this.idealLength=r.DEFAULT_EDGE_LENGTH}e.prototype=Object.create(s.prototype);for(var i in s)e[i]=s[i];m.exports=e},function(m,w,L){var s=L(3);function r(i,u,c,o){s.call(this,i,u,c,o),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=[]}r.prototype=Object.create(s.prototype);for(var e in s)r[e]=s[e];r.prototype.setGridCoordinates=function(i,u,c,o){this.startX=i,this.finishX=u,this.startY=c,this.finishY=o},m.exports=r},function(m,w,L){function s(r,e){if(this.width=0,this.height=0,r!==null&&e!==null)this.height=e,this.width=r}s.prototype.getWidth=function(){return this.width},s.prototype.setWidth=function(r){this.width=r},s.prototype.getHeight=function(){return this.height},s.prototype.setHeight=function(r){this.height=r},m.exports=s},function(m,w,L){var s=L(14);function r(){this.map={},this.keys=[]}r.prototype.put=function(e,i){var u=s.createID(e);if(!this.contains(u))this.map[u]=i,this.keys.push(e)},r.prototype.contains=function(e){var i=s.createID(e);return this.map[e]!=null},r.prototype.get=function(e){var i=s.createID(e);return this.map[i]},r.prototype.keySet=function(){return this.keys},m.exports=r},function(m,w,L){var s=L(14);function r(){this.set={}}r.prototype.add=function(e){var i=s.createID(e);if(!this.contains(i))this.set[i]=e},r.prototype.remove=function(e){delete this.set[s.createID(e)]},r.prototype.clear=function(){this.set={}},r.prototype.contains=function(e){return this.set[s.createID(e)]==e},r.prototype.isEmpty=function(){return this.size()===0},r.prototype.size=function(){return Object.keys(this.set).length},r.prototype.addAllTo=function(e){var i=Object.keys(this.set),u=i.length;for(var c=0;c<u;c++)e.push(this.set[i[c]])},r.prototype.size=function(){return Object.keys(this.set).length},r.prototype.addAll=function(e){var i=e.length;for(var u=0;u<i;u++){var c=e[u];this.add(c)}},m.exports=r},function(m,w,L){var s=function(){function u(c,o){for(var y=0;y<o.length;y++){var n=o[y];if(n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n)n.writable=!0;Object.defineProperty(c,n.key,n)}}return function(c,o,y){if(o)u(c.prototype,o);if(y)u(c,y);return c}}();function r(u,c){if(!(u instanceof c))throw TypeError("Cannot call a class as a function")}var e=L(11),i=function(){function u(c,o){if(r(this,u),o!==null||o!==void 0)this.compareFunction=this._defaultCompareFunction;var y=void 0;if(c instanceof e)y=c.size();else y=c.length;this._quicksort(c,0,y-1)}return s(u,[{key:"_quicksort",value:function(o,y,n){if(y<n){var g=this._partition(o,y,n);this._quicksort(o,y,g),this._quicksort(o,g+1,n)}}},{key:"_partition",value:function(o,y,n){var g=this._get(o,y),f=y,E=n;while(!0){while(this.compareFunction(g,this._get(o,E)))E--;while(this.compareFunction(this._get(o,f),g))f++;if(f<E)this._swap(o,f,E),f++,E--;else return E}}},{key:"_get",value:function(o,y){if(o instanceof e)return o.get_object_at(y);else return o[y]}},{key:"_set",value:function(o,y,n){if(o instanceof e)o.set_object_at(y,n);else o[y]=n}},{key:"_swap",value:function(o,y,n){var g=this._get(o,y);this._set(o,y,this._get(o,n)),this._set(o,n,g)}},{key:"_defaultCompareFunction",value:function(o,y){return y>o}}]),u}();m.exports=i},function(m,w,L){var s=function(){function i(u,c){for(var o=0;o<c.length;o++){var y=c[o];if(y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y)y.writable=!0;Object.defineProperty(u,y.key,y)}}return function(u,c,o){if(c)i(u.prototype,c);if(o)i(u,o);return u}}();function r(i,u){if(!(i instanceof u))throw TypeError("Cannot call a class as a function")}var e=function(){function i(u,c){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,y=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;r(this,i),this.sequence1=u,this.sequence2=c,this.match_score=o,this.mismatch_penalty=y,this.gap_penalty=n,this.iMax=u.length+1,this.jMax=c.length+1,this.grid=Array(this.iMax);for(var g=0;g<this.iMax;g++){this.grid[g]=Array(this.jMax);for(var f=0;f<this.jMax;f++)this.grid[g][f]=0}this.tracebackGrid=Array(this.iMax);for(var E=0;E<this.iMax;E++){this.tracebackGrid[E]=Array(this.jMax);for(var T=0;T<this.jMax;T++)this.tracebackGrid[E][T]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return s(i,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var c=1;c<this.jMax;c++)this.grid[0][c]=this.grid[0][c-1]+this.gap_penalty,this.tracebackGrid[0][c]=[!1,!1,!0];for(var o=1;o<this.iMax;o++)this.grid[o][0]=this.grid[o-1][0]+this.gap_penalty,this.tracebackGrid[o][0]=[!1,!0,!1];for(var y=1;y<this.iMax;y++)for(var n=1;n<this.jMax;n++){var g=void 0;if(this.sequence1[y-1]===this.sequence2[n-1])g=this.grid[y-1][n-1]+this.match_score;else g=this.grid[y-1][n-1]+this.mismatch_penalty;var f=this.grid[y-1][n]+this.gap_penalty,E=this.grid[y][n-1]+this.gap_penalty,T=[g,f,E],N=this.arrayAllMaxIndexes(T);this.grid[y][n]=T[N[0]],this.tracebackGrid[y][n]=[N.includes(0),N.includes(1),N.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var c=[];c.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});while(c[0]){var o=c[0],y=this.tracebackGrid[o.pos[0]][o.pos[1]];if(y[0])c.push({pos:[o.pos[0]-1,o.pos[1]-1],seq1:this.sequence1[o.pos[0]-1]+o.seq1,seq2:this.sequence2[o.pos[1]-1]+o.seq2});if(y[1])c.push({pos:[o.pos[0]-1,o.pos[1]],seq1:this.sequence1[o.pos[0]-1]+o.seq1,seq2:"-"+o.seq2});if(y[2])c.push({pos:[o.pos[0],o.pos[1]-1],seq1:"-"+o.seq1,seq2:this.sequence2[o.pos[1]-1]+o.seq2});if(o.pos[0]===0&&o.pos[1]===0)this.alignments.push({sequence1:o.seq1,sequence2:o.seq2});c.shift()}return this.alignments}},{key:"getAllIndexes",value:function(c,o){var y=[],n=-1;while((n=c.indexOf(o,n+1))!==-1)y.push(n);return y}},{key:"arrayAllMaxIndexes",value:function(c){return this.getAllIndexes(c,Math.max.apply(null,c))}}]),i}();m.exports=e},function(m,w,L){var s=function(){return};s.FDLayout=L(18),s.FDLayoutConstants=L(7),s.FDLayoutEdge=L(19),s.FDLayoutNode=L(20),s.DimensionD=L(21),s.HashMap=L(22),s.HashSet=L(23),s.IGeometry=L(8),s.IMath=L(9),s.Integer=L(10),s.Point=L(12),s.PointD=L(4),s.RandomSeed=L(16),s.RectangleD=L(13),s.Transform=L(17),s.UniqueIDGeneretor=L(14),s.Quicksort=L(24),s.LinkedList=L(11),s.LGraphObject=L(2),s.LGraph=L(5),s.LEdge=L(1),s.LGraphManager=L(6),s.LNode=L(3),s.Layout=L(15),s.LayoutConstants=L(0),s.NeedlemanWunsch=L(25),m.exports=s},function(m,w,L){function s(){this.listeners=[]}var r=s.prototype;r.addListener=function(e,i){this.listeners.push({event:e,callback:i})},r.removeListener=function(e,i){for(var u=this.listeners.length;u>=0;u--){var c=this.listeners[u];if(c.event===e&&c.callback===i)this.listeners.splice(u,1)}},r.emit=function(e,i){for(var u=0;u<this.listeners.length;u++){var c=this.listeners[u];if(e===c.event)c.callback(i)}},m.exports=s}])})});var J=yn(function(Q,z){(function(w,L){if(typeof Q==="object"&&typeof z==="object")z.exports=L(q());else if(typeof define==="function"&&define.amd)define(["layout-base"],L);else if(typeof Q==="object")Q.coseBase=L(q());else w.coseBase=L(w.layoutBase)})(Q,function(m){return function(w){var L={};function s(r){if(L[r])return L[r].exports;var e=L[r]={i:r,l:!1,exports:{}};return w[r].call(e.exports,e,e.exports,s),e.l=!0,e.exports}return s.m=w,s.c=L,s.i=function(r){return r},s.d=function(r,e,i){if(!s.o(r,e))Object.defineProperty(r,e,{configurable:!1,enumerable:!0,get:i})},s.n=function(r){var e=r&&r.__esModule?function(){return r.default}:function(){return r};return s.d(e,"a",e),e},s.o=function(r,e){return Object.prototype.hasOwnProperty.call(r,e)},s.p="",s(s.s=7)}([function(w,L){w.exports=m},function(w,L,s){var r=s(0).FDLayoutConstants;function e(){}for(var i in r)e[i]=r[i];e.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,e.DEFAULT_RADIAL_SEPARATION=r.DEFAULT_EDGE_LENGTH,e.DEFAULT_COMPONENT_SEPERATION=60,e.TILE=!0,e.TILING_PADDING_VERTICAL=10,e.TILING_PADDING_HORIZONTAL=10,e.TREE_REDUCTION_ON_INCREMENTAL=!1,w.exports=e},function(w,L,s){var r=s(0).FDLayoutEdge;function e(u,c,o){r.call(this,u,c,o)}e.prototype=Object.create(r.prototype);for(var i in r)e[i]=r[i];w.exports=e},function(w,L,s){var r=s(0).LGraph;function e(u,c,o){r.call(this,u,c,o)}e.prototype=Object.create(r.prototype);for(var i in r)e[i]=r[i];w.exports=e},function(w,L,s){var r=s(0).LGraphManager;function e(u){r.call(this,u)}e.prototype=Object.create(r.prototype);for(var i in r)e[i]=r[i];w.exports=e},function(w,L,s){var r=s(0).FDLayoutNode,e=s(0).IMath;function i(c,o,y,n){r.call(this,c,o,y,n)}i.prototype=Object.create(r.prototype);for(var u in r)i[u]=r[u];i.prototype.move=function(){var c=this.graphManager.getLayout();if(this.displacementX=c.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY=c.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren,Math.abs(this.displacementX)>c.coolingFactor*c.maxNodeDisplacement)this.displacementX=c.coolingFactor*c.maxNodeDisplacement*e.sign(this.displacementX);if(Math.abs(this.displacementY)>c.coolingFactor*c.maxNodeDisplacement)this.displacementY=c.coolingFactor*c.maxNodeDisplacement*e.sign(this.displacementY);if(this.child==null)this.moveBy(this.displacementX,this.displacementY);else if(this.child.getNodes().length==0)this.moveBy(this.displacementX,this.displacementY);else this.propogateDisplacementToChildren(this.displacementX,this.displacementY);c.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},i.prototype.propogateDisplacementToChildren=function(c,o){var y=this.getChild().getNodes(),n;for(var g=0;g<y.length;g++)if(n=y[g],n.getChild()==null)n.moveBy(c,o),n.displacementX+=c,n.displacementY+=o;else n.propogateDisplacementToChildren(c,o)},i.prototype.setPred1=function(c){this.pred1=c},i.prototype.getPred1=function(){return pred1},i.prototype.getPred2=function(){return pred2},i.prototype.setNext=function(c){this.next=c},i.prototype.getNext=function(){return next},i.prototype.setProcessed=function(c){this.processed=c},i.prototype.isProcessed=function(){return processed},w.exports=i},function(w,L,s){var r=s(0).FDLayout,e=s(4),i=s(3),u=s(5),c=s(2),o=s(1),y=s(0).FDLayoutConstants,n=s(0).LayoutConstants,g=s(0).Point,f=s(0).PointD,E=s(0).Layout,T=s(0).Integer,N=s(0).IGeometry,v=s(0).LGraph,O=s(0).Transform;function D(){r.call(this),this.toBeTiled={}}D.prototype=Object.create(r.prototype);for(var R in r)D[R]=r[R];D.prototype.newGraphManager=function(){var a=new e(this);return this.graphManager=a,a},D.prototype.newGraph=function(a){return new i(null,this.graphManager,a)},D.prototype.newNode=function(a){return new u(this.graphManager,a)},D.prototype.newEdge=function(a){return new c(null,null,a)},D.prototype.initParameters=function(){if(r.prototype.initParameters.call(this,arguments),!this.isSubLayout){if(o.DEFAULT_EDGE_LENGTH<10)this.idealEdgeLength=10;else this.idealEdgeLength=o.DEFAULT_EDGE_LENGTH;this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.springConstant=y.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=y.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=y.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=y.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=y.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=y.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1,this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/y.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=y.CONVERGENCE_CHECK_PERIOD/this.maxIterations,this.coolingAdjuster=1}},D.prototype.layout=function(){var a=n.DEFAULT_CREATE_BENDS_AS_NEEDED;if(a)this.createBendpoints(),this.graphManager.resetAllEdges();return 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){var a=this.getFlatForest();if(a.length>0)this.positionNodesRadially(a);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var p=new Set(this.getAllNodes()),d=this.nodesWithGravity.filter(function(A){return p.has(A)});this.graphManager.setAllNodesToApplyGravitation(d),this.positionNodesRandomly()}}else if(o.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var p=new Set(this.getAllNodes()),d=this.nodesWithGravity.filter(function(C){return p.has(C)});this.graphManager.setAllNodesToApplyGravitation(d)}return this.initSpringEmbedder(),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%y.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.coolingCycle++,this.layoutQuality==0)this.coolingAdjuster=this.coolingCycle;else if(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 a=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(I){return a.has(I)});this.graphManager.setAllNodesToApplyGravitation(p),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=y.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;if(this.afterGrowthIterations%10==0)this.graphManager.updateBounds(),this.updateGrid();this.coolingFactor=y.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var d=!this.isTreeGrowing&&!this.isGrowthFinished,A=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(d,A),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},D.prototype.getPositionsData=function(){var a=this.graphManager.getAllNodes(),p={};for(var d=0;d<a.length;d++){var A=a[d].rect,I=a[d].id;p[I]={id:I,x:A.getCenterX(),y:A.getCenterY(),w:A.width,h:A.height}}return p},D.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var a=!1;if(y.ANIMATE==="during")this.emit("layoutstarted");else{while(!a)a=this.tick();this.graphManager.updateBounds()}},D.prototype.calculateNodesToApplyGravitationTo=function(){var a=[],p,d=this.graphManager.getGraphs(),A=d.length,I;for(I=0;I<A;I++)if(p=d[I],p.updateConnected(),!p.isConnected)a=a.concat(p.getNodes());return a},D.prototype.createBendpoints=function(){var a=[];a=a.concat(this.graphManager.getAllEdges());var p=new Set,d;for(d=0;d<a.length;d++){var A=a[d];if(!p.has(A)){var I=A.getSource(),C=A.getTarget();if(I==C)A.getBendpoints().push(new f),A.getBendpoints().push(new f),this.createDummyNodesForBendpoints(A),p.add(A);else{var M=[];if(M=M.concat(I.getEdgeListToNode(C)),M=M.concat(C.getEdgeListToNode(I)),!p.has(M[0])){if(M.length>1){var G;for(G=0;G<M.length;G++){var F=M[G];F.getBendpoints().push(new f),this.createDummyNodesForBendpoints(F)}}M.forEach(function(P){p.add(P)})}}}if(p.size==a.length)break}},D.prototype.positionNodesRadially=function(a){var p=new g(0,0),d=Math.ceil(Math.sqrt(a.length)),A=0,I=0,C=0,M=new f(0,0);for(var G=0;G<a.length;G++){if(G%d==0){if(C=0,I=A,G!=0)I+=o.DEFAULT_COMPONENT_SEPERATION;A=0}var F=a[G],P=E.findCenterOfTree(F);if(p.x=C,p.y=I,M=D.radialLayout(F,P,p),M.y>A)A=Math.floor(M.y);C=Math.floor(M.x+o.DEFAULT_COMPONENT_SEPERATION)}this.transform(new f(n.WORLD_CENTER_X-M.x/2,n.WORLD_CENTER_Y-M.y/2))},D.radialLayout=function(a,p,d){var A=Math.max(this.maxDiagonalInTree(a),o.DEFAULT_RADIAL_SEPARATION);D.branchRadialLayout(p,null,0,359,0,A);var I=v.calculateBounds(a),C=new O;C.setDeviceOrgX(I.getMinX()),C.setDeviceOrgY(I.getMinY()),C.setWorldOrgX(d.x),C.setWorldOrgY(d.y);for(var M=0;M<a.length;M++){var G=a[M];G.transform(C)}var F=new f(I.getMaxX(),I.getMaxY());return C.inverseTransformPoint(F)},D.branchRadialLayout=function(a,p,d,A,I,C){var M=(A-d+1)/2;if(M<0)M+=180;var G=(M+d)%360,F=G*N.TWO_PI/360,P=Math.cos(F),b=I*Math.cos(F),U=I*Math.sin(F);a.setCenter(b,U);var x=[];x=x.concat(a.getEdges());var S=x.length;if(p!=null)S--;var Y=0,X=x.length,H,_=a.getEdgesBetween(p);while(_.length>1){var W=_[0];_.splice(0,1);var k=x.indexOf(W);if(k>=0)x.splice(k,1);X--,S--}if(p!=null)H=(x.indexOf(_[0])+1)%X;else H=0;var B=Math.abs(A-d)/S;for(var V=H;Y!=S;V=++V%X){var et=x[V].getOtherEnd(a);if(et==p)continue;var rt=(d+Y*B)%360,ft=(rt+B)%360;D.branchRadialLayout(et,a,rt,ft,I+C,C),Y++}},D.maxDiagonalInTree=function(a){var p=T.MIN_VALUE;for(var d=0;d<a.length;d++){var A=a[d],I=A.getDiagonal();if(I>p)p=I}return p},D.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},D.prototype.groupZeroDegreeMembers=function(){var a=this,p={};this.memberGroups={},this.idToDummyNode={};var d=[],A=this.graphManager.getAllNodes();for(var I=0;I<A.length;I++){var C=A[I],M=C.getParent();if(this.getNodeDegreeWithChildren(C)===0&&(M.id==null||!this.getToBeTiled(M)))d.push(C)}for(var I=0;I<d.length;I++){var C=d[I],G=C.getParent().id;if(typeof p[G]>"u")p[G]=[];p[G]=p[G].concat(C)}Object.keys(p).forEach(function(F){if(p[F].length>1){var P="DummyCompound_"+F;a.memberGroups[P]=p[F];var b=p[F][0].getParent(),U=new u(a.graphManager);U.id=P,U.paddingLeft=b.paddingLeft||0,U.paddingRight=b.paddingRight||0,U.paddingBottom=b.paddingBottom||0,U.paddingTop=b.paddingTop||0,a.idToDummyNode[P]=U;var x=a.getGraphManager().add(a.newGraph(),U),S=b.getChild();S.add(U);for(var Y=0;Y<p[F].length;Y++){var X=p[F][Y];S.remove(X),x.add(X)}}})},D.prototype.clearCompounds=function(){var a={},p={};this.performDFSOnCompounds();for(var d=0;d<this.compoundOrder.length;d++)p[this.compoundOrder[d].id]=this.compoundOrder[d],a[this.compoundOrder[d].id]=[].concat(this.compoundOrder[d].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[d].getChild()),this.compoundOrder[d].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(a,p)},D.prototype.clearZeroDegreeMembers=function(){var a=this,p=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(d){var A=a.idToDummyNode[d];p[d]=a.tileNodes(a.memberGroups[d],A.paddingLeft+A.paddingRight),A.rect.width=p[d].width,A.rect.height=p[d].height})},D.prototype.repopulateCompounds=function(){for(var a=this.compoundOrder.length-1;a>=0;a--){var p=this.compoundOrder[a],{id:d,paddingLeft:A,paddingTop:I}=p;this.adjustLocations(this.tiledMemberPack[d],p.rect.x,p.rect.y,A,I)}},D.prototype.repopulateZeroDegreeMembers=function(){var a=this,p=this.tiledZeroDegreePack;Object.keys(p).forEach(function(d){var A=a.idToDummyNode[d],{paddingLeft:I,paddingTop:C}=A;a.adjustLocations(p[d],A.rect.x,A.rect.y,I,C)})},D.prototype.getToBeTiled=function(a){var p=a.id;if(this.toBeTiled[p]!=null)return this.toBeTiled[p];var d=a.getChild();if(d==null)return this.toBeTiled[p]=!1,!1;var A=d.getNodes();for(var I=0;I<A.length;I++){var C=A[I];if(this.getNodeDegree(C)>0)return this.toBeTiled[p]=!1,!1;if(C.getChild()==null){this.toBeTiled[C.id]=!1;continue}if(!this.getToBeTiled(C))return this.toBeTiled[p]=!1,!1}return this.toBeTiled[p]=!0,!0},D.prototype.getNodeDegree=function(a){var p=a.id,d=a.getEdges(),A=0;for(var I=0;I<d.length;I++){var C=d[I];if(C.getSource().id!==C.getTarget().id)A=A+1}return A},D.prototype.getNodeDegreeWithChildren=function(a){var p=this.getNodeDegree(a);if(a.getChild()==null)return p;var d=a.getChild().getNodes();for(var A=0;A<d.length;A++){var I=d[A];p+=this.getNodeDegreeWithChildren(I)}return p},D.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},D.prototype.fillCompexOrderByDFS=function(a){for(var p=0;p<a.length;p++){var d=a[p];if(d.getChild()!=null)this.fillCompexOrderByDFS(d.getChild().getNodes());if(this.getToBeTiled(d))this.compoundOrder.push(d)}},D.prototype.adjustLocations=function(a,p,d,A,I){p+=A,d+=I;var C=p;for(var M=0;M<a.rows.length;M++){var G=a.rows[M];p=C;var F=0;for(var P=0;P<G.length;P++){var b=G[P];if(b.rect.x=p,b.rect.y=d,p+=b.rect.width+a.horizontalPadding,b.rect.height>F)F=b.rect.height}d+=F+a.verticalPadding}},D.prototype.tileCompoundMembers=function(a,p){var d=this;this.tiledMemberPack=[],Object.keys(a).forEach(function(A){var I=p[A];d.tiledMemberPack[A]=d.tileNodes(a[A],I.paddingLeft+I.paddingRight),I.rect.width=d.tiledMemberPack[A].width,I.rect.height=d.tiledMemberPack[A].height})},D.prototype.tileNodes=function(a,p){var{TILING_PADDING_VERTICAL:d,TILING_PADDING_HORIZONTAL:A}=o,I={rows:[],rowWidth:[],rowHeight:[],width:0,height:p,verticalPadding:d,horizontalPadding:A};a.sort(function(G,F){if(G.rect.width*G.rect.height>F.rect.width*F.rect.height)return-1;if(G.rect.width*G.rect.height<F.rect.width*F.rect.height)return 1;return 0});for(var C=0;C<a.length;C++){var M=a[C];if(I.rows.length==0)this.insertNodeToRow(I,M,0,p);else if(this.canAddHorizontal(I,M.rect.width,M.rect.height))this.insertNodeToRow(I,M,this.getShortestRowIndex(I),p);else this.insertNodeToRow(I,M,I.rows.length,p);this.shiftToLastRow(I)}return I},D.prototype.insertNodeToRow=function(a,p,d,A){var I=A;if(d==a.rows.length){var C=[];a.rows.push(C),a.rowWidth.push(I),a.rowHeight.push(0)}var M=a.rowWidth[d]+p.rect.width;if(a.rows[d].length>0)M+=a.horizontalPadding;if(a.rowWidth[d]=M,a.width<M)a.width=M;var G=p.rect.height;if(d>0)G+=a.verticalPadding;var F=0;if(G>a.rowHeight[d])F=a.rowHeight[d],a.rowHeight[d]=G,F=a.rowHeight[d]-F;a.height+=F,a.rows[d].push(p)},D.prototype.getShortestRowIndex=function(a){var p=-1,d=Number.MAX_VALUE;for(var A=0;A<a.rows.length;A++)if(a.rowWidth[A]<d)p=A,d=a.rowWidth[A];return p},D.prototype.getLongestRowIndex=function(a){var p=-1,d=Number.MIN_VALUE;for(var A=0;A<a.rows.length;A++)if(a.rowWidth[A]>d)p=A,d=a.rowWidth[A];return p},D.prototype.canAddHorizontal=function(a,p,d){var A=this.getShortestRowIndex(a);if(A<0)return!0;var I=a.rowWidth[A];if(I+a.horizontalPadding+p<=a.width)return!0;var C=0;if(a.rowHeight[A]<d){if(A>0)C=d+a.verticalPadding-a.rowHeight[A]}var M;if(a.width-I>=p+a.horizontalPadding)M=(a.height+C)/(I+p+a.horizontalPadding);else M=(a.height+C)/a.width;C=d+a.verticalPadding;var G;if(a.width<p)G=(a.height+C)/p;else G=(a.height+C)/a.width;if(G<1)G=1/G;if(M<1)M=1/M;return M<G},D.prototype.shiftToLastRow=function(a){var p=this.getLongestRowIndex(a),d=a.rowWidth.length-1,A=a.rows[p],I=A[A.length-1],C=I.width+a.horizontalPadding;if(a.width-a.rowWidth[d]>C&&p!=d){A.splice(-1,1),a.rows[d].push(I),a.rowWidth[p]=a.rowWidth[p]-C,a.rowWidth[d]=a.rowWidth[d]+C,a.width=a.rowWidth[instance.getLongestRowIndex(a)];var M=Number.MIN_VALUE;for(var G=0;G<A.length;G++)if(A[G].height>M)M=A[G].height;if(p>0)M+=a.verticalPadding;var F=a.rowHeight[p]+a.rowHeight[d];if(a.rowHeight[p]=M,a.rowHeight[d]<I.height+a.verticalPadding)a.rowHeight[d]=I.height+a.verticalPadding;var P=a.rowHeight[p]+a.rowHeight[d];a.height+=P-F,this.shiftToLastRow(a)}},D.prototype.tilingPreLayout=function(){if(o.TILE)this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers()},D.prototype.tilingPostLayout=function(){if(o.TILE)this.repopulateZeroDegreeMembers(),this.repopulateCompounds()},D.prototype.reduceTrees=function(){var a=[],p=!0,d;while(p){var A=this.graphManager.getAllNodes(),I=[];p=!1;for(var C=0;C<A.length;C++)if(d=A[C],d.getEdges().length==1&&!d.getEdges()[0].isInterGraph&&d.getChild()==null)I.push([d,d.getEdges()[0],d.getOwner()]),p=!0;if(p==!0){var M=[];for(var G=0;G<I.length;G++)if(I[G][0].getEdges().length==1)M.push(I[G]),I[G][0].getOwner().remove(I[G][0]);a.push(M),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=a},D.prototype.growTree=function(a){var p=a.length,d=a[p-1],A;for(var I=0;I<d.length;I++)A=d[I],this.findPlaceforPrunedNode(A),A[2].add(A[0]),A[2].add(A[1],A[1].source,A[1].target);a.splice(a.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},D.prototype.findPlaceforPrunedNode=function(a){var p,d,A=a[0];if(A==a[1].source)d=a[1].target;else d=a[1].source;var I=d.startX,C=d.finishX,M=d.startY,G=d.finishY,F=0,P=0,b=0,U=0,x=[F,b,P,U];if(M>0)for(var S=I;S<=C;S++)x[0]+=this.grid[S][M-1].length+this.grid[S][M].length-1;if(C<this.grid.length-1)for(var S=M;S<=G;S++)x[1]+=this.grid[C+1][S].length+this.grid[C][S].length-1;if(G<this.grid[0].length-1)for(var S=I;S<=C;S++)x[2]+=this.grid[S][G+1].length+this.grid[S][G].length-1;if(I>0)for(var S=M;S<=G;S++)x[3]+=this.grid[I-1][S].length+this.grid[I][S].length-1;var Y=T.MAX_VALUE,X,H;for(var _=0;_<x.length;_++)if(x[_]<Y)Y=x[_],X=1,H=_;else if(x[_]==Y)X++;if(X==3&&Y==0){if(x[0]==0&&x[1]==0&&x[2]==0)p=1;else if(x[0]==0&&x[1]==0&&x[3]==0)p=0;else if(x[0]==0&&x[2]==0&&x[3]==0)p=3;else if(x[1]==0&&x[2]==0&&x[3]==0)p=2}else if(X==2&&Y==0){var W=Math.floor(Math.random()*2);if(x[0]==0&&x[1]==0)if(W==0)p=0;else p=1;else if(x[0]==0&&x[2]==0)if(W==0)p=0;else p=2;else if(x[0]==0&&x[3]==0)if(W==0)p=0;else p=3;else if(x[1]==0&&x[2]==0)if(W==0)p=1;else p=2;else if(x[1]==0&&x[3]==0)if(W==0)p=1;else p=3;else if(W==0)p=2;else p=3}else if(X==4&&Y==0){var W=Math.floor(Math.random()*4);p=W}else p=H;if(p==0)A.setCenter(d.getCenterX(),d.getCenterY()-d.getHeight()/2-y.DEFAULT_EDGE_LENGTH-A.getHeight()/2);else if(p==1)A.setCenter(d.getCenterX()+d.getWidth()/2+y.DEFAULT_EDGE_LENGTH+A.getWidth()/2,d.getCenterY());else if(p==2)A.setCenter(d.getCenterX(),d.getCenterY()+d.getHeight()/2+y.DEFAULT_EDGE_LENGTH+A.getHeight()/2);else A.setCenter(d.getCenterX()-d.getWidth()/2-y.DEFAULT_EDGE_LENGTH-A.getWidth()/2,d.getCenterY())},w.exports=D},function(w,L,s){var r={};r.layoutBase=s(0),r.CoSEConstants=s(1),r.CoSEEdge=s(2),r.CoSEGraph=s(3),r.CoSEGraphManager=s(4),r.CoSELayout=s(6),r.CoSENode=s(5),w.exports=r}])})});var it=yn(function(j,tt){(function(w,L){if(typeof j==="object"&&typeof tt==="object")tt.exports=L(J());else if(typeof define==="function"&&define.amd)define(["cose-base"],L);else if(typeof j==="object")j.cytoscapeCoseBilkent=L(J());else w.cytoscapeCoseBilkent=L(w.coseBase)})(j,function(m){return function(w){var L={};function s(r){if(L[r])return L[r].exports;var e=L[r]={i:r,l:!1,exports:{}};return w[r].call(e.exports,e,e.exports,s),e.l=!0,e.exports}return s.m=w,s.c=L,s.i=function(r){return r},s.d=function(r,e,i){if(!s.o(r,e))Object.defineProperty(r,e,{configurable:!1,enumerable:!0,get:i})},s.n=function(r){var e=r&&r.__esModule?function(){return r.default}:function(){return r};return s.d(e,"a",e),e},s.o=function(r,e){return Object.prototype.hasOwnProperty.call(r,e)},s.p="",s(s.s=1)}([function(w,L){w.exports=m},function(w,L,s){var r=s(0).layoutBase.LayoutConstants,e=s(0).layoutBase.FDLayoutConstants,i=s(0).CoSEConstants,u=s(0).CoSELayout,c=s(0).CoSENode,o=s(0).layoutBase.PointD,y=s(0).layoutBase.DimensionD,n={ready:function(){},stop:function(){},quality:"default",nodeDimensionsIncludeLabels:!1,refresh:30,fit:!0,padding:10,randomize:!0,nodeRepulsion:4500,idealEdgeLength:50,edgeElasticity:0.45,nestingFactor:0.1,gravity:0.25,numIter:2500,tile:!0,animate:"end",animationDuration:500,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:0.5};function g(N,v){var O={};for(var D in N)O[D]=N[D];for(var D in v)O[D]=v[D];return O}function f(N){this.options=g(n,N),E(this.options)}var E=function(v){if(v.nodeRepulsion!=null)i.DEFAULT_REPULSION_STRENGTH=e.DEFAULT_REPULSION_STRENGTH=v.nodeRepulsion;if(v.idealEdgeLength!=null)i.DEFAULT_EDGE_LENGTH=e.DEFAULT_EDGE_LENGTH=v.idealEdgeLength;if(v.edgeElasticity!=null)i.DEFAULT_SPRING_STRENGTH=e.DEFAULT_SPRING_STRENGTH=v.edgeElasticity;if(v.nestingFactor!=null)i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=e.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=v.nestingFactor;if(v.gravity!=null)i.DEFAULT_GRAVITY_STRENGTH=e.DEFAULT_GRAVITY_STRENGTH=v.gravity;if(v.numIter!=null)i.MAX_ITERATIONS=e.MAX_ITERATIONS=v.numIter;if(v.gravityRange!=null)i.DEFAULT_GRAVITY_RANGE_FACTOR=e.DEFAULT_GRAVITY_RANGE_FACTOR=v.gravityRange;if(v.gravityCompound!=null)i.DEFAULT_COMPOUND_GRAVITY_STRENGTH=e.DEFAULT_COMPOUND_GRAVITY_STRENGTH=v.gravityCompound;if(v.gravityRangeCompound!=null)i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=e.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=v.gravityRangeCompound;if(v.initialEnergyOnIncremental!=null)i.DEFAULT_COOLING_FACTOR_INCREMENTAL=e.DEFAULT_COOLING_FACTOR_INCREMENTAL=v.initialEnergyOnIncremental;if(v.quality=="draft")r.QUALITY=0;else if(v.quality=="proof")r.QUALITY=2;else r.QUALITY=1;i.NODE_DIMENSIONS_INCLUDE_LABELS=e.NODE_DIMENSIONS_INCLUDE_LABELS=r.NODE_DIMENSIONS_INCLUDE_LABELS=v.nodeDimensionsIncludeLabels,i.DEFAULT_INCREMENTAL=e.DEFAULT_INCREMENTAL=r.DEFAULT_INCREMENTAL=!v.randomize,i.ANIMATE=e.ANIMATE=r.ANIMATE=v.animate,i.TILE=v.tile,i.TILING_PADDING_VERTICAL=typeof v.tilingPaddingVertical==="function"?v.tilingPaddingVertical.call():v.tilingPaddingVertical,i.TILING_PADDING_HORIZONTAL=typeof v.tilingPaddingHorizontal==="function"?v.tilingPaddingHorizontal.call():v.tilingPaddingHorizontal};f.prototype.run=function(){var N,v,O=this.options,D=this.idToLNode={},R=this.layout=new u,a=this;a.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:"layoutstart",layout:this});var p=R.newGraphManager();this.gm=p;var d=this.options.eles.nodes(),A=this.options.eles.edges();this.root=p.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(d),R);for(var I=0;I<A.length;I++){var C=A[I],M=this.idToLNode[C.data("source")],G=this.idToLNode[C.data("target")];if(M!==G&&M.getEdgesBetween(G).length==0){var F=p.add(R.newEdge(),M,G);F.id=C.id()}}var P=function(x,S){if(typeof x==="number")x=S;var Y=x.data("id"),X=a.idToLNode[Y];return{x:X.getRect().getCenterX(),y:X.getRect().getCenterY()}},b=function U(){var x=function(){if(O.fit)O.cy.fit(O.eles,O.padding);if(!N)N=!0,a.cy.one("layoutready",O.ready),a.cy.trigger({type:"layoutready",layout:a})},S=a.options.refresh,Y;for(var X=0;X<S&&!Y;X++)Y=a.stopped||a.layout.tick();if(Y){if(R.checkLayoutSuccess()&&!R.isSubLayout)R.doPostLayout();if(R.tilingPostLayout)R.tilingPostLayout();if(R.isLayoutFinished=!0,a.options.eles.nodes().positions(P),x(),a.cy.one("layoutstop",a.options.stop),a.cy.trigger({type:"layoutstop",layout:a}),v)cancelAnimationFrame(v);N=!1;return}var H=a.layout.getPositionsData();O.eles.nodes().positions(function(_,W){if(typeof _==="number")_=W;if(!_.isParent()){var k=_.id(),B=H[k],V=_;while(B==null)if(B=H[V.data("parent")]||H["DummyCompound_"+V.data("parent")],H[k]=B,V=V.parent()[0],V==null)break;if(B!=null)return{x:B.x,y:B.y};else return{x:_.position("x"),y:_.position("y")}}}),x(),v=requestAnimationFrame(U)};if(R.addListener("layoutstarted",function(){if(a.options.animate==="during")v=requestAnimationFrame(b)}),R.runLayout(),this.options.animate!=="during")a.options.eles.nodes().not(":parent").layoutPositions(a,a.options,P),N=!1;return this},f.prototype.getTopMostNodes=function(N){var v={};for(var O=0;O<N.length;O++)v[N[O].id()]=!0;var D=N.filter(function(R,a){if(typeof R==="number")R=a;var p=R.parent()[0];while(p!=null){if(v[p.id()])return!1;p=p.parent()[0]}return!0});return D},f.prototype.processChildrenList=function(N,v,O){var D=v.length;for(var R=0;R<D;R++){var a=v[R],p=a.children(),d,A=a.layoutDimensions({nodeDimensionsIncludeLabels:this.options.nodeDimensionsIncludeLabels});if(a.outerWidth()!=null&&a.outerHeight()!=null)d=N.add(new c(O.graphManager,new o(a.position("x")-A.w/2,a.position("y")-A.h/2),new y(parseFloat(A.w),parseFloat(A.h))));else d=N.add(new c(this.graphManager));if(d.id=a.data("id"),d.paddingLeft=parseInt(a.css("padding")),d.paddingTop=parseInt(a.css("padding")),d.paddingRight=parseInt(a.css("padding")),d.paddingBottom=parseInt(a.css("padding")),this.options.nodeDimensionsIncludeLabels){if(a.isParent()){var I=a.boundingBox({includeLabels:!0,includeNodes:!1}).w,C=a.boundingBox({includeLabels:!0,includeNodes:!1}).h,M=a.css("text-halign");d.labelWidth=I,d.labelHeight=C,d.labelPos=M}}if(this.idToLNode[a.data("id")]=d,isNaN(d.rect.x))d.rect.x=0;if(isNaN(d.rect.y))d.rect.y=0;if(p!=null&&p.length>0){var G=O.getGraphManager().add(O.newGraph(),d);this.processChildrenList(G,p,O)}}},f.prototype.stop=function(){return this.stopped=!0,this};var T=function(v){v("layout","cose-bilkent",f)};if(typeof cytoscape<"u")T(cytoscape);w.exports=T}])})});var nt=an(it(),1);Qr.use(nt.default);function st(m,w){m.forEach((L)=>{let s={id:L.id,labelText:L.label,height:L.height,width:L.width,padding:L.padding??0};Object.keys(L).forEach((r)=>{if(!["id","label","height","width","padding","x","y"].includes(r))s[r]=L[r]}),w.add({group:"nodes",data:s,position:{x:L.x??0,y:L.y??0}})})}t(st,"addNodes");function ot(m,w){m.forEach((L)=>{let s={id:L.id,source:L.start,target:L.end};Object.keys(L).forEach((r)=>{if(!["id","start","end"].includes(r))s[r]=L[r]}),w.add({group:"edges",data:s})})}t(ot,"addEdges");function at(m){return new Promise((w)=>{let L=h("body").append("div").attr("id","cy").attr("style","display:none"),s=Qr({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});L.remove(),st(m.nodes,s),ot(m.edges,s),s.nodes().forEach(function(e){e.layoutDimensions=()=>{let i=e.data();return{w:i.width,h:i.height}}});let r={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};s.layout(r).run(),s.ready((e)=>{l.info("Cytoscape ready",e),w(s)})})}t(at,"createCytoscapeInstance");function ht(m){return m.nodes().map((w)=>{let L=w.data(),s=w.position(),r={id:L.id,x:s.x,y:s.y};return Object.keys(L).forEach((e)=>{if(e!=="id")r[e]=L[e]}),r})}t(ht,"extractPositionedNodes");function lt(m){return m.edges().map((w)=>{let L=w.data(),s=w._private.rscratch,r={id:L.id,source:L.source,target:L.target,startX:s.startX,startY:s.startY,midX:s.midX,midY:s.midY,endX:s.endX,endY:s.endY};return Object.keys(L).forEach((e)=>{if(!["id","source","target"].includes(e))r[e]=L[e]}),r})}t(lt,"extractPositionedEdges");async function ut(m,w){l.debug("Starting cose-bilkent layout algorithm");try{gt(m);let L=await at(m),s=ht(L),r=lt(L);return l.debug(`Layout completed: ${s.length} nodes, ${r.length} edges`),{nodes:s,edges:r}}catch(L){throw l.error("Error in cose-bilkent layout algorithm:",L),L}}t(ut,"executeCoseBilkentLayout");function gt(m){if(!m)throw Error("Layout data is required");if(!m.config)throw Error("Configuration is required in layout data");if(!m.rootNode)throw Error("Root node is required");if(!m.nodes||!Array.isArray(m.nodes))throw Error("No nodes found in layout data");if(!Array.isArray(m.edges))throw Error("Edges array is required in layout data");return!0}t(gt,"validateLayoutData");var ct=t(async(m,w,{insertCluster:L,insertEdge:s,insertEdgeLabel:r,insertMarkers:e,insertNode:i,log:u,positionEdgeLabel:c},{algorithm:o})=>{let y={},n={},g=w.select("g");e(g,m.markers,m.type,m.diagramId);let f=g.insert("g").attr("class","subgraphs"),E=g.insert("g").attr("class","edgePaths"),T=g.insert("g").attr("class","edgeLabels"),N=g.insert("g").attr("class","nodes");u.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(m.nodes.map(async(D)=>{if(D.isGroup){let R={...D};n[D.id]=R,y[D.id]=R,await L(f,D)}else{let R={...D};y[D.id]=R;let a=await i(N,D,{config:m.config,dir:m.direction||"TB"}),p=a.node().getBBox();R.width=p.width,R.height=p.height,R.domId=a,u.debug(`Node ${D.id} dimensions: ${p.width}x${p.height}`)}})),u.debug("Running cose-bilkent layout algorithm");let v={...m,nodes:m.nodes.map((D)=>{let R=y[D.id];return{...D,width:R.width,height:R.height}})},O=await ut(v,m.config);u.debug("Positioning nodes based on layout results"),O.nodes.forEach((D)=>{let R=y[D.id];if(R?.domId)R.domId.attr("transform",`translate(${D.x}, ${D.y})`),R.x=D.x,R.y=D.y,u.debug(`Positioned node ${R.id} at center (${D.x}, ${D.y})`)}),O.edges.forEach((D)=>{let R=m.edges.find((a)=>a.id===D.id);if(R)R.points=[{x:D.startX,y:D.startY},{x:D.midX,y:D.midY},{x:D.endX,y:D.endY}]}),u.debug("Inserting and positioning edges"),await Promise.all(m.edges.map(async(D)=>{let R=await r(T,D),a=y[D.start??""],p=y[D.end??""];if(a&&p){let d=O.edges.find((A)=>A.id===D.id);if(d){u.debug("APA01 positionedEdge",d);let A={...D},I=s(E,A,n,m.type,a,p,m.diagramId);c(A,I)}else{let A={...D,points:[{x:a.x||0,y:a.y||0},{x:p.x||0,y:p.y||0}]},I=s(E,A,n,m.type,a,p,m.diagramId);c(A,I)}}})),u.debug("Cose-bilkent rendering completed")},"render"),Et=ct;export{Et as render};
|
|
1
|
+
import{t,l,h}from"./index-fta1y9pc.js";import{Nr}from"./index-ray2czf6.js";import{an,bn}from"./index-pm6xxwz1.js";var q=bn(function(Z,K){(function(w,L){if(typeof Z==="object"&&typeof K==="object")K.exports=L();else if(typeof define==="function"&&define.amd)define([],L);else if(typeof Z==="object")Z.layoutBase=L();else w.layoutBase=L()})(Z,function(){return function(m){var w={};function L(s){if(w[s])return w[s].exports;var r=w[s]={i:s,l:!1,exports:{}};return m[s].call(r.exports,r,r.exports,L),r.l=!0,r.exports}return L.m=m,L.c=w,L.i=function(s){return s},L.d=function(s,r,e){if(!L.o(s,r))Object.defineProperty(s,r,{configurable:!1,enumerable:!0,get:e})},L.n=function(s){var r=s&&s.__esModule?function(){return s.default}:function(){return s};return L.d(r,"a",r),r},L.o=function(s,r){return Object.prototype.hasOwnProperty.call(s,r)},L.p="",L(L.s=26)}([function(m,w,L){function s(){}s.QUALITY=1,s.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,s.DEFAULT_INCREMENTAL=!1,s.DEFAULT_ANIMATION_ON_LAYOUT=!0,s.DEFAULT_ANIMATION_DURING_LAYOUT=!1,s.DEFAULT_ANIMATION_PERIOD=50,s.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,s.DEFAULT_GRAPH_MARGIN=15,s.NODE_DIMENSIONS_INCLUDE_LABELS=!1,s.SIMPLE_NODE_SIZE=40,s.SIMPLE_NODE_HALF_SIZE=s.SIMPLE_NODE_SIZE/2,s.EMPTY_COMPOUND_NODE_SIZE=40,s.MIN_EDGE_LENGTH=1,s.WORLD_BOUNDARY=1e6,s.INITIAL_WORLD_BOUNDARY=s.WORLD_BOUNDARY/1000,s.WORLD_CENTER_X=1200,s.WORLD_CENTER_Y=900,m.exports=s},function(m,w,L){var s=L(2),r=L(8),e=L(9);function i(c,o,y){s.call(this,y),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=y,this.bendpoints=[],this.source=c,this.target=o}i.prototype=Object.create(s.prototype);for(var u in s)i[u]=s[u];i.prototype.getSource=function(){return this.source},i.prototype.getTarget=function(){return this.target},i.prototype.isInterGraph=function(){return this.isInterGraph},i.prototype.getLength=function(){return this.length},i.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},i.prototype.getBendpoints=function(){return this.bendpoints},i.prototype.getLca=function(){return this.lca},i.prototype.getSourceInLca=function(){return this.sourceInLca},i.prototype.getTargetInLca=function(){return this.targetInLca},i.prototype.getOtherEnd=function(c){if(this.source===c)return this.target;else if(this.target===c)return this.source;else throw"Node is not incident with this edge"},i.prototype.getOtherEndInGraph=function(c,o){var y=this.getOtherEnd(c),n=o.getGraphManager().getRoot();while(!0){if(y.getOwner()==o)return y;if(y.getOwner()==n)break;y=y.getOwner().getParent()}return null},i.prototype.updateLength=function(){var c=[,,,,];if(this.isOverlapingSourceAndTarget=r.getIntersection(this.target.getRect(),this.source.getRect(),c),!this.isOverlapingSourceAndTarget){if(this.lengthX=c[0]-c[2],this.lengthY=c[1]-c[3],Math.abs(this.lengthX)<1)this.lengthX=e.sign(this.lengthX);if(Math.abs(this.lengthY)<1)this.lengthY=e.sign(this.lengthY);this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)}},i.prototype.updateLengthSimple=function(){if(this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1)this.lengthX=e.sign(this.lengthX);if(Math.abs(this.lengthY)<1)this.lengthY=e.sign(this.lengthY);this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},m.exports=i},function(m,w,L){function s(r){this.vGraphObject=r}m.exports=s},function(m,w,L){var s=L(2),r=L(10),e=L(13),i=L(0),u=L(16),c=L(4);function o(n,g,f,E){if(f==null&&E==null)E=g;if(s.call(this,E),n.graphManager!=null)n=n.graphManager;if(this.estimatedSize=r.MIN_VALUE,this.inclusionTreeDepth=r.MAX_VALUE,this.vGraphObject=E,this.edges=[],this.graphManager=n,f!=null&&g!=null)this.rect=new e(g.x,g.y,f.width,f.height);else this.rect=new e}o.prototype=Object.create(s.prototype);for(var y in s)o[y]=s[y];o.prototype.getEdges=function(){return this.edges},o.prototype.getChild=function(){return this.child},o.prototype.getOwner=function(){return this.owner},o.prototype.getWidth=function(){return this.rect.width},o.prototype.setWidth=function(n){this.rect.width=n},o.prototype.getHeight=function(){return this.rect.height},o.prototype.setHeight=function(n){this.rect.height=n},o.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},o.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},o.prototype.getCenter=function(){return new c(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},o.prototype.getLocation=function(){return new c(this.rect.x,this.rect.y)},o.prototype.getRect=function(){return this.rect},o.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},o.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},o.prototype.setRect=function(n,g){this.rect.x=n.x,this.rect.y=n.y,this.rect.width=g.width,this.rect.height=g.height},o.prototype.setCenter=function(n,g){this.rect.x=n-this.rect.width/2,this.rect.y=g-this.rect.height/2},o.prototype.setLocation=function(n,g){this.rect.x=n,this.rect.y=g},o.prototype.moveBy=function(n,g){this.rect.x+=n,this.rect.y+=g},o.prototype.getEdgeListToNode=function(n){var g=[],f,E=this;return E.edges.forEach(function(T){if(T.target==n){if(T.source!=E)throw"Incorrect edge source!";g.push(T)}}),g},o.prototype.getEdgesBetween=function(n){var g=[],f,E=this;return E.edges.forEach(function(T){if(!(T.source==E||T.target==E))throw"Incorrect edge source and/or target";if(T.target==n||T.source==n)g.push(T)}),g},o.prototype.getNeighborsList=function(){var n=new Set,g=this;return g.edges.forEach(function(f){if(f.source==g)n.add(f.target);else{if(f.target!=g)throw"Incorrect incidency!";n.add(f.source)}}),n},o.prototype.withChildren=function(){var n=new Set,g,f;if(n.add(this),this.child!=null){var E=this.child.getNodes();for(var T=0;T<E.length;T++)g=E[T],f=g.withChildren(),f.forEach(function(N){n.add(N)})}return n},o.prototype.getNoOfChildren=function(){var n=0,g;if(this.child==null)n=1;else{var f=this.child.getNodes();for(var E=0;E<f.length;E++)g=f[E],n+=g.getNoOfChildren()}if(n==0)n=1;return n},o.prototype.getEstimatedSize=function(){if(this.estimatedSize==r.MIN_VALUE)throw"assert failed";return this.estimatedSize},o.prototype.calcEstimatedSize=function(){if(this.child==null)return this.estimatedSize=(this.rect.width+this.rect.height)/2;else return this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize},o.prototype.scatter=function(){var n,g,f=-i.INITIAL_WORLD_BOUNDARY,E=i.INITIAL_WORLD_BOUNDARY;n=i.WORLD_CENTER_X+u.nextDouble()*(E-f)+f;var T=-i.INITIAL_WORLD_BOUNDARY,N=i.INITIAL_WORLD_BOUNDARY;g=i.WORLD_CENTER_Y+u.nextDouble()*(N-T)+T,this.rect.x=n,this.rect.y=g},o.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var n=this.getChild();if(n.updateBounds(!0),this.rect.x=n.getLeft(),this.rect.y=n.getTop(),this.setWidth(n.getRight()-n.getLeft()),this.setHeight(n.getBottom()-n.getTop()),i.NODE_DIMENSIONS_INCLUDE_LABELS){var g=n.getRight()-n.getLeft(),f=n.getBottom()-n.getTop();if(this.labelWidth>g)this.rect.x-=(this.labelWidth-g)/2,this.setWidth(this.labelWidth);if(this.labelHeight>f){if(this.labelPos=="center")this.rect.y-=(this.labelHeight-f)/2;else if(this.labelPos=="top")this.rect.y-=this.labelHeight-f;this.setHeight(this.labelHeight)}}}},o.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==r.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},o.prototype.transform=function(n){var g=this.rect.x;if(g>i.WORLD_BOUNDARY)g=i.WORLD_BOUNDARY;else if(g<-i.WORLD_BOUNDARY)g=-i.WORLD_BOUNDARY;var f=this.rect.y;if(f>i.WORLD_BOUNDARY)f=i.WORLD_BOUNDARY;else if(f<-i.WORLD_BOUNDARY)f=-i.WORLD_BOUNDARY;var E=new c(g,f),T=n.inverseTransformPoint(E);this.setLocation(T.x,T.y)},o.prototype.getLeft=function(){return this.rect.x},o.prototype.getRight=function(){return this.rect.x+this.rect.width},o.prototype.getTop=function(){return this.rect.y},o.prototype.getBottom=function(){return this.rect.y+this.rect.height},o.prototype.getParent=function(){if(this.owner==null)return null;return this.owner.getParent()},m.exports=o},function(m,w,L){function s(r,e){if(r==null&&e==null)this.x=0,this.y=0;else this.x=r,this.y=e}s.prototype.getX=function(){return this.x},s.prototype.getY=function(){return this.y},s.prototype.setX=function(r){this.x=r},s.prototype.setY=function(r){this.y=r},s.prototype.getDifference=function(r){return new DimensionD(this.x-r.x,this.y-r.y)},s.prototype.getCopy=function(){return new s(this.x,this.y)},s.prototype.translate=function(r){return this.x+=r.width,this.y+=r.height,this},m.exports=s},function(m,w,L){var s=L(2),r=L(10),e=L(0),i=L(6),u=L(3),c=L(1),o=L(13),y=L(12),n=L(11);function g(E,T,N){if(s.call(this,N),this.estimatedSize=r.MIN_VALUE,this.margin=e.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=E,T!=null&&T instanceof i)this.graphManager=T;else if(T!=null&&T instanceof Layout)this.graphManager=T.graphManager}g.prototype=Object.create(s.prototype);for(var f in s)g[f]=s[f];g.prototype.getNodes=function(){return this.nodes},g.prototype.getEdges=function(){return this.edges},g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getParent=function(){return this.parent},g.prototype.getLeft=function(){return this.left},g.prototype.getRight=function(){return this.right},g.prototype.getTop=function(){return this.top},g.prototype.getBottom=function(){return this.bottom},g.prototype.isConnected=function(){return this.isConnected},g.prototype.add=function(E,T,N){if(T==null&&N==null){var v=E;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(v)>-1)throw"Node already in graph!";return v.owner=this,this.getNodes().push(v),v}else{var O=E;if(!(this.getNodes().indexOf(T)>-1&&this.getNodes().indexOf(N)>-1))throw"Source or target not in graph!";if(!(T.owner==N.owner&&T.owner==this))throw"Both owners must be this graph!";if(T.owner!=N.owner)return null;if(O.source=T,O.target=N,O.isInterGraph=!1,this.getEdges().push(O),T.edges.push(O),N!=T)N.edges.push(O);return O}},g.prototype.remove=function(E){var T=E;if(E instanceof u){if(T==null)throw"Node is null!";if(!(T.owner!=null&&T.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";var N=T.edges.slice(),v,O=N.length;for(var D=0;D<O;D++)if(v=N[D],v.isInterGraph)this.graphManager.remove(v);else v.source.owner.remove(v);var R=this.nodes.indexOf(T);if(R==-1)throw"Node not in owner node list!";this.nodes.splice(R,1)}else if(E instanceof c){var v=E;if(v==null)throw"Edge is null!";if(!(v.source!=null&&v.target!=null))throw"Source and/or target is null!";if(!(v.source.owner!=null&&v.target.owner!=null&&v.source.owner==this&&v.target.owner==this))throw"Source and/or target owner is invalid!";var a=v.source.edges.indexOf(v),p=v.target.edges.indexOf(v);if(!(a>-1&&p>-1))throw"Source and/or target doesn't know this edge!";if(v.source.edges.splice(a,1),v.target!=v.source)v.target.edges.splice(p,1);var R=v.source.owner.getEdges().indexOf(v);if(R==-1)throw"Not in owner's edge list!";v.source.owner.getEdges().splice(R,1)}},g.prototype.updateLeftTop=function(){var{MAX_VALUE:E,MAX_VALUE:T}=r,N,v,O,D=this.getNodes(),R=D.length;for(var a=0;a<R;a++){var p=D[a];if(N=p.getTop(),v=p.getLeft(),E>N)E=N;if(T>v)T=v}if(E==r.MAX_VALUE)return null;if(D[0].getParent().paddingLeft!=null)O=D[0].getParent().paddingLeft;else O=this.margin;return this.left=T-O,this.top=E-O,new y(this.left,this.top)},g.prototype.updateBounds=function(E){var T=r.MAX_VALUE,N=-r.MAX_VALUE,v=r.MAX_VALUE,O=-r.MAX_VALUE,D,R,a,p,d,A=this.nodes,I=A.length;for(var C=0;C<I;C++){var M=A[C];if(E&&M.child!=null)M.updateBounds();if(D=M.getLeft(),R=M.getRight(),a=M.getTop(),p=M.getBottom(),T>D)T=D;if(N<R)N=R;if(v>a)v=a;if(O<p)O=p}var G=new o(T,v,N-T,O-v);if(T==r.MAX_VALUE)this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom();if(A[0].getParent().paddingLeft!=null)d=A[0].getParent().paddingLeft;else d=this.margin;this.left=G.x-d,this.right=G.x+G.width+d,this.top=G.y-d,this.bottom=G.y+G.height+d},g.calculateBounds=function(E){var T=r.MAX_VALUE,N=-r.MAX_VALUE,v=r.MAX_VALUE,O=-r.MAX_VALUE,D,R,a,p,d=E.length;for(var A=0;A<d;A++){var I=E[A];if(D=I.getLeft(),R=I.getRight(),a=I.getTop(),p=I.getBottom(),T>D)T=D;if(N<R)N=R;if(v>a)v=a;if(O<p)O=p}var C=new o(T,v,N-T,O-v);return C},g.prototype.getInclusionTreeDepth=function(){if(this==this.graphManager.getRoot())return 1;else return this.parent.getInclusionTreeDepth()},g.prototype.getEstimatedSize=function(){if(this.estimatedSize==r.MIN_VALUE)throw"assert failed";return this.estimatedSize},g.prototype.calcEstimatedSize=function(){var E=0,T=this.nodes,N=T.length;for(var v=0;v<N;v++){var O=T[v];E+=O.calcEstimatedSize()}if(E==0)this.estimatedSize=e.EMPTY_COMPOUND_NODE_SIZE;else this.estimatedSize=E/Math.sqrt(this.nodes.length);return this.estimatedSize},g.prototype.updateConnected=function(){var E=this;if(this.nodes.length==0){this.isConnected=!0;return}var T=new n,N=new Set,v=this.nodes[0],O,D,R=v.withChildren();R.forEach(function(C){T.push(C),N.add(C)});while(T.length!==0){v=T.shift(),O=v.getEdges();var a=O.length;for(var p=0;p<a;p++){var d=O[p];if(D=d.getOtherEndInGraph(v,this),D!=null&&!N.has(D)){var A=D.withChildren();A.forEach(function(C){T.push(C),N.add(C)})}}}if(this.isConnected=!1,N.size>=this.nodes.length){var I=0;if(N.forEach(function(C){if(C.owner==E)I++}),I==this.nodes.length)this.isConnected=!0}},m.exports=g},function(m,w,L){var s,r=L(1);function e(i){s=L(5),this.layout=i,this.graphs=[],this.edges=[]}e.prototype.addRoot=function(){var i=this.layout.newGraph(),u=this.layout.newNode(null),c=this.add(i,u);return this.setRootGraph(c),this.rootGraph},e.prototype.add=function(i,u,c,o,y){if(c==null&&o==null&&y==null){if(i==null)throw"Graph is null!";if(u==null)throw"Parent node is null!";if(this.graphs.indexOf(i)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(i),i.parent!=null)throw"Already has a parent!";if(u.child!=null)throw"Already has a child!";return i.parent=u,u.child=i,i}else{y=c,o=u,c=i;var n=o.getOwner(),g=y.getOwner();if(!(n!=null&&n.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(g!=null&&g.getGraphManager()==this))throw"Target not in this graph mgr!";if(n==g)return c.isInterGraph=!1,n.add(c,o,y);else{if(c.isInterGraph=!0,c.source=o,c.target=y,this.edges.indexOf(c)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(c),!(c.source!=null&&c.target!=null))throw"Edge source and/or target is null!";if(!(c.source.edges.indexOf(c)==-1&&c.target.edges.indexOf(c)==-1))throw"Edge already in source and/or target incidency list!";return c.source.edges.push(c),c.target.edges.push(c),c}}},e.prototype.remove=function(i){if(i instanceof s){var u=i;if(u.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(u==this.rootGraph||u.parent!=null&&u.parent.graphManager==this))throw"Invalid parent node!";var c=[];c=c.concat(u.getEdges());var o,y=c.length;for(var n=0;n<y;n++)o=c[n],u.remove(o);var g=[];g=g.concat(u.getNodes());var f;y=g.length;for(var n=0;n<y;n++)f=g[n],u.remove(f);if(u==this.rootGraph)this.setRootGraph(null);var E=this.graphs.indexOf(u);this.graphs.splice(E,1),u.parent=null}else if(i instanceof r){if(o=i,o==null)throw"Edge is null!";if(!o.isInterGraph)throw"Not an inter-graph edge!";if(!(o.source!=null&&o.target!=null))throw"Source and/or target is null!";if(!(o.source.edges.indexOf(o)!=-1&&o.target.edges.indexOf(o)!=-1))throw"Source and/or target doesn't know this edge!";var E=o.source.edges.indexOf(o);if(o.source.edges.splice(E,1),E=o.target.edges.indexOf(o),o.target.edges.splice(E,1),!(o.source.owner!=null&&o.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(o.source.owner.getGraphManager().edges.indexOf(o)==-1)throw"Not in owner graph manager's edge list!";var E=o.source.owner.getGraphManager().edges.indexOf(o);o.source.owner.getGraphManager().edges.splice(E,1)}},e.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},e.prototype.getGraphs=function(){return this.graphs},e.prototype.getAllNodes=function(){if(this.allNodes==null){var i=[],u=this.getGraphs(),c=u.length;for(var o=0;o<c;o++)i=i.concat(u[o].getNodes());this.allNodes=i}return this.allNodes},e.prototype.resetAllNodes=function(){this.allNodes=null},e.prototype.resetAllEdges=function(){this.allEdges=null},e.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},e.prototype.getAllEdges=function(){if(this.allEdges==null){var i=[],u=this.getGraphs(),c=u.length;for(var o=0;o<u.length;o++)i=i.concat(u[o].getEdges());i=i.concat(this.edges),this.allEdges=i}return this.allEdges},e.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},e.prototype.setAllNodesToApplyGravitation=function(i){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=i},e.prototype.getRoot=function(){return this.rootGraph},e.prototype.setRootGraph=function(i){if(i.getGraphManager()!=this)throw"Root not in this graph mgr!";if(this.rootGraph=i,i.parent==null)i.parent=this.layout.newNode("Root node")},e.prototype.getLayout=function(){return this.layout},e.prototype.isOneAncestorOfOther=function(i,u){if(!(i!=null&&u!=null))throw"assert failed";if(i==u)return!0;var c=i.getOwner(),o;do{if(o=c.getParent(),o==null)break;if(o==u)return!0;if(c=o.getOwner(),c==null)break}while(!0);c=u.getOwner();do{if(o=c.getParent(),o==null)break;if(o==i)return!0;if(c=o.getOwner(),c==null)break}while(!0);return!1},e.prototype.calcLowestCommonAncestors=function(){var i,u,c,o,y,n=this.getAllEdges(),g=n.length;for(var f=0;f<g;f++){if(i=n[f],u=i.source,c=i.target,i.lca=null,i.sourceInLca=u,i.targetInLca=c,u==c){i.lca=u.getOwner();continue}o=u.getOwner();while(i.lca==null){i.targetInLca=c,y=c.getOwner();while(i.lca==null){if(y==o){i.lca=y;break}if(y==this.rootGraph)break;if(i.lca!=null)throw"assert failed";i.targetInLca=y.getParent(),y=i.targetInLca.getOwner()}if(o==this.rootGraph)break;if(i.lca==null)i.sourceInLca=o.getParent(),o=i.sourceInLca.getOwner()}if(i.lca==null)throw"assert failed"}},e.prototype.calcLowestCommonAncestor=function(i,u){if(i==u)return i.getOwner();var c=i.getOwner();do{if(c==null)break;var o=u.getOwner();do{if(o==null)break;if(o==c)return o;o=o.getParent().getOwner()}while(!0);c=c.getParent().getOwner()}while(!0);return c},e.prototype.calcInclusionTreeDepths=function(i,u){if(i==null&&u==null)i=this.rootGraph,u=1;var c,o=i.getNodes(),y=o.length;for(var n=0;n<y;n++)if(c=o[n],c.inclusionTreeDepth=u,c.child!=null)this.calcInclusionTreeDepths(c.child,u+1)},e.prototype.includesInvalidEdge=function(){var i,u=this.edges.length;for(var c=0;c<u;c++)if(i=this.edges[c],this.isOneAncestorOfOther(i.source,i.target))return!0;return!1},m.exports=e},function(m,w,L){var s=L(0);function r(){}for(var e in s)r[e]=s[e];r.MAX_ITERATIONS=2500,r.DEFAULT_EDGE_LENGTH=50,r.DEFAULT_SPRING_STRENGTH=0.45,r.DEFAULT_REPULSION_STRENGTH=4500,r.DEFAULT_GRAVITY_STRENGTH=0.4,r.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,r.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,r.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,r.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,r.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,r.DEFAULT_COOLING_FACTOR_INCREMENTAL=0.3,r.COOLING_ADAPTATION_FACTOR=0.33,r.ADAPTATION_LOWER_NODE_LIMIT=1000,r.ADAPTATION_UPPER_NODE_LIMIT=5000,r.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,r.MAX_NODE_DISPLACEMENT=r.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,r.MIN_REPULSION_DIST=r.DEFAULT_EDGE_LENGTH/10,r.CONVERGENCE_CHECK_PERIOD=100,r.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=0.1,r.MIN_EDGE_LENGTH=1,r.GRID_CALCULATION_CHECK_PERIOD=10,m.exports=r},function(m,w,L){var s=L(12);function r(){}r.calcSeparationAmount=function(e,i,u,c){if(!e.intersects(i))throw"assert failed";var o=[,,];if(this.decideDirectionsForOverlappingNodes(e,i,o),u[0]=Math.min(e.getRight(),i.getRight())-Math.max(e.x,i.x),u[1]=Math.min(e.getBottom(),i.getBottom())-Math.max(e.y,i.y),e.getX()<=i.getX()&&e.getRight()>=i.getRight())u[0]+=Math.min(i.getX()-e.getX(),e.getRight()-i.getRight());else if(i.getX()<=e.getX()&&i.getRight()>=e.getRight())u[0]+=Math.min(e.getX()-i.getX(),i.getRight()-e.getRight());if(e.getY()<=i.getY()&&e.getBottom()>=i.getBottom())u[1]+=Math.min(i.getY()-e.getY(),e.getBottom()-i.getBottom());else if(i.getY()<=e.getY()&&i.getBottom()>=e.getBottom())u[1]+=Math.min(e.getY()-i.getY(),i.getBottom()-e.getBottom());var y=Math.abs((i.getCenterY()-e.getCenterY())/(i.getCenterX()-e.getCenterX()));if(i.getCenterY()===e.getCenterY()&&i.getCenterX()===e.getCenterX())y=1;var n=y*u[0],g=u[1]/y;if(u[0]<g)g=u[0];else n=u[1];u[0]=-1*o[0]*(g/2+c),u[1]=-1*o[1]*(n/2+c)},r.decideDirectionsForOverlappingNodes=function(e,i,u){if(e.getCenterX()<i.getCenterX())u[0]=-1;else u[0]=1;if(e.getCenterY()<i.getCenterY())u[1]=-1;else u[1]=1},r.getIntersection2=function(e,i,u){var c=e.getCenterX(),o=e.getCenterY(),y=i.getCenterX(),n=i.getCenterY();if(e.intersects(i))return u[0]=c,u[1]=o,u[2]=y,u[3]=n,!0;var g=e.getX(),f=e.getY(),E=e.getRight(),T=e.getX(),N=e.getBottom(),v=e.getRight(),O=e.getWidthHalf(),D=e.getHeightHalf(),R=i.getX(),a=i.getY(),p=i.getRight(),d=i.getX(),A=i.getBottom(),I=i.getRight(),C=i.getWidthHalf(),M=i.getHeightHalf(),G=!1,F=!1;if(c===y){if(o>n)return u[0]=c,u[1]=f,u[2]=y,u[3]=A,!1;else if(o<n)return u[0]=c,u[1]=N,u[2]=y,u[3]=a,!1}else if(o===n){if(c>y)return u[0]=g,u[1]=o,u[2]=p,u[3]=n,!1;else if(c<y)return u[0]=E,u[1]=o,u[2]=R,u[3]=n,!1}else{var P=e.height/e.width,b=i.height/i.width,U=(n-o)/(y-c),x=void 0,S=void 0,Y=void 0,X=void 0,H=void 0,_=void 0;if(-P===U)if(c>y)u[0]=T,u[1]=N,G=!0;else u[0]=E,u[1]=f,G=!0;else if(P===U)if(c>y)u[0]=g,u[1]=f,G=!0;else u[0]=v,u[1]=N,G=!0;if(-b===U)if(y>c)u[2]=d,u[3]=A,F=!0;else u[2]=p,u[3]=a,F=!0;else if(b===U)if(y>c)u[2]=R,u[3]=a,F=!0;else u[2]=I,u[3]=A,F=!0;if(G&&F)return!1;if(c>y)if(o>n)x=this.getCardinalDirection(P,U,4),S=this.getCardinalDirection(b,U,2);else x=this.getCardinalDirection(-P,U,3),S=this.getCardinalDirection(-b,U,1);else if(o>n)x=this.getCardinalDirection(-P,U,1),S=this.getCardinalDirection(-b,U,3);else x=this.getCardinalDirection(P,U,2),S=this.getCardinalDirection(b,U,4);if(!G)switch(x){case 1:X=f,Y=c+-D/U,u[0]=Y,u[1]=X;break;case 2:Y=v,X=o+O*U,u[0]=Y,u[1]=X;break;case 3:X=N,Y=c+D/U,u[0]=Y,u[1]=X;break;case 4:Y=T,X=o+-O*U,u[0]=Y,u[1]=X;break}if(!F)switch(S){case 1:_=a,H=y+-M/U,u[2]=H,u[3]=_;break;case 2:H=I,_=n+C*U,u[2]=H,u[3]=_;break;case 3:_=A,H=y+M/U,u[2]=H,u[3]=_;break;case 4:H=d,_=n+-C*U,u[2]=H,u[3]=_;break}}return!1},r.getCardinalDirection=function(e,i,u){if(e>i)return u;else return 1+u%4},r.getIntersection=function(e,i,u,c){if(c==null)return this.getIntersection2(e,i,u);var{x:o,y}=e,{x:n,y:g}=i,{x:f,y:E}=u,{x:T,y:N}=c,v=void 0,O=void 0,D=void 0,R=void 0,a=void 0,p=void 0,d=void 0,A=void 0,I=void 0;if(D=g-y,a=o-n,d=n*y-o*g,R=N-E,p=f-T,A=T*E-f*N,I=D*p-R*a,I===0)return null;return v=(a*A-p*d)/I,O=(R*d-D*A)/I,new s(v,O)},r.angleOfVector=function(e,i,u,c){var o=void 0;if(e!==u){if(o=Math.atan((c-i)/(u-e)),u<e)o+=Math.PI;else if(c<i)o+=this.TWO_PI}else if(c<i)o=this.ONE_AND_HALF_PI;else o=this.HALF_PI;return o},r.doIntersect=function(e,i,u,c){var{x:o,y}=e,{x:n,y:g}=i,{x:f,y:E}=u,{x:T,y:N}=c,v=(n-o)*(N-E)-(T-f)*(g-y);if(v===0)return!1;else{var O=((N-E)*(T-o)+(f-T)*(N-y))/v,D=((y-g)*(T-o)+(n-o)*(N-y))/v;return 0<O&&O<1&&0<D&&D<1}},r.HALF_PI=0.5*Math.PI,r.ONE_AND_HALF_PI=1.5*Math.PI,r.TWO_PI=2*Math.PI,r.THREE_PI=3*Math.PI,m.exports=r},function(m,w,L){function s(){}s.sign=function(r){if(r>0)return 1;else if(r<0)return-1;else return 0},s.floor=function(r){return r<0?Math.ceil(r):Math.floor(r)},s.ceil=function(r){return r<0?Math.floor(r):Math.ceil(r)},m.exports=s},function(m,w,L){function s(){}s.MAX_VALUE=2147483647,s.MIN_VALUE=-2147483648,m.exports=s},function(m,w,L){var s=function(){function o(y,n){for(var g=0;g<n.length;g++){var f=n[g];if(f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f)f.writable=!0;Object.defineProperty(y,f.key,f)}}return function(y,n,g){if(n)o(y.prototype,n);if(g)o(y,g);return y}}();function r(o,y){if(!(o instanceof y))throw TypeError("Cannot call a class as a function")}var e=function(y){return{value:y,next:null,prev:null}},i=function(y,n,g,f){if(y!==null)y.next=n;else f.head=n;if(g!==null)g.prev=n;else f.tail=n;return n.prev=y,n.next=g,f.length++,n},u=function(y,n){var{prev:g,next:f}=y;if(g!==null)g.next=f;else n.head=f;if(f!==null)f.prev=g;else n.tail=g;return y.prev=y.next=null,n.length--,y},c=function(){function o(y){var n=this;if(r(this,o),this.length=0,this.head=null,this.tail=null,y!=null)y.forEach(function(g){return n.push(g)})}return s(o,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(n,g){return i(g.prev,e(n),g,this)}},{key:"insertAfter",value:function(n,g){return i(g,e(n),g.next,this)}},{key:"insertNodeBefore",value:function(n,g){return i(g.prev,n,g,this)}},{key:"insertNodeAfter",value:function(n,g){return i(g,n,g.next,this)}},{key:"push",value:function(n){return i(this.tail,e(n),null,this)}},{key:"unshift",value:function(n){return i(null,e(n),this.head,this)}},{key:"remove",value:function(n){return u(n,this)}},{key:"pop",value:function(){return u(this.tail,this).value}},{key:"popNode",value:function(){return u(this.tail,this)}},{key:"shift",value:function(){return u(this.head,this).value}},{key:"shiftNode",value:function(){return u(this.head,this)}},{key:"get_object_at",value:function(n){if(n<=this.length()){var g=1,f=this.head;while(g<n)f=f.next,g++;return f.value}}},{key:"set_object_at",value:function(n,g){if(n<=this.length()){var f=1,E=this.head;while(f<n)E=E.next,f++;E.value=g}}}]),o}();m.exports=c},function(m,w,L){function s(r,e,i){if(this.x=null,this.y=null,r==null&&e==null&&i==null)this.x=0,this.y=0;else if(typeof r=="number"&&typeof e=="number"&&i==null)this.x=r,this.y=e;else if(r.constructor.name=="Point"&&e==null&&i==null)i=r,this.x=i.x,this.y=i.y}s.prototype.getX=function(){return this.x},s.prototype.getY=function(){return this.y},s.prototype.getLocation=function(){return new s(this.x,this.y)},s.prototype.setLocation=function(r,e,i){if(r.constructor.name=="Point"&&e==null&&i==null)i=r,this.setLocation(i.x,i.y);else if(typeof r=="number"&&typeof e=="number"&&i==null)if(parseInt(r)==r&&parseInt(e)==e)this.move(r,e);else this.x=Math.floor(r+0.5),this.y=Math.floor(e+0.5)},s.prototype.move=function(r,e){this.x=r,this.y=e},s.prototype.translate=function(r,e){this.x+=r,this.y+=e},s.prototype.equals=function(r){if(r.constructor.name=="Point"){var e=r;return this.x==e.x&&this.y==e.y}return this==r},s.prototype.toString=function(){return new s().constructor.name+"[x="+this.x+",y="+this.y+"]"},m.exports=s},function(m,w,L){function s(r,e,i,u){if(this.x=0,this.y=0,this.width=0,this.height=0,r!=null&&e!=null&&i!=null&&u!=null)this.x=r,this.y=e,this.width=i,this.height=u}s.prototype.getX=function(){return this.x},s.prototype.setX=function(r){this.x=r},s.prototype.getY=function(){return this.y},s.prototype.setY=function(r){this.y=r},s.prototype.getWidth=function(){return this.width},s.prototype.setWidth=function(r){this.width=r},s.prototype.getHeight=function(){return this.height},s.prototype.setHeight=function(r){this.height=r},s.prototype.getRight=function(){return this.x+this.width},s.prototype.getBottom=function(){return this.y+this.height},s.prototype.intersects=function(r){if(this.getRight()<r.x)return!1;if(this.getBottom()<r.y)return!1;if(r.getRight()<this.x)return!1;if(r.getBottom()<this.y)return!1;return!0},s.prototype.getCenterX=function(){return this.x+this.width/2},s.prototype.getMinX=function(){return this.getX()},s.prototype.getMaxX=function(){return this.getX()+this.width},s.prototype.getCenterY=function(){return this.y+this.height/2},s.prototype.getMinY=function(){return this.getY()},s.prototype.getMaxY=function(){return this.getY()+this.height},s.prototype.getWidthHalf=function(){return this.width/2},s.prototype.getHeightHalf=function(){return this.height/2},m.exports=s},function(m,w,L){var s=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function r(){}r.lastID=0,r.createID=function(e){if(r.isPrimitive(e))return e;if(e.uniqueID!=null)return e.uniqueID;return e.uniqueID=r.getString(),r.lastID++,e.uniqueID},r.getString=function(e){if(e==null)e=r.lastID;return"Object#"+e},r.isPrimitive=function(e){var i=typeof e>"u"?"undefined":s(e);return e==null||i!="object"&&i!="function"},m.exports=r},function(m,w,L){function s(f){if(Array.isArray(f)){for(var E=0,T=Array(f.length);E<f.length;E++)T[E]=f[E];return T}else return Array.from(f)}var r=L(0),e=L(6),i=L(3),u=L(1),c=L(5),o=L(4),y=L(17),n=L(27);function g(f){if(n.call(this),this.layoutQuality=r.QUALITY,this.createBendsAsNeeded=r.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=r.DEFAULT_INCREMENTAL,this.animationOnLayout=r.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=r.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=r.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=r.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new e(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,f!=null)this.isRemoteUse=f}g.RANDOM_SEED=1,g.prototype=Object.create(n.prototype),g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},g.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},g.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},g.prototype.newGraphManager=function(){var f=new e(this);return this.graphManager=f,f},g.prototype.newGraph=function(f){return new c(null,this.graphManager,f)},g.prototype.newNode=function(f){return new i(this.graphManager,f)},g.prototype.newEdge=function(f){return new u(null,null,f)},g.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},g.prototype.runLayout=function(){if(this.isLayoutFinished=!1,this.tilingPreLayout)this.tilingPreLayout();this.initParameters();var f;if(this.checkLayoutSuccess())f=!1;else f=this.layout();if(r.ANIMATE==="during")return!1;if(f){if(!this.isSubLayout)this.doPostLayout()}if(this.tilingPostLayout)this.tilingPostLayout();return this.isLayoutFinished=!0,f},g.prototype.doPostLayout=function(){if(!this.incremental)this.transform();this.update()},g.prototype.update2=function(){if(this.createBendsAsNeeded)this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges();if(!this.isRemoteUse){var f,E=this.graphManager.getAllEdges();for(var T=0;T<E.length;T++)f=E[T];var N,v=this.graphManager.getRoot().getNodes();for(var T=0;T<v.length;T++)N=v[T];this.update(this.graphManager.getRoot())}},g.prototype.update=function(f){if(f==null)this.update2();else if(f instanceof i){var E=f;if(E.getChild()!=null){var T=E.getChild().getNodes();for(var N=0;N<T.length;N++)update(T[N])}if(E.vGraphObject!=null){var v=E.vGraphObject;v.update(E)}}else if(f instanceof u){var O=f;if(O.vGraphObject!=null){var D=O.vGraphObject;D.update(O)}}else if(f instanceof c){var R=f;if(R.vGraphObject!=null){var a=R.vGraphObject;a.update(R)}}},g.prototype.initParameters=function(){if(!this.isSubLayout)this.layoutQuality=r.QUALITY,this.animationDuringLayout=r.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=r.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=r.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=r.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=r.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=r.DEFAULT_UNIFORM_LEAF_NODE_SIZES;if(this.animationDuringLayout)this.animationOnLayout=!1},g.prototype.transform=function(f){if(f==null)this.transform(new o(0,0));else{var E=new y,T=this.graphManager.getRoot().updateLeftTop();if(T!=null){E.setWorldOrgX(f.x),E.setWorldOrgY(f.y),E.setDeviceOrgX(T.x),E.setDeviceOrgY(T.y);var N=this.getAllNodes(),v;for(var O=0;O<N.length;O++)v=N[O],v.transform(E)}}},g.prototype.positionNodesRandomly=function(f){if(f==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else{var E,T,N=f.getNodes();for(var v=0;v<N.length;v++)if(E=N[v],T=E.getChild(),T==null)E.scatter();else if(T.getNodes().length==0)E.scatter();else this.positionNodesRandomly(T),E.updateBounds()}},g.prototype.getFlatForest=function(){var f=[],E=!0,T=this.graphManager.getRoot().getNodes(),N=!0;for(var v=0;v<T.length;v++)if(T[v].getChild()!=null)N=!1;if(!N)return f;var O=new Set,D=[],R=new Map,a=[];a=a.concat(T);while(a.length>0&&E){D.push(a[0]);while(D.length>0&&E){var p=D[0];D.splice(0,1),O.add(p);var d=p.getEdges();for(var v=0;v<d.length;v++){var A=d[v].getOtherEnd(p);if(R.get(p)!=A)if(!O.has(A))D.push(A),R.set(A,p);else{E=!1;break}}}if(!E)f=[];else{var I=[].concat(s(O));f.push(I);for(var v=0;v<I.length;v++){var C=I[v],M=a.indexOf(C);if(M>-1)a.splice(M,1)}O=new Set,R=new Map}}return f},g.prototype.createDummyNodesForBendpoints=function(f){var E=[],T=f.source,N=this.graphManager.calcLowestCommonAncestor(f.source,f.target);for(var v=0;v<f.bendpoints.length;v++){var O=this.newNode(null);O.setRect(new Point(0,0),new Dimension(1,1)),N.add(O);var D=this.newEdge(null);this.graphManager.add(D,T,O),E.add(O),T=O}var D=this.newEdge(null);if(this.graphManager.add(D,T,f.target),this.edgeToDummyNodes.set(f,E),f.isInterGraph())this.graphManager.remove(f);else N.remove(f);return E},g.prototype.createBendpointsFromDummyNodes=function(){var f=[];f=f.concat(this.graphManager.getAllEdges()),f=[].concat(s(this.edgeToDummyNodes.keys())).concat(f);for(var E=0;E<f.length;E++){var T=f[E];if(T.bendpoints.length>0){var N=this.edgeToDummyNodes.get(T);for(var v=0;v<N.length;v++){var O=N[v],D=new o(O.getCenterX(),O.getCenterY()),R=T.bendpoints.get(v);R.x=D.x,R.y=D.y,O.getOwner().remove(O)}this.graphManager.add(T,T.source,T.target)}}},g.transform=function(f,E,T,N){if(T!=null&&N!=null){var v=E;if(f<=50){var O=E/T;v-=(E-O)/50*(50-f)}else{var D=E*N;v+=(D-E)/50*(f-50)}return v}else{var R,a;if(f<=50)R=9*E/500,a=E/10;else R=9*E/50,a=-8*E;return R*f+a}},g.findCenterOfTree=function(f){var E=[];E=E.concat(f);var T=[],N=new Map,v=!1,O=null;if(E.length==1||E.length==2)v=!0,O=E[0];for(var D=0;D<E.length;D++){var R=E[D],a=R.getNeighborsList().size;if(N.set(R,R.getNeighborsList().size),a==1)T.push(R)}var p=[];p=p.concat(T);while(!v){var d=[];d=d.concat(p),p=[];for(var D=0;D<E.length;D++){var R=E[D],A=E.indexOf(R);if(A>=0)E.splice(A,1);var I=R.getNeighborsList();I.forEach(function(G){if(T.indexOf(G)<0){var F=N.get(G),P=F-1;if(P==1)p.push(G);N.set(G,P)}})}if(T=T.concat(p),E.length==1||E.length==2)v=!0,O=E[0]}return O},g.prototype.setGraphManager=function(f){this.graphManager=f},m.exports=g},function(m,w,L){function s(){}s.seed=1,s.x=0,s.nextDouble=function(){return s.x=Math.sin(s.seed++)*1e4,s.x-Math.floor(s.x)},m.exports=s},function(m,w,L){var s=L(4);function r(e,i){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}r.prototype.getWorldOrgX=function(){return this.lworldOrgX},r.prototype.setWorldOrgX=function(e){this.lworldOrgX=e},r.prototype.getWorldOrgY=function(){return this.lworldOrgY},r.prototype.setWorldOrgY=function(e){this.lworldOrgY=e},r.prototype.getWorldExtX=function(){return this.lworldExtX},r.prototype.setWorldExtX=function(e){this.lworldExtX=e},r.prototype.getWorldExtY=function(){return this.lworldExtY},r.prototype.setWorldExtY=function(e){this.lworldExtY=e},r.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},r.prototype.setDeviceOrgX=function(e){this.ldeviceOrgX=e},r.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},r.prototype.setDeviceOrgY=function(e){this.ldeviceOrgY=e},r.prototype.getDeviceExtX=function(){return this.ldeviceExtX},r.prototype.setDeviceExtX=function(e){this.ldeviceExtX=e},r.prototype.getDeviceExtY=function(){return this.ldeviceExtY},r.prototype.setDeviceExtY=function(e){this.ldeviceExtY=e},r.prototype.transformX=function(e){var i=0,u=this.lworldExtX;if(u!=0)i=this.ldeviceOrgX+(e-this.lworldOrgX)*this.ldeviceExtX/u;return i},r.prototype.transformY=function(e){var i=0,u=this.lworldExtY;if(u!=0)i=this.ldeviceOrgY+(e-this.lworldOrgY)*this.ldeviceExtY/u;return i},r.prototype.inverseTransformX=function(e){var i=0,u=this.ldeviceExtX;if(u!=0)i=this.lworldOrgX+(e-this.ldeviceOrgX)*this.lworldExtX/u;return i},r.prototype.inverseTransformY=function(e){var i=0,u=this.ldeviceExtY;if(u!=0)i=this.lworldOrgY+(e-this.ldeviceOrgY)*this.lworldExtY/u;return i},r.prototype.inverseTransformPoint=function(e){var i=new s(this.inverseTransformX(e.x),this.inverseTransformY(e.y));return i},m.exports=r},function(m,w,L){function s(n){if(Array.isArray(n)){for(var g=0,f=Array(n.length);g<n.length;g++)f[g]=n[g];return f}else return Array.from(n)}var r=L(15),e=L(7),i=L(0),u=L(8),c=L(9);function o(){r.call(this),this.useSmartIdealEdgeLengthCalculation=e.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.idealEdgeLength=e.DEFAULT_EDGE_LENGTH,this.springConstant=e.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=e.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=e.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=e.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=e.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=e.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*e.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=e.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=e.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=e.MAX_ITERATIONS}o.prototype=Object.create(r.prototype);for(var y in r)o[y]=r[y];o.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=e.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},o.prototype.calcIdealEdgeLengths=function(){var n,g,f,E,T,N,v=this.getGraphManager().getAllEdges();for(var O=0;O<v.length;O++)if(n=v[O],n.idealLength=this.idealEdgeLength,n.isInterGraph){if(f=n.getSource(),E=n.getTarget(),T=n.getSourceInLca().getEstimatedSize(),N=n.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation)n.idealLength+=T+N-2*i.SIMPLE_NODE_SIZE;g=n.getLca().getInclusionTreeDepth(),n.idealLength+=e.DEFAULT_EDGE_LENGTH*e.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(f.getInclusionTreeDepth()+E.getInclusionTreeDepth()-2*g)}},o.prototype.initSpringEmbedder=function(){var n=this.getAllNodes().length;if(this.incremental){if(n>e.ADAPTATION_LOWER_NODE_LIMIT)this.coolingFactor=Math.max(this.coolingFactor*e.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(n-e.ADAPTATION_LOWER_NODE_LIMIT)/(e.ADAPTATION_UPPER_NODE_LIMIT-e.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-e.COOLING_ADAPTATION_FACTOR));this.maxNodeDisplacement=e.MAX_NODE_DISPLACEMENT_INCREMENTAL}else{if(n>e.ADAPTATION_LOWER_NODE_LIMIT)this.coolingFactor=Math.max(e.COOLING_ADAPTATION_FACTOR,1-(n-e.ADAPTATION_LOWER_NODE_LIMIT)/(e.ADAPTATION_UPPER_NODE_LIMIT-e.ADAPTATION_LOWER_NODE_LIMIT)*(1-e.COOLING_ADAPTATION_FACTOR));else this.coolingFactor=1;this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=e.MAX_NODE_DISPLACEMENT}this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},o.prototype.calcSpringForces=function(){var n=this.getAllEdges(),g;for(var f=0;f<n.length;f++)g=n[f],this.calcSpringForce(g,g.idealLength)},o.prototype.calcRepulsionForces=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,f,E,T,N,v=this.getAllNodes(),O;if(this.useFRGridVariant){if(this.totalIterations%e.GRID_CALCULATION_CHECK_PERIOD==1&&n)this.updateGrid();O=new Set;for(f=0;f<v.length;f++)T=v[f],this.calculateRepulsionForceOfANode(T,O,n,g),O.add(T)}else for(f=0;f<v.length;f++){T=v[f];for(E=f+1;E<v.length;E++){if(N=v[E],T.getOwner()!=N.getOwner())continue;this.calcRepulsionForce(T,N)}}},o.prototype.calcGravitationalForces=function(){var n,g=this.getAllNodesToApplyGravitation();for(var f=0;f<g.length;f++)n=g[f],this.calcGravitationalForce(n)},o.prototype.moveNodes=function(){var n=this.getAllNodes(),g;for(var f=0;f<n.length;f++)g=n[f],g.move()},o.prototype.calcSpringForce=function(n,g){var f=n.getSource(),E=n.getTarget(),T,N,v,O;if(this.uniformLeafNodeSizes&&f.getChild()==null&&E.getChild()==null)n.updateLengthSimple();else if(n.updateLength(),n.isOverlapingSourceAndTarget)return;if(T=n.getLength(),T==0)return;N=this.springConstant*(T-g),v=N*(n.lengthX/T),O=N*(n.lengthY/T),f.springForceX+=v,f.springForceY+=O,E.springForceX-=v,E.springForceY-=O},o.prototype.calcRepulsionForce=function(n,g){var f=n.getRect(),E=g.getRect(),T=[,,],N=[,,,,],v,O,D,R,a,p,d;if(f.intersects(E)){u.calcSeparationAmount(f,E,T,e.DEFAULT_EDGE_LENGTH/2),p=2*T[0],d=2*T[1];var A=n.noOfChildren*g.noOfChildren/(n.noOfChildren+g.noOfChildren);n.repulsionForceX-=A*p,n.repulsionForceY-=A*d,g.repulsionForceX+=A*p,g.repulsionForceY+=A*d}else{if(this.uniformLeafNodeSizes&&n.getChild()==null&&g.getChild()==null)v=E.getCenterX()-f.getCenterX(),O=E.getCenterY()-f.getCenterY();else u.getIntersection(f,E,N),v=N[2]-N[0],O=N[3]-N[1];if(Math.abs(v)<e.MIN_REPULSION_DIST)v=c.sign(v)*e.MIN_REPULSION_DIST;if(Math.abs(O)<e.MIN_REPULSION_DIST)O=c.sign(O)*e.MIN_REPULSION_DIST;D=v*v+O*O,R=Math.sqrt(D),a=this.repulsionConstant*n.noOfChildren*g.noOfChildren/D,p=a*v/R,d=a*O/R,n.repulsionForceX-=p,n.repulsionForceY-=d,g.repulsionForceX+=p,g.repulsionForceY+=d}},o.prototype.calcGravitationalForce=function(n){var g,f,E,T,N,v,O,D;if(g=n.getOwner(),f=(g.getRight()+g.getLeft())/2,E=(g.getTop()+g.getBottom())/2,T=n.getCenterX()-f,N=n.getCenterY()-E,v=Math.abs(T)+n.getWidth()/2,O=Math.abs(N)+n.getHeight()/2,n.getOwner()==this.graphManager.getRoot()){if(D=g.getEstimatedSize()*this.gravityRangeFactor,v>D||O>D)n.gravitationForceX=-this.gravityConstant*T,n.gravitationForceY=-this.gravityConstant*N}else if(D=g.getEstimatedSize()*this.compoundGravityRangeFactor,v>D||O>D)n.gravitationForceX=-this.gravityConstant*T*this.compoundGravityConstant,n.gravitationForceY=-this.gravityConstant*N*this.compoundGravityConstant},o.prototype.isConverged=function(){var n,g=!1;if(this.totalIterations>this.maxIterations/3)g=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2;return n=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,n||g},o.prototype.animate=function(){if(this.animationDuringLayout&&!this.isSubLayout)if(this.notAnimatedIterations==this.animationPeriod)this.update(),this.notAnimatedIterations=0;else this.notAnimatedIterations++},o.prototype.calcNoOfChildrenForAllNodes=function(){var n,g=this.graphManager.getAllNodes();for(var f=0;f<g.length;f++)n=g[f],n.noOfChildren=n.getNoOfChildren()},o.prototype.calcGrid=function(n){var g=0,f=0;g=parseInt(Math.ceil((n.getRight()-n.getLeft())/this.repulsionRange)),f=parseInt(Math.ceil((n.getBottom()-n.getTop())/this.repulsionRange));var E=Array(g);for(var T=0;T<g;T++)E[T]=Array(f);for(var T=0;T<g;T++)for(var N=0;N<f;N++)E[T][N]=[];return E},o.prototype.addNodeToGrid=function(n,g,f){var E=0,T=0,N=0,v=0;E=parseInt(Math.floor((n.getRect().x-g)/this.repulsionRange)),T=parseInt(Math.floor((n.getRect().width+n.getRect().x-g)/this.repulsionRange)),N=parseInt(Math.floor((n.getRect().y-f)/this.repulsionRange)),v=parseInt(Math.floor((n.getRect().height+n.getRect().y-f)/this.repulsionRange));for(var O=E;O<=T;O++)for(var D=N;D<=v;D++)this.grid[O][D].push(n),n.setGridCoordinates(E,T,N,v)},o.prototype.updateGrid=function(){var n,g,f=this.getAllNodes();this.grid=this.calcGrid(this.graphManager.getRoot());for(n=0;n<f.length;n++)g=f[n],this.addNodeToGrid(g,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},o.prototype.calculateRepulsionForceOfANode=function(n,g,f,E){if(this.totalIterations%e.GRID_CALCULATION_CHECK_PERIOD==1&&f||E){var T=new Set;n.surrounding=[];var N,v=this.grid;for(var O=n.startX-1;O<n.finishX+2;O++)for(var D=n.startY-1;D<n.finishY+2;D++)if(!(O<0||D<0||O>=v.length||D>=v[0].length))for(var R=0;R<v[O][D].length;R++){if(N=v[O][D][R],n.getOwner()!=N.getOwner()||n==N)continue;if(!g.has(N)&&!T.has(N)){var a=Math.abs(n.getCenterX()-N.getCenterX())-(n.getWidth()/2+N.getWidth()/2),p=Math.abs(n.getCenterY()-N.getCenterY())-(n.getHeight()/2+N.getHeight()/2);if(a<=this.repulsionRange&&p<=this.repulsionRange)T.add(N)}}n.surrounding=[].concat(s(T))}for(O=0;O<n.surrounding.length;O++)this.calcRepulsionForce(n,n.surrounding[O])},o.prototype.calcRepulsionRange=function(){return 0},m.exports=o},function(m,w,L){var s=L(1),r=L(7);function e(u,c,o){s.call(this,u,c,o),this.idealLength=r.DEFAULT_EDGE_LENGTH}e.prototype=Object.create(s.prototype);for(var i in s)e[i]=s[i];m.exports=e},function(m,w,L){var s=L(3);function r(i,u,c,o){s.call(this,i,u,c,o),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=[]}r.prototype=Object.create(s.prototype);for(var e in s)r[e]=s[e];r.prototype.setGridCoordinates=function(i,u,c,o){this.startX=i,this.finishX=u,this.startY=c,this.finishY=o},m.exports=r},function(m,w,L){function s(r,e){if(this.width=0,this.height=0,r!==null&&e!==null)this.height=e,this.width=r}s.prototype.getWidth=function(){return this.width},s.prototype.setWidth=function(r){this.width=r},s.prototype.getHeight=function(){return this.height},s.prototype.setHeight=function(r){this.height=r},m.exports=s},function(m,w,L){var s=L(14);function r(){this.map={},this.keys=[]}r.prototype.put=function(e,i){var u=s.createID(e);if(!this.contains(u))this.map[u]=i,this.keys.push(e)},r.prototype.contains=function(e){var i=s.createID(e);return this.map[e]!=null},r.prototype.get=function(e){var i=s.createID(e);return this.map[i]},r.prototype.keySet=function(){return this.keys},m.exports=r},function(m,w,L){var s=L(14);function r(){this.set={}}r.prototype.add=function(e){var i=s.createID(e);if(!this.contains(i))this.set[i]=e},r.prototype.remove=function(e){delete this.set[s.createID(e)]},r.prototype.clear=function(){this.set={}},r.prototype.contains=function(e){return this.set[s.createID(e)]==e},r.prototype.isEmpty=function(){return this.size()===0},r.prototype.size=function(){return Object.keys(this.set).length},r.prototype.addAllTo=function(e){var i=Object.keys(this.set),u=i.length;for(var c=0;c<u;c++)e.push(this.set[i[c]])},r.prototype.size=function(){return Object.keys(this.set).length},r.prototype.addAll=function(e){var i=e.length;for(var u=0;u<i;u++){var c=e[u];this.add(c)}},m.exports=r},function(m,w,L){var s=function(){function u(c,o){for(var y=0;y<o.length;y++){var n=o[y];if(n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n)n.writable=!0;Object.defineProperty(c,n.key,n)}}return function(c,o,y){if(o)u(c.prototype,o);if(y)u(c,y);return c}}();function r(u,c){if(!(u instanceof c))throw TypeError("Cannot call a class as a function")}var e=L(11),i=function(){function u(c,o){if(r(this,u),o!==null||o!==void 0)this.compareFunction=this._defaultCompareFunction;var y=void 0;if(c instanceof e)y=c.size();else y=c.length;this._quicksort(c,0,y-1)}return s(u,[{key:"_quicksort",value:function(o,y,n){if(y<n){var g=this._partition(o,y,n);this._quicksort(o,y,g),this._quicksort(o,g+1,n)}}},{key:"_partition",value:function(o,y,n){var g=this._get(o,y),f=y,E=n;while(!0){while(this.compareFunction(g,this._get(o,E)))E--;while(this.compareFunction(this._get(o,f),g))f++;if(f<E)this._swap(o,f,E),f++,E--;else return E}}},{key:"_get",value:function(o,y){if(o instanceof e)return o.get_object_at(y);else return o[y]}},{key:"_set",value:function(o,y,n){if(o instanceof e)o.set_object_at(y,n);else o[y]=n}},{key:"_swap",value:function(o,y,n){var g=this._get(o,y);this._set(o,y,this._get(o,n)),this._set(o,n,g)}},{key:"_defaultCompareFunction",value:function(o,y){return y>o}}]),u}();m.exports=i},function(m,w,L){var s=function(){function i(u,c){for(var o=0;o<c.length;o++){var y=c[o];if(y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y)y.writable=!0;Object.defineProperty(u,y.key,y)}}return function(u,c,o){if(c)i(u.prototype,c);if(o)i(u,o);return u}}();function r(i,u){if(!(i instanceof u))throw TypeError("Cannot call a class as a function")}var e=function(){function i(u,c){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,y=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;r(this,i),this.sequence1=u,this.sequence2=c,this.match_score=o,this.mismatch_penalty=y,this.gap_penalty=n,this.iMax=u.length+1,this.jMax=c.length+1,this.grid=Array(this.iMax);for(var g=0;g<this.iMax;g++){this.grid[g]=Array(this.jMax);for(var f=0;f<this.jMax;f++)this.grid[g][f]=0}this.tracebackGrid=Array(this.iMax);for(var E=0;E<this.iMax;E++){this.tracebackGrid[E]=Array(this.jMax);for(var T=0;T<this.jMax;T++)this.tracebackGrid[E][T]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return s(i,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var c=1;c<this.jMax;c++)this.grid[0][c]=this.grid[0][c-1]+this.gap_penalty,this.tracebackGrid[0][c]=[!1,!1,!0];for(var o=1;o<this.iMax;o++)this.grid[o][0]=this.grid[o-1][0]+this.gap_penalty,this.tracebackGrid[o][0]=[!1,!0,!1];for(var y=1;y<this.iMax;y++)for(var n=1;n<this.jMax;n++){var g=void 0;if(this.sequence1[y-1]===this.sequence2[n-1])g=this.grid[y-1][n-1]+this.match_score;else g=this.grid[y-1][n-1]+this.mismatch_penalty;var f=this.grid[y-1][n]+this.gap_penalty,E=this.grid[y][n-1]+this.gap_penalty,T=[g,f,E],N=this.arrayAllMaxIndexes(T);this.grid[y][n]=T[N[0]],this.tracebackGrid[y][n]=[N.includes(0),N.includes(1),N.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var c=[];c.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});while(c[0]){var o=c[0],y=this.tracebackGrid[o.pos[0]][o.pos[1]];if(y[0])c.push({pos:[o.pos[0]-1,o.pos[1]-1],seq1:this.sequence1[o.pos[0]-1]+o.seq1,seq2:this.sequence2[o.pos[1]-1]+o.seq2});if(y[1])c.push({pos:[o.pos[0]-1,o.pos[1]],seq1:this.sequence1[o.pos[0]-1]+o.seq1,seq2:"-"+o.seq2});if(y[2])c.push({pos:[o.pos[0],o.pos[1]-1],seq1:"-"+o.seq1,seq2:this.sequence2[o.pos[1]-1]+o.seq2});if(o.pos[0]===0&&o.pos[1]===0)this.alignments.push({sequence1:o.seq1,sequence2:o.seq2});c.shift()}return this.alignments}},{key:"getAllIndexes",value:function(c,o){var y=[],n=-1;while((n=c.indexOf(o,n+1))!==-1)y.push(n);return y}},{key:"arrayAllMaxIndexes",value:function(c){return this.getAllIndexes(c,Math.max.apply(null,c))}}]),i}();m.exports=e},function(m,w,L){var s=function(){return};s.FDLayout=L(18),s.FDLayoutConstants=L(7),s.FDLayoutEdge=L(19),s.FDLayoutNode=L(20),s.DimensionD=L(21),s.HashMap=L(22),s.HashSet=L(23),s.IGeometry=L(8),s.IMath=L(9),s.Integer=L(10),s.Point=L(12),s.PointD=L(4),s.RandomSeed=L(16),s.RectangleD=L(13),s.Transform=L(17),s.UniqueIDGeneretor=L(14),s.Quicksort=L(24),s.LinkedList=L(11),s.LGraphObject=L(2),s.LGraph=L(5),s.LEdge=L(1),s.LGraphManager=L(6),s.LNode=L(3),s.Layout=L(15),s.LayoutConstants=L(0),s.NeedlemanWunsch=L(25),m.exports=s},function(m,w,L){function s(){this.listeners=[]}var r=s.prototype;r.addListener=function(e,i){this.listeners.push({event:e,callback:i})},r.removeListener=function(e,i){for(var u=this.listeners.length;u>=0;u--){var c=this.listeners[u];if(c.event===e&&c.callback===i)this.listeners.splice(u,1)}},r.emit=function(e,i){for(var u=0;u<this.listeners.length;u++){var c=this.listeners[u];if(e===c.event)c.callback(i)}},m.exports=s}])})});var J=bn(function(Q,z){(function(w,L){if(typeof Q==="object"&&typeof z==="object")z.exports=L(q());else if(typeof define==="function"&&define.amd)define(["layout-base"],L);else if(typeof Q==="object")Q.coseBase=L(q());else w.coseBase=L(w.layoutBase)})(Q,function(m){return function(w){var L={};function s(r){if(L[r])return L[r].exports;var e=L[r]={i:r,l:!1,exports:{}};return w[r].call(e.exports,e,e.exports,s),e.l=!0,e.exports}return s.m=w,s.c=L,s.i=function(r){return r},s.d=function(r,e,i){if(!s.o(r,e))Object.defineProperty(r,e,{configurable:!1,enumerable:!0,get:i})},s.n=function(r){var e=r&&r.__esModule?function(){return r.default}:function(){return r};return s.d(e,"a",e),e},s.o=function(r,e){return Object.prototype.hasOwnProperty.call(r,e)},s.p="",s(s.s=7)}([function(w,L){w.exports=m},function(w,L,s){var r=s(0).FDLayoutConstants;function e(){}for(var i in r)e[i]=r[i];e.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,e.DEFAULT_RADIAL_SEPARATION=r.DEFAULT_EDGE_LENGTH,e.DEFAULT_COMPONENT_SEPERATION=60,e.TILE=!0,e.TILING_PADDING_VERTICAL=10,e.TILING_PADDING_HORIZONTAL=10,e.TREE_REDUCTION_ON_INCREMENTAL=!1,w.exports=e},function(w,L,s){var r=s(0).FDLayoutEdge;function e(u,c,o){r.call(this,u,c,o)}e.prototype=Object.create(r.prototype);for(var i in r)e[i]=r[i];w.exports=e},function(w,L,s){var r=s(0).LGraph;function e(u,c,o){r.call(this,u,c,o)}e.prototype=Object.create(r.prototype);for(var i in r)e[i]=r[i];w.exports=e},function(w,L,s){var r=s(0).LGraphManager;function e(u){r.call(this,u)}e.prototype=Object.create(r.prototype);for(var i in r)e[i]=r[i];w.exports=e},function(w,L,s){var r=s(0).FDLayoutNode,e=s(0).IMath;function i(c,o,y,n){r.call(this,c,o,y,n)}i.prototype=Object.create(r.prototype);for(var u in r)i[u]=r[u];i.prototype.move=function(){var c=this.graphManager.getLayout();if(this.displacementX=c.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY=c.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren,Math.abs(this.displacementX)>c.coolingFactor*c.maxNodeDisplacement)this.displacementX=c.coolingFactor*c.maxNodeDisplacement*e.sign(this.displacementX);if(Math.abs(this.displacementY)>c.coolingFactor*c.maxNodeDisplacement)this.displacementY=c.coolingFactor*c.maxNodeDisplacement*e.sign(this.displacementY);if(this.child==null)this.moveBy(this.displacementX,this.displacementY);else if(this.child.getNodes().length==0)this.moveBy(this.displacementX,this.displacementY);else this.propogateDisplacementToChildren(this.displacementX,this.displacementY);c.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},i.prototype.propogateDisplacementToChildren=function(c,o){var y=this.getChild().getNodes(),n;for(var g=0;g<y.length;g++)if(n=y[g],n.getChild()==null)n.moveBy(c,o),n.displacementX+=c,n.displacementY+=o;else n.propogateDisplacementToChildren(c,o)},i.prototype.setPred1=function(c){this.pred1=c},i.prototype.getPred1=function(){return pred1},i.prototype.getPred2=function(){return pred2},i.prototype.setNext=function(c){this.next=c},i.prototype.getNext=function(){return next},i.prototype.setProcessed=function(c){this.processed=c},i.prototype.isProcessed=function(){return processed},w.exports=i},function(w,L,s){var r=s(0).FDLayout,e=s(4),i=s(3),u=s(5),c=s(2),o=s(1),y=s(0).FDLayoutConstants,n=s(0).LayoutConstants,g=s(0).Point,f=s(0).PointD,E=s(0).Layout,T=s(0).Integer,N=s(0).IGeometry,v=s(0).LGraph,O=s(0).Transform;function D(){r.call(this),this.toBeTiled={}}D.prototype=Object.create(r.prototype);for(var R in r)D[R]=r[R];D.prototype.newGraphManager=function(){var a=new e(this);return this.graphManager=a,a},D.prototype.newGraph=function(a){return new i(null,this.graphManager,a)},D.prototype.newNode=function(a){return new u(this.graphManager,a)},D.prototype.newEdge=function(a){return new c(null,null,a)},D.prototype.initParameters=function(){if(r.prototype.initParameters.call(this,arguments),!this.isSubLayout){if(o.DEFAULT_EDGE_LENGTH<10)this.idealEdgeLength=10;else this.idealEdgeLength=o.DEFAULT_EDGE_LENGTH;this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.springConstant=y.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=y.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=y.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=y.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=y.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=y.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1,this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/y.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=y.CONVERGENCE_CHECK_PERIOD/this.maxIterations,this.coolingAdjuster=1}},D.prototype.layout=function(){var a=n.DEFAULT_CREATE_BENDS_AS_NEEDED;if(a)this.createBendpoints(),this.graphManager.resetAllEdges();return 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){var a=this.getFlatForest();if(a.length>0)this.positionNodesRadially(a);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var p=new Set(this.getAllNodes()),d=this.nodesWithGravity.filter(function(A){return p.has(A)});this.graphManager.setAllNodesToApplyGravitation(d),this.positionNodesRandomly()}}else if(o.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var p=new Set(this.getAllNodes()),d=this.nodesWithGravity.filter(function(C){return p.has(C)});this.graphManager.setAllNodesToApplyGravitation(d)}return this.initSpringEmbedder(),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%y.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.coolingCycle++,this.layoutQuality==0)this.coolingAdjuster=this.coolingCycle;else if(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 a=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(I){return a.has(I)});this.graphManager.setAllNodesToApplyGravitation(p),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=y.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;if(this.afterGrowthIterations%10==0)this.graphManager.updateBounds(),this.updateGrid();this.coolingFactor=y.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var d=!this.isTreeGrowing&&!this.isGrowthFinished,A=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(d,A),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},D.prototype.getPositionsData=function(){var a=this.graphManager.getAllNodes(),p={};for(var d=0;d<a.length;d++){var A=a[d].rect,I=a[d].id;p[I]={id:I,x:A.getCenterX(),y:A.getCenterY(),w:A.width,h:A.height}}return p},D.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var a=!1;if(y.ANIMATE==="during")this.emit("layoutstarted");else{while(!a)a=this.tick();this.graphManager.updateBounds()}},D.prototype.calculateNodesToApplyGravitationTo=function(){var a=[],p,d=this.graphManager.getGraphs(),A=d.length,I;for(I=0;I<A;I++)if(p=d[I],p.updateConnected(),!p.isConnected)a=a.concat(p.getNodes());return a},D.prototype.createBendpoints=function(){var a=[];a=a.concat(this.graphManager.getAllEdges());var p=new Set,d;for(d=0;d<a.length;d++){var A=a[d];if(!p.has(A)){var I=A.getSource(),C=A.getTarget();if(I==C)A.getBendpoints().push(new f),A.getBendpoints().push(new f),this.createDummyNodesForBendpoints(A),p.add(A);else{var M=[];if(M=M.concat(I.getEdgeListToNode(C)),M=M.concat(C.getEdgeListToNode(I)),!p.has(M[0])){if(M.length>1){var G;for(G=0;G<M.length;G++){var F=M[G];F.getBendpoints().push(new f),this.createDummyNodesForBendpoints(F)}}M.forEach(function(P){p.add(P)})}}}if(p.size==a.length)break}},D.prototype.positionNodesRadially=function(a){var p=new g(0,0),d=Math.ceil(Math.sqrt(a.length)),A=0,I=0,C=0,M=new f(0,0);for(var G=0;G<a.length;G++){if(G%d==0){if(C=0,I=A,G!=0)I+=o.DEFAULT_COMPONENT_SEPERATION;A=0}var F=a[G],P=E.findCenterOfTree(F);if(p.x=C,p.y=I,M=D.radialLayout(F,P,p),M.y>A)A=Math.floor(M.y);C=Math.floor(M.x+o.DEFAULT_COMPONENT_SEPERATION)}this.transform(new f(n.WORLD_CENTER_X-M.x/2,n.WORLD_CENTER_Y-M.y/2))},D.radialLayout=function(a,p,d){var A=Math.max(this.maxDiagonalInTree(a),o.DEFAULT_RADIAL_SEPARATION);D.branchRadialLayout(p,null,0,359,0,A);var I=v.calculateBounds(a),C=new O;C.setDeviceOrgX(I.getMinX()),C.setDeviceOrgY(I.getMinY()),C.setWorldOrgX(d.x),C.setWorldOrgY(d.y);for(var M=0;M<a.length;M++){var G=a[M];G.transform(C)}var F=new f(I.getMaxX(),I.getMaxY());return C.inverseTransformPoint(F)},D.branchRadialLayout=function(a,p,d,A,I,C){var M=(A-d+1)/2;if(M<0)M+=180;var G=(M+d)%360,F=G*N.TWO_PI/360,P=Math.cos(F),b=I*Math.cos(F),U=I*Math.sin(F);a.setCenter(b,U);var x=[];x=x.concat(a.getEdges());var S=x.length;if(p!=null)S--;var Y=0,X=x.length,H,_=a.getEdgesBetween(p);while(_.length>1){var W=_[0];_.splice(0,1);var k=x.indexOf(W);if(k>=0)x.splice(k,1);X--,S--}if(p!=null)H=(x.indexOf(_[0])+1)%X;else H=0;var B=Math.abs(A-d)/S;for(var V=H;Y!=S;V=++V%X){var et=x[V].getOtherEnd(a);if(et==p)continue;var rt=(d+Y*B)%360,ft=(rt+B)%360;D.branchRadialLayout(et,a,rt,ft,I+C,C),Y++}},D.maxDiagonalInTree=function(a){var p=T.MIN_VALUE;for(var d=0;d<a.length;d++){var A=a[d],I=A.getDiagonal();if(I>p)p=I}return p},D.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},D.prototype.groupZeroDegreeMembers=function(){var a=this,p={};this.memberGroups={},this.idToDummyNode={};var d=[],A=this.graphManager.getAllNodes();for(var I=0;I<A.length;I++){var C=A[I],M=C.getParent();if(this.getNodeDegreeWithChildren(C)===0&&(M.id==null||!this.getToBeTiled(M)))d.push(C)}for(var I=0;I<d.length;I++){var C=d[I],G=C.getParent().id;if(typeof p[G]>"u")p[G]=[];p[G]=p[G].concat(C)}Object.keys(p).forEach(function(F){if(p[F].length>1){var P="DummyCompound_"+F;a.memberGroups[P]=p[F];var b=p[F][0].getParent(),U=new u(a.graphManager);U.id=P,U.paddingLeft=b.paddingLeft||0,U.paddingRight=b.paddingRight||0,U.paddingBottom=b.paddingBottom||0,U.paddingTop=b.paddingTop||0,a.idToDummyNode[P]=U;var x=a.getGraphManager().add(a.newGraph(),U),S=b.getChild();S.add(U);for(var Y=0;Y<p[F].length;Y++){var X=p[F][Y];S.remove(X),x.add(X)}}})},D.prototype.clearCompounds=function(){var a={},p={};this.performDFSOnCompounds();for(var d=0;d<this.compoundOrder.length;d++)p[this.compoundOrder[d].id]=this.compoundOrder[d],a[this.compoundOrder[d].id]=[].concat(this.compoundOrder[d].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[d].getChild()),this.compoundOrder[d].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(a,p)},D.prototype.clearZeroDegreeMembers=function(){var a=this,p=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(d){var A=a.idToDummyNode[d];p[d]=a.tileNodes(a.memberGroups[d],A.paddingLeft+A.paddingRight),A.rect.width=p[d].width,A.rect.height=p[d].height})},D.prototype.repopulateCompounds=function(){for(var a=this.compoundOrder.length-1;a>=0;a--){var p=this.compoundOrder[a],{id:d,paddingLeft:A,paddingTop:I}=p;this.adjustLocations(this.tiledMemberPack[d],p.rect.x,p.rect.y,A,I)}},D.prototype.repopulateZeroDegreeMembers=function(){var a=this,p=this.tiledZeroDegreePack;Object.keys(p).forEach(function(d){var A=a.idToDummyNode[d],{paddingLeft:I,paddingTop:C}=A;a.adjustLocations(p[d],A.rect.x,A.rect.y,I,C)})},D.prototype.getToBeTiled=function(a){var p=a.id;if(this.toBeTiled[p]!=null)return this.toBeTiled[p];var d=a.getChild();if(d==null)return this.toBeTiled[p]=!1,!1;var A=d.getNodes();for(var I=0;I<A.length;I++){var C=A[I];if(this.getNodeDegree(C)>0)return this.toBeTiled[p]=!1,!1;if(C.getChild()==null){this.toBeTiled[C.id]=!1;continue}if(!this.getToBeTiled(C))return this.toBeTiled[p]=!1,!1}return this.toBeTiled[p]=!0,!0},D.prototype.getNodeDegree=function(a){var p=a.id,d=a.getEdges(),A=0;for(var I=0;I<d.length;I++){var C=d[I];if(C.getSource().id!==C.getTarget().id)A=A+1}return A},D.prototype.getNodeDegreeWithChildren=function(a){var p=this.getNodeDegree(a);if(a.getChild()==null)return p;var d=a.getChild().getNodes();for(var A=0;A<d.length;A++){var I=d[A];p+=this.getNodeDegreeWithChildren(I)}return p},D.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},D.prototype.fillCompexOrderByDFS=function(a){for(var p=0;p<a.length;p++){var d=a[p];if(d.getChild()!=null)this.fillCompexOrderByDFS(d.getChild().getNodes());if(this.getToBeTiled(d))this.compoundOrder.push(d)}},D.prototype.adjustLocations=function(a,p,d,A,I){p+=A,d+=I;var C=p;for(var M=0;M<a.rows.length;M++){var G=a.rows[M];p=C;var F=0;for(var P=0;P<G.length;P++){var b=G[P];if(b.rect.x=p,b.rect.y=d,p+=b.rect.width+a.horizontalPadding,b.rect.height>F)F=b.rect.height}d+=F+a.verticalPadding}},D.prototype.tileCompoundMembers=function(a,p){var d=this;this.tiledMemberPack=[],Object.keys(a).forEach(function(A){var I=p[A];d.tiledMemberPack[A]=d.tileNodes(a[A],I.paddingLeft+I.paddingRight),I.rect.width=d.tiledMemberPack[A].width,I.rect.height=d.tiledMemberPack[A].height})},D.prototype.tileNodes=function(a,p){var{TILING_PADDING_VERTICAL:d,TILING_PADDING_HORIZONTAL:A}=o,I={rows:[],rowWidth:[],rowHeight:[],width:0,height:p,verticalPadding:d,horizontalPadding:A};a.sort(function(G,F){if(G.rect.width*G.rect.height>F.rect.width*F.rect.height)return-1;if(G.rect.width*G.rect.height<F.rect.width*F.rect.height)return 1;return 0});for(var C=0;C<a.length;C++){var M=a[C];if(I.rows.length==0)this.insertNodeToRow(I,M,0,p);else if(this.canAddHorizontal(I,M.rect.width,M.rect.height))this.insertNodeToRow(I,M,this.getShortestRowIndex(I),p);else this.insertNodeToRow(I,M,I.rows.length,p);this.shiftToLastRow(I)}return I},D.prototype.insertNodeToRow=function(a,p,d,A){var I=A;if(d==a.rows.length){var C=[];a.rows.push(C),a.rowWidth.push(I),a.rowHeight.push(0)}var M=a.rowWidth[d]+p.rect.width;if(a.rows[d].length>0)M+=a.horizontalPadding;if(a.rowWidth[d]=M,a.width<M)a.width=M;var G=p.rect.height;if(d>0)G+=a.verticalPadding;var F=0;if(G>a.rowHeight[d])F=a.rowHeight[d],a.rowHeight[d]=G,F=a.rowHeight[d]-F;a.height+=F,a.rows[d].push(p)},D.prototype.getShortestRowIndex=function(a){var p=-1,d=Number.MAX_VALUE;for(var A=0;A<a.rows.length;A++)if(a.rowWidth[A]<d)p=A,d=a.rowWidth[A];return p},D.prototype.getLongestRowIndex=function(a){var p=-1,d=Number.MIN_VALUE;for(var A=0;A<a.rows.length;A++)if(a.rowWidth[A]>d)p=A,d=a.rowWidth[A];return p},D.prototype.canAddHorizontal=function(a,p,d){var A=this.getShortestRowIndex(a);if(A<0)return!0;var I=a.rowWidth[A];if(I+a.horizontalPadding+p<=a.width)return!0;var C=0;if(a.rowHeight[A]<d){if(A>0)C=d+a.verticalPadding-a.rowHeight[A]}var M;if(a.width-I>=p+a.horizontalPadding)M=(a.height+C)/(I+p+a.horizontalPadding);else M=(a.height+C)/a.width;C=d+a.verticalPadding;var G;if(a.width<p)G=(a.height+C)/p;else G=(a.height+C)/a.width;if(G<1)G=1/G;if(M<1)M=1/M;return M<G},D.prototype.shiftToLastRow=function(a){var p=this.getLongestRowIndex(a),d=a.rowWidth.length-1,A=a.rows[p],I=A[A.length-1],C=I.width+a.horizontalPadding;if(a.width-a.rowWidth[d]>C&&p!=d){A.splice(-1,1),a.rows[d].push(I),a.rowWidth[p]=a.rowWidth[p]-C,a.rowWidth[d]=a.rowWidth[d]+C,a.width=a.rowWidth[instance.getLongestRowIndex(a)];var M=Number.MIN_VALUE;for(var G=0;G<A.length;G++)if(A[G].height>M)M=A[G].height;if(p>0)M+=a.verticalPadding;var F=a.rowHeight[p]+a.rowHeight[d];if(a.rowHeight[p]=M,a.rowHeight[d]<I.height+a.verticalPadding)a.rowHeight[d]=I.height+a.verticalPadding;var P=a.rowHeight[p]+a.rowHeight[d];a.height+=P-F,this.shiftToLastRow(a)}},D.prototype.tilingPreLayout=function(){if(o.TILE)this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers()},D.prototype.tilingPostLayout=function(){if(o.TILE)this.repopulateZeroDegreeMembers(),this.repopulateCompounds()},D.prototype.reduceTrees=function(){var a=[],p=!0,d;while(p){var A=this.graphManager.getAllNodes(),I=[];p=!1;for(var C=0;C<A.length;C++)if(d=A[C],d.getEdges().length==1&&!d.getEdges()[0].isInterGraph&&d.getChild()==null)I.push([d,d.getEdges()[0],d.getOwner()]),p=!0;if(p==!0){var M=[];for(var G=0;G<I.length;G++)if(I[G][0].getEdges().length==1)M.push(I[G]),I[G][0].getOwner().remove(I[G][0]);a.push(M),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=a},D.prototype.growTree=function(a){var p=a.length,d=a[p-1],A;for(var I=0;I<d.length;I++)A=d[I],this.findPlaceforPrunedNode(A),A[2].add(A[0]),A[2].add(A[1],A[1].source,A[1].target);a.splice(a.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},D.prototype.findPlaceforPrunedNode=function(a){var p,d,A=a[0];if(A==a[1].source)d=a[1].target;else d=a[1].source;var I=d.startX,C=d.finishX,M=d.startY,G=d.finishY,F=0,P=0,b=0,U=0,x=[F,b,P,U];if(M>0)for(var S=I;S<=C;S++)x[0]+=this.grid[S][M-1].length+this.grid[S][M].length-1;if(C<this.grid.length-1)for(var S=M;S<=G;S++)x[1]+=this.grid[C+1][S].length+this.grid[C][S].length-1;if(G<this.grid[0].length-1)for(var S=I;S<=C;S++)x[2]+=this.grid[S][G+1].length+this.grid[S][G].length-1;if(I>0)for(var S=M;S<=G;S++)x[3]+=this.grid[I-1][S].length+this.grid[I][S].length-1;var Y=T.MAX_VALUE,X,H;for(var _=0;_<x.length;_++)if(x[_]<Y)Y=x[_],X=1,H=_;else if(x[_]==Y)X++;if(X==3&&Y==0){if(x[0]==0&&x[1]==0&&x[2]==0)p=1;else if(x[0]==0&&x[1]==0&&x[3]==0)p=0;else if(x[0]==0&&x[2]==0&&x[3]==0)p=3;else if(x[1]==0&&x[2]==0&&x[3]==0)p=2}else if(X==2&&Y==0){var W=Math.floor(Math.random()*2);if(x[0]==0&&x[1]==0)if(W==0)p=0;else p=1;else if(x[0]==0&&x[2]==0)if(W==0)p=0;else p=2;else if(x[0]==0&&x[3]==0)if(W==0)p=0;else p=3;else if(x[1]==0&&x[2]==0)if(W==0)p=1;else p=2;else if(x[1]==0&&x[3]==0)if(W==0)p=1;else p=3;else if(W==0)p=2;else p=3}else if(X==4&&Y==0){var W=Math.floor(Math.random()*4);p=W}else p=H;if(p==0)A.setCenter(d.getCenterX(),d.getCenterY()-d.getHeight()/2-y.DEFAULT_EDGE_LENGTH-A.getHeight()/2);else if(p==1)A.setCenter(d.getCenterX()+d.getWidth()/2+y.DEFAULT_EDGE_LENGTH+A.getWidth()/2,d.getCenterY());else if(p==2)A.setCenter(d.getCenterX(),d.getCenterY()+d.getHeight()/2+y.DEFAULT_EDGE_LENGTH+A.getHeight()/2);else A.setCenter(d.getCenterX()-d.getWidth()/2-y.DEFAULT_EDGE_LENGTH-A.getWidth()/2,d.getCenterY())},w.exports=D},function(w,L,s){var r={};r.layoutBase=s(0),r.CoSEConstants=s(1),r.CoSEEdge=s(2),r.CoSEGraph=s(3),r.CoSEGraphManager=s(4),r.CoSELayout=s(6),r.CoSENode=s(5),w.exports=r}])})});var it=bn(function(j,tt){(function(w,L){if(typeof j==="object"&&typeof tt==="object")tt.exports=L(J());else if(typeof define==="function"&&define.amd)define(["cose-base"],L);else if(typeof j==="object")j.cytoscapeCoseBilkent=L(J());else w.cytoscapeCoseBilkent=L(w.coseBase)})(j,function(m){return function(w){var L={};function s(r){if(L[r])return L[r].exports;var e=L[r]={i:r,l:!1,exports:{}};return w[r].call(e.exports,e,e.exports,s),e.l=!0,e.exports}return s.m=w,s.c=L,s.i=function(r){return r},s.d=function(r,e,i){if(!s.o(r,e))Object.defineProperty(r,e,{configurable:!1,enumerable:!0,get:i})},s.n=function(r){var e=r&&r.__esModule?function(){return r.default}:function(){return r};return s.d(e,"a",e),e},s.o=function(r,e){return Object.prototype.hasOwnProperty.call(r,e)},s.p="",s(s.s=1)}([function(w,L){w.exports=m},function(w,L,s){var r=s(0).layoutBase.LayoutConstants,e=s(0).layoutBase.FDLayoutConstants,i=s(0).CoSEConstants,u=s(0).CoSELayout,c=s(0).CoSENode,o=s(0).layoutBase.PointD,y=s(0).layoutBase.DimensionD,n={ready:function(){},stop:function(){},quality:"default",nodeDimensionsIncludeLabels:!1,refresh:30,fit:!0,padding:10,randomize:!0,nodeRepulsion:4500,idealEdgeLength:50,edgeElasticity:0.45,nestingFactor:0.1,gravity:0.25,numIter:2500,tile:!0,animate:"end",animationDuration:500,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:0.5};function g(N,v){var O={};for(var D in N)O[D]=N[D];for(var D in v)O[D]=v[D];return O}function f(N){this.options=g(n,N),E(this.options)}var E=function(v){if(v.nodeRepulsion!=null)i.DEFAULT_REPULSION_STRENGTH=e.DEFAULT_REPULSION_STRENGTH=v.nodeRepulsion;if(v.idealEdgeLength!=null)i.DEFAULT_EDGE_LENGTH=e.DEFAULT_EDGE_LENGTH=v.idealEdgeLength;if(v.edgeElasticity!=null)i.DEFAULT_SPRING_STRENGTH=e.DEFAULT_SPRING_STRENGTH=v.edgeElasticity;if(v.nestingFactor!=null)i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=e.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=v.nestingFactor;if(v.gravity!=null)i.DEFAULT_GRAVITY_STRENGTH=e.DEFAULT_GRAVITY_STRENGTH=v.gravity;if(v.numIter!=null)i.MAX_ITERATIONS=e.MAX_ITERATIONS=v.numIter;if(v.gravityRange!=null)i.DEFAULT_GRAVITY_RANGE_FACTOR=e.DEFAULT_GRAVITY_RANGE_FACTOR=v.gravityRange;if(v.gravityCompound!=null)i.DEFAULT_COMPOUND_GRAVITY_STRENGTH=e.DEFAULT_COMPOUND_GRAVITY_STRENGTH=v.gravityCompound;if(v.gravityRangeCompound!=null)i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=e.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=v.gravityRangeCompound;if(v.initialEnergyOnIncremental!=null)i.DEFAULT_COOLING_FACTOR_INCREMENTAL=e.DEFAULT_COOLING_FACTOR_INCREMENTAL=v.initialEnergyOnIncremental;if(v.quality=="draft")r.QUALITY=0;else if(v.quality=="proof")r.QUALITY=2;else r.QUALITY=1;i.NODE_DIMENSIONS_INCLUDE_LABELS=e.NODE_DIMENSIONS_INCLUDE_LABELS=r.NODE_DIMENSIONS_INCLUDE_LABELS=v.nodeDimensionsIncludeLabels,i.DEFAULT_INCREMENTAL=e.DEFAULT_INCREMENTAL=r.DEFAULT_INCREMENTAL=!v.randomize,i.ANIMATE=e.ANIMATE=r.ANIMATE=v.animate,i.TILE=v.tile,i.TILING_PADDING_VERTICAL=typeof v.tilingPaddingVertical==="function"?v.tilingPaddingVertical.call():v.tilingPaddingVertical,i.TILING_PADDING_HORIZONTAL=typeof v.tilingPaddingHorizontal==="function"?v.tilingPaddingHorizontal.call():v.tilingPaddingHorizontal};f.prototype.run=function(){var N,v,O=this.options,D=this.idToLNode={},R=this.layout=new u,a=this;a.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:"layoutstart",layout:this});var p=R.newGraphManager();this.gm=p;var d=this.options.eles.nodes(),A=this.options.eles.edges();this.root=p.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(d),R);for(var I=0;I<A.length;I++){var C=A[I],M=this.idToLNode[C.data("source")],G=this.idToLNode[C.data("target")];if(M!==G&&M.getEdgesBetween(G).length==0){var F=p.add(R.newEdge(),M,G);F.id=C.id()}}var P=function(x,S){if(typeof x==="number")x=S;var Y=x.data("id"),X=a.idToLNode[Y];return{x:X.getRect().getCenterX(),y:X.getRect().getCenterY()}},b=function U(){var x=function(){if(O.fit)O.cy.fit(O.eles,O.padding);if(!N)N=!0,a.cy.one("layoutready",O.ready),a.cy.trigger({type:"layoutready",layout:a})},S=a.options.refresh,Y;for(var X=0;X<S&&!Y;X++)Y=a.stopped||a.layout.tick();if(Y){if(R.checkLayoutSuccess()&&!R.isSubLayout)R.doPostLayout();if(R.tilingPostLayout)R.tilingPostLayout();if(R.isLayoutFinished=!0,a.options.eles.nodes().positions(P),x(),a.cy.one("layoutstop",a.options.stop),a.cy.trigger({type:"layoutstop",layout:a}),v)cancelAnimationFrame(v);N=!1;return}var H=a.layout.getPositionsData();O.eles.nodes().positions(function(_,W){if(typeof _==="number")_=W;if(!_.isParent()){var k=_.id(),B=H[k],V=_;while(B==null)if(B=H[V.data("parent")]||H["DummyCompound_"+V.data("parent")],H[k]=B,V=V.parent()[0],V==null)break;if(B!=null)return{x:B.x,y:B.y};else return{x:_.position("x"),y:_.position("y")}}}),x(),v=requestAnimationFrame(U)};if(R.addListener("layoutstarted",function(){if(a.options.animate==="during")v=requestAnimationFrame(b)}),R.runLayout(),this.options.animate!=="during")a.options.eles.nodes().not(":parent").layoutPositions(a,a.options,P),N=!1;return this},f.prototype.getTopMostNodes=function(N){var v={};for(var O=0;O<N.length;O++)v[N[O].id()]=!0;var D=N.filter(function(R,a){if(typeof R==="number")R=a;var p=R.parent()[0];while(p!=null){if(v[p.id()])return!1;p=p.parent()[0]}return!0});return D},f.prototype.processChildrenList=function(N,v,O){var D=v.length;for(var R=0;R<D;R++){var a=v[R],p=a.children(),d,A=a.layoutDimensions({nodeDimensionsIncludeLabels:this.options.nodeDimensionsIncludeLabels});if(a.outerWidth()!=null&&a.outerHeight()!=null)d=N.add(new c(O.graphManager,new o(a.position("x")-A.w/2,a.position("y")-A.h/2),new y(parseFloat(A.w),parseFloat(A.h))));else d=N.add(new c(this.graphManager));if(d.id=a.data("id"),d.paddingLeft=parseInt(a.css("padding")),d.paddingTop=parseInt(a.css("padding")),d.paddingRight=parseInt(a.css("padding")),d.paddingBottom=parseInt(a.css("padding")),this.options.nodeDimensionsIncludeLabels){if(a.isParent()){var I=a.boundingBox({includeLabels:!0,includeNodes:!1}).w,C=a.boundingBox({includeLabels:!0,includeNodes:!1}).h,M=a.css("text-halign");d.labelWidth=I,d.labelHeight=C,d.labelPos=M}}if(this.idToLNode[a.data("id")]=d,isNaN(d.rect.x))d.rect.x=0;if(isNaN(d.rect.y))d.rect.y=0;if(p!=null&&p.length>0){var G=O.getGraphManager().add(O.newGraph(),d);this.processChildrenList(G,p,O)}}},f.prototype.stop=function(){return this.stopped=!0,this};var T=function(v){v("layout","cose-bilkent",f)};if(typeof cytoscape<"u")T(cytoscape);w.exports=T}])})});var nt=an(it(),1);Nr.use(nt.default);function st(m,w){m.forEach((L)=>{let s={id:L.id,labelText:L.label,height:L.height,width:L.width,padding:L.padding??0};Object.keys(L).forEach((r)=>{if(!["id","label","height","width","padding","x","y"].includes(r))s[r]=L[r]}),w.add({group:"nodes",data:s,position:{x:L.x??0,y:L.y??0}})})}t(st,"addNodes");function ot(m,w){m.forEach((L)=>{let s={id:L.id,source:L.start,target:L.end};Object.keys(L).forEach((r)=>{if(!["id","start","end"].includes(r))s[r]=L[r]}),w.add({group:"edges",data:s})})}t(ot,"addEdges");function at(m){return new Promise((w)=>{let L=h("body").append("div").attr("id","cy").attr("style","display:none"),s=Nr({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});L.remove(),st(m.nodes,s),ot(m.edges,s),s.nodes().forEach(function(e){e.layoutDimensions=()=>{let i=e.data();return{w:i.width,h:i.height}}});let r={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};s.layout(r).run(),s.ready((e)=>{l.info("Cytoscape ready",e),w(s)})})}t(at,"createCytoscapeInstance");function ht(m){return m.nodes().map((w)=>{let L=w.data(),s=w.position(),r={id:L.id,x:s.x,y:s.y};return Object.keys(L).forEach((e)=>{if(e!=="id")r[e]=L[e]}),r})}t(ht,"extractPositionedNodes");function lt(m){return m.edges().map((w)=>{let L=w.data(),s=w._private.rscratch,r={id:L.id,source:L.source,target:L.target,startX:s.startX,startY:s.startY,midX:s.midX,midY:s.midY,endX:s.endX,endY:s.endY};return Object.keys(L).forEach((e)=>{if(!["id","source","target"].includes(e))r[e]=L[e]}),r})}t(lt,"extractPositionedEdges");async function ut(m,w){l.debug("Starting cose-bilkent layout algorithm");try{gt(m);let L=await at(m),s=ht(L),r=lt(L);return l.debug(`Layout completed: ${s.length} nodes, ${r.length} edges`),{nodes:s,edges:r}}catch(L){throw l.error("Error in cose-bilkent layout algorithm:",L),L}}t(ut,"executeCoseBilkentLayout");function gt(m){if(!m)throw Error("Layout data is required");if(!m.config)throw Error("Configuration is required in layout data");if(!m.rootNode)throw Error("Root node is required");if(!m.nodes||!Array.isArray(m.nodes))throw Error("No nodes found in layout data");if(!Array.isArray(m.edges))throw Error("Edges array is required in layout data");return!0}t(gt,"validateLayoutData");var ct=t(async(m,w,{insertCluster:L,insertEdge:s,insertEdgeLabel:r,insertMarkers:e,insertNode:i,log:u,positionEdgeLabel:c},{algorithm:o})=>{let y={},n={},g=w.select("g");e(g,m.markers,m.type,m.diagramId);let f=g.insert("g").attr("class","subgraphs"),E=g.insert("g").attr("class","edgePaths"),T=g.insert("g").attr("class","edgeLabels"),N=g.insert("g").attr("class","nodes");u.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(m.nodes.map(async(D)=>{if(D.isGroup){let R={...D};n[D.id]=R,y[D.id]=R,await L(f,D)}else{let R={...D};y[D.id]=R;let a=await i(N,D,{config:m.config,dir:m.direction||"TB"}),p=a.node().getBBox();R.width=p.width,R.height=p.height,R.domId=a,u.debug(`Node ${D.id} dimensions: ${p.width}x${p.height}`)}})),u.debug("Running cose-bilkent layout algorithm");let v={...m,nodes:m.nodes.map((D)=>{let R=y[D.id];return{...D,width:R.width,height:R.height}})},O=await ut(v,m.config);u.debug("Positioning nodes based on layout results"),O.nodes.forEach((D)=>{let R=y[D.id];if(R?.domId)R.domId.attr("transform",`translate(${D.x}, ${D.y})`),R.x=D.x,R.y=D.y,u.debug(`Positioned node ${R.id} at center (${D.x}, ${D.y})`)}),O.edges.forEach((D)=>{let R=m.edges.find((a)=>a.id===D.id);if(R)R.points=[{x:D.startX,y:D.startY},{x:D.midX,y:D.midY},{x:D.endX,y:D.endY}]}),u.debug("Inserting and positioning edges"),await Promise.all(m.edges.map(async(D)=>{let R=await r(T,D),a=y[D.start??""],p=y[D.end??""];if(a&&p){let d=O.edges.find((A)=>A.id===D.id);if(d){u.debug("APA01 positionedEdge",d);let A={...D},I=s(E,A,n,m.type,a,p,m.diagramId);c(A,I)}else{let A={...D,points:[{x:a.x||0,y:a.y||0},{x:p.x||0,y:p.y||0}]},I=s(E,A,n,m.type,a,p,m.diagramId);c(A,I)}}})),u.debug("Cose-bilkent rendering completed")},"render"),Et=ct;export{Et as render};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{rd,as,ah,ih,oh,sh}from"./index-rytaa8ca.js";export{ah as css,sh as gss,as as keywords,oh as less,rd as mkCSS,ih as sCSS};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{nf}from"./index-j51d5a5m.js";export{nf as createCynefinServices};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{be}from"./index-
|
|
1
|
+
import{be}from"./index-52rqxgya.js";import{t,l,Mt,K,E,te,R,L,z,O,U,j,G,de,oe}from"./index-fta1y9pc.js";import{Te}from"./index-j51d5a5m.js";var mt=t(()=>({domains:new Map,transitions:[]}),"createDefaultData"),Z=mt(),Dt=t(()=>Z.domains,"getDomains"),kt=t(()=>Z.transitions,"getTransitions"),Tt=t((e)=>{if(!e)return;for(let n of e){let o=n.domain,a=(n.items??[]).map((c)=>({label:c.label}));Z.domains.set(o,{name:o,items:a})}},"setDomains"),At=t((e)=>{if(!e)return;Z.transitions=e.filter((n)=>{if(n.from===n.to)return l.warn(`Cynefin: self-loop transition on domain "${n.from}" is not meaningful and will be skipped.`),!1;return!0}).map((n)=>({from:n.from,to:n.to,label:n.label||void 0}))},"setTransitions"),Bt=t(()=>oe({...K.cynefin,...E().cynefin}),"getConfig"),St=t(()=>{R(),Z=mt()},"clear"),et={getDomains:Dt,getTransitions:kt,setDomains:Tt,setTransitions:At,getConfig:Bt,clear:St,setAccTitle:L,getAccTitle:z,setDiagramTitle:j,getDiagramTitle:G,getAccDescription:U,setAccDescription:O},zt=t((e)=>{be(e,et),et.setDomains(e.domains),et.setTransitions(e.transitions)},"populate"),Lt={parse:t(async(e)=>{let n=await Te("cynefin",e);l.debug(n),zt(n)},"parse")};function Q(e){let n=e+1831565813|0;return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}t(Q,"seededRandom");function pt(e){let n=0;for(let o=0;o<e.length;o++){let a=e.charCodeAt(o);n=(n<<5)-n+a,n|=0}return n}t(pt,"hashString");function yt(e,n){if(typeof e==="number"&&Number.isFinite(e)&&e!==0)return e;return pt(n)}t(yt,"resolveSeed");function ut(e,n,o,a){let c=e/2,p=a??e*0.015,J=7,_=n/7,f=[];for(let r=0;r<=7;r++){let y=Q(o+r*17)*p*2-p;f.push({x:c+y,y:r*_})}let k=`M${f[0].x},${f[0].y}`;for(let r=0;r<f.length-1;r++){let y=f[r],s=f[r+1],m=(y.y+s.y)/2,C=r%2===0?1:-1,h=p*1.5*C*Q(o+r*31+7),H=y.x+h,Y=m,X=s.x-h;k+=` C${H},${Y} ${X},${m} ${s.x},${s.y}`}return k}t(ut,"generateFoldPath");function gt(e,n,o,a){let c=n/2,p=a??n*0.015,J=7,_=e/7,f=[];for(let r=0;r<=7;r++){let y=Q(o+r*23)*p*2-p;f.push({x:r*_,y:c+y})}let k=`M${f[0].x},${f[0].y}`;for(let r=0;r<f.length-1;r++){let y=f[r],s=f[r+1],m=(y.x+s.x)/2,C=r%2===0?1:-1,h=p*1.5*C*Q(o+r*37+11),H=m,Y=y.y+h,X=m,P=s.y-h;k+=` C${H},${Y} ${X},${P} ${s.x},${s.y}`}return k}t(gt,"generateHorizontalBoundary");function ht(e,n){let o=e/2,a=n*0.5,c=n,p=e*0.03;return[`M${o},${a}`,`C${o+p},${a+(c-a)*0.2}`,`${o-p*1.5},${a+(c-a)*0.55}`,`${o+p*0.5},${a+(c-a)*0.75}`,`C${o-p},${a+(c-a)*0.85}`,`${o+p*0.3},${a+(c-a)*0.95}`,`${o},${c}`].join(" ")}t(ht,"generateCliffPath");function xt(e,n,o,a){return[`M${e-o},${n}`,`A${o},${a} 0 1,1 ${e+o},${n}`,`A${o},${a} 0 1,1 ${e-o},${n}`,"Z"].join(" ")}t(xt,"generateConfusionPath");var ft={complex:{model:"Probe → Sense → Respond",practice:"Emergent Practices"},complicated:{model:"Sense → Analyse → Respond",practice:"Good Practices"},clear:{model:"Sense → Categorise → Respond",practice:"Best Practices"},chaotic:{model:"Act → Sense → Respond",practice:"Novel Practices"},confusion:{model:"",practice:"Disorder"}},Nt=t((e,n)=>{let o=e/2,a=n/2;return{complex:{cx:o/2,cy:a/2,x:0,y:0,w:o,h:a},complicated:{cx:o+o/2,cy:a/2,x:o,y:0,w:o,h:a},chaotic:{cx:o/2,cy:a+a/2,x:0,y:a,w:o,h:a},clear:{cx:o+o/2,cy:a+a/2,x:o,y:a,w:o,h:a},confusion:{cx:o,cy:a,x:o*0.7,y:a*0.7,w:o*0.6,h:a*0.6}}},"getDomainLayouts"),Pt=t(()=>{let e=Mt(),n=E();return oe(e,n.themeVariables).cynefin},"getCynefinDomainColors"),at=3,It=t((e,n,o,a)=>{let c=a.db,p=c.getDomains(),J=c.getTransitions(),_=c.getDiagramTitle(),f=c.getAccTitle(),k=c.getAccDescription(),r=c.getConfig(),y=Pt();l.debug("Rendering Cynefin diagram");let{width:s,height:m,padding:C,showDomainDescriptions:h,boundaryAmplitude:H}=r,Y=s+C*2,X=m+C*2,P={complex:y.complexBg,complicated:y.complicatedBg,clear:y.clearBg,chaotic:y.chaoticBg,confusion:y.confusionBg},T=de(n);if(te(T,X,Y,r.useMaxWidth??!0),T.attr("viewBox",`0 0 ${Y} ${X}`),f)T.append("title").text(f);if(k)T.append("desc").text(k);let A=T.append("g").attr("transform",`translate(${C}, ${C})`),q=Nt(s,m),rt=yt(r.seed,n),$t=A.append("g").attr("class","cynefin-backgrounds"),nt=["complex","complicated","chaotic","clear"];for(let d of nt){let i=q[d];$t.append("rect").attr("class","cynefinDomain").attr("x",i.x).attr("y",i.y).attr("width",i.w).attr("height",i.h).attr("fill",P[d]).attr("fill-opacity",0.4).attr("stroke","none")}let ot=A.append("g").attr("class","cynefin-boundaries");ot.append("path").attr("class","cynefinBoundary").attr("d",ut(s,m,rt,H)).attr("fill","none"),ot.append("path").attr("class","cynefinBoundary").attr("d",gt(s,m,rt+100,H)).attr("fill","none"),ot.append("path").attr("class","cynefinCliff").attr("d",ht(s,m)).attr("fill","none");let bt=s*0.15,wt=m*0.15;A.append("path").attr("class","cynefinConfusion").attr("d",xt(s/2,m/2,bt,wt)).attr("fill",P.confusion).attr("fill-opacity",0.5);let it=A.append("g").attr("class","cynefin-labels");for(let d of nt){let i=q[d];it.append("text").attr("class","cynefinDomainLabel").attr("x",i.cx).attr("y",h?i.cy-30:i.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(d.charAt(0).toUpperCase()+d.slice(1))}if(it.append("text").attr("class","cynefinDomainLabel").attr("x",s/2).attr("y",h?m/2-10:m/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion"),h){let d=A.append("g").attr("class","cynefin-subtitles");for(let i of nt){let g=q[i],u=ft[i];d.append("text").attr("class","cynefinSubtitle").attr("x",g.cx).attr("y",g.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(u.model),d.append("text").attr("class","cynefinSubtitle").attr("x",g.cx).attr("y",g.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(u.practice)}d.append("text").attr("class","cynefinSubtitle").attr("x",s/2).attr("y",m/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(ft.confusion.practice)}let st=A.append("g").attr("class","cynefin-items"),B=26,ct=10,Ct=["complex","complicated","chaotic","clear","confusion"];for(let d of Ct){let i=p.get(d);if(!i||i.items.length===0)continue;let g=q[d],u=d==="confusion",I=i.items,W=0;if(u&&i.items.length>at)W=i.items.length-at,I=i.items.slice(0,at);let S;if(u){let b=h?22:14;S=g.cy+b}else S=g.cy+(h?25:15);if([...I].forEach((b,M)=>{let v=S+M*(B+4),N=st.append("g"),F=N.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",B/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(b.label),w=b.label.length*7,x=F.node();if(x&&typeof x.getBBox==="function"){let tt=x.getBBox();if(tt.width>0)w=tt.width}let D=w+ct*2,V=g.cx-D/2;N.attr("transform",`translate(${V}, ${v})`),N.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",D).attr("height",B).attr("rx",4).attr("ry",4).attr("fill",P[d]).attr("fill-opacity",0.95),F.attr("x",D/2).attr("y",B/2)}),W>0){let b=S+I.length*(B+4),M=`+${W} more`,v=st.append("g"),N=v.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",B/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(M),F=M.length*7,w=N.node();if(w&&typeof w.getBBox==="function"){let V=w.getBBox();if(V.width>0)F=V.width}let x=F+ct*2,D=g.cx-x/2;v.attr("transform",`translate(${D}, ${b})`),v.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",x).attr("height",B).attr("rx",4).attr("ry",4).attr("fill",P[d]).attr("fill-opacity",0.6),N.attr("x",x/2).attr("y",B/2)}}if(J.length>0){let d=T.select("defs").empty()?T.append("defs"):T.select("defs"),i=`cynefin-arrow-${n}`;d.append("marker").attr("id",i).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","cynefinArrowHead");let g=A.append("g").attr("class","cynefin-arrows");J.forEach((u)=>{let I=q[u.from],W=q[u.to];if(!I||!W)return;if(u.from===u.to){l.warn(`Cynefin renderer: skipping self-loop on domain "${u.from}"`);return}let{cx:S,cy:b}=I,{cx:M,cy:v}=W,N=(S+M)/2,F=(b+v)/2,w=M-S,x=v-b,D=Math.sqrt(w*w+x*x),V=D*0.15,tt=-x/D,vt=w/D,lt=N+tt*V,dt=F+vt*V;if(g.append("path").attr("class","cynefinArrowLine").attr("d",`M${S},${b} Q${lt},${dt} ${M},${v}`).attr("fill","none").attr("marker-end",`url(#${i})`),u.label)g.append("text").attr("class","cynefinArrowLabel").attr("x",lt).attr("y",dt-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(u.label)})}if(_)A.append("text").attr("class","cynefinTitle").attr("x",s/2).attr("y",-C/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(_)},"draw"),Wt={draw:It},Rt=t(()=>{let e=Mt(),n=E();return oe(e,n.themeVariables).cynefin},"getCynefinTheme"),Ft=t(()=>{let e=Rt();return`
|
|
2
2
|
.cynefinDomain {
|
|
3
3
|
stroke: none;
|
|
4
4
|
}
|
|
@@ -59,4 +59,4 @@ import{be}from"./index-3vhznzgr.js";import{t,l,Lt,K,E,te,R,M,O,P,z,j,G,ue,ae}fro
|
|
|
59
59
|
font-weight: bold;
|
|
60
60
|
fill: ${e.labelColor};
|
|
61
61
|
}
|
|
62
|
-
`},"styles"),Vt=Ft,jt={parser:
|
|
62
|
+
`},"styles"),Vt=Ft,jt={parser:Lt,db:et,renderer:Wt,styles:Vt};export{jt as diagram};
|