@kabmo-labs/kabmo 0.42.0 → 0.42.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/index.html +1 -1
- package/dist/client/index.js +592 -593
- package/dist/client/static/js/{CsvGrid-20k047ht.js → CsvGrid-g6rek8y9.js} +1 -1
- package/dist/client/static/js/{DocxView-qpvhfcmg.js → DocxView-41t9ryws.js} +2 -2
- package/dist/client/static/js/{DrawioView-178skky8.js → DrawioView-mfxhfz1h.js} +1 -1
- package/dist/client/static/js/{ImageView-460th5qa.js → ImageView-bxqw3t4k.js} +1 -1
- package/dist/client/static/js/{LayoutWrapper-5cv0dty8.js → LayoutWrapper-zt14rv9m.js} +2 -2
- package/dist/client/static/js/{Modal-wks6p4r5.js → Modal-cm35g20x.js} +10 -10
- package/dist/client/static/js/{PdfView-y51g03nr.js → PdfView-bek8k888.js} +1 -1
- package/dist/client/static/js/{SessionsView-rsmvn7ks.js → SessionsView-gn53zyn7.js} +1 -1
- package/dist/client/static/js/{SheetView-z7yvb05v.js → SheetView-vezssf6b.js} +1 -1
- package/dist/client/static/js/{SvgPreview-yehgzhem.js → SvgPreview-f1qaw73k.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-6zxpcy8b.js → abnfDiagram-O67JEVCF-4qn94h52.js} +1 -1
- package/dist/client/static/js/architecture-7GRP2DOG-cagtcfhk.js +1 -0
- package/dist/client/static/js/{architectureDiagram-NJMV4G6O-m98sgh3c.js → architectureDiagram-NJMV4G6O-tbewzdya.js} +3 -3
- package/dist/client/static/js/{blockDiagram-BEXU5L5S-cp7rervg.js → blockDiagram-BEXU5L5S-njgnwckz.js} +2 -2
- package/dist/client/static/js/{c4Diagram-YGBWAQC7-t31recqm.js → c4Diagram-YGBWAQC7-f58pcvbk.js} +1 -1
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-fy8x3dkx.js → classDiagram-v2-NBCMYWYE-52g73vyw.js} +3 -3
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-va7ybm9e.js → cose-bilkent-JH36ORCC-ptdnshzh.js} +1 -1
- package/dist/client/static/js/cynefin-OW5HDTMX-6g2ydrss.js +1 -0
- package/dist/client/static/js/{cynefinDiagram-VND7K2PF-4k0k429c.js → cynefinDiagram-VND7K2PF-qabfdkzr.js} +1 -1
- package/dist/client/static/js/{dagre-6A5THRUB-ykdhxq6t.js → dagre-6A5THRUB-kyf5jetf.js} +2 -2
- package/dist/client/static/js/{diagram-22UHCM2B-5nvwx7b6.js → diagram-22UHCM2B-bxrsjtv9.js} +4 -4
- package/dist/client/static/js/{diagram-3UASUU5V-hc7zsjgw.js → diagram-3UASUU5V-0f41s00j.js} +1 -1
- package/dist/client/static/js/{diagram-ATOU4E4O-97ae07y7.js → diagram-ATOU4E4O-0z1zx9h1.js} +1 -1
- package/dist/client/static/js/{diagram-CDSNMT55-b56nnbbs.js → diagram-CDSNMT55-znrmr6bk.js} +3 -3
- package/dist/client/static/js/{diagram-MLGK6HIB-37rygr9k.js → diagram-MLGK6HIB-jfe2jhk0.js} +1 -1
- package/dist/client/static/js/{diagram-MPIPVDR6-wv3vhhfk.js → diagram-MPIPVDR6-2kaawmwa.js} +1 -1
- package/dist/client/static/js/{dockerfile-0efb1z6e.js → dockerfile-12exatm9.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-13fv7vxg.js → ebnfDiagram-ZINNZB2B-s5n37rfp.js} +1 -1
- package/dist/client/static/js/{elixir-mabagxwa.js → elixir-szk51ehr.js} +1 -1
- package/dist/client/static/js/{elk-276RUBZZ-xam60ktz.js → elk-276RUBZZ-433rd9fp.js} +1 -1
- package/dist/client/static/js/{erDiagram-OPXOYQCR-24ctv2ee.js → erDiagram-OPXOYQCR-key6ah0b.js} +2 -2
- package/dist/client/static/js/eventmodeling-NTZA5JFV-b774qbn2.js +1 -0
- package/dist/client/static/js/flowDiagram-KWPJA3E3-nznq0n36.js +1 -0
- package/dist/client/static/js/{ganttDiagram-FUAMR5RP-766a8fqw.js → ganttDiagram-FUAMR5RP-4efkhmca.js} +2 -2
- package/dist/client/static/js/gitGraph-4MIJSDKK-b047d6vk.js +1 -0
- package/dist/client/static/js/{gitGraphDiagram-X574FWY7-fmwjkgh6.js → gitGraphDiagram-X574FWY7-ac376y2k.js} +1 -1
- package/dist/client/static/js/html-tbz83eke.js +1 -0
- package/dist/client/static/js/{index-13xbwcbz.js → index-02543wk3.js} +1 -1
- package/dist/client/static/js/{index-sx809d6d.js → index-0e9nkc0g.js} +1 -1
- package/dist/client/static/js/{index-1c0pnsjd.js → index-0gbj4270.js} +1 -1
- package/dist/client/static/js/{index-z6kpc98a.js → index-0pabfaac.js} +1 -1
- package/dist/client/static/js/{index-4mstdh41.js → index-1t5ybx9v.js} +1 -1
- package/dist/client/static/js/{index-9vdbnvmk.js → index-1y3rzw6b.js} +1 -1
- package/dist/client/static/js/{index-qj34r6d0.js → index-38xv8h4t.js} +1 -1
- package/dist/client/static/js/{index-4j8rgr4p.js → index-50mdqev0.js} +1 -1
- package/dist/client/static/js/{index-zvazj4va.js → index-5jnvz9hw.js} +1 -1
- package/dist/client/static/js/{index-97qst4k9.js → index-77t0nvt1.js} +1 -1
- package/dist/client/static/js/{index-x7f5ysch.js → index-7a2efrbj.js} +1 -1
- package/dist/client/static/js/{index-yvxa7hd8.js → index-82vk27q1.js} +1 -1
- package/dist/client/static/js/{index-nbexks3x.js → index-8k7vjp8b.js} +1 -1
- package/dist/client/static/js/{index-sq3r1xhf.js → index-8kbp24xg.js} +1 -1
- package/dist/client/static/js/{index-zjydzxhm.js → index-b0v6gwym.js} +2 -2
- package/dist/client/static/js/{index-grczkttn.js → index-b42t14wk.js} +7 -7
- package/dist/client/static/js/{index-13dr1t1r.js → index-cz50ha6x.js} +23 -23
- package/dist/client/static/js/{index-8jqawh3r.js → index-dtj73vs1.js} +1 -1
- package/dist/client/static/js/{index-7t63akyt.js → index-dzmar8jr.js} +1 -1
- package/dist/client/static/js/{index-2x9eqztp.js → index-f33c4paw.js} +1 -1
- package/dist/client/static/js/{index-xxe52zrm.js → index-fb6pw9xb.js} +1 -1
- package/dist/client/static/js/{index-6ge6gk9w.js → index-gp57dx2v.js} +1 -1
- package/dist/client/static/js/{index-2hpy58d0.js → index-gsxebrq9.js} +2 -2
- package/dist/client/static/js/{index-czagykbq.js → index-pxtff3ez.js} +2 -2
- package/dist/client/static/js/{index-8hgm0abr.js → index-pzvr1699.js} +187 -183
- package/dist/client/static/js/{index-dydwcp3n.js → index-r9db1gsf.js} +1 -1
- package/dist/client/static/js/{index-b4y5g48d.js → index-raca8tsh.js} +1 -1
- package/dist/client/static/js/{index-95en3p3g.js → index-rf29f3fq.js} +4 -4
- package/dist/client/static/js/{index-sz3mxjvy.js → index-s4gv0rpk.js} +1 -1
- package/dist/client/static/js/{index-a9t9gdew.js → index-v3f7we4n.js} +4 -4
- package/dist/client/static/js/{index-ejdnjh5c.js → index-yjmm73jm.js} +1 -1
- package/dist/client/static/js/{index-1rxa9zxp.js → index-ykfd2fyj.js} +1 -1
- package/dist/client/static/js/{index-4z4ax55k.js → index-yzda8j2d.js} +6 -6
- package/dist/client/static/js/{index-vcn1kcpy.js → index-z78bzryw.js} +3 -3
- package/dist/client/static/js/{index-tqycj126.js → index-zndbhb9w.js} +1 -1
- package/dist/client/static/js/{index-ka2rc2cr.js → index-zs73zwjz.js} +3 -3
- package/dist/client/static/js/{index-xe5cqwnf.js → index-zs7sjv6x.js} +1 -1
- package/dist/client/static/js/{index-hzwr5fm9.js → index-zw621xez.js} +3 -3
- package/dist/client/static/js/info-A6RAGUB7-n495k952.js +1 -0
- package/dist/client/static/js/{infoDiagram-VRGFBTTK-tqytmzp1.js → infoDiagram-VRGFBTTK-4e7ej63f.js} +2 -2
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-rp77ff6m.js → ishikawaDiagram-OU5B5YK6-k3yet1ec.js} +2 -2
- package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-c7bxrhf1.js → journeyDiagram-ZHPQQLJL-qe352kyd.js} +2 -2
- package/dist/client/static/js/{kanban-definition-PNTS6WVX-j2pxewqq.js → kanban-definition-PNTS6WVX-58hag75n.js} +4 -4
- package/dist/client/static/js/{mermaid.core-cqqe1krg.js → mermaid.core-6e89h6vm.js} +2 -2
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-s03k32p9.js → mindmap-definition-NLK3R4M7-ncsam2fm.js} +1 -1
- package/dist/client/static/js/one-dark-pro-qmyne0tn.js +1 -0
- package/dist/client/static/js/one-light-dj0ecjcj.js +1 -0
- package/dist/client/static/js/packet-AYTQ26CC-zajj62z6.js +1 -0
- package/dist/client/static/js/{pegDiagram-GJSIUBJH-dfg2j0zc.js → pegDiagram-GJSIUBJH-b5ckc39d.js} +1 -1
- package/dist/client/static/js/{perl-5vxax0nr.js → perl-dtn1fccw.js} +1 -1
- package/dist/client/static/js/{php-hgrgdq63.js → php-7av78hch.js} +1 -1
- package/dist/client/static/js/pie-WAS4IAKB-1ve78y5f.js +1 -0
- package/dist/client/static/js/{pieDiagram-5QR66LMP-pshd1j79.js → pieDiagram-5QR66LMP-s4d47ve8.js} +2 -2
- package/dist/client/static/js/{quadrantDiagram-O4NWA36T-cvvvmtk2.js → quadrantDiagram-O4NWA36T-zm0ekvjz.js} +1 -1
- package/dist/client/static/js/radar-RG4KPBEZ-8rqadb58.js +1 -0
- package/dist/client/static/js/railroad-74A4TZTK-v6ppm8dy.js +1 -0
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-9j6bae14.js +1 -0
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-56cpyt0g.js +1 -0
- package/dist/client/static/js/railroad-peg-WCYAUIDC-yfdmspf4.js +1 -0
- package/dist/client/static/js/{railroadDiagram-XR7U4H2S-h53p3sha.js → railroadDiagram-XR7U4H2S-52vdqf53.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-bdv2fkxd.js → requirementDiagram-PLB6GJNP-7kf8bmk9.js} +1 -1
- package/dist/client/static/js/{ruby-8pxcn21w.js → ruby-s2bqr910.js} +1 -1
- package/dist/client/static/js/{rust-j80dxgjg.js → rust-q98kssv3.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-xqnnvmhy.js → sankeyDiagram-IPEJSGJF-bcb9f54a.js} +1 -1
- package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-3p67305f.js → sequenceDiagram-PO4LG4MO-76ywvj7g.js} +3 -3
- package/dist/client/static/js/{sizeCapture-INFHLROL-f87525h7.js → sizeCapture-INFHLROL-p9bsf5dc.js} +1 -1
- package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-e5st1fy3.js → stateDiagram-v2-GCMORJYK-1ecfb3fs.js} +1 -1
- package/dist/client/static/js/{swimlanes-2SLR337P-ceghkbez.js → swimlanes-2SLR337P-2pyjr946.js} +1 -1
- package/dist/client/static/js/{swimlanesDiagram-TC7HE7FX-vc8hvfya.js → swimlanesDiagram-TC7HE7FX-qr5hdxm4.js} +1 -1
- package/dist/client/static/js/{timeline-definition-EJHVYXUP-f7evs443.js → timeline-definition-EJHVYXUP-4csxwmn2.js} +3 -3
- package/dist/client/static/js/treeView-Q6P3EWNA-vwpg3wp8.js +1 -0
- package/dist/client/static/js/treemap-WGGIJYW6-htfxwd32.js +1 -0
- package/dist/client/static/js/{usecaseDiagram-POWQR4AR-0gpn21p7.js → usecaseDiagram-POWQR4AR-0p1jnbsn.js} +7 -7
- package/dist/client/static/js/{vennDiagram-UO4OBE2U-4spzy428.js → vennDiagram-UO4OBE2U-y1hgdet4.js} +2 -2
- package/dist/client/static/js/{vue-xm1dxpmy.js → vue-cbqm4bed.js} +1 -1
- package/dist/client/static/js/wardley-WFR3VGLG-hapfjkzq.js +1 -0
- package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-745xr2pa.js → wardleyDiagram-VNRHLVJA-p578yrgm.js} +2 -2
- package/dist/client/static/js/{xychartDiagram-PMCCYNJV-7dr9qwx5.js → xychartDiagram-PMCCYNJV-b08b4ah0.js} +3 -3
- package/package.json +1 -1
- package/src/cli/lib/commands/session.js +12 -1
- package/src/client/components/workspace/chat-timeline/MessageItem.tsx +14 -123
- package/src/client/components/workspace/chat-timeline/OrchestrationNotice.tsx +214 -0
- package/src/client/components/workspace/chat-timeline/UserTurn.test.tsx +126 -0
- package/src/client/components/workspace/chat-timeline/UserTurn.tsx +183 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ToolBody.tsx +3 -3
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ToolRowActions.tsx +45 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/tool-view.ts +14 -4
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Card.tsx +2 -12
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Compact.tsx +42 -38
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Minimal.tsx +25 -21
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Trace.tsx +41 -29
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Tui.tsx +47 -43
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/parity.test.tsx +136 -0
- package/src/client/hooks/chat/timeline/composer-modes.ts +10 -7
- package/src/client/hooks/chat/timeline/plan-review-republish.test.ts +121 -0
- package/src/client/hooks/chat/timeline/plan-review.ts +12 -3
- package/src/server/lib/harness/acp/acp-audit.server.ts +1 -1
- package/src/server/lib/harness/acp/session-exit.ts +39 -5
- package/src/server/lib/harness/acp/session-turns.ts +67 -12
- package/src/server/lib/harness/acp/session.test.ts +61 -0
- package/src/server/lib/harness/acp/session.ts +15 -25
- package/src/server/lib/harness/acp/turn-outcome.server.test.ts +97 -0
- package/src/server/lib/harness/acp/turn-outcome.server.ts +71 -0
- package/src/server/lib/harness/acp/turn-silence.ts +52 -0
- package/src/server/lib/harness/acp/turn.test.ts +85 -3
- package/src/server/lib/harness/acp/turn.ts +62 -4
- package/src/server/lib/lifecycle/after-listen.ts +10 -0
- package/src/server/lib/omp/rpc/frame-fold-contract.ts +21 -0
- package/src/server/lib/omp/rpc/frame-fold-host.test-util.ts +4 -0
- package/src/server/lib/omp/rpc/frame-fold.ts +25 -2
- package/src/server/lib/omp/rpc/manager.ts +9 -8
- package/src/server/lib/omp/rpc/retry-saga.ts +54 -0
- package/src/server/lib/omp/rpc/run-settle.server.ts +38 -5
- package/src/server/lib/omp/rpc/run-settle.test.ts +5 -2
- package/src/server/lib/omp/rpc/session-commands-dialog.test.ts +6 -20
- package/src/server/lib/omp/rpc/session-commands-mapping.test.ts +131 -0
- package/src/server/lib/omp/rpc/session-commands.test.ts +95 -116
- package/src/server/lib/omp/rpc/session-commands.ts +38 -17
- package/src/server/lib/omp/rpc/terminal-settle.test.ts +223 -0
- package/src/server/lib/omp/rpc/terminal-settle.ts +127 -29
- package/src/server/lib/omp/session/scan.ts +15 -2
- package/src/server/lib/omp/session/session-discovery.test.ts +21 -0
- package/src/server/lib/sessions/notify.server.test.ts +11 -3
- package/src/server/lib/sessions/notify.server.ts +67 -42
- package/src/server/lib/sessions/spawn.server.test.ts +5 -1
- package/src/server/lib/sessions/spawn.server.ts +8 -3
- package/src/server/routes/sessions/answer.test.ts +62 -0
- package/src/server/routes/sessions/answer.ts +13 -2
- package/src/shared/lib/chat/composer/delegation.ts +11 -7
- package/src/shared/lib/chat/export-markdown.ts +19 -0
- package/src/shared/lib/chat/orchestration/notice.test.ts +118 -0
- package/src/shared/lib/chat/orchestration/notice.ts +183 -0
- package/src/shared/lib/chat/timeline/omp-callbacks.ts +6 -1
- package/src/shared/lib/chat/timeline/tool-render-mode.ts +3 -3
- package/src/shared/lib/icons/tint-hues.generated.ts +36 -36
- package/src/shared/lib/omp/session/operator-title.test.ts +21 -0
- package/src/shared/lib/omp/session/operator-title.ts +28 -0
- package/dist/client/static/js/architecture-7GRP2DOG-9q06651f.js +0 -1
- package/dist/client/static/js/cynefin-OW5HDTMX-w7a38g4g.js +0 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-6wrjccyw.js +0 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-19vjkg84.js +0 -1
- package/dist/client/static/js/gitGraph-4MIJSDKK-4je2p50v.js +0 -1
- package/dist/client/static/js/html-bwyt0ayy.js +0 -1
- package/dist/client/static/js/info-A6RAGUB7-k0z5qdew.js +0 -1
- package/dist/client/static/js/one-dark-pro-9tt0a020.js +0 -1
- package/dist/client/static/js/one-light-5fg4r0ra.js +0 -1
- package/dist/client/static/js/packet-AYTQ26CC-6cnvmb2z.js +0 -1
- package/dist/client/static/js/pie-WAS4IAKB-m9z1mztn.js +0 -1
- package/dist/client/static/js/radar-RG4KPBEZ-8m9rkex6.js +0 -1
- package/dist/client/static/js/railroad-74A4TZTK-wc55emj8.js +0 -1
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-2y2rnrzq.js +0 -1
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-zzcc9x0v.js +0 -1
- package/dist/client/static/js/railroad-peg-WCYAUIDC-z82na5nb.js +0 -1
- package/dist/client/static/js/treeView-Q6P3EWNA-kzh6cm3f.js +0 -1
- package/dist/client/static/js/treemap-WGGIJYW6-wz5ed560.js +0 -1
- package/dist/client/static/js/wardley-WFR3VGLG-zewbfccz.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{be}from"./index-9vdbnvmk.js";import{t,l,V,C,ee,$r,R,F,z,P,U,q,j,p,h,ue,zf,Fi,lr,se,wn,on}from"./index-13dr1t1r.js";import{De}from"./index-grczkttn.js";import{Pr}from"./index-qsw5edtk.js";import{mn,Bn}from"./index-czagykbq.js";var Re=Bn(function(me,Ie){(function(I,A){if(typeof me==="object"&&typeof Ie==="object")Ie.exports=A();else if(typeof define==="function"&&define.amd)define([],A);else if(typeof me==="object")me.layoutBase=A();else I.layoutBase=A()})(me,function(){return function(w){var I={};function A(v){if(I[v])return I[v].exports;var f=I[v]={i:v,l:!1,exports:{}};return w[v].call(f.exports,f,f.exports,A),f.l=!0,f.exports}return A.m=w,A.c=I,A.i=function(v){return v},A.d=function(v,f,o){if(!A.o(v,f))Object.defineProperty(v,f,{configurable:!1,enumerable:!0,get:o})},A.n=function(v){var f=v&&v.__esModule?function(){return v.default}:function(){return v};return A.d(f,"a",f),f},A.o=function(v,f){return Object.prototype.hasOwnProperty.call(v,f)},A.p="",A(A.s=28)}([function(w,I,A){function v(){}v.QUALITY=1,v.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,v.DEFAULT_INCREMENTAL=!1,v.DEFAULT_ANIMATION_ON_LAYOUT=!0,v.DEFAULT_ANIMATION_DURING_LAYOUT=!1,v.DEFAULT_ANIMATION_PERIOD=50,v.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,v.DEFAULT_GRAPH_MARGIN=15,v.NODE_DIMENSIONS_INCLUDE_LABELS=!1,v.SIMPLE_NODE_SIZE=40,v.SIMPLE_NODE_HALF_SIZE=v.SIMPLE_NODE_SIZE/2,v.EMPTY_COMPOUND_NODE_SIZE=40,v.MIN_EDGE_LENGTH=1,v.WORLD_BOUNDARY=1e6,v.INITIAL_WORLD_BOUNDARY=v.WORLD_BOUNDARY/1000,v.WORLD_CENTER_X=1200,v.WORLD_CENTER_Y=900,w.exports=v},function(w,I,A){var v=A(2),f=A(8),o=A(9);function n(u,r,y){v.call(this,y),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=y,this.bendpoints=[],this.source=u,this.target=r}n.prototype=Object.create(v.prototype);for(var a in v)n[a]=v[a];n.prototype.getSource=function(){return this.source},n.prototype.getTarget=function(){return this.target},n.prototype.isInterGraph=function(){return this.isInterGraph},n.prototype.getLength=function(){return this.length},n.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},n.prototype.getBendpoints=function(){return this.bendpoints},n.prototype.getLca=function(){return this.lca},n.prototype.getSourceInLca=function(){return this.sourceInLca},n.prototype.getTargetInLca=function(){return this.targetInLca},n.prototype.getOtherEnd=function(u){if(this.source===u)return this.target;else if(this.target===u)return this.source;else throw"Node is not incident with this edge"},n.prototype.getOtherEndInGraph=function(u,r){var y=this.getOtherEnd(u),i=r.getGraphManager().getRoot();while(!0){if(y.getOwner()==r)return y;if(y.getOwner()==i)break;y=y.getOwner().getParent()}return null},n.prototype.updateLength=function(){var u=[,,,,];if(this.isOverlapingSourceAndTarget=f.getIntersection(this.target.getRect(),this.source.getRect(),u),!this.isOverlapingSourceAndTarget){if(this.lengthX=u[0]-u[2],this.lengthY=u[1]-u[3],Math.abs(this.lengthX)<1)this.lengthX=o.sign(this.lengthX);if(Math.abs(this.lengthY)<1)this.lengthY=o.sign(this.lengthY);this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)}},n.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=o.sign(this.lengthX);if(Math.abs(this.lengthY)<1)this.lengthY=o.sign(this.lengthY);this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},w.exports=n},function(w,I,A){function v(f){this.vGraphObject=f}w.exports=v},function(w,I,A){var v=A(2),f=A(10),o=A(13),n=A(0),a=A(16),u=A(5);function r(i,e,g,d){if(g==null&&d==null)d=e;if(v.call(this,d),i.graphManager!=null)i=i.graphManager;if(this.estimatedSize=f.MIN_VALUE,this.inclusionTreeDepth=f.MAX_VALUE,this.vGraphObject=d,this.edges=[],this.graphManager=i,g!=null&&e!=null)this.rect=new o(e.x,e.y,g.width,g.height);else this.rect=new o}r.prototype=Object.create(v.prototype);for(var y in v)r[y]=v[y];r.prototype.getEdges=function(){return this.edges},r.prototype.getChild=function(){return this.child},r.prototype.getOwner=function(){return this.owner},r.prototype.getWidth=function(){return this.rect.width},r.prototype.setWidth=function(i){this.rect.width=i},r.prototype.getHeight=function(){return this.rect.height},r.prototype.setHeight=function(i){this.rect.height=i},r.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},r.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},r.prototype.getCenter=function(){return new u(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},r.prototype.getLocation=function(){return new u(this.rect.x,this.rect.y)},r.prototype.getRect=function(){return this.rect},r.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},r.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},r.prototype.setRect=function(i,e){this.rect.x=i.x,this.rect.y=i.y,this.rect.width=e.width,this.rect.height=e.height},r.prototype.setCenter=function(i,e){this.rect.x=i-this.rect.width/2,this.rect.y=e-this.rect.height/2},r.prototype.setLocation=function(i,e){this.rect.x=i,this.rect.y=e},r.prototype.moveBy=function(i,e){this.rect.x+=i,this.rect.y+=e},r.prototype.getEdgeListToNode=function(i){var e=[],g,d=this;return d.edges.forEach(function(c){if(c.target==i){if(c.source!=d)throw"Incorrect edge source!";e.push(c)}}),e},r.prototype.getEdgesBetween=function(i){var e=[],g,d=this;return d.edges.forEach(function(c){if(!(c.source==d||c.target==d))throw"Incorrect edge source and/or target";if(c.target==i||c.source==i)e.push(c)}),e},r.prototype.getNeighborsList=function(){var i=new Set,e=this;return e.edges.forEach(function(g){if(g.source==e)i.add(g.target);else{if(g.target!=e)throw"Incorrect incidency!";i.add(g.source)}}),i},r.prototype.withChildren=function(){var i=new Set,e,g;if(i.add(this),this.child!=null){var d=this.child.getNodes();for(var c=0;c<d.length;c++)e=d[c],g=e.withChildren(),g.forEach(function(O){i.add(O)})}return i},r.prototype.getNoOfChildren=function(){var i=0,e;if(this.child==null)i=1;else{var g=this.child.getNodes();for(var d=0;d<g.length;d++)e=g[d],i+=e.getNoOfChildren()}if(i==0)i=1;return i},r.prototype.getEstimatedSize=function(){if(this.estimatedSize==f.MIN_VALUE)throw"assert failed";return this.estimatedSize},r.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},r.prototype.scatter=function(){var i,e,g=-n.INITIAL_WORLD_BOUNDARY,d=n.INITIAL_WORLD_BOUNDARY;i=n.WORLD_CENTER_X+a.nextDouble()*(d-g)+g;var c=-n.INITIAL_WORLD_BOUNDARY,O=n.INITIAL_WORLD_BOUNDARY;e=n.WORLD_CENTER_Y+a.nextDouble()*(O-c)+c,this.rect.x=i,this.rect.y=e},r.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var i=this.getChild();if(i.updateBounds(!0),this.rect.x=i.getLeft(),this.rect.y=i.getTop(),this.setWidth(i.getRight()-i.getLeft()),this.setHeight(i.getBottom()-i.getTop()),n.NODE_DIMENSIONS_INCLUDE_LABELS){var e=i.getRight()-i.getLeft(),g=i.getBottom()-i.getTop();if(this.labelWidth){if(this.labelPosHorizontal=="left")this.rect.x-=this.labelWidth,this.setWidth(e+this.labelWidth);else if(this.labelPosHorizontal=="center"&&this.labelWidth>e)this.rect.x-=(this.labelWidth-e)/2,this.setWidth(this.labelWidth);else if(this.labelPosHorizontal=="right")this.setWidth(e+this.labelWidth)}if(this.labelHeight){if(this.labelPosVertical=="top")this.rect.y-=this.labelHeight,this.setHeight(g+this.labelHeight);else if(this.labelPosVertical=="center"&&this.labelHeight>g)this.rect.y-=(this.labelHeight-g)/2,this.setHeight(this.labelHeight);else if(this.labelPosVertical=="bottom")this.setHeight(g+this.labelHeight)}}}},r.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==f.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},r.prototype.transform=function(i){var e=this.rect.x;if(e>n.WORLD_BOUNDARY)e=n.WORLD_BOUNDARY;else if(e<-n.WORLD_BOUNDARY)e=-n.WORLD_BOUNDARY;var g=this.rect.y;if(g>n.WORLD_BOUNDARY)g=n.WORLD_BOUNDARY;else if(g<-n.WORLD_BOUNDARY)g=-n.WORLD_BOUNDARY;var d=new u(e,g),c=i.inverseTransformPoint(d);this.setLocation(c.x,c.y)},r.prototype.getLeft=function(){return this.rect.x},r.prototype.getRight=function(){return this.rect.x+this.rect.width},r.prototype.getTop=function(){return this.rect.y},r.prototype.getBottom=function(){return this.rect.y+this.rect.height},r.prototype.getParent=function(){if(this.owner==null)return null;return this.owner.getParent()},w.exports=r},function(w,I,A){var v=A(0);function f(){}for(var o in v)f[o]=v[o];f.MAX_ITERATIONS=2500,f.DEFAULT_EDGE_LENGTH=50,f.DEFAULT_SPRING_STRENGTH=0.45,f.DEFAULT_REPULSION_STRENGTH=4500,f.DEFAULT_GRAVITY_STRENGTH=0.4,f.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,f.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,f.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,f.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,f.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,f.DEFAULT_COOLING_FACTOR_INCREMENTAL=0.3,f.COOLING_ADAPTATION_FACTOR=0.33,f.ADAPTATION_LOWER_NODE_LIMIT=1000,f.ADAPTATION_UPPER_NODE_LIMIT=5000,f.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,f.MAX_NODE_DISPLACEMENT=f.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,f.MIN_REPULSION_DIST=f.DEFAULT_EDGE_LENGTH/10,f.CONVERGENCE_CHECK_PERIOD=100,f.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=0.1,f.MIN_EDGE_LENGTH=1,f.GRID_CALCULATION_CHECK_PERIOD=10,w.exports=f},function(w,I,A){function v(f,o){if(f==null&&o==null)this.x=0,this.y=0;else this.x=f,this.y=o}v.prototype.getX=function(){return this.x},v.prototype.getY=function(){return this.y},v.prototype.setX=function(f){this.x=f},v.prototype.setY=function(f){this.y=f},v.prototype.getDifference=function(f){return new DimensionD(this.x-f.x,this.y-f.y)},v.prototype.getCopy=function(){return new v(this.x,this.y)},v.prototype.translate=function(f){return this.x+=f.width,this.y+=f.height,this},w.exports=v},function(w,I,A){var v=A(2),f=A(10),o=A(0),n=A(7),a=A(3),u=A(1),r=A(13),y=A(12),i=A(11);function e(d,c,O){if(v.call(this,O),this.estimatedSize=f.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=d,c!=null&&c instanceof n)this.graphManager=c;else if(c!=null&&c instanceof Layout)this.graphManager=c.graphManager}e.prototype=Object.create(v.prototype);for(var g in v)e[g]=v[g];e.prototype.getNodes=function(){return this.nodes},e.prototype.getEdges=function(){return this.edges},e.prototype.getGraphManager=function(){return this.graphManager},e.prototype.getParent=function(){return this.parent},e.prototype.getLeft=function(){return this.left},e.prototype.getRight=function(){return this.right},e.prototype.getTop=function(){return this.top},e.prototype.getBottom=function(){return this.bottom},e.prototype.isConnected=function(){return this.isConnected},e.prototype.add=function(d,c,O){if(c==null&&O==null){var T=d;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(T)>-1)throw"Node already in graph!";return T.owner=this,this.getNodes().push(T),T}else{var N=d;if(!(this.getNodes().indexOf(c)>-1&&this.getNodes().indexOf(O)>-1))throw"Source or target not in graph!";if(!(c.owner==O.owner&&c.owner==this))throw"Both owners must be this graph!";if(c.owner!=O.owner)return null;if(N.source=c,N.target=O,N.isInterGraph=!1,this.getEdges().push(N),c.edges.push(N),O!=c)O.edges.push(N);return N}},e.prototype.remove=function(d){var c=d;if(d instanceof a){if(c==null)throw"Node is null!";if(!(c.owner!=null&&c.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";var O=c.edges.slice(),T,N=O.length;for(var D=0;D<N;D++)if(T=O[D],T.isInterGraph)this.graphManager.remove(T);else T.source.owner.remove(T);var X=this.nodes.indexOf(c);if(X==-1)throw"Node not in owner node list!";this.nodes.splice(X,1)}else if(d instanceof u){var T=d;if(T==null)throw"Edge is null!";if(!(T.source!=null&&T.target!=null))throw"Source and/or target is null!";if(!(T.source.owner!=null&&T.target.owner!=null&&T.source.owner==this&&T.target.owner==this))throw"Source and/or target owner is invalid!";var x=T.source.edges.indexOf(T),W=T.target.edges.indexOf(T);if(!(x>-1&&W>-1))throw"Source and/or target doesn't know this edge!";if(T.source.edges.splice(x,1),T.target!=T.source)T.target.edges.splice(W,1);var X=T.source.owner.getEdges().indexOf(T);if(X==-1)throw"Not in owner's edge list!";T.source.owner.getEdges().splice(X,1)}},e.prototype.updateLeftTop=function(){var{MAX_VALUE:d,MAX_VALUE:c}=f,O,T,N,D=this.getNodes(),X=D.length;for(var x=0;x<X;x++){var W=D[x];if(O=W.getTop(),T=W.getLeft(),d>O)d=O;if(c>T)c=T}if(d==f.MAX_VALUE)return null;if(D[0].getParent().paddingLeft!=null)N=D[0].getParent().paddingLeft;else N=this.margin;return this.left=c-N,this.top=d-N,new y(this.left,this.top)},e.prototype.updateBounds=function(d){var c=f.MAX_VALUE,O=-f.MAX_VALUE,T=f.MAX_VALUE,N=-f.MAX_VALUE,D,X,x,W,_,Q=this.nodes,lt=Q.length;for(var G=0;G<lt;G++){var tt=Q[G];if(d&&tt.child!=null)tt.updateBounds();if(D=tt.getLeft(),X=tt.getRight(),x=tt.getTop(),W=tt.getBottom(),c>D)c=D;if(O<X)O=X;if(T>x)T=x;if(N<W)N=W}var s=new r(c,T,O-c,N-T);if(c==f.MAX_VALUE)this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom();if(Q[0].getParent().paddingLeft!=null)_=Q[0].getParent().paddingLeft;else _=this.margin;this.left=s.x-_,this.right=s.x+s.width+_,this.top=s.y-_,this.bottom=s.y+s.height+_},e.calculateBounds=function(d){var c=f.MAX_VALUE,O=-f.MAX_VALUE,T=f.MAX_VALUE,N=-f.MAX_VALUE,D,X,x,W,_=d.length;for(var Q=0;Q<_;Q++){var lt=d[Q];if(D=lt.getLeft(),X=lt.getRight(),x=lt.getTop(),W=lt.getBottom(),c>D)c=D;if(O<X)O=X;if(T>x)T=x;if(N<W)N=W}var G=new r(c,T,O-c,N-T);return G},e.prototype.getInclusionTreeDepth=function(){if(this==this.graphManager.getRoot())return 1;else return this.parent.getInclusionTreeDepth()},e.prototype.getEstimatedSize=function(){if(this.estimatedSize==f.MIN_VALUE)throw"assert failed";return this.estimatedSize},e.prototype.calcEstimatedSize=function(){var d=0,c=this.nodes,O=c.length;for(var T=0;T<O;T++){var N=c[T];d+=N.calcEstimatedSize()}if(d==0)this.estimatedSize=o.EMPTY_COMPOUND_NODE_SIZE;else this.estimatedSize=d/Math.sqrt(this.nodes.length);return this.estimatedSize},e.prototype.updateConnected=function(){var d=this;if(this.nodes.length==0){this.isConnected=!0;return}var c=new i,O=new Set,T=this.nodes[0],N,D,X=T.withChildren();X.forEach(function(G){c.push(G),O.add(G)});while(c.length!==0){T=c.shift(),N=T.getEdges();var x=N.length;for(var W=0;W<x;W++){var _=N[W];if(D=_.getOtherEndInGraph(T,this),D!=null&&!O.has(D)){var Q=D.withChildren();Q.forEach(function(G){c.push(G),O.add(G)})}}}if(this.isConnected=!1,O.size>=this.nodes.length){var lt=0;if(O.forEach(function(G){if(G.owner==d)lt++}),lt==this.nodes.length)this.isConnected=!0}},w.exports=e},function(w,I,A){var v,f=A(1);function o(n){v=A(6),this.layout=n,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var n=this.layout.newGraph(),a=this.layout.newNode(null),u=this.add(n,a);return this.setRootGraph(u),this.rootGraph},o.prototype.add=function(n,a,u,r,y){if(u==null&&r==null&&y==null){if(n==null)throw"Graph is null!";if(a==null)throw"Parent node is null!";if(this.graphs.indexOf(n)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(n),n.parent!=null)throw"Already has a parent!";if(a.child!=null)throw"Already has a child!";return n.parent=a,a.child=n,n}else{y=u,r=a,u=n;var i=r.getOwner(),e=y.getOwner();if(!(i!=null&&i.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(e!=null&&e.getGraphManager()==this))throw"Target not in this graph mgr!";if(i==e)return u.isInterGraph=!1,i.add(u,r,y);else{if(u.isInterGraph=!0,u.source=r,u.target=y,this.edges.indexOf(u)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(u),!(u.source!=null&&u.target!=null))throw"Edge source and/or target is null!";if(!(u.source.edges.indexOf(u)==-1&&u.target.edges.indexOf(u)==-1))throw"Edge already in source and/or target incidency list!";return u.source.edges.push(u),u.target.edges.push(u),u}}},o.prototype.remove=function(n){if(n instanceof v){var a=n;if(a.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(a==this.rootGraph||a.parent!=null&&a.parent.graphManager==this))throw"Invalid parent node!";var u=[];u=u.concat(a.getEdges());var r,y=u.length;for(var i=0;i<y;i++)r=u[i],a.remove(r);var e=[];e=e.concat(a.getNodes());var g;y=e.length;for(var i=0;i<y;i++)g=e[i],a.remove(g);if(a==this.rootGraph)this.setRootGraph(null);var d=this.graphs.indexOf(a);this.graphs.splice(d,1),a.parent=null}else if(n instanceof f){if(r=n,r==null)throw"Edge is null!";if(!r.isInterGraph)throw"Not an inter-graph edge!";if(!(r.source!=null&&r.target!=null))throw"Source and/or target is null!";if(!(r.source.edges.indexOf(r)!=-1&&r.target.edges.indexOf(r)!=-1))throw"Source and/or target doesn't know this edge!";var d=r.source.edges.indexOf(r);if(r.source.edges.splice(d,1),d=r.target.edges.indexOf(r),r.target.edges.splice(d,1),!(r.source.owner!=null&&r.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(r.source.owner.getGraphManager().edges.indexOf(r)==-1)throw"Not in owner graph manager's edge list!";var d=r.source.owner.getGraphManager().edges.indexOf(r);r.source.owner.getGraphManager().edges.splice(d,1)}},o.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},o.prototype.getGraphs=function(){return this.graphs},o.prototype.getAllNodes=function(){if(this.allNodes==null){var n=[],a=this.getGraphs(),u=a.length;for(var r=0;r<u;r++)n=n.concat(a[r].getNodes());this.allNodes=n}return this.allNodes},o.prototype.resetAllNodes=function(){this.allNodes=null},o.prototype.resetAllEdges=function(){this.allEdges=null},o.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},o.prototype.getAllEdges=function(){if(this.allEdges==null){var n=[],a=this.getGraphs(),u=a.length;for(var r=0;r<a.length;r++)n=n.concat(a[r].getEdges());n=n.concat(this.edges),this.allEdges=n}return this.allEdges},o.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},o.prototype.setAllNodesToApplyGravitation=function(n){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=n},o.prototype.getRoot=function(){return this.rootGraph},o.prototype.setRootGraph=function(n){if(n.getGraphManager()!=this)throw"Root not in this graph mgr!";if(this.rootGraph=n,n.parent==null)n.parent=this.layout.newNode("Root node")},o.prototype.getLayout=function(){return this.layout},o.prototype.isOneAncestorOfOther=function(n,a){if(!(n!=null&&a!=null))throw"assert failed";if(n==a)return!0;var u=n.getOwner(),r;do{if(r=u.getParent(),r==null)break;if(r==a)return!0;if(u=r.getOwner(),u==null)break}while(!0);u=a.getOwner();do{if(r=u.getParent(),r==null)break;if(r==n)return!0;if(u=r.getOwner(),u==null)break}while(!0);return!1},o.prototype.calcLowestCommonAncestors=function(){var n,a,u,r,y,i=this.getAllEdges(),e=i.length;for(var g=0;g<e;g++){if(n=i[g],a=n.source,u=n.target,n.lca=null,n.sourceInLca=a,n.targetInLca=u,a==u){n.lca=a.getOwner();continue}r=a.getOwner();while(n.lca==null){n.targetInLca=u,y=u.getOwner();while(n.lca==null){if(y==r){n.lca=y;break}if(y==this.rootGraph)break;if(n.lca!=null)throw"assert failed";n.targetInLca=y.getParent(),y=n.targetInLca.getOwner()}if(r==this.rootGraph)break;if(n.lca==null)n.sourceInLca=r.getParent(),r=n.sourceInLca.getOwner()}if(n.lca==null)throw"assert failed"}},o.prototype.calcLowestCommonAncestor=function(n,a){if(n==a)return n.getOwner();var u=n.getOwner();do{if(u==null)break;var r=a.getOwner();do{if(r==null)break;if(r==u)return r;r=r.getParent().getOwner()}while(!0);u=u.getParent().getOwner()}while(!0);return u},o.prototype.calcInclusionTreeDepths=function(n,a){if(n==null&&a==null)n=this.rootGraph,a=1;var u,r=n.getNodes(),y=r.length;for(var i=0;i<y;i++)if(u=r[i],u.inclusionTreeDepth=a,u.child!=null)this.calcInclusionTreeDepths(u.child,a+1)},o.prototype.includesInvalidEdge=function(){var n,a=[],u=this.edges.length;for(var r=0;r<u;r++)if(n=this.edges[r],this.isOneAncestorOfOther(n.source,n.target))a.push(n);for(var r=0;r<a.length;r++)this.remove(a[r]);return!1},w.exports=o},function(w,I,A){var v=A(12);function f(){}f.calcSeparationAmount=function(o,n,a,u){if(!o.intersects(n))throw"assert failed";var r=[,,];if(this.decideDirectionsForOverlappingNodes(o,n,r),a[0]=Math.min(o.getRight(),n.getRight())-Math.max(o.x,n.x),a[1]=Math.min(o.getBottom(),n.getBottom())-Math.max(o.y,n.y),o.getX()<=n.getX()&&o.getRight()>=n.getRight())a[0]+=Math.min(n.getX()-o.getX(),o.getRight()-n.getRight());else if(n.getX()<=o.getX()&&n.getRight()>=o.getRight())a[0]+=Math.min(o.getX()-n.getX(),n.getRight()-o.getRight());if(o.getY()<=n.getY()&&o.getBottom()>=n.getBottom())a[1]+=Math.min(n.getY()-o.getY(),o.getBottom()-n.getBottom());else if(n.getY()<=o.getY()&&n.getBottom()>=o.getBottom())a[1]+=Math.min(o.getY()-n.getY(),n.getBottom()-o.getBottom());var y=Math.abs((n.getCenterY()-o.getCenterY())/(n.getCenterX()-o.getCenterX()));if(n.getCenterY()===o.getCenterY()&&n.getCenterX()===o.getCenterX())y=1;var i=y*a[0],e=a[1]/y;if(a[0]<e)e=a[0];else i=a[1];a[0]=-1*r[0]*(e/2+u),a[1]=-1*r[1]*(i/2+u)},f.decideDirectionsForOverlappingNodes=function(o,n,a){if(o.getCenterX()<n.getCenterX())a[0]=-1;else a[0]=1;if(o.getCenterY()<n.getCenterY())a[1]=-1;else a[1]=1},f.getIntersection2=function(o,n,a){var u=o.getCenterX(),r=o.getCenterY(),y=n.getCenterX(),i=n.getCenterY();if(o.intersects(n))return a[0]=u,a[1]=r,a[2]=y,a[3]=i,!0;var e=o.getX(),g=o.getY(),d=o.getRight(),c=o.getX(),O=o.getBottom(),T=o.getRight(),N=o.getWidthHalf(),D=o.getHeightHalf(),X=n.getX(),x=n.getY(),W=n.getRight(),_=n.getX(),Q=n.getBottom(),lt=n.getRight(),G=n.getWidthHalf(),tt=n.getHeightHalf(),s=!1,L=!1;if(u===y){if(r>i)return a[0]=u,a[1]=g,a[2]=y,a[3]=Q,!1;else if(r<i)return a[0]=u,a[1]=O,a[2]=y,a[3]=x,!1}else if(r===i){if(u>y)return a[0]=e,a[1]=r,a[2]=W,a[3]=i,!1;else if(u<y)return a[0]=d,a[1]=r,a[2]=X,a[3]=i,!1}else{var E=o.height/o.width,M=n.height/n.width,m=(i-r)/(y-u),Y=void 0,b=void 0,k=void 0,B=void 0,H=void 0,st=void 0;if(-E===m)if(u>y)a[0]=c,a[1]=O,s=!0;else a[0]=d,a[1]=g,s=!0;else if(E===m)if(u>y)a[0]=e,a[1]=g,s=!0;else a[0]=T,a[1]=O,s=!0;if(-M===m)if(y>u)a[2]=_,a[3]=Q,L=!0;else a[2]=W,a[3]=x,L=!0;else if(M===m)if(y>u)a[2]=X,a[3]=x,L=!0;else a[2]=lt,a[3]=Q,L=!0;if(s&&L)return!1;if(u>y)if(r>i)Y=this.getCardinalDirection(E,m,4),b=this.getCardinalDirection(M,m,2);else Y=this.getCardinalDirection(-E,m,3),b=this.getCardinalDirection(-M,m,1);else if(r>i)Y=this.getCardinalDirection(-E,m,1),b=this.getCardinalDirection(-M,m,3);else Y=this.getCardinalDirection(E,m,2),b=this.getCardinalDirection(M,m,4);if(!s)switch(Y){case 1:B=g,k=u+-D/m,a[0]=k,a[1]=B;break;case 2:k=T,B=r+N*m,a[0]=k,a[1]=B;break;case 3:B=O,k=u+D/m,a[0]=k,a[1]=B;break;case 4:k=c,B=r+-N*m,a[0]=k,a[1]=B;break}if(!L)switch(b){case 1:st=x,H=y+-tt/m,a[2]=H,a[3]=st;break;case 2:H=lt,st=i+G*m,a[2]=H,a[3]=st;break;case 3:st=Q,H=y+tt/m,a[2]=H,a[3]=st;break;case 4:H=_,st=i+-G*m,a[2]=H,a[3]=st;break}}return!1},f.getCardinalDirection=function(o,n,a){if(o>n)return a;else return 1+a%4},f.getIntersection=function(o,n,a,u){if(u==null)return this.getIntersection2(o,n,a);var{x:r,y}=o,{x:i,y:e}=n,{x:g,y:d}=a,{x:c,y:O}=u,T=void 0,N=void 0,D=void 0,X=void 0,x=void 0,W=void 0,_=void 0,Q=void 0,lt=void 0;if(D=e-y,x=r-i,_=i*y-r*e,X=O-d,W=g-c,Q=c*d-g*O,lt=D*W-X*x,lt===0)return null;return T=(x*Q-W*_)/lt,N=(X*_-D*Q)/lt,new v(T,N)},f.angleOfVector=function(o,n,a,u){var r=void 0;if(o!==a){if(r=Math.atan((u-n)/(a-o)),a<o)r+=Math.PI;else if(u<n)r+=this.TWO_PI}else if(u<n)r=this.ONE_AND_HALF_PI;else r=this.HALF_PI;return r},f.doIntersect=function(o,n,a,u){var{x:r,y}=o,{x:i,y:e}=n,{x:g,y:d}=a,{x:c,y:O}=u,T=(i-r)*(O-d)-(c-g)*(e-y);if(T===0)return!1;else{var N=((O-d)*(c-r)+(g-c)*(O-y))/T,D=((y-e)*(c-r)+(i-r)*(O-y))/T;return 0<N&&N<1&&0<D&&D<1}},f.findCircleLineIntersections=function(o,n,a,u,r,y,i){var e=(a-o)*(a-o)+(u-n)*(u-n),g=2*((o-r)*(a-o)+(n-y)*(u-n)),d=(o-r)*(o-r)+(n-y)*(n-y)-i*i,c=g*g-4*e*d;if(c>=0){var O=(-g+Math.sqrt(g*g-4*e*d))/(2*e),T=(-g-Math.sqrt(g*g-4*e*d))/(2*e),N=null;if(O>=0&&O<=1)return[O];if(T>=0&&T<=1)return[T];return N}else return null},f.HALF_PI=0.5*Math.PI,f.ONE_AND_HALF_PI=1.5*Math.PI,f.TWO_PI=2*Math.PI,f.THREE_PI=3*Math.PI,w.exports=f},function(w,I,A){function v(){}v.sign=function(f){if(f>0)return 1;else if(f<0)return-1;else return 0},v.floor=function(f){return f<0?Math.ceil(f):Math.floor(f)},v.ceil=function(f){return f<0?Math.floor(f):Math.ceil(f)},w.exports=v},function(w,I,A){function v(){}v.MAX_VALUE=2147483647,v.MIN_VALUE=-2147483648,w.exports=v},function(w,I,A){var v=function(){function r(y,i){for(var e=0;e<i.length;e++){var g=i[e];if(g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g)g.writable=!0;Object.defineProperty(y,g.key,g)}}return function(y,i,e){if(i)r(y.prototype,i);if(e)r(y,e);return y}}();function f(r,y){if(!(r instanceof y))throw TypeError("Cannot call a class as a function")}var o=function(y){return{value:y,next:null,prev:null}},n=function(y,i,e,g){if(y!==null)y.next=i;else g.head=i;if(e!==null)e.prev=i;else g.tail=i;return i.prev=y,i.next=e,g.length++,i},a=function(y,i){var{prev:e,next:g}=y;if(e!==null)e.next=g;else i.head=g;if(g!==null)g.prev=e;else i.tail=e;return y.prev=y.next=null,i.length--,y},u=function(){function r(y){var i=this;if(f(this,r),this.length=0,this.head=null,this.tail=null,y!=null)y.forEach(function(e){return i.push(e)})}return v(r,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(i,e){return n(e.prev,o(i),e,this)}},{key:"insertAfter",value:function(i,e){return n(e,o(i),e.next,this)}},{key:"insertNodeBefore",value:function(i,e){return n(e.prev,i,e,this)}},{key:"insertNodeAfter",value:function(i,e){return n(e,i,e.next,this)}},{key:"push",value:function(i){return n(this.tail,o(i),null,this)}},{key:"unshift",value:function(i){return n(null,o(i),this.head,this)}},{key:"remove",value:function(i){return a(i,this)}},{key:"pop",value:function(){return a(this.tail,this).value}},{key:"popNode",value:function(){return a(this.tail,this)}},{key:"shift",value:function(){return a(this.head,this).value}},{key:"shiftNode",value:function(){return a(this.head,this)}},{key:"get_object_at",value:function(i){if(i<=this.length()){var e=1,g=this.head;while(e<i)g=g.next,e++;return g.value}}},{key:"set_object_at",value:function(i,e){if(i<=this.length()){var g=1,d=this.head;while(g<i)d=d.next,g++;d.value=e}}}]),r}();w.exports=u},function(w,I,A){function v(f,o,n){if(this.x=null,this.y=null,f==null&&o==null&&n==null)this.x=0,this.y=0;else if(typeof f=="number"&&typeof o=="number"&&n==null)this.x=f,this.y=o;else if(f.constructor.name=="Point"&&o==null&&n==null)n=f,this.x=n.x,this.y=n.y}v.prototype.getX=function(){return this.x},v.prototype.getY=function(){return this.y},v.prototype.getLocation=function(){return new v(this.x,this.y)},v.prototype.setLocation=function(f,o,n){if(f.constructor.name=="Point"&&o==null&&n==null)n=f,this.setLocation(n.x,n.y);else if(typeof f=="number"&&typeof o=="number"&&n==null)if(parseInt(f)==f&&parseInt(o)==o)this.move(f,o);else this.x=Math.floor(f+0.5),this.y=Math.floor(o+0.5)},v.prototype.move=function(f,o){this.x=f,this.y=o},v.prototype.translate=function(f,o){this.x+=f,this.y+=o},v.prototype.equals=function(f){if(f.constructor.name=="Point"){var o=f;return this.x==o.x&&this.y==o.y}return this==f},v.prototype.toString=function(){return new v().constructor.name+"[x="+this.x+",y="+this.y+"]"},w.exports=v},function(w,I,A){function v(f,o,n,a){if(this.x=0,this.y=0,this.width=0,this.height=0,f!=null&&o!=null&&n!=null&&a!=null)this.x=f,this.y=o,this.width=n,this.height=a}v.prototype.getX=function(){return this.x},v.prototype.setX=function(f){this.x=f},v.prototype.getY=function(){return this.y},v.prototype.setY=function(f){this.y=f},v.prototype.getWidth=function(){return this.width},v.prototype.setWidth=function(f){this.width=f},v.prototype.getHeight=function(){return this.height},v.prototype.setHeight=function(f){this.height=f},v.prototype.getRight=function(){return this.x+this.width},v.prototype.getBottom=function(){return this.y+this.height},v.prototype.intersects=function(f){if(this.getRight()<f.x)return!1;if(this.getBottom()<f.y)return!1;if(f.getRight()<this.x)return!1;if(f.getBottom()<this.y)return!1;return!0},v.prototype.getCenterX=function(){return this.x+this.width/2},v.prototype.getMinX=function(){return this.getX()},v.prototype.getMaxX=function(){return this.getX()+this.width},v.prototype.getCenterY=function(){return this.y+this.height/2},v.prototype.getMinY=function(){return this.getY()},v.prototype.getMaxY=function(){return this.getY()+this.height},v.prototype.getWidthHalf=function(){return this.width/2},v.prototype.getHeightHalf=function(){return this.height/2},w.exports=v},function(w,I,A){var v=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol==="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o};function f(){}f.lastID=0,f.createID=function(o){if(f.isPrimitive(o))return o;if(o.uniqueID!=null)return o.uniqueID;return o.uniqueID=f.getString(),f.lastID++,o.uniqueID},f.getString=function(o){if(o==null)o=f.lastID;return"Object#"+o},f.isPrimitive=function(o){var n=typeof o>"u"?"undefined":v(o);return o==null||n!="object"&&n!="function"},w.exports=f},function(w,I,A){function v(g){if(Array.isArray(g)){for(var d=0,c=Array(g.length);d<g.length;d++)c[d]=g[d];return c}else return Array.from(g)}var f=A(0),o=A(7),n=A(3),a=A(1),u=A(6),r=A(5),y=A(17),i=A(29);function e(g){if(i.call(this),this.layoutQuality=f.QUALITY,this.createBendsAsNeeded=f.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=f.DEFAULT_INCREMENTAL,this.animationOnLayout=f.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=f.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=f.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=f.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new o(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,g!=null)this.isRemoteUse=g}e.RANDOM_SEED=1,e.prototype=Object.create(i.prototype),e.prototype.getGraphManager=function(){return this.graphManager},e.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},e.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},e.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},e.prototype.newGraphManager=function(){var g=new o(this);return this.graphManager=g,g},e.prototype.newGraph=function(g){return new u(null,this.graphManager,g)},e.prototype.newNode=function(g){return new n(this.graphManager,g)},e.prototype.newEdge=function(g){return new a(null,null,g)},e.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},e.prototype.runLayout=function(){if(this.isLayoutFinished=!1,this.tilingPreLayout)this.tilingPreLayout();this.initParameters();var g;if(this.checkLayoutSuccess())g=!1;else g=this.layout();if(f.ANIMATE==="during")return!1;if(g){if(!this.isSubLayout)this.doPostLayout()}if(this.tilingPostLayout)this.tilingPostLayout();return this.isLayoutFinished=!0,g},e.prototype.doPostLayout=function(){if(!this.incremental)this.transform();this.update()},e.prototype.update2=function(){if(this.createBendsAsNeeded)this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges();if(!this.isRemoteUse){var g,d=this.graphManager.getAllEdges();for(var c=0;c<d.length;c++)g=d[c];var O,T=this.graphManager.getRoot().getNodes();for(var c=0;c<T.length;c++)O=T[c];this.update(this.graphManager.getRoot())}},e.prototype.update=function(g){if(g==null)this.update2();else if(g instanceof n){var d=g;if(d.getChild()!=null){var c=d.getChild().getNodes();for(var O=0;O<c.length;O++)update(c[O])}if(d.vGraphObject!=null){var T=d.vGraphObject;T.update(d)}}else if(g instanceof a){var N=g;if(N.vGraphObject!=null){var D=N.vGraphObject;D.update(N)}}else if(g instanceof u){var X=g;if(X.vGraphObject!=null){var x=X.vGraphObject;x.update(X)}}},e.prototype.initParameters=function(){if(!this.isSubLayout)this.layoutQuality=f.QUALITY,this.animationDuringLayout=f.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=f.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=f.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=f.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=f.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=f.DEFAULT_UNIFORM_LEAF_NODE_SIZES;if(this.animationDuringLayout)this.animationOnLayout=!1},e.prototype.transform=function(g){if(g==null)this.transform(new r(0,0));else{var d=new y,c=this.graphManager.getRoot().updateLeftTop();if(c!=null){d.setWorldOrgX(g.x),d.setWorldOrgY(g.y),d.setDeviceOrgX(c.x),d.setDeviceOrgY(c.y);var O=this.getAllNodes(),T;for(var N=0;N<O.length;N++)T=O[N],T.transform(d)}}},e.prototype.positionNodesRandomly=function(g){if(g==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else{var d,c,O=g.getNodes();for(var T=0;T<O.length;T++)if(d=O[T],c=d.getChild(),c==null)d.scatter();else if(c.getNodes().length==0)d.scatter();else this.positionNodesRandomly(c),d.updateBounds()}},e.prototype.getFlatForest=function(){var g=[],d=!0,c=this.graphManager.getRoot().getNodes(),O=!0;for(var T=0;T<c.length;T++)if(c[T].getChild()!=null)O=!1;if(!O)return g;var N=new Set,D=[],X=new Map,x=[];x=x.concat(c);while(x.length>0&&d){D.push(x[0]);while(D.length>0&&d){var W=D[0];D.splice(0,1),N.add(W);var _=W.getEdges();for(var T=0;T<_.length;T++){var Q=_[T].getOtherEnd(W);if(X.get(W)!=Q)if(!N.has(Q))D.push(Q),X.set(Q,W);else{d=!1;break}}}if(!d)g=[];else{var lt=[].concat(v(N));g.push(lt);for(var T=0;T<lt.length;T++){var G=lt[T],tt=x.indexOf(G);if(tt>-1)x.splice(tt,1)}N=new Set,X=new Map}}return g},e.prototype.createDummyNodesForBendpoints=function(g){var d=[],c=g.source,O=this.graphManager.calcLowestCommonAncestor(g.source,g.target);for(var T=0;T<g.bendpoints.length;T++){var N=this.newNode(null);N.setRect(new Point(0,0),new Dimension(1,1)),O.add(N);var D=this.newEdge(null);this.graphManager.add(D,c,N),d.add(N),c=N}var D=this.newEdge(null);if(this.graphManager.add(D,c,g.target),this.edgeToDummyNodes.set(g,d),g.isInterGraph())this.graphManager.remove(g);else O.remove(g);return d},e.prototype.createBendpointsFromDummyNodes=function(){var g=[];g=g.concat(this.graphManager.getAllEdges()),g=[].concat(v(this.edgeToDummyNodes.keys())).concat(g);for(var d=0;d<g.length;d++){var c=g[d];if(c.bendpoints.length>0){var O=this.edgeToDummyNodes.get(c);for(var T=0;T<O.length;T++){var N=O[T],D=new r(N.getCenterX(),N.getCenterY()),X=c.bendpoints.get(T);X.x=D.x,X.y=D.y,N.getOwner().remove(N)}this.graphManager.add(c,c.source,c.target)}}},e.transform=function(g,d,c,O){if(c!=null&&O!=null){var T=d;if(g<=50){var N=d/c;T-=(d-N)/50*(50-g)}else{var D=d*O;T+=(D-d)/50*(g-50)}return T}else{var X,x;if(g<=50)X=9*d/500,x=d/10;else X=9*d/50,x=-8*d;return X*g+x}},e.findCenterOfTree=function(g){var d=[];d=d.concat(g);var c=[],O=new Map,T=!1,N=null;if(d.length==1||d.length==2)T=!0,N=d[0];for(var D=0;D<d.length;D++){var X=d[D],x=X.getNeighborsList().size;if(O.set(X,X.getNeighborsList().size),x==1)c.push(X)}var W=[];W=W.concat(c);while(!T){var _=[];_=_.concat(W),W=[];for(var D=0;D<d.length;D++){var X=d[D],Q=d.indexOf(X);if(Q>=0)d.splice(Q,1);var lt=X.getNeighborsList();lt.forEach(function(s){if(c.indexOf(s)<0){var L=O.get(s),E=L-1;if(E==1)W.push(s);O.set(s,E)}})}if(c=c.concat(W),d.length==1||d.length==2)T=!0,N=d[0]}return N},e.prototype.setGraphManager=function(g){this.graphManager=g},w.exports=e},function(w,I,A){function v(){}v.seed=1,v.x=0,v.nextDouble=function(){return v.x=Math.sin(v.seed++)*1e4,v.x-Math.floor(v.x)},w.exports=v},function(w,I,A){var v=A(5);function f(o,n){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}f.prototype.getWorldOrgX=function(){return this.lworldOrgX},f.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},f.prototype.getWorldOrgY=function(){return this.lworldOrgY},f.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},f.prototype.getWorldExtX=function(){return this.lworldExtX},f.prototype.setWorldExtX=function(o){this.lworldExtX=o},f.prototype.getWorldExtY=function(){return this.lworldExtY},f.prototype.setWorldExtY=function(o){this.lworldExtY=o},f.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},f.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},f.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},f.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},f.prototype.getDeviceExtX=function(){return this.ldeviceExtX},f.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},f.prototype.getDeviceExtY=function(){return this.ldeviceExtY},f.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},f.prototype.transformX=function(o){var n=0,a=this.lworldExtX;if(a!=0)n=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/a;return n},f.prototype.transformY=function(o){var n=0,a=this.lworldExtY;if(a!=0)n=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/a;return n},f.prototype.inverseTransformX=function(o){var n=0,a=this.ldeviceExtX;if(a!=0)n=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/a;return n},f.prototype.inverseTransformY=function(o){var n=0,a=this.ldeviceExtY;if(a!=0)n=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/a;return n},f.prototype.inverseTransformPoint=function(o){var n=new v(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return n},w.exports=f},function(w,I,A){function v(i){if(Array.isArray(i)){for(var e=0,g=Array(i.length);e<i.length;e++)g[e]=i[e];return g}else return Array.from(i)}var f=A(15),o=A(4),n=A(0),a=A(8),u=A(9);function r(){f.call(this),this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=o.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=o.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=o.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=o.MAX_ITERATIONS}r.prototype=Object.create(f.prototype);for(var y in f)r[y]=f[y];r.prototype.initParameters=function(){f.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=o.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},r.prototype.calcIdealEdgeLengths=function(){var i,e,g,d,c,O,T,N=this.getGraphManager().getAllEdges();for(var D=0;D<N.length;D++)if(i=N[D],e=i.idealLength,i.isInterGraph){if(d=i.getSource(),c=i.getTarget(),O=i.getSourceInLca().getEstimatedSize(),T=i.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation)i.idealLength+=O+T-2*n.SIMPLE_NODE_SIZE;g=i.getLca().getInclusionTreeDepth(),i.idealLength+=e*o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(d.getInclusionTreeDepth()+c.getInclusionTreeDepth()-2*g)}},r.prototype.initSpringEmbedder=function(){var i=this.getAllNodes().length;if(this.incremental){if(i>o.ADAPTATION_LOWER_NODE_LIMIT)this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(i-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR));this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL}else{if(i>o.ADAPTATION_LOWER_NODE_LIMIT)this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(i-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR));else this.coolingFactor=1;this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT}this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},r.prototype.calcSpringForces=function(){var i=this.getAllEdges(),e;for(var g=0;g<i.length;g++)e=i[g],this.calcSpringForce(e,e.idealLength)},r.prototype.calcRepulsionForces=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,g,d,c,O,T=this.getAllNodes(),N;if(this.useFRGridVariant){if(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&i)this.updateGrid();N=new Set;for(g=0;g<T.length;g++)c=T[g],this.calculateRepulsionForceOfANode(c,N,i,e),N.add(c)}else for(g=0;g<T.length;g++){c=T[g];for(d=g+1;d<T.length;d++){if(O=T[d],c.getOwner()!=O.getOwner())continue;this.calcRepulsionForce(c,O)}}},r.prototype.calcGravitationalForces=function(){var i,e=this.getAllNodesToApplyGravitation();for(var g=0;g<e.length;g++)i=e[g],this.calcGravitationalForce(i)},r.prototype.moveNodes=function(){var i=this.getAllNodes(),e;for(var g=0;g<i.length;g++)e=i[g],e.move()},r.prototype.calcSpringForce=function(i,e){var g=i.getSource(),d=i.getTarget(),c,O,T,N;if(this.uniformLeafNodeSizes&&g.getChild()==null&&d.getChild()==null)i.updateLengthSimple();else if(i.updateLength(),i.isOverlapingSourceAndTarget)return;if(c=i.getLength(),c==0)return;O=i.edgeElasticity*(c-e),T=O*(i.lengthX/c),N=O*(i.lengthY/c),g.springForceX+=T,g.springForceY+=N,d.springForceX-=T,d.springForceY-=N},r.prototype.calcRepulsionForce=function(i,e){var g=i.getRect(),d=e.getRect(),c=[,,],O=[,,,,],T,N,D,X,x,W,_;if(g.intersects(d)){a.calcSeparationAmount(g,d,c,o.DEFAULT_EDGE_LENGTH/2),W=2*c[0],_=2*c[1];var Q=i.noOfChildren*e.noOfChildren/(i.noOfChildren+e.noOfChildren);i.repulsionForceX-=Q*W,i.repulsionForceY-=Q*_,e.repulsionForceX+=Q*W,e.repulsionForceY+=Q*_}else{if(this.uniformLeafNodeSizes&&i.getChild()==null&&e.getChild()==null)T=d.getCenterX()-g.getCenterX(),N=d.getCenterY()-g.getCenterY();else a.getIntersection(g,d,O),T=O[2]-O[0],N=O[3]-O[1];if(Math.abs(T)<o.MIN_REPULSION_DIST)T=u.sign(T)*o.MIN_REPULSION_DIST;if(Math.abs(N)<o.MIN_REPULSION_DIST)N=u.sign(N)*o.MIN_REPULSION_DIST;D=T*T+N*N,X=Math.sqrt(D),x=(i.nodeRepulsion/2+e.nodeRepulsion/2)*i.noOfChildren*e.noOfChildren/D,W=x*T/X,_=x*N/X,i.repulsionForceX-=W,i.repulsionForceY-=_,e.repulsionForceX+=W,e.repulsionForceY+=_}},r.prototype.calcGravitationalForce=function(i){var e,g,d,c,O,T,N,D;if(e=i.getOwner(),g=(e.getRight()+e.getLeft())/2,d=(e.getTop()+e.getBottom())/2,c=i.getCenterX()-g,O=i.getCenterY()-d,T=Math.abs(c)+i.getWidth()/2,N=Math.abs(O)+i.getHeight()/2,i.getOwner()==this.graphManager.getRoot()){if(D=e.getEstimatedSize()*this.gravityRangeFactor,T>D||N>D)i.gravitationForceX=-this.gravityConstant*c,i.gravitationForceY=-this.gravityConstant*O}else if(D=e.getEstimatedSize()*this.compoundGravityRangeFactor,T>D||N>D)i.gravitationForceX=-this.gravityConstant*c*this.compoundGravityConstant,i.gravitationForceY=-this.gravityConstant*O*this.compoundGravityConstant},r.prototype.isConverged=function(){var i,e=!1;if(this.totalIterations>this.maxIterations/3)e=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2;return i=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,i||e},r.prototype.animate=function(){if(this.animationDuringLayout&&!this.isSubLayout)if(this.notAnimatedIterations==this.animationPeriod)this.update(),this.notAnimatedIterations=0;else this.notAnimatedIterations++},r.prototype.calcNoOfChildrenForAllNodes=function(){var i,e=this.graphManager.getAllNodes();for(var g=0;g<e.length;g++)i=e[g],i.noOfChildren=i.getNoOfChildren()},r.prototype.calcGrid=function(i){var e=0,g=0;e=parseInt(Math.ceil((i.getRight()-i.getLeft())/this.repulsionRange)),g=parseInt(Math.ceil((i.getBottom()-i.getTop())/this.repulsionRange));var d=Array(e);for(var c=0;c<e;c++)d[c]=Array(g);for(var c=0;c<e;c++)for(var O=0;O<g;O++)d[c][O]=[];return d},r.prototype.addNodeToGrid=function(i,e,g){var d=0,c=0,O=0,T=0;d=parseInt(Math.floor((i.getRect().x-e)/this.repulsionRange)),c=parseInt(Math.floor((i.getRect().width+i.getRect().x-e)/this.repulsionRange)),O=parseInt(Math.floor((i.getRect().y-g)/this.repulsionRange)),T=parseInt(Math.floor((i.getRect().height+i.getRect().y-g)/this.repulsionRange));for(var N=d;N<=c;N++)for(var D=O;D<=T;D++)this.grid[N][D].push(i),i.setGridCoordinates(d,c,O,T)},r.prototype.updateGrid=function(){var i,e,g=this.getAllNodes();this.grid=this.calcGrid(this.graphManager.getRoot());for(i=0;i<g.length;i++)e=g[i],this.addNodeToGrid(e,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},r.prototype.calculateRepulsionForceOfANode=function(i,e,g,d){if(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&g||d){var c=new Set;i.surrounding=[];var O,T=this.grid;for(var N=i.startX-1;N<i.finishX+2;N++)for(var D=i.startY-1;D<i.finishY+2;D++)if(!(N<0||D<0||N>=T.length||D>=T[0].length))for(var X=0;X<T[N][D].length;X++){if(O=T[N][D][X],i.getOwner()!=O.getOwner()||i==O)continue;if(!e.has(O)&&!c.has(O)){var x=Math.abs(i.getCenterX()-O.getCenterX())-(i.getWidth()/2+O.getWidth()/2),W=Math.abs(i.getCenterY()-O.getCenterY())-(i.getHeight()/2+O.getHeight()/2);if(x<=this.repulsionRange&&W<=this.repulsionRange)c.add(O)}}i.surrounding=[].concat(v(c))}for(N=0;N<i.surrounding.length;N++)this.calcRepulsionForce(i,i.surrounding[N])},r.prototype.calcRepulsionRange=function(){return 0},w.exports=r},function(w,I,A){var v=A(1),f=A(4);function o(a,u,r){v.call(this,a,u,r),this.idealLength=f.DEFAULT_EDGE_LENGTH,this.edgeElasticity=f.DEFAULT_SPRING_STRENGTH}o.prototype=Object.create(v.prototype);for(var n in v)o[n]=v[n];w.exports=o},function(w,I,A){var v=A(3),f=A(4);function o(a,u,r,y){v.call(this,a,u,r,y),this.nodeRepulsion=f.DEFAULT_REPULSION_STRENGTH,this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}o.prototype=Object.create(v.prototype);for(var n in v)o[n]=v[n];o.prototype.setGridCoordinates=function(a,u,r,y){this.startX=a,this.finishX=u,this.startY=r,this.finishY=y},w.exports=o},function(w,I,A){function v(f,o){if(this.width=0,this.height=0,f!==null&&o!==null)this.height=o,this.width=f}v.prototype.getWidth=function(){return this.width},v.prototype.setWidth=function(f){this.width=f},v.prototype.getHeight=function(){return this.height},v.prototype.setHeight=function(f){this.height=f},w.exports=v},function(w,I,A){var v=A(14);function f(){this.map={},this.keys=[]}f.prototype.put=function(o,n){var a=v.createID(o);if(!this.contains(a))this.map[a]=n,this.keys.push(o)},f.prototype.contains=function(o){var n=v.createID(o);return this.map[o]!=null},f.prototype.get=function(o){var n=v.createID(o);return this.map[n]},f.prototype.keySet=function(){return this.keys},w.exports=f},function(w,I,A){var v=A(14);function f(){this.set={}}f.prototype.add=function(o){var n=v.createID(o);if(!this.contains(n))this.set[n]=o},f.prototype.remove=function(o){delete this.set[v.createID(o)]},f.prototype.clear=function(){this.set={}},f.prototype.contains=function(o){return this.set[v.createID(o)]==o},f.prototype.isEmpty=function(){return this.size()===0},f.prototype.size=function(){return Object.keys(this.set).length},f.prototype.addAllTo=function(o){var n=Object.keys(this.set),a=n.length;for(var u=0;u<a;u++)o.push(this.set[n[u]])},f.prototype.size=function(){return Object.keys(this.set).length},f.prototype.addAll=function(o){var n=o.length;for(var a=0;a<n;a++){var u=o[a];this.add(u)}},w.exports=f},function(w,I,A){function v(){}v.multMat=function(f,o){var n=[];for(var a=0;a<f.length;a++){n[a]=[];for(var u=0;u<o[0].length;u++){n[a][u]=0;for(var r=0;r<f[0].length;r++)n[a][u]+=f[a][r]*o[r][u]}}return n},v.transpose=function(f){var o=[];for(var n=0;n<f[0].length;n++){o[n]=[];for(var a=0;a<f.length;a++)o[n][a]=f[a][n]}return o},v.multCons=function(f,o){var n=[];for(var a=0;a<f.length;a++)n[a]=f[a]*o;return n},v.minusOp=function(f,o){var n=[];for(var a=0;a<f.length;a++)n[a]=f[a]-o[a];return n},v.dotProduct=function(f,o){var n=0;for(var a=0;a<f.length;a++)n+=f[a]*o[a];return n},v.mag=function(f){return Math.sqrt(this.dotProduct(f,f))},v.normalize=function(f){var o=[],n=this.mag(f);for(var a=0;a<f.length;a++)o[a]=f[a]/n;return o},v.multGamma=function(f){var o=[],n=0;for(var a=0;a<f.length;a++)n+=f[a];n*=-1/f.length;for(var u=0;u<f.length;u++)o[u]=n+f[u];return o},v.multL=function(f,o,n){var a=[],u=[],r=[];for(var y=0;y<o[0].length;y++){var i=0;for(var e=0;e<o.length;e++)i+=-0.5*o[e][y]*f[e];u[y]=i}for(var g=0;g<n.length;g++){var d=0;for(var c=0;c<n.length;c++)d+=n[g][c]*u[c];r[g]=d}for(var O=0;O<o.length;O++){var T=0;for(var N=0;N<o[0].length;N++)T+=o[O][N]*r[N];a[O]=T}return a},w.exports=v},function(w,I,A){var v=function(){function a(u,r){for(var y=0;y<r.length;y++){var i=r[y];if(i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i)i.writable=!0;Object.defineProperty(u,i.key,i)}}return function(u,r,y){if(r)a(u.prototype,r);if(y)a(u,y);return u}}();function f(a,u){if(!(a instanceof u))throw TypeError("Cannot call a class as a function")}var o=A(11),n=function(){function a(u,r){if(f(this,a),r!==null||r!==void 0)this.compareFunction=this._defaultCompareFunction;var y=void 0;if(u instanceof o)y=u.size();else y=u.length;this._quicksort(u,0,y-1)}return v(a,[{key:"_quicksort",value:function(r,y,i){if(y<i){var e=this._partition(r,y,i);this._quicksort(r,y,e),this._quicksort(r,e+1,i)}}},{key:"_partition",value:function(r,y,i){var e=this._get(r,y),g=y,d=i;while(!0){while(this.compareFunction(e,this._get(r,d)))d--;while(this.compareFunction(this._get(r,g),e))g++;if(g<d)this._swap(r,g,d),g++,d--;else return d}}},{key:"_get",value:function(r,y){if(r instanceof o)return r.get_object_at(y);else return r[y]}},{key:"_set",value:function(r,y,i){if(r instanceof o)r.set_object_at(y,i);else r[y]=i}},{key:"_swap",value:function(r,y,i){var e=this._get(r,y);this._set(r,y,this._get(r,i)),this._set(r,i,e)}},{key:"_defaultCompareFunction",value:function(r,y){return y>r}}]),a}();w.exports=n},function(w,I,A){function v(){}v.svd=function(f){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=f.length,this.n=f[0].length;var o=Math.min(this.m,this.n);this.s=function(Wt){var bt=[];while(Wt-- >0)bt.push(0);return bt}(Math.min(this.m+1,this.n)),this.U=function(Wt){var bt=function ae($t){if($t.length==0)return 0;else{var jt=[];for(var ie=0;ie<$t[0];ie++)jt.push(ae($t.slice(1)));return jt}};return bt(Wt)}([this.m,o]),this.V=function(Wt){var bt=function ae($t){if($t.length==0)return 0;else{var jt=[];for(var ie=0;ie<$t[0];ie++)jt.push(ae($t.slice(1)));return jt}};return bt(Wt)}([this.n,this.n]);var n=function(Wt){var bt=[];while(Wt-- >0)bt.push(0);return bt}(this.n),a=function(Wt){var bt=[];while(Wt-- >0)bt.push(0);return bt}(this.m),u=!0,r=!0,y=Math.min(this.m-1,this.n),i=Math.max(0,Math.min(this.n-2,this.m));for(var e=0;e<Math.max(y,i);e++){if(e<y){this.s[e]=0;for(var g=e;g<this.m;g++)this.s[e]=v.hypot(this.s[e],f[g][e]);if(this.s[e]!==0){if(f[e][e]<0)this.s[e]=-this.s[e];for(var d=e;d<this.m;d++)f[d][e]/=this.s[e];f[e][e]+=1}this.s[e]=-this.s[e]}for(var c=e+1;c<this.n;c++){if(function(Wt,bt){return Wt&&bt}(e<y,this.s[e]!==0)){var O=0;for(var T=e;T<this.m;T++)O+=f[T][e]*f[T][c];O=-O/f[e][e];for(var N=e;N<this.m;N++)f[N][c]+=O*f[N][e]}n[c]=f[e][c]}if(function(Wt,bt){return Wt&&bt}(u,e<y))for(var D=e;D<this.m;D++)this.U[D][e]=f[D][e];if(e<i){n[e]=0;for(var X=e+1;X<this.n;X++)n[e]=v.hypot(n[e],n[X]);if(n[e]!==0){if(n[e+1]<0)n[e]=-n[e];for(var x=e+1;x<this.n;x++)n[x]/=n[e];n[e+1]+=1}if(n[e]=-n[e],function(Wt,bt){return Wt&&bt}(e+1<this.m,n[e]!==0)){for(var W=e+1;W<this.m;W++)a[W]=0;for(var _=e+1;_<this.n;_++)for(var Q=e+1;Q<this.m;Q++)a[Q]+=n[_]*f[Q][_];for(var lt=e+1;lt<this.n;lt++){var G=-n[lt]/n[e+1];for(var tt=e+1;tt<this.m;tt++)f[tt][lt]+=G*a[tt]}}if(r)for(var s=e+1;s<this.n;s++)this.V[s][e]=n[s]}}var L=Math.min(this.n,this.m+1);if(y<this.n)this.s[y]=f[y][y];if(this.m<L)this.s[L-1]=0;if(i+1<L)n[i]=f[i][L-1];if(n[L-1]=0,u){for(var E=y;E<o;E++){for(var M=0;M<this.m;M++)this.U[M][E]=0;this.U[E][E]=1}for(var m=y-1;m>=0;m--)if(this.s[m]!==0){for(var Y=m+1;Y<o;Y++){var b=0;for(var k=m;k<this.m;k++)b+=this.U[k][m]*this.U[k][Y];b=-b/this.U[m][m];for(var B=m;B<this.m;B++)this.U[B][Y]+=b*this.U[B][m]}for(var H=m;H<this.m;H++)this.U[H][m]=-this.U[H][m];this.U[m][m]=1+this.U[m][m];for(var st=0;st<m-1;st++)this.U[st][m]=0}else{for(var dt=0;dt<this.m;dt++)this.U[dt][m]=0;this.U[m][m]=1}}if(r)for(var Z=this.n-1;Z>=0;Z--){if(function(Wt,bt){return Wt&&bt}(Z<i,n[Z]!==0))for(var ut=Z+1;ut<o;ut++){var nt=0;for(var S=Z+1;S<this.n;S++)nt+=this.V[S][Z]*this.V[S][ut];nt=-nt/this.V[Z+1][Z];for(var K=Z+1;K<this.n;K++)this.V[K][ut]+=nt*this.V[K][Z]}for(var et=0;et<this.n;et++)this.V[et][Z]=0;this.V[Z][Z]=1}var ct=L-1,Nt=0,Pt=Math.pow(2,-52),Bt=Math.pow(2,-966);while(L>0){var ft=void 0,Jt=void 0;for(ft=L-2;ft>=-1;ft--){if(ft===-1)break;if(Math.abs(n[ft])<=Bt+Pt*(Math.abs(this.s[ft])+Math.abs(this.s[ft+1]))){n[ft]=0;break}}if(ft===L-2)Jt=4;else{var Xt=void 0;for(Xt=L-1;Xt>=ft;Xt--){if(Xt===ft)break;var Et=(Xt!==L?Math.abs(n[Xt]):0)+(Xt!==ft+1?Math.abs(n[Xt-1]):0);if(Math.abs(this.s[Xt])<=Bt+Pt*Et){this.s[Xt]=0;break}}if(Xt===ft)Jt=3;else if(Xt===L-1)Jt=1;else Jt=2,ft=Xt}switch(ft++,Jt){case 1:{var vt=n[L-2];n[L-2]=0;for(var xt=L-2;xt>=ft;xt--){var Rt=v.hypot(this.s[xt],vt),Gt=this.s[xt]/Rt,St=vt/Rt;if(this.s[xt]=Rt,xt!==ft)vt=-St*n[xt-1],n[xt-1]=Gt*n[xt-1];if(r)for(var Ft=0;Ft<this.n;Ft++)Rt=Gt*this.V[Ft][xt]+St*this.V[Ft][L-1],this.V[Ft][L-1]=-St*this.V[Ft][xt]+Gt*this.V[Ft][L-1],this.V[Ft][xt]=Rt}}break;case 2:{var Ht=n[ft-1];n[ft-1]=0;for(var zt=ft;zt<L;zt++){var te=v.hypot(this.s[zt],Ht),qt=this.s[zt]/te,Kt=Ht/te;if(this.s[zt]=te,Ht=-Kt*n[zt],n[zt]=qt*n[zt],u)for(var kt=0;kt<this.m;kt++)te=qt*this.U[kt][zt]+Kt*this.U[kt][ft-1],this.U[kt][ft-1]=-Kt*this.U[kt][zt]+qt*this.U[kt][ft-1],this.U[kt][zt]=te}}break;case 3:{var J=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[L-1]),Math.abs(this.s[L-2])),Math.abs(n[L-2])),Math.abs(this.s[ft])),Math.abs(n[ft])),rt=this.s[L-1]/J,it=this.s[L-2]/J,at=n[L-2]/J,ot=this.s[ft]/J,gt=n[ft]/J,At=((it+rt)*(it-rt)+at*at)/2,Mt=rt*at*(rt*at),ht=0;if(function(Wt,bt){return Wt||bt}(At!==0,Mt!==0)){if(ht=Math.sqrt(At*At+Mt),At<0)ht=-ht;ht=Mt/(At+ht)}var Lt=(ot+rt)*(ot-rt)+ht,Ct=ot*gt;for(var pt=ft;pt<L-1;pt++){var Ot=v.hypot(Lt,Ct),Ut=Lt/Ot,Tt=Ct/Ot;if(pt!==ft)n[pt-1]=Ot;if(Lt=Ut*this.s[pt]+Tt*n[pt],n[pt]=Ut*n[pt]-Tt*this.s[pt],Ct=Tt*this.s[pt+1],this.s[pt+1]=Ut*this.s[pt+1],r)for(var yt=0;yt<this.n;yt++)Ot=Ut*this.V[yt][pt]+Tt*this.V[yt][pt+1],this.V[yt][pt+1]=-Tt*this.V[yt][pt]+Ut*this.V[yt][pt+1],this.V[yt][pt]=Ot;if(Ot=v.hypot(Lt,Ct),Ut=Lt/Ot,Tt=Ct/Ot,this.s[pt]=Ot,Lt=Ut*n[pt]+Tt*this.s[pt+1],this.s[pt+1]=-Tt*n[pt]+Ut*this.s[pt+1],Ct=Tt*n[pt+1],n[pt+1]=Ut*n[pt+1],u&&pt<this.m-1)for(var Dt=0;Dt<this.m;Dt++)Ot=Ut*this.U[Dt][pt]+Tt*this.U[Dt][pt+1],this.U[Dt][pt+1]=-Tt*this.U[Dt][pt]+Ut*this.U[Dt][pt+1],this.U[Dt][pt]=Ot}n[L-2]=Lt,Nt=Nt+1}break;case 4:{if(this.s[ft]<=0){if(this.s[ft]=this.s[ft]<0?-this.s[ft]:0,r)for(var mt=0;mt<=ct;mt++)this.V[mt][ft]=-this.V[mt][ft]}while(ft<ct){if(this.s[ft]>=this.s[ft+1])break;var wt=this.s[ft];if(this.s[ft]=this.s[ft+1],this.s[ft+1]=wt,r&&ft<this.n-1)for(var Zt=0;Zt<this.n;Zt++)wt=this.V[Zt][ft+1],this.V[Zt][ft+1]=this.V[Zt][ft],this.V[Zt][ft]=wt;if(u&&ft<this.m-1)for(var Vt=0;Vt<this.m;Vt++)wt=this.U[Vt][ft+1],this.U[Vt][ft+1]=this.U[Vt][ft],this.U[Vt][ft]=wt;ft++}Nt=0,L--}break}}var re={U:this.U,V:this.V,S:this.s};return re},v.hypot=function(f,o){var n=void 0;if(Math.abs(f)>Math.abs(o))n=o/f,n=Math.abs(f)*Math.sqrt(1+n*n);else if(o!=0)n=f/o,n=Math.abs(o)*Math.sqrt(1+n*n);else n=0;return n},w.exports=v},function(w,I,A){var v=function(){function n(a,u){for(var r=0;r<u.length;r++){var y=u[r];if(y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y)y.writable=!0;Object.defineProperty(a,y.key,y)}}return function(a,u,r){if(u)n(a.prototype,u);if(r)n(a,r);return a}}();function f(n,a){if(!(n instanceof a))throw TypeError("Cannot call a class as a function")}var o=function(){function n(a,u){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,y=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;f(this,n),this.sequence1=a,this.sequence2=u,this.match_score=r,this.mismatch_penalty=y,this.gap_penalty=i,this.iMax=a.length+1,this.jMax=u.length+1,this.grid=Array(this.iMax);for(var e=0;e<this.iMax;e++){this.grid[e]=Array(this.jMax);for(var g=0;g<this.jMax;g++)this.grid[e][g]=0}this.tracebackGrid=Array(this.iMax);for(var d=0;d<this.iMax;d++){this.tracebackGrid[d]=Array(this.jMax);for(var c=0;c<this.jMax;c++)this.tracebackGrid[d][c]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return v(n,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var u=1;u<this.jMax;u++)this.grid[0][u]=this.grid[0][u-1]+this.gap_penalty,this.tracebackGrid[0][u]=[!1,!1,!0];for(var r=1;r<this.iMax;r++)this.grid[r][0]=this.grid[r-1][0]+this.gap_penalty,this.tracebackGrid[r][0]=[!1,!0,!1];for(var y=1;y<this.iMax;y++)for(var i=1;i<this.jMax;i++){var e=void 0;if(this.sequence1[y-1]===this.sequence2[i-1])e=this.grid[y-1][i-1]+this.match_score;else e=this.grid[y-1][i-1]+this.mismatch_penalty;var g=this.grid[y-1][i]+this.gap_penalty,d=this.grid[y][i-1]+this.gap_penalty,c=[e,g,d],O=this.arrayAllMaxIndexes(c);this.grid[y][i]=c[O[0]],this.tracebackGrid[y][i]=[O.includes(0),O.includes(1),O.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var u=[];u.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});while(u[0]){var r=u[0],y=this.tracebackGrid[r.pos[0]][r.pos[1]];if(y[0])u.push({pos:[r.pos[0]-1,r.pos[1]-1],seq1:this.sequence1[r.pos[0]-1]+r.seq1,seq2:this.sequence2[r.pos[1]-1]+r.seq2});if(y[1])u.push({pos:[r.pos[0]-1,r.pos[1]],seq1:this.sequence1[r.pos[0]-1]+r.seq1,seq2:"-"+r.seq2});if(y[2])u.push({pos:[r.pos[0],r.pos[1]-1],seq1:"-"+r.seq1,seq2:this.sequence2[r.pos[1]-1]+r.seq2});if(r.pos[0]===0&&r.pos[1]===0)this.alignments.push({sequence1:r.seq1,sequence2:r.seq2});u.shift()}return this.alignments}},{key:"getAllIndexes",value:function(u,r){var y=[],i=-1;while((i=u.indexOf(r,i+1))!==-1)y.push(i);return y}},{key:"arrayAllMaxIndexes",value:function(u){return this.getAllIndexes(u,Math.max.apply(null,u))}}]),n}();w.exports=o},function(w,I,A){var v=function(){return};v.FDLayout=A(18),v.FDLayoutConstants=A(4),v.FDLayoutEdge=A(19),v.FDLayoutNode=A(20),v.DimensionD=A(21),v.HashMap=A(22),v.HashSet=A(23),v.IGeometry=A(8),v.IMath=A(9),v.Integer=A(10),v.Point=A(12),v.PointD=A(5),v.RandomSeed=A(16),v.RectangleD=A(13),v.Transform=A(17),v.UniqueIDGeneretor=A(14),v.Quicksort=A(25),v.LinkedList=A(11),v.LGraphObject=A(2),v.LGraph=A(6),v.LEdge=A(1),v.LGraphManager=A(7),v.LNode=A(3),v.Layout=A(15),v.LayoutConstants=A(0),v.NeedlemanWunsch=A(27),v.Matrix=A(24),v.SVD=A(26),w.exports=v},function(w,I,A){function v(){this.listeners=[]}var f=v.prototype;f.addListener=function(o,n){this.listeners.push({event:o,callback:n})},f.removeListener=function(o,n){for(var a=this.listeners.length;a>=0;a--){var u=this.listeners[a];if(u.event===o&&u.callback===n)this.listeners.splice(a,1)}},f.emit=function(o,n){for(var a=0;a<this.listeners.length;a++){var u=this.listeners[a];if(o===u.event)u.callback(n)}},w.exports=v}])})});var Fe=Bn(function(Ee,Se){(function(I,A){if(typeof Ee==="object"&&typeof Se==="object")Se.exports=A(Re());else if(typeof define==="function"&&define.amd)define(["layout-base"],A);else if(typeof Ee==="object")Ee.coseBase=A(Re());else I.coseBase=A(I.layoutBase)})(Ee,function(w){return(()=>{var I={45:(o,n,a)=>{var u={};u.layoutBase=a(551),u.CoSEConstants=a(806),u.CoSEEdge=a(767),u.CoSEGraph=a(880),u.CoSEGraphManager=a(578),u.CoSELayout=a(765),u.CoSENode=a(991),u.ConstraintHandler=a(902),o.exports=u},806:(o,n,a)=>{var u=a(551).FDLayoutConstants;function r(){}for(var y in u)r[y]=u[y];r.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,r.DEFAULT_RADIAL_SEPARATION=u.DEFAULT_EDGE_LENGTH,r.DEFAULT_COMPONENT_SEPERATION=60,r.TILE=!0,r.TILING_PADDING_VERTICAL=10,r.TILING_PADDING_HORIZONTAL=10,r.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,r.ENFORCE_CONSTRAINTS=!0,r.APPLY_LAYOUT=!0,r.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,r.TREE_REDUCTION_ON_INCREMENTAL=!0,r.PURE_INCREMENTAL=r.DEFAULT_INCREMENTAL,o.exports=r},767:(o,n,a)=>{var u=a(551).FDLayoutEdge;function r(i,e,g){u.call(this,i,e,g)}r.prototype=Object.create(u.prototype);for(var y in u)r[y]=u[y];o.exports=r},880:(o,n,a)=>{var u=a(551).LGraph;function r(i,e,g){u.call(this,i,e,g)}r.prototype=Object.create(u.prototype);for(var y in u)r[y]=u[y];o.exports=r},578:(o,n,a)=>{var u=a(551).LGraphManager;function r(i){u.call(this,i)}r.prototype=Object.create(u.prototype);for(var y in u)r[y]=u[y];o.exports=r},765:(o,n,a)=>{var u=a(551).FDLayout,r=a(578),y=a(880),i=a(991),e=a(767),g=a(806),d=a(902),c=a(551).FDLayoutConstants,O=a(551).LayoutConstants,T=a(551).Point,N=a(551).PointD,D=a(551).DimensionD,X=a(551).Layout,x=a(551).Integer,W=a(551).IGeometry,_=a(551).LGraph,Q=a(551).Transform,lt=a(551).LinkedList;function G(){u.call(this),this.toBeTiled={},this.constraints={}}G.prototype=Object.create(u.prototype);for(var tt in u)G[tt]=u[tt];G.prototype.newGraphManager=function(){var s=new r(this);return this.graphManager=s,s},G.prototype.newGraph=function(s){return new y(null,this.graphManager,s)},G.prototype.newNode=function(s){return new i(this.graphManager,s)},G.prototype.newEdge=function(s){return new e(null,null,s)},G.prototype.initParameters=function(){if(u.prototype.initParameters.call(this,arguments),!this.isSubLayout){if(g.DEFAULT_EDGE_LENGTH<10)this.idealEdgeLength=10;else this.idealEdgeLength=g.DEFAULT_EDGE_LENGTH;this.useSmartIdealEdgeLengthCalculation=g.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=c.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=c.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1}},G.prototype.initSpringEmbedder=function(){u.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/c.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=0.04,this.coolingAdjuster=1},G.prototype.layout=function(){var s=O.DEFAULT_CREATE_BENDS_AS_NEEDED;if(s)this.createBendpoints(),this.graphManager.resetAllEdges();return this.level=0,this.classicLayout()},G.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 s=this.getFlatForest();if(s.length>0)this.positionNodesRadially(s);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var L=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(M){return L.has(M)});this.graphManager.setAllNodesToApplyGravitation(E),this.positionNodesRandomly()}}else if(g.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var L=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(Y){return L.has(Y)});this.graphManager.setAllNodesToApplyGravitation(E)}if(Object.keys(this.constraints).length>0)d.handleConstraints(this),this.initConstraintVariables();if(this.initSpringEmbedder(),g.APPLY_LAYOUT)this.runSpringEmbedder();return!0},G.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%c.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 s=new Set(this.getAllNodes()),L=this.nodesWithGravity.filter(function(m){return s.has(m)});if(this.graphManager.setAllNodesToApplyGravitation(L),this.graphManager.updateBounds(),this.updateGrid(),g.PURE_INCREMENTAL)this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL/2;else this.coolingFactor=c.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();if(g.PURE_INCREMENTAL)this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100);else this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100);this.afterGrowthIterations++}var E=!this.isTreeGrowing&&!this.isGrowthFinished,M=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(E,M),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},G.prototype.getPositionsData=function(){var s=this.graphManager.getAllNodes(),L={};for(var E=0;E<s.length;E++){var M=s[E].rect,m=s[E].id;L[m]={id:m,x:M.getCenterX(),y:M.getCenterY(),w:M.width,h:M.height}}return L},G.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var s=!1;if(c.ANIMATE==="during")this.emit("layoutstarted");else{while(!s)s=this.tick();this.graphManager.updateBounds()}},G.prototype.moveNodes=function(){var s=this.getAllNodes(),L;for(var E=0;E<s.length;E++)L=s[E],L.calculateDisplacement();if(Object.keys(this.constraints).length>0)this.updateDisplacements();for(var E=0;E<s.length;E++)L=s[E],L.move()},G.prototype.initConstraintVariables=function(){var s=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;var L=this.graphManager.getAllNodes();for(var E=0;E<L.length;E++){var M=L[E];this.idToNodeMap.set(M.id,M)}var m=function S(K){var et=K.getChild().getNodes(),ct,Nt=0;for(var Pt=0;Pt<et.length;Pt++)if(ct=et[Pt],ct.getChild()==null){if(s.fixedNodeSet.has(ct.id))Nt+=100}else Nt+=S(ct);return Nt};if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(et){s.fixedNodeSet.add(et.nodeId)});var L=this.graphManager.getAllNodes(),M;for(var E=0;E<L.length;E++)if(M=L[E],M.getChild()!=null){var Y=m(M);if(Y>0)M.fixedNodeWeight=Y}}if(this.constraints.relativePlacementConstraint){var b=new Map,k=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(S){s.fixedNodesOnHorizontal.add(S),s.fixedNodesOnVertical.add(S)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var B=this.constraints.alignmentConstraint.vertical;for(var E=0;E<B.length;E++)this.dummyToNodeForVerticalAlignment.set("dummy"+E,[]),B[E].forEach(function(K){if(b.set(K,"dummy"+E),s.dummyToNodeForVerticalAlignment.get("dummy"+E).push(K),s.fixedNodeSet.has(K))s.fixedNodesOnHorizontal.add("dummy"+E)})}if(this.constraints.alignmentConstraint.horizontal){var H=this.constraints.alignmentConstraint.horizontal;for(var E=0;E<H.length;E++)this.dummyToNodeForHorizontalAlignment.set("dummy"+E,[]),H[E].forEach(function(K){if(k.set(K,"dummy"+E),s.dummyToNodeForHorizontalAlignment.get("dummy"+E).push(K),s.fixedNodeSet.has(K))s.fixedNodesOnVertical.add("dummy"+E)})}}if(g.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(S){var K,et,ct;for(ct=S.length-1;ct>=2*S.length/3;ct--)K=Math.floor(Math.random()*(ct+1)),et=S[ct],S[ct]=S[K],S[K]=et;return S},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(S){if(S.left){var K=b.has(S.left)?b.get(S.left):S.left,et=b.has(S.right)?b.get(S.right):S.right;if(!s.nodesInRelativeHorizontal.includes(K))if(s.nodesInRelativeHorizontal.push(K),s.nodeToRelativeConstraintMapHorizontal.set(K,[]),s.dummyToNodeForVerticalAlignment.has(K))s.nodeToTempPositionMapHorizontal.set(K,s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(K)[0]).getCenterX());else s.nodeToTempPositionMapHorizontal.set(K,s.idToNodeMap.get(K).getCenterX());if(!s.nodesInRelativeHorizontal.includes(et))if(s.nodesInRelativeHorizontal.push(et),s.nodeToRelativeConstraintMapHorizontal.set(et,[]),s.dummyToNodeForVerticalAlignment.has(et))s.nodeToTempPositionMapHorizontal.set(et,s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(et)[0]).getCenterX());else s.nodeToTempPositionMapHorizontal.set(et,s.idToNodeMap.get(et).getCenterX());s.nodeToRelativeConstraintMapHorizontal.get(K).push({right:et,gap:S.gap}),s.nodeToRelativeConstraintMapHorizontal.get(et).push({left:K,gap:S.gap})}else{var ct=k.has(S.top)?k.get(S.top):S.top,Nt=k.has(S.bottom)?k.get(S.bottom):S.bottom;if(!s.nodesInRelativeVertical.includes(ct))if(s.nodesInRelativeVertical.push(ct),s.nodeToRelativeConstraintMapVertical.set(ct,[]),s.dummyToNodeForHorizontalAlignment.has(ct))s.nodeToTempPositionMapVertical.set(ct,s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(ct)[0]).getCenterY());else s.nodeToTempPositionMapVertical.set(ct,s.idToNodeMap.get(ct).getCenterY());if(!s.nodesInRelativeVertical.includes(Nt))if(s.nodesInRelativeVertical.push(Nt),s.nodeToRelativeConstraintMapVertical.set(Nt,[]),s.dummyToNodeForHorizontalAlignment.has(Nt))s.nodeToTempPositionMapVertical.set(Nt,s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(Nt)[0]).getCenterY());else s.nodeToTempPositionMapVertical.set(Nt,s.idToNodeMap.get(Nt).getCenterY());s.nodeToRelativeConstraintMapVertical.get(ct).push({bottom:Nt,gap:S.gap}),s.nodeToRelativeConstraintMapVertical.get(Nt).push({top:ct,gap:S.gap})}});else{var st=new Map,dt=new Map;this.constraints.relativePlacementConstraint.forEach(function(S){if(S.left){var K=b.has(S.left)?b.get(S.left):S.left,et=b.has(S.right)?b.get(S.right):S.right;if(st.has(K))st.get(K).push(et);else st.set(K,[et]);if(st.has(et))st.get(et).push(K);else st.set(et,[K])}else{var ct=k.has(S.top)?k.get(S.top):S.top,Nt=k.has(S.bottom)?k.get(S.bottom):S.bottom;if(dt.has(ct))dt.get(ct).push(Nt);else dt.set(ct,[Nt]);if(dt.has(Nt))dt.get(Nt).push(ct);else dt.set(Nt,[ct])}});var Z=function(K,et){var ct=[],Nt=[],Pt=new lt,Bt=new Set,ft=0;return K.forEach(function(Jt,Xt){if(!Bt.has(Xt)){ct[ft]=[],Nt[ft]=!1;var Et=Xt;Pt.push(Et),Bt.add(Et),ct[ft].push(Et);while(Pt.length!=0){if(Et=Pt.shift(),et.has(Et))Nt[ft]=!0;var vt=K.get(Et);vt.forEach(function(xt){if(!Bt.has(xt))Pt.push(xt),Bt.add(xt),ct[ft].push(xt)})}ft++}}),{components:ct,isFixed:Nt}},ut=Z(st,s.fixedNodesOnHorizontal);this.componentsOnHorizontal=ut.components,this.fixedComponentsOnHorizontal=ut.isFixed;var nt=Z(dt,s.fixedNodesOnVertical);this.componentsOnVertical=nt.components,this.fixedComponentsOnVertical=nt.isFixed}}},G.prototype.updateDisplacements=function(){var s=this;if(this.constraints.fixedNodeConstraint)this.constraints.fixedNodeConstraint.forEach(function(nt){var S=s.idToNodeMap.get(nt.nodeId);S.displacementX=0,S.displacementY=0});if(this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var L=this.constraints.alignmentConstraint.vertical;for(var E=0;E<L.length;E++){var M=0;for(var m=0;m<L[E].length;m++){if(this.fixedNodeSet.has(L[E][m])){M=0;break}M+=this.idToNodeMap.get(L[E][m]).displacementX}var Y=M/L[E].length;for(var m=0;m<L[E].length;m++)this.idToNodeMap.get(L[E][m]).displacementX=Y}}if(this.constraints.alignmentConstraint.horizontal){var b=this.constraints.alignmentConstraint.horizontal;for(var E=0;E<b.length;E++){var k=0;for(var m=0;m<b[E].length;m++){if(this.fixedNodeSet.has(b[E][m])){k=0;break}k+=this.idToNodeMap.get(b[E][m]).displacementY}var B=k/b[E].length;for(var m=0;m<b[E].length;m++)this.idToNodeMap.get(b[E][m]).displacementY=B}}}if(this.constraints.relativePlacementConstraint)if(g.RELAX_MOVEMENT_ON_CONSTRAINTS){if(this.totalIterations%10==0)this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical);this.nodesInRelativeHorizontal.forEach(function(nt){if(!s.fixedNodesOnHorizontal.has(nt)){var S=0;if(s.dummyToNodeForVerticalAlignment.has(nt))S=s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(nt)[0]).displacementX;else S=s.idToNodeMap.get(nt).displacementX;if(s.nodeToRelativeConstraintMapHorizontal.get(nt).forEach(function(K){if(K.right){var et=s.nodeToTempPositionMapHorizontal.get(K.right)-s.nodeToTempPositionMapHorizontal.get(nt)-S;if(et<K.gap)S-=K.gap-et}else{var et=s.nodeToTempPositionMapHorizontal.get(nt)-s.nodeToTempPositionMapHorizontal.get(K.left)+S;if(et<K.gap)S+=K.gap-et}}),s.nodeToTempPositionMapHorizontal.set(nt,s.nodeToTempPositionMapHorizontal.get(nt)+S),s.dummyToNodeForVerticalAlignment.has(nt))s.dummyToNodeForVerticalAlignment.get(nt).forEach(function(K){s.idToNodeMap.get(K).displacementX=S});else s.idToNodeMap.get(nt).displacementX=S}}),this.nodesInRelativeVertical.forEach(function(nt){if(!s.fixedNodesOnHorizontal.has(nt)){var S=0;if(s.dummyToNodeForHorizontalAlignment.has(nt))S=s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(nt)[0]).displacementY;else S=s.idToNodeMap.get(nt).displacementY;if(s.nodeToRelativeConstraintMapVertical.get(nt).forEach(function(K){if(K.bottom){var et=s.nodeToTempPositionMapVertical.get(K.bottom)-s.nodeToTempPositionMapVertical.get(nt)-S;if(et<K.gap)S-=K.gap-et}else{var et=s.nodeToTempPositionMapVertical.get(nt)-s.nodeToTempPositionMapVertical.get(K.top)+S;if(et<K.gap)S+=K.gap-et}}),s.nodeToTempPositionMapVertical.set(nt,s.nodeToTempPositionMapVertical.get(nt)+S),s.dummyToNodeForHorizontalAlignment.has(nt))s.dummyToNodeForHorizontalAlignment.get(nt).forEach(function(K){s.idToNodeMap.get(K).displacementY=S});else s.idToNodeMap.get(nt).displacementY=S}})}else{for(var E=0;E<this.componentsOnHorizontal.length;E++){var H=this.componentsOnHorizontal[E];if(this.fixedComponentsOnHorizontal[E])for(var m=0;m<H.length;m++)if(this.dummyToNodeForVerticalAlignment.has(H[m]))this.dummyToNodeForVerticalAlignment.get(H[m]).forEach(function(K){s.idToNodeMap.get(K).displacementX=0});else this.idToNodeMap.get(H[m]).displacementX=0;else{var st=0,dt=0;for(var m=0;m<H.length;m++)if(this.dummyToNodeForVerticalAlignment.has(H[m])){var Z=this.dummyToNodeForVerticalAlignment.get(H[m]);st+=Z.length*this.idToNodeMap.get(Z[0]).displacementX,dt+=Z.length}else st+=this.idToNodeMap.get(H[m]).displacementX,dt++;var ut=st/dt;for(var m=0;m<H.length;m++)if(this.dummyToNodeForVerticalAlignment.has(H[m]))this.dummyToNodeForVerticalAlignment.get(H[m]).forEach(function(K){s.idToNodeMap.get(K).displacementX=ut});else this.idToNodeMap.get(H[m]).displacementX=ut}}for(var E=0;E<this.componentsOnVertical.length;E++){var H=this.componentsOnVertical[E];if(this.fixedComponentsOnVertical[E])for(var m=0;m<H.length;m++)if(this.dummyToNodeForHorizontalAlignment.has(H[m]))this.dummyToNodeForHorizontalAlignment.get(H[m]).forEach(function(et){s.idToNodeMap.get(et).displacementY=0});else this.idToNodeMap.get(H[m]).displacementY=0;else{var st=0,dt=0;for(var m=0;m<H.length;m++)if(this.dummyToNodeForHorizontalAlignment.has(H[m])){var Z=this.dummyToNodeForHorizontalAlignment.get(H[m]);st+=Z.length*this.idToNodeMap.get(Z[0]).displacementY,dt+=Z.length}else st+=this.idToNodeMap.get(H[m]).displacementY,dt++;var ut=st/dt;for(var m=0;m<H.length;m++)if(this.dummyToNodeForHorizontalAlignment.has(H[m]))this.dummyToNodeForHorizontalAlignment.get(H[m]).forEach(function(Pt){s.idToNodeMap.get(Pt).displacementY=ut});else this.idToNodeMap.get(H[m]).displacementY=ut}}}},G.prototype.calculateNodesToApplyGravitationTo=function(){var s=[],L,E=this.graphManager.getGraphs(),M=E.length,m;for(m=0;m<M;m++)if(L=E[m],L.updateConnected(),!L.isConnected)s=s.concat(L.getNodes());return s},G.prototype.createBendpoints=function(){var s=[];s=s.concat(this.graphManager.getAllEdges());var L=new Set,E;for(E=0;E<s.length;E++){var M=s[E];if(!L.has(M)){var m=M.getSource(),Y=M.getTarget();if(m==Y)M.getBendpoints().push(new N),M.getBendpoints().push(new N),this.createDummyNodesForBendpoints(M),L.add(M);else{var b=[];if(b=b.concat(m.getEdgeListToNode(Y)),b=b.concat(Y.getEdgeListToNode(m)),!L.has(b[0])){if(b.length>1){var k;for(k=0;k<b.length;k++){var B=b[k];B.getBendpoints().push(new N),this.createDummyNodesForBendpoints(B)}}b.forEach(function(H){L.add(H)})}}}if(L.size==s.length)break}},G.prototype.positionNodesRadially=function(s){var L=new T(0,0),E=Math.ceil(Math.sqrt(s.length)),M=0,m=0,Y=0,b=new N(0,0);for(var k=0;k<s.length;k++){if(k%E==0){if(Y=0,m=M,k!=0)m+=g.DEFAULT_COMPONENT_SEPERATION;M=0}var B=s[k],H=X.findCenterOfTree(B);if(L.x=Y,L.y=m,b=G.radialLayout(B,H,L),b.y>M)M=Math.floor(b.y);Y=Math.floor(b.x+g.DEFAULT_COMPONENT_SEPERATION)}this.transform(new N(O.WORLD_CENTER_X-b.x/2,O.WORLD_CENTER_Y-b.y/2))},G.radialLayout=function(s,L,E){var M=Math.max(this.maxDiagonalInTree(s),g.DEFAULT_RADIAL_SEPARATION);G.branchRadialLayout(L,null,0,359,0,M);var m=_.calculateBounds(s),Y=new Q;Y.setDeviceOrgX(m.getMinX()),Y.setDeviceOrgY(m.getMinY()),Y.setWorldOrgX(E.x),Y.setWorldOrgY(E.y);for(var b=0;b<s.length;b++){var k=s[b];k.transform(Y)}var B=new N(m.getMaxX(),m.getMaxY());return Y.inverseTransformPoint(B)},G.branchRadialLayout=function(s,L,E,M,m,Y){var b=(M-E+1)/2;if(b<0)b+=180;var k=(b+E)%360,B=k*W.TWO_PI/360,H=Math.cos(B),st=m*Math.cos(B),dt=m*Math.sin(B);s.setCenter(st,dt);var Z=[];Z=Z.concat(s.getEdges());var ut=Z.length;if(L!=null)ut--;var nt=0,S=Z.length,K,et=s.getEdgesBetween(L);while(et.length>1){var ct=et[0];et.splice(0,1);var Nt=Z.indexOf(ct);if(Nt>=0)Z.splice(Nt,1);S--,ut--}if(L!=null)K=(Z.indexOf(et[0])+1)%S;else K=0;var Pt=Math.abs(M-E)/ut;for(var Bt=K;nt!=ut;Bt=++Bt%S){var ft=Z[Bt].getOtherEnd(s);if(ft==L)continue;var Jt=(E+nt*Pt)%360,Xt=(Jt+Pt)%360;G.branchRadialLayout(ft,s,Jt,Xt,m+Y,Y),nt++}},G.maxDiagonalInTree=function(s){var L=x.MIN_VALUE;for(var E=0;E<s.length;E++){var M=s[E],m=M.getDiagonal();if(m>L)L=m}return L},G.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},G.prototype.groupZeroDegreeMembers=function(){var s=this,L={};this.memberGroups={},this.idToDummyNode={};var E=[],M=this.graphManager.getAllNodes();for(var m=0;m<M.length;m++){var Y=M[m],b=Y.getParent();if(this.getNodeDegreeWithChildren(Y)===0&&(b.id==null||!this.getToBeTiled(b)))E.push(Y)}for(var m=0;m<E.length;m++){var Y=E[m],k=Y.getParent().id;if(typeof L[k]>"u")L[k]=[];L[k]=L[k].concat(Y)}Object.keys(L).forEach(function(B){if(L[B].length>1){var H="DummyCompound_"+B;s.memberGroups[H]=L[B];var st=L[B][0].getParent(),dt=new i(s.graphManager);dt.id=H,dt.paddingLeft=st.paddingLeft||0,dt.paddingRight=st.paddingRight||0,dt.paddingBottom=st.paddingBottom||0,dt.paddingTop=st.paddingTop||0,s.idToDummyNode[H]=dt;var Z=s.getGraphManager().add(s.newGraph(),dt),ut=st.getChild();ut.add(dt);for(var nt=0;nt<L[B].length;nt++){var S=L[B][nt];ut.remove(S),Z.add(S)}}})},G.prototype.clearCompounds=function(){var s={},L={};this.performDFSOnCompounds();for(var E=0;E<this.compoundOrder.length;E++)L[this.compoundOrder[E].id]=this.compoundOrder[E],s[this.compoundOrder[E].id]=[].concat(this.compoundOrder[E].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[E].getChild()),this.compoundOrder[E].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(s,L)},G.prototype.clearZeroDegreeMembers=function(){var s=this,L=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(E){var M=s.idToDummyNode[E];if(L[E]=s.tileNodes(s.memberGroups[E],M.paddingLeft+M.paddingRight),M.rect.width=L[E].width,M.rect.height=L[E].height,M.setCenter(L[E].centerX,L[E].centerY),M.labelMarginLeft=0,M.labelMarginTop=0,g.NODE_DIMENSIONS_INCLUDE_LABELS){var m=M.rect.width,Y=M.rect.height;if(M.labelWidth){if(M.labelPosHorizontal=="left")M.rect.x-=M.labelWidth,M.setWidth(m+M.labelWidth),M.labelMarginLeft=M.labelWidth;else if(M.labelPosHorizontal=="center"&&M.labelWidth>m)M.rect.x-=(M.labelWidth-m)/2,M.setWidth(M.labelWidth),M.labelMarginLeft=(M.labelWidth-m)/2;else if(M.labelPosHorizontal=="right")M.setWidth(m+M.labelWidth)}if(M.labelHeight){if(M.labelPosVertical=="top")M.rect.y-=M.labelHeight,M.setHeight(Y+M.labelHeight),M.labelMarginTop=M.labelHeight;else if(M.labelPosVertical=="center"&&M.labelHeight>Y)M.rect.y-=(M.labelHeight-Y)/2,M.setHeight(M.labelHeight),M.labelMarginTop=(M.labelHeight-Y)/2;else if(M.labelPosVertical=="bottom")M.setHeight(Y+M.labelHeight)}}})},G.prototype.repopulateCompounds=function(){for(var s=this.compoundOrder.length-1;s>=0;s--){var L=this.compoundOrder[s],{id:E,paddingLeft:M,paddingTop:m,labelMarginLeft:Y,labelMarginTop:b}=L;this.adjustLocations(this.tiledMemberPack[E],L.rect.x,L.rect.y,M,m,Y,b)}},G.prototype.repopulateZeroDegreeMembers=function(){var s=this,L=this.tiledZeroDegreePack;Object.keys(L).forEach(function(E){var M=s.idToDummyNode[E],{paddingLeft:m,paddingTop:Y,labelMarginLeft:b,labelMarginTop:k}=M;s.adjustLocations(L[E],M.rect.x,M.rect.y,m,Y,b,k)})},G.prototype.getToBeTiled=function(s){var L=s.id;if(this.toBeTiled[L]!=null)return this.toBeTiled[L];var E=s.getChild();if(E==null)return this.toBeTiled[L]=!1,!1;var M=E.getNodes();for(var m=0;m<M.length;m++){var Y=M[m];if(this.getNodeDegree(Y)>0)return this.toBeTiled[L]=!1,!1;if(Y.getChild()==null){this.toBeTiled[Y.id]=!1;continue}if(!this.getToBeTiled(Y))return this.toBeTiled[L]=!1,!1}return this.toBeTiled[L]=!0,!0},G.prototype.getNodeDegree=function(s){var L=s.id,E=s.getEdges(),M=0;for(var m=0;m<E.length;m++){var Y=E[m];if(Y.getSource().id!==Y.getTarget().id)M=M+1}return M},G.prototype.getNodeDegreeWithChildren=function(s){var L=this.getNodeDegree(s);if(s.getChild()==null)return L;var E=s.getChild().getNodes();for(var M=0;M<E.length;M++){var m=E[M];L+=this.getNodeDegreeWithChildren(m)}return L},G.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},G.prototype.fillCompexOrderByDFS=function(s){for(var L=0;L<s.length;L++){var E=s[L];if(E.getChild()!=null)this.fillCompexOrderByDFS(E.getChild().getNodes());if(this.getToBeTiled(E))this.compoundOrder.push(E)}},G.prototype.adjustLocations=function(s,L,E,M,m,Y,b){L+=M+Y,E+=m+b;var k=L;for(var B=0;B<s.rows.length;B++){var H=s.rows[B];L=k;var st=0;for(var dt=0;dt<H.length;dt++){var Z=H[dt];if(Z.rect.x=L,Z.rect.y=E,L+=Z.rect.width+s.horizontalPadding,Z.rect.height>st)st=Z.rect.height}E+=st+s.verticalPadding}},G.prototype.tileCompoundMembers=function(s,L){var E=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(M){var m=L[M];if(E.tiledMemberPack[M]=E.tileNodes(s[M],m.paddingLeft+m.paddingRight),m.rect.width=E.tiledMemberPack[M].width,m.rect.height=E.tiledMemberPack[M].height,m.setCenter(E.tiledMemberPack[M].centerX,E.tiledMemberPack[M].centerY),m.labelMarginLeft=0,m.labelMarginTop=0,g.NODE_DIMENSIONS_INCLUDE_LABELS){var Y=m.rect.width,b=m.rect.height;if(m.labelWidth){if(m.labelPosHorizontal=="left")m.rect.x-=m.labelWidth,m.setWidth(Y+m.labelWidth),m.labelMarginLeft=m.labelWidth;else if(m.labelPosHorizontal=="center"&&m.labelWidth>Y)m.rect.x-=(m.labelWidth-Y)/2,m.setWidth(m.labelWidth),m.labelMarginLeft=(m.labelWidth-Y)/2;else if(m.labelPosHorizontal=="right")m.setWidth(Y+m.labelWidth)}if(m.labelHeight){if(m.labelPosVertical=="top")m.rect.y-=m.labelHeight,m.setHeight(b+m.labelHeight),m.labelMarginTop=m.labelHeight;else if(m.labelPosVertical=="center"&&m.labelHeight>b)m.rect.y-=(m.labelHeight-b)/2,m.setHeight(m.labelHeight),m.labelMarginTop=(m.labelHeight-b)/2;else if(m.labelPosVertical=="bottom")m.setHeight(b+m.labelHeight)}}})},G.prototype.tileNodes=function(s,L){var E=this.tileNodesByFavoringDim(s,L,!0),M=this.tileNodesByFavoringDim(s,L,!1),m=this.getOrgRatio(E),Y=this.getOrgRatio(M),b;if(Y<m)b=M;else b=E;return b},G.prototype.getOrgRatio=function(s){var{width:L,height:E}=s,M=L/E;if(M<1)M=1/M;return M},G.prototype.calcIdealRowWidth=function(s,L){var{TILING_PADDING_VERTICAL:E,TILING_PADDING_HORIZONTAL:M}=g,m=s.length,Y=0,b=0,k=0;s.forEach(function(nt){if(Y+=nt.getWidth(),b+=nt.getHeight(),nt.getWidth()>k)k=nt.getWidth()});var B=Y/m,H=b/m,st=Math.pow(E-M,2)+4*(B+M)*(H+E)*m,dt=(M-E+Math.sqrt(st))/(2*(B+M)),Z;if(L){if(Z=Math.ceil(dt),Z==dt)Z++}else Z=Math.floor(dt);var ut=Z*(B+M)-M;if(k>ut)ut=k;return ut+=M*2,ut},G.prototype.tileNodesByFavoringDim=function(s,L,E){var{TILING_PADDING_VERTICAL:M,TILING_PADDING_HORIZONTAL:m,TILING_COMPARE_BY:Y}=g,b={rows:[],rowWidth:[],rowHeight:[],width:0,height:L,verticalPadding:M,horizontalPadding:m,centerX:0,centerY:0};if(Y)b.idealRowWidth=this.calcIdealRowWidth(s,E);var k=function(S){return S.rect.width*S.rect.height},B=function(S,K){return k(K)-k(S)};s.sort(function(nt,S){var K=B;if(b.idealRowWidth)return K=Y,K(nt.id,S.id);return K(nt,S)});var H=0,st=0;for(var dt=0;dt<s.length;dt++){var Z=s[dt];H+=Z.getCenterX(),st+=Z.getCenterY()}b.centerX=H/s.length,b.centerY=st/s.length;for(var dt=0;dt<s.length;dt++){var Z=s[dt];if(b.rows.length==0)this.insertNodeToRow(b,Z,0,L);else if(this.canAddHorizontal(b,Z.rect.width,Z.rect.height)){var ut=b.rows.length-1;if(!b.idealRowWidth)ut=this.getShortestRowIndex(b);this.insertNodeToRow(b,Z,ut,L)}else this.insertNodeToRow(b,Z,b.rows.length,L);this.shiftToLastRow(b)}return b},G.prototype.insertNodeToRow=function(s,L,E,M){var m=M;if(E==s.rows.length){var Y=[];s.rows.push(Y),s.rowWidth.push(m),s.rowHeight.push(0)}var b=s.rowWidth[E]+L.rect.width;if(s.rows[E].length>0)b+=s.horizontalPadding;if(s.rowWidth[E]=b,s.width<b)s.width=b;var k=L.rect.height;if(E>0)k+=s.verticalPadding;var B=0;if(k>s.rowHeight[E])B=s.rowHeight[E],s.rowHeight[E]=k,B=s.rowHeight[E]-B;s.height+=B,s.rows[E].push(L)},G.prototype.getShortestRowIndex=function(s){var L=-1,E=Number.MAX_VALUE;for(var M=0;M<s.rows.length;M++)if(s.rowWidth[M]<E)L=M,E=s.rowWidth[M];return L},G.prototype.getLongestRowIndex=function(s){var L=-1,E=Number.MIN_VALUE;for(var M=0;M<s.rows.length;M++)if(s.rowWidth[M]>E)L=M,E=s.rowWidth[M];return L},G.prototype.canAddHorizontal=function(s,L,E){if(s.idealRowWidth){var M=s.rows.length-1,m=s.rowWidth[M];return m+L+s.horizontalPadding<=s.idealRowWidth}var Y=this.getShortestRowIndex(s);if(Y<0)return!0;var b=s.rowWidth[Y];if(b+s.horizontalPadding+L<=s.width)return!0;var k=0;if(s.rowHeight[Y]<E){if(Y>0)k=E+s.verticalPadding-s.rowHeight[Y]}var B;if(s.width-b>=L+s.horizontalPadding)B=(s.height+k)/(b+L+s.horizontalPadding);else B=(s.height+k)/s.width;k=E+s.verticalPadding;var H;if(s.width<L)H=(s.height+k)/L;else H=(s.height+k)/s.width;if(H<1)H=1/H;if(B<1)B=1/B;return B<H},G.prototype.shiftToLastRow=function(s){var L=this.getLongestRowIndex(s),E=s.rowWidth.length-1,M=s.rows[L],m=M[M.length-1],Y=m.width+s.horizontalPadding;if(s.width-s.rowWidth[E]>Y&&L!=E){M.splice(-1,1),s.rows[E].push(m),s.rowWidth[L]=s.rowWidth[L]-Y,s.rowWidth[E]=s.rowWidth[E]+Y,s.width=s.rowWidth[instance.getLongestRowIndex(s)];var b=Number.MIN_VALUE;for(var k=0;k<M.length;k++)if(M[k].height>b)b=M[k].height;if(L>0)b+=s.verticalPadding;var B=s.rowHeight[L]+s.rowHeight[E];if(s.rowHeight[L]=b,s.rowHeight[E]<m.height+s.verticalPadding)s.rowHeight[E]=m.height+s.verticalPadding;var H=s.rowHeight[L]+s.rowHeight[E];s.height+=H-B,this.shiftToLastRow(s)}},G.prototype.tilingPreLayout=function(){if(g.TILE)this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers()},G.prototype.tilingPostLayout=function(){if(g.TILE)this.repopulateZeroDegreeMembers(),this.repopulateCompounds()},G.prototype.reduceTrees=function(){var s=[],L=!0,E;while(L){var M=this.graphManager.getAllNodes(),m=[];L=!1;for(var Y=0;Y<M.length;Y++)if(E=M[Y],E.getEdges().length==1&&!E.getEdges()[0].isInterGraph&&E.getChild()==null){if(g.PURE_INCREMENTAL){var b=E.getEdges()[0].getOtherEnd(E),k=new D(E.getCenterX()-b.getCenterX(),E.getCenterY()-b.getCenterY());m.push([E,E.getEdges()[0],E.getOwner(),k])}else m.push([E,E.getEdges()[0],E.getOwner()]);L=!0}if(L==!0){var B=[];for(var H=0;H<m.length;H++)if(m[H][0].getEdges().length==1)B.push(m[H]),m[H][0].getOwner().remove(m[H][0]);s.push(B),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=s},G.prototype.growTree=function(s){var L=s.length,E=s[L-1],M;for(var m=0;m<E.length;m++)M=E[m],this.findPlaceforPrunedNode(M),M[2].add(M[0]),M[2].add(M[1],M[1].source,M[1].target);s.splice(s.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},G.prototype.findPlaceforPrunedNode=function(s){var L,E,M=s[0];if(M==s[1].source)E=s[1].target;else E=s[1].source;if(g.PURE_INCREMENTAL)M.setCenter(E.getCenterX()+s[3].getWidth(),E.getCenterY()+s[3].getHeight());else{var m=E.startX,Y=E.finishX,b=E.startY,k=E.finishY,B=0,H=0,st=0,dt=0,Z=[B,st,H,dt];if(b>0)for(var ut=m;ut<=Y;ut++)Z[0]+=this.grid[ut][b-1].length+this.grid[ut][b].length-1;if(Y<this.grid.length-1)for(var ut=b;ut<=k;ut++)Z[1]+=this.grid[Y+1][ut].length+this.grid[Y][ut].length-1;if(k<this.grid[0].length-1)for(var ut=m;ut<=Y;ut++)Z[2]+=this.grid[ut][k+1].length+this.grid[ut][k].length-1;if(m>0)for(var ut=b;ut<=k;ut++)Z[3]+=this.grid[m-1][ut].length+this.grid[m][ut].length-1;var nt=x.MAX_VALUE,S,K;for(var et=0;et<Z.length;et++)if(Z[et]<nt)nt=Z[et],S=1,K=et;else if(Z[et]==nt)S++;if(S==3&&nt==0){if(Z[0]==0&&Z[1]==0&&Z[2]==0)L=1;else if(Z[0]==0&&Z[1]==0&&Z[3]==0)L=0;else if(Z[0]==0&&Z[2]==0&&Z[3]==0)L=3;else if(Z[1]==0&&Z[2]==0&&Z[3]==0)L=2}else if(S==2&&nt==0){var ct=Math.floor(Math.random()*2);if(Z[0]==0&&Z[1]==0)if(ct==0)L=0;else L=1;else if(Z[0]==0&&Z[2]==0)if(ct==0)L=0;else L=2;else if(Z[0]==0&&Z[3]==0)if(ct==0)L=0;else L=3;else if(Z[1]==0&&Z[2]==0)if(ct==0)L=1;else L=2;else if(Z[1]==0&&Z[3]==0)if(ct==0)L=1;else L=3;else if(ct==0)L=2;else L=3}else if(S==4&&nt==0){var ct=Math.floor(Math.random()*4);L=ct}else L=K;if(L==0)M.setCenter(E.getCenterX(),E.getCenterY()-E.getHeight()/2-c.DEFAULT_EDGE_LENGTH-M.getHeight()/2);else if(L==1)M.setCenter(E.getCenterX()+E.getWidth()/2+c.DEFAULT_EDGE_LENGTH+M.getWidth()/2,E.getCenterY());else if(L==2)M.setCenter(E.getCenterX(),E.getCenterY()+E.getHeight()/2+c.DEFAULT_EDGE_LENGTH+M.getHeight()/2);else M.setCenter(E.getCenterX()-E.getWidth()/2-c.DEFAULT_EDGE_LENGTH-M.getWidth()/2,E.getCenterY())}},o.exports=G},991:(o,n,a)=>{var u=a(551).FDLayoutNode,r=a(551).IMath;function y(e,g,d,c){u.call(this,e,g,d,c)}y.prototype=Object.create(u.prototype);for(var i in u)y[i]=u[i];y.prototype.calculateDisplacement=function(){var e=this.graphManager.getLayout();if(this.getChild()!=null&&this.fixedNodeWeight)this.displacementX+=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight;else this.displacementX+=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren;if(Math.abs(this.displacementX)>e.coolingFactor*e.maxNodeDisplacement)this.displacementX=e.coolingFactor*e.maxNodeDisplacement*r.sign(this.displacementX);if(Math.abs(this.displacementY)>e.coolingFactor*e.maxNodeDisplacement)this.displacementY=e.coolingFactor*e.maxNodeDisplacement*r.sign(this.displacementY);if(this.child&&this.child.getNodes().length>0)this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},y.prototype.propogateDisplacementToChildren=function(e,g){var d=this.getChild().getNodes(),c;for(var O=0;O<d.length;O++)if(c=d[O],c.getChild()==null)c.displacementX+=e,c.displacementY+=g;else c.propogateDisplacementToChildren(e,g)},y.prototype.move=function(){var e=this.graphManager.getLayout();if(this.child==null||this.child.getNodes().length==0)this.moveBy(this.displacementX,this.displacementY),e.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},y.prototype.setPred1=function(e){this.pred1=e},y.prototype.getPred1=function(){return pred1},y.prototype.getPred2=function(){return pred2},y.prototype.setNext=function(e){this.next=e},y.prototype.getNext=function(){return next},y.prototype.setProcessed=function(e){this.processed=e},y.prototype.isProcessed=function(){return processed},o.exports=y},902:(o,n,a)=>{function u(d){if(Array.isArray(d)){for(var c=0,O=Array(d.length);c<d.length;c++)O[c]=d[c];return O}else return Array.from(d)}var r=a(806),y=a(551).LinkedList,i=a(551).Matrix,e=a(551).SVD;function g(){}g.handleConstraints=function(d){var c={};c.fixedNodeConstraint=d.constraints.fixedNodeConstraint,c.alignmentConstraint=d.constraints.alignmentConstraint,c.relativePlacementConstraint=d.constraints.relativePlacementConstraint;var O=new Map,T=new Map,N=[],D=[],X=d.getAllNodes(),x=0;for(var W=0;W<X.length;W++){var _=X[W];if(_.getChild()==null)T.set(_.id,x++),N.push(_.getCenterX()),D.push(_.getCenterY()),O.set(_.id,_)}if(c.relativePlacementConstraint)c.relativePlacementConstraint.forEach(function(J){if(!J.gap&&J.gap!=0)if(J.left)J.gap=r.DEFAULT_EDGE_LENGTH+O.get(J.left).getWidth()/2+O.get(J.right).getWidth()/2;else J.gap=r.DEFAULT_EDGE_LENGTH+O.get(J.top).getHeight()/2+O.get(J.bottom).getHeight()/2});var Q=function(rt,it){return{x:rt.x-it.x,y:rt.y-it.y}},lt=function(rt){var it=0,at=0;return rt.forEach(function(ot){it+=N[T.get(ot)],at+=D[T.get(ot)]}),{x:it/rt.size,y:at/rt.size}},G=function(rt,it,at,ot,gt){function At(Tt,yt){var Dt=new Set(Tt),mt=!0,wt=!1,Zt=void 0;try{for(var Vt=yt[Symbol.iterator](),re;!(mt=(re=Vt.next()).done);mt=!0){var Wt=re.value;Dt.add(Wt)}}catch(bt){wt=!0,Zt=bt}finally{try{if(!mt&&Vt.return)Vt.return()}finally{if(wt)throw Zt}}return Dt}var Mt=new Map;rt.forEach(function(Tt,yt){Mt.set(yt,0)}),rt.forEach(function(Tt,yt){Tt.forEach(function(Dt){Mt.set(Dt.id,Mt.get(Dt.id)+1)})});var ht=new Map,Lt=new Map,Ct=new y;if(Mt.forEach(function(Tt,yt){if(Tt==0){if(Ct.push(yt),!at)if(it=="horizontal")ht.set(yt,T.has(yt)?N[T.get(yt)]:ot.get(yt));else ht.set(yt,T.has(yt)?D[T.get(yt)]:ot.get(yt))}else ht.set(yt,Number.NEGATIVE_INFINITY);if(at)Lt.set(yt,new Set([yt]))}),at)gt.forEach(function(Tt){var yt=[];if(Tt.forEach(function(wt){if(at.has(wt))yt.push(wt)}),yt.length>0){var Dt=0;yt.forEach(function(wt){if(it=="horizontal")ht.set(wt,T.has(wt)?N[T.get(wt)]:ot.get(wt)),Dt+=ht.get(wt);else ht.set(wt,T.has(wt)?D[T.get(wt)]:ot.get(wt)),Dt+=ht.get(wt)}),Dt=Dt/yt.length,Tt.forEach(function(wt){if(!at.has(wt))ht.set(wt,Dt)})}else{var mt=0;Tt.forEach(function(wt){if(it=="horizontal")mt+=T.has(wt)?N[T.get(wt)]:ot.get(wt);else mt+=T.has(wt)?D[T.get(wt)]:ot.get(wt)}),mt=mt/Tt.length,Tt.forEach(function(wt){ht.set(wt,mt)})}});var pt=function(){var yt=Ct.shift(),Dt=rt.get(yt);Dt.forEach(function(mt){if(ht.get(mt.id)<ht.get(yt)+mt.gap)if(at&&at.has(mt.id)){var wt=void 0;if(it=="horizontal")wt=T.has(mt.id)?N[T.get(mt.id)]:ot.get(mt.id);else wt=T.has(mt.id)?D[T.get(mt.id)]:ot.get(mt.id);if(ht.set(mt.id,wt),wt<ht.get(yt)+mt.gap){var Zt=ht.get(yt)+mt.gap-wt;Lt.get(yt).forEach(function(Vt){ht.set(Vt,ht.get(Vt)-Zt)})}}else ht.set(mt.id,ht.get(yt)+mt.gap);if(Mt.set(mt.id,Mt.get(mt.id)-1),Mt.get(mt.id)==0)Ct.push(mt.id);if(at)Lt.set(mt.id,At(Lt.get(yt),Lt.get(mt.id)))})};while(Ct.length!=0)pt();if(at){var Ot=new Set;rt.forEach(function(Tt,yt){if(Tt.length==0)Ot.add(yt)});var Ut=[];Lt.forEach(function(Tt,yt){if(Ot.has(yt)){var Dt=!1,mt=!0,wt=!1,Zt=void 0;try{for(var Vt=Tt[Symbol.iterator](),re;!(mt=(re=Vt.next()).done);mt=!0){var Wt=re.value;if(at.has(Wt))Dt=!0}}catch($t){wt=!0,Zt=$t}finally{try{if(!mt&&Vt.return)Vt.return()}finally{if(wt)throw Zt}}if(!Dt){var bt=!1,ae=void 0;if(Ut.forEach(function($t,jt){if($t.has([].concat(u(Tt))[0]))bt=!0,ae=jt}),!bt)Ut.push(new Set(Tt));else Tt.forEach(function($t){Ut[ae].add($t)})}}}),Ut.forEach(function(Tt,yt){var{POSITIVE_INFINITY:Dt,POSITIVE_INFINITY:mt,NEGATIVE_INFINITY:wt,NEGATIVE_INFINITY:Zt}=Number,Vt=!0,re=!1,Wt=void 0;try{for(var bt=Tt[Symbol.iterator](),ae;!(Vt=(ae=bt.next()).done);Vt=!0){var $t=ae.value,jt=void 0;if(it=="horizontal")jt=T.has($t)?N[T.get($t)]:ot.get($t);else jt=T.has($t)?D[T.get($t)]:ot.get($t);var ie=ht.get($t);if(jt<Dt)Dt=jt;if(jt>wt)wt=jt;if(ie<mt)mt=ie;if(ie>Zt)Zt=ie}}catch(ve){re=!0,Wt=ve}finally{try{if(!Vt&&bt.return)bt.return()}finally{if(re)throw Wt}}var Me=(Dt+wt)/2-(mt+Zt)/2,le=!0,ce=!1,ge=void 0;try{for(var fe=Tt[Symbol.iterator](),Le;!(le=(Le=fe.next()).done);le=!0){var de=Le.value;ht.set(de,ht.get(de)+Me)}}catch(ve){ce=!0,ge=ve}finally{try{if(!le&&fe.return)fe.return()}finally{if(ce)throw ge}}})}return ht},tt=function(rt){var it=0,at=0,ot=0,gt=0;if(rt.forEach(function(Lt){if(Lt.left)N[T.get(Lt.left)]-N[T.get(Lt.right)]>=0?it++:at++;else D[T.get(Lt.top)]-D[T.get(Lt.bottom)]>=0?ot++:gt++}),it>at&&ot>gt)for(var At=0;At<T.size;At++)N[At]=-1*N[At],D[At]=-1*D[At];else if(it>at)for(var Mt=0;Mt<T.size;Mt++)N[Mt]=-1*N[Mt];else if(ot>gt)for(var ht=0;ht<T.size;ht++)D[ht]=-1*D[ht]},s=function(rt){var it=[],at=new y,ot=new Set,gt=0;return rt.forEach(function(At,Mt){if(!ot.has(Mt)){it[gt]=[];var ht=Mt;at.push(ht),ot.add(ht),it[gt].push(ht);while(at.length!=0){ht=at.shift();var Lt=rt.get(ht);Lt.forEach(function(Ct){if(!ot.has(Ct.id))at.push(Ct.id),ot.add(Ct.id),it[gt].push(Ct.id)})}gt++}}),it},L=function(rt){var it=new Map;return rt.forEach(function(at,ot){it.set(ot,[])}),rt.forEach(function(at,ot){at.forEach(function(gt){it.get(ot).push(gt),it.get(gt.id).push({id:ot,gap:gt.gap,direction:gt.direction})})}),it},E=function(rt){var it=new Map;return rt.forEach(function(at,ot){it.set(ot,[])}),rt.forEach(function(at,ot){at.forEach(function(gt){it.get(gt.id).push({id:ot,gap:gt.gap,direction:gt.direction})})}),it},M=[],m=[],Y=!1,b=!1,k=new Set,B=new Map,H=new Map,st=[];if(c.fixedNodeConstraint)c.fixedNodeConstraint.forEach(function(J){k.add(J.nodeId)});if(c.relativePlacementConstraint)c.relativePlacementConstraint.forEach(function(J){if(J.left){if(B.has(J.left))B.get(J.left).push({id:J.right,gap:J.gap,direction:"horizontal"});else B.set(J.left,[{id:J.right,gap:J.gap,direction:"horizontal"}]);if(!B.has(J.right))B.set(J.right,[])}else{if(B.has(J.top))B.get(J.top).push({id:J.bottom,gap:J.gap,direction:"vertical"});else B.set(J.top,[{id:J.bottom,gap:J.gap,direction:"vertical"}]);if(!B.has(J.bottom))B.set(J.bottom,[])}}),H=L(B),st=s(H);if(r.TRANSFORM_ON_CONSTRAINT_HANDLING){if(c.fixedNodeConstraint&&c.fixedNodeConstraint.length>1)c.fixedNodeConstraint.forEach(function(J,rt){M[rt]=[J.position.x,J.position.y],m[rt]=[N[T.get(J.nodeId)],D[T.get(J.nodeId)]]}),Y=!0;else if(c.alignmentConstraint)(function(){var J=0;if(c.alignmentConstraint.vertical){var rt=c.alignmentConstraint.vertical,it=function(ht){var Lt=new Set;rt[ht].forEach(function(Ot){Lt.add(Ot)});var Ct=new Set([].concat(u(Lt)).filter(function(Ot){return k.has(Ot)})),pt=void 0;if(Ct.size>0)pt=N[T.get(Ct.values().next().value)];else pt=lt(Lt).x;rt[ht].forEach(function(Ot){M[J]=[pt,D[T.get(Ot)]],m[J]=[N[T.get(Ot)],D[T.get(Ot)]],J++})};for(var at=0;at<rt.length;at++)it(at);Y=!0}if(c.alignmentConstraint.horizontal){var ot=c.alignmentConstraint.horizontal,gt=function(ht){var Lt=new Set;ot[ht].forEach(function(Ot){Lt.add(Ot)});var Ct=new Set([].concat(u(Lt)).filter(function(Ot){return k.has(Ot)})),pt=void 0;if(Ct.size>0)pt=N[T.get(Ct.values().next().value)];else pt=lt(Lt).y;ot[ht].forEach(function(Ot){M[J]=[N[T.get(Ot)],pt],m[J]=[N[T.get(Ot)],D[T.get(Ot)]],J++})};for(var At=0;At<ot.length;At++)gt(At);Y=!0}if(c.relativePlacementConstraint)b=!0})();else if(c.relativePlacementConstraint){var dt=0,Z=0;for(var ut=0;ut<st.length;ut++)if(st[ut].length>dt)dt=st[ut].length,Z=ut;if(dt<H.size/2)tt(c.relativePlacementConstraint),Y=!1,b=!1;else{var nt=new Map,S=new Map,K=[];st[Z].forEach(function(J){B.get(J).forEach(function(rt){if(rt.direction=="horizontal"){if(nt.has(J))nt.get(J).push(rt);else nt.set(J,[rt]);if(!nt.has(rt.id))nt.set(rt.id,[]);K.push({left:J,right:rt.id})}else{if(S.has(J))S.get(J).push(rt);else S.set(J,[rt]);if(!S.has(rt.id))S.set(rt.id,[]);K.push({top:J,bottom:rt.id})}})}),tt(K),b=!1;var et=G(nt,"horizontal"),ct=G(S,"vertical");st[Z].forEach(function(J,rt){if(m[rt]=[N[T.get(J)],D[T.get(J)]],M[rt]=[],et.has(J))M[rt][0]=et.get(J);else M[rt][0]=N[T.get(J)];if(ct.has(J))M[rt][1]=ct.get(J);else M[rt][1]=D[T.get(J)]}),Y=!0}}if(Y){var Nt=void 0,Pt=i.transpose(M),Bt=i.transpose(m);for(var ft=0;ft<Pt.length;ft++)Pt[ft]=i.multGamma(Pt[ft]),Bt[ft]=i.multGamma(Bt[ft]);var Jt=i.multMat(Pt,i.transpose(Bt)),Xt=e.svd(Jt);Nt=i.multMat(Xt.V,i.transpose(Xt.U));for(var Et=0;Et<T.size;Et++){var vt=[N[Et],D[Et]],xt=[Nt[0][0],Nt[1][0]],Rt=[Nt[0][1],Nt[1][1]];N[Et]=i.dotProduct(vt,xt),D[Et]=i.dotProduct(vt,Rt)}if(b)tt(c.relativePlacementConstraint)}}if(r.ENFORCE_CONSTRAINTS){if(c.fixedNodeConstraint&&c.fixedNodeConstraint.length>0){var Gt={x:0,y:0};c.fixedNodeConstraint.forEach(function(J,rt){var it={x:N[T.get(J.nodeId)],y:D[T.get(J.nodeId)]},at=J.position,ot=Q(at,it);Gt.x+=ot.x,Gt.y+=ot.y}),Gt.x/=c.fixedNodeConstraint.length,Gt.y/=c.fixedNodeConstraint.length,N.forEach(function(J,rt){N[rt]+=Gt.x}),D.forEach(function(J,rt){D[rt]+=Gt.y}),c.fixedNodeConstraint.forEach(function(J){N[T.get(J.nodeId)]=J.position.x,D[T.get(J.nodeId)]=J.position.y})}if(c.alignmentConstraint){if(c.alignmentConstraint.vertical){var St=c.alignmentConstraint.vertical,Ft=function(rt){var it=new Set;St[rt].forEach(function(gt){it.add(gt)});var at=new Set([].concat(u(it)).filter(function(gt){return k.has(gt)})),ot=void 0;if(at.size>0)ot=N[T.get(at.values().next().value)];else ot=lt(it).x;it.forEach(function(gt){if(!k.has(gt))N[T.get(gt)]=ot})};for(var Ht=0;Ht<St.length;Ht++)Ft(Ht)}if(c.alignmentConstraint.horizontal){var zt=c.alignmentConstraint.horizontal,te=function(rt){var it=new Set;zt[rt].forEach(function(gt){it.add(gt)});var at=new Set([].concat(u(it)).filter(function(gt){return k.has(gt)})),ot=void 0;if(at.size>0)ot=D[T.get(at.values().next().value)];else ot=lt(it).y;it.forEach(function(gt){if(!k.has(gt))D[T.get(gt)]=ot})};for(var qt=0;qt<zt.length;qt++)te(qt)}}if(c.relativePlacementConstraint)(function(){var J=new Map,rt=new Map,it=new Map,at=new Map,ot=new Map,gt=new Map,At=new Set,Mt=new Set;if(k.forEach(function(Qt){At.add(Qt),Mt.add(Qt)}),c.alignmentConstraint){if(c.alignmentConstraint.vertical){var ht=c.alignmentConstraint.vertical,Lt=function(It){it.set("dummy"+It,[]),ht[It].forEach(function(Yt){if(J.set(Yt,"dummy"+It),it.get("dummy"+It).push(Yt),k.has(Yt))At.add("dummy"+It)}),ot.set("dummy"+It,N[T.get(ht[It][0])])};for(var Ct=0;Ct<ht.length;Ct++)Lt(Ct)}if(c.alignmentConstraint.horizontal){var pt=c.alignmentConstraint.horizontal,Ot=function(It){at.set("dummy"+It,[]),pt[It].forEach(function(Yt){if(rt.set(Yt,"dummy"+It),at.get("dummy"+It).push(Yt),k.has(Yt))Mt.add("dummy"+It)}),gt.set("dummy"+It,D[T.get(pt[It][0])])};for(var Ut=0;Ut<pt.length;Ut++)Ot(Ut)}}var Tt=new Map,yt=new Map,Dt=function(It){B.get(It).forEach(function(Yt){var oe=void 0,ne=void 0;if(Yt.direction=="horizontal"){if(oe=J.get(It)?J.get(It):It,J.get(Yt.id))ne={id:J.get(Yt.id),gap:Yt.gap,direction:Yt.direction};else ne=Yt;if(Tt.has(oe))Tt.get(oe).push(ne);else Tt.set(oe,[ne]);if(!Tt.has(ne.id))Tt.set(ne.id,[])}else{if(oe=rt.get(It)?rt.get(It):It,rt.get(Yt.id))ne={id:rt.get(Yt.id),gap:Yt.gap,direction:Yt.direction};else ne=Yt;if(yt.has(oe))yt.get(oe).push(ne);else yt.set(oe,[ne]);if(!yt.has(ne.id))yt.set(ne.id,[])}})},mt=!0,wt=!1,Zt=void 0;try{for(var Vt=B.keys()[Symbol.iterator](),re;!(mt=(re=Vt.next()).done);mt=!0){var Wt=re.value;Dt(Wt)}}catch(Qt){wt=!0,Zt=Qt}finally{try{if(!mt&&Vt.return)Vt.return()}finally{if(wt)throw Zt}}var bt=L(Tt),ae=L(yt),$t=s(bt),jt=s(ae),ie=E(Tt),Me=E(yt),le=[],ce=[];$t.forEach(function(Qt,It){le[It]=[],Qt.forEach(function(Yt){if(ie.get(Yt).length==0)le[It].push(Yt)})}),jt.forEach(function(Qt,It){ce[It]=[],Qt.forEach(function(Yt){if(Me.get(Yt).length==0)ce[It].push(Yt)})});var ge=G(Tt,"horizontal",At,ot,le),fe=G(yt,"vertical",Mt,gt,ce),Le=function(It){if(it.get(It))it.get(It).forEach(function(Yt){N[T.get(Yt)]=ge.get(It)});else N[T.get(It)]=ge.get(It)},de=!0,ve=!1,Xe=void 0;try{for(var Ce=ge.keys()[Symbol.iterator](),He;!(de=(He=Ce.next()).done);de=!0){var Ae=He.value;Le(Ae)}}catch(Qt){ve=!0,Xe=Qt}finally{try{if(!de&&Ce.return)Ce.return()}finally{if(ve)throw Xe}}var sr=function(It){if(at.get(It))at.get(It).forEach(function(Yt){D[T.get(Yt)]=fe.get(It)});else D[T.get(It)]=fe.get(It)},Oe=!0,We=!1,Ve=void 0;try{for(var xe=fe.keys()[Symbol.iterator](),ze;!(Oe=(ze=xe.next()).done);Oe=!0){var Ae=ze.value;sr(Ae)}}catch(Qt){We=!0,Ve=Qt}finally{try{if(!Oe&&xe.return)xe.return()}finally{if(We)throw Ve}}})()}for(var Kt=0;Kt<X.length;Kt++){var kt=X[Kt];if(kt.getChild()==null)kt.setCenter(N[T.get(kt.id)],D[T.get(kt.id)])}},o.exports=g},551:(o)=>{o.exports=w}},A={};function v(o){var n=A[o];if(n!==void 0)return n.exports;var a=A[o]={exports:{}};return I[o](a,a.exports,v),a.exports}var f=v(45);return f})()})});var $e=Bn(function(Te,Pe){(function(I,A){if(typeof Te==="object"&&typeof Pe==="object")Pe.exports=A(Fe());else if(typeof define==="function"&&define.amd)define(["cose-base"],A);else if(typeof Te==="object")Te.cytoscapeFcose=A(Fe());else I.cytoscapeFcose=A(I.coseBase)})(Te,function(w){return(()=>{var I={658:(o)=>{o.exports=Object.assign!=null?Object.assign.bind(Object):function(n){for(var a=arguments.length,u=Array(a>1?a-1:0),r=1;r<a;r++)u[r-1]=arguments[r];return u.forEach(function(y){Object.keys(y).forEach(function(i){return n[i]=y[i]})}),n}},548:(o,n,a)=>{var u=function(){function i(e,g){var d=[],c=!0,O=!1,T=void 0;try{for(var N=e[Symbol.iterator](),D;!(c=(D=N.next()).done);c=!0)if(d.push(D.value),g&&d.length===g)break}catch(X){O=!0,T=X}finally{try{if(!c&&N.return)N.return()}finally{if(O)throw T}}return d}return function(e,g){if(Array.isArray(e))return e;else if(Symbol.iterator in Object(e))return i(e,g);else throw TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=a(140).layoutBase.LinkedList,y={};y.getTopMostNodes=function(i){var e={};for(var g=0;g<i.length;g++)e[i[g].id()]=!0;var d=i.filter(function(c,O){if(typeof c==="number")c=O;var T=c.parent()[0];while(T!=null){if(e[T.id()])return!1;T=T.parent()[0]}return!0});return d},y.connectComponents=function(i,e,g,d){var c=new r,O=new Set,T=[],N=void 0,D=void 0,X=void 0,x=!1,W=1,_=[],Q=[],lt=function(){var tt=i.collection();Q.push(tt);var s=g[0],L=i.collection();L.merge(s).merge(s.descendants().intersection(e)),T.push(s),L.forEach(function(m){c.push(m),O.add(m),tt.merge(m)});var E=function(){s=c.shift();var Y=i.collection();s.neighborhood().nodes().forEach(function(H){if(e.intersection(s.edgesWith(H)).length>0)Y.merge(H)});for(var b=0;b<Y.length;b++){var k=Y[b];if(N=g.intersection(k.union(k.ancestors())),N!=null&&!O.has(N[0])){var B=N.union(N.descendants());B.forEach(function(H){if(c.push(H),O.add(H),tt.merge(H),g.has(H))T.push(H)})}}};while(c.length!=0)E();if(tt.forEach(function(m){e.intersection(m.connectedEdges()).forEach(function(Y){if(tt.has(Y.source())&&tt.has(Y.target()))tt.merge(Y)})}),T.length==g.length)x=!0;if(!x||x&&W>1){D=T[0],X=D.connectedEdges().length,T.forEach(function(m){if(m.connectedEdges().length<X)X=m.connectedEdges().length,D=m}),_.push(D.id());var M=i.collection();M.merge(T[0]),T.forEach(function(m){M.merge(m)}),T=[],g=g.difference(M),W++}};do lt();while(!x);if(d){if(_.length>0)d.set("dummy"+(d.size+1),_)}return Q},y.relocateComponent=function(i,e,g){if(!g.fixedNodeConstraint){var{POSITIVE_INFINITY:d,NEGATIVE_INFINITY:c,POSITIVE_INFINITY:O,NEGATIVE_INFINITY:T}=Number;if(g.quality=="draft"){var N=!0,D=!1,X=void 0;try{for(var x=e.nodeIndexes[Symbol.iterator](),W;!(N=(W=x.next()).done);N=!0){var _=W.value,Q=u(_,2),lt=Q[0],G=Q[1],tt=g.cy.getElementById(lt);if(tt){var s=tt.boundingBox(),L=e.xCoords[G]-s.w/2,E=e.xCoords[G]+s.w/2,M=e.yCoords[G]-s.h/2,m=e.yCoords[G]+s.h/2;if(L<d)d=L;if(E>c)c=E;if(M<O)O=M;if(m>T)T=m}}}catch(H){D=!0,X=H}finally{try{if(!N&&x.return)x.return()}finally{if(D)throw X}}var Y=i.x-(c+d)/2,b=i.y-(T+O)/2;e.xCoords=e.xCoords.map(function(H){return H+Y}),e.yCoords=e.yCoords.map(function(H){return H+b})}else{Object.keys(e).forEach(function(H){var st=e[H],dt=st.getRect().x,Z=st.getRect().x+st.getRect().width,ut=st.getRect().y,nt=st.getRect().y+st.getRect().height;if(dt<d)d=dt;if(Z>c)c=Z;if(ut<O)O=ut;if(nt>T)T=nt});var k=i.x-(c+d)/2,B=i.y-(T+O)/2;Object.keys(e).forEach(function(H){var st=e[H];st.setCenter(st.getCenterX()+k,st.getCenterY()+B)})}}},y.calcBoundingBox=function(i,e,g,d){var{MAX_SAFE_INTEGER:c,MIN_SAFE_INTEGER:O,MAX_SAFE_INTEGER:T,MIN_SAFE_INTEGER:N}=Number,D=void 0,X=void 0,x=void 0,W=void 0,_=i.descendants().not(":parent"),Q=_.length;for(var lt=0;lt<Q;lt++){var G=_[lt];if(D=e[d.get(G.id())]-G.width()/2,X=e[d.get(G.id())]+G.width()/2,x=g[d.get(G.id())]-G.height()/2,W=g[d.get(G.id())]+G.height()/2,c>D)c=D;if(O<X)O=X;if(T>x)T=x;if(N<W)N=W}var tt={};return tt.topLeftX=c,tt.topLeftY=T,tt.width=O-c,tt.height=N-T,tt},y.calcParentsWithoutChildren=function(i,e){var g=i.collection();return e.nodes(":parent").forEach(function(d){var c=!1;if(d.children().forEach(function(O){if(O.css("display")!="none")c=!0}),!c)g.merge(d)}),g},o.exports=y},816:(o,n,a)=>{var u=a(548),r=a(140).CoSELayout,y=a(140).CoSENode,i=a(140).layoutBase.PointD,e=a(140).layoutBase.DimensionD,g=a(140).layoutBase.LayoutConstants,d=a(140).layoutBase.FDLayoutConstants,c=a(140).CoSEConstants,O=function(N,D){var{cy:X,eles:x}=N,W=x.nodes(),_=x.edges(),Q=void 0,lt=void 0,G=void 0,tt={};if(N.randomize)Q=D.nodeIndexes,lt=D.xCoords,G=D.yCoords;var s=function(H){return typeof H==="function"},L=function(H,st){if(s(H))return H(st);else return H},E=u.calcParentsWithoutChildren(X,x),M=function B(H,st,dt,Z){var ut=st.length;for(var nt=0;nt<ut;nt++){var S=st[nt],K=null;if(S.intersection(E).length==0)K=S.children();var et=void 0,ct=S.layoutDimensions({nodeDimensionsIncludeLabels:Z.nodeDimensionsIncludeLabels});if(S.outerWidth()!=null&&S.outerHeight()!=null)if(Z.randomize)if(!S.isParent())et=H.add(new y(dt.graphManager,new i(lt[Q.get(S.id())]-ct.w/2,G[Q.get(S.id())]-ct.h/2),new e(parseFloat(ct.w),parseFloat(ct.h))));else{var Nt=u.calcBoundingBox(S,lt,G,Q);if(S.intersection(E).length==0)et=H.add(new y(dt.graphManager,new i(Nt.topLeftX,Nt.topLeftY),new e(Nt.width,Nt.height)));else et=H.add(new y(dt.graphManager,new i(Nt.topLeftX,Nt.topLeftY),new e(parseFloat(ct.w),parseFloat(ct.h))))}else et=H.add(new y(dt.graphManager,new i(S.position("x")-ct.w/2,S.position("y")-ct.h/2),new e(parseFloat(ct.w),parseFloat(ct.h))));else et=H.add(new y(this.graphManager));if(et.id=S.data("id"),et.nodeRepulsion=L(Z.nodeRepulsion,S),et.paddingLeft=parseInt(S.css("padding")),et.paddingTop=parseInt(S.css("padding")),et.paddingRight=parseInt(S.css("padding")),et.paddingBottom=parseInt(S.css("padding")),Z.nodeDimensionsIncludeLabels)et.labelWidth=S.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,et.labelHeight=S.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,et.labelPosVertical=S.css("text-valign"),et.labelPosHorizontal=S.css("text-halign");if(tt[S.data("id")]=et,isNaN(et.rect.x))et.rect.x=0;if(isNaN(et.rect.y))et.rect.y=0;if(K!=null&&K.length>0){var Pt=void 0;Pt=dt.getGraphManager().add(dt.newGraph(),et),B(Pt,K,dt,Z)}}},m=function(H,st,dt){var Z=0,ut=0;for(var nt=0;nt<dt.length;nt++){var S=dt[nt],K=tt[S.data("source")],et=tt[S.data("target")];if(K&&et&&K!==et&&K.getEdgesBetween(et).length==0){var ct=st.add(H.newEdge(),K,et);ct.id=S.id(),ct.idealLength=L(N.idealEdgeLength,S),ct.edgeElasticity=L(N.edgeElasticity,S),Z+=ct.idealLength,ut++}}if(N.idealEdgeLength!=null){if(ut>0)c.DEFAULT_EDGE_LENGTH=d.DEFAULT_EDGE_LENGTH=Z/ut;else if(!s(N.idealEdgeLength))c.DEFAULT_EDGE_LENGTH=d.DEFAULT_EDGE_LENGTH=N.idealEdgeLength;else c.DEFAULT_EDGE_LENGTH=d.DEFAULT_EDGE_LENGTH=50;c.MIN_REPULSION_DIST=d.MIN_REPULSION_DIST=d.DEFAULT_EDGE_LENGTH/10,c.DEFAULT_RADIAL_SEPARATION=d.DEFAULT_EDGE_LENGTH}},Y=function(H,st){if(st.fixedNodeConstraint)H.constraints.fixedNodeConstraint=st.fixedNodeConstraint;if(st.alignmentConstraint)H.constraints.alignmentConstraint=st.alignmentConstraint;if(st.relativePlacementConstraint)H.constraints.relativePlacementConstraint=st.relativePlacementConstraint};if(N.nestingFactor!=null)c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=d.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=N.nestingFactor;if(N.gravity!=null)c.DEFAULT_GRAVITY_STRENGTH=d.DEFAULT_GRAVITY_STRENGTH=N.gravity;if(N.numIter!=null)c.MAX_ITERATIONS=d.MAX_ITERATIONS=N.numIter;if(N.gravityRange!=null)c.DEFAULT_GRAVITY_RANGE_FACTOR=d.DEFAULT_GRAVITY_RANGE_FACTOR=N.gravityRange;if(N.gravityCompound!=null)c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=d.DEFAULT_COMPOUND_GRAVITY_STRENGTH=N.gravityCompound;if(N.gravityRangeCompound!=null)c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=d.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=N.gravityRangeCompound;if(N.initialEnergyOnIncremental!=null)c.DEFAULT_COOLING_FACTOR_INCREMENTAL=d.DEFAULT_COOLING_FACTOR_INCREMENTAL=N.initialEnergyOnIncremental;if(N.tilingCompareBy!=null)c.TILING_COMPARE_BY=N.tilingCompareBy;if(N.quality=="proof")g.QUALITY=2;else g.QUALITY=0;if(c.NODE_DIMENSIONS_INCLUDE_LABELS=d.NODE_DIMENSIONS_INCLUDE_LABELS=g.NODE_DIMENSIONS_INCLUDE_LABELS=N.nodeDimensionsIncludeLabels,c.DEFAULT_INCREMENTAL=d.DEFAULT_INCREMENTAL=g.DEFAULT_INCREMENTAL=!N.randomize,c.ANIMATE=d.ANIMATE=g.ANIMATE=N.animate,c.TILE=N.tile,c.TILING_PADDING_VERTICAL=typeof N.tilingPaddingVertical==="function"?N.tilingPaddingVertical.call():N.tilingPaddingVertical,c.TILING_PADDING_HORIZONTAL=typeof N.tilingPaddingHorizontal==="function"?N.tilingPaddingHorizontal.call():N.tilingPaddingHorizontal,c.DEFAULT_INCREMENTAL=d.DEFAULT_INCREMENTAL=g.DEFAULT_INCREMENTAL=!0,c.PURE_INCREMENTAL=!N.randomize,g.DEFAULT_UNIFORM_LEAF_NODE_SIZES=N.uniformNodeDimensions,N.step=="transformed")c.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,c.ENFORCE_CONSTRAINTS=!1,c.APPLY_LAYOUT=!1;if(N.step=="enforced")c.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,c.ENFORCE_CONSTRAINTS=!0,c.APPLY_LAYOUT=!1;if(N.step=="cose")c.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,c.ENFORCE_CONSTRAINTS=!1,c.APPLY_LAYOUT=!0;if(N.step=="all"){if(N.randomize)c.TRANSFORM_ON_CONSTRAINT_HANDLING=!0;else c.TRANSFORM_ON_CONSTRAINT_HANDLING=!1;c.ENFORCE_CONSTRAINTS=!0,c.APPLY_LAYOUT=!0}if(N.fixedNodeConstraint||N.alignmentConstraint||N.relativePlacementConstraint)c.TREE_REDUCTION_ON_INCREMENTAL=!1;else c.TREE_REDUCTION_ON_INCREMENTAL=!0;var b=new r,k=b.newGraphManager();return M(k.addRoot(),u.getTopMostNodes(W),b,N),m(b,k,_),Y(b,N),b.runLayout(),tt};o.exports={coseLayout:O}},212:(o,n,a)=>{var u=function(){function N(D,X){for(var x=0;x<X.length;x++){var W=X[x];if(W.enumerable=W.enumerable||!1,W.configurable=!0,"value"in W)W.writable=!0;Object.defineProperty(D,W.key,W)}}return function(D,X,x){if(X)N(D.prototype,X);if(x)N(D,x);return D}}();function r(N,D){if(!(N instanceof D))throw TypeError("Cannot call a class as a function")}var y=a(658),i=a(548),e=a(657),g=e.spectralLayout,d=a(816),c=d.coseLayout,O=Object.freeze({quality:"default",randomize:!0,animate:!0,animationDuration:1000,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:"all",samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:0.0000001,nodeRepulsion:function(D){return 4500},idealEdgeLength:function(D){return 50},edgeElasticity:function(D){return 0.45},nestingFactor:0.1,gravity:0.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:0.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:function(){},stop:function(){}}),T=function(){function N(D){r(this,N),this.options=y({},O,D)}return u(N,[{key:"run",value:function(){var X=this,x=this.options,{cy:W,eles:_}=x,Q=[],lt=void 0,G=void 0,tt=[],s=void 0,L=[];if(x.fixedNodeConstraint&&(!Array.isArray(x.fixedNodeConstraint)||x.fixedNodeConstraint.length==0))x.fixedNodeConstraint=void 0;if(x.alignmentConstraint){if(x.alignmentConstraint.vertical&&(!Array.isArray(x.alignmentConstraint.vertical)||x.alignmentConstraint.vertical.length==0))x.alignmentConstraint.vertical=void 0;if(x.alignmentConstraint.horizontal&&(!Array.isArray(x.alignmentConstraint.horizontal)||x.alignmentConstraint.horizontal.length==0))x.alignmentConstraint.horizontal=void 0}if(x.relativePlacementConstraint&&(!Array.isArray(x.relativePlacementConstraint)||x.relativePlacementConstraint.length==0))x.relativePlacementConstraint=void 0;var E=x.fixedNodeConstraint||x.alignmentConstraint||x.relativePlacementConstraint;if(E)x.tile=!1,x.packComponents=!1;var M=void 0,m=!1;if(W.layoutUtilities&&x.packComponents){if(M=W.layoutUtilities("get"),!M)M=W.layoutUtilities();m=!0}if(_.nodes().length>0)if(!m){var Y=x.eles.boundingBox();if(L.push({x:Y.x1+Y.w/2,y:Y.y1+Y.h/2}),x.randomize){var b=g(x);Q.push(b)}if(x.quality=="default"||x.quality=="proof")tt.push(c(x,Q[0])),i.relocateComponent(L[0],tt[0],x);else i.relocateComponent(L[0],Q[0],x)}else{var k=i.getTopMostNodes(x.eles.nodes());if(s=i.connectComponents(W,x.eles,k),s.forEach(function(Et){var vt=Et.boundingBox();L.push({x:vt.x1+vt.w/2,y:vt.y1+vt.h/2})}),x.randomize)s.forEach(function(Et){x.eles=Et,Q.push(g(x))});if(x.quality=="default"||x.quality=="proof"){var B=W.collection();if(x.tile){var H=new Map,st=[],dt=[],Z=0,ut={nodeIndexes:H,xCoords:st,yCoords:dt},nt=[];if(s.forEach(function(Et,vt){if(Et.edges().length==0)Et.nodes().forEach(function(xt,Rt){if(B.merge(Et.nodes()[Rt]),!xt.isParent())ut.nodeIndexes.set(Et.nodes()[Rt].id(),Z++),ut.xCoords.push(Et.nodes()[0].position().x),ut.yCoords.push(Et.nodes()[0].position().y)}),nt.push(vt)}),B.length>1){var S=B.boundingBox();L.push({x:S.x1+S.w/2,y:S.y1+S.h/2}),s.push(B),Q.push(ut);for(var K=nt.length-1;K>=0;K--)s.splice(nt[K],1),Q.splice(nt[K],1),L.splice(nt[K],1)}}s.forEach(function(Et,vt){x.eles=Et,tt.push(c(x,Q[vt])),i.relocateComponent(L[vt],tt[vt],x)})}else s.forEach(function(Et,vt){i.relocateComponent(L[vt],Q[vt],x)});var et=new Set;if(s.length>1){var ct=[],Nt=_.filter(function(Et){return Et.css("display")=="none"});s.forEach(function(Et,vt){var xt=void 0;if(x.quality=="draft")xt=Q[vt].nodeIndexes;if(Et.nodes().not(Nt).length>0){var Rt={};Rt.edges=[],Rt.nodes=[];var Gt=void 0;if(Et.nodes().not(Nt).forEach(function(St){if(x.quality=="draft")if(!St.isParent())Gt=xt.get(St.id()),Rt.nodes.push({x:Q[vt].xCoords[Gt]-St.boundingbox().w/2,y:Q[vt].yCoords[Gt]-St.boundingbox().h/2,width:St.boundingbox().w,height:St.boundingbox().h});else{var Ft=i.calcBoundingBox(St,Q[vt].xCoords,Q[vt].yCoords,xt);Rt.nodes.push({x:Ft.topLeftX,y:Ft.topLeftY,width:Ft.width,height:Ft.height})}else if(tt[vt][St.id()])Rt.nodes.push({x:tt[vt][St.id()].getLeft(),y:tt[vt][St.id()].getTop(),width:tt[vt][St.id()].getWidth(),height:tt[vt][St.id()].getHeight()})}),Et.edges().forEach(function(St){var Ft=St.source(),Ht=St.target();if(Ft.css("display")!="none"&&Ht.css("display")!="none"){if(x.quality=="draft"){var zt=xt.get(Ft.id()),te=xt.get(Ht.id()),qt=[],Kt=[];if(Ft.isParent()){var kt=i.calcBoundingBox(Ft,Q[vt].xCoords,Q[vt].yCoords,xt);qt.push(kt.topLeftX+kt.width/2),qt.push(kt.topLeftY+kt.height/2)}else qt.push(Q[vt].xCoords[zt]),qt.push(Q[vt].yCoords[zt]);if(Ht.isParent()){var J=i.calcBoundingBox(Ht,Q[vt].xCoords,Q[vt].yCoords,xt);Kt.push(J.topLeftX+J.width/2),Kt.push(J.topLeftY+J.height/2)}else Kt.push(Q[vt].xCoords[te]),Kt.push(Q[vt].yCoords[te]);Rt.edges.push({startX:qt[0],startY:qt[1],endX:Kt[0],endY:Kt[1]})}else if(tt[vt][Ft.id()]&&tt[vt][Ht.id()])Rt.edges.push({startX:tt[vt][Ft.id()].getCenterX(),startY:tt[vt][Ft.id()].getCenterY(),endX:tt[vt][Ht.id()].getCenterX(),endY:tt[vt][Ht.id()].getCenterY()})}}),Rt.nodes.length>0)ct.push(Rt),et.add(vt)}});var Pt=M.packComponents(ct,x.randomize).shifts;if(x.quality=="draft")Q.forEach(function(Et,vt){var xt=Et.xCoords.map(function(Gt){return Gt+Pt[vt].dx}),Rt=Et.yCoords.map(function(Gt){return Gt+Pt[vt].dy});Et.xCoords=xt,Et.yCoords=Rt});else{var Bt=0;et.forEach(function(Et){Object.keys(tt[Et]).forEach(function(vt){var xt=tt[Et][vt];xt.setCenter(xt.getCenterX()+Pt[Bt].dx,xt.getCenterY()+Pt[Bt].dy)}),Bt++})}}}var ft=function(vt,xt){if(x.quality=="default"||x.quality=="proof"){if(typeof vt==="number")vt=xt;var Rt=void 0,Gt=void 0,St=vt.data("id");if(tt.forEach(function(Ht){if(St in Ht)Rt={x:Ht[St].getRect().getCenterX(),y:Ht[St].getRect().getCenterY()},Gt=Ht[St]}),x.nodeDimensionsIncludeLabels){if(Gt.labelWidth){if(Gt.labelPosHorizontal=="left")Rt.x+=Gt.labelWidth/2;else if(Gt.labelPosHorizontal=="right")Rt.x-=Gt.labelWidth/2}if(Gt.labelHeight){if(Gt.labelPosVertical=="top")Rt.y+=Gt.labelHeight/2;else if(Gt.labelPosVertical=="bottom")Rt.y-=Gt.labelHeight/2}}if(Rt==null)Rt={x:vt.position("x"),y:vt.position("y")};return{x:Rt.x,y:Rt.y}}else{var Ft=void 0;if(Q.forEach(function(Ht){var zt=Ht.nodeIndexes.get(vt.id());if(zt!=null)Ft={x:Ht.xCoords[zt],y:Ht.yCoords[zt]}}),Ft==null)Ft={x:vt.position("x"),y:vt.position("y")};return{x:Ft.x,y:Ft.y}}};if(x.quality=="default"||x.quality=="proof"||x.randomize){var Jt=i.calcParentsWithoutChildren(W,_),Xt=_.filter(function(Et){return Et.css("display")=="none"});if(x.eles=_.not(Xt),_.nodes().not(":parent").not(Xt).layoutPositions(X,x,ft),Jt.length>0)Jt.forEach(function(Et){Et.position(ft(Et))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),N}();o.exports=T},657:(o,n,a)=>{var u=a(548),r=a(140).layoutBase.Matrix,y=a(140).layoutBase.SVD,i=function(g){var{cy:d,eles:c}=g,O=c.nodes(),T=c.nodes(":parent"),N=new Map,D=new Map,X=new Map,x=[],W=[],_=[],Q=[],lt=[],G=[],tt=[],s=[],L=void 0,E=void 0,M=1e8,m=0.000000001,{piTol:Y,samplingType:b,nodeSeparation:k}=g,B=void 0,H=function(){var it=0,at=0,ot=!1;while(at<B){it=Math.floor(Math.random()*E),ot=!1;for(var gt=0;gt<at;gt++)if(Q[gt]==it){ot=!0;break}if(!ot)Q[at]=it,at++;else continue}},st=function(it,at,ot){var gt=[],At=0,Mt=0,ht=0,Lt=void 0,Ct=[],pt=0,Ot=1;for(var Ut=0;Ut<E;Ut++)Ct[Ut]=M;gt[Mt]=it,Ct[it]=0;while(Mt>=At){ht=gt[At++];var Tt=x[ht];for(var yt=0;yt<Tt.length;yt++)if(Lt=D.get(Tt[yt]),Ct[Lt]==M)Ct[Lt]=Ct[ht]+1,gt[++Mt]=Lt;G[ht][at]=Ct[ht]*k}if(ot){for(var Dt=0;Dt<E;Dt++)if(G[Dt][at]<lt[Dt])lt[Dt]=G[Dt][at];for(var mt=0;mt<E;mt++)if(lt[mt]>pt)pt=lt[mt],Ot=mt}return Ot},dt=function(it){var at=void 0;if(!it){H();for(var ot=0;ot<B;ot++)st(Q[ot],ot,it,!1)}else{at=Math.floor(Math.random()*E),L=at;for(var gt=0;gt<E;gt++)lt[gt]=M;for(var At=0;At<B;At++)Q[At]=at,at=st(at,At,it)}for(var Mt=0;Mt<E;Mt++)for(var ht=0;ht<B;ht++)G[Mt][ht]*=G[Mt][ht];for(var Lt=0;Lt<B;Lt++)tt[Lt]=[];for(var Ct=0;Ct<B;Ct++)for(var pt=0;pt<B;pt++)tt[Ct][pt]=G[Q[pt]][Ct]},Z=function(){var it=y.svd(tt),{S:at,U:ot,V:gt}=it,At=at[0]*at[0]*at[0],Mt=[];for(var ht=0;ht<B;ht++){Mt[ht]=[];for(var Lt=0;Lt<B;Lt++)if(Mt[ht][Lt]=0,ht==Lt)Mt[ht][Lt]=at[ht]/(at[ht]*at[ht]+At/(at[ht]*at[ht]))}s=r.multMat(r.multMat(gt,Mt),r.transpose(ot))},ut=function(){var it=void 0,at=void 0,ot=[],gt=[],At=[],Mt=[];for(var ht=0;ht<E;ht++)ot[ht]=Math.random(),gt[ht]=Math.random();ot=r.normalize(ot),gt=r.normalize(gt);var Lt=0,Ct=m,pt=m,Ot=void 0;while(!0){Lt++;for(var Ut=0;Ut<E;Ut++)At[Ut]=ot[Ut];if(ot=r.multGamma(r.multL(r.multGamma(At),G,s)),it=r.dotProduct(At,ot),ot=r.normalize(ot),Ct=r.dotProduct(At,ot),Ot=Math.abs(Ct/pt),Ot<=1+Y&&Ot>=1)break;pt=Ct}for(var Tt=0;Tt<E;Tt++)At[Tt]=ot[Tt];Lt=0,pt=m;while(!0){Lt++;for(var yt=0;yt<E;yt++)Mt[yt]=gt[yt];if(Mt=r.minusOp(Mt,r.multCons(At,r.dotProduct(At,Mt))),gt=r.multGamma(r.multL(r.multGamma(Mt),G,s)),at=r.dotProduct(Mt,gt),gt=r.normalize(gt),Ct=r.dotProduct(Mt,gt),Ot=Math.abs(Ct/pt),Ot<=1+Y&&Ot>=1)break;pt=Ct}for(var Dt=0;Dt<E;Dt++)Mt[Dt]=gt[Dt];W=r.multCons(At,Math.sqrt(Math.abs(it))),_=r.multCons(Mt,Math.sqrt(Math.abs(at)))};u.connectComponents(d,c,u.getTopMostNodes(O),N),T.forEach(function(rt){u.connectComponents(d,c,u.getTopMostNodes(rt.descendants().intersection(c)),N)});var nt=0;for(var S=0;S<O.length;S++)if(!O[S].isParent())D.set(O[S].id(),nt++);var K=!0,et=!1,ct=void 0;try{for(var Nt=N.keys()[Symbol.iterator](),Pt;!(K=(Pt=Nt.next()).done);K=!0){var Bt=Pt.value;D.set(Bt,nt++)}}catch(rt){et=!0,ct=rt}finally{try{if(!K&&Nt.return)Nt.return()}finally{if(et)throw ct}}for(var ft=0;ft<D.size;ft++)x[ft]=[];T.forEach(function(rt){var it=rt.children().intersection(c);while(it.nodes(":childless").length==0)it=it.nodes()[0].children().intersection(c);var at=0,ot=it.nodes(":childless")[0].connectedEdges().length;it.nodes(":childless").forEach(function(gt,At){if(gt.connectedEdges().length<ot)ot=gt.connectedEdges().length,at=At}),X.set(rt.id(),it.nodes(":childless")[at].id())}),O.forEach(function(rt){var it=void 0;if(rt.isParent())it=D.get(X.get(rt.id()));else it=D.get(rt.id());rt.neighborhood().nodes().forEach(function(at){if(c.intersection(rt.edgesWith(at)).length>0)if(at.isParent())x[it].push(X.get(at.id()));else x[it].push(at.id())})});var Jt=function(it){var at=D.get(it),ot=void 0;N.get(it).forEach(function(gt){if(d.getElementById(gt).isParent())ot=X.get(gt);else ot=gt;x[at].push(ot),x[D.get(ot)].push(it)})},Xt=!0,Et=!1,vt=void 0;try{for(var xt=N.keys()[Symbol.iterator](),Rt;!(Xt=(Rt=xt.next()).done);Xt=!0){var Gt=Rt.value;Jt(Gt)}}catch(rt){Et=!0,vt=rt}finally{try{if(!Xt&&xt.return)xt.return()}finally{if(Et)throw vt}}E=D.size;var St=void 0;if(E>2){B=E<g.sampleSize?E:g.sampleSize;for(var Ft=0;Ft<E;Ft++)G[Ft]=[];for(var Ht=0;Ht<B;Ht++)s[Ht]=[];if(g.quality=="draft"||g.step=="all")dt(b),Z(),ut(),St={nodeIndexes:D,xCoords:W,yCoords:_};else D.forEach(function(rt,it){W.push(d.getElementById(it).position("x")),_.push(d.getElementById(it).position("y"))}),St={nodeIndexes:D,xCoords:W,yCoords:_};return St}else{var zt=D.keys(),te=d.getElementById(zt.next().value),qt=te.position(),Kt=te.outerWidth();if(W.push(qt.x),_.push(qt.y),E==2){var kt=d.getElementById(zt.next().value),J=kt.outerWidth();W.push(qt.x+Kt/2+J/2+g.idealEdgeLength),_.push(qt.y)}return St={nodeIndexes:D,xCoords:W,yCoords:_},St}};o.exports={spectralLayout:i}},579:(o,n,a)=>{var u=a(212),r=function(i){if(!i)return;i("layout","fcose",u)};if(typeof cytoscape<"u")r(cytoscape);o.exports=r},140:(o)=>{o.exports=w}},A={};function v(o){var n=A[o];if(n!==void 0)return n.exports;var a=A[o]={exports:{}};return I[o](a,a.exports,v),a.exports}var f=v(579);return f})()})});var je=mn($e(),1);var Be={L:"left",R:"right",T:"top",B:"bottom"},Ze={L:t((w)=>`${w},${w/2} 0,${w} 0,0`,"L"),R:t((w)=>`0,${w/2} ${w},0 ${w},${w}`,"R"),T:t((w)=>`0,0 ${w},0 ${w/2},${w}`,"T"),B:t((w)=>`${w/2},0 ${w},${w} 0,${w}`,"B")},we={L:t((w,I)=>w-I+2,"L"),R:t((w,I)=>w-2,"R"),T:t((w,I)=>w-I+2,"T"),B:t((w,I)=>w-2,"B")},hr=t(function(w){if(_t(w))return w==="L"?"R":"L";else return w==="T"?"B":"T"},"getOppositeArchitectureDirection"),ke=t(function(w){let I=w;return I==="L"||I==="R"||I==="T"||I==="B"},"isArchitectureDirection"),_t=t(function(w){let I=w;return I==="L"||I==="R"},"isArchitectureDirectionX"),he=t(function(w){let I=w;return I==="T"||I==="B"},"isArchitectureDirectionY"),Ye=t(function(w,I){let A=_t(w)&&he(I),v=he(w)&&_t(I);return A||v},"isArchitectureDirectionXY"),fr=t(function(w){let I=w[0],A=w[1],v=_t(I)&&he(A),f=he(I)&&_t(A);return v||f},"isArchitecturePairXY"),cr=t(function(w){return w!=="LL"&&w!=="RR"&&w!=="TT"&&w!=="BB"},"isValidArchitectureDirectionPair"),Ge=t(function(w,I){let A=`${w}${I}`;return cr(A)?A:void 0},"getArchitectureDirectionPair"),gr=t(function([w,I],A){let v=A[0],f=A[1];if(_t(v))if(he(f))return[w+(v==="L"?-1:1),I+(f==="T"?1:-1)];else return[w+(v==="L"?-1:1),I];else if(_t(f))return[w+(f==="L"?1:-1),I+(v==="T"?1:-1)];else return[w,I+(v==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),ur=t(function(w){if(w==="LT"||w==="TL")return[1,1];else if(w==="BL"||w==="LB")return[1,-1];else if(w==="BR"||w==="RB")return[-1,-1];else return[-1,1]},"getArchitectureDirectionXYFactors"),dr=t(function(w,I){if(Ye(w,I))return"bend";else if(_t(w))return"horizontal";return"vertical"},"getArchitectureDirectionAlignment"),vr=t(function(w){return w.type==="service"},"isArchitectureService"),pr=t(function(w){return w.type==="junction"},"isArchitectureJunction"),qe=t((w,I)=>{let[A,v]=[w,I].sort();return`${JSON.stringify(A)}-${JSON.stringify(v)}`},"architectureGroupAlignmentKey"),Qe=t((w)=>w.data(),"edgeData"),ye=t((w)=>w.data(),"nodeData"),yr=V.architecture,Je=class{constructor(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.elements=new Map,this.diagramId="",this.setAccTitle=F,this.getAccTitle=z,this.setDiagramTitle=q,this.getDiagramTitle=j,this.getAccDescription=U,this.setAccDescription=P,this.clear()}static{t(this,"ArchitectureDB")}setDiagramId(w){this.diagramId=w}getDiagramId(){return this.diagramId}clear(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.dataStructures=void 0,this.elements=new Map,this.diagramId="",R()}addService({id:w,icon:I,in:A,title:v,iconText:f}){if(this.registeredIds.has(w))throw Error(`The service id [${w}] is already in use by another ${this.registeredIds.get(w)}`);if(A!==void 0){if(w===A)throw Error(`The service [${w}] cannot be placed within itself`);if(!this.registeredIds.has(A))throw Error(`The service [${w}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds.get(A)==="node")throw Error(`The service [${w}]'s parent is not a group`)}this.registeredIds.set(w,"node"),this.nodes.set(w,{id:w,type:"service",icon:I,iconText:f,title:v,edges:[],in:A})}getServices(){return[...this.nodes.values()].filter(vr)}addJunction({id:w,in:I}){if(this.registeredIds.has(w))throw Error(`The junction id [${w}] is already in use by another ${this.registeredIds.get(w)}`);if(I!==void 0){if(w===I)throw Error(`The junction [${w}] cannot be placed within itself`);if(!this.registeredIds.has(I))throw Error(`The junction [${w}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds.get(I)==="node")throw Error(`The junction [${w}]'s parent is not a group`)}this.registeredIds.set(w,"node"),this.nodes.set(w,{id:w,type:"junction",edges:[],in:I})}getJunctions(){return[...this.nodes.values()].filter(pr)}getNodes(){return[...this.nodes.values()]}getNode(w){return this.nodes.get(w)??null}addGroup({id:w,icon:I,in:A,title:v}){if(this.registeredIds.has(w))throw Error(`The group id [${w}] is already in use by another ${this.registeredIds.get(w)}`);if(A!==void 0){if(w===A)throw Error(`The group [${w}] cannot be placed within itself`);if(!this.registeredIds.has(A))throw Error(`The group [${w}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds.get(A)==="node")throw Error(`The group [${w}]'s parent is not a group`)}this.registeredIds.set(w,"group"),this.groups.set(w,{id:w,icon:I,title:v,in:A})}getGroups(){return[...this.groups.values()]}addEdge({lhsId:w,rhsId:I,lhsDir:A,rhsDir:v,lhsInto:f,rhsInto:o,lhsGroup:n,rhsGroup:a,title:u}){if(!ke(A))throw Error(`Invalid direction given for left hand side of edge ${w}--${I}. Expected (L,R,T,B) got ${String(A)}`);if(!ke(v))throw Error(`Invalid direction given for right hand side of edge ${w}--${I}. Expected (L,R,T,B) got ${String(v)}`);if(!this.nodes.has(w)&&!this.groups.has(w))throw Error(`The left-hand id [${w}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(!this.nodes.has(I)&&!this.groups.has(I))throw Error(`The right-hand id [${I}] does not yet exist. Please create the service/group before declaring an edge to it.`);let r=this.nodes.get(w).in,y=this.nodes.get(I).in;if(n&&r&&y&&r==y)throw Error(`The left-hand id [${w}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(a&&r&&y&&r==y)throw Error(`The right-hand id [${I}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);let i={lhsId:w,lhsDir:A,lhsInto:f,lhsGroup:n,rhsId:I,rhsDir:v,rhsInto:o,rhsGroup:a,title:u};this.edges.push(i);let e=this.nodes.get(w),g=this.nodes.get(I);if(e&&g)e.edges.push(this.edges[this.edges.length-1]),g.edges.push(this.edges[this.edges.length-1])}getEdges(){return this.edges}addLayoutHint(w){if(w.members.length<2)throw Error(`An align directive requires at least two members; got ${w.members.length}`);let I=new Set;w.members.forEach((A)=>{if(this.registeredIds.get(A)!=="node")throw Error(`align ${w.direction} references [${A}], which is not a service or junction`);if(I.has(A))throw Error(`align ${w.direction} lists [${A}] more than once`);I.add(A)}),this.layoutHints.push(w)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(this.dataStructures===void 0){let w=new Map,I=new Map;for(let[n,a]of this.nodes.entries()){let u=new Map;for(let r of a.edges){let y=this.getNode(r.lhsId)?.in,i=this.getNode(r.rhsId)?.in;if(y&&i&&y!==i){let e=dr(r.lhsDir,r.rhsDir);if(e!=="bend")w.set(qe(y,i),e)}if(r.lhsId===n){let e=Ge(r.lhsDir,r.rhsDir);if(e)u.set(e,r.rhsId)}else{let e=Ge(r.rhsDir,r.lhsDir);if(e)u.set(e,r.lhsId)}}I.set(n,u)}let A=new Set,v=new Set(I.keys()),f=t((n)=>{let a=new Map([[n,[0,0]]]),u=[n];while(u.length>0){let r=u.shift();if(r){A.add(r),v.delete(r);let y=I.get(r);if(!y)throw Error(`BFS error: adjacency list for id ${r} not found. Please report this as a bug.`);let i=a.get(r);if(!i)throw Error(`BFS error: position for id ${r} not found in spatial map. Please report this as a bug.`);let[e,g]=i;y.forEach((d,c)=>{if(!A.has(d))a.set(d,gr([e,g],c)),u.push(d)})}}return a},"BFS"),o=[];while(v.size>0){let n=v.values().next().value;o.push(f(n))}this.dataStructures={adjList:I,spatialMaps:o,groupAlignments:w}}return this.dataStructures}setElementForId(w,I){this.elements.set(w,I)}getElementById(w){return this.elements.get(w)}getConfig(){return se({...yr,...C().architecture})}getConfigField(w){return this.getConfig()[w]}},mr=t((w,I)=>{be(w,I),w.groups.map((A)=>I.addGroup(A)),w.services.map((A)=>I.addService({...A,type:"service"})),w.junctions.map((A)=>I.addJunction({...A,type:"junction"})),w.edges.map((A)=>I.addEdge(A)),w.alignments?.map((A)=>I.addLayoutHint({direction:A.direction,members:[...A.members]}))},"populateDb"),Ke={parser:{yy:void 0},parse:t(async(w)=>{let I=await De("architecture",w);l.debug(I);let A=Ke.parser?.yy;if(!(A instanceof Je))throw Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");mr(I,A)},"parse")},Er=t((w)=>`
|
|
1
|
+
import{be}from"./index-1y3rzw6b.js";import{t,l,V,C,ee,$r,R,F,z,P,U,q,j,p,h,de,zf,Fi,lr,se,Cn,on}from"./index-cz50ha6x.js";import{De}from"./index-b42t14wk.js";import{Pr}from"./index-qsw5edtk.js";import{mn,In}from"./index-pxtff3ez.js";var Re=In(function(me,Ie){(function(I,A){if(typeof me==="object"&&typeof Ie==="object")Ie.exports=A();else if(typeof define==="function"&&define.amd)define([],A);else if(typeof me==="object")me.layoutBase=A();else I.layoutBase=A()})(me,function(){return function(w){var I={};function A(v){if(I[v])return I[v].exports;var f=I[v]={i:v,l:!1,exports:{}};return w[v].call(f.exports,f,f.exports,A),f.l=!0,f.exports}return A.m=w,A.c=I,A.i=function(v){return v},A.d=function(v,f,o){if(!A.o(v,f))Object.defineProperty(v,f,{configurable:!1,enumerable:!0,get:o})},A.n=function(v){var f=v&&v.__esModule?function(){return v.default}:function(){return v};return A.d(f,"a",f),f},A.o=function(v,f){return Object.prototype.hasOwnProperty.call(v,f)},A.p="",A(A.s=28)}([function(w,I,A){function v(){}v.QUALITY=1,v.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,v.DEFAULT_INCREMENTAL=!1,v.DEFAULT_ANIMATION_ON_LAYOUT=!0,v.DEFAULT_ANIMATION_DURING_LAYOUT=!1,v.DEFAULT_ANIMATION_PERIOD=50,v.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,v.DEFAULT_GRAPH_MARGIN=15,v.NODE_DIMENSIONS_INCLUDE_LABELS=!1,v.SIMPLE_NODE_SIZE=40,v.SIMPLE_NODE_HALF_SIZE=v.SIMPLE_NODE_SIZE/2,v.EMPTY_COMPOUND_NODE_SIZE=40,v.MIN_EDGE_LENGTH=1,v.WORLD_BOUNDARY=1e6,v.INITIAL_WORLD_BOUNDARY=v.WORLD_BOUNDARY/1000,v.WORLD_CENTER_X=1200,v.WORLD_CENTER_Y=900,w.exports=v},function(w,I,A){var v=A(2),f=A(8),o=A(9);function n(u,r,y){v.call(this,y),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=y,this.bendpoints=[],this.source=u,this.target=r}n.prototype=Object.create(v.prototype);for(var a in v)n[a]=v[a];n.prototype.getSource=function(){return this.source},n.prototype.getTarget=function(){return this.target},n.prototype.isInterGraph=function(){return this.isInterGraph},n.prototype.getLength=function(){return this.length},n.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},n.prototype.getBendpoints=function(){return this.bendpoints},n.prototype.getLca=function(){return this.lca},n.prototype.getSourceInLca=function(){return this.sourceInLca},n.prototype.getTargetInLca=function(){return this.targetInLca},n.prototype.getOtherEnd=function(u){if(this.source===u)return this.target;else if(this.target===u)return this.source;else throw"Node is not incident with this edge"},n.prototype.getOtherEndInGraph=function(u,r){var y=this.getOtherEnd(u),i=r.getGraphManager().getRoot();while(!0){if(y.getOwner()==r)return y;if(y.getOwner()==i)break;y=y.getOwner().getParent()}return null},n.prototype.updateLength=function(){var u=[,,,,];if(this.isOverlapingSourceAndTarget=f.getIntersection(this.target.getRect(),this.source.getRect(),u),!this.isOverlapingSourceAndTarget){if(this.lengthX=u[0]-u[2],this.lengthY=u[1]-u[3],Math.abs(this.lengthX)<1)this.lengthX=o.sign(this.lengthX);if(Math.abs(this.lengthY)<1)this.lengthY=o.sign(this.lengthY);this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)}},n.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=o.sign(this.lengthX);if(Math.abs(this.lengthY)<1)this.lengthY=o.sign(this.lengthY);this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},w.exports=n},function(w,I,A){function v(f){this.vGraphObject=f}w.exports=v},function(w,I,A){var v=A(2),f=A(10),o=A(13),n=A(0),a=A(16),u=A(5);function r(i,e,g,d){if(g==null&&d==null)d=e;if(v.call(this,d),i.graphManager!=null)i=i.graphManager;if(this.estimatedSize=f.MIN_VALUE,this.inclusionTreeDepth=f.MAX_VALUE,this.vGraphObject=d,this.edges=[],this.graphManager=i,g!=null&&e!=null)this.rect=new o(e.x,e.y,g.width,g.height);else this.rect=new o}r.prototype=Object.create(v.prototype);for(var y in v)r[y]=v[y];r.prototype.getEdges=function(){return this.edges},r.prototype.getChild=function(){return this.child},r.prototype.getOwner=function(){return this.owner},r.prototype.getWidth=function(){return this.rect.width},r.prototype.setWidth=function(i){this.rect.width=i},r.prototype.getHeight=function(){return this.rect.height},r.prototype.setHeight=function(i){this.rect.height=i},r.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},r.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},r.prototype.getCenter=function(){return new u(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},r.prototype.getLocation=function(){return new u(this.rect.x,this.rect.y)},r.prototype.getRect=function(){return this.rect},r.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},r.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},r.prototype.setRect=function(i,e){this.rect.x=i.x,this.rect.y=i.y,this.rect.width=e.width,this.rect.height=e.height},r.prototype.setCenter=function(i,e){this.rect.x=i-this.rect.width/2,this.rect.y=e-this.rect.height/2},r.prototype.setLocation=function(i,e){this.rect.x=i,this.rect.y=e},r.prototype.moveBy=function(i,e){this.rect.x+=i,this.rect.y+=e},r.prototype.getEdgeListToNode=function(i){var e=[],g,d=this;return d.edges.forEach(function(c){if(c.target==i){if(c.source!=d)throw"Incorrect edge source!";e.push(c)}}),e},r.prototype.getEdgesBetween=function(i){var e=[],g,d=this;return d.edges.forEach(function(c){if(!(c.source==d||c.target==d))throw"Incorrect edge source and/or target";if(c.target==i||c.source==i)e.push(c)}),e},r.prototype.getNeighborsList=function(){var i=new Set,e=this;return e.edges.forEach(function(g){if(g.source==e)i.add(g.target);else{if(g.target!=e)throw"Incorrect incidency!";i.add(g.source)}}),i},r.prototype.withChildren=function(){var i=new Set,e,g;if(i.add(this),this.child!=null){var d=this.child.getNodes();for(var c=0;c<d.length;c++)e=d[c],g=e.withChildren(),g.forEach(function(O){i.add(O)})}return i},r.prototype.getNoOfChildren=function(){var i=0,e;if(this.child==null)i=1;else{var g=this.child.getNodes();for(var d=0;d<g.length;d++)e=g[d],i+=e.getNoOfChildren()}if(i==0)i=1;return i},r.prototype.getEstimatedSize=function(){if(this.estimatedSize==f.MIN_VALUE)throw"assert failed";return this.estimatedSize},r.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},r.prototype.scatter=function(){var i,e,g=-n.INITIAL_WORLD_BOUNDARY,d=n.INITIAL_WORLD_BOUNDARY;i=n.WORLD_CENTER_X+a.nextDouble()*(d-g)+g;var c=-n.INITIAL_WORLD_BOUNDARY,O=n.INITIAL_WORLD_BOUNDARY;e=n.WORLD_CENTER_Y+a.nextDouble()*(O-c)+c,this.rect.x=i,this.rect.y=e},r.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var i=this.getChild();if(i.updateBounds(!0),this.rect.x=i.getLeft(),this.rect.y=i.getTop(),this.setWidth(i.getRight()-i.getLeft()),this.setHeight(i.getBottom()-i.getTop()),n.NODE_DIMENSIONS_INCLUDE_LABELS){var e=i.getRight()-i.getLeft(),g=i.getBottom()-i.getTop();if(this.labelWidth){if(this.labelPosHorizontal=="left")this.rect.x-=this.labelWidth,this.setWidth(e+this.labelWidth);else if(this.labelPosHorizontal=="center"&&this.labelWidth>e)this.rect.x-=(this.labelWidth-e)/2,this.setWidth(this.labelWidth);else if(this.labelPosHorizontal=="right")this.setWidth(e+this.labelWidth)}if(this.labelHeight){if(this.labelPosVertical=="top")this.rect.y-=this.labelHeight,this.setHeight(g+this.labelHeight);else if(this.labelPosVertical=="center"&&this.labelHeight>g)this.rect.y-=(this.labelHeight-g)/2,this.setHeight(this.labelHeight);else if(this.labelPosVertical=="bottom")this.setHeight(g+this.labelHeight)}}}},r.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==f.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},r.prototype.transform=function(i){var e=this.rect.x;if(e>n.WORLD_BOUNDARY)e=n.WORLD_BOUNDARY;else if(e<-n.WORLD_BOUNDARY)e=-n.WORLD_BOUNDARY;var g=this.rect.y;if(g>n.WORLD_BOUNDARY)g=n.WORLD_BOUNDARY;else if(g<-n.WORLD_BOUNDARY)g=-n.WORLD_BOUNDARY;var d=new u(e,g),c=i.inverseTransformPoint(d);this.setLocation(c.x,c.y)},r.prototype.getLeft=function(){return this.rect.x},r.prototype.getRight=function(){return this.rect.x+this.rect.width},r.prototype.getTop=function(){return this.rect.y},r.prototype.getBottom=function(){return this.rect.y+this.rect.height},r.prototype.getParent=function(){if(this.owner==null)return null;return this.owner.getParent()},w.exports=r},function(w,I,A){var v=A(0);function f(){}for(var o in v)f[o]=v[o];f.MAX_ITERATIONS=2500,f.DEFAULT_EDGE_LENGTH=50,f.DEFAULT_SPRING_STRENGTH=0.45,f.DEFAULT_REPULSION_STRENGTH=4500,f.DEFAULT_GRAVITY_STRENGTH=0.4,f.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,f.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,f.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,f.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,f.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,f.DEFAULT_COOLING_FACTOR_INCREMENTAL=0.3,f.COOLING_ADAPTATION_FACTOR=0.33,f.ADAPTATION_LOWER_NODE_LIMIT=1000,f.ADAPTATION_UPPER_NODE_LIMIT=5000,f.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,f.MAX_NODE_DISPLACEMENT=f.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,f.MIN_REPULSION_DIST=f.DEFAULT_EDGE_LENGTH/10,f.CONVERGENCE_CHECK_PERIOD=100,f.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=0.1,f.MIN_EDGE_LENGTH=1,f.GRID_CALCULATION_CHECK_PERIOD=10,w.exports=f},function(w,I,A){function v(f,o){if(f==null&&o==null)this.x=0,this.y=0;else this.x=f,this.y=o}v.prototype.getX=function(){return this.x},v.prototype.getY=function(){return this.y},v.prototype.setX=function(f){this.x=f},v.prototype.setY=function(f){this.y=f},v.prototype.getDifference=function(f){return new DimensionD(this.x-f.x,this.y-f.y)},v.prototype.getCopy=function(){return new v(this.x,this.y)},v.prototype.translate=function(f){return this.x+=f.width,this.y+=f.height,this},w.exports=v},function(w,I,A){var v=A(2),f=A(10),o=A(0),n=A(7),a=A(3),u=A(1),r=A(13),y=A(12),i=A(11);function e(d,c,O){if(v.call(this,O),this.estimatedSize=f.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=d,c!=null&&c instanceof n)this.graphManager=c;else if(c!=null&&c instanceof Layout)this.graphManager=c.graphManager}e.prototype=Object.create(v.prototype);for(var g in v)e[g]=v[g];e.prototype.getNodes=function(){return this.nodes},e.prototype.getEdges=function(){return this.edges},e.prototype.getGraphManager=function(){return this.graphManager},e.prototype.getParent=function(){return this.parent},e.prototype.getLeft=function(){return this.left},e.prototype.getRight=function(){return this.right},e.prototype.getTop=function(){return this.top},e.prototype.getBottom=function(){return this.bottom},e.prototype.isConnected=function(){return this.isConnected},e.prototype.add=function(d,c,O){if(c==null&&O==null){var T=d;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(T)>-1)throw"Node already in graph!";return T.owner=this,this.getNodes().push(T),T}else{var N=d;if(!(this.getNodes().indexOf(c)>-1&&this.getNodes().indexOf(O)>-1))throw"Source or target not in graph!";if(!(c.owner==O.owner&&c.owner==this))throw"Both owners must be this graph!";if(c.owner!=O.owner)return null;if(N.source=c,N.target=O,N.isInterGraph=!1,this.getEdges().push(N),c.edges.push(N),O!=c)O.edges.push(N);return N}},e.prototype.remove=function(d){var c=d;if(d instanceof a){if(c==null)throw"Node is null!";if(!(c.owner!=null&&c.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";var O=c.edges.slice(),T,N=O.length;for(var D=0;D<N;D++)if(T=O[D],T.isInterGraph)this.graphManager.remove(T);else T.source.owner.remove(T);var X=this.nodes.indexOf(c);if(X==-1)throw"Node not in owner node list!";this.nodes.splice(X,1)}else if(d instanceof u){var T=d;if(T==null)throw"Edge is null!";if(!(T.source!=null&&T.target!=null))throw"Source and/or target is null!";if(!(T.source.owner!=null&&T.target.owner!=null&&T.source.owner==this&&T.target.owner==this))throw"Source and/or target owner is invalid!";var x=T.source.edges.indexOf(T),W=T.target.edges.indexOf(T);if(!(x>-1&&W>-1))throw"Source and/or target doesn't know this edge!";if(T.source.edges.splice(x,1),T.target!=T.source)T.target.edges.splice(W,1);var X=T.source.owner.getEdges().indexOf(T);if(X==-1)throw"Not in owner's edge list!";T.source.owner.getEdges().splice(X,1)}},e.prototype.updateLeftTop=function(){var{MAX_VALUE:d,MAX_VALUE:c}=f,O,T,N,D=this.getNodes(),X=D.length;for(var x=0;x<X;x++){var W=D[x];if(O=W.getTop(),T=W.getLeft(),d>O)d=O;if(c>T)c=T}if(d==f.MAX_VALUE)return null;if(D[0].getParent().paddingLeft!=null)N=D[0].getParent().paddingLeft;else N=this.margin;return this.left=c-N,this.top=d-N,new y(this.left,this.top)},e.prototype.updateBounds=function(d){var c=f.MAX_VALUE,O=-f.MAX_VALUE,T=f.MAX_VALUE,N=-f.MAX_VALUE,D,X,x,W,_,Q=this.nodes,lt=Q.length;for(var G=0;G<lt;G++){var tt=Q[G];if(d&&tt.child!=null)tt.updateBounds();if(D=tt.getLeft(),X=tt.getRight(),x=tt.getTop(),W=tt.getBottom(),c>D)c=D;if(O<X)O=X;if(T>x)T=x;if(N<W)N=W}var s=new r(c,T,O-c,N-T);if(c==f.MAX_VALUE)this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom();if(Q[0].getParent().paddingLeft!=null)_=Q[0].getParent().paddingLeft;else _=this.margin;this.left=s.x-_,this.right=s.x+s.width+_,this.top=s.y-_,this.bottom=s.y+s.height+_},e.calculateBounds=function(d){var c=f.MAX_VALUE,O=-f.MAX_VALUE,T=f.MAX_VALUE,N=-f.MAX_VALUE,D,X,x,W,_=d.length;for(var Q=0;Q<_;Q++){var lt=d[Q];if(D=lt.getLeft(),X=lt.getRight(),x=lt.getTop(),W=lt.getBottom(),c>D)c=D;if(O<X)O=X;if(T>x)T=x;if(N<W)N=W}var G=new r(c,T,O-c,N-T);return G},e.prototype.getInclusionTreeDepth=function(){if(this==this.graphManager.getRoot())return 1;else return this.parent.getInclusionTreeDepth()},e.prototype.getEstimatedSize=function(){if(this.estimatedSize==f.MIN_VALUE)throw"assert failed";return this.estimatedSize},e.prototype.calcEstimatedSize=function(){var d=0,c=this.nodes,O=c.length;for(var T=0;T<O;T++){var N=c[T];d+=N.calcEstimatedSize()}if(d==0)this.estimatedSize=o.EMPTY_COMPOUND_NODE_SIZE;else this.estimatedSize=d/Math.sqrt(this.nodes.length);return this.estimatedSize},e.prototype.updateConnected=function(){var d=this;if(this.nodes.length==0){this.isConnected=!0;return}var c=new i,O=new Set,T=this.nodes[0],N,D,X=T.withChildren();X.forEach(function(G){c.push(G),O.add(G)});while(c.length!==0){T=c.shift(),N=T.getEdges();var x=N.length;for(var W=0;W<x;W++){var _=N[W];if(D=_.getOtherEndInGraph(T,this),D!=null&&!O.has(D)){var Q=D.withChildren();Q.forEach(function(G){c.push(G),O.add(G)})}}}if(this.isConnected=!1,O.size>=this.nodes.length){var lt=0;if(O.forEach(function(G){if(G.owner==d)lt++}),lt==this.nodes.length)this.isConnected=!0}},w.exports=e},function(w,I,A){var v,f=A(1);function o(n){v=A(6),this.layout=n,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var n=this.layout.newGraph(),a=this.layout.newNode(null),u=this.add(n,a);return this.setRootGraph(u),this.rootGraph},o.prototype.add=function(n,a,u,r,y){if(u==null&&r==null&&y==null){if(n==null)throw"Graph is null!";if(a==null)throw"Parent node is null!";if(this.graphs.indexOf(n)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(n),n.parent!=null)throw"Already has a parent!";if(a.child!=null)throw"Already has a child!";return n.parent=a,a.child=n,n}else{y=u,r=a,u=n;var i=r.getOwner(),e=y.getOwner();if(!(i!=null&&i.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(e!=null&&e.getGraphManager()==this))throw"Target not in this graph mgr!";if(i==e)return u.isInterGraph=!1,i.add(u,r,y);else{if(u.isInterGraph=!0,u.source=r,u.target=y,this.edges.indexOf(u)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(u),!(u.source!=null&&u.target!=null))throw"Edge source and/or target is null!";if(!(u.source.edges.indexOf(u)==-1&&u.target.edges.indexOf(u)==-1))throw"Edge already in source and/or target incidency list!";return u.source.edges.push(u),u.target.edges.push(u),u}}},o.prototype.remove=function(n){if(n instanceof v){var a=n;if(a.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(a==this.rootGraph||a.parent!=null&&a.parent.graphManager==this))throw"Invalid parent node!";var u=[];u=u.concat(a.getEdges());var r,y=u.length;for(var i=0;i<y;i++)r=u[i],a.remove(r);var e=[];e=e.concat(a.getNodes());var g;y=e.length;for(var i=0;i<y;i++)g=e[i],a.remove(g);if(a==this.rootGraph)this.setRootGraph(null);var d=this.graphs.indexOf(a);this.graphs.splice(d,1),a.parent=null}else if(n instanceof f){if(r=n,r==null)throw"Edge is null!";if(!r.isInterGraph)throw"Not an inter-graph edge!";if(!(r.source!=null&&r.target!=null))throw"Source and/or target is null!";if(!(r.source.edges.indexOf(r)!=-1&&r.target.edges.indexOf(r)!=-1))throw"Source and/or target doesn't know this edge!";var d=r.source.edges.indexOf(r);if(r.source.edges.splice(d,1),d=r.target.edges.indexOf(r),r.target.edges.splice(d,1),!(r.source.owner!=null&&r.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(r.source.owner.getGraphManager().edges.indexOf(r)==-1)throw"Not in owner graph manager's edge list!";var d=r.source.owner.getGraphManager().edges.indexOf(r);r.source.owner.getGraphManager().edges.splice(d,1)}},o.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},o.prototype.getGraphs=function(){return this.graphs},o.prototype.getAllNodes=function(){if(this.allNodes==null){var n=[],a=this.getGraphs(),u=a.length;for(var r=0;r<u;r++)n=n.concat(a[r].getNodes());this.allNodes=n}return this.allNodes},o.prototype.resetAllNodes=function(){this.allNodes=null},o.prototype.resetAllEdges=function(){this.allEdges=null},o.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},o.prototype.getAllEdges=function(){if(this.allEdges==null){var n=[],a=this.getGraphs(),u=a.length;for(var r=0;r<a.length;r++)n=n.concat(a[r].getEdges());n=n.concat(this.edges),this.allEdges=n}return this.allEdges},o.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},o.prototype.setAllNodesToApplyGravitation=function(n){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=n},o.prototype.getRoot=function(){return this.rootGraph},o.prototype.setRootGraph=function(n){if(n.getGraphManager()!=this)throw"Root not in this graph mgr!";if(this.rootGraph=n,n.parent==null)n.parent=this.layout.newNode("Root node")},o.prototype.getLayout=function(){return this.layout},o.prototype.isOneAncestorOfOther=function(n,a){if(!(n!=null&&a!=null))throw"assert failed";if(n==a)return!0;var u=n.getOwner(),r;do{if(r=u.getParent(),r==null)break;if(r==a)return!0;if(u=r.getOwner(),u==null)break}while(!0);u=a.getOwner();do{if(r=u.getParent(),r==null)break;if(r==n)return!0;if(u=r.getOwner(),u==null)break}while(!0);return!1},o.prototype.calcLowestCommonAncestors=function(){var n,a,u,r,y,i=this.getAllEdges(),e=i.length;for(var g=0;g<e;g++){if(n=i[g],a=n.source,u=n.target,n.lca=null,n.sourceInLca=a,n.targetInLca=u,a==u){n.lca=a.getOwner();continue}r=a.getOwner();while(n.lca==null){n.targetInLca=u,y=u.getOwner();while(n.lca==null){if(y==r){n.lca=y;break}if(y==this.rootGraph)break;if(n.lca!=null)throw"assert failed";n.targetInLca=y.getParent(),y=n.targetInLca.getOwner()}if(r==this.rootGraph)break;if(n.lca==null)n.sourceInLca=r.getParent(),r=n.sourceInLca.getOwner()}if(n.lca==null)throw"assert failed"}},o.prototype.calcLowestCommonAncestor=function(n,a){if(n==a)return n.getOwner();var u=n.getOwner();do{if(u==null)break;var r=a.getOwner();do{if(r==null)break;if(r==u)return r;r=r.getParent().getOwner()}while(!0);u=u.getParent().getOwner()}while(!0);return u},o.prototype.calcInclusionTreeDepths=function(n,a){if(n==null&&a==null)n=this.rootGraph,a=1;var u,r=n.getNodes(),y=r.length;for(var i=0;i<y;i++)if(u=r[i],u.inclusionTreeDepth=a,u.child!=null)this.calcInclusionTreeDepths(u.child,a+1)},o.prototype.includesInvalidEdge=function(){var n,a=[],u=this.edges.length;for(var r=0;r<u;r++)if(n=this.edges[r],this.isOneAncestorOfOther(n.source,n.target))a.push(n);for(var r=0;r<a.length;r++)this.remove(a[r]);return!1},w.exports=o},function(w,I,A){var v=A(12);function f(){}f.calcSeparationAmount=function(o,n,a,u){if(!o.intersects(n))throw"assert failed";var r=[,,];if(this.decideDirectionsForOverlappingNodes(o,n,r),a[0]=Math.min(o.getRight(),n.getRight())-Math.max(o.x,n.x),a[1]=Math.min(o.getBottom(),n.getBottom())-Math.max(o.y,n.y),o.getX()<=n.getX()&&o.getRight()>=n.getRight())a[0]+=Math.min(n.getX()-o.getX(),o.getRight()-n.getRight());else if(n.getX()<=o.getX()&&n.getRight()>=o.getRight())a[0]+=Math.min(o.getX()-n.getX(),n.getRight()-o.getRight());if(o.getY()<=n.getY()&&o.getBottom()>=n.getBottom())a[1]+=Math.min(n.getY()-o.getY(),o.getBottom()-n.getBottom());else if(n.getY()<=o.getY()&&n.getBottom()>=o.getBottom())a[1]+=Math.min(o.getY()-n.getY(),n.getBottom()-o.getBottom());var y=Math.abs((n.getCenterY()-o.getCenterY())/(n.getCenterX()-o.getCenterX()));if(n.getCenterY()===o.getCenterY()&&n.getCenterX()===o.getCenterX())y=1;var i=y*a[0],e=a[1]/y;if(a[0]<e)e=a[0];else i=a[1];a[0]=-1*r[0]*(e/2+u),a[1]=-1*r[1]*(i/2+u)},f.decideDirectionsForOverlappingNodes=function(o,n,a){if(o.getCenterX()<n.getCenterX())a[0]=-1;else a[0]=1;if(o.getCenterY()<n.getCenterY())a[1]=-1;else a[1]=1},f.getIntersection2=function(o,n,a){var u=o.getCenterX(),r=o.getCenterY(),y=n.getCenterX(),i=n.getCenterY();if(o.intersects(n))return a[0]=u,a[1]=r,a[2]=y,a[3]=i,!0;var e=o.getX(),g=o.getY(),d=o.getRight(),c=o.getX(),O=o.getBottom(),T=o.getRight(),N=o.getWidthHalf(),D=o.getHeightHalf(),X=n.getX(),x=n.getY(),W=n.getRight(),_=n.getX(),Q=n.getBottom(),lt=n.getRight(),G=n.getWidthHalf(),tt=n.getHeightHalf(),s=!1,L=!1;if(u===y){if(r>i)return a[0]=u,a[1]=g,a[2]=y,a[3]=Q,!1;else if(r<i)return a[0]=u,a[1]=O,a[2]=y,a[3]=x,!1}else if(r===i){if(u>y)return a[0]=e,a[1]=r,a[2]=W,a[3]=i,!1;else if(u<y)return a[0]=d,a[1]=r,a[2]=X,a[3]=i,!1}else{var E=o.height/o.width,M=n.height/n.width,m=(i-r)/(y-u),Y=void 0,b=void 0,k=void 0,B=void 0,H=void 0,st=void 0;if(-E===m)if(u>y)a[0]=c,a[1]=O,s=!0;else a[0]=d,a[1]=g,s=!0;else if(E===m)if(u>y)a[0]=e,a[1]=g,s=!0;else a[0]=T,a[1]=O,s=!0;if(-M===m)if(y>u)a[2]=_,a[3]=Q,L=!0;else a[2]=W,a[3]=x,L=!0;else if(M===m)if(y>u)a[2]=X,a[3]=x,L=!0;else a[2]=lt,a[3]=Q,L=!0;if(s&&L)return!1;if(u>y)if(r>i)Y=this.getCardinalDirection(E,m,4),b=this.getCardinalDirection(M,m,2);else Y=this.getCardinalDirection(-E,m,3),b=this.getCardinalDirection(-M,m,1);else if(r>i)Y=this.getCardinalDirection(-E,m,1),b=this.getCardinalDirection(-M,m,3);else Y=this.getCardinalDirection(E,m,2),b=this.getCardinalDirection(M,m,4);if(!s)switch(Y){case 1:B=g,k=u+-D/m,a[0]=k,a[1]=B;break;case 2:k=T,B=r+N*m,a[0]=k,a[1]=B;break;case 3:B=O,k=u+D/m,a[0]=k,a[1]=B;break;case 4:k=c,B=r+-N*m,a[0]=k,a[1]=B;break}if(!L)switch(b){case 1:st=x,H=y+-tt/m,a[2]=H,a[3]=st;break;case 2:H=lt,st=i+G*m,a[2]=H,a[3]=st;break;case 3:st=Q,H=y+tt/m,a[2]=H,a[3]=st;break;case 4:H=_,st=i+-G*m,a[2]=H,a[3]=st;break}}return!1},f.getCardinalDirection=function(o,n,a){if(o>n)return a;else return 1+a%4},f.getIntersection=function(o,n,a,u){if(u==null)return this.getIntersection2(o,n,a);var{x:r,y}=o,{x:i,y:e}=n,{x:g,y:d}=a,{x:c,y:O}=u,T=void 0,N=void 0,D=void 0,X=void 0,x=void 0,W=void 0,_=void 0,Q=void 0,lt=void 0;if(D=e-y,x=r-i,_=i*y-r*e,X=O-d,W=g-c,Q=c*d-g*O,lt=D*W-X*x,lt===0)return null;return T=(x*Q-W*_)/lt,N=(X*_-D*Q)/lt,new v(T,N)},f.angleOfVector=function(o,n,a,u){var r=void 0;if(o!==a){if(r=Math.atan((u-n)/(a-o)),a<o)r+=Math.PI;else if(u<n)r+=this.TWO_PI}else if(u<n)r=this.ONE_AND_HALF_PI;else r=this.HALF_PI;return r},f.doIntersect=function(o,n,a,u){var{x:r,y}=o,{x:i,y:e}=n,{x:g,y:d}=a,{x:c,y:O}=u,T=(i-r)*(O-d)-(c-g)*(e-y);if(T===0)return!1;else{var N=((O-d)*(c-r)+(g-c)*(O-y))/T,D=((y-e)*(c-r)+(i-r)*(O-y))/T;return 0<N&&N<1&&0<D&&D<1}},f.findCircleLineIntersections=function(o,n,a,u,r,y,i){var e=(a-o)*(a-o)+(u-n)*(u-n),g=2*((o-r)*(a-o)+(n-y)*(u-n)),d=(o-r)*(o-r)+(n-y)*(n-y)-i*i,c=g*g-4*e*d;if(c>=0){var O=(-g+Math.sqrt(g*g-4*e*d))/(2*e),T=(-g-Math.sqrt(g*g-4*e*d))/(2*e),N=null;if(O>=0&&O<=1)return[O];if(T>=0&&T<=1)return[T];return N}else return null},f.HALF_PI=0.5*Math.PI,f.ONE_AND_HALF_PI=1.5*Math.PI,f.TWO_PI=2*Math.PI,f.THREE_PI=3*Math.PI,w.exports=f},function(w,I,A){function v(){}v.sign=function(f){if(f>0)return 1;else if(f<0)return-1;else return 0},v.floor=function(f){return f<0?Math.ceil(f):Math.floor(f)},v.ceil=function(f){return f<0?Math.floor(f):Math.ceil(f)},w.exports=v},function(w,I,A){function v(){}v.MAX_VALUE=2147483647,v.MIN_VALUE=-2147483648,w.exports=v},function(w,I,A){var v=function(){function r(y,i){for(var e=0;e<i.length;e++){var g=i[e];if(g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g)g.writable=!0;Object.defineProperty(y,g.key,g)}}return function(y,i,e){if(i)r(y.prototype,i);if(e)r(y,e);return y}}();function f(r,y){if(!(r instanceof y))throw TypeError("Cannot call a class as a function")}var o=function(y){return{value:y,next:null,prev:null}},n=function(y,i,e,g){if(y!==null)y.next=i;else g.head=i;if(e!==null)e.prev=i;else g.tail=i;return i.prev=y,i.next=e,g.length++,i},a=function(y,i){var{prev:e,next:g}=y;if(e!==null)e.next=g;else i.head=g;if(g!==null)g.prev=e;else i.tail=e;return y.prev=y.next=null,i.length--,y},u=function(){function r(y){var i=this;if(f(this,r),this.length=0,this.head=null,this.tail=null,y!=null)y.forEach(function(e){return i.push(e)})}return v(r,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(i,e){return n(e.prev,o(i),e,this)}},{key:"insertAfter",value:function(i,e){return n(e,o(i),e.next,this)}},{key:"insertNodeBefore",value:function(i,e){return n(e.prev,i,e,this)}},{key:"insertNodeAfter",value:function(i,e){return n(e,i,e.next,this)}},{key:"push",value:function(i){return n(this.tail,o(i),null,this)}},{key:"unshift",value:function(i){return n(null,o(i),this.head,this)}},{key:"remove",value:function(i){return a(i,this)}},{key:"pop",value:function(){return a(this.tail,this).value}},{key:"popNode",value:function(){return a(this.tail,this)}},{key:"shift",value:function(){return a(this.head,this).value}},{key:"shiftNode",value:function(){return a(this.head,this)}},{key:"get_object_at",value:function(i){if(i<=this.length()){var e=1,g=this.head;while(e<i)g=g.next,e++;return g.value}}},{key:"set_object_at",value:function(i,e){if(i<=this.length()){var g=1,d=this.head;while(g<i)d=d.next,g++;d.value=e}}}]),r}();w.exports=u},function(w,I,A){function v(f,o,n){if(this.x=null,this.y=null,f==null&&o==null&&n==null)this.x=0,this.y=0;else if(typeof f=="number"&&typeof o=="number"&&n==null)this.x=f,this.y=o;else if(f.constructor.name=="Point"&&o==null&&n==null)n=f,this.x=n.x,this.y=n.y}v.prototype.getX=function(){return this.x},v.prototype.getY=function(){return this.y},v.prototype.getLocation=function(){return new v(this.x,this.y)},v.prototype.setLocation=function(f,o,n){if(f.constructor.name=="Point"&&o==null&&n==null)n=f,this.setLocation(n.x,n.y);else if(typeof f=="number"&&typeof o=="number"&&n==null)if(parseInt(f)==f&&parseInt(o)==o)this.move(f,o);else this.x=Math.floor(f+0.5),this.y=Math.floor(o+0.5)},v.prototype.move=function(f,o){this.x=f,this.y=o},v.prototype.translate=function(f,o){this.x+=f,this.y+=o},v.prototype.equals=function(f){if(f.constructor.name=="Point"){var o=f;return this.x==o.x&&this.y==o.y}return this==f},v.prototype.toString=function(){return new v().constructor.name+"[x="+this.x+",y="+this.y+"]"},w.exports=v},function(w,I,A){function v(f,o,n,a){if(this.x=0,this.y=0,this.width=0,this.height=0,f!=null&&o!=null&&n!=null&&a!=null)this.x=f,this.y=o,this.width=n,this.height=a}v.prototype.getX=function(){return this.x},v.prototype.setX=function(f){this.x=f},v.prototype.getY=function(){return this.y},v.prototype.setY=function(f){this.y=f},v.prototype.getWidth=function(){return this.width},v.prototype.setWidth=function(f){this.width=f},v.prototype.getHeight=function(){return this.height},v.prototype.setHeight=function(f){this.height=f},v.prototype.getRight=function(){return this.x+this.width},v.prototype.getBottom=function(){return this.y+this.height},v.prototype.intersects=function(f){if(this.getRight()<f.x)return!1;if(this.getBottom()<f.y)return!1;if(f.getRight()<this.x)return!1;if(f.getBottom()<this.y)return!1;return!0},v.prototype.getCenterX=function(){return this.x+this.width/2},v.prototype.getMinX=function(){return this.getX()},v.prototype.getMaxX=function(){return this.getX()+this.width},v.prototype.getCenterY=function(){return this.y+this.height/2},v.prototype.getMinY=function(){return this.getY()},v.prototype.getMaxY=function(){return this.getY()+this.height},v.prototype.getWidthHalf=function(){return this.width/2},v.prototype.getHeightHalf=function(){return this.height/2},w.exports=v},function(w,I,A){var v=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol==="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o};function f(){}f.lastID=0,f.createID=function(o){if(f.isPrimitive(o))return o;if(o.uniqueID!=null)return o.uniqueID;return o.uniqueID=f.getString(),f.lastID++,o.uniqueID},f.getString=function(o){if(o==null)o=f.lastID;return"Object#"+o},f.isPrimitive=function(o){var n=typeof o>"u"?"undefined":v(o);return o==null||n!="object"&&n!="function"},w.exports=f},function(w,I,A){function v(g){if(Array.isArray(g)){for(var d=0,c=Array(g.length);d<g.length;d++)c[d]=g[d];return c}else return Array.from(g)}var f=A(0),o=A(7),n=A(3),a=A(1),u=A(6),r=A(5),y=A(17),i=A(29);function e(g){if(i.call(this),this.layoutQuality=f.QUALITY,this.createBendsAsNeeded=f.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=f.DEFAULT_INCREMENTAL,this.animationOnLayout=f.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=f.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=f.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=f.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new o(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,g!=null)this.isRemoteUse=g}e.RANDOM_SEED=1,e.prototype=Object.create(i.prototype),e.prototype.getGraphManager=function(){return this.graphManager},e.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},e.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},e.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},e.prototype.newGraphManager=function(){var g=new o(this);return this.graphManager=g,g},e.prototype.newGraph=function(g){return new u(null,this.graphManager,g)},e.prototype.newNode=function(g){return new n(this.graphManager,g)},e.prototype.newEdge=function(g){return new a(null,null,g)},e.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},e.prototype.runLayout=function(){if(this.isLayoutFinished=!1,this.tilingPreLayout)this.tilingPreLayout();this.initParameters();var g;if(this.checkLayoutSuccess())g=!1;else g=this.layout();if(f.ANIMATE==="during")return!1;if(g){if(!this.isSubLayout)this.doPostLayout()}if(this.tilingPostLayout)this.tilingPostLayout();return this.isLayoutFinished=!0,g},e.prototype.doPostLayout=function(){if(!this.incremental)this.transform();this.update()},e.prototype.update2=function(){if(this.createBendsAsNeeded)this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges();if(!this.isRemoteUse){var g,d=this.graphManager.getAllEdges();for(var c=0;c<d.length;c++)g=d[c];var O,T=this.graphManager.getRoot().getNodes();for(var c=0;c<T.length;c++)O=T[c];this.update(this.graphManager.getRoot())}},e.prototype.update=function(g){if(g==null)this.update2();else if(g instanceof n){var d=g;if(d.getChild()!=null){var c=d.getChild().getNodes();for(var O=0;O<c.length;O++)update(c[O])}if(d.vGraphObject!=null){var T=d.vGraphObject;T.update(d)}}else if(g instanceof a){var N=g;if(N.vGraphObject!=null){var D=N.vGraphObject;D.update(N)}}else if(g instanceof u){var X=g;if(X.vGraphObject!=null){var x=X.vGraphObject;x.update(X)}}},e.prototype.initParameters=function(){if(!this.isSubLayout)this.layoutQuality=f.QUALITY,this.animationDuringLayout=f.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=f.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=f.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=f.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=f.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=f.DEFAULT_UNIFORM_LEAF_NODE_SIZES;if(this.animationDuringLayout)this.animationOnLayout=!1},e.prototype.transform=function(g){if(g==null)this.transform(new r(0,0));else{var d=new y,c=this.graphManager.getRoot().updateLeftTop();if(c!=null){d.setWorldOrgX(g.x),d.setWorldOrgY(g.y),d.setDeviceOrgX(c.x),d.setDeviceOrgY(c.y);var O=this.getAllNodes(),T;for(var N=0;N<O.length;N++)T=O[N],T.transform(d)}}},e.prototype.positionNodesRandomly=function(g){if(g==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else{var d,c,O=g.getNodes();for(var T=0;T<O.length;T++)if(d=O[T],c=d.getChild(),c==null)d.scatter();else if(c.getNodes().length==0)d.scatter();else this.positionNodesRandomly(c),d.updateBounds()}},e.prototype.getFlatForest=function(){var g=[],d=!0,c=this.graphManager.getRoot().getNodes(),O=!0;for(var T=0;T<c.length;T++)if(c[T].getChild()!=null)O=!1;if(!O)return g;var N=new Set,D=[],X=new Map,x=[];x=x.concat(c);while(x.length>0&&d){D.push(x[0]);while(D.length>0&&d){var W=D[0];D.splice(0,1),N.add(W);var _=W.getEdges();for(var T=0;T<_.length;T++){var Q=_[T].getOtherEnd(W);if(X.get(W)!=Q)if(!N.has(Q))D.push(Q),X.set(Q,W);else{d=!1;break}}}if(!d)g=[];else{var lt=[].concat(v(N));g.push(lt);for(var T=0;T<lt.length;T++){var G=lt[T],tt=x.indexOf(G);if(tt>-1)x.splice(tt,1)}N=new Set,X=new Map}}return g},e.prototype.createDummyNodesForBendpoints=function(g){var d=[],c=g.source,O=this.graphManager.calcLowestCommonAncestor(g.source,g.target);for(var T=0;T<g.bendpoints.length;T++){var N=this.newNode(null);N.setRect(new Point(0,0),new Dimension(1,1)),O.add(N);var D=this.newEdge(null);this.graphManager.add(D,c,N),d.add(N),c=N}var D=this.newEdge(null);if(this.graphManager.add(D,c,g.target),this.edgeToDummyNodes.set(g,d),g.isInterGraph())this.graphManager.remove(g);else O.remove(g);return d},e.prototype.createBendpointsFromDummyNodes=function(){var g=[];g=g.concat(this.graphManager.getAllEdges()),g=[].concat(v(this.edgeToDummyNodes.keys())).concat(g);for(var d=0;d<g.length;d++){var c=g[d];if(c.bendpoints.length>0){var O=this.edgeToDummyNodes.get(c);for(var T=0;T<O.length;T++){var N=O[T],D=new r(N.getCenterX(),N.getCenterY()),X=c.bendpoints.get(T);X.x=D.x,X.y=D.y,N.getOwner().remove(N)}this.graphManager.add(c,c.source,c.target)}}},e.transform=function(g,d,c,O){if(c!=null&&O!=null){var T=d;if(g<=50){var N=d/c;T-=(d-N)/50*(50-g)}else{var D=d*O;T+=(D-d)/50*(g-50)}return T}else{var X,x;if(g<=50)X=9*d/500,x=d/10;else X=9*d/50,x=-8*d;return X*g+x}},e.findCenterOfTree=function(g){var d=[];d=d.concat(g);var c=[],O=new Map,T=!1,N=null;if(d.length==1||d.length==2)T=!0,N=d[0];for(var D=0;D<d.length;D++){var X=d[D],x=X.getNeighborsList().size;if(O.set(X,X.getNeighborsList().size),x==1)c.push(X)}var W=[];W=W.concat(c);while(!T){var _=[];_=_.concat(W),W=[];for(var D=0;D<d.length;D++){var X=d[D],Q=d.indexOf(X);if(Q>=0)d.splice(Q,1);var lt=X.getNeighborsList();lt.forEach(function(s){if(c.indexOf(s)<0){var L=O.get(s),E=L-1;if(E==1)W.push(s);O.set(s,E)}})}if(c=c.concat(W),d.length==1||d.length==2)T=!0,N=d[0]}return N},e.prototype.setGraphManager=function(g){this.graphManager=g},w.exports=e},function(w,I,A){function v(){}v.seed=1,v.x=0,v.nextDouble=function(){return v.x=Math.sin(v.seed++)*1e4,v.x-Math.floor(v.x)},w.exports=v},function(w,I,A){var v=A(5);function f(o,n){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}f.prototype.getWorldOrgX=function(){return this.lworldOrgX},f.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},f.prototype.getWorldOrgY=function(){return this.lworldOrgY},f.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},f.prototype.getWorldExtX=function(){return this.lworldExtX},f.prototype.setWorldExtX=function(o){this.lworldExtX=o},f.prototype.getWorldExtY=function(){return this.lworldExtY},f.prototype.setWorldExtY=function(o){this.lworldExtY=o},f.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},f.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},f.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},f.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},f.prototype.getDeviceExtX=function(){return this.ldeviceExtX},f.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},f.prototype.getDeviceExtY=function(){return this.ldeviceExtY},f.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},f.prototype.transformX=function(o){var n=0,a=this.lworldExtX;if(a!=0)n=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/a;return n},f.prototype.transformY=function(o){var n=0,a=this.lworldExtY;if(a!=0)n=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/a;return n},f.prototype.inverseTransformX=function(o){var n=0,a=this.ldeviceExtX;if(a!=0)n=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/a;return n},f.prototype.inverseTransformY=function(o){var n=0,a=this.ldeviceExtY;if(a!=0)n=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/a;return n},f.prototype.inverseTransformPoint=function(o){var n=new v(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return n},w.exports=f},function(w,I,A){function v(i){if(Array.isArray(i)){for(var e=0,g=Array(i.length);e<i.length;e++)g[e]=i[e];return g}else return Array.from(i)}var f=A(15),o=A(4),n=A(0),a=A(8),u=A(9);function r(){f.call(this),this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=o.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=o.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=o.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=o.MAX_ITERATIONS}r.prototype=Object.create(f.prototype);for(var y in f)r[y]=f[y];r.prototype.initParameters=function(){f.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=o.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},r.prototype.calcIdealEdgeLengths=function(){var i,e,g,d,c,O,T,N=this.getGraphManager().getAllEdges();for(var D=0;D<N.length;D++)if(i=N[D],e=i.idealLength,i.isInterGraph){if(d=i.getSource(),c=i.getTarget(),O=i.getSourceInLca().getEstimatedSize(),T=i.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation)i.idealLength+=O+T-2*n.SIMPLE_NODE_SIZE;g=i.getLca().getInclusionTreeDepth(),i.idealLength+=e*o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(d.getInclusionTreeDepth()+c.getInclusionTreeDepth()-2*g)}},r.prototype.initSpringEmbedder=function(){var i=this.getAllNodes().length;if(this.incremental){if(i>o.ADAPTATION_LOWER_NODE_LIMIT)this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(i-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR));this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL}else{if(i>o.ADAPTATION_LOWER_NODE_LIMIT)this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(i-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR));else this.coolingFactor=1;this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT}this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},r.prototype.calcSpringForces=function(){var i=this.getAllEdges(),e;for(var g=0;g<i.length;g++)e=i[g],this.calcSpringForce(e,e.idealLength)},r.prototype.calcRepulsionForces=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,g,d,c,O,T=this.getAllNodes(),N;if(this.useFRGridVariant){if(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&i)this.updateGrid();N=new Set;for(g=0;g<T.length;g++)c=T[g],this.calculateRepulsionForceOfANode(c,N,i,e),N.add(c)}else for(g=0;g<T.length;g++){c=T[g];for(d=g+1;d<T.length;d++){if(O=T[d],c.getOwner()!=O.getOwner())continue;this.calcRepulsionForce(c,O)}}},r.prototype.calcGravitationalForces=function(){var i,e=this.getAllNodesToApplyGravitation();for(var g=0;g<e.length;g++)i=e[g],this.calcGravitationalForce(i)},r.prototype.moveNodes=function(){var i=this.getAllNodes(),e;for(var g=0;g<i.length;g++)e=i[g],e.move()},r.prototype.calcSpringForce=function(i,e){var g=i.getSource(),d=i.getTarget(),c,O,T,N;if(this.uniformLeafNodeSizes&&g.getChild()==null&&d.getChild()==null)i.updateLengthSimple();else if(i.updateLength(),i.isOverlapingSourceAndTarget)return;if(c=i.getLength(),c==0)return;O=i.edgeElasticity*(c-e),T=O*(i.lengthX/c),N=O*(i.lengthY/c),g.springForceX+=T,g.springForceY+=N,d.springForceX-=T,d.springForceY-=N},r.prototype.calcRepulsionForce=function(i,e){var g=i.getRect(),d=e.getRect(),c=[,,],O=[,,,,],T,N,D,X,x,W,_;if(g.intersects(d)){a.calcSeparationAmount(g,d,c,o.DEFAULT_EDGE_LENGTH/2),W=2*c[0],_=2*c[1];var Q=i.noOfChildren*e.noOfChildren/(i.noOfChildren+e.noOfChildren);i.repulsionForceX-=Q*W,i.repulsionForceY-=Q*_,e.repulsionForceX+=Q*W,e.repulsionForceY+=Q*_}else{if(this.uniformLeafNodeSizes&&i.getChild()==null&&e.getChild()==null)T=d.getCenterX()-g.getCenterX(),N=d.getCenterY()-g.getCenterY();else a.getIntersection(g,d,O),T=O[2]-O[0],N=O[3]-O[1];if(Math.abs(T)<o.MIN_REPULSION_DIST)T=u.sign(T)*o.MIN_REPULSION_DIST;if(Math.abs(N)<o.MIN_REPULSION_DIST)N=u.sign(N)*o.MIN_REPULSION_DIST;D=T*T+N*N,X=Math.sqrt(D),x=(i.nodeRepulsion/2+e.nodeRepulsion/2)*i.noOfChildren*e.noOfChildren/D,W=x*T/X,_=x*N/X,i.repulsionForceX-=W,i.repulsionForceY-=_,e.repulsionForceX+=W,e.repulsionForceY+=_}},r.prototype.calcGravitationalForce=function(i){var e,g,d,c,O,T,N,D;if(e=i.getOwner(),g=(e.getRight()+e.getLeft())/2,d=(e.getTop()+e.getBottom())/2,c=i.getCenterX()-g,O=i.getCenterY()-d,T=Math.abs(c)+i.getWidth()/2,N=Math.abs(O)+i.getHeight()/2,i.getOwner()==this.graphManager.getRoot()){if(D=e.getEstimatedSize()*this.gravityRangeFactor,T>D||N>D)i.gravitationForceX=-this.gravityConstant*c,i.gravitationForceY=-this.gravityConstant*O}else if(D=e.getEstimatedSize()*this.compoundGravityRangeFactor,T>D||N>D)i.gravitationForceX=-this.gravityConstant*c*this.compoundGravityConstant,i.gravitationForceY=-this.gravityConstant*O*this.compoundGravityConstant},r.prototype.isConverged=function(){var i,e=!1;if(this.totalIterations>this.maxIterations/3)e=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2;return i=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,i||e},r.prototype.animate=function(){if(this.animationDuringLayout&&!this.isSubLayout)if(this.notAnimatedIterations==this.animationPeriod)this.update(),this.notAnimatedIterations=0;else this.notAnimatedIterations++},r.prototype.calcNoOfChildrenForAllNodes=function(){var i,e=this.graphManager.getAllNodes();for(var g=0;g<e.length;g++)i=e[g],i.noOfChildren=i.getNoOfChildren()},r.prototype.calcGrid=function(i){var e=0,g=0;e=parseInt(Math.ceil((i.getRight()-i.getLeft())/this.repulsionRange)),g=parseInt(Math.ceil((i.getBottom()-i.getTop())/this.repulsionRange));var d=Array(e);for(var c=0;c<e;c++)d[c]=Array(g);for(var c=0;c<e;c++)for(var O=0;O<g;O++)d[c][O]=[];return d},r.prototype.addNodeToGrid=function(i,e,g){var d=0,c=0,O=0,T=0;d=parseInt(Math.floor((i.getRect().x-e)/this.repulsionRange)),c=parseInt(Math.floor((i.getRect().width+i.getRect().x-e)/this.repulsionRange)),O=parseInt(Math.floor((i.getRect().y-g)/this.repulsionRange)),T=parseInt(Math.floor((i.getRect().height+i.getRect().y-g)/this.repulsionRange));for(var N=d;N<=c;N++)for(var D=O;D<=T;D++)this.grid[N][D].push(i),i.setGridCoordinates(d,c,O,T)},r.prototype.updateGrid=function(){var i,e,g=this.getAllNodes();this.grid=this.calcGrid(this.graphManager.getRoot());for(i=0;i<g.length;i++)e=g[i],this.addNodeToGrid(e,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},r.prototype.calculateRepulsionForceOfANode=function(i,e,g,d){if(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&g||d){var c=new Set;i.surrounding=[];var O,T=this.grid;for(var N=i.startX-1;N<i.finishX+2;N++)for(var D=i.startY-1;D<i.finishY+2;D++)if(!(N<0||D<0||N>=T.length||D>=T[0].length))for(var X=0;X<T[N][D].length;X++){if(O=T[N][D][X],i.getOwner()!=O.getOwner()||i==O)continue;if(!e.has(O)&&!c.has(O)){var x=Math.abs(i.getCenterX()-O.getCenterX())-(i.getWidth()/2+O.getWidth()/2),W=Math.abs(i.getCenterY()-O.getCenterY())-(i.getHeight()/2+O.getHeight()/2);if(x<=this.repulsionRange&&W<=this.repulsionRange)c.add(O)}}i.surrounding=[].concat(v(c))}for(N=0;N<i.surrounding.length;N++)this.calcRepulsionForce(i,i.surrounding[N])},r.prototype.calcRepulsionRange=function(){return 0},w.exports=r},function(w,I,A){var v=A(1),f=A(4);function o(a,u,r){v.call(this,a,u,r),this.idealLength=f.DEFAULT_EDGE_LENGTH,this.edgeElasticity=f.DEFAULT_SPRING_STRENGTH}o.prototype=Object.create(v.prototype);for(var n in v)o[n]=v[n];w.exports=o},function(w,I,A){var v=A(3),f=A(4);function o(a,u,r,y){v.call(this,a,u,r,y),this.nodeRepulsion=f.DEFAULT_REPULSION_STRENGTH,this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}o.prototype=Object.create(v.prototype);for(var n in v)o[n]=v[n];o.prototype.setGridCoordinates=function(a,u,r,y){this.startX=a,this.finishX=u,this.startY=r,this.finishY=y},w.exports=o},function(w,I,A){function v(f,o){if(this.width=0,this.height=0,f!==null&&o!==null)this.height=o,this.width=f}v.prototype.getWidth=function(){return this.width},v.prototype.setWidth=function(f){this.width=f},v.prototype.getHeight=function(){return this.height},v.prototype.setHeight=function(f){this.height=f},w.exports=v},function(w,I,A){var v=A(14);function f(){this.map={},this.keys=[]}f.prototype.put=function(o,n){var a=v.createID(o);if(!this.contains(a))this.map[a]=n,this.keys.push(o)},f.prototype.contains=function(o){var n=v.createID(o);return this.map[o]!=null},f.prototype.get=function(o){var n=v.createID(o);return this.map[n]},f.prototype.keySet=function(){return this.keys},w.exports=f},function(w,I,A){var v=A(14);function f(){this.set={}}f.prototype.add=function(o){var n=v.createID(o);if(!this.contains(n))this.set[n]=o},f.prototype.remove=function(o){delete this.set[v.createID(o)]},f.prototype.clear=function(){this.set={}},f.prototype.contains=function(o){return this.set[v.createID(o)]==o},f.prototype.isEmpty=function(){return this.size()===0},f.prototype.size=function(){return Object.keys(this.set).length},f.prototype.addAllTo=function(o){var n=Object.keys(this.set),a=n.length;for(var u=0;u<a;u++)o.push(this.set[n[u]])},f.prototype.size=function(){return Object.keys(this.set).length},f.prototype.addAll=function(o){var n=o.length;for(var a=0;a<n;a++){var u=o[a];this.add(u)}},w.exports=f},function(w,I,A){function v(){}v.multMat=function(f,o){var n=[];for(var a=0;a<f.length;a++){n[a]=[];for(var u=0;u<o[0].length;u++){n[a][u]=0;for(var r=0;r<f[0].length;r++)n[a][u]+=f[a][r]*o[r][u]}}return n},v.transpose=function(f){var o=[];for(var n=0;n<f[0].length;n++){o[n]=[];for(var a=0;a<f.length;a++)o[n][a]=f[a][n]}return o},v.multCons=function(f,o){var n=[];for(var a=0;a<f.length;a++)n[a]=f[a]*o;return n},v.minusOp=function(f,o){var n=[];for(var a=0;a<f.length;a++)n[a]=f[a]-o[a];return n},v.dotProduct=function(f,o){var n=0;for(var a=0;a<f.length;a++)n+=f[a]*o[a];return n},v.mag=function(f){return Math.sqrt(this.dotProduct(f,f))},v.normalize=function(f){var o=[],n=this.mag(f);for(var a=0;a<f.length;a++)o[a]=f[a]/n;return o},v.multGamma=function(f){var o=[],n=0;for(var a=0;a<f.length;a++)n+=f[a];n*=-1/f.length;for(var u=0;u<f.length;u++)o[u]=n+f[u];return o},v.multL=function(f,o,n){var a=[],u=[],r=[];for(var y=0;y<o[0].length;y++){var i=0;for(var e=0;e<o.length;e++)i+=-0.5*o[e][y]*f[e];u[y]=i}for(var g=0;g<n.length;g++){var d=0;for(var c=0;c<n.length;c++)d+=n[g][c]*u[c];r[g]=d}for(var O=0;O<o.length;O++){var T=0;for(var N=0;N<o[0].length;N++)T+=o[O][N]*r[N];a[O]=T}return a},w.exports=v},function(w,I,A){var v=function(){function a(u,r){for(var y=0;y<r.length;y++){var i=r[y];if(i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i)i.writable=!0;Object.defineProperty(u,i.key,i)}}return function(u,r,y){if(r)a(u.prototype,r);if(y)a(u,y);return u}}();function f(a,u){if(!(a instanceof u))throw TypeError("Cannot call a class as a function")}var o=A(11),n=function(){function a(u,r){if(f(this,a),r!==null||r!==void 0)this.compareFunction=this._defaultCompareFunction;var y=void 0;if(u instanceof o)y=u.size();else y=u.length;this._quicksort(u,0,y-1)}return v(a,[{key:"_quicksort",value:function(r,y,i){if(y<i){var e=this._partition(r,y,i);this._quicksort(r,y,e),this._quicksort(r,e+1,i)}}},{key:"_partition",value:function(r,y,i){var e=this._get(r,y),g=y,d=i;while(!0){while(this.compareFunction(e,this._get(r,d)))d--;while(this.compareFunction(this._get(r,g),e))g++;if(g<d)this._swap(r,g,d),g++,d--;else return d}}},{key:"_get",value:function(r,y){if(r instanceof o)return r.get_object_at(y);else return r[y]}},{key:"_set",value:function(r,y,i){if(r instanceof o)r.set_object_at(y,i);else r[y]=i}},{key:"_swap",value:function(r,y,i){var e=this._get(r,y);this._set(r,y,this._get(r,i)),this._set(r,i,e)}},{key:"_defaultCompareFunction",value:function(r,y){return y>r}}]),a}();w.exports=n},function(w,I,A){function v(){}v.svd=function(f){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=f.length,this.n=f[0].length;var o=Math.min(this.m,this.n);this.s=function(Wt){var bt=[];while(Wt-- >0)bt.push(0);return bt}(Math.min(this.m+1,this.n)),this.U=function(Wt){var bt=function ae($t){if($t.length==0)return 0;else{var jt=[];for(var ie=0;ie<$t[0];ie++)jt.push(ae($t.slice(1)));return jt}};return bt(Wt)}([this.m,o]),this.V=function(Wt){var bt=function ae($t){if($t.length==0)return 0;else{var jt=[];for(var ie=0;ie<$t[0];ie++)jt.push(ae($t.slice(1)));return jt}};return bt(Wt)}([this.n,this.n]);var n=function(Wt){var bt=[];while(Wt-- >0)bt.push(0);return bt}(this.n),a=function(Wt){var bt=[];while(Wt-- >0)bt.push(0);return bt}(this.m),u=!0,r=!0,y=Math.min(this.m-1,this.n),i=Math.max(0,Math.min(this.n-2,this.m));for(var e=0;e<Math.max(y,i);e++){if(e<y){this.s[e]=0;for(var g=e;g<this.m;g++)this.s[e]=v.hypot(this.s[e],f[g][e]);if(this.s[e]!==0){if(f[e][e]<0)this.s[e]=-this.s[e];for(var d=e;d<this.m;d++)f[d][e]/=this.s[e];f[e][e]+=1}this.s[e]=-this.s[e]}for(var c=e+1;c<this.n;c++){if(function(Wt,bt){return Wt&&bt}(e<y,this.s[e]!==0)){var O=0;for(var T=e;T<this.m;T++)O+=f[T][e]*f[T][c];O=-O/f[e][e];for(var N=e;N<this.m;N++)f[N][c]+=O*f[N][e]}n[c]=f[e][c]}if(function(Wt,bt){return Wt&&bt}(u,e<y))for(var D=e;D<this.m;D++)this.U[D][e]=f[D][e];if(e<i){n[e]=0;for(var X=e+1;X<this.n;X++)n[e]=v.hypot(n[e],n[X]);if(n[e]!==0){if(n[e+1]<0)n[e]=-n[e];for(var x=e+1;x<this.n;x++)n[x]/=n[e];n[e+1]+=1}if(n[e]=-n[e],function(Wt,bt){return Wt&&bt}(e+1<this.m,n[e]!==0)){for(var W=e+1;W<this.m;W++)a[W]=0;for(var _=e+1;_<this.n;_++)for(var Q=e+1;Q<this.m;Q++)a[Q]+=n[_]*f[Q][_];for(var lt=e+1;lt<this.n;lt++){var G=-n[lt]/n[e+1];for(var tt=e+1;tt<this.m;tt++)f[tt][lt]+=G*a[tt]}}if(r)for(var s=e+1;s<this.n;s++)this.V[s][e]=n[s]}}var L=Math.min(this.n,this.m+1);if(y<this.n)this.s[y]=f[y][y];if(this.m<L)this.s[L-1]=0;if(i+1<L)n[i]=f[i][L-1];if(n[L-1]=0,u){for(var E=y;E<o;E++){for(var M=0;M<this.m;M++)this.U[M][E]=0;this.U[E][E]=1}for(var m=y-1;m>=0;m--)if(this.s[m]!==0){for(var Y=m+1;Y<o;Y++){var b=0;for(var k=m;k<this.m;k++)b+=this.U[k][m]*this.U[k][Y];b=-b/this.U[m][m];for(var B=m;B<this.m;B++)this.U[B][Y]+=b*this.U[B][m]}for(var H=m;H<this.m;H++)this.U[H][m]=-this.U[H][m];this.U[m][m]=1+this.U[m][m];for(var st=0;st<m-1;st++)this.U[st][m]=0}else{for(var dt=0;dt<this.m;dt++)this.U[dt][m]=0;this.U[m][m]=1}}if(r)for(var Z=this.n-1;Z>=0;Z--){if(function(Wt,bt){return Wt&&bt}(Z<i,n[Z]!==0))for(var ut=Z+1;ut<o;ut++){var nt=0;for(var S=Z+1;S<this.n;S++)nt+=this.V[S][Z]*this.V[S][ut];nt=-nt/this.V[Z+1][Z];for(var K=Z+1;K<this.n;K++)this.V[K][ut]+=nt*this.V[K][Z]}for(var et=0;et<this.n;et++)this.V[et][Z]=0;this.V[Z][Z]=1}var ct=L-1,Nt=0,Pt=Math.pow(2,-52),Bt=Math.pow(2,-966);while(L>0){var ft=void 0,Jt=void 0;for(ft=L-2;ft>=-1;ft--){if(ft===-1)break;if(Math.abs(n[ft])<=Bt+Pt*(Math.abs(this.s[ft])+Math.abs(this.s[ft+1]))){n[ft]=0;break}}if(ft===L-2)Jt=4;else{var Xt=void 0;for(Xt=L-1;Xt>=ft;Xt--){if(Xt===ft)break;var Et=(Xt!==L?Math.abs(n[Xt]):0)+(Xt!==ft+1?Math.abs(n[Xt-1]):0);if(Math.abs(this.s[Xt])<=Bt+Pt*Et){this.s[Xt]=0;break}}if(Xt===ft)Jt=3;else if(Xt===L-1)Jt=1;else Jt=2,ft=Xt}switch(ft++,Jt){case 1:{var vt=n[L-2];n[L-2]=0;for(var xt=L-2;xt>=ft;xt--){var Rt=v.hypot(this.s[xt],vt),Gt=this.s[xt]/Rt,St=vt/Rt;if(this.s[xt]=Rt,xt!==ft)vt=-St*n[xt-1],n[xt-1]=Gt*n[xt-1];if(r)for(var Ft=0;Ft<this.n;Ft++)Rt=Gt*this.V[Ft][xt]+St*this.V[Ft][L-1],this.V[Ft][L-1]=-St*this.V[Ft][xt]+Gt*this.V[Ft][L-1],this.V[Ft][xt]=Rt}}break;case 2:{var Ht=n[ft-1];n[ft-1]=0;for(var zt=ft;zt<L;zt++){var te=v.hypot(this.s[zt],Ht),qt=this.s[zt]/te,Kt=Ht/te;if(this.s[zt]=te,Ht=-Kt*n[zt],n[zt]=qt*n[zt],u)for(var kt=0;kt<this.m;kt++)te=qt*this.U[kt][zt]+Kt*this.U[kt][ft-1],this.U[kt][ft-1]=-Kt*this.U[kt][zt]+qt*this.U[kt][ft-1],this.U[kt][zt]=te}}break;case 3:{var J=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[L-1]),Math.abs(this.s[L-2])),Math.abs(n[L-2])),Math.abs(this.s[ft])),Math.abs(n[ft])),rt=this.s[L-1]/J,it=this.s[L-2]/J,at=n[L-2]/J,ot=this.s[ft]/J,gt=n[ft]/J,At=((it+rt)*(it-rt)+at*at)/2,Mt=rt*at*(rt*at),ht=0;if(function(Wt,bt){return Wt||bt}(At!==0,Mt!==0)){if(ht=Math.sqrt(At*At+Mt),At<0)ht=-ht;ht=Mt/(At+ht)}var Lt=(ot+rt)*(ot-rt)+ht,Ct=ot*gt;for(var pt=ft;pt<L-1;pt++){var Ot=v.hypot(Lt,Ct),Ut=Lt/Ot,Tt=Ct/Ot;if(pt!==ft)n[pt-1]=Ot;if(Lt=Ut*this.s[pt]+Tt*n[pt],n[pt]=Ut*n[pt]-Tt*this.s[pt],Ct=Tt*this.s[pt+1],this.s[pt+1]=Ut*this.s[pt+1],r)for(var yt=0;yt<this.n;yt++)Ot=Ut*this.V[yt][pt]+Tt*this.V[yt][pt+1],this.V[yt][pt+1]=-Tt*this.V[yt][pt]+Ut*this.V[yt][pt+1],this.V[yt][pt]=Ot;if(Ot=v.hypot(Lt,Ct),Ut=Lt/Ot,Tt=Ct/Ot,this.s[pt]=Ot,Lt=Ut*n[pt]+Tt*this.s[pt+1],this.s[pt+1]=-Tt*n[pt]+Ut*this.s[pt+1],Ct=Tt*n[pt+1],n[pt+1]=Ut*n[pt+1],u&&pt<this.m-1)for(var Dt=0;Dt<this.m;Dt++)Ot=Ut*this.U[Dt][pt]+Tt*this.U[Dt][pt+1],this.U[Dt][pt+1]=-Tt*this.U[Dt][pt]+Ut*this.U[Dt][pt+1],this.U[Dt][pt]=Ot}n[L-2]=Lt,Nt=Nt+1}break;case 4:{if(this.s[ft]<=0){if(this.s[ft]=this.s[ft]<0?-this.s[ft]:0,r)for(var mt=0;mt<=ct;mt++)this.V[mt][ft]=-this.V[mt][ft]}while(ft<ct){if(this.s[ft]>=this.s[ft+1])break;var wt=this.s[ft];if(this.s[ft]=this.s[ft+1],this.s[ft+1]=wt,r&&ft<this.n-1)for(var Zt=0;Zt<this.n;Zt++)wt=this.V[Zt][ft+1],this.V[Zt][ft+1]=this.V[Zt][ft],this.V[Zt][ft]=wt;if(u&&ft<this.m-1)for(var Vt=0;Vt<this.m;Vt++)wt=this.U[Vt][ft+1],this.U[Vt][ft+1]=this.U[Vt][ft],this.U[Vt][ft]=wt;ft++}Nt=0,L--}break}}var re={U:this.U,V:this.V,S:this.s};return re},v.hypot=function(f,o){var n=void 0;if(Math.abs(f)>Math.abs(o))n=o/f,n=Math.abs(f)*Math.sqrt(1+n*n);else if(o!=0)n=f/o,n=Math.abs(o)*Math.sqrt(1+n*n);else n=0;return n},w.exports=v},function(w,I,A){var v=function(){function n(a,u){for(var r=0;r<u.length;r++){var y=u[r];if(y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y)y.writable=!0;Object.defineProperty(a,y.key,y)}}return function(a,u,r){if(u)n(a.prototype,u);if(r)n(a,r);return a}}();function f(n,a){if(!(n instanceof a))throw TypeError("Cannot call a class as a function")}var o=function(){function n(a,u){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,y=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;f(this,n),this.sequence1=a,this.sequence2=u,this.match_score=r,this.mismatch_penalty=y,this.gap_penalty=i,this.iMax=a.length+1,this.jMax=u.length+1,this.grid=Array(this.iMax);for(var e=0;e<this.iMax;e++){this.grid[e]=Array(this.jMax);for(var g=0;g<this.jMax;g++)this.grid[e][g]=0}this.tracebackGrid=Array(this.iMax);for(var d=0;d<this.iMax;d++){this.tracebackGrid[d]=Array(this.jMax);for(var c=0;c<this.jMax;c++)this.tracebackGrid[d][c]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return v(n,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var u=1;u<this.jMax;u++)this.grid[0][u]=this.grid[0][u-1]+this.gap_penalty,this.tracebackGrid[0][u]=[!1,!1,!0];for(var r=1;r<this.iMax;r++)this.grid[r][0]=this.grid[r-1][0]+this.gap_penalty,this.tracebackGrid[r][0]=[!1,!0,!1];for(var y=1;y<this.iMax;y++)for(var i=1;i<this.jMax;i++){var e=void 0;if(this.sequence1[y-1]===this.sequence2[i-1])e=this.grid[y-1][i-1]+this.match_score;else e=this.grid[y-1][i-1]+this.mismatch_penalty;var g=this.grid[y-1][i]+this.gap_penalty,d=this.grid[y][i-1]+this.gap_penalty,c=[e,g,d],O=this.arrayAllMaxIndexes(c);this.grid[y][i]=c[O[0]],this.tracebackGrid[y][i]=[O.includes(0),O.includes(1),O.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var u=[];u.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});while(u[0]){var r=u[0],y=this.tracebackGrid[r.pos[0]][r.pos[1]];if(y[0])u.push({pos:[r.pos[0]-1,r.pos[1]-1],seq1:this.sequence1[r.pos[0]-1]+r.seq1,seq2:this.sequence2[r.pos[1]-1]+r.seq2});if(y[1])u.push({pos:[r.pos[0]-1,r.pos[1]],seq1:this.sequence1[r.pos[0]-1]+r.seq1,seq2:"-"+r.seq2});if(y[2])u.push({pos:[r.pos[0],r.pos[1]-1],seq1:"-"+r.seq1,seq2:this.sequence2[r.pos[1]-1]+r.seq2});if(r.pos[0]===0&&r.pos[1]===0)this.alignments.push({sequence1:r.seq1,sequence2:r.seq2});u.shift()}return this.alignments}},{key:"getAllIndexes",value:function(u,r){var y=[],i=-1;while((i=u.indexOf(r,i+1))!==-1)y.push(i);return y}},{key:"arrayAllMaxIndexes",value:function(u){return this.getAllIndexes(u,Math.max.apply(null,u))}}]),n}();w.exports=o},function(w,I,A){var v=function(){return};v.FDLayout=A(18),v.FDLayoutConstants=A(4),v.FDLayoutEdge=A(19),v.FDLayoutNode=A(20),v.DimensionD=A(21),v.HashMap=A(22),v.HashSet=A(23),v.IGeometry=A(8),v.IMath=A(9),v.Integer=A(10),v.Point=A(12),v.PointD=A(5),v.RandomSeed=A(16),v.RectangleD=A(13),v.Transform=A(17),v.UniqueIDGeneretor=A(14),v.Quicksort=A(25),v.LinkedList=A(11),v.LGraphObject=A(2),v.LGraph=A(6),v.LEdge=A(1),v.LGraphManager=A(7),v.LNode=A(3),v.Layout=A(15),v.LayoutConstants=A(0),v.NeedlemanWunsch=A(27),v.Matrix=A(24),v.SVD=A(26),w.exports=v},function(w,I,A){function v(){this.listeners=[]}var f=v.prototype;f.addListener=function(o,n){this.listeners.push({event:o,callback:n})},f.removeListener=function(o,n){for(var a=this.listeners.length;a>=0;a--){var u=this.listeners[a];if(u.event===o&&u.callback===n)this.listeners.splice(a,1)}},f.emit=function(o,n){for(var a=0;a<this.listeners.length;a++){var u=this.listeners[a];if(o===u.event)u.callback(n)}},w.exports=v}])})});var Fe=In(function(Ee,Se){(function(I,A){if(typeof Ee==="object"&&typeof Se==="object")Se.exports=A(Re());else if(typeof define==="function"&&define.amd)define(["layout-base"],A);else if(typeof Ee==="object")Ee.coseBase=A(Re());else I.coseBase=A(I.layoutBase)})(Ee,function(w){return(()=>{var I={45:(o,n,a)=>{var u={};u.layoutBase=a(551),u.CoSEConstants=a(806),u.CoSEEdge=a(767),u.CoSEGraph=a(880),u.CoSEGraphManager=a(578),u.CoSELayout=a(765),u.CoSENode=a(991),u.ConstraintHandler=a(902),o.exports=u},806:(o,n,a)=>{var u=a(551).FDLayoutConstants;function r(){}for(var y in u)r[y]=u[y];r.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,r.DEFAULT_RADIAL_SEPARATION=u.DEFAULT_EDGE_LENGTH,r.DEFAULT_COMPONENT_SEPERATION=60,r.TILE=!0,r.TILING_PADDING_VERTICAL=10,r.TILING_PADDING_HORIZONTAL=10,r.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,r.ENFORCE_CONSTRAINTS=!0,r.APPLY_LAYOUT=!0,r.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,r.TREE_REDUCTION_ON_INCREMENTAL=!0,r.PURE_INCREMENTAL=r.DEFAULT_INCREMENTAL,o.exports=r},767:(o,n,a)=>{var u=a(551).FDLayoutEdge;function r(i,e,g){u.call(this,i,e,g)}r.prototype=Object.create(u.prototype);for(var y in u)r[y]=u[y];o.exports=r},880:(o,n,a)=>{var u=a(551).LGraph;function r(i,e,g){u.call(this,i,e,g)}r.prototype=Object.create(u.prototype);for(var y in u)r[y]=u[y];o.exports=r},578:(o,n,a)=>{var u=a(551).LGraphManager;function r(i){u.call(this,i)}r.prototype=Object.create(u.prototype);for(var y in u)r[y]=u[y];o.exports=r},765:(o,n,a)=>{var u=a(551).FDLayout,r=a(578),y=a(880),i=a(991),e=a(767),g=a(806),d=a(902),c=a(551).FDLayoutConstants,O=a(551).LayoutConstants,T=a(551).Point,N=a(551).PointD,D=a(551).DimensionD,X=a(551).Layout,x=a(551).Integer,W=a(551).IGeometry,_=a(551).LGraph,Q=a(551).Transform,lt=a(551).LinkedList;function G(){u.call(this),this.toBeTiled={},this.constraints={}}G.prototype=Object.create(u.prototype);for(var tt in u)G[tt]=u[tt];G.prototype.newGraphManager=function(){var s=new r(this);return this.graphManager=s,s},G.prototype.newGraph=function(s){return new y(null,this.graphManager,s)},G.prototype.newNode=function(s){return new i(this.graphManager,s)},G.prototype.newEdge=function(s){return new e(null,null,s)},G.prototype.initParameters=function(){if(u.prototype.initParameters.call(this,arguments),!this.isSubLayout){if(g.DEFAULT_EDGE_LENGTH<10)this.idealEdgeLength=10;else this.idealEdgeLength=g.DEFAULT_EDGE_LENGTH;this.useSmartIdealEdgeLengthCalculation=g.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=c.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=c.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1}},G.prototype.initSpringEmbedder=function(){u.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/c.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=0.04,this.coolingAdjuster=1},G.prototype.layout=function(){var s=O.DEFAULT_CREATE_BENDS_AS_NEEDED;if(s)this.createBendpoints(),this.graphManager.resetAllEdges();return this.level=0,this.classicLayout()},G.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 s=this.getFlatForest();if(s.length>0)this.positionNodesRadially(s);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var L=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(M){return L.has(M)});this.graphManager.setAllNodesToApplyGravitation(E),this.positionNodesRandomly()}}else if(g.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var L=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(Y){return L.has(Y)});this.graphManager.setAllNodesToApplyGravitation(E)}if(Object.keys(this.constraints).length>0)d.handleConstraints(this),this.initConstraintVariables();if(this.initSpringEmbedder(),g.APPLY_LAYOUT)this.runSpringEmbedder();return!0},G.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%c.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 s=new Set(this.getAllNodes()),L=this.nodesWithGravity.filter(function(m){return s.has(m)});if(this.graphManager.setAllNodesToApplyGravitation(L),this.graphManager.updateBounds(),this.updateGrid(),g.PURE_INCREMENTAL)this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL/2;else this.coolingFactor=c.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();if(g.PURE_INCREMENTAL)this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100);else this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100);this.afterGrowthIterations++}var E=!this.isTreeGrowing&&!this.isGrowthFinished,M=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(E,M),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},G.prototype.getPositionsData=function(){var s=this.graphManager.getAllNodes(),L={};for(var E=0;E<s.length;E++){var M=s[E].rect,m=s[E].id;L[m]={id:m,x:M.getCenterX(),y:M.getCenterY(),w:M.width,h:M.height}}return L},G.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var s=!1;if(c.ANIMATE==="during")this.emit("layoutstarted");else{while(!s)s=this.tick();this.graphManager.updateBounds()}},G.prototype.moveNodes=function(){var s=this.getAllNodes(),L;for(var E=0;E<s.length;E++)L=s[E],L.calculateDisplacement();if(Object.keys(this.constraints).length>0)this.updateDisplacements();for(var E=0;E<s.length;E++)L=s[E],L.move()},G.prototype.initConstraintVariables=function(){var s=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;var L=this.graphManager.getAllNodes();for(var E=0;E<L.length;E++){var M=L[E];this.idToNodeMap.set(M.id,M)}var m=function S(K){var et=K.getChild().getNodes(),ct,Nt=0;for(var Pt=0;Pt<et.length;Pt++)if(ct=et[Pt],ct.getChild()==null){if(s.fixedNodeSet.has(ct.id))Nt+=100}else Nt+=S(ct);return Nt};if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(et){s.fixedNodeSet.add(et.nodeId)});var L=this.graphManager.getAllNodes(),M;for(var E=0;E<L.length;E++)if(M=L[E],M.getChild()!=null){var Y=m(M);if(Y>0)M.fixedNodeWeight=Y}}if(this.constraints.relativePlacementConstraint){var b=new Map,k=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(S){s.fixedNodesOnHorizontal.add(S),s.fixedNodesOnVertical.add(S)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var B=this.constraints.alignmentConstraint.vertical;for(var E=0;E<B.length;E++)this.dummyToNodeForVerticalAlignment.set("dummy"+E,[]),B[E].forEach(function(K){if(b.set(K,"dummy"+E),s.dummyToNodeForVerticalAlignment.get("dummy"+E).push(K),s.fixedNodeSet.has(K))s.fixedNodesOnHorizontal.add("dummy"+E)})}if(this.constraints.alignmentConstraint.horizontal){var H=this.constraints.alignmentConstraint.horizontal;for(var E=0;E<H.length;E++)this.dummyToNodeForHorizontalAlignment.set("dummy"+E,[]),H[E].forEach(function(K){if(k.set(K,"dummy"+E),s.dummyToNodeForHorizontalAlignment.get("dummy"+E).push(K),s.fixedNodeSet.has(K))s.fixedNodesOnVertical.add("dummy"+E)})}}if(g.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(S){var K,et,ct;for(ct=S.length-1;ct>=2*S.length/3;ct--)K=Math.floor(Math.random()*(ct+1)),et=S[ct],S[ct]=S[K],S[K]=et;return S},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(S){if(S.left){var K=b.has(S.left)?b.get(S.left):S.left,et=b.has(S.right)?b.get(S.right):S.right;if(!s.nodesInRelativeHorizontal.includes(K))if(s.nodesInRelativeHorizontal.push(K),s.nodeToRelativeConstraintMapHorizontal.set(K,[]),s.dummyToNodeForVerticalAlignment.has(K))s.nodeToTempPositionMapHorizontal.set(K,s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(K)[0]).getCenterX());else s.nodeToTempPositionMapHorizontal.set(K,s.idToNodeMap.get(K).getCenterX());if(!s.nodesInRelativeHorizontal.includes(et))if(s.nodesInRelativeHorizontal.push(et),s.nodeToRelativeConstraintMapHorizontal.set(et,[]),s.dummyToNodeForVerticalAlignment.has(et))s.nodeToTempPositionMapHorizontal.set(et,s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(et)[0]).getCenterX());else s.nodeToTempPositionMapHorizontal.set(et,s.idToNodeMap.get(et).getCenterX());s.nodeToRelativeConstraintMapHorizontal.get(K).push({right:et,gap:S.gap}),s.nodeToRelativeConstraintMapHorizontal.get(et).push({left:K,gap:S.gap})}else{var ct=k.has(S.top)?k.get(S.top):S.top,Nt=k.has(S.bottom)?k.get(S.bottom):S.bottom;if(!s.nodesInRelativeVertical.includes(ct))if(s.nodesInRelativeVertical.push(ct),s.nodeToRelativeConstraintMapVertical.set(ct,[]),s.dummyToNodeForHorizontalAlignment.has(ct))s.nodeToTempPositionMapVertical.set(ct,s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(ct)[0]).getCenterY());else s.nodeToTempPositionMapVertical.set(ct,s.idToNodeMap.get(ct).getCenterY());if(!s.nodesInRelativeVertical.includes(Nt))if(s.nodesInRelativeVertical.push(Nt),s.nodeToRelativeConstraintMapVertical.set(Nt,[]),s.dummyToNodeForHorizontalAlignment.has(Nt))s.nodeToTempPositionMapVertical.set(Nt,s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(Nt)[0]).getCenterY());else s.nodeToTempPositionMapVertical.set(Nt,s.idToNodeMap.get(Nt).getCenterY());s.nodeToRelativeConstraintMapVertical.get(ct).push({bottom:Nt,gap:S.gap}),s.nodeToRelativeConstraintMapVertical.get(Nt).push({top:ct,gap:S.gap})}});else{var st=new Map,dt=new Map;this.constraints.relativePlacementConstraint.forEach(function(S){if(S.left){var K=b.has(S.left)?b.get(S.left):S.left,et=b.has(S.right)?b.get(S.right):S.right;if(st.has(K))st.get(K).push(et);else st.set(K,[et]);if(st.has(et))st.get(et).push(K);else st.set(et,[K])}else{var ct=k.has(S.top)?k.get(S.top):S.top,Nt=k.has(S.bottom)?k.get(S.bottom):S.bottom;if(dt.has(ct))dt.get(ct).push(Nt);else dt.set(ct,[Nt]);if(dt.has(Nt))dt.get(Nt).push(ct);else dt.set(Nt,[ct])}});var Z=function(K,et){var ct=[],Nt=[],Pt=new lt,Bt=new Set,ft=0;return K.forEach(function(Jt,Xt){if(!Bt.has(Xt)){ct[ft]=[],Nt[ft]=!1;var Et=Xt;Pt.push(Et),Bt.add(Et),ct[ft].push(Et);while(Pt.length!=0){if(Et=Pt.shift(),et.has(Et))Nt[ft]=!0;var vt=K.get(Et);vt.forEach(function(xt){if(!Bt.has(xt))Pt.push(xt),Bt.add(xt),ct[ft].push(xt)})}ft++}}),{components:ct,isFixed:Nt}},ut=Z(st,s.fixedNodesOnHorizontal);this.componentsOnHorizontal=ut.components,this.fixedComponentsOnHorizontal=ut.isFixed;var nt=Z(dt,s.fixedNodesOnVertical);this.componentsOnVertical=nt.components,this.fixedComponentsOnVertical=nt.isFixed}}},G.prototype.updateDisplacements=function(){var s=this;if(this.constraints.fixedNodeConstraint)this.constraints.fixedNodeConstraint.forEach(function(nt){var S=s.idToNodeMap.get(nt.nodeId);S.displacementX=0,S.displacementY=0});if(this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var L=this.constraints.alignmentConstraint.vertical;for(var E=0;E<L.length;E++){var M=0;for(var m=0;m<L[E].length;m++){if(this.fixedNodeSet.has(L[E][m])){M=0;break}M+=this.idToNodeMap.get(L[E][m]).displacementX}var Y=M/L[E].length;for(var m=0;m<L[E].length;m++)this.idToNodeMap.get(L[E][m]).displacementX=Y}}if(this.constraints.alignmentConstraint.horizontal){var b=this.constraints.alignmentConstraint.horizontal;for(var E=0;E<b.length;E++){var k=0;for(var m=0;m<b[E].length;m++){if(this.fixedNodeSet.has(b[E][m])){k=0;break}k+=this.idToNodeMap.get(b[E][m]).displacementY}var B=k/b[E].length;for(var m=0;m<b[E].length;m++)this.idToNodeMap.get(b[E][m]).displacementY=B}}}if(this.constraints.relativePlacementConstraint)if(g.RELAX_MOVEMENT_ON_CONSTRAINTS){if(this.totalIterations%10==0)this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical);this.nodesInRelativeHorizontal.forEach(function(nt){if(!s.fixedNodesOnHorizontal.has(nt)){var S=0;if(s.dummyToNodeForVerticalAlignment.has(nt))S=s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(nt)[0]).displacementX;else S=s.idToNodeMap.get(nt).displacementX;if(s.nodeToRelativeConstraintMapHorizontal.get(nt).forEach(function(K){if(K.right){var et=s.nodeToTempPositionMapHorizontal.get(K.right)-s.nodeToTempPositionMapHorizontal.get(nt)-S;if(et<K.gap)S-=K.gap-et}else{var et=s.nodeToTempPositionMapHorizontal.get(nt)-s.nodeToTempPositionMapHorizontal.get(K.left)+S;if(et<K.gap)S+=K.gap-et}}),s.nodeToTempPositionMapHorizontal.set(nt,s.nodeToTempPositionMapHorizontal.get(nt)+S),s.dummyToNodeForVerticalAlignment.has(nt))s.dummyToNodeForVerticalAlignment.get(nt).forEach(function(K){s.idToNodeMap.get(K).displacementX=S});else s.idToNodeMap.get(nt).displacementX=S}}),this.nodesInRelativeVertical.forEach(function(nt){if(!s.fixedNodesOnHorizontal.has(nt)){var S=0;if(s.dummyToNodeForHorizontalAlignment.has(nt))S=s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(nt)[0]).displacementY;else S=s.idToNodeMap.get(nt).displacementY;if(s.nodeToRelativeConstraintMapVertical.get(nt).forEach(function(K){if(K.bottom){var et=s.nodeToTempPositionMapVertical.get(K.bottom)-s.nodeToTempPositionMapVertical.get(nt)-S;if(et<K.gap)S-=K.gap-et}else{var et=s.nodeToTempPositionMapVertical.get(nt)-s.nodeToTempPositionMapVertical.get(K.top)+S;if(et<K.gap)S+=K.gap-et}}),s.nodeToTempPositionMapVertical.set(nt,s.nodeToTempPositionMapVertical.get(nt)+S),s.dummyToNodeForHorizontalAlignment.has(nt))s.dummyToNodeForHorizontalAlignment.get(nt).forEach(function(K){s.idToNodeMap.get(K).displacementY=S});else s.idToNodeMap.get(nt).displacementY=S}})}else{for(var E=0;E<this.componentsOnHorizontal.length;E++){var H=this.componentsOnHorizontal[E];if(this.fixedComponentsOnHorizontal[E])for(var m=0;m<H.length;m++)if(this.dummyToNodeForVerticalAlignment.has(H[m]))this.dummyToNodeForVerticalAlignment.get(H[m]).forEach(function(K){s.idToNodeMap.get(K).displacementX=0});else this.idToNodeMap.get(H[m]).displacementX=0;else{var st=0,dt=0;for(var m=0;m<H.length;m++)if(this.dummyToNodeForVerticalAlignment.has(H[m])){var Z=this.dummyToNodeForVerticalAlignment.get(H[m]);st+=Z.length*this.idToNodeMap.get(Z[0]).displacementX,dt+=Z.length}else st+=this.idToNodeMap.get(H[m]).displacementX,dt++;var ut=st/dt;for(var m=0;m<H.length;m++)if(this.dummyToNodeForVerticalAlignment.has(H[m]))this.dummyToNodeForVerticalAlignment.get(H[m]).forEach(function(K){s.idToNodeMap.get(K).displacementX=ut});else this.idToNodeMap.get(H[m]).displacementX=ut}}for(var E=0;E<this.componentsOnVertical.length;E++){var H=this.componentsOnVertical[E];if(this.fixedComponentsOnVertical[E])for(var m=0;m<H.length;m++)if(this.dummyToNodeForHorizontalAlignment.has(H[m]))this.dummyToNodeForHorizontalAlignment.get(H[m]).forEach(function(et){s.idToNodeMap.get(et).displacementY=0});else this.idToNodeMap.get(H[m]).displacementY=0;else{var st=0,dt=0;for(var m=0;m<H.length;m++)if(this.dummyToNodeForHorizontalAlignment.has(H[m])){var Z=this.dummyToNodeForHorizontalAlignment.get(H[m]);st+=Z.length*this.idToNodeMap.get(Z[0]).displacementY,dt+=Z.length}else st+=this.idToNodeMap.get(H[m]).displacementY,dt++;var ut=st/dt;for(var m=0;m<H.length;m++)if(this.dummyToNodeForHorizontalAlignment.has(H[m]))this.dummyToNodeForHorizontalAlignment.get(H[m]).forEach(function(Pt){s.idToNodeMap.get(Pt).displacementY=ut});else this.idToNodeMap.get(H[m]).displacementY=ut}}}},G.prototype.calculateNodesToApplyGravitationTo=function(){var s=[],L,E=this.graphManager.getGraphs(),M=E.length,m;for(m=0;m<M;m++)if(L=E[m],L.updateConnected(),!L.isConnected)s=s.concat(L.getNodes());return s},G.prototype.createBendpoints=function(){var s=[];s=s.concat(this.graphManager.getAllEdges());var L=new Set,E;for(E=0;E<s.length;E++){var M=s[E];if(!L.has(M)){var m=M.getSource(),Y=M.getTarget();if(m==Y)M.getBendpoints().push(new N),M.getBendpoints().push(new N),this.createDummyNodesForBendpoints(M),L.add(M);else{var b=[];if(b=b.concat(m.getEdgeListToNode(Y)),b=b.concat(Y.getEdgeListToNode(m)),!L.has(b[0])){if(b.length>1){var k;for(k=0;k<b.length;k++){var B=b[k];B.getBendpoints().push(new N),this.createDummyNodesForBendpoints(B)}}b.forEach(function(H){L.add(H)})}}}if(L.size==s.length)break}},G.prototype.positionNodesRadially=function(s){var L=new T(0,0),E=Math.ceil(Math.sqrt(s.length)),M=0,m=0,Y=0,b=new N(0,0);for(var k=0;k<s.length;k++){if(k%E==0){if(Y=0,m=M,k!=0)m+=g.DEFAULT_COMPONENT_SEPERATION;M=0}var B=s[k],H=X.findCenterOfTree(B);if(L.x=Y,L.y=m,b=G.radialLayout(B,H,L),b.y>M)M=Math.floor(b.y);Y=Math.floor(b.x+g.DEFAULT_COMPONENT_SEPERATION)}this.transform(new N(O.WORLD_CENTER_X-b.x/2,O.WORLD_CENTER_Y-b.y/2))},G.radialLayout=function(s,L,E){var M=Math.max(this.maxDiagonalInTree(s),g.DEFAULT_RADIAL_SEPARATION);G.branchRadialLayout(L,null,0,359,0,M);var m=_.calculateBounds(s),Y=new Q;Y.setDeviceOrgX(m.getMinX()),Y.setDeviceOrgY(m.getMinY()),Y.setWorldOrgX(E.x),Y.setWorldOrgY(E.y);for(var b=0;b<s.length;b++){var k=s[b];k.transform(Y)}var B=new N(m.getMaxX(),m.getMaxY());return Y.inverseTransformPoint(B)},G.branchRadialLayout=function(s,L,E,M,m,Y){var b=(M-E+1)/2;if(b<0)b+=180;var k=(b+E)%360,B=k*W.TWO_PI/360,H=Math.cos(B),st=m*Math.cos(B),dt=m*Math.sin(B);s.setCenter(st,dt);var Z=[];Z=Z.concat(s.getEdges());var ut=Z.length;if(L!=null)ut--;var nt=0,S=Z.length,K,et=s.getEdgesBetween(L);while(et.length>1){var ct=et[0];et.splice(0,1);var Nt=Z.indexOf(ct);if(Nt>=0)Z.splice(Nt,1);S--,ut--}if(L!=null)K=(Z.indexOf(et[0])+1)%S;else K=0;var Pt=Math.abs(M-E)/ut;for(var Bt=K;nt!=ut;Bt=++Bt%S){var ft=Z[Bt].getOtherEnd(s);if(ft==L)continue;var Jt=(E+nt*Pt)%360,Xt=(Jt+Pt)%360;G.branchRadialLayout(ft,s,Jt,Xt,m+Y,Y),nt++}},G.maxDiagonalInTree=function(s){var L=x.MIN_VALUE;for(var E=0;E<s.length;E++){var M=s[E],m=M.getDiagonal();if(m>L)L=m}return L},G.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},G.prototype.groupZeroDegreeMembers=function(){var s=this,L={};this.memberGroups={},this.idToDummyNode={};var E=[],M=this.graphManager.getAllNodes();for(var m=0;m<M.length;m++){var Y=M[m],b=Y.getParent();if(this.getNodeDegreeWithChildren(Y)===0&&(b.id==null||!this.getToBeTiled(b)))E.push(Y)}for(var m=0;m<E.length;m++){var Y=E[m],k=Y.getParent().id;if(typeof L[k]>"u")L[k]=[];L[k]=L[k].concat(Y)}Object.keys(L).forEach(function(B){if(L[B].length>1){var H="DummyCompound_"+B;s.memberGroups[H]=L[B];var st=L[B][0].getParent(),dt=new i(s.graphManager);dt.id=H,dt.paddingLeft=st.paddingLeft||0,dt.paddingRight=st.paddingRight||0,dt.paddingBottom=st.paddingBottom||0,dt.paddingTop=st.paddingTop||0,s.idToDummyNode[H]=dt;var Z=s.getGraphManager().add(s.newGraph(),dt),ut=st.getChild();ut.add(dt);for(var nt=0;nt<L[B].length;nt++){var S=L[B][nt];ut.remove(S),Z.add(S)}}})},G.prototype.clearCompounds=function(){var s={},L={};this.performDFSOnCompounds();for(var E=0;E<this.compoundOrder.length;E++)L[this.compoundOrder[E].id]=this.compoundOrder[E],s[this.compoundOrder[E].id]=[].concat(this.compoundOrder[E].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[E].getChild()),this.compoundOrder[E].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(s,L)},G.prototype.clearZeroDegreeMembers=function(){var s=this,L=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(E){var M=s.idToDummyNode[E];if(L[E]=s.tileNodes(s.memberGroups[E],M.paddingLeft+M.paddingRight),M.rect.width=L[E].width,M.rect.height=L[E].height,M.setCenter(L[E].centerX,L[E].centerY),M.labelMarginLeft=0,M.labelMarginTop=0,g.NODE_DIMENSIONS_INCLUDE_LABELS){var m=M.rect.width,Y=M.rect.height;if(M.labelWidth){if(M.labelPosHorizontal=="left")M.rect.x-=M.labelWidth,M.setWidth(m+M.labelWidth),M.labelMarginLeft=M.labelWidth;else if(M.labelPosHorizontal=="center"&&M.labelWidth>m)M.rect.x-=(M.labelWidth-m)/2,M.setWidth(M.labelWidth),M.labelMarginLeft=(M.labelWidth-m)/2;else if(M.labelPosHorizontal=="right")M.setWidth(m+M.labelWidth)}if(M.labelHeight){if(M.labelPosVertical=="top")M.rect.y-=M.labelHeight,M.setHeight(Y+M.labelHeight),M.labelMarginTop=M.labelHeight;else if(M.labelPosVertical=="center"&&M.labelHeight>Y)M.rect.y-=(M.labelHeight-Y)/2,M.setHeight(M.labelHeight),M.labelMarginTop=(M.labelHeight-Y)/2;else if(M.labelPosVertical=="bottom")M.setHeight(Y+M.labelHeight)}}})},G.prototype.repopulateCompounds=function(){for(var s=this.compoundOrder.length-1;s>=0;s--){var L=this.compoundOrder[s],{id:E,paddingLeft:M,paddingTop:m,labelMarginLeft:Y,labelMarginTop:b}=L;this.adjustLocations(this.tiledMemberPack[E],L.rect.x,L.rect.y,M,m,Y,b)}},G.prototype.repopulateZeroDegreeMembers=function(){var s=this,L=this.tiledZeroDegreePack;Object.keys(L).forEach(function(E){var M=s.idToDummyNode[E],{paddingLeft:m,paddingTop:Y,labelMarginLeft:b,labelMarginTop:k}=M;s.adjustLocations(L[E],M.rect.x,M.rect.y,m,Y,b,k)})},G.prototype.getToBeTiled=function(s){var L=s.id;if(this.toBeTiled[L]!=null)return this.toBeTiled[L];var E=s.getChild();if(E==null)return this.toBeTiled[L]=!1,!1;var M=E.getNodes();for(var m=0;m<M.length;m++){var Y=M[m];if(this.getNodeDegree(Y)>0)return this.toBeTiled[L]=!1,!1;if(Y.getChild()==null){this.toBeTiled[Y.id]=!1;continue}if(!this.getToBeTiled(Y))return this.toBeTiled[L]=!1,!1}return this.toBeTiled[L]=!0,!0},G.prototype.getNodeDegree=function(s){var L=s.id,E=s.getEdges(),M=0;for(var m=0;m<E.length;m++){var Y=E[m];if(Y.getSource().id!==Y.getTarget().id)M=M+1}return M},G.prototype.getNodeDegreeWithChildren=function(s){var L=this.getNodeDegree(s);if(s.getChild()==null)return L;var E=s.getChild().getNodes();for(var M=0;M<E.length;M++){var m=E[M];L+=this.getNodeDegreeWithChildren(m)}return L},G.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},G.prototype.fillCompexOrderByDFS=function(s){for(var L=0;L<s.length;L++){var E=s[L];if(E.getChild()!=null)this.fillCompexOrderByDFS(E.getChild().getNodes());if(this.getToBeTiled(E))this.compoundOrder.push(E)}},G.prototype.adjustLocations=function(s,L,E,M,m,Y,b){L+=M+Y,E+=m+b;var k=L;for(var B=0;B<s.rows.length;B++){var H=s.rows[B];L=k;var st=0;for(var dt=0;dt<H.length;dt++){var Z=H[dt];if(Z.rect.x=L,Z.rect.y=E,L+=Z.rect.width+s.horizontalPadding,Z.rect.height>st)st=Z.rect.height}E+=st+s.verticalPadding}},G.prototype.tileCompoundMembers=function(s,L){var E=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(M){var m=L[M];if(E.tiledMemberPack[M]=E.tileNodes(s[M],m.paddingLeft+m.paddingRight),m.rect.width=E.tiledMemberPack[M].width,m.rect.height=E.tiledMemberPack[M].height,m.setCenter(E.tiledMemberPack[M].centerX,E.tiledMemberPack[M].centerY),m.labelMarginLeft=0,m.labelMarginTop=0,g.NODE_DIMENSIONS_INCLUDE_LABELS){var Y=m.rect.width,b=m.rect.height;if(m.labelWidth){if(m.labelPosHorizontal=="left")m.rect.x-=m.labelWidth,m.setWidth(Y+m.labelWidth),m.labelMarginLeft=m.labelWidth;else if(m.labelPosHorizontal=="center"&&m.labelWidth>Y)m.rect.x-=(m.labelWidth-Y)/2,m.setWidth(m.labelWidth),m.labelMarginLeft=(m.labelWidth-Y)/2;else if(m.labelPosHorizontal=="right")m.setWidth(Y+m.labelWidth)}if(m.labelHeight){if(m.labelPosVertical=="top")m.rect.y-=m.labelHeight,m.setHeight(b+m.labelHeight),m.labelMarginTop=m.labelHeight;else if(m.labelPosVertical=="center"&&m.labelHeight>b)m.rect.y-=(m.labelHeight-b)/2,m.setHeight(m.labelHeight),m.labelMarginTop=(m.labelHeight-b)/2;else if(m.labelPosVertical=="bottom")m.setHeight(b+m.labelHeight)}}})},G.prototype.tileNodes=function(s,L){var E=this.tileNodesByFavoringDim(s,L,!0),M=this.tileNodesByFavoringDim(s,L,!1),m=this.getOrgRatio(E),Y=this.getOrgRatio(M),b;if(Y<m)b=M;else b=E;return b},G.prototype.getOrgRatio=function(s){var{width:L,height:E}=s,M=L/E;if(M<1)M=1/M;return M},G.prototype.calcIdealRowWidth=function(s,L){var{TILING_PADDING_VERTICAL:E,TILING_PADDING_HORIZONTAL:M}=g,m=s.length,Y=0,b=0,k=0;s.forEach(function(nt){if(Y+=nt.getWidth(),b+=nt.getHeight(),nt.getWidth()>k)k=nt.getWidth()});var B=Y/m,H=b/m,st=Math.pow(E-M,2)+4*(B+M)*(H+E)*m,dt=(M-E+Math.sqrt(st))/(2*(B+M)),Z;if(L){if(Z=Math.ceil(dt),Z==dt)Z++}else Z=Math.floor(dt);var ut=Z*(B+M)-M;if(k>ut)ut=k;return ut+=M*2,ut},G.prototype.tileNodesByFavoringDim=function(s,L,E){var{TILING_PADDING_VERTICAL:M,TILING_PADDING_HORIZONTAL:m,TILING_COMPARE_BY:Y}=g,b={rows:[],rowWidth:[],rowHeight:[],width:0,height:L,verticalPadding:M,horizontalPadding:m,centerX:0,centerY:0};if(Y)b.idealRowWidth=this.calcIdealRowWidth(s,E);var k=function(S){return S.rect.width*S.rect.height},B=function(S,K){return k(K)-k(S)};s.sort(function(nt,S){var K=B;if(b.idealRowWidth)return K=Y,K(nt.id,S.id);return K(nt,S)});var H=0,st=0;for(var dt=0;dt<s.length;dt++){var Z=s[dt];H+=Z.getCenterX(),st+=Z.getCenterY()}b.centerX=H/s.length,b.centerY=st/s.length;for(var dt=0;dt<s.length;dt++){var Z=s[dt];if(b.rows.length==0)this.insertNodeToRow(b,Z,0,L);else if(this.canAddHorizontal(b,Z.rect.width,Z.rect.height)){var ut=b.rows.length-1;if(!b.idealRowWidth)ut=this.getShortestRowIndex(b);this.insertNodeToRow(b,Z,ut,L)}else this.insertNodeToRow(b,Z,b.rows.length,L);this.shiftToLastRow(b)}return b},G.prototype.insertNodeToRow=function(s,L,E,M){var m=M;if(E==s.rows.length){var Y=[];s.rows.push(Y),s.rowWidth.push(m),s.rowHeight.push(0)}var b=s.rowWidth[E]+L.rect.width;if(s.rows[E].length>0)b+=s.horizontalPadding;if(s.rowWidth[E]=b,s.width<b)s.width=b;var k=L.rect.height;if(E>0)k+=s.verticalPadding;var B=0;if(k>s.rowHeight[E])B=s.rowHeight[E],s.rowHeight[E]=k,B=s.rowHeight[E]-B;s.height+=B,s.rows[E].push(L)},G.prototype.getShortestRowIndex=function(s){var L=-1,E=Number.MAX_VALUE;for(var M=0;M<s.rows.length;M++)if(s.rowWidth[M]<E)L=M,E=s.rowWidth[M];return L},G.prototype.getLongestRowIndex=function(s){var L=-1,E=Number.MIN_VALUE;for(var M=0;M<s.rows.length;M++)if(s.rowWidth[M]>E)L=M,E=s.rowWidth[M];return L},G.prototype.canAddHorizontal=function(s,L,E){if(s.idealRowWidth){var M=s.rows.length-1,m=s.rowWidth[M];return m+L+s.horizontalPadding<=s.idealRowWidth}var Y=this.getShortestRowIndex(s);if(Y<0)return!0;var b=s.rowWidth[Y];if(b+s.horizontalPadding+L<=s.width)return!0;var k=0;if(s.rowHeight[Y]<E){if(Y>0)k=E+s.verticalPadding-s.rowHeight[Y]}var B;if(s.width-b>=L+s.horizontalPadding)B=(s.height+k)/(b+L+s.horizontalPadding);else B=(s.height+k)/s.width;k=E+s.verticalPadding;var H;if(s.width<L)H=(s.height+k)/L;else H=(s.height+k)/s.width;if(H<1)H=1/H;if(B<1)B=1/B;return B<H},G.prototype.shiftToLastRow=function(s){var L=this.getLongestRowIndex(s),E=s.rowWidth.length-1,M=s.rows[L],m=M[M.length-1],Y=m.width+s.horizontalPadding;if(s.width-s.rowWidth[E]>Y&&L!=E){M.splice(-1,1),s.rows[E].push(m),s.rowWidth[L]=s.rowWidth[L]-Y,s.rowWidth[E]=s.rowWidth[E]+Y,s.width=s.rowWidth[instance.getLongestRowIndex(s)];var b=Number.MIN_VALUE;for(var k=0;k<M.length;k++)if(M[k].height>b)b=M[k].height;if(L>0)b+=s.verticalPadding;var B=s.rowHeight[L]+s.rowHeight[E];if(s.rowHeight[L]=b,s.rowHeight[E]<m.height+s.verticalPadding)s.rowHeight[E]=m.height+s.verticalPadding;var H=s.rowHeight[L]+s.rowHeight[E];s.height+=H-B,this.shiftToLastRow(s)}},G.prototype.tilingPreLayout=function(){if(g.TILE)this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers()},G.prototype.tilingPostLayout=function(){if(g.TILE)this.repopulateZeroDegreeMembers(),this.repopulateCompounds()},G.prototype.reduceTrees=function(){var s=[],L=!0,E;while(L){var M=this.graphManager.getAllNodes(),m=[];L=!1;for(var Y=0;Y<M.length;Y++)if(E=M[Y],E.getEdges().length==1&&!E.getEdges()[0].isInterGraph&&E.getChild()==null){if(g.PURE_INCREMENTAL){var b=E.getEdges()[0].getOtherEnd(E),k=new D(E.getCenterX()-b.getCenterX(),E.getCenterY()-b.getCenterY());m.push([E,E.getEdges()[0],E.getOwner(),k])}else m.push([E,E.getEdges()[0],E.getOwner()]);L=!0}if(L==!0){var B=[];for(var H=0;H<m.length;H++)if(m[H][0].getEdges().length==1)B.push(m[H]),m[H][0].getOwner().remove(m[H][0]);s.push(B),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=s},G.prototype.growTree=function(s){var L=s.length,E=s[L-1],M;for(var m=0;m<E.length;m++)M=E[m],this.findPlaceforPrunedNode(M),M[2].add(M[0]),M[2].add(M[1],M[1].source,M[1].target);s.splice(s.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},G.prototype.findPlaceforPrunedNode=function(s){var L,E,M=s[0];if(M==s[1].source)E=s[1].target;else E=s[1].source;if(g.PURE_INCREMENTAL)M.setCenter(E.getCenterX()+s[3].getWidth(),E.getCenterY()+s[3].getHeight());else{var m=E.startX,Y=E.finishX,b=E.startY,k=E.finishY,B=0,H=0,st=0,dt=0,Z=[B,st,H,dt];if(b>0)for(var ut=m;ut<=Y;ut++)Z[0]+=this.grid[ut][b-1].length+this.grid[ut][b].length-1;if(Y<this.grid.length-1)for(var ut=b;ut<=k;ut++)Z[1]+=this.grid[Y+1][ut].length+this.grid[Y][ut].length-1;if(k<this.grid[0].length-1)for(var ut=m;ut<=Y;ut++)Z[2]+=this.grid[ut][k+1].length+this.grid[ut][k].length-1;if(m>0)for(var ut=b;ut<=k;ut++)Z[3]+=this.grid[m-1][ut].length+this.grid[m][ut].length-1;var nt=x.MAX_VALUE,S,K;for(var et=0;et<Z.length;et++)if(Z[et]<nt)nt=Z[et],S=1,K=et;else if(Z[et]==nt)S++;if(S==3&&nt==0){if(Z[0]==0&&Z[1]==0&&Z[2]==0)L=1;else if(Z[0]==0&&Z[1]==0&&Z[3]==0)L=0;else if(Z[0]==0&&Z[2]==0&&Z[3]==0)L=3;else if(Z[1]==0&&Z[2]==0&&Z[3]==0)L=2}else if(S==2&&nt==0){var ct=Math.floor(Math.random()*2);if(Z[0]==0&&Z[1]==0)if(ct==0)L=0;else L=1;else if(Z[0]==0&&Z[2]==0)if(ct==0)L=0;else L=2;else if(Z[0]==0&&Z[3]==0)if(ct==0)L=0;else L=3;else if(Z[1]==0&&Z[2]==0)if(ct==0)L=1;else L=2;else if(Z[1]==0&&Z[3]==0)if(ct==0)L=1;else L=3;else if(ct==0)L=2;else L=3}else if(S==4&&nt==0){var ct=Math.floor(Math.random()*4);L=ct}else L=K;if(L==0)M.setCenter(E.getCenterX(),E.getCenterY()-E.getHeight()/2-c.DEFAULT_EDGE_LENGTH-M.getHeight()/2);else if(L==1)M.setCenter(E.getCenterX()+E.getWidth()/2+c.DEFAULT_EDGE_LENGTH+M.getWidth()/2,E.getCenterY());else if(L==2)M.setCenter(E.getCenterX(),E.getCenterY()+E.getHeight()/2+c.DEFAULT_EDGE_LENGTH+M.getHeight()/2);else M.setCenter(E.getCenterX()-E.getWidth()/2-c.DEFAULT_EDGE_LENGTH-M.getWidth()/2,E.getCenterY())}},o.exports=G},991:(o,n,a)=>{var u=a(551).FDLayoutNode,r=a(551).IMath;function y(e,g,d,c){u.call(this,e,g,d,c)}y.prototype=Object.create(u.prototype);for(var i in u)y[i]=u[i];y.prototype.calculateDisplacement=function(){var e=this.graphManager.getLayout();if(this.getChild()!=null&&this.fixedNodeWeight)this.displacementX+=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight;else this.displacementX+=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren;if(Math.abs(this.displacementX)>e.coolingFactor*e.maxNodeDisplacement)this.displacementX=e.coolingFactor*e.maxNodeDisplacement*r.sign(this.displacementX);if(Math.abs(this.displacementY)>e.coolingFactor*e.maxNodeDisplacement)this.displacementY=e.coolingFactor*e.maxNodeDisplacement*r.sign(this.displacementY);if(this.child&&this.child.getNodes().length>0)this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},y.prototype.propogateDisplacementToChildren=function(e,g){var d=this.getChild().getNodes(),c;for(var O=0;O<d.length;O++)if(c=d[O],c.getChild()==null)c.displacementX+=e,c.displacementY+=g;else c.propogateDisplacementToChildren(e,g)},y.prototype.move=function(){var e=this.graphManager.getLayout();if(this.child==null||this.child.getNodes().length==0)this.moveBy(this.displacementX,this.displacementY),e.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},y.prototype.setPred1=function(e){this.pred1=e},y.prototype.getPred1=function(){return pred1},y.prototype.getPred2=function(){return pred2},y.prototype.setNext=function(e){this.next=e},y.prototype.getNext=function(){return next},y.prototype.setProcessed=function(e){this.processed=e},y.prototype.isProcessed=function(){return processed},o.exports=y},902:(o,n,a)=>{function u(d){if(Array.isArray(d)){for(var c=0,O=Array(d.length);c<d.length;c++)O[c]=d[c];return O}else return Array.from(d)}var r=a(806),y=a(551).LinkedList,i=a(551).Matrix,e=a(551).SVD;function g(){}g.handleConstraints=function(d){var c={};c.fixedNodeConstraint=d.constraints.fixedNodeConstraint,c.alignmentConstraint=d.constraints.alignmentConstraint,c.relativePlacementConstraint=d.constraints.relativePlacementConstraint;var O=new Map,T=new Map,N=[],D=[],X=d.getAllNodes(),x=0;for(var W=0;W<X.length;W++){var _=X[W];if(_.getChild()==null)T.set(_.id,x++),N.push(_.getCenterX()),D.push(_.getCenterY()),O.set(_.id,_)}if(c.relativePlacementConstraint)c.relativePlacementConstraint.forEach(function(J){if(!J.gap&&J.gap!=0)if(J.left)J.gap=r.DEFAULT_EDGE_LENGTH+O.get(J.left).getWidth()/2+O.get(J.right).getWidth()/2;else J.gap=r.DEFAULT_EDGE_LENGTH+O.get(J.top).getHeight()/2+O.get(J.bottom).getHeight()/2});var Q=function(rt,it){return{x:rt.x-it.x,y:rt.y-it.y}},lt=function(rt){var it=0,at=0;return rt.forEach(function(ot){it+=N[T.get(ot)],at+=D[T.get(ot)]}),{x:it/rt.size,y:at/rt.size}},G=function(rt,it,at,ot,gt){function At(Tt,yt){var Dt=new Set(Tt),mt=!0,wt=!1,Zt=void 0;try{for(var Vt=yt[Symbol.iterator](),re;!(mt=(re=Vt.next()).done);mt=!0){var Wt=re.value;Dt.add(Wt)}}catch(bt){wt=!0,Zt=bt}finally{try{if(!mt&&Vt.return)Vt.return()}finally{if(wt)throw Zt}}return Dt}var Mt=new Map;rt.forEach(function(Tt,yt){Mt.set(yt,0)}),rt.forEach(function(Tt,yt){Tt.forEach(function(Dt){Mt.set(Dt.id,Mt.get(Dt.id)+1)})});var ht=new Map,Lt=new Map,Ct=new y;if(Mt.forEach(function(Tt,yt){if(Tt==0){if(Ct.push(yt),!at)if(it=="horizontal")ht.set(yt,T.has(yt)?N[T.get(yt)]:ot.get(yt));else ht.set(yt,T.has(yt)?D[T.get(yt)]:ot.get(yt))}else ht.set(yt,Number.NEGATIVE_INFINITY);if(at)Lt.set(yt,new Set([yt]))}),at)gt.forEach(function(Tt){var yt=[];if(Tt.forEach(function(wt){if(at.has(wt))yt.push(wt)}),yt.length>0){var Dt=0;yt.forEach(function(wt){if(it=="horizontal")ht.set(wt,T.has(wt)?N[T.get(wt)]:ot.get(wt)),Dt+=ht.get(wt);else ht.set(wt,T.has(wt)?D[T.get(wt)]:ot.get(wt)),Dt+=ht.get(wt)}),Dt=Dt/yt.length,Tt.forEach(function(wt){if(!at.has(wt))ht.set(wt,Dt)})}else{var mt=0;Tt.forEach(function(wt){if(it=="horizontal")mt+=T.has(wt)?N[T.get(wt)]:ot.get(wt);else mt+=T.has(wt)?D[T.get(wt)]:ot.get(wt)}),mt=mt/Tt.length,Tt.forEach(function(wt){ht.set(wt,mt)})}});var pt=function(){var yt=Ct.shift(),Dt=rt.get(yt);Dt.forEach(function(mt){if(ht.get(mt.id)<ht.get(yt)+mt.gap)if(at&&at.has(mt.id)){var wt=void 0;if(it=="horizontal")wt=T.has(mt.id)?N[T.get(mt.id)]:ot.get(mt.id);else wt=T.has(mt.id)?D[T.get(mt.id)]:ot.get(mt.id);if(ht.set(mt.id,wt),wt<ht.get(yt)+mt.gap){var Zt=ht.get(yt)+mt.gap-wt;Lt.get(yt).forEach(function(Vt){ht.set(Vt,ht.get(Vt)-Zt)})}}else ht.set(mt.id,ht.get(yt)+mt.gap);if(Mt.set(mt.id,Mt.get(mt.id)-1),Mt.get(mt.id)==0)Ct.push(mt.id);if(at)Lt.set(mt.id,At(Lt.get(yt),Lt.get(mt.id)))})};while(Ct.length!=0)pt();if(at){var Ot=new Set;rt.forEach(function(Tt,yt){if(Tt.length==0)Ot.add(yt)});var Ut=[];Lt.forEach(function(Tt,yt){if(Ot.has(yt)){var Dt=!1,mt=!0,wt=!1,Zt=void 0;try{for(var Vt=Tt[Symbol.iterator](),re;!(mt=(re=Vt.next()).done);mt=!0){var Wt=re.value;if(at.has(Wt))Dt=!0}}catch($t){wt=!0,Zt=$t}finally{try{if(!mt&&Vt.return)Vt.return()}finally{if(wt)throw Zt}}if(!Dt){var bt=!1,ae=void 0;if(Ut.forEach(function($t,jt){if($t.has([].concat(u(Tt))[0]))bt=!0,ae=jt}),!bt)Ut.push(new Set(Tt));else Tt.forEach(function($t){Ut[ae].add($t)})}}}),Ut.forEach(function(Tt,yt){var{POSITIVE_INFINITY:Dt,POSITIVE_INFINITY:mt,NEGATIVE_INFINITY:wt,NEGATIVE_INFINITY:Zt}=Number,Vt=!0,re=!1,Wt=void 0;try{for(var bt=Tt[Symbol.iterator](),ae;!(Vt=(ae=bt.next()).done);Vt=!0){var $t=ae.value,jt=void 0;if(it=="horizontal")jt=T.has($t)?N[T.get($t)]:ot.get($t);else jt=T.has($t)?D[T.get($t)]:ot.get($t);var ie=ht.get($t);if(jt<Dt)Dt=jt;if(jt>wt)wt=jt;if(ie<mt)mt=ie;if(ie>Zt)Zt=ie}}catch(ve){re=!0,Wt=ve}finally{try{if(!Vt&&bt.return)bt.return()}finally{if(re)throw Wt}}var Me=(Dt+wt)/2-(mt+Zt)/2,le=!0,ce=!1,ge=void 0;try{for(var fe=Tt[Symbol.iterator](),Le;!(le=(Le=fe.next()).done);le=!0){var ue=Le.value;ht.set(ue,ht.get(ue)+Me)}}catch(ve){ce=!0,ge=ve}finally{try{if(!le&&fe.return)fe.return()}finally{if(ce)throw ge}}})}return ht},tt=function(rt){var it=0,at=0,ot=0,gt=0;if(rt.forEach(function(Lt){if(Lt.left)N[T.get(Lt.left)]-N[T.get(Lt.right)]>=0?it++:at++;else D[T.get(Lt.top)]-D[T.get(Lt.bottom)]>=0?ot++:gt++}),it>at&&ot>gt)for(var At=0;At<T.size;At++)N[At]=-1*N[At],D[At]=-1*D[At];else if(it>at)for(var Mt=0;Mt<T.size;Mt++)N[Mt]=-1*N[Mt];else if(ot>gt)for(var ht=0;ht<T.size;ht++)D[ht]=-1*D[ht]},s=function(rt){var it=[],at=new y,ot=new Set,gt=0;return rt.forEach(function(At,Mt){if(!ot.has(Mt)){it[gt]=[];var ht=Mt;at.push(ht),ot.add(ht),it[gt].push(ht);while(at.length!=0){ht=at.shift();var Lt=rt.get(ht);Lt.forEach(function(Ct){if(!ot.has(Ct.id))at.push(Ct.id),ot.add(Ct.id),it[gt].push(Ct.id)})}gt++}}),it},L=function(rt){var it=new Map;return rt.forEach(function(at,ot){it.set(ot,[])}),rt.forEach(function(at,ot){at.forEach(function(gt){it.get(ot).push(gt),it.get(gt.id).push({id:ot,gap:gt.gap,direction:gt.direction})})}),it},E=function(rt){var it=new Map;return rt.forEach(function(at,ot){it.set(ot,[])}),rt.forEach(function(at,ot){at.forEach(function(gt){it.get(gt.id).push({id:ot,gap:gt.gap,direction:gt.direction})})}),it},M=[],m=[],Y=!1,b=!1,k=new Set,B=new Map,H=new Map,st=[];if(c.fixedNodeConstraint)c.fixedNodeConstraint.forEach(function(J){k.add(J.nodeId)});if(c.relativePlacementConstraint)c.relativePlacementConstraint.forEach(function(J){if(J.left){if(B.has(J.left))B.get(J.left).push({id:J.right,gap:J.gap,direction:"horizontal"});else B.set(J.left,[{id:J.right,gap:J.gap,direction:"horizontal"}]);if(!B.has(J.right))B.set(J.right,[])}else{if(B.has(J.top))B.get(J.top).push({id:J.bottom,gap:J.gap,direction:"vertical"});else B.set(J.top,[{id:J.bottom,gap:J.gap,direction:"vertical"}]);if(!B.has(J.bottom))B.set(J.bottom,[])}}),H=L(B),st=s(H);if(r.TRANSFORM_ON_CONSTRAINT_HANDLING){if(c.fixedNodeConstraint&&c.fixedNodeConstraint.length>1)c.fixedNodeConstraint.forEach(function(J,rt){M[rt]=[J.position.x,J.position.y],m[rt]=[N[T.get(J.nodeId)],D[T.get(J.nodeId)]]}),Y=!0;else if(c.alignmentConstraint)(function(){var J=0;if(c.alignmentConstraint.vertical){var rt=c.alignmentConstraint.vertical,it=function(ht){var Lt=new Set;rt[ht].forEach(function(Ot){Lt.add(Ot)});var Ct=new Set([].concat(u(Lt)).filter(function(Ot){return k.has(Ot)})),pt=void 0;if(Ct.size>0)pt=N[T.get(Ct.values().next().value)];else pt=lt(Lt).x;rt[ht].forEach(function(Ot){M[J]=[pt,D[T.get(Ot)]],m[J]=[N[T.get(Ot)],D[T.get(Ot)]],J++})};for(var at=0;at<rt.length;at++)it(at);Y=!0}if(c.alignmentConstraint.horizontal){var ot=c.alignmentConstraint.horizontal,gt=function(ht){var Lt=new Set;ot[ht].forEach(function(Ot){Lt.add(Ot)});var Ct=new Set([].concat(u(Lt)).filter(function(Ot){return k.has(Ot)})),pt=void 0;if(Ct.size>0)pt=N[T.get(Ct.values().next().value)];else pt=lt(Lt).y;ot[ht].forEach(function(Ot){M[J]=[N[T.get(Ot)],pt],m[J]=[N[T.get(Ot)],D[T.get(Ot)]],J++})};for(var At=0;At<ot.length;At++)gt(At);Y=!0}if(c.relativePlacementConstraint)b=!0})();else if(c.relativePlacementConstraint){var dt=0,Z=0;for(var ut=0;ut<st.length;ut++)if(st[ut].length>dt)dt=st[ut].length,Z=ut;if(dt<H.size/2)tt(c.relativePlacementConstraint),Y=!1,b=!1;else{var nt=new Map,S=new Map,K=[];st[Z].forEach(function(J){B.get(J).forEach(function(rt){if(rt.direction=="horizontal"){if(nt.has(J))nt.get(J).push(rt);else nt.set(J,[rt]);if(!nt.has(rt.id))nt.set(rt.id,[]);K.push({left:J,right:rt.id})}else{if(S.has(J))S.get(J).push(rt);else S.set(J,[rt]);if(!S.has(rt.id))S.set(rt.id,[]);K.push({top:J,bottom:rt.id})}})}),tt(K),b=!1;var et=G(nt,"horizontal"),ct=G(S,"vertical");st[Z].forEach(function(J,rt){if(m[rt]=[N[T.get(J)],D[T.get(J)]],M[rt]=[],et.has(J))M[rt][0]=et.get(J);else M[rt][0]=N[T.get(J)];if(ct.has(J))M[rt][1]=ct.get(J);else M[rt][1]=D[T.get(J)]}),Y=!0}}if(Y){var Nt=void 0,Pt=i.transpose(M),Bt=i.transpose(m);for(var ft=0;ft<Pt.length;ft++)Pt[ft]=i.multGamma(Pt[ft]),Bt[ft]=i.multGamma(Bt[ft]);var Jt=i.multMat(Pt,i.transpose(Bt)),Xt=e.svd(Jt);Nt=i.multMat(Xt.V,i.transpose(Xt.U));for(var Et=0;Et<T.size;Et++){var vt=[N[Et],D[Et]],xt=[Nt[0][0],Nt[1][0]],Rt=[Nt[0][1],Nt[1][1]];N[Et]=i.dotProduct(vt,xt),D[Et]=i.dotProduct(vt,Rt)}if(b)tt(c.relativePlacementConstraint)}}if(r.ENFORCE_CONSTRAINTS){if(c.fixedNodeConstraint&&c.fixedNodeConstraint.length>0){var Gt={x:0,y:0};c.fixedNodeConstraint.forEach(function(J,rt){var it={x:N[T.get(J.nodeId)],y:D[T.get(J.nodeId)]},at=J.position,ot=Q(at,it);Gt.x+=ot.x,Gt.y+=ot.y}),Gt.x/=c.fixedNodeConstraint.length,Gt.y/=c.fixedNodeConstraint.length,N.forEach(function(J,rt){N[rt]+=Gt.x}),D.forEach(function(J,rt){D[rt]+=Gt.y}),c.fixedNodeConstraint.forEach(function(J){N[T.get(J.nodeId)]=J.position.x,D[T.get(J.nodeId)]=J.position.y})}if(c.alignmentConstraint){if(c.alignmentConstraint.vertical){var St=c.alignmentConstraint.vertical,Ft=function(rt){var it=new Set;St[rt].forEach(function(gt){it.add(gt)});var at=new Set([].concat(u(it)).filter(function(gt){return k.has(gt)})),ot=void 0;if(at.size>0)ot=N[T.get(at.values().next().value)];else ot=lt(it).x;it.forEach(function(gt){if(!k.has(gt))N[T.get(gt)]=ot})};for(var Ht=0;Ht<St.length;Ht++)Ft(Ht)}if(c.alignmentConstraint.horizontal){var zt=c.alignmentConstraint.horizontal,te=function(rt){var it=new Set;zt[rt].forEach(function(gt){it.add(gt)});var at=new Set([].concat(u(it)).filter(function(gt){return k.has(gt)})),ot=void 0;if(at.size>0)ot=D[T.get(at.values().next().value)];else ot=lt(it).y;it.forEach(function(gt){if(!k.has(gt))D[T.get(gt)]=ot})};for(var qt=0;qt<zt.length;qt++)te(qt)}}if(c.relativePlacementConstraint)(function(){var J=new Map,rt=new Map,it=new Map,at=new Map,ot=new Map,gt=new Map,At=new Set,Mt=new Set;if(k.forEach(function(Qt){At.add(Qt),Mt.add(Qt)}),c.alignmentConstraint){if(c.alignmentConstraint.vertical){var ht=c.alignmentConstraint.vertical,Lt=function(It){it.set("dummy"+It,[]),ht[It].forEach(function(Yt){if(J.set(Yt,"dummy"+It),it.get("dummy"+It).push(Yt),k.has(Yt))At.add("dummy"+It)}),ot.set("dummy"+It,N[T.get(ht[It][0])])};for(var Ct=0;Ct<ht.length;Ct++)Lt(Ct)}if(c.alignmentConstraint.horizontal){var pt=c.alignmentConstraint.horizontal,Ot=function(It){at.set("dummy"+It,[]),pt[It].forEach(function(Yt){if(rt.set(Yt,"dummy"+It),at.get("dummy"+It).push(Yt),k.has(Yt))Mt.add("dummy"+It)}),gt.set("dummy"+It,D[T.get(pt[It][0])])};for(var Ut=0;Ut<pt.length;Ut++)Ot(Ut)}}var Tt=new Map,yt=new Map,Dt=function(It){B.get(It).forEach(function(Yt){var oe=void 0,ne=void 0;if(Yt.direction=="horizontal"){if(oe=J.get(It)?J.get(It):It,J.get(Yt.id))ne={id:J.get(Yt.id),gap:Yt.gap,direction:Yt.direction};else ne=Yt;if(Tt.has(oe))Tt.get(oe).push(ne);else Tt.set(oe,[ne]);if(!Tt.has(ne.id))Tt.set(ne.id,[])}else{if(oe=rt.get(It)?rt.get(It):It,rt.get(Yt.id))ne={id:rt.get(Yt.id),gap:Yt.gap,direction:Yt.direction};else ne=Yt;if(yt.has(oe))yt.get(oe).push(ne);else yt.set(oe,[ne]);if(!yt.has(ne.id))yt.set(ne.id,[])}})},mt=!0,wt=!1,Zt=void 0;try{for(var Vt=B.keys()[Symbol.iterator](),re;!(mt=(re=Vt.next()).done);mt=!0){var Wt=re.value;Dt(Wt)}}catch(Qt){wt=!0,Zt=Qt}finally{try{if(!mt&&Vt.return)Vt.return()}finally{if(wt)throw Zt}}var bt=L(Tt),ae=L(yt),$t=s(bt),jt=s(ae),ie=E(Tt),Me=E(yt),le=[],ce=[];$t.forEach(function(Qt,It){le[It]=[],Qt.forEach(function(Yt){if(ie.get(Yt).length==0)le[It].push(Yt)})}),jt.forEach(function(Qt,It){ce[It]=[],Qt.forEach(function(Yt){if(Me.get(Yt).length==0)ce[It].push(Yt)})});var ge=G(Tt,"horizontal",At,ot,le),fe=G(yt,"vertical",Mt,gt,ce),Le=function(It){if(it.get(It))it.get(It).forEach(function(Yt){N[T.get(Yt)]=ge.get(It)});else N[T.get(It)]=ge.get(It)},ue=!0,ve=!1,Xe=void 0;try{for(var Ce=ge.keys()[Symbol.iterator](),He;!(ue=(He=Ce.next()).done);ue=!0){var Ae=He.value;Le(Ae)}}catch(Qt){ve=!0,Xe=Qt}finally{try{if(!ue&&Ce.return)Ce.return()}finally{if(ve)throw Xe}}var sr=function(It){if(at.get(It))at.get(It).forEach(function(Yt){D[T.get(Yt)]=fe.get(It)});else D[T.get(It)]=fe.get(It)},Oe=!0,We=!1,Ve=void 0;try{for(var xe=fe.keys()[Symbol.iterator](),ze;!(Oe=(ze=xe.next()).done);Oe=!0){var Ae=ze.value;sr(Ae)}}catch(Qt){We=!0,Ve=Qt}finally{try{if(!Oe&&xe.return)xe.return()}finally{if(We)throw Ve}}})()}for(var Kt=0;Kt<X.length;Kt++){var kt=X[Kt];if(kt.getChild()==null)kt.setCenter(N[T.get(kt.id)],D[T.get(kt.id)])}},o.exports=g},551:(o)=>{o.exports=w}},A={};function v(o){var n=A[o];if(n!==void 0)return n.exports;var a=A[o]={exports:{}};return I[o](a,a.exports,v),a.exports}var f=v(45);return f})()})});var $e=In(function(Te,Pe){(function(I,A){if(typeof Te==="object"&&typeof Pe==="object")Pe.exports=A(Fe());else if(typeof define==="function"&&define.amd)define(["cose-base"],A);else if(typeof Te==="object")Te.cytoscapeFcose=A(Fe());else I.cytoscapeFcose=A(I.coseBase)})(Te,function(w){return(()=>{var I={658:(o)=>{o.exports=Object.assign!=null?Object.assign.bind(Object):function(n){for(var a=arguments.length,u=Array(a>1?a-1:0),r=1;r<a;r++)u[r-1]=arguments[r];return u.forEach(function(y){Object.keys(y).forEach(function(i){return n[i]=y[i]})}),n}},548:(o,n,a)=>{var u=function(){function i(e,g){var d=[],c=!0,O=!1,T=void 0;try{for(var N=e[Symbol.iterator](),D;!(c=(D=N.next()).done);c=!0)if(d.push(D.value),g&&d.length===g)break}catch(X){O=!0,T=X}finally{try{if(!c&&N.return)N.return()}finally{if(O)throw T}}return d}return function(e,g){if(Array.isArray(e))return e;else if(Symbol.iterator in Object(e))return i(e,g);else throw TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=a(140).layoutBase.LinkedList,y={};y.getTopMostNodes=function(i){var e={};for(var g=0;g<i.length;g++)e[i[g].id()]=!0;var d=i.filter(function(c,O){if(typeof c==="number")c=O;var T=c.parent()[0];while(T!=null){if(e[T.id()])return!1;T=T.parent()[0]}return!0});return d},y.connectComponents=function(i,e,g,d){var c=new r,O=new Set,T=[],N=void 0,D=void 0,X=void 0,x=!1,W=1,_=[],Q=[],lt=function(){var tt=i.collection();Q.push(tt);var s=g[0],L=i.collection();L.merge(s).merge(s.descendants().intersection(e)),T.push(s),L.forEach(function(m){c.push(m),O.add(m),tt.merge(m)});var E=function(){s=c.shift();var Y=i.collection();s.neighborhood().nodes().forEach(function(H){if(e.intersection(s.edgesWith(H)).length>0)Y.merge(H)});for(var b=0;b<Y.length;b++){var k=Y[b];if(N=g.intersection(k.union(k.ancestors())),N!=null&&!O.has(N[0])){var B=N.union(N.descendants());B.forEach(function(H){if(c.push(H),O.add(H),tt.merge(H),g.has(H))T.push(H)})}}};while(c.length!=0)E();if(tt.forEach(function(m){e.intersection(m.connectedEdges()).forEach(function(Y){if(tt.has(Y.source())&&tt.has(Y.target()))tt.merge(Y)})}),T.length==g.length)x=!0;if(!x||x&&W>1){D=T[0],X=D.connectedEdges().length,T.forEach(function(m){if(m.connectedEdges().length<X)X=m.connectedEdges().length,D=m}),_.push(D.id());var M=i.collection();M.merge(T[0]),T.forEach(function(m){M.merge(m)}),T=[],g=g.difference(M),W++}};do lt();while(!x);if(d){if(_.length>0)d.set("dummy"+(d.size+1),_)}return Q},y.relocateComponent=function(i,e,g){if(!g.fixedNodeConstraint){var{POSITIVE_INFINITY:d,NEGATIVE_INFINITY:c,POSITIVE_INFINITY:O,NEGATIVE_INFINITY:T}=Number;if(g.quality=="draft"){var N=!0,D=!1,X=void 0;try{for(var x=e.nodeIndexes[Symbol.iterator](),W;!(N=(W=x.next()).done);N=!0){var _=W.value,Q=u(_,2),lt=Q[0],G=Q[1],tt=g.cy.getElementById(lt);if(tt){var s=tt.boundingBox(),L=e.xCoords[G]-s.w/2,E=e.xCoords[G]+s.w/2,M=e.yCoords[G]-s.h/2,m=e.yCoords[G]+s.h/2;if(L<d)d=L;if(E>c)c=E;if(M<O)O=M;if(m>T)T=m}}}catch(H){D=!0,X=H}finally{try{if(!N&&x.return)x.return()}finally{if(D)throw X}}var Y=i.x-(c+d)/2,b=i.y-(T+O)/2;e.xCoords=e.xCoords.map(function(H){return H+Y}),e.yCoords=e.yCoords.map(function(H){return H+b})}else{Object.keys(e).forEach(function(H){var st=e[H],dt=st.getRect().x,Z=st.getRect().x+st.getRect().width,ut=st.getRect().y,nt=st.getRect().y+st.getRect().height;if(dt<d)d=dt;if(Z>c)c=Z;if(ut<O)O=ut;if(nt>T)T=nt});var k=i.x-(c+d)/2,B=i.y-(T+O)/2;Object.keys(e).forEach(function(H){var st=e[H];st.setCenter(st.getCenterX()+k,st.getCenterY()+B)})}}},y.calcBoundingBox=function(i,e,g,d){var{MAX_SAFE_INTEGER:c,MIN_SAFE_INTEGER:O,MAX_SAFE_INTEGER:T,MIN_SAFE_INTEGER:N}=Number,D=void 0,X=void 0,x=void 0,W=void 0,_=i.descendants().not(":parent"),Q=_.length;for(var lt=0;lt<Q;lt++){var G=_[lt];if(D=e[d.get(G.id())]-G.width()/2,X=e[d.get(G.id())]+G.width()/2,x=g[d.get(G.id())]-G.height()/2,W=g[d.get(G.id())]+G.height()/2,c>D)c=D;if(O<X)O=X;if(T>x)T=x;if(N<W)N=W}var tt={};return tt.topLeftX=c,tt.topLeftY=T,tt.width=O-c,tt.height=N-T,tt},y.calcParentsWithoutChildren=function(i,e){var g=i.collection();return e.nodes(":parent").forEach(function(d){var c=!1;if(d.children().forEach(function(O){if(O.css("display")!="none")c=!0}),!c)g.merge(d)}),g},o.exports=y},816:(o,n,a)=>{var u=a(548),r=a(140).CoSELayout,y=a(140).CoSENode,i=a(140).layoutBase.PointD,e=a(140).layoutBase.DimensionD,g=a(140).layoutBase.LayoutConstants,d=a(140).layoutBase.FDLayoutConstants,c=a(140).CoSEConstants,O=function(N,D){var{cy:X,eles:x}=N,W=x.nodes(),_=x.edges(),Q=void 0,lt=void 0,G=void 0,tt={};if(N.randomize)Q=D.nodeIndexes,lt=D.xCoords,G=D.yCoords;var s=function(H){return typeof H==="function"},L=function(H,st){if(s(H))return H(st);else return H},E=u.calcParentsWithoutChildren(X,x),M=function B(H,st,dt,Z){var ut=st.length;for(var nt=0;nt<ut;nt++){var S=st[nt],K=null;if(S.intersection(E).length==0)K=S.children();var et=void 0,ct=S.layoutDimensions({nodeDimensionsIncludeLabels:Z.nodeDimensionsIncludeLabels});if(S.outerWidth()!=null&&S.outerHeight()!=null)if(Z.randomize)if(!S.isParent())et=H.add(new y(dt.graphManager,new i(lt[Q.get(S.id())]-ct.w/2,G[Q.get(S.id())]-ct.h/2),new e(parseFloat(ct.w),parseFloat(ct.h))));else{var Nt=u.calcBoundingBox(S,lt,G,Q);if(S.intersection(E).length==0)et=H.add(new y(dt.graphManager,new i(Nt.topLeftX,Nt.topLeftY),new e(Nt.width,Nt.height)));else et=H.add(new y(dt.graphManager,new i(Nt.topLeftX,Nt.topLeftY),new e(parseFloat(ct.w),parseFloat(ct.h))))}else et=H.add(new y(dt.graphManager,new i(S.position("x")-ct.w/2,S.position("y")-ct.h/2),new e(parseFloat(ct.w),parseFloat(ct.h))));else et=H.add(new y(this.graphManager));if(et.id=S.data("id"),et.nodeRepulsion=L(Z.nodeRepulsion,S),et.paddingLeft=parseInt(S.css("padding")),et.paddingTop=parseInt(S.css("padding")),et.paddingRight=parseInt(S.css("padding")),et.paddingBottom=parseInt(S.css("padding")),Z.nodeDimensionsIncludeLabels)et.labelWidth=S.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,et.labelHeight=S.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,et.labelPosVertical=S.css("text-valign"),et.labelPosHorizontal=S.css("text-halign");if(tt[S.data("id")]=et,isNaN(et.rect.x))et.rect.x=0;if(isNaN(et.rect.y))et.rect.y=0;if(K!=null&&K.length>0){var Pt=void 0;Pt=dt.getGraphManager().add(dt.newGraph(),et),B(Pt,K,dt,Z)}}},m=function(H,st,dt){var Z=0,ut=0;for(var nt=0;nt<dt.length;nt++){var S=dt[nt],K=tt[S.data("source")],et=tt[S.data("target")];if(K&&et&&K!==et&&K.getEdgesBetween(et).length==0){var ct=st.add(H.newEdge(),K,et);ct.id=S.id(),ct.idealLength=L(N.idealEdgeLength,S),ct.edgeElasticity=L(N.edgeElasticity,S),Z+=ct.idealLength,ut++}}if(N.idealEdgeLength!=null){if(ut>0)c.DEFAULT_EDGE_LENGTH=d.DEFAULT_EDGE_LENGTH=Z/ut;else if(!s(N.idealEdgeLength))c.DEFAULT_EDGE_LENGTH=d.DEFAULT_EDGE_LENGTH=N.idealEdgeLength;else c.DEFAULT_EDGE_LENGTH=d.DEFAULT_EDGE_LENGTH=50;c.MIN_REPULSION_DIST=d.MIN_REPULSION_DIST=d.DEFAULT_EDGE_LENGTH/10,c.DEFAULT_RADIAL_SEPARATION=d.DEFAULT_EDGE_LENGTH}},Y=function(H,st){if(st.fixedNodeConstraint)H.constraints.fixedNodeConstraint=st.fixedNodeConstraint;if(st.alignmentConstraint)H.constraints.alignmentConstraint=st.alignmentConstraint;if(st.relativePlacementConstraint)H.constraints.relativePlacementConstraint=st.relativePlacementConstraint};if(N.nestingFactor!=null)c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=d.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=N.nestingFactor;if(N.gravity!=null)c.DEFAULT_GRAVITY_STRENGTH=d.DEFAULT_GRAVITY_STRENGTH=N.gravity;if(N.numIter!=null)c.MAX_ITERATIONS=d.MAX_ITERATIONS=N.numIter;if(N.gravityRange!=null)c.DEFAULT_GRAVITY_RANGE_FACTOR=d.DEFAULT_GRAVITY_RANGE_FACTOR=N.gravityRange;if(N.gravityCompound!=null)c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=d.DEFAULT_COMPOUND_GRAVITY_STRENGTH=N.gravityCompound;if(N.gravityRangeCompound!=null)c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=d.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=N.gravityRangeCompound;if(N.initialEnergyOnIncremental!=null)c.DEFAULT_COOLING_FACTOR_INCREMENTAL=d.DEFAULT_COOLING_FACTOR_INCREMENTAL=N.initialEnergyOnIncremental;if(N.tilingCompareBy!=null)c.TILING_COMPARE_BY=N.tilingCompareBy;if(N.quality=="proof")g.QUALITY=2;else g.QUALITY=0;if(c.NODE_DIMENSIONS_INCLUDE_LABELS=d.NODE_DIMENSIONS_INCLUDE_LABELS=g.NODE_DIMENSIONS_INCLUDE_LABELS=N.nodeDimensionsIncludeLabels,c.DEFAULT_INCREMENTAL=d.DEFAULT_INCREMENTAL=g.DEFAULT_INCREMENTAL=!N.randomize,c.ANIMATE=d.ANIMATE=g.ANIMATE=N.animate,c.TILE=N.tile,c.TILING_PADDING_VERTICAL=typeof N.tilingPaddingVertical==="function"?N.tilingPaddingVertical.call():N.tilingPaddingVertical,c.TILING_PADDING_HORIZONTAL=typeof N.tilingPaddingHorizontal==="function"?N.tilingPaddingHorizontal.call():N.tilingPaddingHorizontal,c.DEFAULT_INCREMENTAL=d.DEFAULT_INCREMENTAL=g.DEFAULT_INCREMENTAL=!0,c.PURE_INCREMENTAL=!N.randomize,g.DEFAULT_UNIFORM_LEAF_NODE_SIZES=N.uniformNodeDimensions,N.step=="transformed")c.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,c.ENFORCE_CONSTRAINTS=!1,c.APPLY_LAYOUT=!1;if(N.step=="enforced")c.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,c.ENFORCE_CONSTRAINTS=!0,c.APPLY_LAYOUT=!1;if(N.step=="cose")c.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,c.ENFORCE_CONSTRAINTS=!1,c.APPLY_LAYOUT=!0;if(N.step=="all"){if(N.randomize)c.TRANSFORM_ON_CONSTRAINT_HANDLING=!0;else c.TRANSFORM_ON_CONSTRAINT_HANDLING=!1;c.ENFORCE_CONSTRAINTS=!0,c.APPLY_LAYOUT=!0}if(N.fixedNodeConstraint||N.alignmentConstraint||N.relativePlacementConstraint)c.TREE_REDUCTION_ON_INCREMENTAL=!1;else c.TREE_REDUCTION_ON_INCREMENTAL=!0;var b=new r,k=b.newGraphManager();return M(k.addRoot(),u.getTopMostNodes(W),b,N),m(b,k,_),Y(b,N),b.runLayout(),tt};o.exports={coseLayout:O}},212:(o,n,a)=>{var u=function(){function N(D,X){for(var x=0;x<X.length;x++){var W=X[x];if(W.enumerable=W.enumerable||!1,W.configurable=!0,"value"in W)W.writable=!0;Object.defineProperty(D,W.key,W)}}return function(D,X,x){if(X)N(D.prototype,X);if(x)N(D,x);return D}}();function r(N,D){if(!(N instanceof D))throw TypeError("Cannot call a class as a function")}var y=a(658),i=a(548),e=a(657),g=e.spectralLayout,d=a(816),c=d.coseLayout,O=Object.freeze({quality:"default",randomize:!0,animate:!0,animationDuration:1000,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:"all",samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:0.0000001,nodeRepulsion:function(D){return 4500},idealEdgeLength:function(D){return 50},edgeElasticity:function(D){return 0.45},nestingFactor:0.1,gravity:0.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:0.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:function(){},stop:function(){}}),T=function(){function N(D){r(this,N),this.options=y({},O,D)}return u(N,[{key:"run",value:function(){var X=this,x=this.options,{cy:W,eles:_}=x,Q=[],lt=void 0,G=void 0,tt=[],s=void 0,L=[];if(x.fixedNodeConstraint&&(!Array.isArray(x.fixedNodeConstraint)||x.fixedNodeConstraint.length==0))x.fixedNodeConstraint=void 0;if(x.alignmentConstraint){if(x.alignmentConstraint.vertical&&(!Array.isArray(x.alignmentConstraint.vertical)||x.alignmentConstraint.vertical.length==0))x.alignmentConstraint.vertical=void 0;if(x.alignmentConstraint.horizontal&&(!Array.isArray(x.alignmentConstraint.horizontal)||x.alignmentConstraint.horizontal.length==0))x.alignmentConstraint.horizontal=void 0}if(x.relativePlacementConstraint&&(!Array.isArray(x.relativePlacementConstraint)||x.relativePlacementConstraint.length==0))x.relativePlacementConstraint=void 0;var E=x.fixedNodeConstraint||x.alignmentConstraint||x.relativePlacementConstraint;if(E)x.tile=!1,x.packComponents=!1;var M=void 0,m=!1;if(W.layoutUtilities&&x.packComponents){if(M=W.layoutUtilities("get"),!M)M=W.layoutUtilities();m=!0}if(_.nodes().length>0)if(!m){var Y=x.eles.boundingBox();if(L.push({x:Y.x1+Y.w/2,y:Y.y1+Y.h/2}),x.randomize){var b=g(x);Q.push(b)}if(x.quality=="default"||x.quality=="proof")tt.push(c(x,Q[0])),i.relocateComponent(L[0],tt[0],x);else i.relocateComponent(L[0],Q[0],x)}else{var k=i.getTopMostNodes(x.eles.nodes());if(s=i.connectComponents(W,x.eles,k),s.forEach(function(Et){var vt=Et.boundingBox();L.push({x:vt.x1+vt.w/2,y:vt.y1+vt.h/2})}),x.randomize)s.forEach(function(Et){x.eles=Et,Q.push(g(x))});if(x.quality=="default"||x.quality=="proof"){var B=W.collection();if(x.tile){var H=new Map,st=[],dt=[],Z=0,ut={nodeIndexes:H,xCoords:st,yCoords:dt},nt=[];if(s.forEach(function(Et,vt){if(Et.edges().length==0)Et.nodes().forEach(function(xt,Rt){if(B.merge(Et.nodes()[Rt]),!xt.isParent())ut.nodeIndexes.set(Et.nodes()[Rt].id(),Z++),ut.xCoords.push(Et.nodes()[0].position().x),ut.yCoords.push(Et.nodes()[0].position().y)}),nt.push(vt)}),B.length>1){var S=B.boundingBox();L.push({x:S.x1+S.w/2,y:S.y1+S.h/2}),s.push(B),Q.push(ut);for(var K=nt.length-1;K>=0;K--)s.splice(nt[K],1),Q.splice(nt[K],1),L.splice(nt[K],1)}}s.forEach(function(Et,vt){x.eles=Et,tt.push(c(x,Q[vt])),i.relocateComponent(L[vt],tt[vt],x)})}else s.forEach(function(Et,vt){i.relocateComponent(L[vt],Q[vt],x)});var et=new Set;if(s.length>1){var ct=[],Nt=_.filter(function(Et){return Et.css("display")=="none"});s.forEach(function(Et,vt){var xt=void 0;if(x.quality=="draft")xt=Q[vt].nodeIndexes;if(Et.nodes().not(Nt).length>0){var Rt={};Rt.edges=[],Rt.nodes=[];var Gt=void 0;if(Et.nodes().not(Nt).forEach(function(St){if(x.quality=="draft")if(!St.isParent())Gt=xt.get(St.id()),Rt.nodes.push({x:Q[vt].xCoords[Gt]-St.boundingbox().w/2,y:Q[vt].yCoords[Gt]-St.boundingbox().h/2,width:St.boundingbox().w,height:St.boundingbox().h});else{var Ft=i.calcBoundingBox(St,Q[vt].xCoords,Q[vt].yCoords,xt);Rt.nodes.push({x:Ft.topLeftX,y:Ft.topLeftY,width:Ft.width,height:Ft.height})}else if(tt[vt][St.id()])Rt.nodes.push({x:tt[vt][St.id()].getLeft(),y:tt[vt][St.id()].getTop(),width:tt[vt][St.id()].getWidth(),height:tt[vt][St.id()].getHeight()})}),Et.edges().forEach(function(St){var Ft=St.source(),Ht=St.target();if(Ft.css("display")!="none"&&Ht.css("display")!="none"){if(x.quality=="draft"){var zt=xt.get(Ft.id()),te=xt.get(Ht.id()),qt=[],Kt=[];if(Ft.isParent()){var kt=i.calcBoundingBox(Ft,Q[vt].xCoords,Q[vt].yCoords,xt);qt.push(kt.topLeftX+kt.width/2),qt.push(kt.topLeftY+kt.height/2)}else qt.push(Q[vt].xCoords[zt]),qt.push(Q[vt].yCoords[zt]);if(Ht.isParent()){var J=i.calcBoundingBox(Ht,Q[vt].xCoords,Q[vt].yCoords,xt);Kt.push(J.topLeftX+J.width/2),Kt.push(J.topLeftY+J.height/2)}else Kt.push(Q[vt].xCoords[te]),Kt.push(Q[vt].yCoords[te]);Rt.edges.push({startX:qt[0],startY:qt[1],endX:Kt[0],endY:Kt[1]})}else if(tt[vt][Ft.id()]&&tt[vt][Ht.id()])Rt.edges.push({startX:tt[vt][Ft.id()].getCenterX(),startY:tt[vt][Ft.id()].getCenterY(),endX:tt[vt][Ht.id()].getCenterX(),endY:tt[vt][Ht.id()].getCenterY()})}}),Rt.nodes.length>0)ct.push(Rt),et.add(vt)}});var Pt=M.packComponents(ct,x.randomize).shifts;if(x.quality=="draft")Q.forEach(function(Et,vt){var xt=Et.xCoords.map(function(Gt){return Gt+Pt[vt].dx}),Rt=Et.yCoords.map(function(Gt){return Gt+Pt[vt].dy});Et.xCoords=xt,Et.yCoords=Rt});else{var Bt=0;et.forEach(function(Et){Object.keys(tt[Et]).forEach(function(vt){var xt=tt[Et][vt];xt.setCenter(xt.getCenterX()+Pt[Bt].dx,xt.getCenterY()+Pt[Bt].dy)}),Bt++})}}}var ft=function(vt,xt){if(x.quality=="default"||x.quality=="proof"){if(typeof vt==="number")vt=xt;var Rt=void 0,Gt=void 0,St=vt.data("id");if(tt.forEach(function(Ht){if(St in Ht)Rt={x:Ht[St].getRect().getCenterX(),y:Ht[St].getRect().getCenterY()},Gt=Ht[St]}),x.nodeDimensionsIncludeLabels){if(Gt.labelWidth){if(Gt.labelPosHorizontal=="left")Rt.x+=Gt.labelWidth/2;else if(Gt.labelPosHorizontal=="right")Rt.x-=Gt.labelWidth/2}if(Gt.labelHeight){if(Gt.labelPosVertical=="top")Rt.y+=Gt.labelHeight/2;else if(Gt.labelPosVertical=="bottom")Rt.y-=Gt.labelHeight/2}}if(Rt==null)Rt={x:vt.position("x"),y:vt.position("y")};return{x:Rt.x,y:Rt.y}}else{var Ft=void 0;if(Q.forEach(function(Ht){var zt=Ht.nodeIndexes.get(vt.id());if(zt!=null)Ft={x:Ht.xCoords[zt],y:Ht.yCoords[zt]}}),Ft==null)Ft={x:vt.position("x"),y:vt.position("y")};return{x:Ft.x,y:Ft.y}}};if(x.quality=="default"||x.quality=="proof"||x.randomize){var Jt=i.calcParentsWithoutChildren(W,_),Xt=_.filter(function(Et){return Et.css("display")=="none"});if(x.eles=_.not(Xt),_.nodes().not(":parent").not(Xt).layoutPositions(X,x,ft),Jt.length>0)Jt.forEach(function(Et){Et.position(ft(Et))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),N}();o.exports=T},657:(o,n,a)=>{var u=a(548),r=a(140).layoutBase.Matrix,y=a(140).layoutBase.SVD,i=function(g){var{cy:d,eles:c}=g,O=c.nodes(),T=c.nodes(":parent"),N=new Map,D=new Map,X=new Map,x=[],W=[],_=[],Q=[],lt=[],G=[],tt=[],s=[],L=void 0,E=void 0,M=1e8,m=0.000000001,{piTol:Y,samplingType:b,nodeSeparation:k}=g,B=void 0,H=function(){var it=0,at=0,ot=!1;while(at<B){it=Math.floor(Math.random()*E),ot=!1;for(var gt=0;gt<at;gt++)if(Q[gt]==it){ot=!0;break}if(!ot)Q[at]=it,at++;else continue}},st=function(it,at,ot){var gt=[],At=0,Mt=0,ht=0,Lt=void 0,Ct=[],pt=0,Ot=1;for(var Ut=0;Ut<E;Ut++)Ct[Ut]=M;gt[Mt]=it,Ct[it]=0;while(Mt>=At){ht=gt[At++];var Tt=x[ht];for(var yt=0;yt<Tt.length;yt++)if(Lt=D.get(Tt[yt]),Ct[Lt]==M)Ct[Lt]=Ct[ht]+1,gt[++Mt]=Lt;G[ht][at]=Ct[ht]*k}if(ot){for(var Dt=0;Dt<E;Dt++)if(G[Dt][at]<lt[Dt])lt[Dt]=G[Dt][at];for(var mt=0;mt<E;mt++)if(lt[mt]>pt)pt=lt[mt],Ot=mt}return Ot},dt=function(it){var at=void 0;if(!it){H();for(var ot=0;ot<B;ot++)st(Q[ot],ot,it,!1)}else{at=Math.floor(Math.random()*E),L=at;for(var gt=0;gt<E;gt++)lt[gt]=M;for(var At=0;At<B;At++)Q[At]=at,at=st(at,At,it)}for(var Mt=0;Mt<E;Mt++)for(var ht=0;ht<B;ht++)G[Mt][ht]*=G[Mt][ht];for(var Lt=0;Lt<B;Lt++)tt[Lt]=[];for(var Ct=0;Ct<B;Ct++)for(var pt=0;pt<B;pt++)tt[Ct][pt]=G[Q[pt]][Ct]},Z=function(){var it=y.svd(tt),{S:at,U:ot,V:gt}=it,At=at[0]*at[0]*at[0],Mt=[];for(var ht=0;ht<B;ht++){Mt[ht]=[];for(var Lt=0;Lt<B;Lt++)if(Mt[ht][Lt]=0,ht==Lt)Mt[ht][Lt]=at[ht]/(at[ht]*at[ht]+At/(at[ht]*at[ht]))}s=r.multMat(r.multMat(gt,Mt),r.transpose(ot))},ut=function(){var it=void 0,at=void 0,ot=[],gt=[],At=[],Mt=[];for(var ht=0;ht<E;ht++)ot[ht]=Math.random(),gt[ht]=Math.random();ot=r.normalize(ot),gt=r.normalize(gt);var Lt=0,Ct=m,pt=m,Ot=void 0;while(!0){Lt++;for(var Ut=0;Ut<E;Ut++)At[Ut]=ot[Ut];if(ot=r.multGamma(r.multL(r.multGamma(At),G,s)),it=r.dotProduct(At,ot),ot=r.normalize(ot),Ct=r.dotProduct(At,ot),Ot=Math.abs(Ct/pt),Ot<=1+Y&&Ot>=1)break;pt=Ct}for(var Tt=0;Tt<E;Tt++)At[Tt]=ot[Tt];Lt=0,pt=m;while(!0){Lt++;for(var yt=0;yt<E;yt++)Mt[yt]=gt[yt];if(Mt=r.minusOp(Mt,r.multCons(At,r.dotProduct(At,Mt))),gt=r.multGamma(r.multL(r.multGamma(Mt),G,s)),at=r.dotProduct(Mt,gt),gt=r.normalize(gt),Ct=r.dotProduct(Mt,gt),Ot=Math.abs(Ct/pt),Ot<=1+Y&&Ot>=1)break;pt=Ct}for(var Dt=0;Dt<E;Dt++)Mt[Dt]=gt[Dt];W=r.multCons(At,Math.sqrt(Math.abs(it))),_=r.multCons(Mt,Math.sqrt(Math.abs(at)))};u.connectComponents(d,c,u.getTopMostNodes(O),N),T.forEach(function(rt){u.connectComponents(d,c,u.getTopMostNodes(rt.descendants().intersection(c)),N)});var nt=0;for(var S=0;S<O.length;S++)if(!O[S].isParent())D.set(O[S].id(),nt++);var K=!0,et=!1,ct=void 0;try{for(var Nt=N.keys()[Symbol.iterator](),Pt;!(K=(Pt=Nt.next()).done);K=!0){var Bt=Pt.value;D.set(Bt,nt++)}}catch(rt){et=!0,ct=rt}finally{try{if(!K&&Nt.return)Nt.return()}finally{if(et)throw ct}}for(var ft=0;ft<D.size;ft++)x[ft]=[];T.forEach(function(rt){var it=rt.children().intersection(c);while(it.nodes(":childless").length==0)it=it.nodes()[0].children().intersection(c);var at=0,ot=it.nodes(":childless")[0].connectedEdges().length;it.nodes(":childless").forEach(function(gt,At){if(gt.connectedEdges().length<ot)ot=gt.connectedEdges().length,at=At}),X.set(rt.id(),it.nodes(":childless")[at].id())}),O.forEach(function(rt){var it=void 0;if(rt.isParent())it=D.get(X.get(rt.id()));else it=D.get(rt.id());rt.neighborhood().nodes().forEach(function(at){if(c.intersection(rt.edgesWith(at)).length>0)if(at.isParent())x[it].push(X.get(at.id()));else x[it].push(at.id())})});var Jt=function(it){var at=D.get(it),ot=void 0;N.get(it).forEach(function(gt){if(d.getElementById(gt).isParent())ot=X.get(gt);else ot=gt;x[at].push(ot),x[D.get(ot)].push(it)})},Xt=!0,Et=!1,vt=void 0;try{for(var xt=N.keys()[Symbol.iterator](),Rt;!(Xt=(Rt=xt.next()).done);Xt=!0){var Gt=Rt.value;Jt(Gt)}}catch(rt){Et=!0,vt=rt}finally{try{if(!Xt&&xt.return)xt.return()}finally{if(Et)throw vt}}E=D.size;var St=void 0;if(E>2){B=E<g.sampleSize?E:g.sampleSize;for(var Ft=0;Ft<E;Ft++)G[Ft]=[];for(var Ht=0;Ht<B;Ht++)s[Ht]=[];if(g.quality=="draft"||g.step=="all")dt(b),Z(),ut(),St={nodeIndexes:D,xCoords:W,yCoords:_};else D.forEach(function(rt,it){W.push(d.getElementById(it).position("x")),_.push(d.getElementById(it).position("y"))}),St={nodeIndexes:D,xCoords:W,yCoords:_};return St}else{var zt=D.keys(),te=d.getElementById(zt.next().value),qt=te.position(),Kt=te.outerWidth();if(W.push(qt.x),_.push(qt.y),E==2){var kt=d.getElementById(zt.next().value),J=kt.outerWidth();W.push(qt.x+Kt/2+J/2+g.idealEdgeLength),_.push(qt.y)}return St={nodeIndexes:D,xCoords:W,yCoords:_},St}};o.exports={spectralLayout:i}},579:(o,n,a)=>{var u=a(212),r=function(i){if(!i)return;i("layout","fcose",u)};if(typeof cytoscape<"u")r(cytoscape);o.exports=r},140:(o)=>{o.exports=w}},A={};function v(o){var n=A[o];if(n!==void 0)return n.exports;var a=A[o]={exports:{}};return I[o](a,a.exports,v),a.exports}var f=v(579);return f})()})});var je=mn($e(),1);var Be={L:"left",R:"right",T:"top",B:"bottom"},Ze={L:t((w)=>`${w},${w/2} 0,${w} 0,0`,"L"),R:t((w)=>`0,${w/2} ${w},0 ${w},${w}`,"R"),T:t((w)=>`0,0 ${w},0 ${w/2},${w}`,"T"),B:t((w)=>`${w/2},0 ${w},${w} 0,${w}`,"B")},we={L:t((w,I)=>w-I+2,"L"),R:t((w,I)=>w-2,"R"),T:t((w,I)=>w-I+2,"T"),B:t((w,I)=>w-2,"B")},hr=t(function(w){if(_t(w))return w==="L"?"R":"L";else return w==="T"?"B":"T"},"getOppositeArchitectureDirection"),ke=t(function(w){let I=w;return I==="L"||I==="R"||I==="T"||I==="B"},"isArchitectureDirection"),_t=t(function(w){let I=w;return I==="L"||I==="R"},"isArchitectureDirectionX"),he=t(function(w){let I=w;return I==="T"||I==="B"},"isArchitectureDirectionY"),Ye=t(function(w,I){let A=_t(w)&&he(I),v=he(w)&&_t(I);return A||v},"isArchitectureDirectionXY"),fr=t(function(w){let I=w[0],A=w[1],v=_t(I)&&he(A),f=he(I)&&_t(A);return v||f},"isArchitecturePairXY"),cr=t(function(w){return w!=="LL"&&w!=="RR"&&w!=="TT"&&w!=="BB"},"isValidArchitectureDirectionPair"),Ge=t(function(w,I){let A=`${w}${I}`;return cr(A)?A:void 0},"getArchitectureDirectionPair"),gr=t(function([w,I],A){let v=A[0],f=A[1];if(_t(v))if(he(f))return[w+(v==="L"?-1:1),I+(f==="T"?1:-1)];else return[w+(v==="L"?-1:1),I];else if(_t(f))return[w+(f==="L"?1:-1),I+(v==="T"?1:-1)];else return[w,I+(v==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),ur=t(function(w){if(w==="LT"||w==="TL")return[1,1];else if(w==="BL"||w==="LB")return[1,-1];else if(w==="BR"||w==="RB")return[-1,-1];else return[-1,1]},"getArchitectureDirectionXYFactors"),dr=t(function(w,I){if(Ye(w,I))return"bend";else if(_t(w))return"horizontal";return"vertical"},"getArchitectureDirectionAlignment"),vr=t(function(w){return w.type==="service"},"isArchitectureService"),pr=t(function(w){return w.type==="junction"},"isArchitectureJunction"),qe=t((w,I)=>{let[A,v]=[w,I].sort();return`${JSON.stringify(A)}-${JSON.stringify(v)}`},"architectureGroupAlignmentKey"),Qe=t((w)=>w.data(),"edgeData"),ye=t((w)=>w.data(),"nodeData"),yr=V.architecture,Je=class{constructor(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.elements=new Map,this.diagramId="",this.setAccTitle=F,this.getAccTitle=z,this.setDiagramTitle=q,this.getDiagramTitle=j,this.getAccDescription=U,this.setAccDescription=P,this.clear()}static{t(this,"ArchitectureDB")}setDiagramId(w){this.diagramId=w}getDiagramId(){return this.diagramId}clear(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.dataStructures=void 0,this.elements=new Map,this.diagramId="",R()}addService({id:w,icon:I,in:A,title:v,iconText:f}){if(this.registeredIds.has(w))throw Error(`The service id [${w}] is already in use by another ${this.registeredIds.get(w)}`);if(A!==void 0){if(w===A)throw Error(`The service [${w}] cannot be placed within itself`);if(!this.registeredIds.has(A))throw Error(`The service [${w}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds.get(A)==="node")throw Error(`The service [${w}]'s parent is not a group`)}this.registeredIds.set(w,"node"),this.nodes.set(w,{id:w,type:"service",icon:I,iconText:f,title:v,edges:[],in:A})}getServices(){return[...this.nodes.values()].filter(vr)}addJunction({id:w,in:I}){if(this.registeredIds.has(w))throw Error(`The junction id [${w}] is already in use by another ${this.registeredIds.get(w)}`);if(I!==void 0){if(w===I)throw Error(`The junction [${w}] cannot be placed within itself`);if(!this.registeredIds.has(I))throw Error(`The junction [${w}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds.get(I)==="node")throw Error(`The junction [${w}]'s parent is not a group`)}this.registeredIds.set(w,"node"),this.nodes.set(w,{id:w,type:"junction",edges:[],in:I})}getJunctions(){return[...this.nodes.values()].filter(pr)}getNodes(){return[...this.nodes.values()]}getNode(w){return this.nodes.get(w)??null}addGroup({id:w,icon:I,in:A,title:v}){if(this.registeredIds.has(w))throw Error(`The group id [${w}] is already in use by another ${this.registeredIds.get(w)}`);if(A!==void 0){if(w===A)throw Error(`The group [${w}] cannot be placed within itself`);if(!this.registeredIds.has(A))throw Error(`The group [${w}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds.get(A)==="node")throw Error(`The group [${w}]'s parent is not a group`)}this.registeredIds.set(w,"group"),this.groups.set(w,{id:w,icon:I,title:v,in:A})}getGroups(){return[...this.groups.values()]}addEdge({lhsId:w,rhsId:I,lhsDir:A,rhsDir:v,lhsInto:f,rhsInto:o,lhsGroup:n,rhsGroup:a,title:u}){if(!ke(A))throw Error(`Invalid direction given for left hand side of edge ${w}--${I}. Expected (L,R,T,B) got ${String(A)}`);if(!ke(v))throw Error(`Invalid direction given for right hand side of edge ${w}--${I}. Expected (L,R,T,B) got ${String(v)}`);if(!this.nodes.has(w)&&!this.groups.has(w))throw Error(`The left-hand id [${w}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(!this.nodes.has(I)&&!this.groups.has(I))throw Error(`The right-hand id [${I}] does not yet exist. Please create the service/group before declaring an edge to it.`);let r=this.nodes.get(w).in,y=this.nodes.get(I).in;if(n&&r&&y&&r==y)throw Error(`The left-hand id [${w}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(a&&r&&y&&r==y)throw Error(`The right-hand id [${I}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);let i={lhsId:w,lhsDir:A,lhsInto:f,lhsGroup:n,rhsId:I,rhsDir:v,rhsInto:o,rhsGroup:a,title:u};this.edges.push(i);let e=this.nodes.get(w),g=this.nodes.get(I);if(e&&g)e.edges.push(this.edges[this.edges.length-1]),g.edges.push(this.edges[this.edges.length-1])}getEdges(){return this.edges}addLayoutHint(w){if(w.members.length<2)throw Error(`An align directive requires at least two members; got ${w.members.length}`);let I=new Set;w.members.forEach((A)=>{if(this.registeredIds.get(A)!=="node")throw Error(`align ${w.direction} references [${A}], which is not a service or junction`);if(I.has(A))throw Error(`align ${w.direction} lists [${A}] more than once`);I.add(A)}),this.layoutHints.push(w)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(this.dataStructures===void 0){let w=new Map,I=new Map;for(let[n,a]of this.nodes.entries()){let u=new Map;for(let r of a.edges){let y=this.getNode(r.lhsId)?.in,i=this.getNode(r.rhsId)?.in;if(y&&i&&y!==i){let e=dr(r.lhsDir,r.rhsDir);if(e!=="bend")w.set(qe(y,i),e)}if(r.lhsId===n){let e=Ge(r.lhsDir,r.rhsDir);if(e)u.set(e,r.rhsId)}else{let e=Ge(r.rhsDir,r.lhsDir);if(e)u.set(e,r.lhsId)}}I.set(n,u)}let A=new Set,v=new Set(I.keys()),f=t((n)=>{let a=new Map([[n,[0,0]]]),u=[n];while(u.length>0){let r=u.shift();if(r){A.add(r),v.delete(r);let y=I.get(r);if(!y)throw Error(`BFS error: adjacency list for id ${r} not found. Please report this as a bug.`);let i=a.get(r);if(!i)throw Error(`BFS error: position for id ${r} not found in spatial map. Please report this as a bug.`);let[e,g]=i;y.forEach((d,c)=>{if(!A.has(d))a.set(d,gr([e,g],c)),u.push(d)})}}return a},"BFS"),o=[];while(v.size>0){let n=v.values().next().value;o.push(f(n))}this.dataStructures={adjList:I,spatialMaps:o,groupAlignments:w}}return this.dataStructures}setElementForId(w,I){this.elements.set(w,I)}getElementById(w){return this.elements.get(w)}getConfig(){return se({...yr,...C().architecture})}getConfigField(w){return this.getConfig()[w]}},mr=t((w,I)=>{be(w,I),w.groups.map((A)=>I.addGroup(A)),w.services.map((A)=>I.addService({...A,type:"service"})),w.junctions.map((A)=>I.addJunction({...A,type:"junction"})),w.edges.map((A)=>I.addEdge(A)),w.alignments?.map((A)=>I.addLayoutHint({direction:A.direction,members:[...A.members]}))},"populateDb"),Ke={parser:{yy:void 0},parse:t(async(w)=>{let I=await De("architecture",w);l.debug(I);let A=Ke.parser?.yy;if(!(A instanceof Je))throw Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");mr(I,A)},"parse")},Er=t((w)=>`
|
|
2
2
|
.edge {
|
|
3
3
|
stroke-width: ${w.archEdgeWidth};
|
|
4
4
|
stroke: ${w.archEdgeColor};
|
|
@@ -29,8 +29,8 @@ import{be}from"./index-9vdbnvmk.js";import{t,l,V,C,ee,$r,R,F,z,P,U,q,j,p,h,ue,zf
|
|
|
29
29
|
display: -webkit-box;
|
|
30
30
|
-webkit-box-orient: vertical;
|
|
31
31
|
}
|
|
32
|
-
`,"getStyles"),Tr=Er;function Ue(w,I){if(w===0)return I();let A=Math.random,v=w>>>0;Math.random=function(){v=v+1831565813>>>0;let f=v;return f=Math.imul(f^f>>>15,f|1),f^=f+Math.imul(f^f>>>7,f|61),((f^f>>>14)>>>0)/4294967296};try{return I()}finally{Math.random=A}}t(Ue,"withSeededRandom");var pe=t((w)=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${w}</g>`,"wrapIcon"),Ne={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:pe('<path id="b" data-name="4" d="m20,57.86c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="c" data-name="3" d="m20,45.95c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="d" data-name="2" d="m20,34.05c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse id="e" data-name="1" cx="40" cy="22.14" rx="20" ry="7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="20" y1="57.86" x2="20" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="60" y1="57.86" x2="60" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},server:{body:pe('<rect x="17.5" y="17.5" width="45" height="45" rx="2" ry="2" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="32.5" x2="62.5" y2="32.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="47.5" x2="62.5" y2="47.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><g><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g>')},disk:{body:pe('<rect x="20" y="15" width="40" height="50" rx="1" ry="1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="14" ry="14.58" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="4" ry="4.17" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m37.51,42.52l-4.83,13.22c-.26.71-1.1,1.02-1.76.64l-4.18-2.42c-.66-.38-.81-1.26-.33-1.84l9.01-10.8c.88-1.05,2.56-.08,2.09,1.2Z" style="fill: #fff; stroke-width: 0px;"/>')},internet:{body:pe('<circle cx="40" cy="40" r="22.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="40" y1="17.5" x2="40" y2="62.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="40" x2="62.5" y2="40" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m39.99,17.51c-15.28,11.1-15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m40.01,17.51c15.28,11.1,15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="30.1" x2="60.25" y2="30.1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="49.9" x2="60.25" y2="49.9" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},cloud:{body:pe('<path d="m65,47.5c0,2.76-2.24,5-5,5H20c-2.76,0-5-2.24-5-5,0-1.87,1.03-3.51,2.56-4.36-.04-.21-.06-.42-.06-.64,0-2.6,2.48-4.74,5.65-4.97,1.65-4.51,6.34-7.76,11.85-7.76.86,0,1.69.08,2.5.23,2.09-1.57,4.69-2.5,7.5-2.5,6.1,0,11.19,4.38,12.28,10.17,2.14.56,3.72,2.51,3.72,4.83,0,.03,0,.07-.01.1,2.29.46,4.01,2.48,4.01,4.9Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},unknown:zf,blank:{body:pe("")}}},Nr=t(async function(w,I,A,v){let f=A.getConfigField("padding"),o=A.getConfigField("iconSize"),n=o/2,a=o/6,u=a/2;await Promise.all(I.edges().map(async(r)=>{let{source:y,sourceDir:i,sourceArrow:e,sourceGroup:g,target:d,targetDir:c,targetArrow:O,targetGroup:T,label:N}=Qe(r),{x:D,y:X}=r[0].sourceEndpoint(),{x,y:W}=r[0].midpoint(),{x:_,y:Q}=r[0].targetEndpoint(),lt=f+4;if(g)if(_t(i))D+=i==="L"?-lt:lt;else X+=i==="T"?-lt:lt+18;if(T)if(_t(c))_+=c==="L"?-lt:lt;else Q+=c==="T"?-lt:lt+18;if(!g&&A.getNode(y)?.type==="junction")if(_t(i))D+=i==="L"?n:-n;else X+=i==="T"?n:-n;if(!T&&A.getNode(d)?.type==="junction")if(_t(c))_+=c==="L"?n:-n;else Q+=c==="T"?n:-n;if(r[0]._private.rscratch){let G=w.insert("g");if(G.insert("path").attr("d",`M ${D},${X} L ${x},${W} L${_},${Q} `).attr("class","edge").attr("id",`${v}-${
|
|
32
|
+
`,"getStyles"),Tr=Er;function Ue(w,I){if(w===0)return I();let A=Math.random,v=w>>>0;Math.random=function(){v=v+1831565813>>>0;let f=v;return f=Math.imul(f^f>>>15,f|1),f^=f+Math.imul(f^f>>>7,f|61),((f^f>>>14)>>>0)/4294967296};try{return I()}finally{Math.random=A}}t(Ue,"withSeededRandom");var pe=t((w)=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${w}</g>`,"wrapIcon"),Ne={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:pe('<path id="b" data-name="4" d="m20,57.86c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="c" data-name="3" d="m20,45.95c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="d" data-name="2" d="m20,34.05c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse id="e" data-name="1" cx="40" cy="22.14" rx="20" ry="7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="20" y1="57.86" x2="20" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="60" y1="57.86" x2="60" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},server:{body:pe('<rect x="17.5" y="17.5" width="45" height="45" rx="2" ry="2" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="32.5" x2="62.5" y2="32.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="47.5" x2="62.5" y2="47.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><g><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g>')},disk:{body:pe('<rect x="20" y="15" width="40" height="50" rx="1" ry="1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="14" ry="14.58" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="4" ry="4.17" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m37.51,42.52l-4.83,13.22c-.26.71-1.1,1.02-1.76.64l-4.18-2.42c-.66-.38-.81-1.26-.33-1.84l9.01-10.8c.88-1.05,2.56-.08,2.09,1.2Z" style="fill: #fff; stroke-width: 0px;"/>')},internet:{body:pe('<circle cx="40" cy="40" r="22.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="40" y1="17.5" x2="40" y2="62.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="40" x2="62.5" y2="40" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m39.99,17.51c-15.28,11.1-15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m40.01,17.51c15.28,11.1,15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="30.1" x2="60.25" y2="30.1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="49.9" x2="60.25" y2="49.9" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},cloud:{body:pe('<path d="m65,47.5c0,2.76-2.24,5-5,5H20c-2.76,0-5-2.24-5-5,0-1.87,1.03-3.51,2.56-4.36-.04-.21-.06-.42-.06-.64,0-2.6,2.48-4.74,5.65-4.97,1.65-4.51,6.34-7.76,11.85-7.76.86,0,1.69.08,2.5.23,2.09-1.57,4.69-2.5,7.5-2.5,6.1,0,11.19,4.38,12.28,10.17,2.14.56,3.72,2.51,3.72,4.83,0,.03,0,.07-.01.1,2.29.46,4.01,2.48,4.01,4.9Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},unknown:zf,blank:{body:pe("")}}},Nr=t(async function(w,I,A,v){let f=A.getConfigField("padding"),o=A.getConfigField("iconSize"),n=o/2,a=o/6,u=a/2;await Promise.all(I.edges().map(async(r)=>{let{source:y,sourceDir:i,sourceArrow:e,sourceGroup:g,target:d,targetDir:c,targetArrow:O,targetGroup:T,label:N}=Qe(r),{x:D,y:X}=r[0].sourceEndpoint(),{x,y:W}=r[0].midpoint(),{x:_,y:Q}=r[0].targetEndpoint(),lt=f+4;if(g)if(_t(i))D+=i==="L"?-lt:lt;else X+=i==="T"?-lt:lt+18;if(T)if(_t(c))_+=c==="L"?-lt:lt;else Q+=c==="T"?-lt:lt+18;if(!g&&A.getNode(y)?.type==="junction")if(_t(i))D+=i==="L"?n:-n;else X+=i==="T"?n:-n;if(!T&&A.getNode(d)?.type==="junction")if(_t(c))_+=c==="L"?n:-n;else Q+=c==="T"?n:-n;if(r[0]._private.rscratch){let G=w.insert("g");if(G.insert("path").attr("d",`M ${D},${X} L ${x},${W} L${_},${Q} `).attr("class","edge").attr("id",`${v}-${Cn(y,d,{prefix:"L"})}`),e){let tt=_t(i)?we[i](D,a):D-u,s=he(i)?we[i](X,a):X-u;G.insert("polygon").attr("points",Ze[i](a)).attr("transform",`translate(${tt},${s})`).attr("class","arrow")}if(O){let tt=_t(c)?we[c](_,a):_-u,s=he(c)?we[c](Q,a):Q-u;G.insert("polygon").attr("points",Ze[c](a)).attr("transform",`translate(${tt},${s})`).attr("class","arrow")}if(N){let tt=!Ye(i,c)?_t(i)?"X":"Y":"XY",s=0;if(tt==="X")s=Math.abs(D-_);else if(tt==="Y")s=Math.abs(X-Q)/1.5;else s=Math.abs(D-_)/2;let L=G.append("g");if(await on(L,N,{useHtmlLabels:!1,width:s,classes:"architecture-service-label"},p()),L.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),tt==="X")L.attr("transform","translate("+x+", "+W+")");else if(tt==="Y")L.attr("transform","translate("+x+", "+W+") rotate(-90)");else if(tt==="XY"){let E=Ge(i,c);if(E&&fr(E)){let M=L.node().getBoundingClientRect(),[m,Y]=ur(E);L.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*m*Y*45})`);let b=L.node().getBoundingClientRect();L.attr("transform",`
|
|
33
33
|
translate(${x}, ${W-M.height/2})
|
|
34
34
|
translate(${m*b.width/2}, ${Y*b.height/2})
|
|
35
35
|
rotate(${-1*m*Y*45}, 0, ${M.height/2})
|
|
36
|
-
`)}}}}}))},"drawEdges"),Lr=t(async function(w,I,A,v){let o=A.getConfigField("padding")*0.75,n=A.getConfigField("fontSize"),u=A.getConfigField("iconSize")/2;await Promise.all(I.nodes().map(async(r)=>{let y=ye(r);if(y.type==="group"){let{h:i,w:e,x1:g,y1:d}=r.boundingBox(),c=w.append("rect");c.attr("id",`${v}-group-${y.id}`).attr("x",g+u).attr("y",d+u).attr("width",e).attr("height",i).attr("class","node-bkg");let O=w.append("g"),T=g,N=d;if(y.icon){let D=O.append("g");D.html(`<g>${await lr(y.icon,{height:o,width:o,fallbackPrefix:Ne.prefix})}</g>`),D.attr("transform","translate("+(T+u+1)+", "+(N+u+1)+")"),T+=o,N+=n/2-1-2}if(y.label){let D=O.append("g");await on(D,y.label,{useHtmlLabels:!1,width:e,classes:"architecture-service-label"},p()),D.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),D.attr("transform","translate("+(T+u+4)+", "+(N+u+2)+")")}A.setElementForId(y.id,c)}}))},"drawGroups"),wr=t(async function(w,I,A,v){let f=p();for(let o of A){let n=I.append("g"),a=w.getConfigField("iconSize");if(o.title){let i=n.append("g");await on(i,o.title,{useHtmlLabels:!1,width:a*1.5,classes:"architecture-service-label"},f),i.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),i.attr("transform","translate("+a/2+", "+a+")")}let u=n.append("g");if(o.icon)u.html(`<g>${await lr(o.icon,{height:a,width:a,fallbackPrefix:Ne.prefix})}</g>`);else if(o.iconText){u.html(`<g>${await lr("blank",{height:a,width:a,fallbackPrefix:Ne.prefix})}</g>`);let g=u.append("g").append("foreignObject").attr("width",a).attr("height",a).append("div").attr("class","node-icon-text").attr("style",`height: ${a}px;`).append("div").html(ee(o.iconText,f)),d=parseInt(window.getComputedStyle(g.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;g.attr("style",`-webkit-line-clamp: ${Math.floor((a-2)/d)};`)}else u.append("path").attr("class","node-bkg").attr("id",`${v}-node-${o.id}`).attr("d",`M0,${a} V5 Q0,0 5,0 H${a-5} Q${a},0 ${a},5 V${a} Z`);n.attr("id",`${v}-service-${o.id}`).attr("class","architecture-service");let{width:r,height:y}=n.node().getBBox();o.width=r,o.height=y,w.setElementForId(o.id,n)}return 0},"drawServices"),Mr=t(function(w,I,A,v){A.forEach((f)=>{let o=I.append("g"),n=w.getConfigField("iconSize");o.append("g").append("rect").attr("id",`${v}-node-${f.id}`).attr("fill-opacity","0").attr("width",n).attr("height",n),o.attr("class","architecture-junction");let{width:u,height:r}=o._groups[0][0].getBBox();o.width=u,o.height=r,w.setElementForId(f.id,o)})},"drawJunctions");Fi([{name:Ne.prefix,icons:Ne}]);Pr.use(je.default);function _e(w,I,A){w.forEach((v)=>{I.add({group:"nodes",data:{type:"service",id:v.id,icon:v.icon,label:v.title,parent:v.in,width:A.getConfigField("iconSize"),height:A.getConfigField("iconSize")},classes:"node-service"})})}t(_e,"addServices");function tr(w,I,A){w.forEach((v)=>{I.add({group:"nodes",data:{type:"junction",id:v.id,parent:v.in,width:A.getConfigField("iconSize"),height:A.getConfigField("iconSize")},classes:"node-junction"})})}t(tr,"addJunctions");function er(w,I){I.nodes().map((A)=>{let v=ye(A);if(v.type==="group")return;v.x=A.position().x,v.y=A.position().y,w.getElementById(v.id).attr("transform","translate("+(v.x||0)+","+(v.y||0)+")")})}t(er,"positionNodes");function rr(w,I){w.forEach((A)=>{I.add({group:"nodes",data:{type:"group",id:A.id,icon:A.icon,label:A.title,parent:A.in},classes:"node-group"})})}t(rr,"addGroups");function ir(w,I){w.forEach((A)=>{let{lhsId:v,rhsId:f,lhsInto:o,lhsGroup:n,rhsInto:a,lhsDir:u,rhsDir:r,rhsGroup:y,title:i}=A,e=Ye(A.lhsDir,A.rhsDir)?"segments":"straight",g={id:`${v}-${f}`,label:i,source:v,sourceDir:u,sourceArrow:o,sourceGroup:n,sourceEndpoint:u==="L"?"0 50%":u==="R"?"100% 50%":u==="T"?"50% 0":"50% 100%",target:f,targetDir:r,targetArrow:a,targetGroup:y,targetEndpoint:r==="L"?"0 50%":r==="R"?"100% 50%":r==="T"?"50% 0":"50% 100%"};I.add({group:"edges",data:g,classes:e})})}t(ir,"addEdges");function nr(w,I,A,v=[]){let f=t((e,g)=>{let d=new Map;for(let[c,O]of e.entries()){let T=`${c}`,N=0,D=[...O.entries()];if(D.length===1){d.set(T,D[0][1]);continue}for(let X=0;X<D.length-1;X++)for(let x=X+1;x<D.length;x++){let[W,_]=D[X],[Q,lt]=D[x];if(A.get(qe(W,Q))===g)d.set(T,[...d.get(T)??[],..._,...lt]);else if(W==="default"||Q==="default")d.set(T,[...d.get(T)??[],..._,...lt]);else{let tt=`${T}-${N++}`;d.set(tt,_);let s=`${T}-${N++}`;d.set(s,lt)}}}return d},"flattenAlignments"),o=I.map((e)=>{let g=new Map,d=new Map;return e.forEach(([c,O],T)=>{let N=w.getNode(T)?.in??"default",D=g.get(O)??new Map;if(!g.has(O))g.set(O,D);let X=d.get(c)??new Map;if(!d.has(c))d.set(c,X);for(let x of[D,X]){let W=x.get(N)??[];if(!x.has(N))x.set(N,W);W.push(T)}}),{horiz:[...f(g,"horizontal").values()].filter((c)=>c.length>1),vert:[...f(d,"vertical").values()].filter((c)=>c.length>1)}}),[n,a]=o.reduce(([e,g],{horiz:d,vert:c})=>[[...e,...d],[...g,...c]],[[],[]]),u=new Set;v.forEach((e)=>e.members.forEach((g)=>u.add(g)));let r=t((e)=>e.filter((g)=>!g.some((d)=>u.has(d))),"dropOverlapping"),y=r(n),i=r(a);return v.forEach((e)=>{if(e.members.length<2)return;if(e.direction==="row")y.push([...e.members]);else i.push([...e.members])}),{horizontal:y,vertical:i}}t(nr,"getAlignments");function ar(w,I,A=[]){let v=[],f=I.getConfigField("iconSize"),o=I.getConfigField("idealEdgeLengthMultiplier"),n=o*f,a=new Set;A.forEach((y)=>{for(let i=0;i<y.members.length-1;i++){let e=y.members[i],g=y.members[i+1];if(a.add(`${e}|${g}`),a.add(`${g}|${e}`),y.direction==="row")v.push({left:e,right:g,gap:n});else v.push({top:e,bottom:g,gap:n})}});let u=t((y)=>`${y[0]},${y[1]}`,"posToStr"),r=t((y)=>y.split(",").map((i)=>parseInt(i)),"strToPos");return w.forEach((y)=>{let i=new Map([...y.entries()].map(([c,O])=>[u(O),c])),e=[u([0,0])],g={},d={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};while(e.length>0){let c=e.shift();if(c){g[c]=1;let O=i.get(c);if(O){let T=r(c);Object.entries(d).forEach(([N,D])=>{let X=u([T[0]+D[0],T[1]+D[1]]),x=i.get(X);if(x&&!g[X]){if(e.push(X),a.has(`${O}|${x}`))return;v.push({[Be[N]]:x,[Be[hr(N)]]:O,gap:o*f})}})}}}}),v}t(ar,"getRelativeConstraints");function or(w,I,A,v,f,{spatialMaps:o,groupAlignments:n}){return new Promise((a)=>{let u=h("body").append("div").attr("id","cy").attr("style","display:none"),r=Pr({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge[label]",style:{label:"data(label)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[0.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${f.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${f.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});u.remove(),rr(A,r),_e(w,r,f),tr(I,r,f),ir(v,r);let y=f.getLayoutHints(),i=nr(f,o,n,y),e=ar(o,f,y),g=f.getConfigField("iconSize"),d=f.getConfigField("idealEdgeLengthMultiplier")*g,c=0.5*g,O=f.getConfigField("edgeElasticity"),T=f.getConfigField("seed"),N=r.layout({name:"fcose",quality:"proof",randomize:f.getConfigField("randomize"),nodeSeparation:f.getConfigField("nodeSeparation"),numIter:f.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(D){let[X,x]=D.connectedNodes(),{parent:W}=ye(X),{parent:_}=ye(x);return W===_?d:c},edgeElasticity(D){let[X,x]=D.connectedNodes(),{parent:W}=ye(X),{parent:_}=ye(x);return W===_?O:0.001},alignmentConstraint:i,relativePlacementConstraint:e});N.one("layoutstop",()=>{function D(X,x,W,_){let Q,lt,{x:G,y:tt}=X,{x:s,y:L}=x;lt=(_-tt+(G-W)*(tt-L)/(G-s))/Math.sqrt(1+Math.pow((tt-L)/(G-s),2)),Q=Math.sqrt(Math.pow(_-tt,2)+Math.pow(W-G,2)-Math.pow(lt,2));let E=Math.sqrt(Math.pow(s-G,2)+Math.pow(L-tt,2));Q=Q/E;let M=(s-G)*(_-tt)-(L-tt)*(W-G);switch(!0){case M>=0:M=1;break;case M<0:M=-1;break}let m=(s-G)*(W-G)+(L-tt)*(_-tt);switch(!0){case m>=0:m=1;break;case m<0:m=-1;break}return lt=Math.abs(lt)*M,Q=Q*m,{distances:lt,weights:Q}}t(D,"getSegmentWeights"),r.startBatch();for(let X of Object.values(r.edges()))if(X.data?.()){let{x,y:W}=X.source().position(),{x:_,y:Q}=X.target().position();if(x!==_&&W!==Q){let lt=X.sourceEndpoint(),G=X.targetEndpoint(),{sourceDir:tt}=Qe(X),[s,L]=he(tt)?[lt.x,G.y]:[G.x,lt.y],{weights:E,distances:M}=D(lt,G,s,L);X.style("segment-distances",M),X.style("segment-weights",E)}}r.endBatch(),Ue(T,()=>N.run())});try{Ue(T,()=>N.run())}catch(D){if(D instanceof RangeError&&D.message.includes("Invalid array length"))throw Error("Architecture layout failed: a declared `align row|column` directive likely contradicts the edge directions, or two declared alignments overlap on a shared node. Check that the order of members in each `align` chain is consistent with the edges between them, and that no node appears in two `align` directives along the same axis.");throw D}r.ready((D)=>{l.info("Ready",D),a(r)})})}t(or,"layoutArchitecture");var Cr=t(async(w,I,A,v)=>{let f=v.db;f.setDiagramId(I);let o=f.getServices(),n=f.getJunctions(),a=f.getGroups(),u=f.getEdges(),r=f.getDataStructures(),y=ue(I),i=y.append("g");i.attr("class","architecture-edges");let e=y.append("g");e.attr("class","architecture-services");let g=y.append("g");g.attr("class","architecture-groups"),await wr(f,e,o,I),Mr(f,e,n,I);let d=await or(o,n,a,u,f,r);await Nr(i,d,f,I),await Lr(g,d,f,I),er(f,d),$r(void 0,y,f.getConfigField("padding"),f.getConfigField("useMaxWidth"))},"draw"),Ar={draw:Cr},Xr={parser:Ke,get db(){return new Je},renderer:Ar,styles:Tr};export{Xr as diagram};
|
|
36
|
+
`)}}}}}))},"drawEdges"),Lr=t(async function(w,I,A,v){let o=A.getConfigField("padding")*0.75,n=A.getConfigField("fontSize"),u=A.getConfigField("iconSize")/2;await Promise.all(I.nodes().map(async(r)=>{let y=ye(r);if(y.type==="group"){let{h:i,w:e,x1:g,y1:d}=r.boundingBox(),c=w.append("rect");c.attr("id",`${v}-group-${y.id}`).attr("x",g+u).attr("y",d+u).attr("width",e).attr("height",i).attr("class","node-bkg");let O=w.append("g"),T=g,N=d;if(y.icon){let D=O.append("g");D.html(`<g>${await lr(y.icon,{height:o,width:o,fallbackPrefix:Ne.prefix})}</g>`),D.attr("transform","translate("+(T+u+1)+", "+(N+u+1)+")"),T+=o,N+=n/2-1-2}if(y.label){let D=O.append("g");await on(D,y.label,{useHtmlLabels:!1,width:e,classes:"architecture-service-label"},p()),D.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),D.attr("transform","translate("+(T+u+4)+", "+(N+u+2)+")")}A.setElementForId(y.id,c)}}))},"drawGroups"),wr=t(async function(w,I,A,v){let f=p();for(let o of A){let n=I.append("g"),a=w.getConfigField("iconSize");if(o.title){let i=n.append("g");await on(i,o.title,{useHtmlLabels:!1,width:a*1.5,classes:"architecture-service-label"},f),i.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),i.attr("transform","translate("+a/2+", "+a+")")}let u=n.append("g");if(o.icon)u.html(`<g>${await lr(o.icon,{height:a,width:a,fallbackPrefix:Ne.prefix})}</g>`);else if(o.iconText){u.html(`<g>${await lr("blank",{height:a,width:a,fallbackPrefix:Ne.prefix})}</g>`);let g=u.append("g").append("foreignObject").attr("width",a).attr("height",a).append("div").attr("class","node-icon-text").attr("style",`height: ${a}px;`).append("div").html(ee(o.iconText,f)),d=parseInt(window.getComputedStyle(g.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;g.attr("style",`-webkit-line-clamp: ${Math.floor((a-2)/d)};`)}else u.append("path").attr("class","node-bkg").attr("id",`${v}-node-${o.id}`).attr("d",`M0,${a} V5 Q0,0 5,0 H${a-5} Q${a},0 ${a},5 V${a} Z`);n.attr("id",`${v}-service-${o.id}`).attr("class","architecture-service");let{width:r,height:y}=n.node().getBBox();o.width=r,o.height=y,w.setElementForId(o.id,n)}return 0},"drawServices"),Mr=t(function(w,I,A,v){A.forEach((f)=>{let o=I.append("g"),n=w.getConfigField("iconSize");o.append("g").append("rect").attr("id",`${v}-node-${f.id}`).attr("fill-opacity","0").attr("width",n).attr("height",n),o.attr("class","architecture-junction");let{width:u,height:r}=o._groups[0][0].getBBox();o.width=u,o.height=r,w.setElementForId(f.id,o)})},"drawJunctions");Fi([{name:Ne.prefix,icons:Ne}]);Pr.use(je.default);function _e(w,I,A){w.forEach((v)=>{I.add({group:"nodes",data:{type:"service",id:v.id,icon:v.icon,label:v.title,parent:v.in,width:A.getConfigField("iconSize"),height:A.getConfigField("iconSize")},classes:"node-service"})})}t(_e,"addServices");function tr(w,I,A){w.forEach((v)=>{I.add({group:"nodes",data:{type:"junction",id:v.id,parent:v.in,width:A.getConfigField("iconSize"),height:A.getConfigField("iconSize")},classes:"node-junction"})})}t(tr,"addJunctions");function er(w,I){I.nodes().map((A)=>{let v=ye(A);if(v.type==="group")return;v.x=A.position().x,v.y=A.position().y,w.getElementById(v.id).attr("transform","translate("+(v.x||0)+","+(v.y||0)+")")})}t(er,"positionNodes");function rr(w,I){w.forEach((A)=>{I.add({group:"nodes",data:{type:"group",id:A.id,icon:A.icon,label:A.title,parent:A.in},classes:"node-group"})})}t(rr,"addGroups");function ir(w,I){w.forEach((A)=>{let{lhsId:v,rhsId:f,lhsInto:o,lhsGroup:n,rhsInto:a,lhsDir:u,rhsDir:r,rhsGroup:y,title:i}=A,e=Ye(A.lhsDir,A.rhsDir)?"segments":"straight",g={id:`${v}-${f}`,label:i,source:v,sourceDir:u,sourceArrow:o,sourceGroup:n,sourceEndpoint:u==="L"?"0 50%":u==="R"?"100% 50%":u==="T"?"50% 0":"50% 100%",target:f,targetDir:r,targetArrow:a,targetGroup:y,targetEndpoint:r==="L"?"0 50%":r==="R"?"100% 50%":r==="T"?"50% 0":"50% 100%"};I.add({group:"edges",data:g,classes:e})})}t(ir,"addEdges");function nr(w,I,A,v=[]){let f=t((e,g)=>{let d=new Map;for(let[c,O]of e.entries()){let T=`${c}`,N=0,D=[...O.entries()];if(D.length===1){d.set(T,D[0][1]);continue}for(let X=0;X<D.length-1;X++)for(let x=X+1;x<D.length;x++){let[W,_]=D[X],[Q,lt]=D[x];if(A.get(qe(W,Q))===g)d.set(T,[...d.get(T)??[],..._,...lt]);else if(W==="default"||Q==="default")d.set(T,[...d.get(T)??[],..._,...lt]);else{let tt=`${T}-${N++}`;d.set(tt,_);let s=`${T}-${N++}`;d.set(s,lt)}}}return d},"flattenAlignments"),o=I.map((e)=>{let g=new Map,d=new Map;return e.forEach(([c,O],T)=>{let N=w.getNode(T)?.in??"default",D=g.get(O)??new Map;if(!g.has(O))g.set(O,D);let X=d.get(c)??new Map;if(!d.has(c))d.set(c,X);for(let x of[D,X]){let W=x.get(N)??[];if(!x.has(N))x.set(N,W);W.push(T)}}),{horiz:[...f(g,"horizontal").values()].filter((c)=>c.length>1),vert:[...f(d,"vertical").values()].filter((c)=>c.length>1)}}),[n,a]=o.reduce(([e,g],{horiz:d,vert:c})=>[[...e,...d],[...g,...c]],[[],[]]),u=new Set;v.forEach((e)=>e.members.forEach((g)=>u.add(g)));let r=t((e)=>e.filter((g)=>!g.some((d)=>u.has(d))),"dropOverlapping"),y=r(n),i=r(a);return v.forEach((e)=>{if(e.members.length<2)return;if(e.direction==="row")y.push([...e.members]);else i.push([...e.members])}),{horizontal:y,vertical:i}}t(nr,"getAlignments");function ar(w,I,A=[]){let v=[],f=I.getConfigField("iconSize"),o=I.getConfigField("idealEdgeLengthMultiplier"),n=o*f,a=new Set;A.forEach((y)=>{for(let i=0;i<y.members.length-1;i++){let e=y.members[i],g=y.members[i+1];if(a.add(`${e}|${g}`),a.add(`${g}|${e}`),y.direction==="row")v.push({left:e,right:g,gap:n});else v.push({top:e,bottom:g,gap:n})}});let u=t((y)=>`${y[0]},${y[1]}`,"posToStr"),r=t((y)=>y.split(",").map((i)=>parseInt(i)),"strToPos");return w.forEach((y)=>{let i=new Map([...y.entries()].map(([c,O])=>[u(O),c])),e=[u([0,0])],g={},d={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};while(e.length>0){let c=e.shift();if(c){g[c]=1;let O=i.get(c);if(O){let T=r(c);Object.entries(d).forEach(([N,D])=>{let X=u([T[0]+D[0],T[1]+D[1]]),x=i.get(X);if(x&&!g[X]){if(e.push(X),a.has(`${O}|${x}`))return;v.push({[Be[N]]:x,[Be[hr(N)]]:O,gap:o*f})}})}}}}),v}t(ar,"getRelativeConstraints");function or(w,I,A,v,f,{spatialMaps:o,groupAlignments:n}){return new Promise((a)=>{let u=h("body").append("div").attr("id","cy").attr("style","display:none"),r=Pr({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge[label]",style:{label:"data(label)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[0.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${f.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${f.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});u.remove(),rr(A,r),_e(w,r,f),tr(I,r,f),ir(v,r);let y=f.getLayoutHints(),i=nr(f,o,n,y),e=ar(o,f,y),g=f.getConfigField("iconSize"),d=f.getConfigField("idealEdgeLengthMultiplier")*g,c=0.5*g,O=f.getConfigField("edgeElasticity"),T=f.getConfigField("seed"),N=r.layout({name:"fcose",quality:"proof",randomize:f.getConfigField("randomize"),nodeSeparation:f.getConfigField("nodeSeparation"),numIter:f.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(D){let[X,x]=D.connectedNodes(),{parent:W}=ye(X),{parent:_}=ye(x);return W===_?d:c},edgeElasticity(D){let[X,x]=D.connectedNodes(),{parent:W}=ye(X),{parent:_}=ye(x);return W===_?O:0.001},alignmentConstraint:i,relativePlacementConstraint:e});N.one("layoutstop",()=>{function D(X,x,W,_){let Q,lt,{x:G,y:tt}=X,{x:s,y:L}=x;lt=(_-tt+(G-W)*(tt-L)/(G-s))/Math.sqrt(1+Math.pow((tt-L)/(G-s),2)),Q=Math.sqrt(Math.pow(_-tt,2)+Math.pow(W-G,2)-Math.pow(lt,2));let E=Math.sqrt(Math.pow(s-G,2)+Math.pow(L-tt,2));Q=Q/E;let M=(s-G)*(_-tt)-(L-tt)*(W-G);switch(!0){case M>=0:M=1;break;case M<0:M=-1;break}let m=(s-G)*(W-G)+(L-tt)*(_-tt);switch(!0){case m>=0:m=1;break;case m<0:m=-1;break}return lt=Math.abs(lt)*M,Q=Q*m,{distances:lt,weights:Q}}t(D,"getSegmentWeights"),r.startBatch();for(let X of Object.values(r.edges()))if(X.data?.()){let{x,y:W}=X.source().position(),{x:_,y:Q}=X.target().position();if(x!==_&&W!==Q){let lt=X.sourceEndpoint(),G=X.targetEndpoint(),{sourceDir:tt}=Qe(X),[s,L]=he(tt)?[lt.x,G.y]:[G.x,lt.y],{weights:E,distances:M}=D(lt,G,s,L);X.style("segment-distances",M),X.style("segment-weights",E)}}r.endBatch(),Ue(T,()=>N.run())});try{Ue(T,()=>N.run())}catch(D){if(D instanceof RangeError&&D.message.includes("Invalid array length"))throw Error("Architecture layout failed: a declared `align row|column` directive likely contradicts the edge directions, or two declared alignments overlap on a shared node. Check that the order of members in each `align` chain is consistent with the edges between them, and that no node appears in two `align` directives along the same axis.");throw D}r.ready((D)=>{l.info("Ready",D),a(r)})})}t(or,"layoutArchitecture");var Cr=t(async(w,I,A,v)=>{let f=v.db;f.setDiagramId(I);let o=f.getServices(),n=f.getJunctions(),a=f.getGroups(),u=f.getEdges(),r=f.getDataStructures(),y=de(I),i=y.append("g");i.attr("class","architecture-edges");let e=y.append("g");e.attr("class","architecture-services");let g=y.append("g");g.attr("class","architecture-groups"),await wr(f,e,o,I),Mr(f,e,n,I);let d=await or(o,n,a,u,f,r);await Nr(i,d,f,I),await Lr(g,d,f,I),er(f,d),$r(void 0,y,f.getConfigField("padding"),f.getConfigField("useMaxWidth"))},"draw"),Ar={draw:Cr},Xr={parser:Ke,get db(){return new Je},renderer:Ar,styles:Tr};export{Xr as diagram};
|