omni-context-cli 0.0.91 → 0.0.93

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/README.md +4 -3
  2. package/README.zh-CN.md +4 -3
  3. package/dist/cli.js +7 -7
  4. package/dist/clients/extension.vsix +0 -0
  5. package/dist/clients/web/assets/App-CBmFCdgC.css +1 -0
  6. package/dist/clients/web/assets/App-CM8Va3JQ.js +2 -0
  7. package/dist/clients/web/assets/ImageWorkshop-D0woOaMP.js +1 -0
  8. package/dist/clients/web/assets/_baseUniq-8ZoXEUbL.js +1 -0
  9. package/dist/clients/web/assets/arc-B2TpLZAc.js +1 -0
  10. package/dist/clients/web/assets/architectureDiagram-VXUJARFQ-sCw1Bqxj.js +1 -0
  11. package/dist/clients/web/assets/blockDiagram-VD42YOAC-TzLCV8cu.js +1 -0
  12. package/dist/clients/web/assets/c4Diagram-YG6GDRKO-CB75g8mk.js +1 -0
  13. package/dist/clients/web/assets/channel-Cc6WLpkH.js +1 -0
  14. package/dist/clients/web/assets/chunk-4BX2VUAB-CnCH9PHV.js +1 -0
  15. package/dist/clients/web/assets/chunk-55IACEB6-j6kgk2Ub.js +1 -0
  16. package/dist/clients/web/assets/chunk-B4BG7PRW-CU5TkBMe.js +1 -0
  17. package/dist/clients/web/assets/chunk-DI55MBZ5-B9PNM453.js +1 -0
  18. package/dist/clients/web/assets/chunk-FMBD7UC4-ubTGnudB.js +1 -0
  19. package/dist/clients/web/assets/chunk-QN33PNHL-D5no8Jfp.js +1 -0
  20. package/dist/clients/web/assets/chunk-QZHKN3VN-RIiVnjQx.js +1 -0
  21. package/dist/clients/web/assets/chunk-TZMSLE5B-DTy2vR2B.js +1 -0
  22. package/dist/clients/web/assets/classDiagram-2ON5EDUG-8oZ_o2z8.js +1 -0
  23. package/dist/clients/web/assets/classDiagram-v2-WZHVMYZB-8oZ_o2z8.js +1 -0
  24. package/dist/clients/web/assets/clone-Z2wHm8pw.js +1 -0
  25. package/dist/clients/web/assets/cose-bilkent-S5V4N54A-Bqct6Lvl.js +1 -0
  26. package/dist/clients/web/assets/dagre-6UL2VRFP-441VQkK1.js +1 -0
  27. package/dist/clients/web/assets/diagram-PSM6KHXK-BO9H2Aak.js +1 -0
  28. package/dist/clients/web/assets/diagram-QEK2KX5R-3lGBBCVw.js +1 -0
  29. package/dist/clients/web/assets/diagram-S2PKOQOG-DY84HL8G.js +1 -0
  30. package/dist/clients/web/assets/erDiagram-Q2GNP2WA-DWcgMtNO.js +1 -0
  31. package/dist/clients/web/assets/flowDiagram-NV44I4VS-Ybex1wXj.js +1 -0
  32. package/dist/clients/web/assets/ganttDiagram-JELNMOA3-ChWIAt1T.js +1 -0
  33. package/dist/clients/web/assets/gitGraphDiagram-NY62KEGX-ClJFv0ul.js +1 -0
  34. package/dist/clients/web/assets/graph-Cs6Qxtax.js +1 -0
  35. package/dist/clients/web/assets/index-DPbcKIIg.js +2 -0
  36. package/dist/clients/web/assets/index-Fz55nSNP.css +1 -0
  37. package/dist/clients/web/assets/infoDiagram-WHAUD3N6-DnTUhHY0.js +1 -0
  38. package/dist/clients/web/assets/journeyDiagram-XKPGCS4Q-CIENPsGT.js +1 -0
  39. package/dist/clients/web/assets/kanban-definition-3W4ZIXB7-AhFkjsY3.js +1 -0
  40. package/dist/clients/web/assets/layout-BntZLQYy.js +1 -0
  41. package/dist/clients/web/assets/linear-CbNyjCBb.js +1 -0
  42. package/dist/clients/web/assets/min-1nUrt3JX.js +1 -0
  43. package/dist/clients/web/assets/mindmap-definition-VGOIOE7T-Cs3o7Dfz.js +1 -0
  44. package/dist/clients/web/assets/pieDiagram-ADFJNKIX-yQPBfZ8y.js +1 -0
  45. package/dist/clients/web/assets/quadrantDiagram-AYHSOK5B-5kPfWslR.js +1 -0
  46. package/dist/clients/web/assets/requirementDiagram-UZGBJVZJ-DoucrOtZ.js +1 -0
  47. package/dist/clients/web/assets/sankeyDiagram-TZEHDZUN-PTFbpc-u.js +1 -0
  48. package/dist/clients/web/assets/sequenceDiagram-WL72ISMW-BZ33cKfm.js +1 -0
  49. package/dist/clients/web/assets/stateDiagram-FKZM4ZOC-C4idf-WB.js +1 -0
  50. package/dist/clients/web/assets/stateDiagram-v2-4FDKWEC3-B-b2Duqy.js +1 -0
  51. package/dist/clients/web/assets/timeline-definition-IT6M3QCI-P1su699P.js +1 -0
  52. package/dist/clients/web/assets/treemap-KMMF4GRG-BmD_DFh3.js +1 -0
  53. package/dist/clients/web/assets/useAppearance-PXtz8423.js +1 -0
  54. package/dist/clients/web/assets/xychartDiagram-PRI3JC2R-DtIpn1yU.js +1 -0
  55. package/dist/clients/web/index.html +2 -2
  56. package/dist/model-prompts/gpt-5.5.md +5 -0
  57. package/package.json +1 -1
  58. package/dist/clients/web/assets/_baseUniq-BDYH-qGs.js +0 -1
  59. package/dist/clients/web/assets/arc-BgRuELYn.js +0 -1
  60. package/dist/clients/web/assets/architectureDiagram-VXUJARFQ-Cex2_41d.js +0 -1
  61. package/dist/clients/web/assets/blockDiagram-VD42YOAC-DBvUs0rU.js +0 -1
  62. package/dist/clients/web/assets/c4Diagram-YG6GDRKO-CJd_7YxK.js +0 -1
  63. package/dist/clients/web/assets/channel-CkOdBXrJ.js +0 -1
  64. package/dist/clients/web/assets/chunk-4BX2VUAB-CjAiz39p.js +0 -1
  65. package/dist/clients/web/assets/chunk-55IACEB6-BIADemBk.js +0 -1
  66. package/dist/clients/web/assets/chunk-B4BG7PRW-CdZvue6N.js +0 -1
  67. package/dist/clients/web/assets/chunk-DI55MBZ5-CtPcG11Q.js +0 -1
  68. package/dist/clients/web/assets/chunk-FMBD7UC4-CnT2icSo.js +0 -1
  69. package/dist/clients/web/assets/chunk-QN33PNHL-BPPz_1GB.js +0 -1
  70. package/dist/clients/web/assets/chunk-QZHKN3VN-CQUazhia.js +0 -1
  71. package/dist/clients/web/assets/chunk-TZMSLE5B-Cus0DJbS.js +0 -1
  72. package/dist/clients/web/assets/classDiagram-2ON5EDUG-B9YA_U4r.js +0 -1
  73. package/dist/clients/web/assets/classDiagram-v2-WZHVMYZB-B9YA_U4r.js +0 -1
  74. package/dist/clients/web/assets/clone-DEP9HaYN.js +0 -1
  75. package/dist/clients/web/assets/cose-bilkent-S5V4N54A-CDuuAfej.js +0 -1
  76. package/dist/clients/web/assets/dagre-6UL2VRFP-DBYvwMNJ.js +0 -1
  77. package/dist/clients/web/assets/diagram-PSM6KHXK-DmDHxKDU.js +0 -1
  78. package/dist/clients/web/assets/diagram-QEK2KX5R-CPCj5LYE.js +0 -1
  79. package/dist/clients/web/assets/diagram-S2PKOQOG-dKlW9LCp.js +0 -1
  80. package/dist/clients/web/assets/erDiagram-Q2GNP2WA-DXs4DL87.js +0 -1
  81. package/dist/clients/web/assets/flowDiagram-NV44I4VS-DyZigpkG.js +0 -1
  82. package/dist/clients/web/assets/ganttDiagram-JELNMOA3-ByonKtsF.js +0 -1
  83. package/dist/clients/web/assets/gitGraphDiagram-NY62KEGX-mdwsZDab.js +0 -1
  84. package/dist/clients/web/assets/graph-D3YdmkIz.js +0 -1
  85. package/dist/clients/web/assets/index-5mQ2UgiF.css +0 -1
  86. package/dist/clients/web/assets/index-C5d-CFGb.js +0 -2
  87. package/dist/clients/web/assets/infoDiagram-WHAUD3N6-D53YsuXV.js +0 -1
  88. package/dist/clients/web/assets/journeyDiagram-XKPGCS4Q-Dei_Z_bl.js +0 -1
  89. package/dist/clients/web/assets/kanban-definition-3W4ZIXB7-jUOZB7H6.js +0 -1
  90. package/dist/clients/web/assets/layout-odJhx1DE.js +0 -1
  91. package/dist/clients/web/assets/linear-4xiWbSPB.js +0 -1
  92. package/dist/clients/web/assets/min-Cvpawy_w.js +0 -1
  93. package/dist/clients/web/assets/mindmap-definition-VGOIOE7T-DEJbXPh3.js +0 -1
  94. package/dist/clients/web/assets/pieDiagram-ADFJNKIX-BgKrZrMs.js +0 -1
  95. package/dist/clients/web/assets/quadrantDiagram-AYHSOK5B-D_pD0WZC.js +0 -1
  96. package/dist/clients/web/assets/requirementDiagram-UZGBJVZJ-BNsHrc92.js +0 -1
  97. package/dist/clients/web/assets/sankeyDiagram-TZEHDZUN-BY0pyb4k.js +0 -1
  98. package/dist/clients/web/assets/sequenceDiagram-WL72ISMW-BfMDa1rw.js +0 -1
  99. package/dist/clients/web/assets/stateDiagram-FKZM4ZOC-BRWg7fz9.js +0 -1
  100. package/dist/clients/web/assets/stateDiagram-v2-4FDKWEC3-DizPjxtQ.js +0 -1
  101. package/dist/clients/web/assets/timeline-definition-IT6M3QCI-CLH3bcF4.js +0 -1
  102. package/dist/clients/web/assets/treemap-KMMF4GRG-CS9j6H9_.js +0 -1
  103. package/dist/clients/web/assets/xychartDiagram-PRI3JC2R-CrvAORqu.js +0 -1
@@ -0,0 +1 @@
1
+ import{R as e,r as t,j as o,e as r,d as n}from"./index-DPbcKIIg.js";const c=t=>e.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M6 2h12v2H6zm0 18h12v2H6zM2 6h2v12H2zm18 0h2v12h-2zm-2-2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2H8zm-2 2h2v2H6zm12 2h2v2h-2zM4 4h2v2H4zm0 14h2v2H4z"})),i=t=>e.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10 18H8v-2h2v2Zm-2-2H6v-2h2v2Zm4-2v2h-2v-2h2Zm-6 0H4v-2h2v2Zm8 0h-2v-2h2v2Zm2-2h-2v-2h2v2Zm2-2h-2V8h2v2Zm2-2h-2V6h2v2Z"})),s=t=>e.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M13 16h-2v-2h2v2Zm-2-2H9v-2h2v2Zm4 0h-2v-2h2v2Zm-6-2H7v-2h2v2Zm8 0h-2v-2h2v2ZM7 10H5V8h2v2Zm12 0h-2V8h2v2Z"})),h=t=>e.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M8 6h12v2H8zM4 2h12v2H4zm2 6h2v12H6zM2 4h2v12H2zm6 16h12v2H8zM20 8h2v12h-2zm-4-4h2v2h-2zM4 16h2v2H4z"})),a=t=>e.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zm-4 8h2v2h-2zm-2 2h2v2h-2zm4 0h2v2h-2zm-8 0h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2z"}),e.createElement("path",{d:"M20 16h2v2h-2zM8 16h2v2H8zm-2 2h2v2H6zM8 6h2v2H8zM6 8h2v2H6zm2 2h2v2H8zm2-2h2v2h-2z"})),l=t=>e.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M13 22h-2v-6h2v6Zm-6-3H5v-2h2v2Zm12 0h-2v-2h2v2ZM9 17H7v-2h2v2Zm8 0h-2v-2h2v2Zm-9-4H2v-2h6v2Zm14 0h-6v-2h6v2ZM9 9H7V7h2v2Zm8 0h-2V7h2v2Zm-4-1h-2V2h2v6ZM7 7H5V5h2v2Zm12 0h-2V5h2v2Z"})),d=t=>e.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M13 11h7v2h-7v7h-2v-7H4v-2h7V4h2v7Z"})),v=t=>e.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M16 4h2v6h-2zm-2-2h2v2h-2zm0 2h2v8h-2zM4 8H2v5h2z"}),e.createElement("path",{d:"M4 6h16v2H4zm4 14H6v-6h2zm2 2H8v-2h2zm0-2H8v-8h2zm10-4h2v-5h-2z"}),e.createElement("path",{d:"M20 18H4v-2h16z"})),m=t=>e.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M2 10h2v2H2zm0 4h2v-2H2zm20-4h-2v2h2zm0 4h-2v-2h2zM4 8h2v2H4zm0 8h2v-2H4zm16-8h-2v2h2zm0 8h-2v-2h2zM6 6h2v2H6zm0 12h2v-2H6zM18 6h-2v2h2zm0 12h-2v-2h2zM8 4h2v2H8zm0 16h2v-2H8zm8-16h-2v2h2zm0 16h-2v-2h2zM10 2h2v2h-2zm0 20h2v-2h-2zm4-20h-2v2h2zm0 20h-2v-2h2zm-3-5h2v-2h-2zm0-4h2V7h-2z"})),g=t.memo(function({icon:e,title:t,onClick:r,disabled:n=!1,className:c=""}){return o.jsx("button",{type:"button",onClick:r,disabled:n,className:`p-2.5 transition-all duration-200 shrink-0 border border-transparent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-vscode-accent ${n?"text-vscode-text-muted cursor-not-allowed opacity-50":"text-vscode-text-muted hover:text-vscode-text hover:bg-vscode-element cursor-pointer"} ${c}`,title:t,children:o.jsx(e,{width:16,height:16})})});let f=0;const w=r(e=>({toasts:[],dismiss:t=>e(e=>({toasts:e.toasts.filter(e=>e.id!==t)}))}));function b(e,t="info"){const o=f++;w.setState(r=>({toasts:[...r.toasts,{id:o,message:e,type:t}]}))}const u={info:t=>e.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zm-9 5h2V7h-2zm0 8h2v-6h-2z"})),success:i,error:m},x={info:"bg-vscode-sidebar border-vscode-border text-vscode-text",success:"bg-vscode-sidebar border-vscode-info/70 text-vscode-text",error:"bg-vscode-sidebar border-vscode-error/70 text-vscode-text"};function p({toast:e,onDismiss:r}){const n=u[e.type];return t.useEffect(()=>{if("error"!==e.type){const t=setTimeout(()=>r(e.id),3e3);return()=>clearTimeout(t)}},[r,e.id,e.type]),o.jsxs("div",{className:`flex items-center gap-3 pl-4 pr-2 py-2.5 border border-dashed animate-fade-in ${x[e.type]}`,children:[o.jsx(n,{width:16,height:16,className:"shrink-0"}),o.jsx("span",{className:"text-sm flex-1 min-w-0 break-words",children:e.message}),o.jsx("button",{type:"button","aria-label":"Dismiss toast",onClick:()=>r(e.id),className:"p-1 hover:bg-white/10 opacity-75 hover:opacity-100 transition-opacity",children:o.jsx(c,{width:14,height:14})})]})}function z(){const{toasts:e,dismiss:t}=w();return 0===e.length?null:o.jsx("div",{className:"fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-50 flex flex-col gap-2 max-w-lg w-full px-4",children:e.map(e=>o.jsx(p,{toast:e,onDismiss:t},e.id))})}function H({icon:e,title:r,sessions:n,currentId:c,emptyText:i,newTitle:h,onSelect:a,onNew:l,disabled:v=!1}){const[m,g]=t.useState(!1),f=t.useRef(null);return t.useEffect(()=>{const e=e=>{f.current&&!f.current.contains(e.target)&&g(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),o.jsxs("div",{className:"flex items-center gap-2 w-full",ref:f,children:[o.jsxs("div",{className:"relative flex-1 min-w-0",children:[o.jsxs("button",{type:"button",onClick:()=>!v&&g(e=>!e),disabled:v,className:"group w-full flex items-center gap-2 px-3 py-2 transition-all duration-200 border border-dashed border-vscode-border bg-vscode-sidebar focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-vscode-accent "+(v?"opacity-50 cursor-not-allowed":"hover:bg-vscode-element hover:border-vscode-border-active cursor-pointer"),children:[o.jsx(e,{width:16,height:16,className:"text-vscode-accent shrink-0"}),o.jsx("span",{className:"truncate text-sm font-medium text-vscode-text group-hover:text-vscode-text-header transition-colors",children:r}),o.jsx(s,{width:14,height:14,className:"text-vscode-text-muted transition-transform duration-200 shrink-0 ml-auto "+(m?"rotate-180":"")})]}),m&&o.jsx("div",{className:"absolute top-full left-0 z-50 w-full mt-2 bg-vscode-sidebar border border-dashed border-vscode-border overflow-hidden animate-fade-in",children:0===n.length?o.jsx("div",{className:"px-4 py-3 text-sm text-vscode-text-muted text-center",children:i}):o.jsx("ul",{className:"max-h-80 overflow-y-auto py-1",children:n.map(e=>o.jsx("li",{children:o.jsxs("button",{type:"button",onClick:()=>{a(e),g(!1)},className:"w-full text-left px-4 py-2.5 text-sm transition-colors border-l-2 cursor-pointer focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-vscode-accent "+(e.id===c?"border-vscode-accent bg-vscode-accent/10 text-vscode-text-header":"border-transparent text-vscode-text hover:bg-vscode-element hover:text-vscode-text-header"),children:[o.jsx("div",{className:"truncate",children:e.title}),o.jsx("div",{className:"text-xs text-vscode-text-muted mt-0.5 font-mono",children:new Date(e.updatedAt).toLocaleDateString()})]})},e.id))})})]}),o.jsx("button",{type:"button",onClick:()=>{l(),g(!1)},disabled:v,className:"p-2.5 bg-vscode-element hover:brightness-110 text-vscode-text-header transition-all shrink-0 border border-dashed border-vscode-border hover:border-vscode-border-active focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-vscode-accent "+(v?"opacity-50 cursor-not-allowed":"cursor-pointer"),title:h,children:o.jsx(d,{width:16,height:16})})]})}const M={crystal:{accent:"#4fc4cf",info:"#5cd0d8",warning:"#fbdd74",error:"#e86060",light:{accent:"#0e8a95",info:"#0e8a95",warning:"#b89800",error:"#cc0000"}},splash:{accent:"#00ebc7",info:"#00ebc7",warning:"#fde24f",error:"#ff5470",light:{accent:"#009080",info:"#009080",warning:"#b89800",error:"#cc0000"}},horizon:{accent:"#3da9fc",info:"#60c0a0",warning:"#e8c060",error:"#ef4565",light:{accent:"#2878c0",info:"#308060",warning:"#b89800",error:"#cc0000"}},neon:{accent:"#7f5af0",info:"#2cb67d",warning:"#e8c060",error:"#e45858",light:{accent:"#6040c0",info:"#1a8050",warning:"#b89800",error:"#cc0000"}},forest:{accent:"#faae2b",info:"#5cb88c",warning:"#f5d070",error:"#fa5246",light:{accent:"#b07810",info:"#308060",warning:"#b89800",error:"#cc0000"}},indigo:{accent:"#6246ea",info:"#8888ef",warning:"#e8c060",error:"#e45858",light:{accent:"#4830c0",info:"#5858c8",warning:"#b89800",error:"#cc0000"}},rosette:{accent:"#fec7d7",info:"#a786df",warning:"#f0c88e",error:"#e06080",light:{accent:"#c05080",info:"#7048a8",warning:"#b89800",error:"#cc0000"}},retro:{accent:"#078080",info:"#078080",warning:"#f0c878",error:"#f45d48",light:{accent:"#067070",info:"#067070",warning:"#b89800",error:"#cc0000"}},tangerine:{accent:"#ff8e3c",info:"#68c8a0",warning:"#f5d070",error:"#d9376e",light:{accent:"#c87018",info:"#308060",warning:"#b89800",error:"#cc0000"}},emerald:{accent:"#f9bc60",info:"#abd1c6",warning:"#f5e078",error:"#e16162",light:{accent:"#b07810",info:"#407868",warning:"#b89800",error:"#cc0000"}},earth:{accent:"#8c7851",info:"#a0a078",warning:"#c8a868",error:"#f25042",light:{accent:"#705838",info:"#607030",warning:"#907018",error:"#cc0000"}},twilight:{accent:"#eebbc3",info:"#b8c1ec",warning:"#e8c890",error:"#d45060",light:{accent:"#a85068",info:"#4858a8",warning:"#b89800",error:"#cc0000"}},inferno:{accent:"#ff8906",info:"#68c8a0",warning:"#f5d070",error:"#e53170",light:{accent:"#c87000",info:"#308060",warning:"#b89800",error:"#cc0000"}},sunshine:{accent:"#ffd803",info:"#bae8e8",warning:"#e8a040",error:"#e06070",light:{accent:"#907800",info:"#207880",warning:"#986808",error:"#cc0000"}},blossom:{accent:"#ff8ba7",info:"#c3f0ca",warning:"#f0c878",error:"#d04050",light:{accent:"#c04868",info:"#287040",warning:"#b89800",error:"#cc0000"}},cocoa:{accent:"#e78fb3",info:"#c088d0",warning:"#f0c090",error:"#d05050",light:{accent:"#a85878",info:"#6838a0",warning:"#987010",error:"#cc0000"}},nautical:{accent:"#f582ae",info:"#8bd3dd",warning:"#f0c878",error:"#e06060",light:{accent:"#c05080",info:"#207890",warning:"#b89800",error:"#cc0000"}}},N={crystal:"Crystal",splash:"Splash",horizon:"Horizon",neon:"Neon",forest:"Forest",indigo:"Indigo",rosette:"Rosette",retro:"Retro",tangerine:"Tangerine",emerald:"Emerald",earth:"Earth",twilight:"Twilight",inferno:"Inferno",sunshine:"Sunshine",blossom:"Blossom",cocoa:"Cocoa",nautical:"Nautical"},y=Object.keys(M);function Z(e){let t=document.getElementById("omx-color-theme");t||(t=document.createElement("style"),t.id="omx-color-theme",document.head.appendChild(t));const o=e?M[e]:void 0;t.textContent=o?`\n :root {\n --vscode-accent: ${o.accent};\n --vscode-info: ${o.info};\n --vscode-warning: ${o.warning};\n --vscode-error: ${o.error};\n }\n :root.light {\n --vscode-accent: ${o.light.accent};\n --vscode-info: ${o.light.info};\n --vscode-warning: ${o.light.warning};\n --vscode-error: ${o.light.error};\n }\n `:""}const C=t.memo(function({label:e,description:r,value:n,onChange:c,options:i,placeholder:h,disabled:a}){const l=t.useId();return o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{htmlFor:l,className:"block text-sm font-medium text-vscode-text",children:e}),o.jsxs("div",{className:"relative",children:[o.jsxs("select",{id:l,value:n,onChange:e=>c(e.target.value),disabled:a,className:"w-full px-4 py-2.5 bg-vscode-bg border border-dashed border-vscode-border text-sm text-vscode-text focus:outline-none focus:border-vscode-accent focus-visible:ring-1 focus-visible:ring-vscode-accent appearance-none "+(a?"opacity-60 cursor-not-allowed":"cursor-pointer"),children:[h&&o.jsx("option",{value:"",children:h}),i.map(e=>o.jsx("option",{value:e.value,children:e.label},e.value))]}),o.jsx("div",{className:"absolute right-4 top-1/2 -translate-y-1/2 pointer-events-none text-vscode-text-muted",children:o.jsx(s,{width:14,height:14})})]}),r&&o.jsx("p",{className:"text-xs text-vscode-text-muted",children:r})]})});function k(){const e=n(e=>e.config),o=n(e=>e.setTheme);t.useEffect(()=>{const t=null==e?void 0:e.webTheme,r=e=>{const t="light"===e||"auto"===e&&window.matchMedia("(prefers-color-scheme: light)").matches;document.documentElement.classList.toggle("light",t),o(t?"light":"dark")};if(r(t),"auto"===t){const e=window.matchMedia("(prefers-color-scheme: light)"),o=()=>r(t);e.addEventListener("change",o);const n=e=>{var t;"themeChange"===(null==(t=e.data)?void 0:t.type)&&r(e.data.theme)};return window.addEventListener("message",n),()=>{e.removeEventListener("change",o),window.removeEventListener("message",n)}}},[null==e?void 0:e.webTheme,o]),t.useEffect(()=>{Z((null==e?void 0:e.colorTheme)??"neon")},[null==e?void 0:e.colorTheme])}export{c as C,g as I,l as L,d as P,v as R,C as S,z as T,m as W,a,h as b,H as c,i as d,s as e,M as f,Z as g,y as p,b as s,N as t,k as u};
@@ -0,0 +1 @@
1
+ var t,i,s,e,h,r,a,n,o,c;import{s as l,g as u,q as f,p as x,a as p,b as d,_ as g,l as m,H as b,e as _,y,F as A,i as k,D as w,E as T,K as v,aA as S,R as M}from"./App-CM8Va3JQ.js";import{i as D}from"./init-C9Lo50Hz.js";import{o as E}from"./ordinal-2upbOM02.js";import{l as R}from"./linear-CbNyjCBb.js";import"./index-DPbcKIIg.js";import"./useAppearance-PXtz8423.js";import"./defaultLocale-DK_abR1s.js";function C(){var t,i,s=E().unknown(void 0),e=s.domain,h=s.range,r=0,a=1,n=!1,o=0,c=0,l=.5;function u(){var s=e().length,u=a<r,f=u?a:r,x=u?r:a;t=(x-f)/Math.max(1,s-o+2*c),n&&(t=Math.floor(t)),f+=(x-f-t*(s-o))*l,i=t*(1-o),n&&(f=Math.round(f),i=Math.round(i));var p=function(t,i,s){t=+t,i=+i,s=(h=arguments.length)<2?(i=t,t=0,1):h<3?1:+s;for(var e=-1,h=0|Math.max(0,Math.ceil((i-t)/s)),r=new Array(h);++e<h;)r[e]=t+e*s;return r}(s).map(function(i){return f+t*i});return h(u?p.reverse():p)}return delete s.unknown,s.domain=function(t){return arguments.length?(e(t),u()):e()},s.range=function(t){return arguments.length?([r,a]=t,r=+r,a=+a,u()):[r,a]},s.rangeRound=function(t){return[r,a]=t,r=+r,a=+a,n=!0,u()},s.bandwidth=function(){return i},s.step=function(){return t},s.round=function(t){return arguments.length?(n=!!t,u()):n},s.padding=function(t){return arguments.length?(o=Math.min(1,c=+t),u()):o},s.paddingInner=function(t){return arguments.length?(o=Math.min(1,t),u()):o},s.paddingOuter=function(t){return arguments.length?(c=+t,u()):c},s.align=function(t){return arguments.length?(l=Math.max(0,Math.min(1,t)),u()):l},s.copy=function(){return C(e(),[r,a]).round(n).paddingInner(o).paddingOuter(c).align(l)},D.apply(u(),arguments)}var I=function(){var t=g(function(t,i,s,e){for(s=s||{},e=t.length;e--;s[t[e]]=i);return s},"o"),i=[1,10,12,14,16,18,19,21,23],s=[2,6],e=[1,3],h=[1,5],r=[1,6],a=[1,7],n=[1,5,10,12,14,16,18,19,21,23,34,35,36],o=[1,25],c=[1,26],l=[1,28],u=[1,29],f=[1,30],x=[1,31],p=[1,32],d=[1,33],m=[1,34],b=[1,35],_=[1,36],y=[1,37],A=[1,43],k=[1,42],w=[1,47],T=[1,50],v=[1,10,12,14,16,18,19,21,23,34,35,36],S=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],M=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],D=[1,64],E={trace:g(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",27:"NUMBER_WITH_DECIMAL",28:"COMMA",31:"ARROW_DELIMITER",34:"NEWLINE",35:"SEMI",36:"EOF",38:"STR",39:"MD_STR",41:"AMP",42:"NUM",43:"ALPHA",44:"PLUS",45:"EQUALS",46:"MULT",47:"DOT",48:"BRKT",49:"MINUS",50:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:g(function(t,i,s,e,h,r,a){var n=r.length-1;switch(h){case 5:e.setOrientation(r[n]);break;case 9:e.setDiagramTitle(r[n].text.trim());break;case 12:e.setLineData({text:"",type:"text"},r[n]);break;case 13:e.setLineData(r[n-1],r[n]);break;case 14:e.setBarData({text:"",type:"text"},r[n]);break;case 15:e.setBarData(r[n-1],r[n]);break;case 16:this.$=r[n].trim(),e.setAccTitle(this.$);break;case 17:case 18:this.$=r[n].trim(),e.setAccDescription(this.$);break;case 19:case 27:this.$=r[n-1];break;case 20:this.$=[Number(r[n-2]),...r[n]];break;case 21:this.$=[Number(r[n])];break;case 22:e.setXAxisTitle(r[n]);break;case 23:e.setXAxisTitle(r[n-1]);break;case 24:e.setXAxisTitle({type:"text",text:""});break;case 25:e.setXAxisBand(r[n]);break;case 26:e.setXAxisRangeData(Number(r[n-2]),Number(r[n]));break;case 28:this.$=[r[n-2],...r[n]];break;case 29:this.$=[r[n]];break;case 30:e.setYAxisTitle(r[n]);break;case 31:e.setYAxisTitle(r[n-1]);break;case 32:e.setYAxisTitle({type:"text",text:""});break;case 33:e.setYAxisRangeData(Number(r[n-2]),Number(r[n]));break;case 37:case 38:this.$={text:r[n],type:"text"};break;case 39:this.$={text:r[n],type:"markdown"};break;case 40:this.$=r[n];break;case 41:this.$=r[n-1]+""+r[n]}},"anonymous"),table:[t(i,s,{3:1,4:2,7:4,5:e,34:h,35:r,36:a}),{1:[3]},t(i,s,{4:2,7:4,3:8,5:e,34:h,35:r,36:a}),t(i,s,{4:2,7:4,6:9,3:10,5:e,8:[1,11],34:h,35:r,36:a}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},t(n,[2,34]),t(n,[2,35]),t(n,[2,36]),{1:[2,1]},t(i,s,{4:2,7:4,3:21,5:e,34:h,35:r,36:a}),{1:[2,3]},t(n,[2,5]),t(i,[2,7],{4:22,34:h,35:r,36:a}),{11:23,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},{11:39,13:38,24:A,27:k,29:40,30:41,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},{11:45,15:44,27:w,33:46,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},{11:49,17:48,24:T,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},{11:52,17:51,24:T,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},{20:[1,53]},{22:[1,54]},t(v,[2,18]),{1:[2,2]},t(v,[2,8]),t(v,[2,9]),t(S,[2,37],{40:55,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y}),t(S,[2,38]),t(S,[2,39]),t(M,[2,40]),t(M,[2,42]),t(M,[2,43]),t(M,[2,44]),t(M,[2,45]),t(M,[2,46]),t(M,[2,47]),t(M,[2,48]),t(M,[2,49]),t(M,[2,50]),t(M,[2,51]),t(v,[2,10]),t(v,[2,22],{30:41,29:56,24:A,27:k}),t(v,[2,24]),t(v,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},t(v,[2,11]),t(v,[2,30],{33:60,27:w}),t(v,[2,32]),{31:[1,61]},t(v,[2,12]),{17:62,24:T},{25:63,27:D},t(v,[2,14]),{17:65,24:T},t(v,[2,16]),t(v,[2,17]),t(M,[2,41]),t(v,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},t(v,[2,31]),{27:[1,69]},t(v,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},t(v,[2,15]),t(v,[2,26]),t(v,[2,27]),{11:59,32:72,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},t(v,[2,33]),t(v,[2,19]),{25:73,27:D},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:g(function(t,i){if(!i.recoverable){var s=new Error(t);throw s.hash=i,s}this.trace(t)},"parseError"),parse:g(function(t){var i=this,s=[0],e=[],h=[null],r=[],a=this.table,n="",o=0,c=0,l=r.slice.call(arguments,1),u=Object.create(this.lexer),f={yy:{}};for(var x in this.yy)Object.prototype.hasOwnProperty.call(this.yy,x)&&(f.yy[x]=this.yy[x]);u.setInput(t,f.yy),f.yy.lexer=u,f.yy.parser=this,void 0===u.yylloc&&(u.yylloc={});var p=u.yylloc;r.push(p);var d=u.options&&u.options.ranges;function m(){var t;return"number"!=typeof(t=e.pop()||u.lex()||1)&&(t instanceof Array&&(t=(e=t).pop()),t=i.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,g(function(t){s.length=s.length-2*t,h.length=h.length-t,r.length=r.length-t},"popStack"),g(m,"lex");for(var b,_,y,A,k,w,T,v,S={};;){if(_=s[s.length-1],this.defaultActions[_]?y=this.defaultActions[_]:(null==b&&(b=m()),y=a[_]&&a[_][b]),void 0===y||!y.length||!y[0]){var M="";for(k in v=[],a[_])this.terminals_[k]&&k>2&&v.push("'"+this.terminals_[k]+"'");M=u.showPosition?"Parse error on line "+(o+1)+":\n"+u.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(o+1)+": Unexpected "+(1==b?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(M,{text:u.match,token:this.terminals_[b]||b,line:u.yylineno,loc:p,expected:v})}if(y[0]instanceof Array&&y.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+b);switch(y[0]){case 1:s.push(b),h.push(u.yytext),r.push(u.yylloc),s.push(y[1]),b=null,c=u.yyleng,n=u.yytext,o=u.yylineno,p=u.yylloc;break;case 2:if(w=this.productions_[y[1]][1],S.$=h[h.length-w],S._$={first_line:r[r.length-(w||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(w||1)].first_column,last_column:r[r.length-1].last_column},d&&(S._$.range=[r[r.length-(w||1)].range[0],r[r.length-1].range[1]]),void 0!==(A=this.performAction.apply(S,[n,c,o,f.yy,y[1],h,r].concat(l))))return A;w&&(s=s.slice(0,-1*w*2),h=h.slice(0,-1*w),r=r.slice(0,-1*w)),s.push(this.productions_[y[1]][0]),h.push(S.$),r.push(S._$),T=a[s[s.length-2]][s[s.length-1]],s.push(T);break;case 3:return!0}}return!0},"parse")},R=function(){return{EOF:1,parseError:g(function(t,i){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,i)},"parseError"),setInput:g(function(t,i){return this.yy=i||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:g(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:g(function(t){var i=t.length,s=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var e=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),s.length-1&&(this.yylineno-=s.length-1);var h=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:s?(s.length===e.length?this.yylloc.first_column:0)+e[e.length-s.length].length-s[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[h[0],h[0]+this.yyleng-i]),this.yyleng=this.yytext.length,this},"unput"),more:g(function(){return this._more=!0,this},"more"),reject:g(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:g(function(t){this.unput(this.match.slice(t))},"less"),pastInput:g(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:g(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:g(function(){var t=this.pastInput(),i=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+i+"^"},"showPosition"),test_match:g(function(t,i){var s,e,h;if(this.options.backtrack_lexer&&(h={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(h.yylloc.range=this.yylloc.range.slice(0))),(e=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=e.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:e?e[e.length-1].length-e[e.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],s=this.performAction.call(this,this.yy,this,i,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),s)return s;if(this._backtrack){for(var r in h)this[r]=h[r];return!1}return!1},"test_match"),next:g(function(){if(this.done)return this.EOF;var t,i,s,e;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var h=this._currentRules(),r=0;r<h.length;r++)if((s=this._input.match(this.rules[h[r]]))&&(!i||s[0].length>i[0].length)){if(i=s,e=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(s,h[r])))return t;if(this._backtrack){i=!1;continue}return!1}if(!this.options.flex)break}return i?!1!==(t=this.test_match(i,h[e]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:g(function(){var t=this.next();return t||this.lex()},"lex"),begin:g(function(t){this.conditionStack.push(t)},"begin"),popState:g(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:g(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:g(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:g(function(t){this.begin(t)},"pushState"),stateStackSize:g(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:g(function(t,i,s,e){switch(s){case 0:case 1:case 5:case 44:break;case 2:case 3:return this.popState(),34;case 4:return 34;case 6:return 10;case 7:return this.pushState("acc_title"),19;case 8:return this.popState(),"acc_title_value";case 9:return this.pushState("acc_descr"),21;case 10:return this.popState(),"acc_descr_value";case 11:this.pushState("acc_descr_multiline");break;case 12:case 26:case 28:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";case 18:return this.pushState("axis_data"),"Y_AXIS";case 19:return this.pushState("axis_band_data"),24;case 20:return 31;case 21:return this.pushState("data"),16;case 22:return this.pushState("data"),18;case 23:return this.pushState("data_inner"),24;case 24:return 27;case 25:return this.popState(),26;case 27:this.pushState("string");break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 43;case 33:return"COLON";case 34:return 44;case 35:return 28;case 36:return 45;case 37:return 46;case 38:return 48;case 39:return 50;case 40:return 47;case 41:return 41;case 42:return 49;case 43:return 42;case 45:return 35;case 46:return 36}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\{)/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}}}();function C(){this.yy={}}return E.lexer=R,g(C,"Parser"),C.prototype=E,E.Parser=C,new C}();I.parser=I;var L=I;function P(t){return"bar"===t.type}function $(t){return"band"===t.type}function N(t){return"linear"===t.type}g(P,"isBarPlot"),g($,"isBandAxisData"),g(N,"isLinearAxisData");var z=(g(t=class{constructor(t){this.parentGroup=t}getMaxDimension(t,i){if(!this.parentGroup)return{width:t.reduce((t,i)=>Math.max(i.length,t),0)*i,height:i};const s={width:0,height:0},e=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",i);for(const h of t){const t=S(e,1,h),r=t?t.width:h.length*i,a=t?t.height:i;s.width=Math.max(s.width,r),s.height=Math.max(s.height,a)}return e.remove(),s}},"TextDimensionCalculatorWithFont"),t),B=(g(i=class{constructor(t,i,s,e){this.axisConfig=t,this.title=i,this.textDimensionCalculator=s,this.axisThemeConfig=e,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left"}setRange(t){this.range=t,"left"===this.axisPosition||"right"===this.axisPosition?this.boundingRect.height=t[1]-t[0]:this.boundingRect.width=t[1]-t[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(t){this.axisPosition=t,this.setRange(this.range)}getTickDistance(){const t=this.getRange();return Math.abs(t[0]-t[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(t=>t.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){.7*this.getTickDistance()>2*this.outerPadding&&(this.outerPadding=Math.floor(.7*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(t){let i=t.height;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const s=this.getLabelDimension(),e=.2*t.width;this.outerPadding=Math.min(s.width/2,e);const h=s.height+2*this.axisConfig.labelPadding;this.labelTextHeight=s.height,h<=i&&(i-=h,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const t=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),s=t.height+2*this.axisConfig.titlePadding;this.titleTextHeight=t.height,s<=i&&(i-=s,this.showTitle=!0)}this.boundingRect.width=t.width,this.boundingRect.height=t.height-i}calculateSpaceIfDrawnVertical(t){let i=t.width;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const s=this.getLabelDimension(),e=.2*t.height;this.outerPadding=Math.min(s.height/2,e);const h=s.width+2*this.axisConfig.labelPadding;h<=i&&(i-=h,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const t=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),s=t.height+2*this.axisConfig.titlePadding;this.titleTextHeight=t.height,s<=i&&(i-=s,this.showTitle=!0)}this.boundingRect.width=t.width-i,this.boundingRect.height=t.height}calculateSpace(t){return"left"===this.axisPosition||"right"===this.axisPosition?this.calculateSpaceIfDrawnVertical(t):this.calculateSpaceIfDrawnHorizontally(t),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}getDrawableElementsForLeftAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${i},${this.boundingRect.y} L ${i},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map(t=>({text:t.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(t),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){const i=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map(t=>({path:`M ${i},${this.getScaleValue(t)} L ${i-this.axisConfig.tickLength},${this.getScaleValue(t)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForBottomAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.y+this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(t=>({text:t.toString(),x:this.getScaleValue(t),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const i=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(t=>({path:`M ${this.getScaleValue(t)},${i} L ${this.getScaleValue(t)},${i+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForTopAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(t=>({text:t.toString(),x:this.getScaleValue(t),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+2*this.axisConfig.titlePadding:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const i=this.boundingRect.y;t.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(t=>({path:`M ${this.getScaleValue(t)},${i+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(t)},${i+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElements(){if("left"===this.axisPosition)return this.getDrawableElementsForLeftAxis();if("right"===this.axisPosition)throw Error("Drawing of right axis is not implemented");return"bottom"===this.axisPosition?this.getDrawableElementsForBottomAxis():"top"===this.axisPosition?this.getDrawableElementsForTopAxis():[]}},"BaseAxis"),i),O=(g(s=class extends B{constructor(t,i,s,e,h){super(t,e,h,i),this.categories=s,this.scale=C().domain(this.categories).range(this.getRange())}setRange(t){super.setRange(t)}recalculateScale(){this.scale=C().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),m.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(t){return this.scale(t)??this.getRange()[0]}},"BandAxis"),s),X=(g(e=class extends B{constructor(t,i,s,e,h){super(t,e,h,i),this.domain=s,this.scale=R().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const t=[...this.domain];"left"===this.axisPosition&&t.reverse(),this.scale=R().domain(t).range(this.getRange())}getScaleValue(t){return this.scale(t)}},"LinearAxis"),e);function F(t,i,s,e){const h=new z(e);return $(t)?new O(i,s,t.categories,t.title,h):new X(i,s,[t.min,t.max],t.title,h)}g(F,"getAxis");var U=(g(h=class{constructor(t,i,s,e){this.textDimensionCalculator=t,this.chartConfig=i,this.chartData=s,this.chartThemeConfig=e,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){const i=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),s=Math.max(i.width,t.width),e=i.height+2*this.chartConfig.titlePadding;return i.width<=s&&i.height<=e&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=s,this.boundingRect.height=e,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){const t=[];return this.showChartTitle&&t.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),t}},"ChartTitle"),h);function W(t,i,s,e){const h=new z(e);return new U(h,t,i,s)}g(W,"getChartTitleComponent");var Y=(g(r=class{constructor(t,i,s,e,h){this.plotData=t,this.xAxis=i,this.yAxis=s,this.orientation=e,this.plotIndex=h}getDrawableElement(){const t=this.plotData.data.map(t=>[this.xAxis.getScaleValue(t[0]),this.yAxis.getScaleValue(t[1])]);let i;return i="horizontal"===this.orientation?M().y(t=>t[0]).x(t=>t[1])(t):M().x(t=>t[0]).y(t=>t[1])(t),i?[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:i,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}]:[]}},"LinePlot"),r),j=(g(a=class{constructor(t,i,s,e,h,r){this.barData=t,this.boundingRect=i,this.xAxis=s,this.yAxis=e,this.orientation=h,this.plotIndex=r}getDrawableElement(){const t=this.barData.data.map(t=>[this.xAxis.getScaleValue(t[0]),this.yAxis.getScaleValue(t[1])]),i=.95*Math.min(2*this.xAxis.getAxisOuterPadding(),this.xAxis.getTickDistance()),s=i/2;return"horizontal"===this.orientation?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(t=>({x:this.boundingRect.x,y:t[0]-s,height:i,width:t[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(t=>({x:t[0]-s,y:t[1],width:i,height:this.boundingRect.y+this.boundingRect.height-t[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},"BarPlot"),a),H=(g(n=class{constructor(t,i,s){this.chartConfig=t,this.chartData=i,this.chartThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0}}setAxes(t,i){this.xAxis=t,this.yAxis=i}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){return this.boundingRect.width=t.width,this.boundingRect.height=t.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!this.xAxis||!this.yAxis)throw Error("Axes must be passed to render Plots");const t=[];for(const[i,s]of this.chartData.plots.entries())switch(s.type){case"line":{const e=new Y(s,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...e.getDrawableElement())}break;case"bar":{const e=new j(s,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...e.getDrawableElement())}}return t}},"BasePlot"),n);function V(t,i,s){return new H(t,i,s)}g(V,"getPlotComponent");var G,Q=(g(o=class{constructor(t,i,s,e){this.chartConfig=t,this.chartData=i,this.componentStore={title:W(t,i,s,e),plot:V(t,i,s),xAxis:F(i.xAxis,t.xAxis,{titleColor:s.xAxisTitleColor,labelColor:s.xAxisLabelColor,tickColor:s.xAxisTickColor,axisLineColor:s.xAxisLineColor},e),yAxis:F(i.yAxis,t.yAxis,{titleColor:s.yAxisTitleColor,labelColor:s.yAxisLabelColor,tickColor:s.yAxisTickColor,axisLineColor:s.yAxisLineColor},e)}}calculateVerticalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,s=0,e=0,h=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),r=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),a=this.componentStore.plot.calculateSpace({width:h,height:r});t-=a.width,i-=a.height,a=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),e=a.height,i-=a.height,this.componentStore.xAxis.setAxisPosition("bottom"),a=this.componentStore.xAxis.calculateSpace({width:t,height:i}),i-=a.height,this.componentStore.yAxis.setAxisPosition("left"),a=this.componentStore.yAxis.calculateSpace({width:t,height:i}),s=a.width,t-=a.width,t>0&&(h+=t,t=0),i>0&&(r+=i,i=0),this.componentStore.plot.calculateSpace({width:h,height:r}),this.componentStore.plot.setBoundingBoxXY({x:s,y:e}),this.componentStore.xAxis.setRange([s,s+h]),this.componentStore.xAxis.setBoundingBoxXY({x:s,y:e+r}),this.componentStore.yAxis.setRange([e,e+r]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:e}),this.chartData.plots.some(t=>P(t))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,s=0,e=0,h=0,r=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),a=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),n=this.componentStore.plot.calculateSpace({width:r,height:a});t-=n.width,i-=n.height,n=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),s=n.height,i-=n.height,this.componentStore.xAxis.setAxisPosition("left"),n=this.componentStore.xAxis.calculateSpace({width:t,height:i}),t-=n.width,e=n.width,this.componentStore.yAxis.setAxisPosition("top"),n=this.componentStore.yAxis.calculateSpace({width:t,height:i}),i-=n.height,h=s+n.height,t>0&&(r+=t,t=0),i>0&&(a+=i,i=0),this.componentStore.plot.calculateSpace({width:r,height:a}),this.componentStore.plot.setBoundingBoxXY({x:e,y:h}),this.componentStore.yAxis.setRange([e,e+r]),this.componentStore.yAxis.setBoundingBoxXY({x:e,y:s}),this.componentStore.xAxis.setRange([h,h+a]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:h}),this.chartData.plots.some(t=>P(t))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){"horizontal"===this.chartConfig.chartOrientation?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();const t=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(const i of Object.values(this.componentStore))t.push(...i.getDrawableElements());return t}},"Orchestrator"),o),K=(g(c=class{static build(t,i,s,e){return new Q(t,i,s,e).getDrawableElement()}},"XYChartBuilder"),c),q=0,Z=rt(),J=ht(),tt=at(),it=J.plotColorPalette.split(",").map(t=>t.trim()),st=!1,et=!1;function ht(){const t=v(),i=A();return w(t.xyChart,i.themeVariables.xyChart)}function rt(){const t=A();return w(T.xyChart,t.xyChart)}function at(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}function nt(t){const i=A();return k(t.trim(),i)}function ot(t){G=t}function ct(t){Z.chartOrientation="horizontal"===t?"horizontal":"vertical"}function lt(t){tt.xAxis.title=nt(t.text)}function ut(t,i){tt.xAxis={type:"linear",title:tt.xAxis.title,min:t,max:i},st=!0}function ft(t){tt.xAxis={type:"band",title:tt.xAxis.title,categories:t.map(t=>nt(t.text))},st=!0}function xt(t){tt.yAxis.title=nt(t.text)}function pt(t,i){tt.yAxis={type:"linear",title:tt.yAxis.title,min:t,max:i},et=!0}function dt(t){const i=Math.min(...t),s=Math.max(...t),e=N(tt.yAxis)?tt.yAxis.min:1/0,h=N(tt.yAxis)?tt.yAxis.max:-1/0;tt.yAxis={type:"linear",title:tt.yAxis.title,min:Math.min(e,i),max:Math.max(h,s)}}function gt(t){let i=[];if(0===t.length)return i;if(!st){const i=N(tt.xAxis)?tt.xAxis.min:1/0,s=N(tt.xAxis)?tt.xAxis.max:-1/0;ut(Math.min(i,1),Math.max(s,t.length))}if(et||dt(t),$(tt.xAxis)&&(i=tt.xAxis.categories.map((i,s)=>[i,t[s]])),N(tt.xAxis)){const s=tt.xAxis.min,e=tt.xAxis.max,h=(e-s)/(t.length-1),r=[];for(let t=s;t<=e;t+=h)r.push(`${t}`);i=r.map((i,s)=>[i,t[s]])}return i}function mt(t){return it[0===t?0:t%it.length]}function bt(t,i){const s=gt(i);tt.plots.push({type:"line",strokeFill:mt(q),strokeWidth:2,data:s}),q++}function _t(t,i){const s=gt(i);tt.plots.push({type:"bar",fill:mt(q),data:s}),q++}function yt(){if(0===tt.plots.length)throw Error("No Plot to render, please provide a plot with some data");return tt.title=f(),K.build(Z,tt,J,G)}function At(){return J}function kt(){return Z}function wt(){return tt}g(ht,"getChartDefaultThemeConfig"),g(rt,"getChartDefaultConfig"),g(at,"getChartDefaultData"),g(nt,"textSanitizer"),g(ot,"setTmpSVGG"),g(ct,"setOrientation"),g(lt,"setXAxisTitle"),g(ut,"setXAxisRangeData"),g(ft,"setXAxisBand"),g(xt,"setYAxisTitle"),g(pt,"setYAxisRangeData"),g(dt,"setYAxisRangeFromPlotData"),g(gt,"transformDataWithoutCategory"),g(mt,"getPlotColorFromPalette"),g(bt,"setLineData"),g(_t,"setBarData"),g(yt,"getDrawableElem"),g(At,"getChartThemeConfig"),g(kt,"getChartConfig"),g(wt,"getXYChartData");var Tt={parser:L,db:{getDrawableElem:yt,clear:g(function(){y(),q=0,Z=rt(),tt={yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]},J=ht(),it=J.plotColorPalette.split(",").map(t=>t.trim()),st=!1,et=!1},"clear"),setAccTitle:d,getAccTitle:p,setDiagramTitle:x,getDiagramTitle:f,getAccDescription:u,setAccDescription:l,setOrientation:ct,setXAxisTitle:lt,setXAxisRangeData:ut,setXAxisBand:ft,setYAxisTitle:xt,setYAxisRangeData:pt,setLineData:bt,setBarData:_t,setTmpSVGG:ot,getChartThemeConfig:At,getChartConfig:kt,getXYChartData:wt},renderer:{draw:g((t,i,s,e)=>{const h=e.db,r=h.getChartThemeConfig(),a=h.getChartConfig(),n=h.getXYChartData().plots[0].data.map(t=>t[1]);function o(t){return"top"===t?"text-before-edge":"middle"}function c(t){return"left"===t?"start":"right"===t?"end":"middle"}function l(t){return`translate(${t.x}, ${t.y}) rotate(${t.rotation||0})`}g(o,"getDominantBaseLine"),g(c,"getTextAnchor"),g(l,"getTextTransformation"),m.debug("Rendering xychart chart\n"+t);const u=b(i),f=u.append("g").attr("class","main"),x=f.append("rect").attr("width",a.width).attr("height",a.height).attr("class","background");_(u,a.height,a.width,!0),u.attr("viewBox",`0 0 ${a.width} ${a.height}`),x.attr("fill",r.backgroundColor),h.setTmpSVGG(u.append("g").attr("class","mermaid-tmp-group"));const p=h.getDrawableElem(),d={};function y(t){let i=f,s="";for(const[e]of t.entries()){let h=f;e>0&&d[s]&&(h=d[s]),s+=t[e],i=d[s],i||(i=d[s]=h.append("g").attr("class",t[e]))}return i}g(y,"getGroup");for(const m of p){if(0===m.data.length)continue;const t=y(m.groupTexts);switch(m.type){case"rect":if(t.selectAll("rect").data(m.data).enter().append("rect").attr("x",t=>t.x).attr("y",t=>t.y).attr("width",t=>t.width).attr("height",t=>t.height).attr("fill",t=>t.fill).attr("stroke",t=>t.strokeFill).attr("stroke-width",t=>t.strokeWidth),a.showDataLabel)if("horizontal"===a.chartOrientation){let i=function(t,i){const{data:e,label:h}=t;return i*h.length*s<=e.width-10};g(i,"fitsHorizontally");const s=.7,e=m.data.map((t,i)=>({data:t,label:n[i].toString()})).filter(t=>t.data.width>0&&t.data.height>0),h=e.map(t=>{const{data:s}=t;let e=.7*s.height;for(;!i(t,e)&&e>0;)e-=1;return e}),r=Math.floor(Math.min(...h));t.selectAll("text").data(e).enter().append("text").attr("x",t=>t.data.x+t.data.width-10).attr("y",t=>t.data.y+t.data.height/2).attr("text-anchor","end").attr("dominant-baseline","middle").attr("fill","black").attr("font-size",`${r}px`).text(t=>t.label)}else{let i=function(t,i,s){const{data:e,label:h}=t,r=i*h.length*.7,a=e.x+e.width/2,n=a+r/2,o=a-r/2>=e.x&&n<=e.x+e.width,c=e.y+s+i<=e.y+e.height;return o&&c};g(i,"fitsInBar");const s=10,e=m.data.map((t,i)=>({data:t,label:n[i].toString()})).filter(t=>t.data.width>0&&t.data.height>0),h=e.map(t=>{const{data:e,label:h}=t;let r=e.width/(.7*h.length);for(;!i(t,r,s)&&r>0;)r-=1;return r}),r=Math.floor(Math.min(...h));t.selectAll("text").data(e).enter().append("text").attr("x",t=>t.data.x+t.data.width/2).attr("y",t=>t.data.y+s).attr("text-anchor","middle").attr("dominant-baseline","hanging").attr("fill","black").attr("font-size",`${r}px`).text(t=>t.label)}break;case"text":t.selectAll("text").data(m.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",t=>t.fill).attr("font-size",t=>t.fontSize).attr("dominant-baseline",t=>o(t.verticalPos)).attr("text-anchor",t=>c(t.horizontalPos)).attr("transform",t=>l(t)).text(t=>t.text);break;case"path":t.selectAll("path").data(m.data).enter().append("path").attr("d",t=>t.path).attr("fill",t=>t.fill?t.fill:"none").attr("stroke",t=>t.strokeFill).attr("stroke-width",t=>t.strokeWidth)}}},"draw")}};export{Tt as diagram};
@@ -9,8 +9,8 @@
9
9
  <meta name="mobile-web-app-capable" content="yes" />
10
10
  <link rel="icon" type="image/png" href="/favicon.png" />
11
11
  <title>OmniContext CLI</title>
12
- <script type="module" crossorigin src="/assets/index-C5d-CFGb.js"></script>
13
- <link rel="stylesheet" crossorigin href="/assets/index-5mQ2UgiF.css">
12
+ <script type="module" crossorigin src="/assets/index-DPbcKIIg.js"></script>
13
+ <link rel="stylesheet" crossorigin href="/assets/index-Fz55nSNP.css">
14
14
  </head>
15
15
 
16
16
  <body>
@@ -0,0 +1,5 @@
1
+ ---
2
+ match: gpt-5.5
3
+ ---
4
+
5
+ Preserve the requested artifact, length, structure, and genre first. Quietly improve clarity, flow, and correctness. Do not add new claims, extra sections, or a more promotional tone unless explicitly requested.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omni-context-cli",
3
- "version": "0.0.91",
3
+ "version": "0.0.93",
4
4
  "description": "Omx is a small, helpful, zero-telemetry coding assistant.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1 +0,0 @@
1
- import{aV as r,br as n,aE as t,aT as u,aD as e,bs as i,bt as o,bu as f,bv as a,bw as c,bm as v,bx as s,aW as l,a$ as b,b2 as j,by as d,aZ as y,bz as p,bp as w,aF as _,bn as m,bA as O}from"./index-C5d-CFGb.js";function h(t){return"symbol"==typeof t||r(t)&&"[object Symbol]"==n(t)}function g(r,n){for(var t=-1,u=null==r?0:r.length,e=Array(u);++t<u;)e[t]=n(r[t],t,r);return e}var A=u?u.prototype:void 0,k=A?A.toString:void 0;function x(r){if("string"==typeof r)return r;if(t(r))return g(r,x)+"";if(h(r))return k?k.call(r):"";var n=r+"";return"0"==n&&1/r==-1/0?"-0":n}function S(r,n){for(var t=-1,u=null==r?0:r.length;++t<u&&!1!==n(r[t],t,r););return r}function $(r,n,t,u){for(var e=r.length,i=t+-1;++i<e;)if(n(r[i],i,r))return i;return-1}function D(r){return r!=r}function E(r,n){return!!(null==r?0:r.length)&&function(r,n,t){return n==n?function(r,n,t){for(var u=t-1,e=r.length;++u<e;)if(r[u]===n)return u;return-1}(r,n,t):$(r,D,t)}(r,n,0)>-1}function B(r){return e(r)?i(r):o(r)}var V=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,q=/^\w*$/;function z(r,n){if(t(r))return!1;var u=typeof r;return!("number"!=u&&"symbol"!=u&&"boolean"!=u&&null!=r&&!h(r))||(q.test(r)||!V.test(r)||null!=n&&r in Object(n))}var F,M,N,R=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,T=/\\(\\)?/g,W=(F=function(r){var n=[];return 46===r.charCodeAt(0)&&n.push(""),r.replace(R,function(r,t,u,e){n.push(u?e.replace(T,"$1"):t||r)}),n},M=f(F,function(r){return 500===N.size&&N.clear(),r}),N=M.cache,M);function Z(r){return null==r?"":x(r)}function C(r,n){return t(r)?r:z(r,n)?[r]:W(Z(r))}function G(r){if("string"==typeof r||h(r))return r;var n=r+"";return"0"==n&&1/r==-1/0?"-0":n}function H(r,n){for(var t=0,u=(n=C(n,r)).length;null!=r&&t<u;)r=r[G(n[t++])];return t&&t==u?r:void 0}function I(r,n){for(var t=-1,u=n.length,e=r.length;++t<u;)r[e+t]=n[t];return r}var J=u?u.isConcatSpreadable:void 0;function K(r){return t(r)||a(r)||!!(J&&r&&r[J])}function L(r,n,t,u,e){var i=-1,o=r.length;for(t||(t=K),e||(e=[]);++i<o;){var f=r[i];t(f)?I(e,f):u||(e[e.length]=f)}return e}function P(r,n,t,u){var e=-1,i=null==r?0:r.length;for(u&&i&&(t=r[++e]);++e<i;)t=n(t,r[e],e,r);return t}function Q(r,n){for(var t=-1,u=null==r?0:r.length,e=0,i=[];++t<u;){var o=r[t];n(o,t,r)&&(i[e++]=o)}return i}function U(){return[]}var X=Object.prototype.propertyIsEnumerable,Y=Object.getOwnPropertySymbols,rr=Y?function(r){return null==r?[]:(r=Object(r),Q(Y(r),function(n){return X.call(r,n)}))}:U;function nr(r,n,u){var e=n(r);return t(r)?e:I(e,u(r))}function tr(r){return nr(r,B,rr)}function ur(r){var n=-1,t=null==r?0:r.length;for(this.__data__=new c;++n<t;)this.add(r[n])}function er(r,n){for(var t=-1,u=null==r?0:r.length;++t<u;)if(n(r[t],t,r))return!0;return!1}function ir(r,n){return r.has(n)}ur.prototype.add=ur.prototype.push=function(r){return this.__data__.set(r,"__lodash_hash_undefined__"),this},ur.prototype.has=function(r){return this.__data__.has(r)};function or(r,n,t,u,e,i){var o=1&t,f=r.length,a=n.length;if(f!=a&&!(o&&a>f))return!1;var c=i.get(r),v=i.get(n);if(c&&v)return c==n&&v==r;var s=-1,l=!0,b=2&t?new ur:void 0;for(i.set(r,n),i.set(n,r);++s<f;){var j=r[s],d=n[s];if(u)var y=o?u(d,j,s,n,r,i):u(j,d,s,r,n,i);if(void 0!==y){if(y)continue;l=!1;break}if(b){if(!er(n,function(r,n){if(!ir(b,n)&&(j===r||e(j,r,t,u,i)))return b.push(n)})){l=!1;break}}else if(j!==d&&!e(j,d,t,u,i)){l=!1;break}}return i.delete(r),i.delete(n),l}function fr(r){var n=-1,t=Array(r.size);return r.forEach(function(r,u){t[++n]=[u,r]}),t}function ar(r){var n=-1,t=Array(r.size);return r.forEach(function(r){t[++n]=r}),t}var cr=u?u.prototype:void 0,vr=cr?cr.valueOf:void 0;var sr=Object.prototype.hasOwnProperty;var lr="[object Arguments]",br="[object Array]",jr="[object Object]",dr=Object.prototype.hasOwnProperty;function yr(r,n,u,e,i,o){var f=t(r),a=t(n),c=f?br:l(r),y=a?br:l(n),p=(c=c==lr?jr:c)==jr,w=(y=y==lr?jr:y)==jr,_=c==y;if(_&&b(r)){if(!b(n))return!1;f=!0,p=!1}if(_&&!p)return o||(o=new j),f||d(r)?or(r,n,u,e,i,o):function(r,n,t,u,e,i,o){switch(t){case"[object DataView]":if(r.byteLength!=n.byteLength||r.byteOffset!=n.byteOffset)return!1;r=r.buffer,n=n.buffer;case"[object ArrayBuffer]":return!(r.byteLength!=n.byteLength||!i(new s(r),new s(n)));case"[object Boolean]":case"[object Date]":case"[object Number]":return v(+r,+n);case"[object Error]":return r.name==n.name&&r.message==n.message;case"[object RegExp]":case"[object String]":return r==n+"";case"[object Map]":var f=fr;case"[object Set]":var a=1&u;if(f||(f=ar),r.size!=n.size&&!a)return!1;var c=o.get(r);if(c)return c==n;u|=2,o.set(r,n);var l=or(f(r),f(n),u,e,i,o);return o.delete(r),l;case"[object Symbol]":if(vr)return vr.call(r)==vr.call(n)}return!1}(r,n,c,u,e,i,o);if(!(1&u)){var m=p&&dr.call(r,"__wrapped__"),O=w&&dr.call(n,"__wrapped__");if(m||O){var h=m?r.value():r,g=O?n.value():n;return o||(o=new j),i(h,g,u,e,o)}}return!!_&&(o||(o=new j),function(r,n,t,u,e,i){var o=1&t,f=tr(r),a=f.length;if(a!=tr(n).length&&!o)return!1;for(var c=a;c--;){var v=f[c];if(!(o?v in n:sr.call(n,v)))return!1}var s=i.get(r),l=i.get(n);if(s&&l)return s==n&&l==r;var b=!0;i.set(r,n),i.set(n,r);for(var j=o;++c<a;){var d=r[v=f[c]],y=n[v];if(u)var p=o?u(y,d,v,n,r,i):u(d,y,v,r,n,i);if(!(void 0===p?d===y||e(d,y,t,u,i):p)){b=!1;break}j||(j="constructor"==v)}if(b&&!j){var w=r.constructor,_=n.constructor;w==_||!("constructor"in r)||!("constructor"in n)||"function"==typeof w&&w instanceof w&&"function"==typeof _&&_ instanceof _||(b=!1)}return i.delete(r),i.delete(n),b}(r,n,u,e,i,o))}function pr(n,t,u,e,i){return n===t||(null==n||null==t||!r(n)&&!r(t)?n!=n&&t!=t:yr(n,t,u,e,pr,i))}function wr(r){return r==r&&!y(r)}function _r(r,n){return function(t){return null!=t&&(t[r]===n&&(void 0!==n||r in Object(t)))}}function mr(r){var n=function(r){for(var n=B(r),t=n.length;t--;){var u=n[t],e=r[u];n[t]=[u,e,wr(e)]}return n}(r);return 1==n.length&&n[0][2]?_r(n[0][0],n[0][1]):function(t){return t===r||function(r,n,t,u){var e=t.length,i=e;if(null==r)return!i;for(r=Object(r);e--;){var o=t[e];if(o[2]?o[1]!==r[o[0]]:!(o[0]in r))return!1}for(;++e<i;){var f=(o=t[e])[0],a=r[f],c=o[1];if(o[2]){if(void 0===a&&!(f in r))return!1}else if(!pr(c,a,3,u,new j))return!1}return!0}(t,0,n)}}function Or(r,n){return null!=r&&n in Object(r)}function hr(r,n,u){for(var e=-1,i=(n=C(n,r)).length,o=!1;++e<i;){var f=G(n[e]);if(!(o=null!=r&&u(r,f)))break;r=r[f]}return o||++e!=i?o:!!(i=null==r?0:r.length)&&p(i)&&w(f,i)&&(t(r)||a(r))}function gr(r,n){return null!=r&&hr(r,n,Or)}function Ar(r,n){return z(r)&&wr(n)?_r(G(r),n):function(t){var u=function(r,n,t){var u=null==r?void 0:H(r,n);return void 0===u?t:u}(t,r);return void 0===u&&u===n?gr(t,r):pr(n,u,3)}}function kr(r){return z(r)?(n=G(r),function(r){return null==r?void 0:r[n]}):function(r){return function(n){return H(n,r)}}(r);var n}function xr(r){return"function"==typeof r?r:null==r?_:"object"==typeof r?t(r)?Ar(r[0],r[1]):mr(r):kr(r)}function Sr(r,n){return r&&m(r,n,B)}var $r,Dr=($r=Sr,function(r,n){if(null==r)return r;if(!e(r))return $r(r,n);for(var t=r.length,u=-1,i=Object(r);++u<t&&!1!==n(i[u],u,i););return r});function Er(r){return"function"==typeof r?r:_}function Br(r,n){return(t(r)?S:Dr)(r,Er(n))}function Vr(r,n){var t=[];return Dr(r,function(r,u,e){n(r,u,e)&&t.push(r)}),t}function qr(r,n){return(t(r)?Q:Vr)(r,xr(n))}function zr(r,n,t,u,e){return e(r,function(r,e,i){t=u?(u=!1,r):n(t,r,e,i)}),t}function Fr(r,n,u){var e=t(r)?P:zr,i=arguments.length<3;return e(r,xr(n),u,i,Dr)}var Mr=O&&1/ar(new O([,-0]))[1]==1/0?function(r){return new O(r)}:function(){};function Nr(r,n,t){var u=-1,e=E,i=r.length,o=!0,f=[],a=f;if(i>=200){var c=n?null:Mr(r);if(c)return ar(c);o=!1,e=ir,a=new ur}else a=n?[]:f;r:for(;++u<i;){var v=r[u],s=n?n(v):v;if(v=0!==v?v:0,o&&s==s){for(var l=a.length;l--;)if(a[l]===s)continue r;n&&a.push(s),f.push(v)}else e(a,s,t)||(a!==f&&a.push(s),f.push(v))}return f}export{Dr as a,L as b,xr as c,g as d,I as e,nr as f,rr as g,S as h,h as i,tr as j,B as k,Nr as l,qr as m,Br as n,$ as o,Er as p,Sr as q,Fr as r,U as s,hr as t,C as u,G as v,H as w,gr as x,Z as y};
@@ -1 +0,0 @@
1
- import{a0 as n,a1 as t,a2 as u,a3 as r,a4 as i,a5 as a,a6 as f,a7 as o,a8 as e,a9 as s,aa as c,ab as l,ac as h,ad as v,ae as y}from"./index-C5d-CFGb.js";function p(n){return n.innerRadius}function x(n){return n.outerRadius}function d(n){return n.startAngle}function m(n){return n.endAngle}function b(n){return n&&n.padAngle}function j(n,t,u,r,i,a,f){var o=n-u,e=t-r,c=(f?a:-a)/s(o*o+e*e),l=c*e,h=-c*o,v=n+l,p=t+h,x=u+l,d=r+h,m=(v+x)/2,b=(p+d)/2,j=x-v,g=d-p,k=j*j+g*g,q=i-a,w=v*d-x*p,z=(g<0?-1:1)*s(y(0,q*q*k-w*w)),A=(w*g-j*z)/k,B=(-w*j-g*z)/k,C=(w*g+j*z)/k,D=(-w*j+g*z)/k,E=A-m,F=B-b,G=C-m,H=D-b;return E*E+F*F>G*G+H*H&&(A=C,B=D),{cx:A,cy:B,x01:-l,y01:-h,x11:A*(i/q-1),y11:B*(i/q-1)}}function g(){var y=p,g=x,k=l(0),q=null,w=d,z=m,A=b,B=null,C=n(D);function D(){var n,l,p=+y.apply(this,arguments),x=+g.apply(this,arguments),d=w.apply(this,arguments)-t,m=z.apply(this,arguments)-t,b=o(m-d),D=m>d;if(B||(B=n=C()),x<p&&(l=x,x=p,p=l),x>u)if(b>r-u)B.moveTo(x*i(d),x*a(d)),B.arc(0,0,x,d,m,!D),p>u&&(B.moveTo(p*i(m),p*a(m)),B.arc(0,0,p,m,d,D));else{var E,F,G=d,H=m,I=d,J=m,K=b,L=b,M=A.apply(this,arguments)/2,N=M>u&&(q?+q.apply(this,arguments):s(p*p+x*x)),O=f(o(x-p)/2,+k.apply(this,arguments)),P=O,Q=O;if(N>u){var R=h(N/p*a(M)),S=h(N/x*a(M));(K-=2*R)>u?(I+=R*=D?1:-1,J-=R):(K=0,I=J=(d+m)/2),(L-=2*S)>u?(G+=S*=D?1:-1,H-=S):(L=0,G=H=(d+m)/2)}var T=x*i(G),U=x*a(G),V=p*i(J),W=p*a(J);if(O>u){var X,Y=x*i(H),Z=x*a(H),$=p*i(I),_=p*a(I);if(b<e)if(X=function(n,t,r,i,a,f,o,e){var s=r-n,c=i-t,l=o-a,h=e-f,v=h*s-l*c;if(!(v*v<u))return[n+(v=(l*(t-f)-h*(n-a))/v)*s,t+v*c]}(T,U,$,_,Y,Z,V,W)){var nn=T-X[0],tn=U-X[1],un=Y-X[0],rn=Z-X[1],an=1/a(v((nn*un+tn*rn)/(s(nn*nn+tn*tn)*s(un*un+rn*rn)))/2),fn=s(X[0]*X[0]+X[1]*X[1]);P=f(O,(p-fn)/(an-1)),Q=f(O,(x-fn)/(an+1))}else P=Q=0}L>u?Q>u?(E=j($,_,T,U,x,Q,D),F=j(Y,Z,V,W,x,Q,D),B.moveTo(E.cx+E.x01,E.cy+E.y01),Q<O?B.arc(E.cx,E.cy,Q,c(E.y01,E.x01),c(F.y01,F.x01),!D):(B.arc(E.cx,E.cy,Q,c(E.y01,E.x01),c(E.y11,E.x11),!D),B.arc(0,0,x,c(E.cy+E.y11,E.cx+E.x11),c(F.cy+F.y11,F.cx+F.x11),!D),B.arc(F.cx,F.cy,Q,c(F.y11,F.x11),c(F.y01,F.x01),!D))):(B.moveTo(T,U),B.arc(0,0,x,G,H,!D)):B.moveTo(T,U),p>u&&K>u?P>u?(E=j(V,W,Y,Z,p,-P,D),F=j(T,U,$,_,p,-P,D),B.lineTo(E.cx+E.x01,E.cy+E.y01),P<O?B.arc(E.cx,E.cy,P,c(E.y01,E.x01),c(F.y01,F.x01),!D):(B.arc(E.cx,E.cy,P,c(E.y01,E.x01),c(E.y11,E.x11),!D),B.arc(0,0,p,c(E.cy+E.y11,E.cx+E.x11),c(F.cy+F.y11,F.cx+F.x11),D),B.arc(F.cx,F.cy,P,c(F.y11,F.x11),c(F.y01,F.x01),!D))):B.arc(0,0,p,J,I,D):B.lineTo(V,W)}else B.moveTo(0,0);if(B.closePath(),n)return B=null,n+""||null}return D.centroid=function(){var n=(+y.apply(this,arguments)+ +g.apply(this,arguments))/2,t=(+w.apply(this,arguments)+ +z.apply(this,arguments))/2-e/2;return[i(t)*n,a(t)*n]},D.innerRadius=function(n){return arguments.length?(y="function"==typeof n?n:l(+n),D):y},D.outerRadius=function(n){return arguments.length?(g="function"==typeof n?n:l(+n),D):g},D.cornerRadius=function(n){return arguments.length?(k="function"==typeof n?n:l(+n),D):k},D.padRadius=function(n){return arguments.length?(q=null==n?null:"function"==typeof n?n:l(+n),D):q},D.startAngle=function(n){return arguments.length?(w="function"==typeof n?n:l(+n),D):w},D.endAngle=function(n){return arguments.length?(z="function"==typeof n?n:l(+n),D):z},D.padAngle=function(n){return arguments.length?(A="function"==typeof n?n:l(+n),D):A},D.context=function(n){return arguments.length?(B=null==n?null:n,D):B},D}export{g as d};
@@ -1 +0,0 @@
1
- var t;import{aG as i,_ as n,H as r,V as s,l as e,b as o,a as h,p as a,q as f,g as u,s as c,y as l,D as v,E as d,F as y,c as p,ak as w,aH as g,i as m,d as b,x as M,aI as k,aJ as x}from"./index-C5d-CFGb.js";import{p as S}from"./chunk-4BX2VUAB-CjAiz39p.js";import{p as $}from"./treemap-KMMF4GRG-CS9j6H9_.js";import{c as j}from"./cytoscape.esm-Cw0kmstm.js";import"./min-Cvpawy_w.js";import"./_baseUniq-BDYH-qGs.js";var O,A={exports:{}},T={exports:{}},I={exports:{}};function E(){return O?I.exports:(O=1,t=function(){return function(t){var i={};function n(r){if(i[r])return i[r].exports;var s=i[r]={i:r,l:!1,exports:{}};return t[r].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=t,n.c=i,n.i=function(t){return t},n.d=function(t,i,r){n.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(i,"a",i),i},n.o=function(t,i){return Object.prototype.hasOwnProperty.call(t,i)},n.p="",n(n.s=28)}([function(t,i,n){function r(){}r.QUALITY=1,r.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,r.DEFAULT_INCREMENTAL=!1,r.DEFAULT_ANIMATION_ON_LAYOUT=!0,r.DEFAULT_ANIMATION_DURING_LAYOUT=!1,r.DEFAULT_ANIMATION_PERIOD=50,r.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,r.DEFAULT_GRAPH_MARGIN=15,r.NODE_DIMENSIONS_INCLUDE_LABELS=!1,r.SIMPLE_NODE_SIZE=40,r.SIMPLE_NODE_HALF_SIZE=r.SIMPLE_NODE_SIZE/2,r.EMPTY_COMPOUND_NODE_SIZE=40,r.MIN_EDGE_LENGTH=1,r.WORLD_BOUNDARY=1e6,r.INITIAL_WORLD_BOUNDARY=r.WORLD_BOUNDARY/1e3,r.WORLD_CENTER_X=1200,r.WORLD_CENTER_Y=900,t.exports=r},function(t,i,n){var r=n(2),s=n(8),e=n(9);function o(t,i,n){r.call(this,n),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=n,this.bendpoints=[],this.source=t,this.target=i}for(var h in o.prototype=Object.create(r.prototype),r)o[h]=r[h];o.prototype.getSource=function(){return this.source},o.prototype.getTarget=function(){return this.target},o.prototype.isInterGraph=function(){return this.isInterGraph},o.prototype.getLength=function(){return this.length},o.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},o.prototype.getBendpoints=function(){return this.bendpoints},o.prototype.getLca=function(){return this.lca},o.prototype.getSourceInLca=function(){return this.sourceInLca},o.prototype.getTargetInLca=function(){return this.targetInLca},o.prototype.getOtherEnd=function(t){if(this.source===t)return this.target;if(this.target===t)return this.source;throw"Node is not incident with this edge"},o.prototype.getOtherEndInGraph=function(t,i){for(var n=this.getOtherEnd(t),r=i.getGraphManager().getRoot();;){if(n.getOwner()==i)return n;if(n.getOwner()==r)break;n=n.getOwner().getParent()}return null},o.prototype.updateLength=function(){var t=new Array(4);this.isOverlapingSourceAndTarget=s.getIntersection(this.target.getRect(),this.source.getRect(),t),this.isOverlapingSourceAndTarget||(this.lengthX=t[0]-t[2],this.lengthY=t[1]-t[3],Math.abs(this.lengthX)<1&&(this.lengthX=e.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=e.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},o.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=e.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=e.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},t.exports=o},function(t,i,n){t.exports=function(t){this.vGraphObject=t}},function(t,i,n){var r=n(2),s=n(10),e=n(13),o=n(0),h=n(16),a=n(5);function f(t,i,n,o){null==n&&null==o&&(o=i),r.call(this,o),null!=t.graphManager&&(t=t.graphManager),this.estimatedSize=s.MIN_VALUE,this.inclusionTreeDepth=s.MAX_VALUE,this.vGraphObject=o,this.edges=[],this.graphManager=t,this.rect=null!=n&&null!=i?new e(i.x,i.y,n.width,n.height):new e}for(var u in f.prototype=Object.create(r.prototype),r)f[u]=r[u];f.prototype.getEdges=function(){return this.edges},f.prototype.getChild=function(){return this.child},f.prototype.getOwner=function(){return this.owner},f.prototype.getWidth=function(){return this.rect.width},f.prototype.setWidth=function(t){this.rect.width=t},f.prototype.getHeight=function(){return this.rect.height},f.prototype.setHeight=function(t){this.rect.height=t},f.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},f.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},f.prototype.getCenter=function(){return new a(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},f.prototype.getLocation=function(){return new a(this.rect.x,this.rect.y)},f.prototype.getRect=function(){return this.rect},f.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},f.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},f.prototype.setRect=function(t,i){this.rect.x=t.x,this.rect.y=t.y,this.rect.width=i.width,this.rect.height=i.height},f.prototype.setCenter=function(t,i){this.rect.x=t-this.rect.width/2,this.rect.y=i-this.rect.height/2},f.prototype.setLocation=function(t,i){this.rect.x=t,this.rect.y=i},f.prototype.moveBy=function(t,i){this.rect.x+=t,this.rect.y+=i},f.prototype.getEdgeListToNode=function(t){var i=[],n=this;return n.edges.forEach(function(r){if(r.target==t){if(r.source!=n)throw"Incorrect edge source!";i.push(r)}}),i},f.prototype.getEdgesBetween=function(t){var i=[],n=this;return n.edges.forEach(function(r){if(r.source!=n&&r.target!=n)throw"Incorrect edge source and/or target";r.target!=t&&r.source!=t||i.push(r)}),i},f.prototype.getNeighborsList=function(){var t=new Set,i=this;return i.edges.forEach(function(n){if(n.source==i)t.add(n.target);else{if(n.target!=i)throw"Incorrect incidency!";t.add(n.source)}}),t},f.prototype.withChildren=function(){var t=new Set;if(t.add(this),null!=this.child)for(var i=this.child.getNodes(),n=0;n<i.length;n++)i[n].withChildren().forEach(function(i){t.add(i)});return t},f.prototype.getNoOfChildren=function(){var t=0;if(null==this.child)t=1;else for(var i=this.child.getNodes(),n=0;n<i.length;n++)t+=i[n].getNoOfChildren();return 0==t&&(t=1),t},f.prototype.getEstimatedSize=function(){if(this.estimatedSize==s.MIN_VALUE)throw"assert failed";return this.estimatedSize},f.prototype.calcEstimatedSize=function(){return null==this.child?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},f.prototype.scatter=function(){var t,i,n=-o.INITIAL_WORLD_BOUNDARY,r=o.INITIAL_WORLD_BOUNDARY;t=o.WORLD_CENTER_X+h.nextDouble()*(r-n)+n;var s=-o.INITIAL_WORLD_BOUNDARY,e=o.INITIAL_WORLD_BOUNDARY;i=o.WORLD_CENTER_Y+h.nextDouble()*(e-s)+s,this.rect.x=t,this.rect.y=i},f.prototype.updateBounds=function(){if(null==this.getChild())throw"assert failed";if(0!=this.getChild().getNodes().length){var t=this.getChild();if(t.updateBounds(!0),this.rect.x=t.getLeft(),this.rect.y=t.getTop(),this.setWidth(t.getRight()-t.getLeft()),this.setHeight(t.getBottom()-t.getTop()),o.NODE_DIMENSIONS_INCLUDE_LABELS){var i=t.getRight()-t.getLeft(),n=t.getBottom()-t.getTop();this.labelWidth&&("left"==this.labelPosHorizontal?(this.rect.x-=this.labelWidth,this.setWidth(i+this.labelWidth)):"center"==this.labelPosHorizontal&&this.labelWidth>i?(this.rect.x-=(this.labelWidth-i)/2,this.setWidth(this.labelWidth)):"right"==this.labelPosHorizontal&&this.setWidth(i+this.labelWidth)),this.labelHeight&&("top"==this.labelPosVertical?(this.rect.y-=this.labelHeight,this.setHeight(n+this.labelHeight)):"center"==this.labelPosVertical&&this.labelHeight>n?(this.rect.y-=(this.labelHeight-n)/2,this.setHeight(this.labelHeight)):"bottom"==this.labelPosVertical&&this.setHeight(n+this.labelHeight))}}},f.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==s.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},f.prototype.transform=function(t){var i=this.rect.x;i>o.WORLD_BOUNDARY?i=o.WORLD_BOUNDARY:i<-o.WORLD_BOUNDARY&&(i=-o.WORLD_BOUNDARY);var n=this.rect.y;n>o.WORLD_BOUNDARY?n=o.WORLD_BOUNDARY:n<-o.WORLD_BOUNDARY&&(n=-o.WORLD_BOUNDARY);var r=new a(i,n),s=t.inverseTransformPoint(r);this.setLocation(s.x,s.y)},f.prototype.getLeft=function(){return this.rect.x},f.prototype.getRight=function(){return this.rect.x+this.rect.width},f.prototype.getTop=function(){return this.rect.y},f.prototype.getBottom=function(){return this.rect.y+this.rect.height},f.prototype.getParent=function(){return null==this.owner?null:this.owner.getParent()},t.exports=f},function(t,i,n){var r=n(0);function s(){}for(var e in r)s[e]=r[e];s.MAX_ITERATIONS=2500,s.DEFAULT_EDGE_LENGTH=50,s.DEFAULT_SPRING_STRENGTH=.45,s.DEFAULT_REPULSION_STRENGTH=4500,s.DEFAULT_GRAVITY_STRENGTH=.4,s.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,s.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,s.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,s.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,s.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,s.COOLING_ADAPTATION_FACTOR=.33,s.ADAPTATION_LOWER_NODE_LIMIT=1e3,s.ADAPTATION_UPPER_NODE_LIMIT=5e3,s.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,s.MAX_NODE_DISPLACEMENT=3*s.MAX_NODE_DISPLACEMENT_INCREMENTAL,s.MIN_REPULSION_DIST=s.DEFAULT_EDGE_LENGTH/10,s.CONVERGENCE_CHECK_PERIOD=100,s.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,s.MIN_EDGE_LENGTH=1,s.GRID_CALCULATION_CHECK_PERIOD=10,t.exports=s},function(t,i,n){function r(t,i){null==t&&null==i?(this.x=0,this.y=0):(this.x=t,this.y=i)}r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.setX=function(t){this.x=t},r.prototype.setY=function(t){this.y=t},r.prototype.getDifference=function(t){return new DimensionD(this.x-t.x,this.y-t.y)},r.prototype.getCopy=function(){return new r(this.x,this.y)},r.prototype.translate=function(t){return this.x+=t.width,this.y+=t.height,this},t.exports=r},function(t,i,n){var r=n(2),s=n(10),e=n(0),o=n(7),h=n(3),a=n(1),f=n(13),u=n(12),c=n(11);function l(t,i,n){r.call(this,n),this.estimatedSize=s.MIN_VALUE,this.margin=e.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=t,null!=i&&i instanceof o?this.graphManager=i:null!=i&&i instanceof Layout&&(this.graphManager=i.graphManager)}for(var v in l.prototype=Object.create(r.prototype),r)l[v]=r[v];l.prototype.getNodes=function(){return this.nodes},l.prototype.getEdges=function(){return this.edges},l.prototype.getGraphManager=function(){return this.graphManager},l.prototype.getParent=function(){return this.parent},l.prototype.getLeft=function(){return this.left},l.prototype.getRight=function(){return this.right},l.prototype.getTop=function(){return this.top},l.prototype.getBottom=function(){return this.bottom},l.prototype.isConnected=function(){return this.isConnected},l.prototype.add=function(t,i,n){if(null==i&&null==n){var r=t;if(null==this.graphManager)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(r)>-1)throw"Node already in graph!";return r.owner=this,this.getNodes().push(r),r}var s=t;if(!(this.getNodes().indexOf(i)>-1&&this.getNodes().indexOf(n)>-1))throw"Source or target not in graph!";if(i.owner!=n.owner||i.owner!=this)throw"Both owners must be this graph!";return i.owner!=n.owner?null:(s.source=i,s.target=n,s.isInterGraph=!1,this.getEdges().push(s),i.edges.push(s),n!=i&&n.edges.push(s),s)},l.prototype.remove=function(t){var i=t;if(t instanceof h){if(null==i)throw"Node is null!";if(null==i.owner||i.owner!=this)throw"Owner graph is invalid!";if(null==this.graphManager)throw"Owner graph manager is invalid!";for(var n=i.edges.slice(),r=n.length,s=0;s<r;s++)(e=n[s]).isInterGraph?this.graphManager.remove(e):e.source.owner.remove(e);if(-1==(o=this.nodes.indexOf(i)))throw"Node not in owner node list!";this.nodes.splice(o,1)}else if(t instanceof a){var e;if(null==(e=t))throw"Edge is null!";if(null==e.source||null==e.target)throw"Source and/or target is null!";if(null==e.source.owner||null==e.target.owner||e.source.owner!=this||e.target.owner!=this)throw"Source and/or target owner is invalid!";var o,f=e.source.edges.indexOf(e),u=e.target.edges.indexOf(e);if(!(f>-1&&u>-1))throw"Source and/or target doesn't know this edge!";if(e.source.edges.splice(f,1),e.target!=e.source&&e.target.edges.splice(u,1),-1==(o=e.source.owner.getEdges().indexOf(e)))throw"Not in owner's edge list!";e.source.owner.getEdges().splice(o,1)}},l.prototype.updateLeftTop=function(){for(var t,i,n,r=s.MAX_VALUE,e=s.MAX_VALUE,o=this.getNodes(),h=o.length,a=0;a<h;a++){var f=o[a];r>(t=f.getTop())&&(r=t),e>(i=f.getLeft())&&(e=i)}return r==s.MAX_VALUE?null:(n=null!=o[0].getParent().paddingLeft?o[0].getParent().paddingLeft:this.margin,this.left=e-n,this.top=r-n,new u(this.left,this.top))},l.prototype.updateBounds=function(t){for(var i,n,r,e,o,h=s.MAX_VALUE,a=-s.MAX_VALUE,u=s.MAX_VALUE,c=-s.MAX_VALUE,l=this.nodes,v=l.length,d=0;d<v;d++){var y=l[d];t&&null!=y.child&&y.updateBounds(),h>(i=y.getLeft())&&(h=i),a<(n=y.getRight())&&(a=n),u>(r=y.getTop())&&(u=r),c<(e=y.getBottom())&&(c=e)}var p=new f(h,u,a-h,c-u);h==s.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),o=null!=l[0].getParent().paddingLeft?l[0].getParent().paddingLeft:this.margin,this.left=p.x-o,this.right=p.x+p.width+o,this.top=p.y-o,this.bottom=p.y+p.height+o},l.calculateBounds=function(t){for(var i,n,r,e,o=s.MAX_VALUE,h=-s.MAX_VALUE,a=s.MAX_VALUE,u=-s.MAX_VALUE,c=t.length,l=0;l<c;l++){var v=t[l];o>(i=v.getLeft())&&(o=i),h<(n=v.getRight())&&(h=n),a>(r=v.getTop())&&(a=r),u<(e=v.getBottom())&&(u=e)}return new f(o,a,h-o,u-a)},l.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},l.prototype.getEstimatedSize=function(){if(this.estimatedSize==s.MIN_VALUE)throw"assert failed";return this.estimatedSize},l.prototype.calcEstimatedSize=function(){for(var t=0,i=this.nodes,n=i.length,r=0;r<n;r++)t+=i[r].calcEstimatedSize();return this.estimatedSize=0==t?e.EMPTY_COMPOUND_NODE_SIZE:t/Math.sqrt(this.nodes.length),this.estimatedSize},l.prototype.updateConnected=function(){var t=this;if(0!=this.nodes.length){var i,n,r=new c,s=new Set,e=this.nodes[0];for(e.withChildren().forEach(function(t){r.push(t),s.add(t)});0!==r.length;)for(var o=(i=(e=r.shift()).getEdges()).length,h=0;h<o;h++)null==(n=i[h].getOtherEndInGraph(e,this))||s.has(n)||n.withChildren().forEach(function(t){r.push(t),s.add(t)});if(this.isConnected=!1,s.size>=this.nodes.length){var a=0;s.forEach(function(i){i.owner==t&&a++}),a==this.nodes.length&&(this.isConnected=!0)}}else this.isConnected=!0},t.exports=l},function(t,i,n){var r,s=n(1);function e(t){r=n(6),this.layout=t,this.graphs=[],this.edges=[]}e.prototype.addRoot=function(){var t=this.layout.newGraph(),i=this.layout.newNode(null),n=this.add(t,i);return this.setRootGraph(n),this.rootGraph},e.prototype.add=function(t,i,n,r,s){if(null==n&&null==r&&null==s){if(null==t)throw"Graph is null!";if(null==i)throw"Parent node is null!";if(this.graphs.indexOf(t)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(t),null!=t.parent)throw"Already has a parent!";if(null!=i.child)throw"Already has a child!";return t.parent=i,i.child=t,t}s=n,n=t;var e=(r=i).getOwner(),o=s.getOwner();if(null==e||e.getGraphManager()!=this)throw"Source not in this graph mgr!";if(null==o||o.getGraphManager()!=this)throw"Target not in this graph mgr!";if(e==o)return n.isInterGraph=!1,e.add(n,r,s);if(n.isInterGraph=!0,n.source=r,n.target=s,this.edges.indexOf(n)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(n),null==n.source||null==n.target)throw"Edge source and/or target is null!";if(-1!=n.source.edges.indexOf(n)||-1!=n.target.edges.indexOf(n))throw"Edge already in source and/or target incidency list!";return n.source.edges.push(n),n.target.edges.push(n),n},e.prototype.remove=function(t){if(t instanceof r){var i=t;if(i.getGraphManager()!=this)throw"Graph not in this graph mgr";if(i!=this.rootGraph&&(null==i.parent||i.parent.graphManager!=this))throw"Invalid parent node!";for(var n,e=[],o=(e=e.concat(i.getEdges())).length,h=0;h<o;h++)n=e[h],i.remove(n);var a,f=[];for(o=(f=f.concat(i.getNodes())).length,h=0;h<o;h++)a=f[h],i.remove(a);i==this.rootGraph&&this.setRootGraph(null);var u=this.graphs.indexOf(i);this.graphs.splice(u,1),i.parent=null}else if(t instanceof s){if(null==(n=t))throw"Edge is null!";if(!n.isInterGraph)throw"Not an inter-graph edge!";if(null==n.source||null==n.target)throw"Source and/or target is null!";if(-1==n.source.edges.indexOf(n)||-1==n.target.edges.indexOf(n))throw"Source and/or target doesn't know this edge!";if(u=n.source.edges.indexOf(n),n.source.edges.splice(u,1),u=n.target.edges.indexOf(n),n.target.edges.splice(u,1),null==n.source.owner||null==n.source.owner.getGraphManager())throw"Edge owner graph or owner graph manager is null!";if(-1==n.source.owner.getGraphManager().edges.indexOf(n))throw"Not in owner graph manager's edge list!";u=n.source.owner.getGraphManager().edges.indexOf(n),n.source.owner.getGraphManager().edges.splice(u,1)}},e.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},e.prototype.getGraphs=function(){return this.graphs},e.prototype.getAllNodes=function(){if(null==this.allNodes){for(var t=[],i=this.getGraphs(),n=i.length,r=0;r<n;r++)t=t.concat(i[r].getNodes());this.allNodes=t}return this.allNodes},e.prototype.resetAllNodes=function(){this.allNodes=null},e.prototype.resetAllEdges=function(){this.allEdges=null},e.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},e.prototype.getAllEdges=function(){if(null==this.allEdges){var t=[],i=this.getGraphs();i.length;for(var n=0;n<i.length;n++)t=t.concat(i[n].getEdges());t=t.concat(this.edges),this.allEdges=t}return this.allEdges},e.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},e.prototype.setAllNodesToApplyGravitation=function(t){if(null!=this.allNodesToApplyGravitation)throw"assert failed";this.allNodesToApplyGravitation=t},e.prototype.getRoot=function(){return this.rootGraph},e.prototype.setRootGraph=function(t){if(t.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=t,null==t.parent&&(t.parent=this.layout.newNode("Root node"))},e.prototype.getLayout=function(){return this.layout},e.prototype.isOneAncestorOfOther=function(t,i){if(null==t||null==i)throw"assert failed";if(t==i)return!0;for(var n,r=t.getOwner();null!=(n=r.getParent());){if(n==i)return!0;if(null==(r=n.getOwner()))break}for(r=i.getOwner();null!=(n=r.getParent());){if(n==t)return!0;if(null==(r=n.getOwner()))break}return!1},e.prototype.calcLowestCommonAncestors=function(){for(var t,i,n,r,s,e=this.getAllEdges(),o=e.length,h=0;h<o;h++)if(i=(t=e[h]).source,n=t.target,t.lca=null,t.sourceInLca=i,t.targetInLca=n,i!=n){for(r=i.getOwner();null==t.lca;){for(t.targetInLca=n,s=n.getOwner();null==t.lca;){if(s==r){t.lca=s;break}if(s==this.rootGraph)break;if(null!=t.lca)throw"assert failed";t.targetInLca=s.getParent(),s=t.targetInLca.getOwner()}if(r==this.rootGraph)break;null==t.lca&&(t.sourceInLca=r.getParent(),r=t.sourceInLca.getOwner())}if(null==t.lca)throw"assert failed"}else t.lca=i.getOwner()},e.prototype.calcLowestCommonAncestor=function(t,i){if(t==i)return t.getOwner();for(var n=t.getOwner();null!=n;){for(var r=i.getOwner();null!=r;){if(r==n)return r;r=r.getParent().getOwner()}n=n.getParent().getOwner()}return n},e.prototype.calcInclusionTreeDepths=function(t,i){var n;null==t&&null==i&&(t=this.rootGraph,i=1);for(var r=t.getNodes(),s=r.length,e=0;e<s;e++)(n=r[e]).inclusionTreeDepth=i,null!=n.child&&this.calcInclusionTreeDepths(n.child,i+1)},e.prototype.includesInvalidEdge=function(){for(var t,i=[],n=this.edges.length,r=0;r<n;r++)t=this.edges[r],this.isOneAncestorOfOther(t.source,t.target)&&i.push(t);for(r=0;r<i.length;r++)this.remove(i[r]);return!1},t.exports=e},function(t,i,n){var r=n(12);function s(){}s.calcSeparationAmount=function(t,i,n,r){if(!t.intersects(i))throw"assert failed";var s=new Array(2);this.decideDirectionsForOverlappingNodes(t,i,s),n[0]=Math.min(t.getRight(),i.getRight())-Math.max(t.x,i.x),n[1]=Math.min(t.getBottom(),i.getBottom())-Math.max(t.y,i.y),t.getX()<=i.getX()&&t.getRight()>=i.getRight()?n[0]+=Math.min(i.getX()-t.getX(),t.getRight()-i.getRight()):i.getX()<=t.getX()&&i.getRight()>=t.getRight()&&(n[0]+=Math.min(t.getX()-i.getX(),i.getRight()-t.getRight())),t.getY()<=i.getY()&&t.getBottom()>=i.getBottom()?n[1]+=Math.min(i.getY()-t.getY(),t.getBottom()-i.getBottom()):i.getY()<=t.getY()&&i.getBottom()>=t.getBottom()&&(n[1]+=Math.min(t.getY()-i.getY(),i.getBottom()-t.getBottom()));var e=Math.abs((i.getCenterY()-t.getCenterY())/(i.getCenterX()-t.getCenterX()));i.getCenterY()===t.getCenterY()&&i.getCenterX()===t.getCenterX()&&(e=1);var o=e*n[0],h=n[1]/e;n[0]<h?h=n[0]:o=n[1],n[0]=-1*s[0]*(h/2+r),n[1]=-1*s[1]*(o/2+r)},s.decideDirectionsForOverlappingNodes=function(t,i,n){t.getCenterX()<i.getCenterX()?n[0]=-1:n[0]=1,t.getCenterY()<i.getCenterY()?n[1]=-1:n[1]=1},s.getIntersection2=function(t,i,n){var r=t.getCenterX(),s=t.getCenterY(),e=i.getCenterX(),o=i.getCenterY();if(t.intersects(i))return n[0]=r,n[1]=s,n[2]=e,n[3]=o,!0;var h=t.getX(),a=t.getY(),f=t.getRight(),u=t.getX(),c=t.getBottom(),l=t.getRight(),v=t.getWidthHalf(),d=t.getHeightHalf(),y=i.getX(),p=i.getY(),w=i.getRight(),g=i.getX(),m=i.getBottom(),b=i.getRight(),M=i.getWidthHalf(),k=i.getHeightHalf(),x=!1,S=!1;if(r===e){if(s>o)return n[0]=r,n[1]=a,n[2]=e,n[3]=m,!1;if(s<o)return n[0]=r,n[1]=c,n[2]=e,n[3]=p,!1}else if(s===o){if(r>e)return n[0]=h,n[1]=s,n[2]=w,n[3]=o,!1;if(r<e)return n[0]=f,n[1]=s,n[2]=y,n[3]=o,!1}else{var $=t.height/t.width,j=i.height/i.width,O=(o-s)/(e-r),A=void 0,T=void 0,I=void 0,E=void 0,L=void 0,D=void 0;if(-$===O?r>e?(n[0]=u,n[1]=c,x=!0):(n[0]=f,n[1]=a,x=!0):$===O&&(r>e?(n[0]=h,n[1]=a,x=!0):(n[0]=l,n[1]=c,x=!0)),-j===O?e>r?(n[2]=g,n[3]=m,S=!0):(n[2]=w,n[3]=p,S=!0):j===O&&(e>r?(n[2]=y,n[3]=p,S=!0):(n[2]=b,n[3]=m,S=!0)),x&&S)return!1;if(r>e?s>o?(A=this.getCardinalDirection($,O,4),T=this.getCardinalDirection(j,O,2)):(A=this.getCardinalDirection(-$,O,3),T=this.getCardinalDirection(-j,O,1)):s>o?(A=this.getCardinalDirection(-$,O,1),T=this.getCardinalDirection(-j,O,3)):(A=this.getCardinalDirection($,O,2),T=this.getCardinalDirection(j,O,4)),!x)switch(A){case 1:E=a,I=r+-d/O,n[0]=I,n[1]=E;break;case 2:I=l,E=s+v*O,n[0]=I,n[1]=E;break;case 3:E=c,I=r+d/O,n[0]=I,n[1]=E;break;case 4:I=u,E=s+-v*O,n[0]=I,n[1]=E}if(!S)switch(T){case 1:D=p,L=e+-k/O,n[2]=L,n[3]=D;break;case 2:L=b,D=o+M*O,n[2]=L,n[3]=D;break;case 3:D=m,L=e+k/O,n[2]=L,n[3]=D;break;case 4:L=g,D=o+-M*O,n[2]=L,n[3]=D}}return!1},s.getCardinalDirection=function(t,i,n){return t>i?n:1+n%4},s.getIntersection=function(t,i,n,s){if(null==s)return this.getIntersection2(t,i,n);var e,o,h,a,f,u,c,l=t.x,v=t.y,d=i.x,y=i.y,p=n.x,w=n.y,g=s.x,m=s.y;return 0===(c=(e=y-v)*(a=p-g)-(o=m-w)*(h=l-d))?null:new r((h*(u=g*w-p*m)-a*(f=d*v-l*y))/c,(o*f-e*u)/c)},s.angleOfVector=function(t,i,n,r){var s=void 0;return t!==n?(s=Math.atan((r-i)/(n-t)),n<t?s+=Math.PI:r<i&&(s+=this.TWO_PI)):s=r<i?this.ONE_AND_HALF_PI:this.HALF_PI,s},s.doIntersect=function(t,i,n,r){var s=t.x,e=t.y,o=i.x,h=i.y,a=n.x,f=n.y,u=r.x,c=r.y,l=(o-s)*(c-f)-(u-a)*(h-e);if(0===l)return!1;var v=((c-f)*(u-s)+(a-u)*(c-e))/l,d=((e-h)*(u-s)+(o-s)*(c-e))/l;return 0<v&&v<1&&0<d&&d<1},s.findCircleLineIntersections=function(t,i,n,r,s,e,o){var h=(n-t)*(n-t)+(r-i)*(r-i),a=2*((t-s)*(n-t)+(i-e)*(r-i)),f=(t-s)*(t-s)+(i-e)*(i-e)-o*o;if(a*a-4*h*f>=0){var u=(-a+Math.sqrt(a*a-4*h*f))/(2*h),c=(-a-Math.sqrt(a*a-4*h*f))/(2*h);return u>=0&&u<=1?[u]:c>=0&&c<=1?[c]:null}return null},s.HALF_PI=.5*Math.PI,s.ONE_AND_HALF_PI=1.5*Math.PI,s.TWO_PI=2*Math.PI,s.THREE_PI=3*Math.PI,t.exports=s},function(t,i,n){function r(){}r.sign=function(t){return t>0?1:t<0?-1:0},r.floor=function(t){return t<0?Math.ceil(t):Math.floor(t)},r.ceil=function(t){return t<0?Math.floor(t):Math.ceil(t)},t.exports=r},function(t,i,n){function r(){}r.MAX_VALUE=2147483647,r.MIN_VALUE=-2147483648,t.exports=r},function(t,i,n){var r=function(){function t(t,i){for(var n=0;n<i.length;n++){var r=i[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(i,n,r){return n&&t(i.prototype,n),r&&t(i,r),i}}(),s=function(t){return{value:t,next:null,prev:null}},e=function(t,i,n,r){return null!==t?t.next=i:r.head=i,null!==n?n.prev=i:r.tail=i,i.prev=t,i.next=n,r.length++,i},o=function(t,i){var n=t.prev,r=t.next;return null!==n?n.next=r:i.head=r,null!==r?r.prev=n:i.tail=n,t.prev=t.next=null,i.length--,t},h=function(){function t(i){var n=this;!function(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}(this,t),this.length=0,this.head=null,this.tail=null,null!=i&&i.forEach(function(t){return n.push(t)})}return r(t,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(t,i){return e(i.prev,s(t),i,this)}},{key:"insertAfter",value:function(t,i){return e(i,s(t),i.next,this)}},{key:"insertNodeBefore",value:function(t,i){return e(i.prev,t,i,this)}},{key:"insertNodeAfter",value:function(t,i){return e(i,t,i.next,this)}},{key:"push",value:function(t){return e(this.tail,s(t),null,this)}},{key:"unshift",value:function(t){return e(null,s(t),this.head,this)}},{key:"remove",value:function(t){return o(t,this)}},{key:"pop",value:function(){return o(this.tail,this).value}},{key:"popNode",value:function(){return o(this.tail,this)}},{key:"shift",value:function(){return o(this.head,this).value}},{key:"shiftNode",value:function(){return o(this.head,this)}},{key:"get_object_at",value:function(t){if(t<=this.length()){for(var i=1,n=this.head;i<t;)n=n.next,i++;return n.value}}},{key:"set_object_at",value:function(t,i){if(t<=this.length()){for(var n=1,r=this.head;n<t;)r=r.next,n++;r.value=i}}}]),t}();t.exports=h},function(t,i,n){function r(t,i,n){this.x=null,this.y=null,null==t&&null==i&&null==n?(this.x=0,this.y=0):"number"==typeof t&&"number"==typeof i&&null==n?(this.x=t,this.y=i):"Point"==t.constructor.name&&null==i&&null==n&&(n=t,this.x=n.x,this.y=n.y)}r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.getLocation=function(){return new r(this.x,this.y)},r.prototype.setLocation=function(t,i,n){"Point"==t.constructor.name&&null==i&&null==n?(n=t,this.setLocation(n.x,n.y)):"number"==typeof t&&"number"==typeof i&&null==n&&(parseInt(t)==t&&parseInt(i)==i?this.move(t,i):(this.x=Math.floor(t+.5),this.y=Math.floor(i+.5)))},r.prototype.move=function(t,i){this.x=t,this.y=i},r.prototype.translate=function(t,i){this.x+=t,this.y+=i},r.prototype.equals=function(t){if("Point"==t.constructor.name){var i=t;return this.x==i.x&&this.y==i.y}return this==t},r.prototype.toString=function(){return(new r).constructor.name+"[x="+this.x+",y="+this.y+"]"},t.exports=r},function(t,i,n){function r(t,i,n,r){this.x=0,this.y=0,this.width=0,this.height=0,null!=t&&null!=i&&null!=n&&null!=r&&(this.x=t,this.y=i,this.width=n,this.height=r)}r.prototype.getX=function(){return this.x},r.prototype.setX=function(t){this.x=t},r.prototype.getY=function(){return this.y},r.prototype.setY=function(t){this.y=t},r.prototype.getWidth=function(){return this.width},r.prototype.setWidth=function(t){this.width=t},r.prototype.getHeight=function(){return this.height},r.prototype.setHeight=function(t){this.height=t},r.prototype.getRight=function(){return this.x+this.width},r.prototype.getBottom=function(){return this.y+this.height},r.prototype.intersects=function(t){return!(this.getRight()<t.x||this.getBottom()<t.y||t.getRight()<this.x||t.getBottom()<this.y)},r.prototype.getCenterX=function(){return this.x+this.width/2},r.prototype.getMinX=function(){return this.getX()},r.prototype.getMaxX=function(){return this.getX()+this.width},r.prototype.getCenterY=function(){return this.y+this.height/2},r.prototype.getMinY=function(){return this.getY()},r.prototype.getMaxY=function(){return this.getY()+this.height},r.prototype.getWidthHalf=function(){return this.width/2},r.prototype.getHeightHalf=function(){return this.height/2},t.exports=r},function(t,i,n){var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function s(){}s.lastID=0,s.createID=function(t){return s.isPrimitive(t)?t:(null!=t.uniqueID||(t.uniqueID=s.getString(),s.lastID++),t.uniqueID)},s.getString=function(t){return null==t&&(t=s.lastID),"Object#"+t},s.isPrimitive=function(t){var i=void 0===t?"undefined":r(t);return null==t||"object"!=i&&"function"!=i},t.exports=s},function(t,i,n){function r(t){if(Array.isArray(t)){for(var i=0,n=Array(t.length);i<t.length;i++)n[i]=t[i];return n}return Array.from(t)}var s=n(0),e=n(7),o=n(3),h=n(1),a=n(6),f=n(5),u=n(17),c=n(29);function l(t){c.call(this),this.layoutQuality=s.QUALITY,this.createBendsAsNeeded=s.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=s.DEFAULT_INCREMENTAL,this.animationOnLayout=s.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=s.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=s.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=s.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new e(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,null!=t&&(this.isRemoteUse=t)}l.RANDOM_SEED=1,l.prototype=Object.create(c.prototype),l.prototype.getGraphManager=function(){return this.graphManager},l.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},l.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},l.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},l.prototype.newGraphManager=function(){var t=new e(this);return this.graphManager=t,t},l.prototype.newGraph=function(t){return new a(null,this.graphManager,t)},l.prototype.newNode=function(t){return new o(this.graphManager,t)},l.prototype.newEdge=function(t){return new h(null,null,t)},l.prototype.checkLayoutSuccess=function(){return null==this.graphManager.getRoot()||0==this.graphManager.getRoot().getNodes().length||this.graphManager.includesInvalidEdge()},l.prototype.runLayout=function(){var t;return this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters(),t=!this.checkLayoutSuccess()&&this.layout(),"during"!==s.ANIMATE&&(t&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,t)},l.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},l.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var t=this.graphManager.getAllEdges(),i=0;i<t.length;i++)t[i];var n=this.graphManager.getRoot().getNodes();for(i=0;i<n.length;i++)n[i];this.update(this.graphManager.getRoot())}},l.prototype.update=function(t){if(null==t)this.update2();else if(t instanceof o){var i=t;if(null!=i.getChild())for(var n=i.getChild().getNodes(),r=0;r<n.length;r++)update(n[r]);null!=i.vGraphObject&&i.vGraphObject.update(i)}else if(t instanceof h){var s=t;null!=s.vGraphObject&&s.vGraphObject.update(s)}else if(t instanceof a){var e=t;null!=e.vGraphObject&&e.vGraphObject.update(e)}},l.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=s.QUALITY,this.animationDuringLayout=s.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=s.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=s.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=s.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=s.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=s.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},l.prototype.transform=function(t){if(null==t)this.transform(new f(0,0));else{var i=new u,n=this.graphManager.getRoot().updateLeftTop();if(null!=n){i.setWorldOrgX(t.x),i.setWorldOrgY(t.y),i.setDeviceOrgX(n.x),i.setDeviceOrgY(n.y);for(var r=this.getAllNodes(),s=0;s<r.length;s++)r[s].transform(i)}}},l.prototype.positionNodesRandomly=function(t){if(null==t)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var i,n,r=t.getNodes(),s=0;s<r.length;s++)null==(n=(i=r[s]).getChild())||0==n.getNodes().length?i.scatter():(this.positionNodesRandomly(n),i.updateBounds())},l.prototype.getFlatForest=function(){for(var t=[],i=!0,n=this.graphManager.getRoot().getNodes(),s=!0,e=0;e<n.length;e++)null!=n[e].getChild()&&(s=!1);if(!s)return t;var o=new Set,h=[],a=new Map,f=[];for(f=f.concat(n);f.length>0&&i;){for(h.push(f[0]);h.length>0&&i;){var u=h[0];h.splice(0,1),o.add(u);var c=u.getEdges();for(e=0;e<c.length;e++){var l=c[e].getOtherEnd(u);if(a.get(u)!=l){if(o.has(l)){i=!1;break}h.push(l),a.set(l,u)}}}if(i){var v=[].concat(r(o));for(t.push(v),e=0;e<v.length;e++){var d=v[e],y=f.indexOf(d);y>-1&&f.splice(y,1)}o=new Set,a=new Map}else t=[]}return t},l.prototype.createDummyNodesForBendpoints=function(t){for(var i=[],n=t.source,r=this.graphManager.calcLowestCommonAncestor(t.source,t.target),s=0;s<t.bendpoints.length;s++){var e=this.newNode(null);e.setRect(new Point(0,0),new Dimension(1,1)),r.add(e);var o=this.newEdge(null);this.graphManager.add(o,n,e),i.add(e),n=e}return o=this.newEdge(null),this.graphManager.add(o,n,t.target),this.edgeToDummyNodes.set(t,i),t.isInterGraph()?this.graphManager.remove(t):r.remove(t),i},l.prototype.createBendpointsFromDummyNodes=function(){var t=[];t=t.concat(this.graphManager.getAllEdges()),t=[].concat(r(this.edgeToDummyNodes.keys())).concat(t);for(var i=0;i<t.length;i++){var n=t[i];if(n.bendpoints.length>0){for(var s=this.edgeToDummyNodes.get(n),e=0;e<s.length;e++){var o=s[e],h=new f(o.getCenterX(),o.getCenterY()),a=n.bendpoints.get(e);a.x=h.x,a.y=h.y,o.getOwner().remove(o)}this.graphManager.add(n,n.source,n.target)}}},l.transform=function(t,i,n,r){if(null!=n&&null!=r){var s=i;return t<=50?s-=(i-i/n)/50*(50-t):s+=(i*r-i)/50*(t-50),s}var e,o;return t<=50?(e=9*i/500,o=i/10):(e=9*i/50,o=-8*i),e*t+o},l.findCenterOfTree=function(t){var i=[];i=i.concat(t);var n=[],r=new Map,s=!1,e=null;1!=i.length&&2!=i.length||(s=!0,e=i[0]);for(var o=0;o<i.length;o++){var h=(u=i[o]).getNeighborsList().size;r.set(u,u.getNeighborsList().size),1==h&&n.push(u)}var a=[];for(a=a.concat(n);!s;){var f=[];for(f=f.concat(a),a=[],o=0;o<i.length;o++){var u=i[o],c=i.indexOf(u);c>=0&&i.splice(c,1),u.getNeighborsList().forEach(function(t){if(n.indexOf(t)<0){var i=r.get(t)-1;1==i&&a.push(t),r.set(t,i)}})}n=n.concat(a),1!=i.length&&2!=i.length||(s=!0,e=i[0])}return e},l.prototype.setGraphManager=function(t){this.graphManager=t},t.exports=l},function(t,i,n){function r(){}r.seed=1,r.x=0,r.nextDouble=function(){return r.x=1e4*Math.sin(r.seed++),r.x-Math.floor(r.x)},t.exports=r},function(t,i,n){var r=n(5);function s(t,i){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}s.prototype.getWorldOrgX=function(){return this.lworldOrgX},s.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},s.prototype.getWorldOrgY=function(){return this.lworldOrgY},s.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},s.prototype.getWorldExtX=function(){return this.lworldExtX},s.prototype.setWorldExtX=function(t){this.lworldExtX=t},s.prototype.getWorldExtY=function(){return this.lworldExtY},s.prototype.setWorldExtY=function(t){this.lworldExtY=t},s.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},s.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},s.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},s.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},s.prototype.getDeviceExtX=function(){return this.ldeviceExtX},s.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},s.prototype.getDeviceExtY=function(){return this.ldeviceExtY},s.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},s.prototype.transformX=function(t){var i=0,n=this.lworldExtX;return 0!=n&&(i=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/n),i},s.prototype.transformY=function(t){var i=0,n=this.lworldExtY;return 0!=n&&(i=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/n),i},s.prototype.inverseTransformX=function(t){var i=0,n=this.ldeviceExtX;return 0!=n&&(i=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/n),i},s.prototype.inverseTransformY=function(t){var i=0,n=this.ldeviceExtY;return 0!=n&&(i=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/n),i},s.prototype.inverseTransformPoint=function(t){return new r(this.inverseTransformX(t.x),this.inverseTransformY(t.y))},t.exports=s},function(t,i,n){var r=n(15),s=n(4),e=n(0),o=n(8),h=n(9);function a(){r.call(this),this.useSmartIdealEdgeLengthCalculation=s.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=s.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=s.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=s.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*s.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=s.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=s.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=s.MAX_ITERATIONS}for(var f in a.prototype=Object.create(r.prototype),r)a[f]=r[f];a.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=s.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},a.prototype.calcIdealEdgeLengths=function(){for(var t,i,n,r,o,h,a,f=this.getGraphManager().getAllEdges(),u=0;u<f.length;u++)i=(t=f[u]).idealLength,t.isInterGraph&&(r=t.getSource(),o=t.getTarget(),h=t.getSourceInLca().getEstimatedSize(),a=t.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(t.idealLength+=h+a-2*e.SIMPLE_NODE_SIZE),n=t.getLca().getInclusionTreeDepth(),t.idealLength+=i*s.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(r.getInclusionTreeDepth()+o.getInclusionTreeDepth()-2*n))},a.prototype.initSpringEmbedder=function(){var t=this.getAllNodes().length;this.incremental?(t>s.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*s.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-s.ADAPTATION_LOWER_NODE_LIMIT)/(s.ADAPTATION_UPPER_NODE_LIMIT-s.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-s.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=s.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>s.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(s.COOLING_ADAPTATION_FACTOR,1-(t-s.ADAPTATION_LOWER_NODE_LIMIT)/(s.ADAPTATION_UPPER_NODE_LIMIT-s.ADAPTATION_LOWER_NODE_LIMIT)*(1-s.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=s.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(5*this.getAllNodes().length,this.maxIterations),this.displacementThresholdPerNode=3*s.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},a.prototype.calcSpringForces=function(){for(var t,i=this.getAllEdges(),n=0;n<i.length;n++)t=i[n],this.calcSpringForce(t,t.idealLength)},a.prototype.calcRepulsionForces=function(){var t,i,n,r,e,o=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],h=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=this.getAllNodes();if(this.useFRGridVariant)for(this.totalIterations%s.GRID_CALCULATION_CHECK_PERIOD==1&&o&&this.updateGrid(),e=new Set,t=0;t<a.length;t++)n=a[t],this.calculateRepulsionForceOfANode(n,e,o,h),e.add(n);else for(t=0;t<a.length;t++)for(n=a[t],i=t+1;i<a.length;i++)r=a[i],n.getOwner()==r.getOwner()&&this.calcRepulsionForce(n,r)},a.prototype.calcGravitationalForces=function(){for(var t,i=this.getAllNodesToApplyGravitation(),n=0;n<i.length;n++)t=i[n],this.calcGravitationalForce(t)},a.prototype.moveNodes=function(){for(var t=this.getAllNodes(),i=0;i<t.length;i++)t[i].move()},a.prototype.calcSpringForce=function(t,i){var n,r,s,e,o=t.getSource(),h=t.getTarget();if(this.uniformLeafNodeSizes&&null==o.getChild()&&null==h.getChild())t.updateLengthSimple();else if(t.updateLength(),t.isOverlapingSourceAndTarget)return;0!=(n=t.getLength())&&(s=(r=t.edgeElasticity*(n-i))*(t.lengthX/n),e=r*(t.lengthY/n),o.springForceX+=s,o.springForceY+=e,h.springForceX-=s,h.springForceY-=e)},a.prototype.calcRepulsionForce=function(t,i){var n,r,e,a,f,u,c,l=t.getRect(),v=i.getRect(),d=new Array(2),y=new Array(4);if(l.intersects(v)){o.calcSeparationAmount(l,v,d,s.DEFAULT_EDGE_LENGTH/2),u=2*d[0],c=2*d[1];var p=t.noOfChildren*i.noOfChildren/(t.noOfChildren+i.noOfChildren);t.repulsionForceX-=p*u,t.repulsionForceY-=p*c,i.repulsionForceX+=p*u,i.repulsionForceY+=p*c}else this.uniformLeafNodeSizes&&null==t.getChild()&&null==i.getChild()?(n=v.getCenterX()-l.getCenterX(),r=v.getCenterY()-l.getCenterY()):(o.getIntersection(l,v,y),n=y[2]-y[0],r=y[3]-y[1]),Math.abs(n)<s.MIN_REPULSION_DIST&&(n=h.sign(n)*s.MIN_REPULSION_DIST),Math.abs(r)<s.MIN_REPULSION_DIST&&(r=h.sign(r)*s.MIN_REPULSION_DIST),e=n*n+r*r,a=Math.sqrt(e),u=(f=(t.nodeRepulsion/2+i.nodeRepulsion/2)*t.noOfChildren*i.noOfChildren/e)*n/a,c=f*r/a,t.repulsionForceX-=u,t.repulsionForceY-=c,i.repulsionForceX+=u,i.repulsionForceY+=c},a.prototype.calcGravitationalForce=function(t){var i,n,r,s,e,o,h,a;n=((i=t.getOwner()).getRight()+i.getLeft())/2,r=(i.getTop()+i.getBottom())/2,s=t.getCenterX()-n,e=t.getCenterY()-r,o=Math.abs(s)+t.getWidth()/2,h=Math.abs(e)+t.getHeight()/2,t.getOwner()==this.graphManager.getRoot()?(o>(a=i.getEstimatedSize()*this.gravityRangeFactor)||h>a)&&(t.gravitationForceX=-this.gravityConstant*s,t.gravitationForceY=-this.gravityConstant*e):(o>(a=i.getEstimatedSize()*this.compoundGravityRangeFactor)||h>a)&&(t.gravitationForceX=-this.gravityConstant*s*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*e*this.compoundGravityConstant)},a.prototype.isConverged=function(){var t,i=!1;return this.totalIterations>this.maxIterations/3&&(i=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,t||i},a.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},a.prototype.calcNoOfChildrenForAllNodes=function(){for(var t,i=this.graphManager.getAllNodes(),n=0;n<i.length;n++)(t=i[n]).noOfChildren=t.getNoOfChildren()},a.prototype.calcGrid=function(t){var i,n;i=parseInt(Math.ceil((t.getRight()-t.getLeft())/this.repulsionRange)),n=parseInt(Math.ceil((t.getBottom()-t.getTop())/this.repulsionRange));for(var r=new Array(i),s=0;s<i;s++)r[s]=new Array(n);for(s=0;s<i;s++)for(var e=0;e<n;e++)r[s][e]=new Array;return r},a.prototype.addNodeToGrid=function(t,i,n){var r,s,e,o;r=parseInt(Math.floor((t.getRect().x-i)/this.repulsionRange)),s=parseInt(Math.floor((t.getRect().width+t.getRect().x-i)/this.repulsionRange)),e=parseInt(Math.floor((t.getRect().y-n)/this.repulsionRange)),o=parseInt(Math.floor((t.getRect().height+t.getRect().y-n)/this.repulsionRange));for(var h=r;h<=s;h++)for(var a=e;a<=o;a++)this.grid[h][a].push(t),t.setGridCoordinates(r,s,e,o)},a.prototype.updateGrid=function(){var t,i,n=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),t=0;t<n.length;t++)i=n[t],this.addNodeToGrid(i,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},a.prototype.calculateRepulsionForceOfANode=function(t,i,n,r){if(this.totalIterations%s.GRID_CALCULATION_CHECK_PERIOD==1&&n||r){var e,o=new Set;t.surrounding=new Array;for(var h=this.grid,a=t.startX-1;a<t.finishX+2;a++)for(var f=t.startY-1;f<t.finishY+2;f++)if(!(a<0||f<0||a>=h.length||f>=h[0].length))for(var u=0;u<h[a][f].length;u++)if(e=h[a][f][u],t.getOwner()==e.getOwner()&&t!=e&&!i.has(e)&&!o.has(e)){var c=Math.abs(t.getCenterX()-e.getCenterX())-(t.getWidth()/2+e.getWidth()/2),l=Math.abs(t.getCenterY()-e.getCenterY())-(t.getHeight()/2+e.getHeight()/2);c<=this.repulsionRange&&l<=this.repulsionRange&&o.add(e)}t.surrounding=[].concat(function(t){if(Array.isArray(t)){for(var i=0,n=Array(t.length);i<t.length;i++)n[i]=t[i];return n}return Array.from(t)}(o))}for(a=0;a<t.surrounding.length;a++)this.calcRepulsionForce(t,t.surrounding[a])},a.prototype.calcRepulsionRange=function(){return 0},t.exports=a},function(t,i,n){var r=n(1),s=n(4);function e(t,i,n){r.call(this,t,i,n),this.idealLength=s.DEFAULT_EDGE_LENGTH,this.edgeElasticity=s.DEFAULT_SPRING_STRENGTH}for(var o in e.prototype=Object.create(r.prototype),r)e[o]=r[o];t.exports=e},function(t,i,n){var r=n(3),s=n(4);function e(t,i,n,e){r.call(this,t,i,n,e),this.nodeRepulsion=s.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=[]}for(var o in e.prototype=Object.create(r.prototype),r)e[o]=r[o];e.prototype.setGridCoordinates=function(t,i,n,r){this.startX=t,this.finishX=i,this.startY=n,this.finishY=r},t.exports=e},function(t,i,n){function r(t,i){this.width=0,this.height=0,null!==t&&null!==i&&(this.height=i,this.width=t)}r.prototype.getWidth=function(){return this.width},r.prototype.setWidth=function(t){this.width=t},r.prototype.getHeight=function(){return this.height},r.prototype.setHeight=function(t){this.height=t},t.exports=r},function(t,i,n){var r=n(14);function s(){this.map={},this.keys=[]}s.prototype.put=function(t,i){var n=r.createID(t);this.contains(n)||(this.map[n]=i,this.keys.push(t))},s.prototype.contains=function(t){return r.createID(t),null!=this.map[t]},s.prototype.get=function(t){var i=r.createID(t);return this.map[i]},s.prototype.keySet=function(){return this.keys},t.exports=s},function(t,i,n){var r=n(14);function s(){this.set={}}s.prototype.add=function(t){var i=r.createID(t);this.contains(i)||(this.set[i]=t)},s.prototype.remove=function(t){delete this.set[r.createID(t)]},s.prototype.clear=function(){this.set={}},s.prototype.contains=function(t){return this.set[r.createID(t)]==t},s.prototype.isEmpty=function(){return 0===this.size()},s.prototype.size=function(){return Object.keys(this.set).length},s.prototype.addAllTo=function(t){for(var i=Object.keys(this.set),n=i.length,r=0;r<n;r++)t.push(this.set[i[r]])},s.prototype.size=function(){return Object.keys(this.set).length},s.prototype.addAll=function(t){for(var i=t.length,n=0;n<i;n++){var r=t[n];this.add(r)}},t.exports=s},function(t,i,n){function r(){}r.multMat=function(t,i){for(var n=[],r=0;r<t.length;r++){n[r]=[];for(var s=0;s<i[0].length;s++){n[r][s]=0;for(var e=0;e<t[0].length;e++)n[r][s]+=t[r][e]*i[e][s]}}return n},r.transpose=function(t){for(var i=[],n=0;n<t[0].length;n++){i[n]=[];for(var r=0;r<t.length;r++)i[n][r]=t[r][n]}return i},r.multCons=function(t,i){for(var n=[],r=0;r<t.length;r++)n[r]=t[r]*i;return n},r.minusOp=function(t,i){for(var n=[],r=0;r<t.length;r++)n[r]=t[r]-i[r];return n},r.dotProduct=function(t,i){for(var n=0,r=0;r<t.length;r++)n+=t[r]*i[r];return n},r.mag=function(t){return Math.sqrt(this.dotProduct(t,t))},r.normalize=function(t){for(var i=[],n=this.mag(t),r=0;r<t.length;r++)i[r]=t[r]/n;return i},r.multGamma=function(t){for(var i=[],n=0,r=0;r<t.length;r++)n+=t[r];n*=-1/t.length;for(var s=0;s<t.length;s++)i[s]=n+t[s];return i},r.multL=function(t,i,n){for(var r=[],s=[],e=[],o=0;o<i[0].length;o++){for(var h=0,a=0;a<i.length;a++)h+=-.5*i[a][o]*t[a];s[o]=h}for(var f=0;f<n.length;f++){for(var u=0,c=0;c<n.length;c++)u+=n[f][c]*s[c];e[f]=u}for(var l=0;l<i.length;l++){for(var v=0,d=0;d<i[0].length;d++)v+=i[l][d]*e[d];r[l]=v}return r},t.exports=r},function(t,i,n){var r=function(){function t(t,i){for(var n=0;n<i.length;n++){var r=i[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(i,n,r){return n&&t(i.prototype,n),r&&t(i,r),i}}(),s=n(11),e=function(){function t(i,n){!function(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}(this,t),null===n&&void 0===n||(this.compareFunction=this._defaultCompareFunction);var r=void 0;r=i instanceof s?i.size():i.length,this._quicksort(i,0,r-1)}return r(t,[{key:"_quicksort",value:function(t,i,n){if(i<n){var r=this._partition(t,i,n);this._quicksort(t,i,r),this._quicksort(t,r+1,n)}}},{key:"_partition",value:function(t,i,n){for(var r=this._get(t,i),s=i,e=n;;){for(;this.compareFunction(r,this._get(t,e));)e--;for(;this.compareFunction(this._get(t,s),r);)s++;if(!(s<e))return e;this._swap(t,s,e),s++,e--}}},{key:"_get",value:function(t,i){return t instanceof s?t.get_object_at(i):t[i]}},{key:"_set",value:function(t,i,n){t instanceof s?t.set_object_at(i,n):t[i]=n}},{key:"_swap",value:function(t,i,n){var r=this._get(t,i);this._set(t,i,this._get(t,n)),this._set(t,n,r)}},{key:"_defaultCompareFunction",value:function(t,i){return i>t}}]),t}();t.exports=e},function(t,i,n){function r(){}r.svd=function(t){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=t.length,this.n=t[0].length;var i=Math.min(this.m,this.n);this.s=function(t){for(var i=[];t-- >0;)i.push(0);return i}(Math.min(this.m+1,this.n)),this.U=function t(i){if(0==i.length)return 0;for(var n=[],r=0;r<i[0];r++)n.push(t(i.slice(1)));return n}([this.m,i]),this.V=function(t){return function t(i){if(0==i.length)return 0;for(var n=[],r=0;r<i[0];r++)n.push(t(i.slice(1)));return n}(t)}([this.n,this.n]);for(var n=function(t){for(var i=[];t-- >0;)i.push(0);return i}(this.n),s=function(t){for(var i=[];t-- >0;)i.push(0);return i}(this.m),e=Math.min(this.m-1,this.n),o=Math.max(0,Math.min(this.n-2,this.m)),h=0;h<Math.max(e,o);h++){if(h<e){this.s[h]=0;for(var a=h;a<this.m;a++)this.s[h]=r.hypot(this.s[h],t[a][h]);if(0!==this.s[h]){t[h][h]<0&&(this.s[h]=-this.s[h]);for(var f=h;f<this.m;f++)t[f][h]/=this.s[h];t[h][h]+=1}this.s[h]=-this.s[h]}for(var u=h+1;u<this.n;u++){if(function(t,i){return t&&i}(h<e,0!==this.s[h])){for(var c=0,l=h;l<this.m;l++)c+=t[l][h]*t[l][u];c=-c/t[h][h];for(var v=h;v<this.m;v++)t[v][u]+=c*t[v][h]}n[u]=t[h][u]}if(function(t,i){return i}(0,h<e))for(var d=h;d<this.m;d++)this.U[d][h]=t[d][h];if(h<o){n[h]=0;for(var y=h+1;y<this.n;y++)n[h]=r.hypot(n[h],n[y]);if(0!==n[h]){n[h+1]<0&&(n[h]=-n[h]);for(var p=h+1;p<this.n;p++)n[p]/=n[h];n[h+1]+=1}if(n[h]=-n[h],function(t,i){return t&&i}(h+1<this.m,0!==n[h])){for(var w=h+1;w<this.m;w++)s[w]=0;for(var g=h+1;g<this.n;g++)for(var m=h+1;m<this.m;m++)s[m]+=n[g]*t[m][g];for(var b=h+1;b<this.n;b++)for(var M=-n[b]/n[h+1],k=h+1;k<this.m;k++)t[k][b]+=M*s[k]}for(var x=h+1;x<this.n;x++)this.V[x][h]=n[x]}}var S=Math.min(this.n,this.m+1);e<this.n&&(this.s[e]=t[e][e]),this.m<S&&(this.s[S-1]=0),o+1<S&&(n[o]=t[o][S-1]),n[S-1]=0;for(var $=e;$<i;$++){for(var j=0;j<this.m;j++)this.U[j][$]=0;this.U[$][$]=1}for(var O=e-1;O>=0;O--)if(0!==this.s[O]){for(var A=O+1;A<i;A++){for(var T=0,I=O;I<this.m;I++)T+=this.U[I][O]*this.U[I][A];T=-T/this.U[O][O];for(var E=O;E<this.m;E++)this.U[E][A]+=T*this.U[E][O]}for(var L=O;L<this.m;L++)this.U[L][O]=-this.U[L][O];this.U[O][O]=1+this.U[O][O];for(var D=0;D<O-1;D++)this.U[D][O]=0}else{for(var N=0;N<this.m;N++)this.U[N][O]=0;this.U[O][O]=1}for(var z=this.n-1;z>=0;z--){if(function(t,i){return t&&i}(z<o,0!==n[z]))for(var B=z+1;B<i;B++){for(var C=0,P=z+1;P<this.n;P++)C+=this.V[P][z]*this.V[P][B];C=-C/this.V[z+1][z];for(var R=z+1;R<this.n;R++)this.V[R][B]+=C*this.V[R][z]}for(var G=0;G<this.n;G++)this.V[G][z]=0;this.V[z][z]=1}for(var q=S-1,F=Math.pow(2,-52),X=Math.pow(2,-966);S>0;){var Y=void 0,_=void 0;for(Y=S-2;Y>=-1&&-1!==Y;Y--)if(Math.abs(n[Y])<=X+F*(Math.abs(this.s[Y])+Math.abs(this.s[Y+1]))){n[Y]=0;break}if(Y===S-2)_=4;else{var H=void 0;for(H=S-1;H>=Y&&H!==Y;H--){var Z=(H!==S?Math.abs(n[H]):0)+(H!==Y+1?Math.abs(n[H-1]):0);if(Math.abs(this.s[H])<=X+F*Z){this.s[H]=0;break}}H===Y?_=3:H===S-1?_=1:(_=2,Y=H)}switch(Y++,_){case 1:var J=n[S-2];n[S-2]=0;for(var V=S-2;V>=Y;V--){var W=r.hypot(this.s[V],J),U=this.s[V]/W,K=J/W;this.s[V]=W,V!==Y&&(J=-K*n[V-1],n[V-1]=U*n[V-1]);for(var Q=0;Q<this.n;Q++)W=U*this.V[Q][V]+K*this.V[Q][S-1],this.V[Q][S-1]=-K*this.V[Q][V]+U*this.V[Q][S-1],this.V[Q][V]=W}break;case 2:var tt=n[Y-1];n[Y-1]=0;for(var it=Y;it<S;it++){var nt=r.hypot(this.s[it],tt),rt=this.s[it]/nt,st=tt/nt;this.s[it]=nt,tt=-st*n[it],n[it]=rt*n[it];for(var et=0;et<this.m;et++)nt=rt*this.U[et][it]+st*this.U[et][Y-1],this.U[et][Y-1]=-st*this.U[et][it]+rt*this.U[et][Y-1],this.U[et][it]=nt}break;case 3:var ot=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[S-1]),Math.abs(this.s[S-2])),Math.abs(n[S-2])),Math.abs(this.s[Y])),Math.abs(n[Y])),ht=this.s[S-1]/ot,at=this.s[S-2]/ot,ft=n[S-2]/ot,ut=this.s[Y]/ot,ct=n[Y]/ot,lt=((at+ht)*(at-ht)+ft*ft)/2,vt=ht*ft*(ht*ft),dt=0;(function(t,i){return t||i})(0!==lt,0!==vt)&&(dt=Math.sqrt(lt*lt+vt),lt<0&&(dt=-dt),dt=vt/(lt+dt));for(var yt=(ut+ht)*(ut-ht)+dt,pt=ut*ct,wt=Y;wt<S-1;wt++){var gt=r.hypot(yt,pt),mt=yt/gt,bt=pt/gt;wt!==Y&&(n[wt-1]=gt),yt=mt*this.s[wt]+bt*n[wt],n[wt]=mt*n[wt]-bt*this.s[wt],pt=bt*this.s[wt+1],this.s[wt+1]=mt*this.s[wt+1];for(var Mt=0;Mt<this.n;Mt++)gt=mt*this.V[Mt][wt]+bt*this.V[Mt][wt+1],this.V[Mt][wt+1]=-bt*this.V[Mt][wt]+mt*this.V[Mt][wt+1],this.V[Mt][wt]=gt;if(mt=yt/(gt=r.hypot(yt,pt)),bt=pt/gt,this.s[wt]=gt,yt=mt*n[wt]+bt*this.s[wt+1],this.s[wt+1]=-bt*n[wt]+mt*this.s[wt+1],pt=bt*n[wt+1],n[wt+1]=mt*n[wt+1],wt<this.m-1)for(var kt=0;kt<this.m;kt++)gt=mt*this.U[kt][wt]+bt*this.U[kt][wt+1],this.U[kt][wt+1]=-bt*this.U[kt][wt]+mt*this.U[kt][wt+1],this.U[kt][wt]=gt}n[S-2]=yt;break;case 4:if(this.s[Y]<=0){this.s[Y]=this.s[Y]<0?-this.s[Y]:0;for(var xt=0;xt<=q;xt++)this.V[xt][Y]=-this.V[xt][Y]}for(;Y<q&&!(this.s[Y]>=this.s[Y+1]);){var St=this.s[Y];if(this.s[Y]=this.s[Y+1],this.s[Y+1]=St,Y<this.n-1)for(var $t=0;$t<this.n;$t++)St=this.V[$t][Y+1],this.V[$t][Y+1]=this.V[$t][Y],this.V[$t][Y]=St;if(Y<this.m-1)for(var jt=0;jt<this.m;jt++)St=this.U[jt][Y+1],this.U[jt][Y+1]=this.U[jt][Y],this.U[jt][Y]=St;Y++}S--}}return{U:this.U,V:this.V,S:this.s}},r.hypot=function(t,i){var n=void 0;return Math.abs(t)>Math.abs(i)?(n=i/t,n=Math.abs(t)*Math.sqrt(1+n*n)):0!=i?(n=t/i,n=Math.abs(i)*Math.sqrt(1+n*n)):n=0,n},t.exports=r},function(t,i,n){var r=function(){function t(t,i){for(var n=0;n<i.length;n++){var r=i[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(i,n,r){return n&&t(i.prototype,n),r&&t(i,r),i}}(),s=function(){function t(i,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,e=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;!function(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}(this,t),this.sequence1=i,this.sequence2=n,this.match_score=r,this.mismatch_penalty=s,this.gap_penalty=e,this.iMax=i.length+1,this.jMax=n.length+1,this.grid=new Array(this.iMax);for(var o=0;o<this.iMax;o++){this.grid[o]=new Array(this.jMax);for(var h=0;h<this.jMax;h++)this.grid[o][h]=0}this.tracebackGrid=new Array(this.iMax);for(var a=0;a<this.iMax;a++){this.tracebackGrid[a]=new Array(this.jMax);for(var f=0;f<this.jMax;f++)this.tracebackGrid[a][f]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return r(t,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var t=1;t<this.jMax;t++)this.grid[0][t]=this.grid[0][t-1]+this.gap_penalty,this.tracebackGrid[0][t]=[!1,!1,!0];for(var i=1;i<this.iMax;i++)this.grid[i][0]=this.grid[i-1][0]+this.gap_penalty,this.tracebackGrid[i][0]=[!1,!0,!1];for(var n=1;n<this.iMax;n++)for(var r=1;r<this.jMax;r++){var s=[this.sequence1[n-1]===this.sequence2[r-1]?this.grid[n-1][r-1]+this.match_score:this.grid[n-1][r-1]+this.mismatch_penalty,this.grid[n-1][r]+this.gap_penalty,this.grid[n][r-1]+this.gap_penalty],e=this.arrayAllMaxIndexes(s);this.grid[n][r]=s[e[0]],this.tracebackGrid[n][r]=[e.includes(0),e.includes(1),e.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var t=[];for(t.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});t[0];){var i=t[0],n=this.tracebackGrid[i.pos[0]][i.pos[1]];n[0]&&t.push({pos:[i.pos[0]-1,i.pos[1]-1],seq1:this.sequence1[i.pos[0]-1]+i.seq1,seq2:this.sequence2[i.pos[1]-1]+i.seq2}),n[1]&&t.push({pos:[i.pos[0]-1,i.pos[1]],seq1:this.sequence1[i.pos[0]-1]+i.seq1,seq2:"-"+i.seq2}),n[2]&&t.push({pos:[i.pos[0],i.pos[1]-1],seq1:"-"+i.seq1,seq2:this.sequence2[i.pos[1]-1]+i.seq2}),0===i.pos[0]&&0===i.pos[1]&&this.alignments.push({sequence1:i.seq1,sequence2:i.seq2}),t.shift()}return this.alignments}},{key:"getAllIndexes",value:function(t,i){for(var n=[],r=-1;-1!==(r=t.indexOf(i,r+1));)n.push(r);return n}},{key:"arrayAllMaxIndexes",value:function(t){return this.getAllIndexes(t,Math.max.apply(null,t))}}]),t}();t.exports=s},function(t,i,n){var r=function(){};r.FDLayout=n(18),r.FDLayoutConstants=n(4),r.FDLayoutEdge=n(19),r.FDLayoutNode=n(20),r.DimensionD=n(21),r.HashMap=n(22),r.HashSet=n(23),r.IGeometry=n(8),r.IMath=n(9),r.Integer=n(10),r.Point=n(12),r.PointD=n(5),r.RandomSeed=n(16),r.RectangleD=n(13),r.Transform=n(17),r.UniqueIDGeneretor=n(14),r.Quicksort=n(25),r.LinkedList=n(11),r.LGraphObject=n(2),r.LGraph=n(6),r.LEdge=n(1),r.LGraphManager=n(7),r.LNode=n(3),r.Layout=n(15),r.LayoutConstants=n(0),r.NeedlemanWunsch=n(27),r.Matrix=n(24),r.SVD=n(26),t.exports=r},function(t,i,n){function r(){this.listeners=[]}var s=r.prototype;s.addListener=function(t,i){this.listeners.push({event:t,callback:i})},s.removeListener=function(t,i){for(var n=this.listeners.length;n>=0;n--){var r=this.listeners[n];r.event===t&&r.callback===i&&this.listeners.splice(n,1)}},s.emit=function(t,i){for(var n=0;n<this.listeners.length;n++){var r=this.listeners[n];t===r.event&&r.callback(i)}},t.exports=r}])},I.exports=t());var t}var L;function D(){return L?T.exports:(L=1,t=function(t){return i={45:(t,i,n)=>{var r={};r.layoutBase=n(551),r.CoSEConstants=n(806),r.CoSEEdge=n(767),r.CoSEGraph=n(880),r.CoSEGraphManager=n(578),r.CoSELayout=n(765),r.CoSENode=n(991),r.ConstraintHandler=n(902),t.exports=r},806:(t,i,n)=>{var r=n(551).FDLayoutConstants;function s(){}for(var e in r)s[e]=r[e];s.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,s.DEFAULT_RADIAL_SEPARATION=r.DEFAULT_EDGE_LENGTH,s.DEFAULT_COMPONENT_SEPERATION=60,s.TILE=!0,s.TILING_PADDING_VERTICAL=10,s.TILING_PADDING_HORIZONTAL=10,s.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,s.ENFORCE_CONSTRAINTS=!0,s.APPLY_LAYOUT=!0,s.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,s.TREE_REDUCTION_ON_INCREMENTAL=!0,s.PURE_INCREMENTAL=s.DEFAULT_INCREMENTAL,t.exports=s},767:(t,i,n)=>{var r=n(551).FDLayoutEdge;function s(t,i,n){r.call(this,t,i,n)}for(var e in s.prototype=Object.create(r.prototype),r)s[e]=r[e];t.exports=s},880:(t,i,n)=>{var r=n(551).LGraph;function s(t,i,n){r.call(this,t,i,n)}for(var e in s.prototype=Object.create(r.prototype),r)s[e]=r[e];t.exports=s},578:(t,i,n)=>{var r=n(551).LGraphManager;function s(t){r.call(this,t)}for(var e in s.prototype=Object.create(r.prototype),r)s[e]=r[e];t.exports=s},765:(t,i,n)=>{var r=n(551).FDLayout,s=n(578),e=n(880),o=n(991),h=n(767),a=n(806),f=n(902),u=n(551).FDLayoutConstants,c=n(551).LayoutConstants,l=n(551).Point,v=n(551).PointD,d=n(551).DimensionD,y=n(551).Layout,p=n(551).Integer,w=n(551).IGeometry,g=n(551).LGraph,m=n(551).Transform,b=n(551).LinkedList;function M(){r.call(this),this.toBeTiled={},this.constraints={}}for(var k in M.prototype=Object.create(r.prototype),r)M[k]=r[k];M.prototype.newGraphManager=function(){var t=new s(this);return this.graphManager=t,t},M.prototype.newGraph=function(t){return new e(null,this.graphManager,t)},M.prototype.newNode=function(t){return new o(this.graphManager,t)},M.prototype.newEdge=function(t){return new h(null,null,t)},M.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.isSubLayout||(a.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=a.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=a.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=u.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=u.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=u.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},M.prototype.initSpringEmbedder=function(){r.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/u.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},M.prototype.layout=function(){return c.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},M.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)a.TREE_REDUCTION_ON_INCREMENTAL&&(this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation(),i=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter(function(t){return i.has(t)}),this.graphManager.setAllNodesToApplyGravitation(n));else{var t=this.getFlatForest();if(t.length>0)this.positionNodesRadially(t);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var i=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter(function(t){return i.has(t)});this.graphManager.setAllNodesToApplyGravitation(n),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(f.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),a.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},M.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}if(this.totalIterations%u.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(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 t=new Set(this.getAllNodes()),i=this.nodesWithGravity.filter(function(i){return t.has(i)});this.graphManager.setAllNodesToApplyGravitation(i),this.graphManager.updateBounds(),this.updateGrid(),a.PURE_INCREMENTAL?this.coolingFactor=u.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=u.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),a.PURE_INCREMENTAL?this.coolingFactor=u.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=u.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var n=!this.isTreeGrowing&&!this.isGrowthFinished,r=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(n,r),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},M.prototype.getPositionsData=function(){for(var t=this.graphManager.getAllNodes(),i={},n=0;n<t.length;n++){var r=t[n].rect,s=t[n].id;i[s]={id:s,x:r.getCenterX(),y:r.getCenterY(),w:r.width,h:r.height}}return i},M.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var t=!1;if("during"===u.ANIMATE)this.emit("layoutstarted");else{for(;!t;)t=this.tick();this.graphManager.updateBounds()}},M.prototype.moveNodes=function(){for(var t=this.getAllNodes(),i=0;i<t.length;i++)t[i].calculateDisplacement();for(Object.keys(this.constraints).length>0&&this.updateDisplacements(),i=0;i<t.length;i++)t[i].move()},M.prototype.initConstraintVariables=function(){var t=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var i=this.graphManager.getAllNodes(),n=0;n<i.length;n++){var r=i[n];this.idToNodeMap.set(r.id,r)}var s=function i(n){for(var r,s=n.getChild().getNodes(),e=0,o=0;o<s.length;o++)null==(r=s[o]).getChild()?t.fixedNodeSet.has(r.id)&&(e+=100):e+=i(r);return e};if(this.constraints.fixedNodeConstraint)for(this.constraints.fixedNodeConstraint.forEach(function(i){t.fixedNodeSet.add(i.nodeId)}),i=this.graphManager.getAllNodes(),n=0;n<i.length;n++)if(null!=(r=i[n]).getChild()){var e=s(r);e>0&&(r.fixedNodeWeight=e)}if(this.constraints.relativePlacementConstraint){var o=new Map,h=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(i){t.fixedNodesOnHorizontal.add(i),t.fixedNodesOnVertical.add(i)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var f=this.constraints.alignmentConstraint.vertical;for(n=0;n<f.length;n++)this.dummyToNodeForVerticalAlignment.set("dummy"+n,[]),f[n].forEach(function(i){o.set(i,"dummy"+n),t.dummyToNodeForVerticalAlignment.get("dummy"+n).push(i),t.fixedNodeSet.has(i)&&t.fixedNodesOnHorizontal.add("dummy"+n)})}if(this.constraints.alignmentConstraint.horizontal){var u=this.constraints.alignmentConstraint.horizontal;for(n=0;n<u.length;n++)this.dummyToNodeForHorizontalAlignment.set("dummy"+n,[]),u[n].forEach(function(i){h.set(i,"dummy"+n),t.dummyToNodeForHorizontalAlignment.get("dummy"+n).push(i),t.fixedNodeSet.has(i)&&t.fixedNodesOnVertical.add("dummy"+n)})}}if(a.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(t){var i,n,r;for(r=t.length-1;r>=2*t.length/3;r--)i=Math.floor(Math.random()*(r+1)),n=t[r],t[r]=t[i],t[i]=n;return t},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(i){if(i.left){var n=o.has(i.left)?o.get(i.left):i.left,r=o.has(i.right)?o.get(i.right):i.right;t.nodesInRelativeHorizontal.includes(n)||(t.nodesInRelativeHorizontal.push(n),t.nodeToRelativeConstraintMapHorizontal.set(n,[]),t.dummyToNodeForVerticalAlignment.has(n)?t.nodeToTempPositionMapHorizontal.set(n,t.idToNodeMap.get(t.dummyToNodeForVerticalAlignment.get(n)[0]).getCenterX()):t.nodeToTempPositionMapHorizontal.set(n,t.idToNodeMap.get(n).getCenterX())),t.nodesInRelativeHorizontal.includes(r)||(t.nodesInRelativeHorizontal.push(r),t.nodeToRelativeConstraintMapHorizontal.set(r,[]),t.dummyToNodeForVerticalAlignment.has(r)?t.nodeToTempPositionMapHorizontal.set(r,t.idToNodeMap.get(t.dummyToNodeForVerticalAlignment.get(r)[0]).getCenterX()):t.nodeToTempPositionMapHorizontal.set(r,t.idToNodeMap.get(r).getCenterX())),t.nodeToRelativeConstraintMapHorizontal.get(n).push({right:r,gap:i.gap}),t.nodeToRelativeConstraintMapHorizontal.get(r).push({left:n,gap:i.gap})}else{var s=h.has(i.top)?h.get(i.top):i.top,e=h.has(i.bottom)?h.get(i.bottom):i.bottom;t.nodesInRelativeVertical.includes(s)||(t.nodesInRelativeVertical.push(s),t.nodeToRelativeConstraintMapVertical.set(s,[]),t.dummyToNodeForHorizontalAlignment.has(s)?t.nodeToTempPositionMapVertical.set(s,t.idToNodeMap.get(t.dummyToNodeForHorizontalAlignment.get(s)[0]).getCenterY()):t.nodeToTempPositionMapVertical.set(s,t.idToNodeMap.get(s).getCenterY())),t.nodesInRelativeVertical.includes(e)||(t.nodesInRelativeVertical.push(e),t.nodeToRelativeConstraintMapVertical.set(e,[]),t.dummyToNodeForHorizontalAlignment.has(e)?t.nodeToTempPositionMapVertical.set(e,t.idToNodeMap.get(t.dummyToNodeForHorizontalAlignment.get(e)[0]).getCenterY()):t.nodeToTempPositionMapVertical.set(e,t.idToNodeMap.get(e).getCenterY())),t.nodeToRelativeConstraintMapVertical.get(s).push({bottom:e,gap:i.gap}),t.nodeToRelativeConstraintMapVertical.get(e).push({top:s,gap:i.gap})}});else{var c=new Map,l=new Map;this.constraints.relativePlacementConstraint.forEach(function(t){if(t.left){var i=o.has(t.left)?o.get(t.left):t.left,n=o.has(t.right)?o.get(t.right):t.right;c.has(i)?c.get(i).push(n):c.set(i,[n]),c.has(n)?c.get(n).push(i):c.set(n,[i])}else{var r=h.has(t.top)?h.get(t.top):t.top,s=h.has(t.bottom)?h.get(t.bottom):t.bottom;l.has(r)?l.get(r).push(s):l.set(r,[s]),l.has(s)?l.get(s).push(r):l.set(s,[r])}});var v=function(t,i){var n=[],r=[],s=new b,e=new Set,o=0;return t.forEach(function(h,a){if(!e.has(a)){n[o]=[],r[o]=!1;var f=a;for(s.push(f),e.add(f),n[o].push(f);0!=s.length;)f=s.shift(),i.has(f)&&(r[o]=!0),t.get(f).forEach(function(t){e.has(t)||(s.push(t),e.add(t),n[o].push(t))});o++}}),{components:n,isFixed:r}},d=v(c,t.fixedNodesOnHorizontal);this.componentsOnHorizontal=d.components,this.fixedComponentsOnHorizontal=d.isFixed;var y=v(l,t.fixedNodesOnVertical);this.componentsOnVertical=y.components,this.fixedComponentsOnVertical=y.isFixed}}},M.prototype.updateDisplacements=function(){var t=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(i){var n=t.idToNodeMap.get(i.nodeId);n.displacementX=0,n.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var i=this.constraints.alignmentConstraint.vertical,n=0;n<i.length;n++){for(var r=0,s=0;s<i[n].length;s++){if(this.fixedNodeSet.has(i[n][s])){r=0;break}r+=this.idToNodeMap.get(i[n][s]).displacementX}var e=r/i[n].length;for(s=0;s<i[n].length;s++)this.idToNodeMap.get(i[n][s]).displacementX=e}if(this.constraints.alignmentConstraint.horizontal){var o=this.constraints.alignmentConstraint.horizontal;for(n=0;n<o.length;n++){var h=0;for(s=0;s<o[n].length;s++){if(this.fixedNodeSet.has(o[n][s])){h=0;break}h+=this.idToNodeMap.get(o[n][s]).displacementY}var f=h/o[n].length;for(s=0;s<o[n].length;s++)this.idToNodeMap.get(o[n][s]).displacementY=f}}}if(this.constraints.relativePlacementConstraint)if(a.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach(function(i){if(!t.fixedNodesOnHorizontal.has(i)){var n=0;n=t.dummyToNodeForVerticalAlignment.has(i)?t.idToNodeMap.get(t.dummyToNodeForVerticalAlignment.get(i)[0]).displacementX:t.idToNodeMap.get(i).displacementX,t.nodeToRelativeConstraintMapHorizontal.get(i).forEach(function(r){var s;r.right?(s=t.nodeToTempPositionMapHorizontal.get(r.right)-t.nodeToTempPositionMapHorizontal.get(i)-n)<r.gap&&(n-=r.gap-s):(s=t.nodeToTempPositionMapHorizontal.get(i)-t.nodeToTempPositionMapHorizontal.get(r.left)+n)<r.gap&&(n+=r.gap-s)}),t.nodeToTempPositionMapHorizontal.set(i,t.nodeToTempPositionMapHorizontal.get(i)+n),t.dummyToNodeForVerticalAlignment.has(i)?t.dummyToNodeForVerticalAlignment.get(i).forEach(function(i){t.idToNodeMap.get(i).displacementX=n}):t.idToNodeMap.get(i).displacementX=n}}),this.nodesInRelativeVertical.forEach(function(i){if(!t.fixedNodesOnHorizontal.has(i)){var n=0;n=t.dummyToNodeForHorizontalAlignment.has(i)?t.idToNodeMap.get(t.dummyToNodeForHorizontalAlignment.get(i)[0]).displacementY:t.idToNodeMap.get(i).displacementY,t.nodeToRelativeConstraintMapVertical.get(i).forEach(function(r){var s;r.bottom?(s=t.nodeToTempPositionMapVertical.get(r.bottom)-t.nodeToTempPositionMapVertical.get(i)-n)<r.gap&&(n-=r.gap-s):(s=t.nodeToTempPositionMapVertical.get(i)-t.nodeToTempPositionMapVertical.get(r.top)+n)<r.gap&&(n+=r.gap-s)}),t.nodeToTempPositionMapVertical.set(i,t.nodeToTempPositionMapVertical.get(i)+n),t.dummyToNodeForHorizontalAlignment.has(i)?t.dummyToNodeForHorizontalAlignment.get(i).forEach(function(i){t.idToNodeMap.get(i).displacementY=n}):t.idToNodeMap.get(i).displacementY=n}});else{for(n=0;n<this.componentsOnHorizontal.length;n++){var u=this.componentsOnHorizontal[n];if(this.fixedComponentsOnHorizontal[n])for(s=0;s<u.length;s++)this.dummyToNodeForVerticalAlignment.has(u[s])?this.dummyToNodeForVerticalAlignment.get(u[s]).forEach(function(i){t.idToNodeMap.get(i).displacementX=0}):this.idToNodeMap.get(u[s]).displacementX=0;else{var c=0,l=0;for(s=0;s<u.length;s++)this.dummyToNodeForVerticalAlignment.has(u[s])?(c+=(d=this.dummyToNodeForVerticalAlignment.get(u[s])).length*this.idToNodeMap.get(d[0]).displacementX,l+=d.length):(c+=this.idToNodeMap.get(u[s]).displacementX,l++);var v=c/l;for(s=0;s<u.length;s++)this.dummyToNodeForVerticalAlignment.has(u[s])?this.dummyToNodeForVerticalAlignment.get(u[s]).forEach(function(i){t.idToNodeMap.get(i).displacementX=v}):this.idToNodeMap.get(u[s]).displacementX=v}}for(n=0;n<this.componentsOnVertical.length;n++)if(u=this.componentsOnVertical[n],this.fixedComponentsOnVertical[n])for(s=0;s<u.length;s++)this.dummyToNodeForHorizontalAlignment.has(u[s])?this.dummyToNodeForHorizontalAlignment.get(u[s]).forEach(function(i){t.idToNodeMap.get(i).displacementY=0}):this.idToNodeMap.get(u[s]).displacementY=0;else{for(c=0,l=0,s=0;s<u.length;s++){var d;this.dummyToNodeForHorizontalAlignment.has(u[s])?(c+=(d=this.dummyToNodeForHorizontalAlignment.get(u[s])).length*this.idToNodeMap.get(d[0]).displacementY,l+=d.length):(c+=this.idToNodeMap.get(u[s]).displacementY,l++)}for(v=c/l,s=0;s<u.length;s++)this.dummyToNodeForHorizontalAlignment.has(u[s])?this.dummyToNodeForHorizontalAlignment.get(u[s]).forEach(function(i){t.idToNodeMap.get(i).displacementY=v}):this.idToNodeMap.get(u[s]).displacementY=v}}},M.prototype.calculateNodesToApplyGravitationTo=function(){var t,i,n=[],r=this.graphManager.getGraphs(),s=r.length;for(i=0;i<s;i++)(t=r[i]).updateConnected(),t.isConnected||(n=n.concat(t.getNodes()));return n},M.prototype.createBendpoints=function(){var t=[];t=t.concat(this.graphManager.getAllEdges());var i,n=new Set;for(i=0;i<t.length;i++){var r=t[i];if(!n.has(r)){var s=r.getSource(),e=r.getTarget();if(s==e)r.getBendpoints().push(new v),r.getBendpoints().push(new v),this.createDummyNodesForBendpoints(r),n.add(r);else{var o=[];if(o=(o=o.concat(s.getEdgeListToNode(e))).concat(e.getEdgeListToNode(s)),!n.has(o[0])){var h;if(o.length>1)for(h=0;h<o.length;h++){var a=o[h];a.getBendpoints().push(new v),this.createDummyNodesForBendpoints(a)}o.forEach(function(t){n.add(t)})}}}if(n.size==t.length)break}},M.prototype.positionNodesRadially=function(t){for(var i=new l(0,0),n=Math.ceil(Math.sqrt(t.length)),r=0,s=0,e=0,o=new v(0,0),h=0;h<t.length;h++){h%n==0&&(e=0,s=r,0!=h&&(s+=a.DEFAULT_COMPONENT_SEPERATION),r=0);var f=t[h],u=y.findCenterOfTree(f);i.x=e,i.y=s,(o=M.radialLayout(f,u,i)).y>r&&(r=Math.floor(o.y)),e=Math.floor(o.x+a.DEFAULT_COMPONENT_SEPERATION)}this.transform(new v(c.WORLD_CENTER_X-o.x/2,c.WORLD_CENTER_Y-o.y/2))},M.radialLayout=function(t,i,n){var r=Math.max(this.maxDiagonalInTree(t),a.DEFAULT_RADIAL_SEPARATION);M.branchRadialLayout(i,null,0,359,0,r);var s=g.calculateBounds(t),e=new m;e.setDeviceOrgX(s.getMinX()),e.setDeviceOrgY(s.getMinY()),e.setWorldOrgX(n.x),e.setWorldOrgY(n.y);for(var o=0;o<t.length;o++)t[o].transform(e);var h=new v(s.getMaxX(),s.getMaxY());return e.inverseTransformPoint(h)},M.branchRadialLayout=function(t,i,n,r,s,e){var o=(r-n+1)/2;o<0&&(o+=180);var h=(o+n)%360*w.TWO_PI/360,a=s*Math.cos(h),f=s*Math.sin(h);t.setCenter(a,f);var u=[],c=(u=u.concat(t.getEdges())).length;null!=i&&c--;for(var l,v=0,d=u.length,y=t.getEdgesBetween(i);y.length>1;){var p=y[0];y.splice(0,1);var g=u.indexOf(p);g>=0&&u.splice(g,1),d--,c--}l=null!=i?(u.indexOf(y[0])+1)%d:0;for(var m=Math.abs(r-n)/c,b=l;v!=c;b=++b%d){var k=u[b].getOtherEnd(t);if(k!=i){var x=(n+v*m)%360,S=(x+m)%360;M.branchRadialLayout(k,t,x,S,s+e,e),v++}}},M.maxDiagonalInTree=function(t){for(var i=p.MIN_VALUE,n=0;n<t.length;n++){var r=t[n].getDiagonal();r>i&&(i=r)}return i},M.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},M.prototype.groupZeroDegreeMembers=function(){var t=this,i={};this.memberGroups={},this.idToDummyNode={};for(var n=[],r=this.graphManager.getAllNodes(),s=0;s<r.length;s++){var e=(h=r[s]).getParent();0!==this.getNodeDegreeWithChildren(h)||null!=e.id&&this.getToBeTiled(e)||n.push(h)}for(s=0;s<n.length;s++){var h,a=(h=n[s]).getParent().id;void 0===i[a]&&(i[a]=[]),i[a]=i[a].concat(h)}Object.keys(i).forEach(function(n){if(i[n].length>1){var r="DummyCompound_"+n;t.memberGroups[r]=i[n];var s=i[n][0].getParent(),e=new o(t.graphManager);e.id=r,e.paddingLeft=s.paddingLeft||0,e.paddingRight=s.paddingRight||0,e.paddingBottom=s.paddingBottom||0,e.paddingTop=s.paddingTop||0,t.idToDummyNode[r]=e;var h=t.getGraphManager().add(t.newGraph(),e),a=s.getChild();a.add(e);for(var f=0;f<i[n].length;f++){var u=i[n][f];a.remove(u),h.add(u)}}})},M.prototype.clearCompounds=function(){var t={},i={};this.performDFSOnCompounds();for(var n=0;n<this.compoundOrder.length;n++)i[this.compoundOrder[n].id]=this.compoundOrder[n],t[this.compoundOrder[n].id]=[].concat(this.compoundOrder[n].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[n].getChild()),this.compoundOrder[n].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(t,i)},M.prototype.clearZeroDegreeMembers=function(){var t=this,i=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(n){var r=t.idToDummyNode[n];if(i[n]=t.tileNodes(t.memberGroups[n],r.paddingLeft+r.paddingRight),r.rect.width=i[n].width,r.rect.height=i[n].height,r.setCenter(i[n].centerX,i[n].centerY),r.labelMarginLeft=0,r.labelMarginTop=0,a.NODE_DIMENSIONS_INCLUDE_LABELS){var s=r.rect.width,e=r.rect.height;r.labelWidth&&("left"==r.labelPosHorizontal?(r.rect.x-=r.labelWidth,r.setWidth(s+r.labelWidth),r.labelMarginLeft=r.labelWidth):"center"==r.labelPosHorizontal&&r.labelWidth>s?(r.rect.x-=(r.labelWidth-s)/2,r.setWidth(r.labelWidth),r.labelMarginLeft=(r.labelWidth-s)/2):"right"==r.labelPosHorizontal&&r.setWidth(s+r.labelWidth)),r.labelHeight&&("top"==r.labelPosVertical?(r.rect.y-=r.labelHeight,r.setHeight(e+r.labelHeight),r.labelMarginTop=r.labelHeight):"center"==r.labelPosVertical&&r.labelHeight>e?(r.rect.y-=(r.labelHeight-e)/2,r.setHeight(r.labelHeight),r.labelMarginTop=(r.labelHeight-e)/2):"bottom"==r.labelPosVertical&&r.setHeight(e+r.labelHeight))}})},M.prototype.repopulateCompounds=function(){for(var t=this.compoundOrder.length-1;t>=0;t--){var i=this.compoundOrder[t],n=i.id,r=i.paddingLeft,s=i.paddingTop,e=i.labelMarginLeft,o=i.labelMarginTop;this.adjustLocations(this.tiledMemberPack[n],i.rect.x,i.rect.y,r,s,e,o)}},M.prototype.repopulateZeroDegreeMembers=function(){var t=this,i=this.tiledZeroDegreePack;Object.keys(i).forEach(function(n){var r=t.idToDummyNode[n],s=r.paddingLeft,e=r.paddingTop,o=r.labelMarginLeft,h=r.labelMarginTop;t.adjustLocations(i[n],r.rect.x,r.rect.y,s,e,o,h)})},M.prototype.getToBeTiled=function(t){var i=t.id;if(null!=this.toBeTiled[i])return this.toBeTiled[i];var n=t.getChild();if(null==n)return this.toBeTiled[i]=!1,!1;for(var r=n.getNodes(),s=0;s<r.length;s++){var e=r[s];if(this.getNodeDegree(e)>0)return this.toBeTiled[i]=!1,!1;if(null!=e.getChild()){if(!this.getToBeTiled(e))return this.toBeTiled[i]=!1,!1}else this.toBeTiled[e.id]=!1}return this.toBeTiled[i]=!0,!0},M.prototype.getNodeDegree=function(t){t.id;for(var i=t.getEdges(),n=0,r=0;r<i.length;r++){var s=i[r];s.getSource().id!==s.getTarget().id&&(n+=1)}return n},M.prototype.getNodeDegreeWithChildren=function(t){var i=this.getNodeDegree(t);if(null==t.getChild())return i;for(var n=t.getChild().getNodes(),r=0;r<n.length;r++){var s=n[r];i+=this.getNodeDegreeWithChildren(s)}return i},M.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},M.prototype.fillCompexOrderByDFS=function(t){for(var i=0;i<t.length;i++){var n=t[i];null!=n.getChild()&&this.fillCompexOrderByDFS(n.getChild().getNodes()),this.getToBeTiled(n)&&this.compoundOrder.push(n)}},M.prototype.adjustLocations=function(t,i,n,r,s,e,o){n+=s+o;for(var h=i+=r+e,a=0;a<t.rows.length;a++){var f=t.rows[a];i=h;for(var u=0,c=0;c<f.length;c++){var l=f[c];l.rect.x=i,l.rect.y=n,i+=l.rect.width+t.horizontalPadding,l.rect.height>u&&(u=l.rect.height)}n+=u+t.verticalPadding}},M.prototype.tileCompoundMembers=function(t,i){var n=this;this.tiledMemberPack=[],Object.keys(t).forEach(function(r){var s=i[r];if(n.tiledMemberPack[r]=n.tileNodes(t[r],s.paddingLeft+s.paddingRight),s.rect.width=n.tiledMemberPack[r].width,s.rect.height=n.tiledMemberPack[r].height,s.setCenter(n.tiledMemberPack[r].centerX,n.tiledMemberPack[r].centerY),s.labelMarginLeft=0,s.labelMarginTop=0,a.NODE_DIMENSIONS_INCLUDE_LABELS){var e=s.rect.width,o=s.rect.height;s.labelWidth&&("left"==s.labelPosHorizontal?(s.rect.x-=s.labelWidth,s.setWidth(e+s.labelWidth),s.labelMarginLeft=s.labelWidth):"center"==s.labelPosHorizontal&&s.labelWidth>e?(s.rect.x-=(s.labelWidth-e)/2,s.setWidth(s.labelWidth),s.labelMarginLeft=(s.labelWidth-e)/2):"right"==s.labelPosHorizontal&&s.setWidth(e+s.labelWidth)),s.labelHeight&&("top"==s.labelPosVertical?(s.rect.y-=s.labelHeight,s.setHeight(o+s.labelHeight),s.labelMarginTop=s.labelHeight):"center"==s.labelPosVertical&&s.labelHeight>o?(s.rect.y-=(s.labelHeight-o)/2,s.setHeight(s.labelHeight),s.labelMarginTop=(s.labelHeight-o)/2):"bottom"==s.labelPosVertical&&s.setHeight(o+s.labelHeight))}})},M.prototype.tileNodes=function(t,i){var n=this.tileNodesByFavoringDim(t,i,!0),r=this.tileNodesByFavoringDim(t,i,!1),s=this.getOrgRatio(n);return this.getOrgRatio(r)<s?r:n},M.prototype.getOrgRatio=function(t){var i=t.width/t.height;return i<1&&(i=1/i),i},M.prototype.calcIdealRowWidth=function(t,i){var n=a.TILING_PADDING_VERTICAL,r=a.TILING_PADDING_HORIZONTAL,s=t.length,e=0,o=0,h=0;t.forEach(function(t){e+=t.getWidth(),o+=t.getHeight(),t.getWidth()>h&&(h=t.getWidth())});var f,u=e/s,c=o/s,l=Math.pow(n-r,2)+4*(u+r)*(c+n)*s,v=(r-n+Math.sqrt(l))/(2*(u+r));i?(f=Math.ceil(v))==v&&f++:f=Math.floor(v);var d=f*(u+r)-r;return h>d&&(d=h),d+=2*r},M.prototype.tileNodesByFavoringDim=function(t,i,n){var r=a.TILING_PADDING_VERTICAL,s=a.TILING_PADDING_HORIZONTAL,e=a.TILING_COMPARE_BY,o={rows:[],rowWidth:[],rowHeight:[],width:0,height:i,verticalPadding:r,horizontalPadding:s,centerX:0,centerY:0};e&&(o.idealRowWidth=this.calcIdealRowWidth(t,n));var h=function(t){return t.rect.width*t.rect.height},f=function(t,i){return h(i)-h(t)};t.sort(function(t,i){var n=f;return o.idealRowWidth?(n=e)(t.id,i.id):n(t,i)});for(var u=0,c=0,l=0;l<t.length;l++)u+=(v=t[l]).getCenterX(),c+=v.getCenterY();for(o.centerX=u/t.length,o.centerY=c/t.length,l=0;l<t.length;l++){var v=t[l];if(0==o.rows.length)this.insertNodeToRow(o,v,0,i);else if(this.canAddHorizontal(o,v.rect.width,v.rect.height)){var d=o.rows.length-1;o.idealRowWidth||(d=this.getShortestRowIndex(o)),this.insertNodeToRow(o,v,d,i)}else this.insertNodeToRow(o,v,o.rows.length,i);this.shiftToLastRow(o)}return o},M.prototype.insertNodeToRow=function(t,i,n,r){var s=r;n==t.rows.length&&(t.rows.push([]),t.rowWidth.push(s),t.rowHeight.push(0));var e=t.rowWidth[n]+i.rect.width;t.rows[n].length>0&&(e+=t.horizontalPadding),t.rowWidth[n]=e,t.width<e&&(t.width=e);var o=i.rect.height;n>0&&(o+=t.verticalPadding);var h=0;o>t.rowHeight[n]&&(h=t.rowHeight[n],t.rowHeight[n]=o,h=t.rowHeight[n]-h),t.height+=h,t.rows[n].push(i)},M.prototype.getShortestRowIndex=function(t){for(var i=-1,n=Number.MAX_VALUE,r=0;r<t.rows.length;r++)t.rowWidth[r]<n&&(i=r,n=t.rowWidth[r]);return i},M.prototype.getLongestRowIndex=function(t){for(var i=-1,n=Number.MIN_VALUE,r=0;r<t.rows.length;r++)t.rowWidth[r]>n&&(i=r,n=t.rowWidth[r]);return i},M.prototype.canAddHorizontal=function(t,i,n){if(t.idealRowWidth){var r=t.rows.length-1;return t.rowWidth[r]+i+t.horizontalPadding<=t.idealRowWidth}var s=this.getShortestRowIndex(t);if(s<0)return!0;var e=t.rowWidth[s];if(e+t.horizontalPadding+i<=t.width)return!0;var o,h,a=0;return t.rowHeight[s]<n&&s>0&&(a=n+t.verticalPadding-t.rowHeight[s]),o=t.width-e>=i+t.horizontalPadding?(t.height+a)/(e+i+t.horizontalPadding):(t.height+a)/t.width,a=n+t.verticalPadding,(h=t.width<i?(t.height+a)/i:(t.height+a)/t.width)<1&&(h=1/h),o<1&&(o=1/o),o<h},M.prototype.shiftToLastRow=function(t){var i=this.getLongestRowIndex(t),n=t.rowWidth.length-1,r=t.rows[i],s=r[r.length-1],e=s.width+t.horizontalPadding;if(t.width-t.rowWidth[n]>e&&i!=n){r.splice(-1,1),t.rows[n].push(s),t.rowWidth[i]=t.rowWidth[i]-e,t.rowWidth[n]=t.rowWidth[n]+e,t.width=t.rowWidth[instance.getLongestRowIndex(t)];for(var o=Number.MIN_VALUE,h=0;h<r.length;h++)r[h].height>o&&(o=r[h].height);i>0&&(o+=t.verticalPadding);var a=t.rowHeight[i]+t.rowHeight[n];t.rowHeight[i]=o,t.rowHeight[n]<s.height+t.verticalPadding&&(t.rowHeight[n]=s.height+t.verticalPadding);var f=t.rowHeight[i]+t.rowHeight[n];t.height+=f-a,this.shiftToLastRow(t)}},M.prototype.tilingPreLayout=function(){a.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},M.prototype.tilingPostLayout=function(){a.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},M.prototype.reduceTrees=function(){for(var t,i=[],n=!0;n;){var r=this.graphManager.getAllNodes(),s=[];n=!1;for(var e=0;e<r.length;e++)if(1==(t=r[e]).getEdges().length&&!t.getEdges()[0].isInterGraph&&null==t.getChild()){if(a.PURE_INCREMENTAL){var o=t.getEdges()[0].getOtherEnd(t),h=new d(t.getCenterX()-o.getCenterX(),t.getCenterY()-o.getCenterY());s.push([t,t.getEdges()[0],t.getOwner(),h])}else s.push([t,t.getEdges()[0],t.getOwner()]);n=!0}if(1==n){for(var f=[],u=0;u<s.length;u++)1==s[u][0].getEdges().length&&(f.push(s[u]),s[u][0].getOwner().remove(s[u][0]));i.push(f),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=i},M.prototype.growTree=function(t){for(var i,n=t[t.length-1],r=0;r<n.length;r++)i=n[r],this.findPlaceforPrunedNode(i),i[2].add(i[0]),i[2].add(i[1],i[1].source,i[1].target);t.splice(t.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},M.prototype.findPlaceforPrunedNode=function(t){var i,n,r=t[0];if(n=r==t[1].source?t[1].target:t[1].source,a.PURE_INCREMENTAL)r.setCenter(n.getCenterX()+t[3].getWidth(),n.getCenterY()+t[3].getHeight());else{var s=n.startX,e=n.finishX,o=n.startY,h=n.finishY,f=[0,0,0,0];if(o>0)for(var c=s;c<=e;c++)f[0]+=this.grid[c][o-1].length+this.grid[c][o].length-1;if(e<this.grid.length-1)for(c=o;c<=h;c++)f[1]+=this.grid[e+1][c].length+this.grid[e][c].length-1;if(h<this.grid[0].length-1)for(c=s;c<=e;c++)f[2]+=this.grid[c][h+1].length+this.grid[c][h].length-1;if(s>0)for(c=o;c<=h;c++)f[3]+=this.grid[s-1][c].length+this.grid[s][c].length-1;for(var l,v,d=p.MAX_VALUE,y=0;y<f.length;y++)f[y]<d?(d=f[y],l=1,v=y):f[y]==d&&l++;if(3==l&&0==d)0==f[0]&&0==f[1]&&0==f[2]?i=1:0==f[0]&&0==f[1]&&0==f[3]?i=0:0==f[0]&&0==f[2]&&0==f[3]?i=3:0==f[1]&&0==f[2]&&0==f[3]&&(i=2);else if(2==l&&0==d){var w=Math.floor(2*Math.random());i=0==f[0]&&0==f[1]?0==w?0:1:0==f[0]&&0==f[2]?0==w?0:2:0==f[0]&&0==f[3]?0==w?0:3:0==f[1]&&0==f[2]?0==w?1:2:0==f[1]&&0==f[3]?0==w?1:3:0==w?2:3}else i=4==l&&0==d?w=Math.floor(4*Math.random()):v;0==i?r.setCenter(n.getCenterX(),n.getCenterY()-n.getHeight()/2-u.DEFAULT_EDGE_LENGTH-r.getHeight()/2):1==i?r.setCenter(n.getCenterX()+n.getWidth()/2+u.DEFAULT_EDGE_LENGTH+r.getWidth()/2,n.getCenterY()):2==i?r.setCenter(n.getCenterX(),n.getCenterY()+n.getHeight()/2+u.DEFAULT_EDGE_LENGTH+r.getHeight()/2):r.setCenter(n.getCenterX()-n.getWidth()/2-u.DEFAULT_EDGE_LENGTH-r.getWidth()/2,n.getCenterY())}},t.exports=M},991:(t,i,n)=>{var r=n(551).FDLayoutNode,s=n(551).IMath;function e(t,i,n,s){r.call(this,t,i,n,s)}for(var o in e.prototype=Object.create(r.prototype),r)e[o]=r[o];e.prototype.calculateDisplacement=function(){var t=this.graphManager.getLayout();null!=this.getChild()&&this.fixedNodeWeight?(this.displacementX+=t.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=t.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=t.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=t.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>t.coolingFactor*t.maxNodeDisplacement&&(this.displacementX=t.coolingFactor*t.maxNodeDisplacement*s.sign(this.displacementX)),Math.abs(this.displacementY)>t.coolingFactor*t.maxNodeDisplacement&&(this.displacementY=t.coolingFactor*t.maxNodeDisplacement*s.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},e.prototype.propogateDisplacementToChildren=function(t,i){for(var n,r=this.getChild().getNodes(),s=0;s<r.length;s++)null==(n=r[s]).getChild()?(n.displacementX+=t,n.displacementY+=i):n.propogateDisplacementToChildren(t,i)},e.prototype.move=function(){var t=this.graphManager.getLayout();null!=this.child&&0!=this.child.getNodes().length||(this.moveBy(this.displacementX,this.displacementY),t.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},e.prototype.setPred1=function(t){this.pred1=t},e.prototype.getPred1=function(){return pred1},e.prototype.getPred2=function(){return pred2},e.prototype.setNext=function(t){this.next=t},e.prototype.getNext=function(){return next},e.prototype.setProcessed=function(t){this.processed=t},e.prototype.isProcessed=function(){return processed},t.exports=e},902:(t,i,n)=>{function r(t){if(Array.isArray(t)){for(var i=0,n=Array(t.length);i<t.length;i++)n[i]=t[i];return n}return Array.from(t)}var s=n(806),e=n(551).LinkedList,o=n(551).Matrix,h=n(551).SVD;function a(){}a.handleConstraints=function(t){var i={};i.fixedNodeConstraint=t.constraints.fixedNodeConstraint,i.alignmentConstraint=t.constraints.alignmentConstraint,i.relativePlacementConstraint=t.constraints.relativePlacementConstraint;for(var n=new Map,a=new Map,f=[],u=[],c=t.getAllNodes(),l=0,v=0;v<c.length;v++){var d=c[v];null==d.getChild()&&(a.set(d.id,l++),f.push(d.getCenterX()),u.push(d.getCenterY()),n.set(d.id,d))}i.relativePlacementConstraint&&i.relativePlacementConstraint.forEach(function(t){t.gap||0==t.gap||(t.left?t.gap=s.DEFAULT_EDGE_LENGTH+n.get(t.left).getWidth()/2+n.get(t.right).getWidth()/2:t.gap=s.DEFAULT_EDGE_LENGTH+n.get(t.top).getHeight()/2+n.get(t.bottom).getHeight()/2)});var y=function(t){var i=0,n=0;return t.forEach(function(t){i+=f[a.get(t)],n+=u[a.get(t)]}),{x:i/t.size,y:n/t.size}},p=function(t,i,n,s,o){var h=new Map;t.forEach(function(t,i){h.set(i,0)}),t.forEach(function(t,i){t.forEach(function(t){h.set(t.id,h.get(t.id)+1)})});var c=new Map,l=new Map,v=new e;h.forEach(function(t,r){0==t?(v.push(r),n||("horizontal"==i?c.set(r,a.has(r)?f[a.get(r)]:s.get(r)):c.set(r,a.has(r)?u[a.get(r)]:s.get(r)))):c.set(r,Number.NEGATIVE_INFINITY),n&&l.set(r,new Set([r]))}),n&&o.forEach(function(t){var r=[];if(t.forEach(function(t){n.has(t)&&r.push(t)}),r.length>0){var e=0;r.forEach(function(t){"horizontal"==i?(c.set(t,a.has(t)?f[a.get(t)]:s.get(t)),e+=c.get(t)):(c.set(t,a.has(t)?u[a.get(t)]:s.get(t)),e+=c.get(t))}),e/=r.length,t.forEach(function(t){n.has(t)||c.set(t,e)})}else{var o=0;t.forEach(function(t){o+="horizontal"==i?a.has(t)?f[a.get(t)]:s.get(t):a.has(t)?u[a.get(t)]:s.get(t)}),o/=t.length,t.forEach(function(t){c.set(t,o)})}});for(var d=function(){var r=v.shift();t.get(r).forEach(function(t){if(c.get(t.id)<c.get(r)+t.gap)if(n&&n.has(t.id)){var e=void 0;if(e="horizontal"==i?a.has(t.id)?f[a.get(t.id)]:s.get(t.id):a.has(t.id)?u[a.get(t.id)]:s.get(t.id),c.set(t.id,e),e<c.get(r)+t.gap){var o=c.get(r)+t.gap-e;l.get(r).forEach(function(t){c.set(t,c.get(t)-o)})}}else c.set(t.id,c.get(r)+t.gap);h.set(t.id,h.get(t.id)-1),0==h.get(t.id)&&v.push(t.id),n&&l.set(t.id,function(t,i){var n=new Set(t),r=!0,s=!1,e=void 0;try{for(var o,h=i[Symbol.iterator]();!(r=(o=h.next()).done);r=!0){var a=o.value;n.add(a)}}catch(f){s=!0,e=f}finally{try{!r&&h.return&&h.return()}finally{if(s)throw e}}return n}(l.get(r),l.get(t.id)))})};0!=v.length;)d();if(n){var y=new Set;t.forEach(function(t,i){0==t.length&&y.add(i)});var p=[];l.forEach(function(t,i){if(y.has(i)){var s=!1,e=!0,o=!1,h=void 0;try{for(var a,f=t[Symbol.iterator]();!(e=(a=f.next()).done);e=!0){var u=a.value;n.has(u)&&(s=!0)}}catch(v){o=!0,h=v}finally{try{!e&&f.return&&f.return()}finally{if(o)throw h}}if(!s){var c=!1,l=void 0;p.forEach(function(i,n){i.has([].concat(r(t))[0])&&(c=!0,l=n)}),c?t.forEach(function(t){p[l].add(t)}):p.push(new Set(t))}}}),p.forEach(function(t,n){var r=Number.POSITIVE_INFINITY,e=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,h=Number.NEGATIVE_INFINITY,l=!0,v=!1,d=void 0;try{for(var y,p=t[Symbol.iterator]();!(l=(y=p.next()).done);l=!0){var w=y.value,g=void 0;g="horizontal"==i?a.has(w)?f[a.get(w)]:s.get(w):a.has(w)?u[a.get(w)]:s.get(w);var m=c.get(w);g<r&&(r=g),g>o&&(o=g),m<e&&(e=m),m>h&&(h=m)}}catch(O){v=!0,d=O}finally{try{!l&&p.return&&p.return()}finally{if(v)throw d}}var b=(r+o)/2-(e+h)/2,M=!0,k=!1,x=void 0;try{for(var S,$=t[Symbol.iterator]();!(M=(S=$.next()).done);M=!0){var j=S.value;c.set(j,c.get(j)+b)}}catch(O){k=!0,x=O}finally{try{!M&&$.return&&$.return()}finally{if(k)throw x}}})}return c},w=function(t){var i=0,n=0,r=0,s=0;if(t.forEach(function(t){t.left?f[a.get(t.left)]-f[a.get(t.right)]>=0?i++:n++:u[a.get(t.top)]-u[a.get(t.bottom)]>=0?r++:s++}),i>n&&r>s)for(var e=0;e<a.size;e++)f[e]=-1*f[e],u[e]=-1*u[e];else if(i>n)for(var o=0;o<a.size;o++)f[o]=-1*f[o];else if(r>s)for(var h=0;h<a.size;h++)u[h]=-1*u[h]},g=function(t){var i=[],n=new e,r=new Set,s=0;return t.forEach(function(e,o){if(!r.has(o)){i[s]=[];var h=o;for(n.push(h),r.add(h),i[s].push(h);0!=n.length;)h=n.shift(),t.get(h).forEach(function(t){r.has(t.id)||(n.push(t.id),r.add(t.id),i[s].push(t.id))});s++}}),i},m=function(t){var i=new Map;return t.forEach(function(t,n){i.set(n,[])}),t.forEach(function(t,n){t.forEach(function(t){i.get(n).push(t),i.get(t.id).push({id:n,gap:t.gap,direction:t.direction})})}),i},b=function(t){var i=new Map;return t.forEach(function(t,n){i.set(n,[])}),t.forEach(function(t,n){t.forEach(function(t){i.get(t.id).push({id:n,gap:t.gap,direction:t.direction})})}),i},M=[],k=[],x=!1,S=!1,$=new Set,j=new Map,O=new Map,A=[];if(i.fixedNodeConstraint&&i.fixedNodeConstraint.forEach(function(t){$.add(t.nodeId)}),i.relativePlacementConstraint&&(i.relativePlacementConstraint.forEach(function(t){t.left?(j.has(t.left)?j.get(t.left).push({id:t.right,gap:t.gap,direction:"horizontal"}):j.set(t.left,[{id:t.right,gap:t.gap,direction:"horizontal"}]),j.has(t.right)||j.set(t.right,[])):(j.has(t.top)?j.get(t.top).push({id:t.bottom,gap:t.gap,direction:"vertical"}):j.set(t.top,[{id:t.bottom,gap:t.gap,direction:"vertical"}]),j.has(t.bottom)||j.set(t.bottom,[]))}),O=m(j),A=g(O)),s.TRANSFORM_ON_CONSTRAINT_HANDLING){if(i.fixedNodeConstraint&&i.fixedNodeConstraint.length>1)i.fixedNodeConstraint.forEach(function(t,i){M[i]=[t.position.x,t.position.y],k[i]=[f[a.get(t.nodeId)],u[a.get(t.nodeId)]]}),x=!0;else if(i.alignmentConstraint)!function(){var t=0;if(i.alignmentConstraint.vertical){for(var n=i.alignmentConstraint.vertical,s=function(i){var s=new Set;n[i].forEach(function(t){s.add(t)});var e=new Set([].concat(r(s)).filter(function(t){return $.has(t)})),o=void 0;o=e.size>0?f[a.get(e.values().next().value)]:y(s).x,n[i].forEach(function(i){M[t]=[o,u[a.get(i)]],k[t]=[f[a.get(i)],u[a.get(i)]],t++})},e=0;e<n.length;e++)s(e);x=!0}if(i.alignmentConstraint.horizontal){for(var o=i.alignmentConstraint.horizontal,h=function(i){var n=new Set;o[i].forEach(function(t){n.add(t)});var s=new Set([].concat(r(n)).filter(function(t){return $.has(t)})),e=void 0;e=s.size>0?f[a.get(s.values().next().value)]:y(n).y,o[i].forEach(function(i){M[t]=[f[a.get(i)],e],k[t]=[f[a.get(i)],u[a.get(i)]],t++})},c=0;c<o.length;c++)h(c);x=!0}i.relativePlacementConstraint&&(S=!0)}();else if(i.relativePlacementConstraint){for(var T=0,I=0,E=0;E<A.length;E++)A[E].length>T&&(T=A[E].length,I=E);if(T<O.size/2)w(i.relativePlacementConstraint),x=!1,S=!1;else{var L=new Map,D=new Map,N=[];A[I].forEach(function(t){j.get(t).forEach(function(i){"horizontal"==i.direction?(L.has(t)?L.get(t).push(i):L.set(t,[i]),L.has(i.id)||L.set(i.id,[]),N.push({left:t,right:i.id})):(D.has(t)?D.get(t).push(i):D.set(t,[i]),D.has(i.id)||D.set(i.id,[]),N.push({top:t,bottom:i.id}))})}),w(N),S=!1;var z=p(L,"horizontal"),B=p(D,"vertical");A[I].forEach(function(t,i){k[i]=[f[a.get(t)],u[a.get(t)]],M[i]=[],z.has(t)?M[i][0]=z.get(t):M[i][0]=f[a.get(t)],B.has(t)?M[i][1]=B.get(t):M[i][1]=u[a.get(t)]}),x=!0}}if(x){for(var C,P=o.transpose(M),R=o.transpose(k),G=0;G<P.length;G++)P[G]=o.multGamma(P[G]),R[G]=o.multGamma(R[G]);var q=o.multMat(P,o.transpose(R)),F=h.svd(q);C=o.multMat(F.V,o.transpose(F.U));for(var X=0;X<a.size;X++){var Y=[f[X],u[X]],_=[C[0][0],C[1][0]],H=[C[0][1],C[1][1]];f[X]=o.dotProduct(Y,_),u[X]=o.dotProduct(Y,H)}S&&w(i.relativePlacementConstraint)}}if(s.ENFORCE_CONSTRAINTS){if(i.fixedNodeConstraint&&i.fixedNodeConstraint.length>0){var Z={x:0,y:0};i.fixedNodeConstraint.forEach(function(t,i){var n,r,s={x:f[a.get(t.nodeId)],y:u[a.get(t.nodeId)]},e=t.position,o=(r=s,{x:(n=e).x-r.x,y:n.y-r.y});Z.x+=o.x,Z.y+=o.y}),Z.x/=i.fixedNodeConstraint.length,Z.y/=i.fixedNodeConstraint.length,f.forEach(function(t,i){f[i]+=Z.x}),u.forEach(function(t,i){u[i]+=Z.y}),i.fixedNodeConstraint.forEach(function(t){f[a.get(t.nodeId)]=t.position.x,u[a.get(t.nodeId)]=t.position.y})}if(i.alignmentConstraint){if(i.alignmentConstraint.vertical)for(var J=i.alignmentConstraint.vertical,V=function(t){var i=new Set;J[t].forEach(function(t){i.add(t)});var n=new Set([].concat(r(i)).filter(function(t){return $.has(t)})),s=void 0;s=n.size>0?f[a.get(n.values().next().value)]:y(i).x,i.forEach(function(t){$.has(t)||(f[a.get(t)]=s)})},W=0;W<J.length;W++)V(W);if(i.alignmentConstraint.horizontal)for(var U=i.alignmentConstraint.horizontal,K=function(t){var i=new Set;U[t].forEach(function(t){i.add(t)});var n=new Set([].concat(r(i)).filter(function(t){return $.has(t)})),s=void 0;s=n.size>0?u[a.get(n.values().next().value)]:y(i).y,i.forEach(function(t){$.has(t)||(u[a.get(t)]=s)})},Q=0;Q<U.length;Q++)K(Q)}i.relativePlacementConstraint&&function(){var t=new Map,n=new Map,r=new Map,s=new Map,e=new Map,o=new Map,h=new Set,c=new Set;if($.forEach(function(t){h.add(t),c.add(t)}),i.alignmentConstraint){if(i.alignmentConstraint.vertical)for(var l=i.alignmentConstraint.vertical,v=function(i){r.set("dummy"+i,[]),l[i].forEach(function(n){t.set(n,"dummy"+i),r.get("dummy"+i).push(n),$.has(n)&&h.add("dummy"+i)}),e.set("dummy"+i,f[a.get(l[i][0])])},d=0;d<l.length;d++)v(d);if(i.alignmentConstraint.horizontal)for(var y=i.alignmentConstraint.horizontal,w=function(t){s.set("dummy"+t,[]),y[t].forEach(function(i){n.set(i,"dummy"+t),s.get("dummy"+t).push(i),$.has(i)&&c.add("dummy"+t)}),o.set("dummy"+t,u[a.get(y[t][0])])},M=0;M<y.length;M++)w(M)}var k=new Map,x=new Map,S=function(i){j.get(i).forEach(function(r){var s=void 0,e=void 0;"horizontal"==r.direction?(s=t.get(i)?t.get(i):i,e=t.get(r.id)?{id:t.get(r.id),gap:r.gap,direction:r.direction}:r,k.has(s)?k.get(s).push(e):k.set(s,[e]),k.has(e.id)||k.set(e.id,[])):(s=n.get(i)?n.get(i):i,e=n.get(r.id)?{id:n.get(r.id),gap:r.gap,direction:r.direction}:r,x.has(s)?x.get(s).push(e):x.set(s,[e]),x.has(e.id)||x.set(e.id,[]))})},O=!0,A=!1,T=void 0;try{for(var I,E=j.keys()[Symbol.iterator]();!(O=(I=E.next()).done);O=!0)S(I.value)}catch(tt){A=!0,T=tt}finally{try{!O&&E.return&&E.return()}finally{if(A)throw T}}var L=m(k),D=m(x),N=g(L),z=g(D),B=b(k),C=b(x),P=[],R=[];N.forEach(function(t,i){P[i]=[],t.forEach(function(t){0==B.get(t).length&&P[i].push(t)})}),z.forEach(function(t,i){R[i]=[],t.forEach(function(t){0==C.get(t).length&&R[i].push(t)})});var G=p(k,"horizontal",h,e,P),q=p(x,"vertical",c,o,R),F=function(t){r.get(t)?r.get(t).forEach(function(i){f[a.get(i)]=G.get(t)}):f[a.get(t)]=G.get(t)},X=!0,Y=!1,_=void 0;try{for(var H,Z=G.keys()[Symbol.iterator]();!(X=(H=Z.next()).done);X=!0)F(H.value)}catch(tt){Y=!0,_=tt}finally{try{!X&&Z.return&&Z.return()}finally{if(Y)throw _}}var J=function(t){s.get(t)?s.get(t).forEach(function(i){u[a.get(i)]=q.get(t)}):u[a.get(t)]=q.get(t)},V=!0,W=!1,U=void 0;try{for(var K,Q=q.keys()[Symbol.iterator]();!(V=(K=Q.next()).done);V=!0)J(K.value)}catch(tt){W=!0,U=tt}finally{try{!V&&Q.return&&Q.return()}finally{if(W)throw U}}}()}for(var tt=0;tt<c.length;tt++){var it=c[tt];null==it.getChild()&&it.setCenter(f[a.get(it.id)],u[a.get(it.id)])}},t.exports=a},551:i=>{i.exports=t}},n={},function t(r){var s=n[r];if(void 0!==s)return s.exports;var e=n[r]={exports:{}};return i[r](e,e.exports,t),e.exports}(45);var i,n},T.exports=t(E()));var t}var N,z,B,C;const P=i(N?A.exports:(N=1,A.exports=(z=D(),B={658:t=>{t.exports=null!=Object.assign?Object.assign.bind(Object):function(t){for(var i=arguments.length,n=Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];return n.forEach(function(i){Object.keys(i).forEach(function(n){return t[n]=i[n]})}),t}},548:(t,i,n)=>{var r=function(){return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,i){var n=[],r=!0,s=!1,e=void 0;try{for(var o,h=t[Symbol.iterator]();!(r=(o=h.next()).done)&&(n.push(o.value),!i||n.length!==i);r=!0);}catch(a){s=!0,e=a}finally{try{!r&&h.return&&h.return()}finally{if(s)throw e}}return n}(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=n(140).layoutBase.LinkedList,e={getTopMostNodes:function(t){for(var i={},n=0;n<t.length;n++)i[t[n].id()]=!0;return t.filter(function(t,n){"number"==typeof t&&(t=n);for(var r=t.parent()[0];null!=r;){if(i[r.id()])return!1;r=r.parent()[0]}return!0})},connectComponents:function(t,i,n,r){var e=new s,o=new Set,h=[],a=void 0,f=void 0,u=void 0,c=!1,l=1,v=[],d=[],y=function(){var r=t.collection();d.push(r);var s=n[0],y=t.collection();y.merge(s).merge(s.descendants().intersection(i)),h.push(s),y.forEach(function(t){e.push(t),o.add(t),r.merge(t)});for(var p=function(){s=e.shift();var f=t.collection();s.neighborhood().nodes().forEach(function(t){i.intersection(s.edgesWith(t)).length>0&&f.merge(t)});for(var u=0;u<f.length;u++){var c=f[u];null==(a=n.intersection(c.union(c.ancestors())))||o.has(a[0])||a.union(a.descendants()).forEach(function(t){e.push(t),o.add(t),r.merge(t),n.has(t)&&h.push(t)})}};0!=e.length;)p();if(r.forEach(function(t){i.intersection(t.connectedEdges()).forEach(function(t){r.has(t.source())&&r.has(t.target())&&r.merge(t)})}),h.length==n.length&&(c=!0),!c||c&&l>1){f=h[0],u=f.connectedEdges().length,h.forEach(function(t){t.connectedEdges().length<u&&(u=t.connectedEdges().length,f=t)}),v.push(f.id());var w=t.collection();w.merge(h[0]),h.forEach(function(t){w.merge(t)}),h=[],n=n.difference(w),l++}};do{y()}while(!c);return r&&v.length>0&&r.set("dummy"+(r.size+1),v),d},relocateComponent:function(t,i,n){if(!n.fixedNodeConstraint){var s=Number.POSITIVE_INFINITY,e=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY;if("draft"==n.quality){var a=!0,f=!1,u=void 0;try{for(var c,l=i.nodeIndexes[Symbol.iterator]();!(a=(c=l.next()).done);a=!0){var v=c.value,d=r(v,2),y=d[0],p=d[1],w=n.cy.getElementById(y);if(w){var g=w.boundingBox(),m=i.xCoords[p]-g.w/2,b=i.xCoords[p]+g.w/2,M=i.yCoords[p]-g.h/2,k=i.yCoords[p]+g.h/2;m<s&&(s=m),b>e&&(e=b),M<o&&(o=M),k>h&&(h=k)}}}catch(O){f=!0,u=O}finally{try{!a&&l.return&&l.return()}finally{if(f)throw u}}var x=t.x-(e+s)/2,S=t.y-(h+o)/2;i.xCoords=i.xCoords.map(function(t){return t+x}),i.yCoords=i.yCoords.map(function(t){return t+S})}else{Object.keys(i).forEach(function(t){var n=i[t],r=n.getRect().x,a=n.getRect().x+n.getRect().width,f=n.getRect().y,u=n.getRect().y+n.getRect().height;r<s&&(s=r),a>e&&(e=a),f<o&&(o=f),u>h&&(h=u)});var $=t.x-(e+s)/2,j=t.y-(h+o)/2;Object.keys(i).forEach(function(t){var n=i[t];n.setCenter(n.getCenterX()+$,n.getCenterY()+j)})}}},calcBoundingBox:function(t,i,n,r){for(var s=Number.MAX_SAFE_INTEGER,e=Number.MIN_SAFE_INTEGER,o=Number.MAX_SAFE_INTEGER,h=Number.MIN_SAFE_INTEGER,a=void 0,f=void 0,u=void 0,c=void 0,l=t.descendants().not(":parent"),v=l.length,d=0;d<v;d++){var y=l[d];s>(a=i[r.get(y.id())]-y.width()/2)&&(s=a),e<(f=i[r.get(y.id())]+y.width()/2)&&(e=f),o>(u=n[r.get(y.id())]-y.height()/2)&&(o=u),h<(c=n[r.get(y.id())]+y.height()/2)&&(h=c)}var p={};return p.topLeftX=s,p.topLeftY=o,p.width=e-s,p.height=h-o,p},calcParentsWithoutChildren:function(t,i){var n=t.collection();return i.nodes(":parent").forEach(function(t){var i=!1;t.children().forEach(function(t){"none"!=t.css("display")&&(i=!0)}),i||n.merge(t)}),n}};t.exports=e},816:(t,i,n)=>{var r=n(548),s=n(140).CoSELayout,e=n(140).CoSENode,o=n(140).layoutBase.PointD,h=n(140).layoutBase.DimensionD,a=n(140).layoutBase.LayoutConstants,f=n(140).layoutBase.FDLayoutConstants,u=n(140).CoSEConstants;t.exports={coseLayout:function(t,i){var n=t.cy,c=t.eles,l=c.nodes(),v=c.edges(),d=void 0,y=void 0,p=void 0,w={};t.randomize&&(d=i.nodeIndexes,y=i.xCoords,p=i.yCoords);var g=function(t){return"function"==typeof t},m=function(t,i){return g(t)?t(i):t},b=r.calcParentsWithoutChildren(n,c);null!=t.nestingFactor&&(u.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=f.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=t.nestingFactor),null!=t.gravity&&(u.DEFAULT_GRAVITY_STRENGTH=f.DEFAULT_GRAVITY_STRENGTH=t.gravity),null!=t.numIter&&(u.MAX_ITERATIONS=f.MAX_ITERATIONS=t.numIter),null!=t.gravityRange&&(u.DEFAULT_GRAVITY_RANGE_FACTOR=f.DEFAULT_GRAVITY_RANGE_FACTOR=t.gravityRange),null!=t.gravityCompound&&(u.DEFAULT_COMPOUND_GRAVITY_STRENGTH=f.DEFAULT_COMPOUND_GRAVITY_STRENGTH=t.gravityCompound),null!=t.gravityRangeCompound&&(u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=f.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=t.gravityRangeCompound),null!=t.initialEnergyOnIncremental&&(u.DEFAULT_COOLING_FACTOR_INCREMENTAL=f.DEFAULT_COOLING_FACTOR_INCREMENTAL=t.initialEnergyOnIncremental),null!=t.tilingCompareBy&&(u.TILING_COMPARE_BY=t.tilingCompareBy),"proof"==t.quality?a.QUALITY=2:a.QUALITY=0,u.NODE_DIMENSIONS_INCLUDE_LABELS=f.NODE_DIMENSIONS_INCLUDE_LABELS=a.NODE_DIMENSIONS_INCLUDE_LABELS=t.nodeDimensionsIncludeLabels,u.DEFAULT_INCREMENTAL=f.DEFAULT_INCREMENTAL=a.DEFAULT_INCREMENTAL=!t.randomize,u.ANIMATE=f.ANIMATE=a.ANIMATE=t.animate,u.TILE=t.tile,u.TILING_PADDING_VERTICAL="function"==typeof t.tilingPaddingVertical?t.tilingPaddingVertical.call():t.tilingPaddingVertical,u.TILING_PADDING_HORIZONTAL="function"==typeof t.tilingPaddingHorizontal?t.tilingPaddingHorizontal.call():t.tilingPaddingHorizontal,u.DEFAULT_INCREMENTAL=f.DEFAULT_INCREMENTAL=a.DEFAULT_INCREMENTAL=!0,u.PURE_INCREMENTAL=!t.randomize,a.DEFAULT_UNIFORM_LEAF_NODE_SIZES=t.uniformNodeDimensions,"transformed"==t.step&&(u.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,u.ENFORCE_CONSTRAINTS=!1,u.APPLY_LAYOUT=!1),"enforced"==t.step&&(u.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,u.ENFORCE_CONSTRAINTS=!0,u.APPLY_LAYOUT=!1),"cose"==t.step&&(u.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,u.ENFORCE_CONSTRAINTS=!1,u.APPLY_LAYOUT=!0),"all"==t.step&&(t.randomize?u.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:u.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,u.ENFORCE_CONSTRAINTS=!0,u.APPLY_LAYOUT=!0),t.fixedNodeConstraint||t.alignmentConstraint||t.relativePlacementConstraint?u.TREE_REDUCTION_ON_INCREMENTAL=!1:u.TREE_REDUCTION_ON_INCREMENTAL=!0;var M,k,x=new s,S=x.newGraphManager();return function t(i,n,s,a){for(var f=n.length,u=0;u<f;u++){var c=n[u],l=null;0==c.intersection(b).length&&(l=c.children());var v=void 0,g=c.layoutDimensions({nodeDimensionsIncludeLabels:a.nodeDimensionsIncludeLabels});if(null!=c.outerWidth()&&null!=c.outerHeight())if(a.randomize)if(c.isParent()){var M=r.calcBoundingBox(c,y,p,d);v=0==c.intersection(b).length?i.add(new e(s.graphManager,new o(M.topLeftX,M.topLeftY),new h(M.width,M.height))):i.add(new e(s.graphManager,new o(M.topLeftX,M.topLeftY),new h(parseFloat(g.w),parseFloat(g.h))))}else v=i.add(new e(s.graphManager,new o(y[d.get(c.id())]-g.w/2,p[d.get(c.id())]-g.h/2),new h(parseFloat(g.w),parseFloat(g.h))));else v=i.add(new e(s.graphManager,new o(c.position("x")-g.w/2,c.position("y")-g.h/2),new h(parseFloat(g.w),parseFloat(g.h))));else v=i.add(new e(this.graphManager));v.id=c.data("id"),v.nodeRepulsion=m(a.nodeRepulsion,c),v.paddingLeft=parseInt(c.css("padding")),v.paddingTop=parseInt(c.css("padding")),v.paddingRight=parseInt(c.css("padding")),v.paddingBottom=parseInt(c.css("padding")),a.nodeDimensionsIncludeLabels&&(v.labelWidth=c.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,v.labelHeight=c.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,v.labelPosVertical=c.css("text-valign"),v.labelPosHorizontal=c.css("text-halign")),w[c.data("id")]=v,isNaN(v.rect.x)&&(v.rect.x=0),isNaN(v.rect.y)&&(v.rect.y=0),null!=l&&l.length>0&&t(s.getGraphManager().add(s.newGraph(),v),l,s,a)}}(S.addRoot(),r.getTopMostNodes(l),x,t),function(i,n,r){for(var s=0,e=0,o=0;o<r.length;o++){var h=r[o],a=w[h.data("source")],c=w[h.data("target")];if(a&&c&&a!==c&&0==a.getEdgesBetween(c).length){var l=n.add(i.newEdge(),a,c);l.id=h.id(),l.idealLength=m(t.idealEdgeLength,h),l.edgeElasticity=m(t.edgeElasticity,h),s+=l.idealLength,e++}}null!=t.idealEdgeLength&&(e>0?u.DEFAULT_EDGE_LENGTH=f.DEFAULT_EDGE_LENGTH=s/e:g(t.idealEdgeLength)?u.DEFAULT_EDGE_LENGTH=f.DEFAULT_EDGE_LENGTH=50:u.DEFAULT_EDGE_LENGTH=f.DEFAULT_EDGE_LENGTH=t.idealEdgeLength,u.MIN_REPULSION_DIST=f.MIN_REPULSION_DIST=f.DEFAULT_EDGE_LENGTH/10,u.DEFAULT_RADIAL_SEPARATION=f.DEFAULT_EDGE_LENGTH)}(x,S,v),M=x,(k=t).fixedNodeConstraint&&(M.constraints.fixedNodeConstraint=k.fixedNodeConstraint),k.alignmentConstraint&&(M.constraints.alignmentConstraint=k.alignmentConstraint),k.relativePlacementConstraint&&(M.constraints.relativePlacementConstraint=k.relativePlacementConstraint),x.runLayout(),w}}},212:(t,i,n)=>{var r=function(){function t(t,i){for(var n=0;n<i.length;n++){var r=i[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(i,n,r){return n&&t(i.prototype,n),r&&t(i,r),i}}(),s=n(658),e=n(548),o=n(657).spectralLayout,h=n(816).coseLayout,a=Object.freeze({quality:"default",randomize:!0,animate:!0,animationDuration:1e3,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:"all",samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:1e-7,nodeRepulsion:function(t){return 4500},idealEdgeLength:function(t){return 50},edgeElasticity:function(t){return.45},nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:function(){},stop:function(){}}),f=function(){function t(i){!function(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}(this,t),this.options=s({},a,i)}return r(t,[{key:"run",value:function(){var t=this.options,i=t.cy,n=t.eles,r=[],s=[],a=void 0,f=[];!t.fixedNodeConstraint||Array.isArray(t.fixedNodeConstraint)&&0!=t.fixedNodeConstraint.length||(t.fixedNodeConstraint=void 0),t.alignmentConstraint&&(!t.alignmentConstraint.vertical||Array.isArray(t.alignmentConstraint.vertical)&&0!=t.alignmentConstraint.vertical.length||(t.alignmentConstraint.vertical=void 0),!t.alignmentConstraint.horizontal||Array.isArray(t.alignmentConstraint.horizontal)&&0!=t.alignmentConstraint.horizontal.length||(t.alignmentConstraint.horizontal=void 0)),!t.relativePlacementConstraint||Array.isArray(t.relativePlacementConstraint)&&0!=t.relativePlacementConstraint.length||(t.relativePlacementConstraint=void 0),(t.fixedNodeConstraint||t.alignmentConstraint||t.relativePlacementConstraint)&&(t.tile=!1,t.packComponents=!1);var u=void 0,c=!1;if(i.layoutUtilities&&t.packComponents&&((u=i.layoutUtilities("get"))||(u=i.layoutUtilities()),c=!0),n.nodes().length>0)if(c){var l=e.getTopMostNodes(t.eles.nodes());if((a=e.connectComponents(i,t.eles,l)).forEach(function(t){var i=t.boundingBox();f.push({x:i.x1+i.w/2,y:i.y1+i.h/2})}),t.randomize&&a.forEach(function(i){t.eles=i,r.push(o(t))}),"default"==t.quality||"proof"==t.quality){var v=i.collection();if(t.tile){var d=0,y={nodeIndexes:new Map,xCoords:[],yCoords:[]},p=[];if(a.forEach(function(t,i){0==t.edges().length&&(t.nodes().forEach(function(i,n){v.merge(t.nodes()[n]),i.isParent()||(y.nodeIndexes.set(t.nodes()[n].id(),d++),y.xCoords.push(t.nodes()[0].position().x),y.yCoords.push(t.nodes()[0].position().y))}),p.push(i))}),v.length>1){var w=v.boundingBox();f.push({x:w.x1+w.w/2,y:w.y1+w.h/2}),a.push(v),r.push(y);for(var g=p.length-1;g>=0;g--)a.splice(p[g],1),r.splice(p[g],1),f.splice(p[g],1)}}a.forEach(function(i,n){t.eles=i,s.push(h(t,r[n])),e.relocateComponent(f[n],s[n],t)})}else a.forEach(function(i,n){e.relocateComponent(f[n],r[n],t)});var m=new Set;if(a.length>1){var b=[],M=n.filter(function(t){return"none"==t.css("display")});a.forEach(function(i,n){var o=void 0;if("draft"==t.quality&&(o=r[n].nodeIndexes),i.nodes().not(M).length>0){var h={edges:[],nodes:[]},a=void 0;i.nodes().not(M).forEach(function(i){if("draft"==t.quality)if(i.isParent()){var f=e.calcBoundingBox(i,r[n].xCoords,r[n].yCoords,o);h.nodes.push({x:f.topLeftX,y:f.topLeftY,width:f.width,height:f.height})}else a=o.get(i.id()),h.nodes.push({x:r[n].xCoords[a]-i.boundingbox().w/2,y:r[n].yCoords[a]-i.boundingbox().h/2,width:i.boundingbox().w,height:i.boundingbox().h});else s[n][i.id()]&&h.nodes.push({x:s[n][i.id()].getLeft(),y:s[n][i.id()].getTop(),width:s[n][i.id()].getWidth(),height:s[n][i.id()].getHeight()})}),i.edges().forEach(function(i){var a=i.source(),f=i.target();if("none"!=a.css("display")&&"none"!=f.css("display"))if("draft"==t.quality){var u=o.get(a.id()),c=o.get(f.id()),l=[],v=[];if(a.isParent()){var d=e.calcBoundingBox(a,r[n].xCoords,r[n].yCoords,o);l.push(d.topLeftX+d.width/2),l.push(d.topLeftY+d.height/2)}else l.push(r[n].xCoords[u]),l.push(r[n].yCoords[u]);if(f.isParent()){var y=e.calcBoundingBox(f,r[n].xCoords,r[n].yCoords,o);v.push(y.topLeftX+y.width/2),v.push(y.topLeftY+y.height/2)}else v.push(r[n].xCoords[c]),v.push(r[n].yCoords[c]);h.edges.push({startX:l[0],startY:l[1],endX:v[0],endY:v[1]})}else s[n][a.id()]&&s[n][f.id()]&&h.edges.push({startX:s[n][a.id()].getCenterX(),startY:s[n][a.id()].getCenterY(),endX:s[n][f.id()].getCenterX(),endY:s[n][f.id()].getCenterY()})}),h.nodes.length>0&&(b.push(h),m.add(n))}});var k=u.packComponents(b,t.randomize).shifts;if("draft"==t.quality)r.forEach(function(t,i){var n=t.xCoords.map(function(t){return t+k[i].dx}),r=t.yCoords.map(function(t){return t+k[i].dy});t.xCoords=n,t.yCoords=r});else{var x=0;m.forEach(function(t){Object.keys(s[t]).forEach(function(i){var n=s[t][i];n.setCenter(n.getCenterX()+k[x].dx,n.getCenterY()+k[x].dy)}),x++})}}}else{var S=t.eles.boundingBox();if(f.push({x:S.x1+S.w/2,y:S.y1+S.h/2}),t.randomize){var $=o(t);r.push($)}"default"==t.quality||"proof"==t.quality?(s.push(h(t,r[0])),e.relocateComponent(f[0],s[0],t)):e.relocateComponent(f[0],r[0],t)}var j=function(i,n){if("default"==t.quality||"proof"==t.quality){"number"==typeof i&&(i=n);var e=void 0,o=void 0,h=i.data("id");return s.forEach(function(t){h in t&&(e={x:t[h].getRect().getCenterX(),y:t[h].getRect().getCenterY()},o=t[h])}),t.nodeDimensionsIncludeLabels&&(o.labelWidth&&("left"==o.labelPosHorizontal?e.x+=o.labelWidth/2:"right"==o.labelPosHorizontal&&(e.x-=o.labelWidth/2)),o.labelHeight&&("top"==o.labelPosVertical?e.y+=o.labelHeight/2:"bottom"==o.labelPosVertical&&(e.y-=o.labelHeight/2))),null==e&&(e={x:i.position("x"),y:i.position("y")}),{x:e.x,y:e.y}}var a=void 0;return r.forEach(function(t){var n=t.nodeIndexes.get(i.id());null!=n&&(a={x:t.xCoords[n],y:t.yCoords[n]})}),null==a&&(a={x:i.position("x"),y:i.position("y")}),{x:a.x,y:a.y}};if("default"==t.quality||"proof"==t.quality||t.randomize){var O=e.calcParentsWithoutChildren(i,n),A=n.filter(function(t){return"none"==t.css("display")});t.eles=n.not(A),n.nodes().not(":parent").not(A).layoutPositions(this,t,j),O.length>0&&O.forEach(function(t){t.position(j(t))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),t}();t.exports=f},657:(t,i,n)=>{var r=n(548),s=n(140).layoutBase.Matrix,e=n(140).layoutBase.SVD;t.exports={spectralLayout:function(t){var i=t.cy,n=t.eles,o=n.nodes(),h=n.nodes(":parent"),a=new Map,f=new Map,u=new Map,c=[],l=[],v=[],d=[],y=[],p=[],w=[],g=[],m=void 0,b=1e8,M=1e-9,k=t.piTol,x=t.samplingType,S=t.nodeSeparation,$=void 0,j=function(t,i,n){for(var r=[],s=0,e=0,o=0,h=void 0,a=[],u=0,l=1,v=0;v<m;v++)a[v]=b;for(r[e]=t,a[t]=0;e>=s;){o=r[s++];for(var d=c[o],w=0;w<d.length;w++)a[h=f.get(d[w])]==b&&(a[h]=a[o]+1,r[++e]=h);p[o][i]=a[o]*S}if(n){for(var g=0;g<m;g++)p[g][i]<y[g]&&(y[g]=p[g][i]);for(var M=0;M<m;M++)y[M]>u&&(u=y[M],l=M)}return l};r.connectComponents(i,n,r.getTopMostNodes(o),a),h.forEach(function(t){r.connectComponents(i,n,r.getTopMostNodes(t.descendants().intersection(n)),a)});for(var O=0,A=0;A<o.length;A++)o[A].isParent()||f.set(o[A].id(),O++);var T=!0,I=!1,E=void 0;try{for(var L,D=a.keys()[Symbol.iterator]();!(T=(L=D.next()).done);T=!0){var N=L.value;f.set(N,O++)}}catch(W){I=!0,E=W}finally{try{!T&&D.return&&D.return()}finally{if(I)throw E}}for(var z=0;z<f.size;z++)c[z]=[];h.forEach(function(t){for(var i=t.children().intersection(n);0==i.nodes(":childless").length;)i=i.nodes()[0].children().intersection(n);var r=0,s=i.nodes(":childless")[0].connectedEdges().length;i.nodes(":childless").forEach(function(t,i){t.connectedEdges().length<s&&(s=t.connectedEdges().length,r=i)}),u.set(t.id(),i.nodes(":childless")[r].id())}),o.forEach(function(t){var i=void 0;i=t.isParent()?f.get(u.get(t.id())):f.get(t.id()),t.neighborhood().nodes().forEach(function(r){n.intersection(t.edgesWith(r)).length>0&&(r.isParent()?c[i].push(u.get(r.id())):c[i].push(r.id()))})});var B=function(t){var n=f.get(t),r=void 0;a.get(t).forEach(function(s){r=i.getElementById(s).isParent()?u.get(s):s,c[n].push(r),c[f.get(r)].push(t)})},C=!0,P=!1,R=void 0;try{for(var G,q=a.keys()[Symbol.iterator]();!(C=(G=q.next()).done);C=!0)B(G.value)}catch(W){P=!0,R=W}finally{try{!C&&q.return&&q.return()}finally{if(P)throw R}}var F=void 0;if((m=f.size)>2){$=m<t.sampleSize?m:t.sampleSize;for(var X=0;X<m;X++)p[X]=[];for(var Y=0;Y<$;Y++)g[Y]=[];return"draft"==t.quality||"all"==t.step?(function(t){var i=void 0;if(t){i=Math.floor(Math.random()*m);for(var n=0;n<m;n++)y[n]=b;for(var r=0;r<$;r++)d[r]=i,i=j(i,r,t)}else{!function(){for(var t=0,i=0,n=!1;i<$;){t=Math.floor(Math.random()*m),n=!1;for(var r=0;r<i;r++)if(d[r]==t){n=!0;break}n||(d[i]=t,i++)}}();for(var s=0;s<$;s++)j(d[s],s,t)}for(var e=0;e<m;e++)for(var o=0;o<$;o++)p[e][o]*=p[e][o];for(var h=0;h<$;h++)w[h]=[];for(var a=0;a<$;a++)for(var f=0;f<$;f++)w[a][f]=p[d[f]][a]}(x),function(){for(var t=e.svd(w),i=t.S,n=t.U,r=t.V,o=i[0]*i[0]*i[0],h=[],a=0;a<$;a++){h[a]=[];for(var f=0;f<$;f++)h[a][f]=0,a==f&&(h[a][f]=i[a]/(i[a]*i[a]+o/(i[a]*i[a])))}g=s.multMat(s.multMat(r,h),s.transpose(n))}(),function(){for(var t=void 0,i=void 0,n=[],r=[],e=[],o=[],h=0;h<m;h++)n[h]=Math.random(),r[h]=Math.random();n=s.normalize(n),r=s.normalize(r);for(var a=M,f=M,u=void 0;;){for(var c=0;c<m;c++)e[c]=n[c];if(n=s.multGamma(s.multL(s.multGamma(e),p,g)),t=s.dotProduct(e,n),n=s.normalize(n),a=s.dotProduct(e,n),(u=Math.abs(a/f))<=1+k&&u>=1)break;f=a}for(var d=0;d<m;d++)e[d]=n[d];for(f=M;;){for(var y=0;y<m;y++)o[y]=r[y];if(o=s.minusOp(o,s.multCons(e,s.dotProduct(e,o))),r=s.multGamma(s.multL(s.multGamma(o),p,g)),i=s.dotProduct(o,r),r=s.normalize(r),a=s.dotProduct(o,r),(u=Math.abs(a/f))<=1+k&&u>=1)break;f=a}for(var w=0;w<m;w++)o[w]=r[w];l=s.multCons(e,Math.sqrt(Math.abs(t))),v=s.multCons(o,Math.sqrt(Math.abs(i)))}(),F={nodeIndexes:f,xCoords:l,yCoords:v}):(f.forEach(function(t,n){l.push(i.getElementById(n).position("x")),v.push(i.getElementById(n).position("y"))}),F={nodeIndexes:f,xCoords:l,yCoords:v}),F}var _=f.keys(),H=i.getElementById(_.next().value),Z=H.position(),J=H.outerWidth();if(l.push(Z.x),v.push(Z.y),2==m){var V=i.getElementById(_.next().value).outerWidth();l.push(Z.x+J/2+V/2+t.idealEdgeLength),v.push(Z.y)}return F={nodeIndexes:f,xCoords:l,yCoords:v}}}},579:(t,i,n)=>{var r=n(212),s=function(t){t&&t("layout","fcose",r)};"undefined"!=typeof cytoscape&&s(cytoscape),t.exports=s},140:t=>{t.exports=z}},C={},function t(i){var n=C[i];if(void 0!==n)return n.exports;var r=C[i]={exports:{}};return B[i](r,r.exports,t),r.exports}(579))));var R={L:"left",R:"right",T:"top",B:"bottom"},G={L:n(t=>`${t},${t/2} 0,${t} 0,0`,"L"),R:n(t=>`0,${t/2} ${t},0 ${t},${t}`,"R"),T:n(t=>`0,0 ${t},0 ${t/2},${t}`,"T"),B:n(t=>`${t/2},0 ${t},${t} 0,${t}`,"B")},q={L:n((t,i)=>t-i+2,"L"),R:n((t,i)=>t-2,"R"),T:n((t,i)=>t-i+2,"T"),B:n((t,i)=>t-2,"B")},F=n(function(t){return Y(t)?"L"===t?"R":"L":"T"===t?"B":"T"},"getOppositeArchitectureDirection"),X=n(function(t){return"L"===t||"R"===t||"T"===t||"B"===t},"isArchitectureDirection"),Y=n(function(t){return"L"===t||"R"===t},"isArchitectureDirectionX"),_=n(function(t){return"T"===t||"B"===t},"isArchitectureDirectionY"),H=n(function(t,i){const n=Y(t)&&_(i),r=_(t)&&Y(i);return n||r},"isArchitectureDirectionXY"),Z=n(function(t){const i=t[0],n=t[1],r=Y(i)&&_(n),s=_(i)&&Y(n);return r||s},"isArchitecturePairXY"),J=n(function(t){return"LL"!==t&&"RR"!==t&&"TT"!==t&&"BB"!==t},"isValidArchitectureDirectionPair"),V=n(function(t,i){const n=`${t}${i}`;return J(n)?n:void 0},"getArchitectureDirectionPair"),W=n(function([t,i],n){const r=n[0],s=n[1];return Y(r)?_(s)?[t+("L"===r?-1:1),i+("T"===s?1:-1)]:[t+("L"===r?-1:1),i]:Y(s)?[t+("L"===s?1:-1),i+("T"===r?1:-1)]:[t,i+("T"===r?1:-1)]},"shiftPositionByArchitectureDirectionPair"),U=n(function(t){return"LT"===t||"TL"===t?[1,1]:"BL"===t||"LB"===t?[1,-1]:"BR"===t||"RB"===t?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),K=n(function(t,i){return H(t,i)?"bend":Y(t)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Q=n(function(t){return"service"===t.type},"isArchitectureService"),tt=n(function(t){return"junction"===t.type},"isArchitectureJunction"),it=n(t=>t.data(),"edgeData"),nt=n(t=>t.data(),"nodeData"),rt=d.architecture,st=(n(t=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.elements={},this.setAccTitle=o,this.getAccTitle=h,this.setDiagramTitle=a,this.getDiagramTitle=f,this.getAccDescription=u,this.setAccDescription=c,this.clear()}clear(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},l()}addService({id:t,icon:i,in:n,title:r,iconText:s}){if(void 0!==this.registeredIds[t])throw new Error(`The service id [${t}] is already in use by another ${this.registeredIds[t]}`);if(void 0!==n){if(t===n)throw new Error(`The service [${t}] cannot be placed within itself`);if(void 0===this.registeredIds[n])throw new Error(`The service [${t}]'s parent does not exist. Please make sure the parent is created before this service`);if("node"===this.registeredIds[n])throw new Error(`The service [${t}]'s parent is not a group`)}this.registeredIds[t]="node",this.nodes[t]={id:t,type:"service",icon:i,iconText:s,title:r,edges:[],in:n}}getServices(){return Object.values(this.nodes).filter(Q)}addJunction({id:t,in:i}){this.registeredIds[t]="node",this.nodes[t]={id:t,type:"junction",edges:[],in:i}}getJunctions(){return Object.values(this.nodes).filter(tt)}getNodes(){return Object.values(this.nodes)}getNode(t){return this.nodes[t]??null}addGroup({id:t,icon:i,in:n,title:r}){var s,e,o;if(void 0!==(null==(s=this.registeredIds)?void 0:s[t]))throw new Error(`The group id [${t}] is already in use by another ${this.registeredIds[t]}`);if(void 0!==n){if(t===n)throw new Error(`The group [${t}] cannot be placed within itself`);if(void 0===(null==(e=this.registeredIds)?void 0:e[n]))throw new Error(`The group [${t}]'s parent does not exist. Please make sure the parent is created before this group`);if("node"===(null==(o=this.registeredIds)?void 0:o[n]))throw new Error(`The group [${t}]'s parent is not a group`)}this.registeredIds[t]="group",this.groups[t]={id:t,icon:i,title:r,in:n}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:t,rhsId:i,lhsDir:n,rhsDir:r,lhsInto:s,rhsInto:e,lhsGroup:o,rhsGroup:h,title:a}){if(!X(n))throw new Error(`Invalid direction given for left hand side of edge ${t}--${i}. Expected (L,R,T,B) got ${String(n)}`);if(!X(r))throw new Error(`Invalid direction given for right hand side of edge ${t}--${i}. Expected (L,R,T,B) got ${String(r)}`);if(void 0===this.nodes[t]&&void 0===this.groups[t])throw new Error(`The left-hand id [${t}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(void 0===this.nodes[i]&&void 0===this.groups[i])throw new Error(`The right-hand id [${i}] does not yet exist. Please create the service/group before declaring an edge to it.`);const f=this.nodes[t].in,u=this.nodes[i].in;if(o&&f&&u&&f==u)throw new Error(`The left-hand id [${t}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(h&&f&&u&&f==u)throw new Error(`The right-hand id [${i}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const c={lhsId:t,lhsDir:n,lhsInto:s,lhsGroup:o,rhsId:i,rhsDir:r,rhsInto:e,rhsGroup:h,title:a};this.edges.push(c),this.nodes[t]&&this.nodes[i]&&(this.nodes[t].edges.push(this.edges[this.edges.length-1]),this.nodes[i].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}getDataStructures(){if(void 0===this.dataStructures){const t={},i=Object.entries(this.nodes).reduce((i,[n,r])=>(i[n]=r.edges.reduce((i,r)=>{var s,e;const o=null==(s=this.getNode(r.lhsId))?void 0:s.in,h=null==(e=this.getNode(r.rhsId))?void 0:e.in;if(o&&h&&o!==h){const i=K(r.lhsDir,r.rhsDir);"bend"!==i&&(t[o]??(t[o]={}),t[o][h]=i,t[h]??(t[h]={}),t[h][o]=i)}if(r.lhsId===n){const t=V(r.lhsDir,r.rhsDir);t&&(i[t]=r.rhsId)}else{const t=V(r.rhsDir,r.lhsDir);t&&(i[t]=r.lhsId)}return i},{}),i),{}),r=Object.keys(i)[0],s={[r]:1},e=Object.keys(i).reduce((t,i)=>i===r?t:{...t,[i]:1},{}),o=n(t=>{const n={[t]:[0,0]},r=[t];for(;r.length>0;){const t=r.shift();if(t){s[t]=1,delete e[t];const o=i[t],[h,a]=n[t];Object.entries(o).forEach(([t,i])=>{s[i]||(n[i]=W([h,a],t),r.push(i))})}}return n},"BFS"),h=[o(r)];for(;Object.keys(e).length>0;)h.push(o(Object.keys(e)[0]));this.dataStructures={adjList:i,spatialMaps:h,groupAlignments:t}}return this.dataStructures}setElementForId(t,i){this.elements[t]=i}getElementById(t){return this.elements[t]}getConfig(){return v({...rt,...y().architecture})}getConfigField(t){return this.getConfig()[t]}},"ArchitectureDB"),t),et=n((t,i)=>{S(t,i),t.groups.map(t=>i.addGroup(t)),t.services.map(t=>i.addService({...t,type:"service"})),t.junctions.map(t=>i.addJunction({...t,type:"junction"})),t.edges.map(t=>i.addEdge(t))},"populateDb"),ot={parser:{yy:void 0},parse:n(async t=>{var i;const n=await $("architecture",t);e.debug(n);const r=null==(i=ot.parser)?void 0:i.yy;if(!(r instanceof st))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");et(n,r)},"parse")},ht=n(t=>`\n .edge {\n stroke-width: ${t.archEdgeWidth};\n stroke: ${t.archEdgeColor};\n fill: none;\n }\n\n .arrow {\n fill: ${t.archEdgeArrowColor};\n }\n\n .node-bkg {\n fill: none;\n stroke: ${t.archGroupBorderColor};\n stroke-width: ${t.archGroupBorderWidth};\n stroke-dasharray: 8;\n }\n .node-icon-text {\n display: flex; \n align-items: center;\n }\n \n .node-icon-text > div {\n color: #fff;\n margin: 1px;\n height: fit-content;\n text-align: center;\n overflow: hidden;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n }\n`,"getStyles"),at=n(t=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${t}</g>`,"wrapIcon"),ft={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:at('<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:at('<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:at('<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:at('<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:at('<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:x,blank:{body:at("")}}},ut=n(async function(t,i,n){const r=n.getConfigField("padding"),s=n.getConfigField("iconSize"),e=s/2,o=s/6,h=o/2;await Promise.all(i.edges().map(async i=>{var s,a;const{source:f,sourceDir:u,sourceArrow:c,sourceGroup:l,target:v,targetDir:d,targetArrow:y,targetGroup:g,label:m}=it(i);let{x:b,y:k}=i[0].sourceEndpoint();const{x:x,y:S}=i[0].midpoint();let{x:$,y:j}=i[0].targetEndpoint();const O=r+4;if(l&&(Y(u)?b+="L"===u?-O:O:k+="T"===u?-O:O+18),g&&(Y(d)?$+="L"===d?-O:O:j+="T"===d?-O:O+18),l||"junction"!==(null==(s=n.getNode(f))?void 0:s.type)||(Y(u)?b+="L"===u?e:-e:k+="T"===u?e:-e),g||"junction"!==(null==(a=n.getNode(v))?void 0:a.type)||(Y(d)?$+="L"===d?e:-e:j+="T"===d?e:-e),i[0].t.rscratch){const i=t.insert("g");if(i.insert("path").attr("d",`M ${b},${k} L ${x},${S} L${$},${j} `).attr("class","edge").attr("id",M(f,v,{prefix:"L"})),c){const t=Y(u)?q[u](b,o):b-h,n=_(u)?q[u](k,o):k-h;i.insert("polygon").attr("points",G[u](o)).attr("transform",`translate(${t},${n})`).attr("class","arrow")}if(y){const t=Y(d)?q[d]($,o):$-h,n=_(d)?q[d](j,o):j-h;i.insert("polygon").attr("points",G[d](o)).attr("transform",`translate(${t},${n})`).attr("class","arrow")}if(m){const t=H(u,d)?"XY":Y(u)?"X":"Y";let n=0;n="X"===t?Math.abs(b-$):"Y"===t?Math.abs(k-j)/1.5:Math.abs(b-$)/2;const r=i.append("g");if(await w(r,m,{useHtmlLabels:!1,width:n,classes:"architecture-service-label"},p()),r.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),"X"===t)r.attr("transform","translate("+x+", "+S+")");else if("Y"===t)r.attr("transform","translate("+x+", "+S+") rotate(-90)");else if("XY"===t){const t=V(u,d);if(t&&Z(t)){const i=r.node().getBoundingClientRect(),[n,s]=U(t);r.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*n*s*45})`);const e=r.node().getBoundingClientRect();r.attr("transform",`\n translate(${x}, ${S-i.height/2})\n translate(${n*e.width/2}, ${s*e.height/2})\n rotate(${-1*n*s*45}, 0, ${i.height/2})\n `)}}}}}))},"drawEdges"),ct=n(async function(t,i,n){const r=.75*n.getConfigField("padding"),s=n.getConfigField("fontSize"),e=n.getConfigField("iconSize")/2;await Promise.all(i.nodes().map(async i=>{const o=nt(i);if("group"===o.type){const{h:h,w:a,x1:f,y1:u}=i.boundingBox(),c=t.append("rect");c.attr("id",`group-${o.id}`).attr("x",f+e).attr("y",u+e).attr("width",a).attr("height",h).attr("class","node-bkg");const l=t.append("g");let v=f,d=u;if(o.icon){const t=l.append("g");t.html(`<g>${await g(o.icon,{height:r,width:r,fallbackPrefix:ft.prefix})}</g>`),t.attr("transform","translate("+(v+e+1)+", "+(d+e+1)+")"),v+=r,d+=s/2-1-2}if(o.label){const t=l.append("g");await w(t,o.label,{useHtmlLabels:!1,width:a,classes:"architecture-service-label"},p()),t.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),t.attr("transform","translate("+(v+e+4)+", "+(d+e+2)+")")}n.setElementForId(o.id,c)}}))},"drawGroups"),lt=n(async function(t,i,n){const r=p();for(const s of n){const n=i.append("g"),e=t.getConfigField("iconSize");if(s.title){const t=n.append("g");await w(t,s.title,{useHtmlLabels:!1,width:1.5*e,classes:"architecture-service-label"},r),t.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),t.attr("transform","translate("+e/2+", "+e+")")}const o=n.append("g");if(s.icon)o.html(`<g>${await g(s.icon,{height:e,width:e,fallbackPrefix:ft.prefix})}</g>`);else if(s.iconText){o.html(`<g>${await g("blank",{height:e,width:e,fallbackPrefix:ft.prefix})}</g>`);const t=o.append("g").append("foreignObject").attr("width",e).attr("height",e).append("div").attr("class","node-icon-text").attr("style",`height: ${e}px;`).append("div").html(m(s.iconText,r)),i=parseInt(window.getComputedStyle(t.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;t.attr("style",`-webkit-line-clamp: ${Math.floor((e-2)/i)};`)}else o.append("path").attr("class","node-bkg").attr("id","node-"+s.id).attr("d",`M0 ${e} v${-e} q0,-5 5,-5 h${e} q5,0 5,5 v${e} H0 Z`);n.attr("id",`service-${s.id}`).attr("class","architecture-service");const{width:h,height:a}=n.node().getBBox();s.width=h,s.height=a,t.setElementForId(s.id,n)}return 0},"drawServices"),vt=n(function(t,i,n){n.forEach(n=>{const r=i.append("g"),s=t.getConfigField("iconSize");r.append("g").append("rect").attr("id","node-"+n.id).attr("fill-opacity","0").attr("width",s).attr("height",s),r.attr("class","architecture-junction");const{width:e,height:o}=r._groups[0][0].getBBox();r.width=e,r.height=o,t.setElementForId(n.id,r)})},"drawJunctions");function dt(t,i,n){t.forEach(t=>{i.add({group:"nodes",data:{type:"service",id:t.id,icon:t.icon,label:t.title,parent:t.in,width:n.getConfigField("iconSize"),height:n.getConfigField("iconSize")},classes:"node-service"})})}function yt(t,i,n){t.forEach(t=>{i.add({group:"nodes",data:{type:"junction",id:t.id,parent:t.in,width:n.getConfigField("iconSize"),height:n.getConfigField("iconSize")},classes:"node-junction"})})}function pt(t,i){i.nodes().map(i=>{const n=nt(i);if("group"===n.type)return;n.x=i.position().x,n.y=i.position().y;t.getElementById(n.id).attr("transform","translate("+(n.x||0)+","+(n.y||0)+")")})}function wt(t,i){t.forEach(t=>{i.add({group:"nodes",data:{type:"group",id:t.id,icon:t.icon,label:t.title,parent:t.in},classes:"node-group"})})}function gt(t,i){t.forEach(t=>{const{lhsId:n,rhsId:r,lhsInto:s,lhsGroup:e,rhsInto:o,lhsDir:h,rhsDir:a,rhsGroup:f,title:u}=t,c=H(t.lhsDir,t.rhsDir)?"segments":"straight",l={id:`${n}-${r}`,label:u,source:n,sourceDir:h,sourceArrow:s,sourceGroup:e,sourceEndpoint:"L"===h?"0 50%":"R"===h?"100% 50%":"T"===h?"50% 0":"50% 100%",target:r,targetDir:a,targetArrow:o,targetGroup:f,targetEndpoint:"L"===a?"0 50%":"R"===a?"100% 50%":"T"===a?"50% 0":"50% 100%"};i.add({group:"edges",data:l,classes:c})})}function mt(t,i,r){const s=n((t,i)=>Object.entries(t).reduce((t,[n,s])=>{var e;let o=0;const h=Object.entries(s);if(1===h.length)return t[n]=h[0][1],t;for(let a=0;a<h.length-1;a++)for(let s=a+1;s<h.length;s++){const[f,u]=h[a],[c,l]=h[s];if((null==(e=r[f])?void 0:e[c])===i)t[n]??(t[n]=[]),t[n]=[...t[n],...u,...l];else if("default"===f||"default"===c)t[n]??(t[n]=[]),t[n]=[...t[n],...u,...l];else{t[`${n}-${o++}`]=u;t[`${n}-${o++}`]=l}}return t},{}),"flattenAlignments"),e=i.map(i=>{const n={},r={};return Object.entries(i).forEach(([i,[s,e]])=>{var o,h,a;const f=(null==(o=t.getNode(i))?void 0:o.in)??"default";n[e]??(n[e]={}),(h=n[e])[f]??(h[f]=[]),n[e][f].push(i),r[s]??(r[s]={}),(a=r[s])[f]??(a[f]=[]),r[s][f].push(i)}),{horiz:Object.values(s(n,"horizontal")).filter(t=>t.length>1),vert:Object.values(s(r,"vertical")).filter(t=>t.length>1)}}),[o,h]=e.reduce(([t,i],{horiz:n,vert:r})=>[[...t,...n],[...i,...r]],[[],[]]);return{horizontal:o,vertical:h}}function bt(t,i){const r=[],s=n(t=>`${t[0]},${t[1]}`,"posToStr"),e=n(t=>t.split(",").map(t=>parseInt(t)),"strToPos");return t.forEach(t=>{const n=Object.fromEntries(Object.entries(t).map(([t,i])=>[s(i),t])),o=[s([0,0])],h={},a={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;o.length>0;){const t=o.shift();if(t){h[t]=1;const f=n[t];if(f){const u=e(t);Object.entries(a).forEach(([t,e])=>{const a=s([u[0]+e[0],u[1]+e[1]]),c=n[a];c&&!h[a]&&(o.push(a),r.push({[R[t]]:c,[R[F(t)]]:f,gap:1.5*i.getConfigField("iconSize")}))})}}}}),r}function Mt(t,i,r,s,o,{spatialMaps:h,groupAlignments:a}){return new Promise(f=>{const u=b("body").append("div").attr("id","cy").attr("style","display:none"),c=j({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight",label:"data(label)","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${o.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:`${o.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});u.remove(),wt(r,c),dt(t,c,o),yt(i,c,o),gt(s,c);const l=mt(o,h,a),v=bt(h,o),d=c.layout({name:"fcose",quality:"proof",styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(t){const[i,n]=t.connectedNodes(),{parent:r}=nt(i),{parent:s}=nt(n);return r===s?1.5*o.getConfigField("iconSize"):.5*o.getConfigField("iconSize")},edgeElasticity(t){const[i,n]=t.connectedNodes(),{parent:r}=nt(i),{parent:s}=nt(n);return r===s?.45:.001},alignmentConstraint:l,relativePlacementConstraint:v});d.one("layoutstop",()=>{var t;function i(t,i,n,r){let s,e;const{x:o,y:h}=t,{x:a,y:f}=i;e=(r-h+(o-n)*(h-f)/(o-a))/Math.sqrt(1+Math.pow((h-f)/(o-a),2)),s=Math.sqrt(Math.pow(r-h,2)+Math.pow(n-o,2)-Math.pow(e,2));s/=Math.sqrt(Math.pow(a-o,2)+Math.pow(f-h,2));let u=(a-o)*(r-h)-(f-h)*(n-o);switch(!0){case u>=0:u=1;break;case u<0:u=-1}let c=(a-o)*(n-o)+(f-h)*(r-h);switch(!0){case c>=0:c=1;break;case c<0:c=-1}return e=Math.abs(e)*u,s*=c,{distances:e,weights:s}}n(i,"getSegmentWeights"),c.startBatch();for(const n of Object.values(c.edges()))if(null==(t=n.data)?void 0:t.call(n)){const{x:t,y:r}=n.source().position(),{x:s,y:e}=n.target().position();if(t!==s&&r!==e){const t=n.sourceEndpoint(),r=n.targetEndpoint(),{sourceDir:s}=it(n),[e,o]=_(s)?[t.x,r.y]:[r.x,t.y],{weights:h,distances:a}=i(t,r,e,o);n.style("segment-distances",a),n.style("segment-weights",h)}}c.endBatch(),d.run()}),d.run(),c.ready(t=>{e.info("Ready",t),f(c)})})}k([{name:ft.prefix,icons:ft}]),j.use(P),n(dt,"addServices"),n(yt,"addJunctions"),n(pt,"positionNodes"),n(wt,"addGroups"),n(gt,"addEdges"),n(mt,"getAlignments"),n(bt,"getRelativeConstraints"),n(Mt,"layoutArchitecture");var kt={draw:n(async(t,i,n,e)=>{const o=e.db,h=o.getServices(),a=o.getJunctions(),f=o.getGroups(),u=o.getEdges(),c=o.getDataStructures(),l=r(i),v=l.append("g");v.attr("class","architecture-edges");const d=l.append("g");d.attr("class","architecture-services");const y=l.append("g");y.attr("class","architecture-groups"),await lt(o,d,h),vt(o,d,a);const p=await Mt(h,a,f,u,o,c);await ut(v,p,o),await ct(y,p,o),pt(o,p),s(void 0,l,o.getConfigField("padding"),o.getConfigField("useMaxWidth"))},"draw")},xt={parser:ot,get db(){return new st},renderer:kt,styles:ht};export{xt as diagram};