local-operator-ui 0.31.24 → 0.31.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/main/index.js +91 -4
- package/out/renderer/assets/{_basePickBy-DvYnhuYU.js → _basePickBy-D0wlCvva.js} +1 -1
- package/out/renderer/assets/{_baseUniq-bfmokOo7.js → _baseUniq-DPa_8DrG.js} +1 -1
- package/out/renderer/assets/{agent-details-page-CKuk0h6D.js → agent-details-page-CrARDEtK.js} +2 -2
- package/out/renderer/assets/agent-hub-page-tj8FYJ7M.js +11 -0
- package/out/renderer/assets/agents-page-CbQN_5wE.js +7 -0
- package/out/renderer/assets/aida-control-BuMafqCb.js +50 -0
- package/out/renderer/assets/arc-BG4bHuQI.js +1 -0
- package/out/renderer/assets/{architectureDiagram-IEHRJDOE-iKar6Oic.js → architectureDiagram-IEHRJDOE-CkYkkIY9.js} +1 -1
- package/out/renderer/assets/{blockDiagram-JOT3LUYC-B2zh8hXK.js → blockDiagram-JOT3LUYC-D0DwK5Ey.js} +1 -1
- package/out/renderer/assets/{book-open-ARKlovXx.js → book-open-DeQc_I6g.js} +1 -1
- package/out/renderer/assets/browser-page-CIhGr6vl.js +1 -0
- package/out/renderer/assets/browser-webauthn-prompt-CYou_6QY.js +1 -0
- package/out/renderer/assets/{c4Diagram-VJAJSXHY-BMHJDEcf.js → c4Diagram-VJAJSXHY-CubzqfYr.js} +1 -1
- package/out/renderer/assets/channel-B-eIVFbM.js +1 -0
- package/out/renderer/assets/{chunk-4BMEZGHF-DRAVdspP.js → chunk-4BMEZGHF-AysrzODh.js} +1 -1
- package/out/renderer/assets/{chunk-A2AXSNBT-Cud6VnlY.js → chunk-A2AXSNBT-DfDo-OSy.js} +1 -1
- package/out/renderer/assets/{chunk-AEK57VVT-BDCFuoNl.js → chunk-AEK57VVT-5xgHbFtp.js} +1 -1
- package/out/renderer/assets/{chunk-D6G4REZN-DlMa4UAs.js → chunk-D6G4REZN-pYCMpQiN.js} +1 -1
- package/out/renderer/assets/{chunk-RZ5BOZE2-EHEIhkiY.js → chunk-RZ5BOZE2-C5bWxzka.js} +1 -1
- package/out/renderer/assets/{chunk-XZIHB7SX-D6SPBzK4.js → chunk-XZIHB7SX-B4wB3iEG.js} +1 -1
- package/out/renderer/assets/classDiagram-GIVACNV2-BN6aG5Qf.js +1 -0
- package/out/renderer/assets/classDiagram-v2-COTLJTTW-BN6aG5Qf.js +1 -0
- package/out/renderer/assets/clone-C3CHGd7j.js +1 -0
- package/out/renderer/assets/{console-mirror-iQjAVQrh.js → console-mirror-45f9-7QH.js} +1 -1
- package/out/renderer/assets/{consoleCapture-f4bHcMlg.js → consoleCapture-GiahzrSM.js} +1 -1
- package/out/renderer/assets/{dagre-OKDRZEBW-C69-0hU9.js → dagre-OKDRZEBW-CBRdPb8k.js} +1 -1
- package/out/renderer/assets/{diagram-SSKATNLV-DsUPj3k9.js → diagram-SSKATNLV-DyGZgIL1.js} +1 -1
- package/out/renderer/assets/{diagram-VNBRO52H-3cLE7l86.js → diagram-VNBRO52H-Con45RzE.js} +1 -1
- package/out/renderer/assets/{en-US-BkS8Ixxl.js → en-US-BcB1DWxG.js} +1 -1
- package/out/renderer/assets/{erDiagram-Q7BY3M3F-Gqm9ZUtK.js → erDiagram-Q7BY3M3F-Cpuc-IVT.js} +1 -1
- package/out/renderer/assets/{error-boundary-BheI-_hJ.js → error-boundary-CdtTgj_c.js} +1 -1
- package/out/renderer/assets/{flowDiagram-4HSFHLVR-bu5rejsx.js → flowDiagram-4HSFHLVR-CsO4ubSn.js} +1 -1
- package/out/renderer/assets/format-CZUObkkr.js +1 -0
- package/out/renderer/assets/{ganttDiagram-APWFNJXF-DOpEB0OK.js → ganttDiagram-APWFNJXF-LYPPAOmY.js} +3 -3
- package/out/renderer/assets/{gitGraphDiagram-7IBYFJ6S-BitJPB27.js → gitGraphDiagram-7IBYFJ6S-BO_dix1Z.js} +1 -1
- package/out/renderer/assets/{graph-CyyuMUaw.js → graph-uBeiISg2.js} +1 -1
- package/out/renderer/assets/index-2qmFWi_F.css +1 -0
- package/out/renderer/assets/index-Bi4c5ZZH.js +7 -0
- package/out/renderer/assets/{index-D-d-ykb4.js → index-CIj3B-eB.js} +1 -1
- package/out/renderer/assets/{index-FOmxzVhB.js → index-COUHPq03.js} +411 -402
- package/out/renderer/assets/index-D8ujEXbz.css +1 -0
- package/out/renderer/assets/infoDiagram-PH2N3AL5-BqRYyG2a.js +2 -0
- package/out/renderer/assets/{installer-Dq_j5D8p.js → installer-zpOWwoWQ.js} +1 -1
- package/out/renderer/assets/{journeyDiagram-U35MCT3I-CMXDard0.js → journeyDiagram-U35MCT3I-B6AH0Dcn.js} +1 -1
- package/out/renderer/assets/{kanban-definition-NDS4AKOZ-CGZPXBz-.js → kanban-definition-NDS4AKOZ-C7dciPrH.js} +1 -1
- package/out/renderer/assets/{layout-TTjt9cpH.js → layout-hxpgEDIm.js} +1 -1
- package/out/renderer/assets/{legacy-agents-page-DsEHBb_T.js → legacy-agents-page-C6kd3fjG.js} +4 -4
- package/out/renderer/assets/{mermaid.core-BGnJVp5q.js → mermaid.core-CC8CflzC.js} +5 -5
- package/out/renderer/assets/mesh-page-M4Y20e0t.js +2 -0
- package/out/renderer/assets/{mindmap-definition-ALO5MXBD-CaLpfI_E.js → mindmap-definition-ALO5MXBD-BWI1IBWM.js} +1 -1
- package/out/renderer/assets/{mini-KOisKeMi.js → mini-Dtj-bCUA.js} +1 -1
- package/out/renderer/assets/{org-surface-gate-CZiYqd1P.js → org-surface-gate-CjPxDSXP.js} +1 -1
- package/out/renderer/assets/{page-header-B2VyeyKK.js → page-header-Dt6h8jvu.js} +1 -1
- package/out/renderer/assets/parseISO-CZfAC2_J.js +1 -0
- package/out/renderer/assets/pieDiagram-IB7DONF6-DNymJR3P.js +30 -0
- package/out/renderer/assets/{projects-page-D8CTmXCv.js → projects-page-C3N6NYIX.js} +11 -11
- package/out/renderer/assets/{quadrantDiagram-7GDLP6J5-8FVHpZVN.js → quadrantDiagram-7GDLP6J5-bRmQaOWY.js} +1 -1
- package/out/renderer/assets/{radar-MK3ICKWK-4pgGQ-2B.js → radar-MK3ICKWK-B1I3333M.js} +1 -1
- package/out/renderer/assets/{radient-auth-buttons-DUT18lNx.js → radient-auth-buttons-CCXHTNWU.js} +1 -1
- package/out/renderer/assets/{requirementDiagram-KVF5MWMF-BubgmAeX.js → requirementDiagram-KVF5MWMF-B29w6CHz.js} +1 -1
- package/out/renderer/assets/sankeyDiagram-QLVOVGJD-BNv_qf23.js +10 -0
- package/out/renderer/assets/{schedules-page-CajtG50s.js → schedules-page-CXz63fN5.js} +10 -10
- package/out/renderer/assets/{sequenceDiagram-X6HHIX6F-DyNeye_f.js → sequenceDiagram-X6HHIX6F-D7gyUvnw.js} +1 -1
- package/out/renderer/assets/{settings-page-DZNyJZ23.js → settings-page-CsCf63si.js} +6 -6
- package/out/renderer/assets/{settings-section-DQ45Riip.js → settings-section-DMXSpP_D.js} +1 -1
- package/out/renderer/assets/{stateDiagram-DGXRK772-DRqrOBmL.js → stateDiagram-DGXRK772-Dd3BswSO.js} +1 -1
- package/out/renderer/assets/stateDiagram-v2-YXO3MK2T-D9cOpOSm.js +1 -0
- package/out/renderer/assets/{textarea-CaRKMTTG.js → textarea-DsHM-W2p.js} +2 -2
- package/out/renderer/assets/{timeline-definition-BDJGKUSR-DC76uMim.js → timeline-definition-BDJGKUSR-MePOCWzB.js} +1 -1
- package/out/renderer/assets/{ui-preferences-store-qSXgzAHu.js → ui-preferences-store-BmAT9G_p.js} +1 -1
- package/out/renderer/assets/{use-download-agent-mutation-B_qjSLGd.js → use-download-agent-mutation-BNAfnIa9.js} +2 -2
- package/out/renderer/assets/use-memberships-query-PWqngUAl.js +1 -0
- package/out/renderer/assets/{xychartDiagram-VJFVF3MP-CyMpnVUJ.js → xychartDiagram-VJFVF3MP-heZP1JY-.js} +1 -1
- package/out/renderer/console-capture.html +5 -5
- package/out/renderer/index.html +9 -9
- package/out/renderer/installer.html +5 -5
- package/out/renderer/mini.html +6 -6
- package/package.json +2 -2
- package/out/renderer/assets/agent-hub-page-mjoCtkLM.js +0 -11
- package/out/renderer/assets/agents-page-CKyDYjEM.js +0 -2
- package/out/renderer/assets/aida-control-B8b5SXix.js +0 -50
- package/out/renderer/assets/arc-CFcKtuSP.js +0 -1
- package/out/renderer/assets/browser-page-UoqCN-xN.js +0 -1
- package/out/renderer/assets/browser-webauthn-prompt-CFO8FunV.js +0 -1
- package/out/renderer/assets/channel-CIrWsSCo.js +0 -1
- package/out/renderer/assets/classDiagram-GIVACNV2-BDlMBcMy.js +0 -1
- package/out/renderer/assets/classDiagram-v2-COTLJTTW-BDlMBcMy.js +0 -1
- package/out/renderer/assets/clone-DkQdBey4.js +0 -1
- package/out/renderer/assets/index-CSPo12AE.css +0 -1
- package/out/renderer/assets/index-CsbIIOFq.css +0 -1
- package/out/renderer/assets/index-Db927tvJ.js +0 -7
- package/out/renderer/assets/infoDiagram-PH2N3AL5-D3FD5ygR.js +0 -2
- package/out/renderer/assets/mesh-page-BuM1oQ_i.js +0 -2
- package/out/renderer/assets/parseISO-BWtr7JL9.js +0 -1
- package/out/renderer/assets/pieDiagram-IB7DONF6-DgCZ_Tpy.js +0 -30
- package/out/renderer/assets/sankeyDiagram-QLVOVGJD-C8luu1Ce.js +0 -10
- package/out/renderer/assets/stateDiagram-v2-YXO3MK2T-o-zf-20f.js +0 -1
- package/out/renderer/assets/use-memberships-query-Q1_CwjZE.js +0 -1
- /package/out/renderer/assets/{index-C8q85hqs.js → index-Dn3kYWFt.js} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{j as t,c as R,r as o}from"./index-Dn3kYWFt.js";import{a as Pe,I as xe}from"./aida-control-BuMafqCb.js";import{P as $e}from"./page-header-Dt6h8jvu.js";import{B as V,T as Le,b as re,g as Oe,D as ze,j as We,k as He,l as Be,m as pe,n as be,f as ge,A as ue}from"./textarea-DsHM-W2p.js";import{ac as Fe,ad as Ye,ae as Ie,af as he,ag as de,ah as Xe,ai as Ge,aj as Ue,ak as Ce,al as Ke,am as Ve,an as le,ao as ke,ap as qe,aq as Ze,ar as me,as as Je,at as Qe,au as Me,av as Se,aw as et,ax as tt,ay as nt,az as st,aA as at,aB as it,aC as rt,aD as lt,aE as ot,aF as dt,aG as ct,aH as ut,aI as mt,aJ as ht,aK as ft,aL as xt,aM as pt,aN as ae}from"./index-COUHPq03.js";import"./ui-preferences-store-BmAT9G_p.js";import"./error-boundary-CdtTgj_c.js";import"./console-mirror-45f9-7QH.js";const bt=4,oe={kind:"idle"};function gt(e){switch(e.kind){case"dragging":case"settling":return e.payload.session.id;case"pressing":return null;default:return null}}function K(e,s){switch(s.kind){case"press":return e.kind!=="idle"?e:{kind:"pressing",payload:s.payload,originX:s.x,originY:s.y,pointerId:s.pointerId};case"move":return e.kind==="pressing"?Math.max(Math.abs(s.x-e.originX),Math.abs(s.y-e.originY))<bt?e:{kind:"dragging",payload:e.payload,x:s.x,y:s.y,target:s.target,pointerId:e.pointerId}:e.kind==="dragging"?{...e,x:s.x,y:s.y,target:s.target}:e;case"release":return e.kind==="dragging"?{kind:"settling",payload:e.payload,target:e.target}:e.kind==="pressing"?oe:e;case"cancel":case"settled":return oe;default:return e}}const kt=({edges:e,geometry:s,selectedDeviceId:d})=>t.jsx("svg",{"aria-hidden":"true",className:"pointer-events-none absolute top-0 left-0 overflow-visible",width:s.bounds.width,height:s.bounds.height,children:e.map(r=>{const u=s.networks.get(r.networkId),x=s.devices.get(r.deviceId);if(!u||!x)return null;const g=d!==null&&r.deviceId===d;return t.jsx("path",{"data-mesh-edge":r.key,d:Fe(u,x),fill:"none",strokeWidth:g?2:1.5,strokeDasharray:r.active?void 0:"4 4",className:g?"stroke-ink":"stroke-ink-dim"},r.key)})}),vt={self:"border-l-hairline",reachable:"border-l-hairline",unreachable:"border-l-warning",suspect:"border-l-danger"},wt={self:"ring-2 ring-accent",reachable:null,unreachable:null,suspect:null},yt={self:"text-accent",reachable:"text-ink-muted",unreachable:"text-warning",suspect:"text-danger"},jt={accept:"border-accent bg-accent-wash",refuse:"border-warning"};function Nt(e,s){const d=Ce(e);return[e.label,d||null,de(e,s)].filter(Boolean).join(", ")}function ee(e){return e.name.trim()||e.id.slice(-6)}function De(e,s,d){return d?e.live_state.trim()?e.live_state.trim():e.locality==="local"?"on this device":`on ${s}`:`unreachable${e.unreachable_reason?` (${e.unreachable_reason})`:""}`}const It={resting:"border-l-2 border-l-hairline",attention:"border-l-2 border-l-warning"},Ct=({network:e,x:s,y:d,refused:r})=>t.jsxs("li",{"data-mesh-network":e.id,"data-mesh-network-refused":r?"true":void 0,className:R("absolute flex items-center gap-2 rounded-md border bg-elevated px-3",r?"border-warning":"border-hairline"),style:{left:s,top:d,width:Ie,height:Ye},children:[t.jsx(he,{"aria-hidden":"true",className:"size-4 shrink-0 text-ink-muted"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-body-sm text-ink",children:e.label}),t.jsxs("span",{title:`epoch ${e.epoch}`,className:"block truncate text-meta text-ink-dim",children:[e.memberCount," ",e.memberCount===1?"device":"devices",e.revokedCount>0?` · ${e.revokedCount} revoked`:""]})]})]}),Mt=({device:e,x:s,y:d,nowSeconds:r,selected:u,sessions:x,sessionTotal:g,dropState:c,movingSessionId:v,draggedSessionId:S,onOpen:C,onChipPointerDown:M,onChipClick:A,onShowAllSessions:f})=>{const m=de(e,r),i=Xe(e,r),w=Nt(e,r);return t.jsxs("li",{"data-mesh-device":e.id,"data-mesh-state":e.state,"data-mesh-drop":c??void 0,"aria-current":u?"true":void 0,className:R("absolute flex flex-col rounded-md border border-l-4 border-control bg-elevated","hover:bg-row-hover",u&&"border-y-ink border-r-ink bg-row-selected",vt[e.state],wt[e.state],c&&jt[c]),style:{left:s,top:d,width:Ie,height:Ge},children:[t.jsxs("button",{type:"button","data-mesh-device-open":e.id,"aria-label":w,onClick:()=>C(e.id),className:R("flex w-full items-center gap-2 rounded-t-[5px] px-3 pt-2 pb-1 text-left","cursor-pointer","focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-[-2px]"),children:[t.jsx(Ue,{"aria-hidden":"true",className:"size-4 shrink-0 text-ink-muted"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-body-sm text-ink",children:e.label}),t.jsxs("span",{title:m,className:R("block truncate text-meta",yt[e.state]),children:[i,e.memberships.length>1?` · ${e.memberships.length} networks`:""]})]})]}),t.jsxs("ul",{"aria-label":`Conversations on ${e.label}`,className:R("m-0 flex list-none items-center gap-1 overflow-hidden px-3 pb-2",c==="accept"&&"opacity-40"),children:[x.shown.map(b=>t.jsx(St,{session:b,ownerLabel:e.label,ownerReachable:e.reachable,moving:v===b.id,dragging:S===b.id,onPointerDown:M,onClick:()=>A(b)},b.id)),x.hidden>0&&t.jsx("li",{className:"shrink-0",children:t.jsxs("button",{type:"button","data-mesh-more":e.id,onClick:()=>f(e.id),className:R("rounded-sm px-1.5 py-0.5 text-meta text-ink-dim","hover:bg-row-hover hover:text-ink","focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2"),title:`Showing ${x.shown.length} of ${g} conversations`,"aria-label":`Show all ${g} conversations`,children:["+",x.hidden]})}),x.rows.length===0&&ve(e)!==null&&t.jsx("li",{className:"text-meta text-ink-dim",children:ve(e)})]})]})};function ve(e){return e.state==="self"?"no conversations here":e.sessionCount===0?"no conversations":null}const St=({session:e,ownerLabel:s,ownerReachable:d,moving:r,dragging:u,onPointerDown:x,onClick:g})=>{const c=De(e,s,d);return r?t.jsx("li",{role:"status","data-mesh-session":e.id,"data-mesh-moving":"true",children:t.jsx("span",{className:"rounded-sm bg-sunken px-1.5 py-0.5 text-meta text-ink-muted",children:"moving…"})}):t.jsx("li",{className:"min-w-0 flex-1","data-mesh-session-item":e.id,"data-mesh-dragging":u?"true":void 0,children:t.jsx("button",{type:"button","data-mesh-session":e.id,style:{touchAction:"none"},title:`${ee(e)} · ${c}`,"aria-label":`${ee(e)}, ${c}. Opens ${s}.`,onPointerDown:v=>x(v,e),onClick:()=>g(e),className:R("w-full max-w-32 truncate rounded-sm border border-hairline bg-surface px-1.5 py-0.5 text-left text-meta text-ink-muted","[direction:rtl]","cursor-grab active:cursor-grabbing","hover:text-ink",It[Ke(e,d)],u&&"opacity-60","focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2"),children:ee(e)})})},we=48,ye=1.25,Dt=.0015,_t=({graph:e,slots:s,nowSeconds:d,selectedDeviceId:r,sessions:u,sessionTotals:x,movingSessionId:g,canMove:c,onOpenDevice:v,onAskMove:S,onDropRefused:C,onShowAllSessions:M,summaryId:A})=>{const f=o.useRef(null),[m,i]=o.useState({width:0,height:0,clipWidth:0,clipHeight:0,left:0,top:0}),[w,b]=o.useState({k:1,tx:0,ty:0}),O=o.useRef(!1),D=o.useRef(!1),T=o.useRef(null),p=o.useMemo(()=>Ve(s),[s]),N=o.useMemo(()=>({selfDeviceId:e.selfDeviceId,devices:new Map(e.devices.map(n=>[n.id,n])),networks:new Map(e.networks.map(n=>[n.id,n]))}),[e]),[h,P]=o.useState(oe),q=o.useRef({kind:"ground"}),te=o.useCallback((n,a)=>{const l=document.elementFromPoint(n,a),y=l?.closest("[data-mesh-device]");if(y){const B=y.getAttribute("data-mesh-device");if(B)return{kind:"device",deviceId:B}}const E=l?.closest("[data-mesh-network]");if(E){const B=E.getAttribute("data-mesh-network");if(B)return{kind:"network",networkId:B}}return{kind:"ground"}},[]),$=o.useMemo(()=>h.kind!=="dragging"&&h.kind!=="settling"?null:le(h.payload,h.target,N),[h,N]),F=o.useCallback(n=>{if(!$)return null;if($.kind==="plan"){const a=h.kind==="dragging"||h.kind==="settling"?h.target:null;return a&&a.kind==="device"&&a.deviceId===n?"accept":null}if($.kind==="refused"){const a=h.kind==="dragging"||h.kind==="settling"?h.target:null;return a&&a.kind==="device"&&a.deviceId===n?"refuse":null}return null},[$,h]),Z=o.useCallback((n,a)=>{if(!c||n.button!==0)return;D.current=!1;const l=a.locality==="local"?e.selfDeviceId??"":a.owner_device,y=N.devices.get(l),E={session:a,ownerDeviceId:l,ownerLabel:y?.label??a.owner_device_name};try{n.currentTarget.setPointerCapture(n.pointerId)}catch{}P(B=>K(B,{kind:"press",payload:E,x:n.clientX,y:n.clientY,pointerId:n.pointerId}))},[c,N,e.selfDeviceId]),ne=n=>{if(h.kind==="pressing"||h.kind==="dragging"){const a=te(n.clientX,n.clientY);q.current=a,P(l=>K(l,{kind:"move",x:n.clientX,y:n.clientY,target:a}));return}U(n)},k=n=>{if(se(n),h.kind!=="pressing"&&h.kind!=="dragging")return;if(h.kind==="pressing"){P(l=>K(l,{kind:"cancel"}));return}const a=le(h.payload,h.target,N);D.current=!0,P(l=>K(l,{kind:"release"})),a.kind==="plan"?S({plan:a.plan,alternatives:a.alternatives,risky:a.risky}):a.kind==="refused"&&C({code:a.code,sentence:a.sentence,remedy:a.remedy,plan:a.plan??null}),P(l=>K(l,{kind:"settled"}))};o.useEffect(()=>()=>P(oe),[]);const _=o.useCallback(()=>{b(ke(p.bounds,m))},[p.bounds,m]);o.useEffect(()=>{const n=f.current;if(!n)return;const a=()=>{const y=n.getBoundingClientRect();i({width:y.width,height:y.height,clipWidth:n.clientWidth,clipHeight:n.clientHeight,left:y.left,top:y.top})};a();const l=new ResizeObserver(a);return l.observe(n),()=>l.disconnect()},[]),o.useEffect(()=>{O.current||m.width<=0||m.height<=0||(O.current=!0,b(ke(p.bounds,m)))},[m,p.bounds]),o.useEffect(()=>{const n=T.current;if(T.current={width:m.width,height:m.height},!n||!O.current||m.width<=0||m.height<=0||m.width>=n.width&&m.height>=n.height||!r)return;const a=p.devices.get(r);a&&b(l=>{const y={width:m.clipWidth,height:m.clipHeight},E=Math.max(0,Math.min(y.width-p.bounds.width*l.k,y.height-p.bounds.height*l.k));return qe(l,a,y,Math.min(Je,E))})},[m,r,p]);const I=h.kind==="dragging"?{x:h.x-m.left+12,y:h.y-m.top+12}:{x:0,y:0},z=$?Ze($):null,j=o.useRef(null),W=o.useRef(null),H=o.useRef(null),X=o.useRef(null),ie=o.useCallback(()=>{H.current=null;const n=j.current,a=W.current;if(j.current=null,W.current=null,n){const l=X.current;if(!l)return;b({k:l.transform.k,tx:l.transform.tx+(n.x-l.x),ty:l.transform.ty+(n.y-l.y)});return}a&&b(l=>me(l,{x:a.x,y:a.y},l.k*Math.exp(-a.deltaY*Dt)))},[]),J=o.useCallback(()=>{H.current===null&&(H.current=requestAnimationFrame(ie))},[ie]);o.useEffect(()=>()=>{H.current!==null&&cancelAnimationFrame(H.current)},[]);const ce=n=>{!(n.target===n.currentTarget)&&n.button!==1||n.button!==0&&n.button!==1||(X.current={x:n.clientX,y:n.clientY,transform:w},n.currentTarget.setPointerCapture(n.pointerId),n.preventDefault())},U=n=>{X.current&&(j.current={x:n.clientX,y:n.clientY},J())},se=n=>{X.current&&(X.current=null,j.current=null,n.currentTarget.hasPointerCapture(n.pointerId)&&n.currentTarget.releasePointerCapture(n.pointerId))},G=o.useCallback(n=>{if(n.deltaY===0)return;n.preventDefault();const a=n.currentTarget.getBoundingClientRect();W.current={x:n.clientX-a.left,y:n.clientY-a.top,deltaY:n.deltaY},J()},[J]);o.useEffect(()=>{const n=f.current;if(n)return n.addEventListener("wheel",G,{passive:!1}),()=>n.removeEventListener("wheel",G)},[G]);const Q=n=>{const a=n.shiftKey?we*4:we;switch(n.key){case"Escape":if(h.kind!=="pressing"&&h.kind!=="dragging")return;n.preventDefault(),h.kind==="dragging"&&(D.current=!0),P(l=>K(l,{kind:"cancel"}));return;case"0":n.preventDefault(),_();return;case"+":case"=":n.preventDefault(),b(l=>me(l,{x:m.width/2,y:m.height/2},l.k*ye));return;case"-":case"_":n.preventDefault(),b(l=>me(l,{x:m.width/2,y:m.height/2},l.k/ye));return;case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"ArrowDown":{n.preventDefault();const l=n.key==="ArrowLeft"?a:n.key==="ArrowRight"?-a:0,y=n.key==="ArrowUp"?a:n.key==="ArrowDown"?-a:0;b(E=>({...E,tx:E.tx+l,ty:E.ty+y}));return}}};return t.jsxs("div",{ref:f,"data-mesh-canvas":"",role:"group","aria-labelledby":A,tabIndex:0,onPointerDown:ce,onPointerMove:ne,onPointerUp:k,onPointerCancel:n=>{h.kind==="dragging"&&(D.current=!0),P(a=>K(a,{kind:"cancel"})),se(n)},"data-mesh-gesture":h.kind,onKeyDown:Q,onDoubleClick:n=>{n.target===n.currentTarget&&_()},className:R("relative min-h-0 flex-1 overflow-hidden rounded-lg border border-hairline bg-sunken","[touch-action:none]","cursor-grab active:cursor-grabbing","focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-[-2px]"),children:[t.jsxs("div",{"data-mesh-world":"",className:"absolute top-0 left-0",style:{transform:`translate3d(${w.tx}px, ${w.ty}px, 0) scale(${w.k})`,transformOrigin:"0 0",width:p.bounds.width,height:p.bounds.height},children:[t.jsx(kt,{edges:e.edges,geometry:p,selectedDeviceId:r}),t.jsx("ul",{"aria-label":"Networks",className:"m-0 list-none p-0",children:e.networks.map(n=>{const a=p.networks.get(n.id);return a?t.jsx(Ct,{network:n,x:a.x,y:a.y,refused:$?.kind==="refused"&&h.kind==="dragging"&&h.target.kind==="network"&&h.target.networkId===n.id},n.id):null})}),t.jsx("ul",{"aria-label":"Devices",className:"m-0 list-none p-0",children:e.devices.map(n=>{const a=p.devices.get(n.id);return a?t.jsx(Mt,{device:n,x:a.x,y:a.y,nowSeconds:d,selected:n.id===r,sessions:u.get(n.id)??{rows:[],shown:[],hidden:0},sessionTotal:x.get(n.id)??n.sessionCount??0,dropState:F(n.id),movingSessionId:g,draggedSessionId:gt(h),onOpen:v,onChipPointerDown:Z,onChipClick:()=>{if(D.current){D.current=!1;return}v(n.id)},onShowAllSessions:M},n.id):null})})]}),h.kind==="dragging"&&t.jsx("div",{"data-mesh-ghost":"","aria-hidden":"true",className:"pointer-events-none absolute z-10 max-w-40 truncate rounded-sm border border-ink-dim bg-surface px-1.5 py-0.5 text-meta text-ink",style:{left:I.x,top:I.y},children:h.payload.session.name||"untitled"}),h.kind==="dragging"&&z&&t.jsx("div",{"data-mesh-indicator":"",className:R("pointer-events-none absolute z-10 rounded-sm border bg-surface px-2 py-1 text-meta",$?.kind==="refused"?"border-warning text-warning":"border-control text-ink"),style:{left:I.x,maxWidth:Math.max(160,m.width-I.x-12),...I.y>m.height*.6?{bottom:Math.max(12,m.height-I.y+8)}:{top:I.y+24}},children:z})]})};function Et(e,s,d,r){const u=d.locality==="local"?s:d.owner_device,x=[];for(const g of e)if(g.id!==u){if(g.id===s){x.push({deviceId:g.id,label:r,verb:"Recall to this device",keepVerb:"Copy here, leave it there"});continue}x.push({deviceId:g.id,label:g.label,verb:`Move to ${g.label}`,keepVerb:`Copy to ${g.label}`})}return x}function Rt(e,s,d){return Et(e.devices,e.selfDeviceId,s,d)}function _e(e,s,d){const r=Rt(e,s,d),u={selfDeviceId:e.selfDeviceId,devices:new Map(e.devices.map(c=>[c.id,c])),networks:new Map(e.networks.map(c=>[c.id,c]))},x=s.locality==="local"?e.selfDeviceId??"":s.owner_device,g=u.devices.get(x);return r.map(c=>{const v=le({session:s,ownerDeviceId:x,ownerLabel:g?.label??s.owner_device_name},{kind:"device",deviceId:c.deviceId},u);return{...c,refused:v.kind==="refused"&&v.code!=="busy"?v.sentence:null}})}const Ee=({session:e,destinations:s,disabled:d,onChoose:r,onOpenChange:u,trigger:x,triggerLabel:g})=>t.jsxs(ze,{onOpenChange:u,children:[t.jsx(We,{asChild:!0,children:t.jsx("button",{type:"button","aria-label":g,"data-mesh-session-menu":e.id,disabled:d||s.length===0,className:"rounded-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2 disabled:text-ink-disabled",children:x})}),t.jsxs(He,{align:"start",className:"min-w-56",children:[t.jsx(Be,{children:ee(e)}),t.jsx(pe,{}),s.map(c=>t.jsx(be,{"data-mesh-move-to":c.deviceId,disabled:!!c.refused,title:c.refused??void 0,onSelect:()=>r(c,!1),children:c.verb},c.deviceId)),t.jsx(pe,{}),s.map(c=>t.jsx(be,{"data-mesh-copy-to":c.deviceId,disabled:!!c.refused,title:c.refused??void 0,onSelect:()=>r(c,!0),children:c.keepVerb},`keep-${c.deviceId}`))]})]}),At=({device:e,sessions:s,sessionTotal:d,nowSeconds:r,destinationsFor:u,movingSessionId:x,canMove:g,canInvite:c,onClose:v,onMove:S,onShowInList:C,onInvite:M,onRemoveMember:A})=>{const f=Ce(e),m=d>s.rows.length?`${s.rows.length} of ${d}`:`${s.rows.length}`;return t.jsxs("aside",{"aria-label":`${e.label} details`,"data-mesh-panel":e.id,className:"flex w-80 shrink-0 flex-col gap-3 overflow-y-auto rounded-md border border-hairline bg-surface p-4",children:[t.jsxs("header",{className:"flex flex-col gap-1",children:[t.jsx(V,{size:"sm",variant:"ghost",className:"w-fit self-end","data-mesh-panel-close":"",onClick:v,children:"Close"}),t.jsx("h2",{className:"text-body-sm text-ink",children:e.label}),t.jsxs("p",{className:"flex items-center gap-1.5 text-meta text-ink-muted",children:[e.state==="suspect"&&t.jsx(Qe,{"aria-hidden":"true",className:"size-3.5 text-danger"}),e.state==="unreachable"&&t.jsx(Le,{"aria-hidden":"true",className:"size-3.5 text-warning"}),f||de(e,r)]}),e.reason&&t.jsx("p",{className:"text-meta text-warning",children:e.reason})]}),t.jsx(re,{}),t.jsxs("section",{className:"flex flex-col gap-2",children:[t.jsx("h3",{className:"text-meta text-ink-dim",children:"Memberships"}),t.jsx("ul",{className:"m-0 flex list-none flex-col gap-2 p-0",children:e.memberships.map(i=>t.jsxs("li",{className:"flex flex-col gap-1",children:[t.jsxs("span",{className:"flex items-center gap-2 text-body-sm text-ink",children:[t.jsx(he,{"aria-hidden":"true",className:"size-3.5 text-ink-muted"}),i.networkName]}),t.jsxs("span",{className:"text-meta text-ink-dim",children:[i.role||"member",i.capabilities.length>0?` · ${i.capabilities.join(", ")}`:"",i.active?"":" · revoked"]}),c&&i.active&&t.jsxs(V,{size:"sm",variant:"ghost",className:"w-fit","data-mesh-remove-member":`${i.networkId}:${e.id}`,onClick:()=>A(e,i.networkId),children:["Remove from ",i.networkName,"…"]})]},i.networkId))}),c&&t.jsx(V,{size:"sm",variant:"secondary",className:"w-fit","data-mesh-invite":e.id,onClick:()=>M(e),children:"Invite to a network…"})]}),t.jsx(re,{}),t.jsxs("section",{className:"flex min-h-0 flex-col gap-2",children:[t.jsxs("h3",{className:"text-meta text-ink-dim",children:["Conversations ",t.jsxs("span",{className:"text-ink-disabled",children:["(",m,")"]})]}),s.rows.length===0?t.jsx("p",{className:"text-meta text-ink-dim",children:e.sessionCount===null?"This device did not report its conversations.":"No conversations here."}):t.jsx("ul",{className:"m-0 flex list-none flex-col gap-1 p-0",children:s.rows.map(i=>t.jsxs("li",{"data-mesh-panel-session":i.id,className:R("flex items-center gap-2 rounded-sm px-2 py-1","border border-hairline bg-elevated",x===i.id&&"border-control"),children:[t.jsx("span",{className:"min-w-0 flex-1 truncate text-body-sm text-ink",children:ee(i)}),t.jsx("span",{className:"shrink-0 text-meta text-ink-dim",children:De(i,e.label,e.reachable)}),x===i.id?t.jsx("span",{className:"shrink-0 text-meta text-ink-muted",children:"moving…"}):t.jsx(Ee,{session:i,destinations:u(i),disabled:!g,onChoose:(w,b)=>S(i,w,b),trigger:t.jsx(Me,{"aria-hidden":"true",className:"size-4"}),triggerLabel:`Move ${ee(i)}`})]},i.id))}),e.endpoints.length>0&&t.jsx(Oe,{content:e.endpoints.join(`
|
|
2
|
+
`),children:t.jsxs("span",{className:"w-fit text-meta text-ink-dim",children:[e.endpoints.length," ",e.endpoints.length===1?"address":"addresses"]})})]}),t.jsx(re,{}),t.jsx(V,{size:"sm",variant:"ghost",className:"w-fit","data-mesh-show-in-list":e.id,onClick:()=>C(e.id),children:"Show in list"})]})},Tt=["name","chats","state"],Pt={name:"Name",chats:"Conversations",state:"State"},je={suspect:0,unreachable:1,self:2,reachable:3};function $t(e,s){const d=[...e];switch(s){case"chats":return d.sort((r,u)=>(u.sessionCount??-1)-(r.sessionCount??-1)||r.label.localeCompare(u.label)),d;case"state":return d.sort((r,u)=>je[r.state]-je[u.state]||r.label.localeCompare(u.label)),d;default:return d.sort((r,u)=>r.label.localeCompare(u.label))}}const Ne=8;function Lt(e,s){if(e.locality==="local")return e.live_state||"here";const d=e.owner_device_name||s,r=e.live_state?` · ${e.live_state}`:"";return e.reachable?`on ${d}${r}`:`on ${d} (not answering)`}const Ot=({graph:e,nowSeconds:s,selectedDeviceId:d,sessions:r,selfLabel:u,canMove:x,onSelect:g,onMove:c,onInvite:v,onRemove:S})=>{const[C,M]=o.useState("name"),A=o.useMemo(()=>e.networks.map(f=>({network:f,members:$t(e.devices.filter(m=>m.memberships.some(i=>i.networkId===f.id)),C)})),[e,C]);return t.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto pr-1",children:[t.jsxs("fieldset",{className:"m-0 w-fit border-0 p-0",children:[t.jsx("legend",{className:"sr-only",children:"Sort devices by"}),t.jsx("div",{className:"flex gap-0.5 rounded-md bg-sunken p-0.5",children:Tt.map(f=>t.jsx("button",{type:"button","aria-pressed":C===f,onClick:()=>M(f),className:R("h-6 rounded-sm px-3 text-body-sm text-ink-muted transition-colors duration-fast ease-out-quart","hover:text-ink","focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2",C===f&&"bg-surface text-ink"),children:Pt[f]},f))})]}),A.map(({network:f,members:m})=>t.jsxs("section",{"data-mesh-network-group":f.id,className:"flex flex-col gap-2",children:[t.jsxs("h2",{className:"flex flex-wrap items-baseline gap-2 text-body-sm text-ink",title:`epoch ${f.epoch}`,children:[f.label,t.jsxs("span",{className:"text-meta text-ink-dim",children:[f.trust," · ",f.memberCount," ",f.memberCount===1?"device":"devices",f.revokedCount>0?` · ${f.revokedCount} revoked`:""]})]}),t.jsx("ul",{className:"m-0 flex list-none flex-col gap-1 p-0",children:m.map(i=>{const w=i.memberships.find(p=>p.networkId===f.id),b=i.id===d,O=r.get(i.id),D=O?.rows??[],T=O?Se(O,i.sessionCount):i.sessionCount??0;return t.jsxs("li",{"data-mesh-device-row":i.id,"data-mesh-state":i.state,"aria-current":b?"true":void 0,className:R("flex flex-col gap-1 rounded-md px-3 py-2","border border-hairline bg-surface",b&&"border-ink bg-row-selected"),children:[t.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-3 gap-y-1",children:[t.jsx("button",{type:"button","data-mesh-device-open":i.id,onClick:()=>g(i.id),className:R("min-w-0 flex-1 truncate text-left text-body-sm text-ink","hover:text-ink-muted","focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2"),children:i.label}),t.jsx("span",{className:R("shrink-0 text-meta",i.state==="unreachable"&&"text-warning",i.state==="suspect"&&"text-danger",i.state==="self"&&"text-accent",i.state==="reachable"&&"text-ink-muted"),children:de(i,s)}),t.jsxs("span",{className:"shrink-0 text-meta text-ink-dim",children:[w?.role?`${w.role} · `:"",w&&!w.active?"revoked":"member"]})]}),D.length>0?t.jsxs(t.Fragment,{children:[t.jsx(re,{className:"my-1"}),t.jsx("ul",{className:"m-0 flex list-none flex-col gap-0.5 p-0",children:D.slice(0,Ne).map(p=>t.jsxs("li",{"data-mesh-row-session":p.id,className:"flex items-center gap-2 py-0.5",children:[t.jsx("span",{className:"min-w-0 flex-1 truncate text-meta text-ink-muted",children:p.name||p.id}),t.jsx("span",{className:"shrink-0 text-meta text-ink-dim",children:Lt(p,u)}),t.jsx(Ee,{session:p,destinations:_e(e,p,u),disabled:!x,onChoose:(N,h)=>c(p,N,h),trigger:t.jsx(Me,{"aria-hidden":"true",className:"size-3.5"}),triggerLabel:`Move ${p.name||p.id}`})]},p.id))}),T>D.slice(0,Ne).length&&t.jsx("button",{type:"button",onClick:()=>g(i.id),className:"w-fit text-meta text-ink-dim hover:text-ink",children:`show all ${T} in the panel`})]}):t.jsx("span",{className:"text-meta text-ink-dim",children:T===0?"no conversations":T===1?"1 conversation":`${T} conversations`}),(w?.active||i.state!=="self")&&t.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[t.jsx(V,{size:"sm",variant:"ghost","data-mesh-invite":i.id,onClick:()=>v({deviceId:i.id,deviceLabel:i.label}),children:"Invite to a network…"}),w?.active&&t.jsxs(V,{size:"sm",variant:"ghost","data-mesh-remove-member":`${f.id}:${i.id}`,onClick:()=>S({networkId:f.id,networkLabel:f.label,deviceId:i.id,deviceLabel:i.label}),children:["Remove from ",f.label,"…"]})]})]},i.id)})})]},f.id)),e.unmatchedPeers.length>0&&t.jsxs("p",{className:"text-meta text-warning",children:[e.unmatchedPeers.length," ",e.unmatchedPeers.length===1?"device":"devices"," answered the peer read but is in no network this app can name."]})]})},zt=["canvas","list"],Wt={canvas:"Canvas",list:"List"},Ht=({state:e,graph:s,nowSeconds:d,checking:r,staleError:u,onRetry:x,sessions:g,sessionError:c,selfLabel:v,movingSessionId:S,canMove:C,pendingMove:M,onAskMove:A,onDropRefused:f,onChooseMove:m,onCancelMove:i,moveBusy:w,moveReport:b,onDismissReport:O,onWaitForIdle:D,onUndoCopy:T,invite:p,onOpenInvite:N,onInvite:h,onCloseInvite:P,inviteBusy:q,inviteReceipt:te,inviteRefusal:$,remove:F,onOpenRemove:Z,onRemove:ne,onCloseRemove:k,removeBusy:_,removeRefusal:I,removed:z})=>{const[j,W]=o.useState("canvas"),[H,X]=o.useState(null),ie=s?et(s):"",J="mesh-summary",ce=tt(s),U=nt(s,g,s?.selfDeviceId??null),se=o.useMemo(()=>{const a=new Map;for(const l of s?.devices??[]){const y=U.byDevice.get(l.id);a.set(l.id,y?Se(y,l.sessionCount):l.sessionCount??0)}return a},[s,U]),G=o.useCallback(a=>{X(a)},[]),Q=s?s.devices.find(a=>a.id===H)??null:null,n=o.useCallback((a,l,y)=>{if(!s)return null;const E={selfDeviceId:s.selfDeviceId,devices:new Map(s.devices.map(Y=>[Y.id,Y])),networks:new Map(s.networks.map(Y=>[Y.id,Y]))},B=a.locality==="local"?s.selfDeviceId??"":a.owner_device,Re=E.devices.get(B),L=le({session:a,ownerDeviceId:B,ownerLabel:Re?.label??a.owner_device_name},{kind:"device",deviceId:l.deviceId},E);if(L.kind==="refused")return f({code:L.code,sentence:L.sentence,remedy:L.remedy,plan:L.plan??null}),null;if(L.kind==="none")return null;const fe=y?L.alternatives.find(Y=>Y.keep)??L.plan:L.plan,Ae=[L.plan,...L.alternatives].filter(Y=>Y.keep!==fe.keep),Te={plan:fe,alternatives:Ae,risky:L.risky};A(Te)},[s,A,f]);return t.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-6 p-6",children:[t.jsx($e,{title:"Mesh",icon:he,subtitle:"Devices this app is paired with, and the networks that hold them.",children:t.jsxs("div",{className:"flex items-center gap-4",children:[r&&t.jsx("output",{className:"text-meta text-ink-dim",children:"checking…"}),(e.kind==="ready"||e.kind==="loading")&&t.jsxs("fieldset",{className:"m-0 w-fit border-0 p-0",children:[t.jsx("legend",{className:"sr-only",children:"Presentation"}),t.jsx("div",{className:"flex gap-0.5 rounded-md bg-sunken p-0.5",children:zt.map(a=>t.jsx("button",{type:"button","aria-pressed":j===a,disabled:e.kind!=="ready",onClick:()=>W(a),className:R("h-6 rounded-sm px-3 text-body-sm text-ink-muted transition-colors duration-fast ease-out-quart","hover:text-ink","focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2","disabled:text-ink-dim disabled:hover:text-ink-dim",j===a&&"bg-surface text-ink"),children:Wt[a]},a))})]})]})}),e.kind==="loading"&&t.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-3",children:[t.jsx(ge,{className:"h-4 w-64"}),t.jsx(ge,{className:"min-h-40 w-full flex-1"})]}),e.kind==="error"&&t.jsxs(ue,{variant:"warning",className:"flex-col items-start gap-2",children:[t.jsx("p",{children:e.message}),t.jsx(V,{variant:"secondary",size:"sm",onClick:x,className:"w-fit",children:"Ask again"})]}),e.kind==="empty"&&t.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center rounded-lg border border-hairline bg-surface p-6",children:t.jsxs("div",{className:"flex flex-col items-start gap-3",children:[t.jsx("h2",{className:"text-heading text-ink",children:"No network on this device"}),t.jsx("p",{className:"max-w-140 text-body-sm text-ink-muted",children:"This device is not in any network, so there is no mesh to draw. Create one on this machine:"}),t.jsx("code",{className:"rounded-sm bg-sunken px-2 py-1 font-mono text-meta text-ink",children:"lop network init <name>"}),t.jsx("p",{className:"text-meta text-ink-dim",children:"A network appears here once this device has joined one."})]})}),e.kind==="ready"&&s&&t.jsxs("div",{className:"flex min-h-0 flex-1 gap-4",children:[t.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col gap-3",children:[t.jsx("p",{id:J,className:"text-meta text-ink-muted","data-mesh-summary":"",children:ie}),u&&t.jsx(ue,{variant:"warning",children:t.jsx("p",{children:u})}),c&&t.jsx(ue,{variant:"warning",children:t.jsx("p",{children:c})}),b&&t.jsx(st,{receipt:b.kind==="moved"?{verb:b.verb,detail:b.detail,undo:b.undo}:null,refusal:b.kind==="refused"?b.refusal:null,canWait:b.kind==="refused"&&b.plan!==null,onWait:D,onRecheck:x,onUndo:T,onDismiss:O,pending:w}),j==="canvas"?t.jsx(_t,{graph:s,slots:ce,nowSeconds:d,selectedDeviceId:H,sessions:U.byDevice,sessionTotals:se,movingSessionId:S,canMove:C,onOpenDevice:G,onAskMove:A,onDropRefused:f,onShowAllSessions:G,summaryId:J}):t.jsx(Ot,{graph:s,nowSeconds:d,selectedDeviceId:H,sessions:U.byDevice,selfLabel:v,canMove:C,onSelect:G,onMove:n,onInvite:N,onRemove:Z})]}),Q&&t.jsx(At,{device:Q,sessions:U.byDevice.get(Q.id)??{rows:[],shown:[],hidden:0},sessionTotal:se.get(Q.id)??0,nowSeconds:d,canMove:C,canInvite:e.kind==="ready",movingSessionId:S,destinationsFor:a=>_e(s,a,v),onClose:()=>X(null),onMove:n,onInvite:a=>N({deviceId:a.id,deviceLabel:a.label}),onRemoveMember:(a,l)=>{const y=s.networks.find(E=>E.id===l);Z({networkId:l,networkLabel:y?.label??l,deviceId:a.id,deviceLabel:a.label})},onShowInList:a=>{G(a),W("list")}})]}),t.jsx(at,{open:M!==null,plan:M?.plan??Bt,alternatives:M?.alternatives??[],risky:M?.risky??!1,busy:w,onCancel:i,onChoose:m}),p&&t.jsx(it,{open:p.open,options:p.options,deviceId:p.deviceId,deviceLabel:p.deviceLabel,onClose:P,onInvite:h,pending:q,receipt:te,refusal:$}),F&&t.jsx(rt,{open:F.open,networkLabel:F.networkLabel,deviceLabel:F.deviceLabel,onClose:k,onConfirm:ne,pending:_,refusal:I,removed:z})]})},Bt={sessionId:"",to:"",keep:!1,verb:"",waitS:0,lost:null},Jt=()=>{const e=Pe(),s=xe(e.data,"peers")==="enabled",d=xe(e.data,"session_transfer")==="enabled",r=lt(s),u=ot(s),x=dt(s),g=o.useMemo(()=>({peers:r,networks:u}),[r,u]),c=ct(g),v=ut(g),S=mt(),C=ht(),M=ft(),[A,f]=o.useState(null),[m,i]=o.useState(null),[w,b]=o.useState(null),[O,D]=o.useState(null),[T,p]=o.useState(null),[N,h]=o.useState(null),[P,q]=o.useState(null),te=o.useMemo(()=>{const k=Math.max(r.dataUpdatedAt,u.dataUpdatedAt);return Math.floor((k||Date.now())/1e3)},[r.dataUpdatedAt,u.dataUpdatedAt]),$=o.useCallback(()=>{r.refetch(),u.refetch(),x.refetch()},[r,u,x]),F=o.useCallback((k,_)=>{f(null);const I={sessionId:k.sessionId,to:k.to,keep:k.keep,waitS:_??k.waitS};S.mutate(I,{onSuccess:z=>{if(z.kind==="moved"){const{receipt:j}=z,W=j.locality==="local"?"this device":v?.devices.find(H=>H.id===j.owner_device)?.label??j.owner_device;i({kind:"moved",verb:j.mode==="keep"?"Copied":"Moved",detail:j.mode==="keep"?`${W} holds a copy as ${j.new_session_id.slice(-6)}; the original is still here.`:`${W} holds it now${j.source_retired?"; the copy here is gone":""}.`,undo:j.mode==="keep"?{sessionId:j.new_session_id,to:"local",keep:!1,verb:`Bring the copy back from ${W}`,waitS:0,lost:xt(W,"this device")}:null});return}i({kind:"refused",refusal:z.refusal,plan:k})},onError:()=>{i({kind:"refused",refusal:{code:"move_failed",sentence:"The move could not be sent. Nothing here changed; the list has been read again.",status:null,unconfirmed:!1},plan:k})}})},[v,S]),Z=o.useMemo(()=>{if(!v)return[];const k=w?.deviceId,_=k?v.devices.find(I=>I.id===k):void 0;return v.networks.filter(I=>{if(!_)return!0;const z=_.memberships.find(j=>j.networkId===I.id);return!z||!z.active}).map(I=>({id:I.id,label:I.label}))},[v,w]);if(!s)return t.jsx(pt,{to:"/chat",replace:!0});const ne=c.kind==="ready"?r.error?ae(r.error):u.error?ae(u.error):null:null;return t.jsx(Ht,{state:c,graph:v,nowSeconds:te,checking:r.isFetching||u.isFetching,staleError:ne,onRetry:$,sessions:x.data??[],movingSessionId:S.isPending?S.variables?.sessionId??null:null,sessionError:x.isError?ae(x.error):null,selfLabel:v?.devices.find(k=>k.state==="self")?.label??"this device",canMove:d,pendingMove:A,onAskMove:f,onDropRefused:k=>i({kind:"refused",refusal:{code:k.code,sentence:k.sentence,status:null,unconfirmed:!1},plan:k.plan}),onChooseMove:k=>F(k),onCancelMove:()=>f(null),moveBusy:S.isPending,moveReport:m,onDismissReport:()=>i(null),onWaitForIdle:()=>{m?.kind!=="refused"||!m.plan||F(m.plan,Ft)},onUndoCopy:()=>{m?.kind!=="moved"||!m.undo||f({plan:m.undo,alternatives:[],risky:!1})},invite:w===null?null:{open:!0,deviceId:w.deviceId,deviceLabel:w.deviceLabel,options:Z},onOpenInvite:k=>{D(null),p(null),b(k)},onInvite:k=>{C.mutate(k,{onSuccess:_=>D(_),onError:_=>p({code:"invite_refused",sentence:ae(_),status:null,unconfirmed:!1})})},onCloseInvite:()=>b(null),inviteBusy:C.isPending,inviteReceipt:O,inviteRefusal:T,remove:N===null?null:{open:!0,networkId:N.networkId,networkLabel:N.networkLabel,deviceId:N.deviceId,deviceLabel:N.deviceLabel},onOpenRemove:k=>{q(null),h(k)},onRemove:k=>{N&&M.mutate({networkId:N.networkId,deviceId:N.deviceId,confirm:k},{onSuccess:_=>q(_)})},onCloseRemove:()=>h(null),removeBusy:M.isPending,removeRefusal:M.isError?{code:"remove_refused",sentence:ae(M.error),status:null,unconfirmed:!1}:null,removed:P})},Ft=300;export{Jt as MeshPage,Ht as MeshSurface,Jt as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as S,l as z,c as ot,K as Nt,V as mt,H as it,i as nt,W as Dt,X as Ot,Y as At,d as It,a5 as Ct,Q as Rt}from"./mermaid.core-BGnJVp5q.js";import{c as dt}from"./cytoscape.esm-DHvQc-Lm.js";import{g as xt}from"./index-C8q85hqs.js";import"./index-FOmxzVhB.js";import"./aida-control-B8b5SXix.js";import"./ui-preferences-store-qSXgzAHu.js";import"./textarea-CaRKMTTG.js";import"./error-boundary-BheI-_hJ.js";import"./console-mirror-iQjAVQrh.js";var tt={exports:{}},et={exports:{}},rt={exports:{}},Mt=rt.exports,ut;function wt(){return ut||(ut=1,function(I,w){(function(D,v){I.exports=v()})(Mt,function(){return function(f){var D={};function v(r){if(D[r])return D[r].exports;var t=D[r]={i:r,l:!1,exports:{}};return f[r].call(t.exports,t,t.exports,v),t.l=!0,t.exports}return v.m=f,v.c=D,v.i=function(r){return r},v.d=function(r,t,e){v.o(r,t)||Object.defineProperty(r,t,{configurable:!1,enumerable:!0,get:e})},v.n=function(r){var t=r&&r.__esModule?function(){return r.default}:function(){return r};return v.d(t,"a",t),t},v.o=function(r,t){return Object.prototype.hasOwnProperty.call(r,t)},v.p="",v(v.s=26)}([function(f,D,v){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,f.exports=r},function(f,D,v){var r=v(2),t=v(8),e=v(9);function i(g,a,y){r.call(this,y),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=y,this.bendpoints=[],this.source=g,this.target=a}i.prototype=Object.create(r.prototype);for(var o in r)i[o]=r[o];i.prototype.getSource=function(){return this.source},i.prototype.getTarget=function(){return this.target},i.prototype.isInterGraph=function(){return this.isInterGraph},i.prototype.getLength=function(){return this.length},i.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},i.prototype.getBendpoints=function(){return this.bendpoints},i.prototype.getLca=function(){return this.lca},i.prototype.getSourceInLca=function(){return this.sourceInLca},i.prototype.getTargetInLca=function(){return this.targetInLca},i.prototype.getOtherEnd=function(g){if(this.source===g)return this.target;if(this.target===g)return this.source;throw"Node is not incident with this edge"},i.prototype.getOtherEndInGraph=function(g,a){for(var y=this.getOtherEnd(g),n=a.getGraphManager().getRoot();;){if(y.getOwner()==a)return y;if(y.getOwner()==n)break;y=y.getOwner().getParent()}return null},i.prototype.updateLength=function(){var g=new Array(4);this.isOverlapingSourceAndTarget=t.getIntersection(this.target.getRect(),this.source.getRect(),g),this.isOverlapingSourceAndTarget||(this.lengthX=g[0]-g[2],this.lengthY=g[1]-g[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))},i.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)},f.exports=i},function(f,D,v){function r(t){this.vGraphObject=t}f.exports=r},function(f,D,v){var r=v(2),t=v(10),e=v(13),i=v(0),o=v(16),g=v(4);function a(n,c,l,E){l==null&&E==null&&(E=c),r.call(this,E),n.graphManager!=null&&(n=n.graphManager),this.estimatedSize=t.MIN_VALUE,this.inclusionTreeDepth=t.MAX_VALUE,this.vGraphObject=E,this.edges=[],this.graphManager=n,l!=null&&c!=null?this.rect=new e(c.x,c.y,l.width,l.height):this.rect=new e}a.prototype=Object.create(r.prototype);for(var y in r)a[y]=r[y];a.prototype.getEdges=function(){return this.edges},a.prototype.getChild=function(){return this.child},a.prototype.getOwner=function(){return this.owner},a.prototype.getWidth=function(){return this.rect.width},a.prototype.setWidth=function(n){this.rect.width=n},a.prototype.getHeight=function(){return this.rect.height},a.prototype.setHeight=function(n){this.rect.height=n},a.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},a.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},a.prototype.getCenter=function(){return new g(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},a.prototype.getLocation=function(){return new g(this.rect.x,this.rect.y)},a.prototype.getRect=function(){return this.rect},a.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},a.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},a.prototype.setRect=function(n,c){this.rect.x=n.x,this.rect.y=n.y,this.rect.width=c.width,this.rect.height=c.height},a.prototype.setCenter=function(n,c){this.rect.x=n-this.rect.width/2,this.rect.y=c-this.rect.height/2},a.prototype.setLocation=function(n,c){this.rect.x=n,this.rect.y=c},a.prototype.moveBy=function(n,c){this.rect.x+=n,this.rect.y+=c},a.prototype.getEdgeListToNode=function(n){var c=[],l=this;return l.edges.forEach(function(E){if(E.target==n){if(E.source!=l)throw"Incorrect edge source!";c.push(E)}}),c},a.prototype.getEdgesBetween=function(n){var c=[],l=this;return l.edges.forEach(function(E){if(!(E.source==l||E.target==l))throw"Incorrect edge source and/or target";(E.target==n||E.source==n)&&c.push(E)}),c},a.prototype.getNeighborsList=function(){var n=new Set,c=this;return c.edges.forEach(function(l){if(l.source==c)n.add(l.target);else{if(l.target!=c)throw"Incorrect incidency!";n.add(l.source)}}),n},a.prototype.withChildren=function(){var n=new Set,c,l;if(n.add(this),this.child!=null)for(var E=this.child.getNodes(),T=0;T<E.length;T++)c=E[T],l=c.withChildren(),l.forEach(function(m){n.add(m)});return n},a.prototype.getNoOfChildren=function(){var n=0,c;if(this.child==null)n=1;else for(var l=this.child.getNodes(),E=0;E<l.length;E++)c=l[E],n+=c.getNoOfChildren();return n==0&&(n=1),n},a.prototype.getEstimatedSize=function(){if(this.estimatedSize==t.MIN_VALUE)throw"assert failed";return this.estimatedSize},a.prototype.calcEstimatedSize=function(){return this.child==null?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},a.prototype.scatter=function(){var n,c,l=-i.INITIAL_WORLD_BOUNDARY,E=i.INITIAL_WORLD_BOUNDARY;n=i.WORLD_CENTER_X+o.nextDouble()*(E-l)+l;var T=-i.INITIAL_WORLD_BOUNDARY,m=i.INITIAL_WORLD_BOUNDARY;c=i.WORLD_CENTER_Y+o.nextDouble()*(m-T)+T,this.rect.x=n,this.rect.y=c},a.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var n=this.getChild();if(n.updateBounds(!0),this.rect.x=n.getLeft(),this.rect.y=n.getTop(),this.setWidth(n.getRight()-n.getLeft()),this.setHeight(n.getBottom()-n.getTop()),i.NODE_DIMENSIONS_INCLUDE_LABELS){var c=n.getRight()-n.getLeft(),l=n.getBottom()-n.getTop();this.labelWidth>c&&(this.rect.x-=(this.labelWidth-c)/2,this.setWidth(this.labelWidth)),this.labelHeight>l&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-l)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-l),this.setHeight(this.labelHeight))}}},a.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==t.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},a.prototype.transform=function(n){var c=this.rect.x;c>i.WORLD_BOUNDARY?c=i.WORLD_BOUNDARY:c<-i.WORLD_BOUNDARY&&(c=-i.WORLD_BOUNDARY);var l=this.rect.y;l>i.WORLD_BOUNDARY?l=i.WORLD_BOUNDARY:l<-i.WORLD_BOUNDARY&&(l=-i.WORLD_BOUNDARY);var E=new g(c,l),T=n.inverseTransformPoint(E);this.setLocation(T.x,T.y)},a.prototype.getLeft=function(){return this.rect.x},a.prototype.getRight=function(){return this.rect.x+this.rect.width},a.prototype.getTop=function(){return this.rect.y},a.prototype.getBottom=function(){return this.rect.y+this.rect.height},a.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},f.exports=a},function(f,D,v){function r(t,e){t==null&&e==null?(this.x=0,this.y=0):(this.x=t,this.y=e)}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},f.exports=r},function(f,D,v){var r=v(2),t=v(10),e=v(0),i=v(6),o=v(3),g=v(1),a=v(13),y=v(12),n=v(11);function c(E,T,m){r.call(this,m),this.estimatedSize=t.MIN_VALUE,this.margin=e.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=E,T!=null&&T instanceof i?this.graphManager=T:T!=null&&T instanceof Layout&&(this.graphManager=T.graphManager)}c.prototype=Object.create(r.prototype);for(var l in r)c[l]=r[l];c.prototype.getNodes=function(){return this.nodes},c.prototype.getEdges=function(){return this.edges},c.prototype.getGraphManager=function(){return this.graphManager},c.prototype.getParent=function(){return this.parent},c.prototype.getLeft=function(){return this.left},c.prototype.getRight=function(){return this.right},c.prototype.getTop=function(){return this.top},c.prototype.getBottom=function(){return this.bottom},c.prototype.isConnected=function(){return this.isConnected},c.prototype.add=function(E,T,m){if(T==null&&m==null){var L=E;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(L)>-1)throw"Node already in graph!";return L.owner=this,this.getNodes().push(L),L}else{var O=E;if(!(this.getNodes().indexOf(T)>-1&&this.getNodes().indexOf(m)>-1))throw"Source or target not in graph!";if(!(T.owner==m.owner&&T.owner==this))throw"Both owners must be this graph!";return T.owner!=m.owner?null:(O.source=T,O.target=m,O.isInterGraph=!1,this.getEdges().push(O),T.edges.push(O),m!=T&&m.edges.push(O),O)}},c.prototype.remove=function(E){var T=E;if(E instanceof o){if(T==null)throw"Node is null!";if(!(T.owner!=null&&T.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var m=T.edges.slice(),L,O=m.length,d=0;d<O;d++)L=m[d],L.isInterGraph?this.graphManager.remove(L):L.source.owner.remove(L);var N=this.nodes.indexOf(T);if(N==-1)throw"Node not in owner node list!";this.nodes.splice(N,1)}else if(E instanceof g){var L=E;if(L==null)throw"Edge is null!";if(!(L.source!=null&&L.target!=null))throw"Source and/or target is null!";if(!(L.source.owner!=null&&L.target.owner!=null&&L.source.owner==this&&L.target.owner==this))throw"Source and/or target owner is invalid!";var s=L.source.edges.indexOf(L),h=L.target.edges.indexOf(L);if(!(s>-1&&h>-1))throw"Source and/or target doesn't know this edge!";L.source.edges.splice(s,1),L.target!=L.source&&L.target.edges.splice(h,1);var N=L.source.owner.getEdges().indexOf(L);if(N==-1)throw"Not in owner's edge list!";L.source.owner.getEdges().splice(N,1)}},c.prototype.updateLeftTop=function(){for(var E=t.MAX_VALUE,T=t.MAX_VALUE,m,L,O,d=this.getNodes(),N=d.length,s=0;s<N;s++){var h=d[s];m=h.getTop(),L=h.getLeft(),E>m&&(E=m),T>L&&(T=L)}return E==t.MAX_VALUE?null:(d[0].getParent().paddingLeft!=null?O=d[0].getParent().paddingLeft:O=this.margin,this.left=T-O,this.top=E-O,new y(this.left,this.top))},c.prototype.updateBounds=function(E){for(var T=t.MAX_VALUE,m=-t.MAX_VALUE,L=t.MAX_VALUE,O=-t.MAX_VALUE,d,N,s,h,u,p=this.nodes,A=p.length,C=0;C<A;C++){var R=p[C];E&&R.child!=null&&R.updateBounds(),d=R.getLeft(),N=R.getRight(),s=R.getTop(),h=R.getBottom(),T>d&&(T=d),m<N&&(m=N),L>s&&(L=s),O<h&&(O=h)}var x=new a(T,L,m-T,O-L);T==t.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),p[0].getParent().paddingLeft!=null?u=p[0].getParent().paddingLeft:u=this.margin,this.left=x.x-u,this.right=x.x+x.width+u,this.top=x.y-u,this.bottom=x.y+x.height+u},c.calculateBounds=function(E){for(var T=t.MAX_VALUE,m=-t.MAX_VALUE,L=t.MAX_VALUE,O=-t.MAX_VALUE,d,N,s,h,u=E.length,p=0;p<u;p++){var A=E[p];d=A.getLeft(),N=A.getRight(),s=A.getTop(),h=A.getBottom(),T>d&&(T=d),m<N&&(m=N),L>s&&(L=s),O<h&&(O=h)}var C=new a(T,L,m-T,O-L);return C},c.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},c.prototype.getEstimatedSize=function(){if(this.estimatedSize==t.MIN_VALUE)throw"assert failed";return this.estimatedSize},c.prototype.calcEstimatedSize=function(){for(var E=0,T=this.nodes,m=T.length,L=0;L<m;L++){var O=T[L];E+=O.calcEstimatedSize()}return E==0?this.estimatedSize=e.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=E/Math.sqrt(this.nodes.length),this.estimatedSize},c.prototype.updateConnected=function(){var E=this;if(this.nodes.length==0){this.isConnected=!0;return}var T=new n,m=new Set,L=this.nodes[0],O,d,N=L.withChildren();for(N.forEach(function(C){T.push(C),m.add(C)});T.length!==0;){L=T.shift(),O=L.getEdges();for(var s=O.length,h=0;h<s;h++){var u=O[h];if(d=u.getOtherEndInGraph(L,this),d!=null&&!m.has(d)){var p=d.withChildren();p.forEach(function(C){T.push(C),m.add(C)})}}}if(this.isConnected=!1,m.size>=this.nodes.length){var A=0;m.forEach(function(C){C.owner==E&&A++}),A==this.nodes.length&&(this.isConnected=!0)}},f.exports=c},function(f,D,v){var r,t=v(1);function e(i){r=v(5),this.layout=i,this.graphs=[],this.edges=[]}e.prototype.addRoot=function(){var i=this.layout.newGraph(),o=this.layout.newNode(null),g=this.add(i,o);return this.setRootGraph(g),this.rootGraph},e.prototype.add=function(i,o,g,a,y){if(g==null&&a==null&&y==null){if(i==null)throw"Graph is null!";if(o==null)throw"Parent node is null!";if(this.graphs.indexOf(i)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(i),i.parent!=null)throw"Already has a parent!";if(o.child!=null)throw"Already has a child!";return i.parent=o,o.child=i,i}else{y=g,a=o,g=i;var n=a.getOwner(),c=y.getOwner();if(!(n!=null&&n.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(c!=null&&c.getGraphManager()==this))throw"Target not in this graph mgr!";if(n==c)return g.isInterGraph=!1,n.add(g,a,y);if(g.isInterGraph=!0,g.source=a,g.target=y,this.edges.indexOf(g)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(g),!(g.source!=null&&g.target!=null))throw"Edge source and/or target is null!";if(!(g.source.edges.indexOf(g)==-1&&g.target.edges.indexOf(g)==-1))throw"Edge already in source and/or target incidency list!";return g.source.edges.push(g),g.target.edges.push(g),g}},e.prototype.remove=function(i){if(i instanceof r){var o=i;if(o.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(o==this.rootGraph||o.parent!=null&&o.parent.graphManager==this))throw"Invalid parent node!";var g=[];g=g.concat(o.getEdges());for(var a,y=g.length,n=0;n<y;n++)a=g[n],o.remove(a);var c=[];c=c.concat(o.getNodes());var l;y=c.length;for(var n=0;n<y;n++)l=c[n],o.remove(l);o==this.rootGraph&&this.setRootGraph(null);var E=this.graphs.indexOf(o);this.graphs.splice(E,1),o.parent=null}else if(i instanceof t){if(a=i,a==null)throw"Edge is null!";if(!a.isInterGraph)throw"Not an inter-graph edge!";if(!(a.source!=null&&a.target!=null))throw"Source and/or target is null!";if(!(a.source.edges.indexOf(a)!=-1&&a.target.edges.indexOf(a)!=-1))throw"Source and/or target doesn't know this edge!";var E=a.source.edges.indexOf(a);if(a.source.edges.splice(E,1),E=a.target.edges.indexOf(a),a.target.edges.splice(E,1),!(a.source.owner!=null&&a.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(a.source.owner.getGraphManager().edges.indexOf(a)==-1)throw"Not in owner graph manager's edge list!";var E=a.source.owner.getGraphManager().edges.indexOf(a);a.source.owner.getGraphManager().edges.splice(E,1)}},e.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},e.prototype.getGraphs=function(){return this.graphs},e.prototype.getAllNodes=function(){if(this.allNodes==null){for(var i=[],o=this.getGraphs(),g=o.length,a=0;a<g;a++)i=i.concat(o[a].getNodes());this.allNodes=i}return this.allNodes},e.prototype.resetAllNodes=function(){this.allNodes=null},e.prototype.resetAllEdges=function(){this.allEdges=null},e.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},e.prototype.getAllEdges=function(){if(this.allEdges==null){var i=[],o=this.getGraphs();o.length;for(var g=0;g<o.length;g++)i=i.concat(o[g].getEdges());i=i.concat(this.edges),this.allEdges=i}return this.allEdges},e.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},e.prototype.setAllNodesToApplyGravitation=function(i){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=i},e.prototype.getRoot=function(){return this.rootGraph},e.prototype.setRootGraph=function(i){if(i.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=i,i.parent==null&&(i.parent=this.layout.newNode("Root node"))},e.prototype.getLayout=function(){return this.layout},e.prototype.isOneAncestorOfOther=function(i,o){if(!(i!=null&&o!=null))throw"assert failed";if(i==o)return!0;var g=i.getOwner(),a;do{if(a=g.getParent(),a==null)break;if(a==o)return!0;if(g=a.getOwner(),g==null)break}while(!0);g=o.getOwner();do{if(a=g.getParent(),a==null)break;if(a==i)return!0;if(g=a.getOwner(),g==null)break}while(!0);return!1},e.prototype.calcLowestCommonAncestors=function(){for(var i,o,g,a,y,n=this.getAllEdges(),c=n.length,l=0;l<c;l++){if(i=n[l],o=i.source,g=i.target,i.lca=null,i.sourceInLca=o,i.targetInLca=g,o==g){i.lca=o.getOwner();continue}for(a=o.getOwner();i.lca==null;){for(i.targetInLca=g,y=g.getOwner();i.lca==null;){if(y==a){i.lca=y;break}if(y==this.rootGraph)break;if(i.lca!=null)throw"assert failed";i.targetInLca=y.getParent(),y=i.targetInLca.getOwner()}if(a==this.rootGraph)break;i.lca==null&&(i.sourceInLca=a.getParent(),a=i.sourceInLca.getOwner())}if(i.lca==null)throw"assert failed"}},e.prototype.calcLowestCommonAncestor=function(i,o){if(i==o)return i.getOwner();var g=i.getOwner();do{if(g==null)break;var a=o.getOwner();do{if(a==null)break;if(a==g)return a;a=a.getParent().getOwner()}while(!0);g=g.getParent().getOwner()}while(!0);return g},e.prototype.calcInclusionTreeDepths=function(i,o){i==null&&o==null&&(i=this.rootGraph,o=1);for(var g,a=i.getNodes(),y=a.length,n=0;n<y;n++)g=a[n],g.inclusionTreeDepth=o,g.child!=null&&this.calcInclusionTreeDepths(g.child,o+1)},e.prototype.includesInvalidEdge=function(){for(var i,o=this.edges.length,g=0;g<o;g++)if(i=this.edges[g],this.isOneAncestorOfOther(i.source,i.target))return!0;return!1},f.exports=e},function(f,D,v){var r=v(0);function t(){}for(var e in r)t[e]=r[e];t.MAX_ITERATIONS=2500,t.DEFAULT_EDGE_LENGTH=50,t.DEFAULT_SPRING_STRENGTH=.45,t.DEFAULT_REPULSION_STRENGTH=4500,t.DEFAULT_GRAVITY_STRENGTH=.4,t.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,t.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,t.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,t.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,t.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,t.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,t.COOLING_ADAPTATION_FACTOR=.33,t.ADAPTATION_LOWER_NODE_LIMIT=1e3,t.ADAPTATION_UPPER_NODE_LIMIT=5e3,t.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,t.MAX_NODE_DISPLACEMENT=t.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,t.MIN_REPULSION_DIST=t.DEFAULT_EDGE_LENGTH/10,t.CONVERGENCE_CHECK_PERIOD=100,t.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,t.MIN_EDGE_LENGTH=1,t.GRID_CALCULATION_CHECK_PERIOD=10,f.exports=t},function(f,D,v){var r=v(12);function t(){}t.calcSeparationAmount=function(e,i,o,g){if(!e.intersects(i))throw"assert failed";var a=new Array(2);this.decideDirectionsForOverlappingNodes(e,i,a),o[0]=Math.min(e.getRight(),i.getRight())-Math.max(e.x,i.x),o[1]=Math.min(e.getBottom(),i.getBottom())-Math.max(e.y,i.y),e.getX()<=i.getX()&&e.getRight()>=i.getRight()?o[0]+=Math.min(i.getX()-e.getX(),e.getRight()-i.getRight()):i.getX()<=e.getX()&&i.getRight()>=e.getRight()&&(o[0]+=Math.min(e.getX()-i.getX(),i.getRight()-e.getRight())),e.getY()<=i.getY()&&e.getBottom()>=i.getBottom()?o[1]+=Math.min(i.getY()-e.getY(),e.getBottom()-i.getBottom()):i.getY()<=e.getY()&&i.getBottom()>=e.getBottom()&&(o[1]+=Math.min(e.getY()-i.getY(),i.getBottom()-e.getBottom()));var y=Math.abs((i.getCenterY()-e.getCenterY())/(i.getCenterX()-e.getCenterX()));i.getCenterY()===e.getCenterY()&&i.getCenterX()===e.getCenterX()&&(y=1);var n=y*o[0],c=o[1]/y;o[0]<c?c=o[0]:n=o[1],o[0]=-1*a[0]*(c/2+g),o[1]=-1*a[1]*(n/2+g)},t.decideDirectionsForOverlappingNodes=function(e,i,o){e.getCenterX()<i.getCenterX()?o[0]=-1:o[0]=1,e.getCenterY()<i.getCenterY()?o[1]=-1:o[1]=1},t.getIntersection2=function(e,i,o){var g=e.getCenterX(),a=e.getCenterY(),y=i.getCenterX(),n=i.getCenterY();if(e.intersects(i))return o[0]=g,o[1]=a,o[2]=y,o[3]=n,!0;var c=e.getX(),l=e.getY(),E=e.getRight(),T=e.getX(),m=e.getBottom(),L=e.getRight(),O=e.getWidthHalf(),d=e.getHeightHalf(),N=i.getX(),s=i.getY(),h=i.getRight(),u=i.getX(),p=i.getBottom(),A=i.getRight(),C=i.getWidthHalf(),R=i.getHeightHalf(),x=!1,_=!1;if(g===y){if(a>n)return o[0]=g,o[1]=l,o[2]=y,o[3]=p,!1;if(a<n)return o[0]=g,o[1]=m,o[2]=y,o[3]=s,!1}else if(a===n){if(g>y)return o[0]=c,o[1]=a,o[2]=h,o[3]=n,!1;if(g<y)return o[0]=E,o[1]=a,o[2]=N,o[3]=n,!1}else{var U=e.height/e.width,X=i.height/i.width,M=(n-a)/(y-g),G=void 0,F=void 0,b=void 0,Y=void 0,k=void 0,H=void 0;if(-U===M?g>y?(o[0]=T,o[1]=m,x=!0):(o[0]=E,o[1]=l,x=!0):U===M&&(g>y?(o[0]=c,o[1]=l,x=!0):(o[0]=L,o[1]=m,x=!0)),-X===M?y>g?(o[2]=u,o[3]=p,_=!0):(o[2]=h,o[3]=s,_=!0):X===M&&(y>g?(o[2]=N,o[3]=s,_=!0):(o[2]=A,o[3]=p,_=!0)),x&&_)return!1;if(g>y?a>n?(G=this.getCardinalDirection(U,M,4),F=this.getCardinalDirection(X,M,2)):(G=this.getCardinalDirection(-U,M,3),F=this.getCardinalDirection(-X,M,1)):a>n?(G=this.getCardinalDirection(-U,M,1),F=this.getCardinalDirection(-X,M,3)):(G=this.getCardinalDirection(U,M,2),F=this.getCardinalDirection(X,M,4)),!x)switch(G){case 1:Y=l,b=g+-d/M,o[0]=b,o[1]=Y;break;case 2:b=L,Y=a+O*M,o[0]=b,o[1]=Y;break;case 3:Y=m,b=g+d/M,o[0]=b,o[1]=Y;break;case 4:b=T,Y=a+-O*M,o[0]=b,o[1]=Y;break}if(!_)switch(F){case 1:H=s,k=y+-R/M,o[2]=k,o[3]=H;break;case 2:k=A,H=n+C*M,o[2]=k,o[3]=H;break;case 3:H=p,k=y+R/M,o[2]=k,o[3]=H;break;case 4:k=u,H=n+-C*M,o[2]=k,o[3]=H;break}}return!1},t.getCardinalDirection=function(e,i,o){return e>i?o:1+o%4},t.getIntersection=function(e,i,o,g){if(g==null)return this.getIntersection2(e,i,o);var a=e.x,y=e.y,n=i.x,c=i.y,l=o.x,E=o.y,T=g.x,m=g.y,L=void 0,O=void 0,d=void 0,N=void 0,s=void 0,h=void 0,u=void 0,p=void 0,A=void 0;return d=c-y,s=a-n,u=n*y-a*c,N=m-E,h=l-T,p=T*E-l*m,A=d*h-N*s,A===0?null:(L=(s*p-h*u)/A,O=(N*u-d*p)/A,new r(L,O))},t.angleOfVector=function(e,i,o,g){var a=void 0;return e!==o?(a=Math.atan((g-i)/(o-e)),o<e?a+=Math.PI:g<i&&(a+=this.TWO_PI)):g<i?a=this.ONE_AND_HALF_PI:a=this.HALF_PI,a},t.doIntersect=function(e,i,o,g){var a=e.x,y=e.y,n=i.x,c=i.y,l=o.x,E=o.y,T=g.x,m=g.y,L=(n-a)*(m-E)-(T-l)*(c-y);if(L===0)return!1;var O=((m-E)*(T-a)+(l-T)*(m-y))/L,d=((y-c)*(T-a)+(n-a)*(m-y))/L;return 0<O&&O<1&&0<d&&d<1},t.HALF_PI=.5*Math.PI,t.ONE_AND_HALF_PI=1.5*Math.PI,t.TWO_PI=2*Math.PI,t.THREE_PI=3*Math.PI,f.exports=t},function(f,D,v){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)},f.exports=r},function(f,D,v){function r(){}r.MAX_VALUE=2147483647,r.MIN_VALUE=-2147483648,f.exports=r},function(f,D,v){var r=function(){function a(y,n){for(var c=0;c<n.length;c++){var l=n[c];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(y,l.key,l)}}return function(y,n,c){return n&&a(y.prototype,n),c&&a(y,c),y}}();function t(a,y){if(!(a instanceof y))throw new TypeError("Cannot call a class as a function")}var e=function(y){return{value:y,next:null,prev:null}},i=function(y,n,c,l){return y!==null?y.next=n:l.head=n,c!==null?c.prev=n:l.tail=n,n.prev=y,n.next=c,l.length++,n},o=function(y,n){var c=y.prev,l=y.next;return c!==null?c.next=l:n.head=l,l!==null?l.prev=c:n.tail=c,y.prev=y.next=null,n.length--,y},g=function(){function a(y){var n=this;t(this,a),this.length=0,this.head=null,this.tail=null,y?.forEach(function(c){return n.push(c)})}return r(a,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(n,c){return i(c.prev,e(n),c,this)}},{key:"insertAfter",value:function(n,c){return i(c,e(n),c.next,this)}},{key:"insertNodeBefore",value:function(n,c){return i(c.prev,n,c,this)}},{key:"insertNodeAfter",value:function(n,c){return i(c,n,c.next,this)}},{key:"push",value:function(n){return i(this.tail,e(n),null,this)}},{key:"unshift",value:function(n){return i(null,e(n),this.head,this)}},{key:"remove",value:function(n){return o(n,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(n){if(n<=this.length()){for(var c=1,l=this.head;c<n;)l=l.next,c++;return l.value}}},{key:"set_object_at",value:function(n,c){if(n<=this.length()){for(var l=1,E=this.head;l<n;)E=E.next,l++;E.value=c}}}]),a}();f.exports=g},function(f,D,v){function r(t,e,i){this.x=null,this.y=null,t==null&&e==null&&i==null?(this.x=0,this.y=0):typeof t=="number"&&typeof e=="number"&&i==null?(this.x=t,this.y=e):t.constructor.name=="Point"&&e==null&&i==null&&(i=t,this.x=i.x,this.y=i.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,e,i){t.constructor.name=="Point"&&e==null&&i==null?(i=t,this.setLocation(i.x,i.y)):typeof t=="number"&&typeof e=="number"&&i==null&&(parseInt(t)==t&&parseInt(e)==e?this.move(t,e):(this.x=Math.floor(t+.5),this.y=Math.floor(e+.5)))},r.prototype.move=function(t,e){this.x=t,this.y=e},r.prototype.translate=function(t,e){this.x+=t,this.y+=e},r.prototype.equals=function(t){if(t.constructor.name=="Point"){var e=t;return this.x==e.x&&this.y==e.y}return this==t},r.prototype.toString=function(){return new r().constructor.name+"[x="+this.x+",y="+this.y+"]"},f.exports=r},function(f,D,v){function r(t,e,i,o){this.x=0,this.y=0,this.width=0,this.height=0,t!=null&&e!=null&&i!=null&&o!=null&&(this.x=t,this.y=e,this.width=i,this.height=o)}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},f.exports=r},function(f,D,v){var r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function t(){}t.lastID=0,t.createID=function(e){return t.isPrimitive(e)?e:(e.uniqueID!=null||(e.uniqueID=t.getString(),t.lastID++),e.uniqueID)},t.getString=function(e){return e==null&&(e=t.lastID),"Object#"+e},t.isPrimitive=function(e){var i=typeof e>"u"?"undefined":r(e);return e==null||i!="object"&&i!="function"},f.exports=t},function(f,D,v){function r(l){if(Array.isArray(l)){for(var E=0,T=Array(l.length);E<l.length;E++)T[E]=l[E];return T}else return Array.from(l)}var t=v(0),e=v(6),i=v(3),o=v(1),g=v(5),a=v(4),y=v(17),n=v(27);function c(l){n.call(this),this.layoutQuality=t.QUALITY,this.createBendsAsNeeded=t.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=t.DEFAULT_INCREMENTAL,this.animationOnLayout=t.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=t.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=t.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=t.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new e(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,l!=null&&(this.isRemoteUse=l)}c.RANDOM_SEED=1,c.prototype=Object.create(n.prototype),c.prototype.getGraphManager=function(){return this.graphManager},c.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},c.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},c.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},c.prototype.newGraphManager=function(){var l=new e(this);return this.graphManager=l,l},c.prototype.newGraph=function(l){return new g(null,this.graphManager,l)},c.prototype.newNode=function(l){return new i(this.graphManager,l)},c.prototype.newEdge=function(l){return new o(null,null,l)},c.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},c.prototype.runLayout=function(){this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters();var l;return this.checkLayoutSuccess()?l=!1:l=this.layout(),t.ANIMATE==="during"?!1:(l&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,l)},c.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},c.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var l=this.graphManager.getAllEdges(),E=0;E<l.length;E++)l[E];for(var T=this.graphManager.getRoot().getNodes(),E=0;E<T.length;E++)T[E];this.update(this.graphManager.getRoot())}},c.prototype.update=function(l){if(l==null)this.update2();else if(l instanceof i){var E=l;if(E.getChild()!=null)for(var T=E.getChild().getNodes(),m=0;m<T.length;m++)update(T[m]);if(E.vGraphObject!=null){var L=E.vGraphObject;L.update(E)}}else if(l instanceof o){var O=l;if(O.vGraphObject!=null){var d=O.vGraphObject;d.update(O)}}else if(l instanceof g){var N=l;if(N.vGraphObject!=null){var s=N.vGraphObject;s.update(N)}}},c.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=t.QUALITY,this.animationDuringLayout=t.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=t.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=t.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=t.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=t.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=t.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},c.prototype.transform=function(l){if(l==null)this.transform(new a(0,0));else{var E=new y,T=this.graphManager.getRoot().updateLeftTop();if(T!=null){E.setWorldOrgX(l.x),E.setWorldOrgY(l.y),E.setDeviceOrgX(T.x),E.setDeviceOrgY(T.y);for(var m=this.getAllNodes(),L,O=0;O<m.length;O++)L=m[O],L.transform(E)}}},c.prototype.positionNodesRandomly=function(l){if(l==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var E,T,m=l.getNodes(),L=0;L<m.length;L++)E=m[L],T=E.getChild(),T==null||T.getNodes().length==0?E.scatter():(this.positionNodesRandomly(T),E.updateBounds())},c.prototype.getFlatForest=function(){for(var l=[],E=!0,T=this.graphManager.getRoot().getNodes(),m=!0,L=0;L<T.length;L++)T[L].getChild()!=null&&(m=!1);if(!m)return l;var O=new Set,d=[],N=new Map,s=[];for(s=s.concat(T);s.length>0&&E;){for(d.push(s[0]);d.length>0&&E;){var h=d[0];d.splice(0,1),O.add(h);for(var u=h.getEdges(),L=0;L<u.length;L++){var p=u[L].getOtherEnd(h);if(N.get(h)!=p)if(!O.has(p))d.push(p),N.set(p,h);else{E=!1;break}}}if(!E)l=[];else{var A=[].concat(r(O));l.push(A);for(var L=0;L<A.length;L++){var C=A[L],R=s.indexOf(C);R>-1&&s.splice(R,1)}O=new Set,N=new Map}}return l},c.prototype.createDummyNodesForBendpoints=function(l){for(var E=[],T=l.source,m=this.graphManager.calcLowestCommonAncestor(l.source,l.target),L=0;L<l.bendpoints.length;L++){var O=this.newNode(null);O.setRect(new Point(0,0),new Dimension(1,1)),m.add(O);var d=this.newEdge(null);this.graphManager.add(d,T,O),E.add(O),T=O}var d=this.newEdge(null);return this.graphManager.add(d,T,l.target),this.edgeToDummyNodes.set(l,E),l.isInterGraph()?this.graphManager.remove(l):m.remove(l),E},c.prototype.createBendpointsFromDummyNodes=function(){var l=[];l=l.concat(this.graphManager.getAllEdges()),l=[].concat(r(this.edgeToDummyNodes.keys())).concat(l);for(var E=0;E<l.length;E++){var T=l[E];if(T.bendpoints.length>0){for(var m=this.edgeToDummyNodes.get(T),L=0;L<m.length;L++){var O=m[L],d=new a(O.getCenterX(),O.getCenterY()),N=T.bendpoints.get(L);N.x=d.x,N.y=d.y,O.getOwner().remove(O)}this.graphManager.add(T,T.source,T.target)}}},c.transform=function(l,E,T,m){if(T!=null&&m!=null){var L=E;if(l<=50){var O=E/T;L-=(E-O)/50*(50-l)}else{var d=E*m;L+=(d-E)/50*(l-50)}return L}else{var N,s;return l<=50?(N=9*E/500,s=E/10):(N=9*E/50,s=-8*E),N*l+s}},c.findCenterOfTree=function(l){var E=[];E=E.concat(l);var T=[],m=new Map,L=!1,O=null;(E.length==1||E.length==2)&&(L=!0,O=E[0]);for(var d=0;d<E.length;d++){var N=E[d],s=N.getNeighborsList().size;m.set(N,N.getNeighborsList().size),s==1&&T.push(N)}var h=[];for(h=h.concat(T);!L;){var u=[];u=u.concat(h),h=[];for(var d=0;d<E.length;d++){var N=E[d],p=E.indexOf(N);p>=0&&E.splice(p,1);var A=N.getNeighborsList();A.forEach(function(x){if(T.indexOf(x)<0){var _=m.get(x),U=_-1;U==1&&h.push(x),m.set(x,U)}})}T=T.concat(h),(E.length==1||E.length==2)&&(L=!0,O=E[0])}return O},c.prototype.setGraphManager=function(l){this.graphManager=l},f.exports=c},function(f,D,v){function r(){}r.seed=1,r.x=0,r.nextDouble=function(){return r.x=Math.sin(r.seed++)*1e4,r.x-Math.floor(r.x)},f.exports=r},function(f,D,v){var r=v(4);function t(e,i){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}t.prototype.getWorldOrgX=function(){return this.lworldOrgX},t.prototype.setWorldOrgX=function(e){this.lworldOrgX=e},t.prototype.getWorldOrgY=function(){return this.lworldOrgY},t.prototype.setWorldOrgY=function(e){this.lworldOrgY=e},t.prototype.getWorldExtX=function(){return this.lworldExtX},t.prototype.setWorldExtX=function(e){this.lworldExtX=e},t.prototype.getWorldExtY=function(){return this.lworldExtY},t.prototype.setWorldExtY=function(e){this.lworldExtY=e},t.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},t.prototype.setDeviceOrgX=function(e){this.ldeviceOrgX=e},t.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},t.prototype.setDeviceOrgY=function(e){this.ldeviceOrgY=e},t.prototype.getDeviceExtX=function(){return this.ldeviceExtX},t.prototype.setDeviceExtX=function(e){this.ldeviceExtX=e},t.prototype.getDeviceExtY=function(){return this.ldeviceExtY},t.prototype.setDeviceExtY=function(e){this.ldeviceExtY=e},t.prototype.transformX=function(e){var i=0,o=this.lworldExtX;return o!=0&&(i=this.ldeviceOrgX+(e-this.lworldOrgX)*this.ldeviceExtX/o),i},t.prototype.transformY=function(e){var i=0,o=this.lworldExtY;return o!=0&&(i=this.ldeviceOrgY+(e-this.lworldOrgY)*this.ldeviceExtY/o),i},t.prototype.inverseTransformX=function(e){var i=0,o=this.ldeviceExtX;return o!=0&&(i=this.lworldOrgX+(e-this.ldeviceOrgX)*this.lworldExtX/o),i},t.prototype.inverseTransformY=function(e){var i=0,o=this.ldeviceExtY;return o!=0&&(i=this.lworldOrgY+(e-this.ldeviceOrgY)*this.lworldExtY/o),i},t.prototype.inverseTransformPoint=function(e){var i=new r(this.inverseTransformX(e.x),this.inverseTransformY(e.y));return i},f.exports=t},function(f,D,v){function r(n){if(Array.isArray(n)){for(var c=0,l=Array(n.length);c<n.length;c++)l[c]=n[c];return l}else return Array.from(n)}var t=v(15),e=v(7),i=v(0),o=v(8),g=v(9);function a(){t.call(this),this.useSmartIdealEdgeLengthCalculation=e.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.idealEdgeLength=e.DEFAULT_EDGE_LENGTH,this.springConstant=e.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=e.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=e.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=e.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=e.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=e.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*e.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=e.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=e.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=e.MAX_ITERATIONS}a.prototype=Object.create(t.prototype);for(var y in t)a[y]=t[y];a.prototype.initParameters=function(){t.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=e.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},a.prototype.calcIdealEdgeLengths=function(){for(var n,c,l,E,T,m,L=this.getGraphManager().getAllEdges(),O=0;O<L.length;O++)n=L[O],n.idealLength=this.idealEdgeLength,n.isInterGraph&&(l=n.getSource(),E=n.getTarget(),T=n.getSourceInLca().getEstimatedSize(),m=n.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(n.idealLength+=T+m-2*i.SIMPLE_NODE_SIZE),c=n.getLca().getInclusionTreeDepth(),n.idealLength+=e.DEFAULT_EDGE_LENGTH*e.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(l.getInclusionTreeDepth()+E.getInclusionTreeDepth()-2*c))},a.prototype.initSpringEmbedder=function(){var n=this.getAllNodes().length;this.incremental?(n>e.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*e.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(n-e.ADAPTATION_LOWER_NODE_LIMIT)/(e.ADAPTATION_UPPER_NODE_LIMIT-e.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-e.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=e.MAX_NODE_DISPLACEMENT_INCREMENTAL):(n>e.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(e.COOLING_ADAPTATION_FACTOR,1-(n-e.ADAPTATION_LOWER_NODE_LIMIT)/(e.ADAPTATION_UPPER_NODE_LIMIT-e.ADAPTATION_LOWER_NODE_LIMIT)*(1-e.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=e.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},a.prototype.calcSpringForces=function(){for(var n=this.getAllEdges(),c,l=0;l<n.length;l++)c=n[l],this.calcSpringForce(c,c.idealLength)},a.prototype.calcRepulsionForces=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,l,E,T,m,L=this.getAllNodes(),O;if(this.useFRGridVariant)for(this.totalIterations%e.GRID_CALCULATION_CHECK_PERIOD==1&&n&&this.updateGrid(),O=new Set,l=0;l<L.length;l++)T=L[l],this.calculateRepulsionForceOfANode(T,O,n,c),O.add(T);else for(l=0;l<L.length;l++)for(T=L[l],E=l+1;E<L.length;E++)m=L[E],T.getOwner()==m.getOwner()&&this.calcRepulsionForce(T,m)},a.prototype.calcGravitationalForces=function(){for(var n,c=this.getAllNodesToApplyGravitation(),l=0;l<c.length;l++)n=c[l],this.calcGravitationalForce(n)},a.prototype.moveNodes=function(){for(var n=this.getAllNodes(),c,l=0;l<n.length;l++)c=n[l],c.move()},a.prototype.calcSpringForce=function(n,c){var l=n.getSource(),E=n.getTarget(),T,m,L,O;if(this.uniformLeafNodeSizes&&l.getChild()==null&&E.getChild()==null)n.updateLengthSimple();else if(n.updateLength(),n.isOverlapingSourceAndTarget)return;T=n.getLength(),T!=0&&(m=this.springConstant*(T-c),L=m*(n.lengthX/T),O=m*(n.lengthY/T),l.springForceX+=L,l.springForceY+=O,E.springForceX-=L,E.springForceY-=O)},a.prototype.calcRepulsionForce=function(n,c){var l=n.getRect(),E=c.getRect(),T=new Array(2),m=new Array(4),L,O,d,N,s,h,u;if(l.intersects(E)){o.calcSeparationAmount(l,E,T,e.DEFAULT_EDGE_LENGTH/2),h=2*T[0],u=2*T[1];var p=n.noOfChildren*c.noOfChildren/(n.noOfChildren+c.noOfChildren);n.repulsionForceX-=p*h,n.repulsionForceY-=p*u,c.repulsionForceX+=p*h,c.repulsionForceY+=p*u}else this.uniformLeafNodeSizes&&n.getChild()==null&&c.getChild()==null?(L=E.getCenterX()-l.getCenterX(),O=E.getCenterY()-l.getCenterY()):(o.getIntersection(l,E,m),L=m[2]-m[0],O=m[3]-m[1]),Math.abs(L)<e.MIN_REPULSION_DIST&&(L=g.sign(L)*e.MIN_REPULSION_DIST),Math.abs(O)<e.MIN_REPULSION_DIST&&(O=g.sign(O)*e.MIN_REPULSION_DIST),d=L*L+O*O,N=Math.sqrt(d),s=this.repulsionConstant*n.noOfChildren*c.noOfChildren/d,h=s*L/N,u=s*O/N,n.repulsionForceX-=h,n.repulsionForceY-=u,c.repulsionForceX+=h,c.repulsionForceY+=u},a.prototype.calcGravitationalForce=function(n){var c,l,E,T,m,L,O,d;c=n.getOwner(),l=(c.getRight()+c.getLeft())/2,E=(c.getTop()+c.getBottom())/2,T=n.getCenterX()-l,m=n.getCenterY()-E,L=Math.abs(T)+n.getWidth()/2,O=Math.abs(m)+n.getHeight()/2,n.getOwner()==this.graphManager.getRoot()?(d=c.getEstimatedSize()*this.gravityRangeFactor,(L>d||O>d)&&(n.gravitationForceX=-this.gravityConstant*T,n.gravitationForceY=-this.gravityConstant*m)):(d=c.getEstimatedSize()*this.compoundGravityRangeFactor,(L>d||O>d)&&(n.gravitationForceX=-this.gravityConstant*T*this.compoundGravityConstant,n.gravitationForceY=-this.gravityConstant*m*this.compoundGravityConstant))},a.prototype.isConverged=function(){var n,c=!1;return this.totalIterations>this.maxIterations/3&&(c=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),n=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,n||c},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 n,c=this.graphManager.getAllNodes(),l=0;l<c.length;l++)n=c[l],n.noOfChildren=n.getNoOfChildren()},a.prototype.calcGrid=function(n){var c=0,l=0;c=parseInt(Math.ceil((n.getRight()-n.getLeft())/this.repulsionRange)),l=parseInt(Math.ceil((n.getBottom()-n.getTop())/this.repulsionRange));for(var E=new Array(c),T=0;T<c;T++)E[T]=new Array(l);for(var T=0;T<c;T++)for(var m=0;m<l;m++)E[T][m]=new Array;return E},a.prototype.addNodeToGrid=function(n,c,l){var E=0,T=0,m=0,L=0;E=parseInt(Math.floor((n.getRect().x-c)/this.repulsionRange)),T=parseInt(Math.floor((n.getRect().width+n.getRect().x-c)/this.repulsionRange)),m=parseInt(Math.floor((n.getRect().y-l)/this.repulsionRange)),L=parseInt(Math.floor((n.getRect().height+n.getRect().y-l)/this.repulsionRange));for(var O=E;O<=T;O++)for(var d=m;d<=L;d++)this.grid[O][d].push(n),n.setGridCoordinates(E,T,m,L)},a.prototype.updateGrid=function(){var n,c,l=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),n=0;n<l.length;n++)c=l[n],this.addNodeToGrid(c,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},a.prototype.calculateRepulsionForceOfANode=function(n,c,l,E){if(this.totalIterations%e.GRID_CALCULATION_CHECK_PERIOD==1&&l||E){var T=new Set;n.surrounding=new Array;for(var m,L=this.grid,O=n.startX-1;O<n.finishX+2;O++)for(var d=n.startY-1;d<n.finishY+2;d++)if(!(O<0||d<0||O>=L.length||d>=L[0].length)){for(var N=0;N<L[O][d].length;N++)if(m=L[O][d][N],!(n.getOwner()!=m.getOwner()||n==m)&&!c.has(m)&&!T.has(m)){var s=Math.abs(n.getCenterX()-m.getCenterX())-(n.getWidth()/2+m.getWidth()/2),h=Math.abs(n.getCenterY()-m.getCenterY())-(n.getHeight()/2+m.getHeight()/2);s<=this.repulsionRange&&h<=this.repulsionRange&&T.add(m)}}n.surrounding=[].concat(r(T))}for(O=0;O<n.surrounding.length;O++)this.calcRepulsionForce(n,n.surrounding[O])},a.prototype.calcRepulsionRange=function(){return 0},f.exports=a},function(f,D,v){var r=v(1),t=v(7);function e(o,g,a){r.call(this,o,g,a),this.idealLength=t.DEFAULT_EDGE_LENGTH}e.prototype=Object.create(r.prototype);for(var i in r)e[i]=r[i];f.exports=e},function(f,D,v){var r=v(3);function t(i,o,g,a){r.call(this,i,o,g,a),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=[]}t.prototype=Object.create(r.prototype);for(var e in r)t[e]=r[e];t.prototype.setGridCoordinates=function(i,o,g,a){this.startX=i,this.finishX=o,this.startY=g,this.finishY=a},f.exports=t},function(f,D,v){function r(t,e){this.width=0,this.height=0,t!==null&&e!==null&&(this.height=e,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},f.exports=r},function(f,D,v){var r=v(14);function t(){this.map={},this.keys=[]}t.prototype.put=function(e,i){var o=r.createID(e);this.contains(o)||(this.map[o]=i,this.keys.push(e))},t.prototype.contains=function(e){return r.createID(e),this.map[e]!=null},t.prototype.get=function(e){var i=r.createID(e);return this.map[i]},t.prototype.keySet=function(){return this.keys},f.exports=t},function(f,D,v){var r=v(14);function t(){this.set={}}t.prototype.add=function(e){var i=r.createID(e);this.contains(i)||(this.set[i]=e)},t.prototype.remove=function(e){delete this.set[r.createID(e)]},t.prototype.clear=function(){this.set={}},t.prototype.contains=function(e){return this.set[r.createID(e)]==e},t.prototype.isEmpty=function(){return this.size()===0},t.prototype.size=function(){return Object.keys(this.set).length},t.prototype.addAllTo=function(e){for(var i=Object.keys(this.set),o=i.length,g=0;g<o;g++)e.push(this.set[i[g]])},t.prototype.size=function(){return Object.keys(this.set).length},t.prototype.addAll=function(e){for(var i=e.length,o=0;o<i;o++){var g=e[o];this.add(g)}},f.exports=t},function(f,D,v){var r=function(){function o(g,a){for(var y=0;y<a.length;y++){var n=a[y];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(g,n.key,n)}}return function(g,a,y){return a&&o(g.prototype,a),y&&o(g,y),g}}();function t(o,g){if(!(o instanceof g))throw new TypeError("Cannot call a class as a function")}var e=v(11),i=function(){function o(g,a){t(this,o),(a!==null||a!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var y=void 0;g instanceof e?y=g.size():y=g.length,this._quicksort(g,0,y-1)}return r(o,[{key:"_quicksort",value:function(a,y,n){if(y<n){var c=this._partition(a,y,n);this._quicksort(a,y,c),this._quicksort(a,c+1,n)}}},{key:"_partition",value:function(a,y,n){for(var c=this._get(a,y),l=y,E=n;;){for(;this.compareFunction(c,this._get(a,E));)E--;for(;this.compareFunction(this._get(a,l),c);)l++;if(l<E)this._swap(a,l,E),l++,E--;else return E}}},{key:"_get",value:function(a,y){return a instanceof e?a.get_object_at(y):a[y]}},{key:"_set",value:function(a,y,n){a instanceof e?a.set_object_at(y,n):a[y]=n}},{key:"_swap",value:function(a,y,n){var c=this._get(a,y);this._set(a,y,this._get(a,n)),this._set(a,n,c)}},{key:"_defaultCompareFunction",value:function(a,y){return y>a}}]),o}();f.exports=i},function(f,D,v){var r=function(){function i(o,g){for(var a=0;a<g.length;a++){var y=g[a];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(o,y.key,y)}}return function(o,g,a){return g&&i(o.prototype,g),a&&i(o,a),o}}();function t(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}var e=function(){function i(o,g){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,y=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;t(this,i),this.sequence1=o,this.sequence2=g,this.match_score=a,this.mismatch_penalty=y,this.gap_penalty=n,this.iMax=o.length+1,this.jMax=g.length+1,this.grid=new Array(this.iMax);for(var c=0;c<this.iMax;c++){this.grid[c]=new Array(this.jMax);for(var l=0;l<this.jMax;l++)this.grid[c][l]=0}this.tracebackGrid=new Array(this.iMax);for(var E=0;E<this.iMax;E++){this.tracebackGrid[E]=new Array(this.jMax);for(var T=0;T<this.jMax;T++)this.tracebackGrid[E][T]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return r(i,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var g=1;g<this.jMax;g++)this.grid[0][g]=this.grid[0][g-1]+this.gap_penalty,this.tracebackGrid[0][g]=[!1,!1,!0];for(var a=1;a<this.iMax;a++)this.grid[a][0]=this.grid[a-1][0]+this.gap_penalty,this.tracebackGrid[a][0]=[!1,!0,!1];for(var y=1;y<this.iMax;y++)for(var n=1;n<this.jMax;n++){var c=void 0;this.sequence1[y-1]===this.sequence2[n-1]?c=this.grid[y-1][n-1]+this.match_score:c=this.grid[y-1][n-1]+this.mismatch_penalty;var l=this.grid[y-1][n]+this.gap_penalty,E=this.grid[y][n-1]+this.gap_penalty,T=[c,l,E],m=this.arrayAllMaxIndexes(T);this.grid[y][n]=T[m[0]],this.tracebackGrid[y][n]=[m.includes(0),m.includes(1),m.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var g=[];for(g.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});g[0];){var a=g[0],y=this.tracebackGrid[a.pos[0]][a.pos[1]];y[0]&&g.push({pos:[a.pos[0]-1,a.pos[1]-1],seq1:this.sequence1[a.pos[0]-1]+a.seq1,seq2:this.sequence2[a.pos[1]-1]+a.seq2}),y[1]&&g.push({pos:[a.pos[0]-1,a.pos[1]],seq1:this.sequence1[a.pos[0]-1]+a.seq1,seq2:"-"+a.seq2}),y[2]&&g.push({pos:[a.pos[0],a.pos[1]-1],seq1:"-"+a.seq1,seq2:this.sequence2[a.pos[1]-1]+a.seq2}),a.pos[0]===0&&a.pos[1]===0&&this.alignments.push({sequence1:a.seq1,sequence2:a.seq2}),g.shift()}return this.alignments}},{key:"getAllIndexes",value:function(g,a){for(var y=[],n=-1;(n=g.indexOf(a,n+1))!==-1;)y.push(n);return y}},{key:"arrayAllMaxIndexes",value:function(g){return this.getAllIndexes(g,Math.max.apply(null,g))}}]),i}();f.exports=e},function(f,D,v){var r=function(){};r.FDLayout=v(18),r.FDLayoutConstants=v(7),r.FDLayoutEdge=v(19),r.FDLayoutNode=v(20),r.DimensionD=v(21),r.HashMap=v(22),r.HashSet=v(23),r.IGeometry=v(8),r.IMath=v(9),r.Integer=v(10),r.Point=v(12),r.PointD=v(4),r.RandomSeed=v(16),r.RectangleD=v(13),r.Transform=v(17),r.UniqueIDGeneretor=v(14),r.Quicksort=v(24),r.LinkedList=v(11),r.LGraphObject=v(2),r.LGraph=v(5),r.LEdge=v(1),r.LGraphManager=v(6),r.LNode=v(3),r.Layout=v(15),r.LayoutConstants=v(0),r.NeedlemanWunsch=v(25),f.exports=r},function(f,D,v){function r(){this.listeners=[]}var t=r.prototype;t.addListener=function(e,i){this.listeners.push({event:e,callback:i})},t.removeListener=function(e,i){for(var o=this.listeners.length;o>=0;o--){var g=this.listeners[o];g.event===e&&g.callback===i&&this.listeners.splice(o,1)}},t.emit=function(e,i){for(var o=0;o<this.listeners.length;o++){var g=this.listeners[o];e===g.event&&g.callback(i)}},f.exports=r}])})}(rt)),rt.exports}var St=et.exports,ft;function Gt(){return ft||(ft=1,function(I,w){(function(D,v){I.exports=v(wt())})(St,function(f){return function(D){var v={};function r(t){if(v[t])return v[t].exports;var e=v[t]={i:t,l:!1,exports:{}};return D[t].call(e.exports,e,e.exports,r),e.l=!0,e.exports}return r.m=D,r.c=v,r.i=function(t){return t},r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=7)}([function(D,v){D.exports=f},function(D,v,r){var t=r(0).FDLayoutConstants;function e(){}for(var i in t)e[i]=t[i];e.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,e.DEFAULT_RADIAL_SEPARATION=t.DEFAULT_EDGE_LENGTH,e.DEFAULT_COMPONENT_SEPERATION=60,e.TILE=!0,e.TILING_PADDING_VERTICAL=10,e.TILING_PADDING_HORIZONTAL=10,e.TREE_REDUCTION_ON_INCREMENTAL=!1,D.exports=e},function(D,v,r){var t=r(0).FDLayoutEdge;function e(o,g,a){t.call(this,o,g,a)}e.prototype=Object.create(t.prototype);for(var i in t)e[i]=t[i];D.exports=e},function(D,v,r){var t=r(0).LGraph;function e(o,g,a){t.call(this,o,g,a)}e.prototype=Object.create(t.prototype);for(var i in t)e[i]=t[i];D.exports=e},function(D,v,r){var t=r(0).LGraphManager;function e(o){t.call(this,o)}e.prototype=Object.create(t.prototype);for(var i in t)e[i]=t[i];D.exports=e},function(D,v,r){var t=r(0).FDLayoutNode,e=r(0).IMath;function i(g,a,y,n){t.call(this,g,a,y,n)}i.prototype=Object.create(t.prototype);for(var o in t)i[o]=t[o];i.prototype.move=function(){var g=this.graphManager.getLayout();this.displacementX=g.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY=g.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren,Math.abs(this.displacementX)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementX=g.coolingFactor*g.maxNodeDisplacement*e.sign(this.displacementX)),Math.abs(this.displacementY)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementY=g.coolingFactor*g.maxNodeDisplacement*e.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),g.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},i.prototype.propogateDisplacementToChildren=function(g,a){for(var y=this.getChild().getNodes(),n,c=0;c<y.length;c++)n=y[c],n.getChild()==null?(n.moveBy(g,a),n.displacementX+=g,n.displacementY+=a):n.propogateDisplacementToChildren(g,a)},i.prototype.setPred1=function(g){this.pred1=g},i.prototype.getPred1=function(){return pred1},i.prototype.getPred2=function(){return pred2},i.prototype.setNext=function(g){this.next=g},i.prototype.getNext=function(){return next},i.prototype.setProcessed=function(g){this.processed=g},i.prototype.isProcessed=function(){return processed},D.exports=i},function(D,v,r){var t=r(0).FDLayout,e=r(4),i=r(3),o=r(5),g=r(2),a=r(1),y=r(0).FDLayoutConstants,n=r(0).LayoutConstants,c=r(0).Point,l=r(0).PointD,E=r(0).Layout,T=r(0).Integer,m=r(0).IGeometry,L=r(0).LGraph,O=r(0).Transform;function d(){t.call(this),this.toBeTiled={}}d.prototype=Object.create(t.prototype);for(var N in t)d[N]=t[N];d.prototype.newGraphManager=function(){var s=new e(this);return this.graphManager=s,s},d.prototype.newGraph=function(s){return new i(null,this.graphManager,s)},d.prototype.newNode=function(s){return new o(this.graphManager,s)},d.prototype.newEdge=function(s){return new g(null,null,s)},d.prototype.initParameters=function(){t.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.springConstant=y.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=y.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=y.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=y.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=y.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=y.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1,this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/y.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=y.CONVERGENCE_CHECK_PERIOD/this.maxIterations,this.coolingAdjuster=1)},d.prototype.layout=function(){var s=n.DEFAULT_CREATE_BENDS_AS_NEEDED;return s&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},d.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(a.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var h=new Set(this.getAllNodes()),u=this.nodesWithGravity.filter(function(C){return h.has(C)});this.graphManager.setAllNodesToApplyGravitation(u)}}else{var s=this.getFlatForest();if(s.length>0)this.positionNodesRadially(s);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var h=new Set(this.getAllNodes()),u=this.nodesWithGravity.filter(function(p){return h.has(p)});this.graphManager.setAllNodesToApplyGravitation(u),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},d.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%y.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),h=this.nodesWithGravity.filter(function(A){return s.has(A)});this.graphManager.setAllNodesToApplyGravitation(h),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=y.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=y.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var u=!this.isTreeGrowing&&!this.isGrowthFinished,p=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(u,p),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},d.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),h={},u=0;u<s.length;u++){var p=s[u].rect,A=s[u].id;h[A]={id:A,x:p.getCenterX(),y:p.getCenterY(),w:p.width,h:p.height}}return h},d.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var s=!1;if(y.ANIMATE==="during")this.emit("layoutstarted");else{for(;!s;)s=this.tick();this.graphManager.updateBounds()}},d.prototype.calculateNodesToApplyGravitationTo=function(){var s=[],h,u=this.graphManager.getGraphs(),p=u.length,A;for(A=0;A<p;A++)h=u[A],h.updateConnected(),h.isConnected||(s=s.concat(h.getNodes()));return s},d.prototype.createBendpoints=function(){var s=[];s=s.concat(this.graphManager.getAllEdges());var h=new Set,u;for(u=0;u<s.length;u++){var p=s[u];if(!h.has(p)){var A=p.getSource(),C=p.getTarget();if(A==C)p.getBendpoints().push(new l),p.getBendpoints().push(new l),this.createDummyNodesForBendpoints(p),h.add(p);else{var R=[];if(R=R.concat(A.getEdgeListToNode(C)),R=R.concat(C.getEdgeListToNode(A)),!h.has(R[0])){if(R.length>1){var x;for(x=0;x<R.length;x++){var _=R[x];_.getBendpoints().push(new l),this.createDummyNodesForBendpoints(_)}}R.forEach(function(U){h.add(U)})}}}if(h.size==s.length)break}},d.prototype.positionNodesRadially=function(s){for(var h=new c(0,0),u=Math.ceil(Math.sqrt(s.length)),p=0,A=0,C=0,R=new l(0,0),x=0;x<s.length;x++){x%u==0&&(C=0,A=p,x!=0&&(A+=a.DEFAULT_COMPONENT_SEPERATION),p=0);var _=s[x],U=E.findCenterOfTree(_);h.x=C,h.y=A,R=d.radialLayout(_,U,h),R.y>p&&(p=Math.floor(R.y)),C=Math.floor(R.x+a.DEFAULT_COMPONENT_SEPERATION)}this.transform(new l(n.WORLD_CENTER_X-R.x/2,n.WORLD_CENTER_Y-R.y/2))},d.radialLayout=function(s,h,u){var p=Math.max(this.maxDiagonalInTree(s),a.DEFAULT_RADIAL_SEPARATION);d.branchRadialLayout(h,null,0,359,0,p);var A=L.calculateBounds(s),C=new O;C.setDeviceOrgX(A.getMinX()),C.setDeviceOrgY(A.getMinY()),C.setWorldOrgX(u.x),C.setWorldOrgY(u.y);for(var R=0;R<s.length;R++){var x=s[R];x.transform(C)}var _=new l(A.getMaxX(),A.getMaxY());return C.inverseTransformPoint(_)},d.branchRadialLayout=function(s,h,u,p,A,C){var R=(p-u+1)/2;R<0&&(R+=180);var x=(R+u)%360,_=x*m.TWO_PI/360,U=A*Math.cos(_),X=A*Math.sin(_);s.setCenter(U,X);var M=[];M=M.concat(s.getEdges());var G=M.length;h!=null&&G--;for(var F=0,b=M.length,Y,k=s.getEdgesBetween(h);k.length>1;){var H=k[0];k.splice(0,1);var P=M.indexOf(H);P>=0&&M.splice(P,1),b--,G--}h!=null?Y=(M.indexOf(k[0])+1)%b:Y=0;for(var B=Math.abs(p-u)/G,$=Y;F!=G;$=++$%b){var K=M[$].getOtherEnd(s);if(K!=h){var Q=(u+F*B)%360,q=(Q+B)%360;d.branchRadialLayout(K,s,Q,q,A+C,C),F++}}},d.maxDiagonalInTree=function(s){for(var h=T.MIN_VALUE,u=0;u<s.length;u++){var p=s[u],A=p.getDiagonal();A>h&&(h=A)}return h},d.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},d.prototype.groupZeroDegreeMembers=function(){var s=this,h={};this.memberGroups={},this.idToDummyNode={};for(var u=[],p=this.graphManager.getAllNodes(),A=0;A<p.length;A++){var C=p[A],R=C.getParent();this.getNodeDegreeWithChildren(C)===0&&(R.id==null||!this.getToBeTiled(R))&&u.push(C)}for(var A=0;A<u.length;A++){var C=u[A],x=C.getParent().id;typeof h[x]>"u"&&(h[x]=[]),h[x]=h[x].concat(C)}Object.keys(h).forEach(function(_){if(h[_].length>1){var U="DummyCompound_"+_;s.memberGroups[U]=h[_];var X=h[_][0].getParent(),M=new o(s.graphManager);M.id=U,M.paddingLeft=X.paddingLeft||0,M.paddingRight=X.paddingRight||0,M.paddingBottom=X.paddingBottom||0,M.paddingTop=X.paddingTop||0,s.idToDummyNode[U]=M;var G=s.getGraphManager().add(s.newGraph(),M),F=X.getChild();F.add(M);for(var b=0;b<h[_].length;b++){var Y=h[_][b];F.remove(Y),G.add(Y)}}})},d.prototype.clearCompounds=function(){var s={},h={};this.performDFSOnCompounds();for(var u=0;u<this.compoundOrder.length;u++)h[this.compoundOrder[u].id]=this.compoundOrder[u],s[this.compoundOrder[u].id]=[].concat(this.compoundOrder[u].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[u].getChild()),this.compoundOrder[u].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(s,h)},d.prototype.clearZeroDegreeMembers=function(){var s=this,h=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(u){var p=s.idToDummyNode[u];h[u]=s.tileNodes(s.memberGroups[u],p.paddingLeft+p.paddingRight),p.rect.width=h[u].width,p.rect.height=h[u].height})},d.prototype.repopulateCompounds=function(){for(var s=this.compoundOrder.length-1;s>=0;s--){var h=this.compoundOrder[s],u=h.id,p=h.paddingLeft,A=h.paddingTop;this.adjustLocations(this.tiledMemberPack[u],h.rect.x,h.rect.y,p,A)}},d.prototype.repopulateZeroDegreeMembers=function(){var s=this,h=this.tiledZeroDegreePack;Object.keys(h).forEach(function(u){var p=s.idToDummyNode[u],A=p.paddingLeft,C=p.paddingTop;s.adjustLocations(h[u],p.rect.x,p.rect.y,A,C)})},d.prototype.getToBeTiled=function(s){var h=s.id;if(this.toBeTiled[h]!=null)return this.toBeTiled[h];var u=s.getChild();if(u==null)return this.toBeTiled[h]=!1,!1;for(var p=u.getNodes(),A=0;A<p.length;A++){var C=p[A];if(this.getNodeDegree(C)>0)return this.toBeTiled[h]=!1,!1;if(C.getChild()==null){this.toBeTiled[C.id]=!1;continue}if(!this.getToBeTiled(C))return this.toBeTiled[h]=!1,!1}return this.toBeTiled[h]=!0,!0},d.prototype.getNodeDegree=function(s){s.id;for(var h=s.getEdges(),u=0,p=0;p<h.length;p++){var A=h[p];A.getSource().id!==A.getTarget().id&&(u=u+1)}return u},d.prototype.getNodeDegreeWithChildren=function(s){var h=this.getNodeDegree(s);if(s.getChild()==null)return h;for(var u=s.getChild().getNodes(),p=0;p<u.length;p++){var A=u[p];h+=this.getNodeDegreeWithChildren(A)}return h},d.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},d.prototype.fillCompexOrderByDFS=function(s){for(var h=0;h<s.length;h++){var u=s[h];u.getChild()!=null&&this.fillCompexOrderByDFS(u.getChild().getNodes()),this.getToBeTiled(u)&&this.compoundOrder.push(u)}},d.prototype.adjustLocations=function(s,h,u,p,A){h+=p,u+=A;for(var C=h,R=0;R<s.rows.length;R++){var x=s.rows[R];h=C;for(var _=0,U=0;U<x.length;U++){var X=x[U];X.rect.x=h,X.rect.y=u,h+=X.rect.width+s.horizontalPadding,X.rect.height>_&&(_=X.rect.height)}u+=_+s.verticalPadding}},d.prototype.tileCompoundMembers=function(s,h){var u=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(p){var A=h[p];u.tiledMemberPack[p]=u.tileNodes(s[p],A.paddingLeft+A.paddingRight),A.rect.width=u.tiledMemberPack[p].width,A.rect.height=u.tiledMemberPack[p].height})},d.prototype.tileNodes=function(s,h){var u=a.TILING_PADDING_VERTICAL,p=a.TILING_PADDING_HORIZONTAL,A={rows:[],rowWidth:[],rowHeight:[],width:0,height:h,verticalPadding:u,horizontalPadding:p};s.sort(function(x,_){return x.rect.width*x.rect.height>_.rect.width*_.rect.height?-1:x.rect.width*x.rect.height<_.rect.width*_.rect.height?1:0});for(var C=0;C<s.length;C++){var R=s[C];A.rows.length==0?this.insertNodeToRow(A,R,0,h):this.canAddHorizontal(A,R.rect.width,R.rect.height)?this.insertNodeToRow(A,R,this.getShortestRowIndex(A),h):this.insertNodeToRow(A,R,A.rows.length,h),this.shiftToLastRow(A)}return A},d.prototype.insertNodeToRow=function(s,h,u,p){var A=p;if(u==s.rows.length){var C=[];s.rows.push(C),s.rowWidth.push(A),s.rowHeight.push(0)}var R=s.rowWidth[u]+h.rect.width;s.rows[u].length>0&&(R+=s.horizontalPadding),s.rowWidth[u]=R,s.width<R&&(s.width=R);var x=h.rect.height;u>0&&(x+=s.verticalPadding);var _=0;x>s.rowHeight[u]&&(_=s.rowHeight[u],s.rowHeight[u]=x,_=s.rowHeight[u]-_),s.height+=_,s.rows[u].push(h)},d.prototype.getShortestRowIndex=function(s){for(var h=-1,u=Number.MAX_VALUE,p=0;p<s.rows.length;p++)s.rowWidth[p]<u&&(h=p,u=s.rowWidth[p]);return h},d.prototype.getLongestRowIndex=function(s){for(var h=-1,u=Number.MIN_VALUE,p=0;p<s.rows.length;p++)s.rowWidth[p]>u&&(h=p,u=s.rowWidth[p]);return h},d.prototype.canAddHorizontal=function(s,h,u){var p=this.getShortestRowIndex(s);if(p<0)return!0;var A=s.rowWidth[p];if(A+s.horizontalPadding+h<=s.width)return!0;var C=0;s.rowHeight[p]<u&&p>0&&(C=u+s.verticalPadding-s.rowHeight[p]);var R;s.width-A>=h+s.horizontalPadding?R=(s.height+C)/(A+h+s.horizontalPadding):R=(s.height+C)/s.width,C=u+s.verticalPadding;var x;return s.width<h?x=(s.height+C)/h:x=(s.height+C)/s.width,x<1&&(x=1/x),R<1&&(R=1/R),R<x},d.prototype.shiftToLastRow=function(s){var h=this.getLongestRowIndex(s),u=s.rowWidth.length-1,p=s.rows[h],A=p[p.length-1],C=A.width+s.horizontalPadding;if(s.width-s.rowWidth[u]>C&&h!=u){p.splice(-1,1),s.rows[u].push(A),s.rowWidth[h]=s.rowWidth[h]-C,s.rowWidth[u]=s.rowWidth[u]+C,s.width=s.rowWidth[instance.getLongestRowIndex(s)];for(var R=Number.MIN_VALUE,x=0;x<p.length;x++)p[x].height>R&&(R=p[x].height);h>0&&(R+=s.verticalPadding);var _=s.rowHeight[h]+s.rowHeight[u];s.rowHeight[h]=R,s.rowHeight[u]<A.height+s.verticalPadding&&(s.rowHeight[u]=A.height+s.verticalPadding);var U=s.rowHeight[h]+s.rowHeight[u];s.height+=U-_,this.shiftToLastRow(s)}},d.prototype.tilingPreLayout=function(){a.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},d.prototype.tilingPostLayout=function(){a.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},d.prototype.reduceTrees=function(){for(var s=[],h=!0,u;h;){var p=this.graphManager.getAllNodes(),A=[];h=!1;for(var C=0;C<p.length;C++)u=p[C],u.getEdges().length==1&&!u.getEdges()[0].isInterGraph&&u.getChild()==null&&(A.push([u,u.getEdges()[0],u.getOwner()]),h=!0);if(h==!0){for(var R=[],x=0;x<A.length;x++)A[x][0].getEdges().length==1&&(R.push(A[x]),A[x][0].getOwner().remove(A[x][0]));s.push(R),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=s},d.prototype.growTree=function(s){for(var h=s.length,u=s[h-1],p,A=0;A<u.length;A++)p=u[A],this.findPlaceforPrunedNode(p),p[2].add(p[0]),p[2].add(p[1],p[1].source,p[1].target);s.splice(s.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},d.prototype.findPlaceforPrunedNode=function(s){var h,u,p=s[0];p==s[1].source?u=s[1].target:u=s[1].source;var A=u.startX,C=u.finishX,R=u.startY,x=u.finishY,_=0,U=0,X=0,M=0,G=[_,X,U,M];if(R>0)for(var F=A;F<=C;F++)G[0]+=this.grid[F][R-1].length+this.grid[F][R].length-1;if(C<this.grid.length-1)for(var F=R;F<=x;F++)G[1]+=this.grid[C+1][F].length+this.grid[C][F].length-1;if(x<this.grid[0].length-1)for(var F=A;F<=C;F++)G[2]+=this.grid[F][x+1].length+this.grid[F][x].length-1;if(A>0)for(var F=R;F<=x;F++)G[3]+=this.grid[A-1][F].length+this.grid[A][F].length-1;for(var b=T.MAX_VALUE,Y,k,H=0;H<G.length;H++)G[H]<b?(b=G[H],Y=1,k=H):G[H]==b&&Y++;if(Y==3&&b==0)G[0]==0&&G[1]==0&&G[2]==0?h=1:G[0]==0&&G[1]==0&&G[3]==0?h=0:G[0]==0&&G[2]==0&&G[3]==0?h=3:G[1]==0&&G[2]==0&&G[3]==0&&(h=2);else if(Y==2&&b==0){var P=Math.floor(Math.random()*2);G[0]==0&&G[1]==0?P==0?h=0:h=1:G[0]==0&&G[2]==0?P==0?h=0:h=2:G[0]==0&&G[3]==0?P==0?h=0:h=3:G[1]==0&&G[2]==0?P==0?h=1:h=2:G[1]==0&&G[3]==0?P==0?h=1:h=3:P==0?h=2:h=3}else if(Y==4&&b==0){var P=Math.floor(Math.random()*4);h=P}else h=k;h==0?p.setCenter(u.getCenterX(),u.getCenterY()-u.getHeight()/2-y.DEFAULT_EDGE_LENGTH-p.getHeight()/2):h==1?p.setCenter(u.getCenterX()+u.getWidth()/2+y.DEFAULT_EDGE_LENGTH+p.getWidth()/2,u.getCenterY()):h==2?p.setCenter(u.getCenterX(),u.getCenterY()+u.getHeight()/2+y.DEFAULT_EDGE_LENGTH+p.getHeight()/2):p.setCenter(u.getCenterX()-u.getWidth()/2-y.DEFAULT_EDGE_LENGTH-p.getWidth()/2,u.getCenterY())},D.exports=d},function(D,v,r){var t={};t.layoutBase=r(0),t.CoSEConstants=r(1),t.CoSEEdge=r(2),t.CoSEGraph=r(3),t.CoSEGraphManager=r(4),t.CoSELayout=r(6),t.CoSENode=r(5),D.exports=t}])})}(et)),et.exports}var _t=tt.exports,pt;function Ft(){return pt||(pt=1,function(I,w){(function(D,v){I.exports=v(Gt())})(_t,function(f){return function(D){var v={};function r(t){if(v[t])return v[t].exports;var e=v[t]={i:t,l:!1,exports:{}};return D[t].call(e.exports,e,e.exports,r),e.l=!0,e.exports}return r.m=D,r.c=v,r.i=function(t){return t},r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([function(D,v){D.exports=f},function(D,v,r){var t=r(0).layoutBase.LayoutConstants,e=r(0).layoutBase.FDLayoutConstants,i=r(0).CoSEConstants,o=r(0).CoSELayout,g=r(0).CoSENode,a=r(0).layoutBase.PointD,y=r(0).layoutBase.DimensionD,n={ready:function(){},stop:function(){},quality:"default",nodeDimensionsIncludeLabels:!1,refresh:30,fit:!0,padding:10,randomize:!0,nodeRepulsion:4500,idealEdgeLength:50,edgeElasticity:.45,nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,animate:"end",animationDuration:500,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.5};function c(m,L){var O={};for(var d in m)O[d]=m[d];for(var d in L)O[d]=L[d];return O}function l(m){this.options=c(n,m),E(this.options)}var E=function(L){L.nodeRepulsion!=null&&(i.DEFAULT_REPULSION_STRENGTH=e.DEFAULT_REPULSION_STRENGTH=L.nodeRepulsion),L.idealEdgeLength!=null&&(i.DEFAULT_EDGE_LENGTH=e.DEFAULT_EDGE_LENGTH=L.idealEdgeLength),L.edgeElasticity!=null&&(i.DEFAULT_SPRING_STRENGTH=e.DEFAULT_SPRING_STRENGTH=L.edgeElasticity),L.nestingFactor!=null&&(i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=e.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=L.nestingFactor),L.gravity!=null&&(i.DEFAULT_GRAVITY_STRENGTH=e.DEFAULT_GRAVITY_STRENGTH=L.gravity),L.numIter!=null&&(i.MAX_ITERATIONS=e.MAX_ITERATIONS=L.numIter),L.gravityRange!=null&&(i.DEFAULT_GRAVITY_RANGE_FACTOR=e.DEFAULT_GRAVITY_RANGE_FACTOR=L.gravityRange),L.gravityCompound!=null&&(i.DEFAULT_COMPOUND_GRAVITY_STRENGTH=e.DEFAULT_COMPOUND_GRAVITY_STRENGTH=L.gravityCompound),L.gravityRangeCompound!=null&&(i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=e.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=L.gravityRangeCompound),L.initialEnergyOnIncremental!=null&&(i.DEFAULT_COOLING_FACTOR_INCREMENTAL=e.DEFAULT_COOLING_FACTOR_INCREMENTAL=L.initialEnergyOnIncremental),L.quality=="draft"?t.QUALITY=0:L.quality=="proof"?t.QUALITY=2:t.QUALITY=1,i.NODE_DIMENSIONS_INCLUDE_LABELS=e.NODE_DIMENSIONS_INCLUDE_LABELS=t.NODE_DIMENSIONS_INCLUDE_LABELS=L.nodeDimensionsIncludeLabels,i.DEFAULT_INCREMENTAL=e.DEFAULT_INCREMENTAL=t.DEFAULT_INCREMENTAL=!L.randomize,i.ANIMATE=e.ANIMATE=t.ANIMATE=L.animate,i.TILE=L.tile,i.TILING_PADDING_VERTICAL=typeof L.tilingPaddingVertical=="function"?L.tilingPaddingVertical.call():L.tilingPaddingVertical,i.TILING_PADDING_HORIZONTAL=typeof L.tilingPaddingHorizontal=="function"?L.tilingPaddingHorizontal.call():L.tilingPaddingHorizontal};l.prototype.run=function(){var m,L,O=this.options;this.idToLNode={};var d=this.layout=new o,N=this;N.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:"layoutstart",layout:this});var s=d.newGraphManager();this.gm=s;var h=this.options.eles.nodes(),u=this.options.eles.edges();this.root=s.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(h),d);for(var p=0;p<u.length;p++){var A=u[p],C=this.idToLNode[A.data("source")],R=this.idToLNode[A.data("target")];if(C!==R&&C.getEdgesBetween(R).length==0){var x=s.add(d.newEdge(),C,R);x.id=A.id()}}var _=function(M,G){typeof M=="number"&&(M=G);var F=M.data("id"),b=N.idToLNode[F];return{x:b.getRect().getCenterX(),y:b.getRect().getCenterY()}},U=function X(){for(var M=function(){O.fit&&O.cy.fit(O.eles,O.padding),m||(m=!0,N.cy.one("layoutready",O.ready),N.cy.trigger({type:"layoutready",layout:N}))},G=N.options.refresh,F,b=0;b<G&&!F;b++)F=N.stopped||N.layout.tick();if(F){d.checkLayoutSuccess()&&!d.isSubLayout&&d.doPostLayout(),d.tilingPostLayout&&d.tilingPostLayout(),d.isLayoutFinished=!0,N.options.eles.nodes().positions(_),M(),N.cy.one("layoutstop",N.options.stop),N.cy.trigger({type:"layoutstop",layout:N}),L&&cancelAnimationFrame(L),m=!1;return}var Y=N.layout.getPositionsData();O.eles.nodes().positions(function(k,H){if(typeof k=="number"&&(k=H),!k.isParent()){for(var P=k.id(),B=Y[P],$=k;B==null&&(B=Y[$.data("parent")]||Y["DummyCompound_"+$.data("parent")],Y[P]=B,$=$.parent()[0],$!=null););return B!=null?{x:B.x,y:B.y}:{x:k.position("x"),y:k.position("y")}}}),M(),L=requestAnimationFrame(X)};return d.addListener("layoutstarted",function(){N.options.animate==="during"&&(L=requestAnimationFrame(U))}),d.runLayout(),this.options.animate!=="during"&&(N.options.eles.nodes().not(":parent").layoutPositions(N,N.options,_),m=!1),this},l.prototype.getTopMostNodes=function(m){for(var L={},O=0;O<m.length;O++)L[m[O].id()]=!0;var d=m.filter(function(N,s){typeof N=="number"&&(N=s);for(var h=N.parent()[0];h!=null;){if(L[h.id()])return!1;h=h.parent()[0]}return!0});return d},l.prototype.processChildrenList=function(m,L,O){for(var d=L.length,N=0;N<d;N++){var s=L[N],h=s.children(),u,p=s.layoutDimensions({nodeDimensionsIncludeLabels:this.options.nodeDimensionsIncludeLabels});if(s.outerWidth()!=null&&s.outerHeight()!=null?u=m.add(new g(O.graphManager,new a(s.position("x")-p.w/2,s.position("y")-p.h/2),new y(parseFloat(p.w),parseFloat(p.h)))):u=m.add(new g(this.graphManager)),u.id=s.data("id"),u.paddingLeft=parseInt(s.css("padding")),u.paddingTop=parseInt(s.css("padding")),u.paddingRight=parseInt(s.css("padding")),u.paddingBottom=parseInt(s.css("padding")),this.options.nodeDimensionsIncludeLabels&&s.isParent()){var A=s.boundingBox({includeLabels:!0,includeNodes:!1}).w,C=s.boundingBox({includeLabels:!0,includeNodes:!1}).h,R=s.css("text-halign");u.labelWidth=A,u.labelHeight=C,u.labelPos=R}if(this.idToLNode[s.data("id")]=u,isNaN(u.rect.x)&&(u.rect.x=0),isNaN(u.rect.y)&&(u.rect.y=0),h!=null&&h.length>0){var x;x=O.getGraphManager().add(O.newGraph(),u),this.processChildrenList(x,h,O)}}},l.prototype.stop=function(){return this.stopped=!0,this};var T=function(L){L("layout","cose-bilkent",l)};typeof cytoscape<"u"&&T(cytoscape),D.exports=T}])})}(tt)),tt.exports}var bt=Ft();const Ut=xt(bt);var at=function(){var I=S(function(O,d,N,s){for(N=N||{},s=O.length;s--;N[O[s]]=d);return N},"o"),w=[1,4],f=[1,13],D=[1,12],v=[1,15],r=[1,16],t=[1,20],e=[1,19],i=[6,7,8],o=[1,26],g=[1,24],a=[1,25],y=[6,7,11],n=[1,6,13,15,16,19,22],c=[1,33],l=[1,34],E=[1,6,7,11,13,15,16,19,22],T={trace:S(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:S(function(d,N,s,h,u,p,A){var C=p.length-1;switch(u){case 6:case 7:return h;case 8:h.getLogger().trace("Stop NL ");break;case 9:h.getLogger().trace("Stop EOF ");break;case 11:h.getLogger().trace("Stop NL2 ");break;case 12:h.getLogger().trace("Stop EOF2 ");break;case 15:h.getLogger().info("Node: ",p[C].id),h.addNode(p[C-1].length,p[C].id,p[C].descr,p[C].type);break;case 16:h.getLogger().trace("Icon: ",p[C]),h.decorateNode({icon:p[C]});break;case 17:case 21:h.decorateNode({class:p[C]});break;case 18:h.getLogger().trace("SPACELIST");break;case 19:h.getLogger().trace("Node: ",p[C].id),h.addNode(0,p[C].id,p[C].descr,p[C].type);break;case 20:h.decorateNode({icon:p[C]});break;case 25:h.getLogger().trace("node found ..",p[C-2]),this.$={id:p[C-1],descr:p[C-1],type:h.getType(p[C-2],p[C])};break;case 26:this.$={id:p[C],descr:p[C],type:h.nodeType.DEFAULT};break;case 27:h.getLogger().trace("node found ..",p[C-3]),this.$={id:p[C-3],descr:p[C-1],type:h.getType(p[C-2],p[C])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:w},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:w},{6:f,7:[1,10],9:9,12:11,13:D,14:14,15:v,16:r,17:17,18:18,19:t,22:e},I(i,[2,3]),{1:[2,2]},I(i,[2,4]),I(i,[2,5]),{1:[2,6],6:f,12:21,13:D,14:14,15:v,16:r,17:17,18:18,19:t,22:e},{6:f,9:22,12:11,13:D,14:14,15:v,16:r,17:17,18:18,19:t,22:e},{6:o,7:g,10:23,11:a},I(y,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:t,22:e}),I(y,[2,18]),I(y,[2,19]),I(y,[2,20]),I(y,[2,21]),I(y,[2,23]),I(y,[2,24]),I(y,[2,26],{19:[1,30]}),{20:[1,31]},{6:o,7:g,10:32,11:a},{1:[2,7],6:f,12:21,13:D,14:14,15:v,16:r,17:17,18:18,19:t,22:e},I(n,[2,14],{7:c,11:l}),I(E,[2,8]),I(E,[2,9]),I(E,[2,10]),I(y,[2,15]),I(y,[2,16]),I(y,[2,17]),{20:[1,35]},{21:[1,36]},I(n,[2,13],{7:c,11:l}),I(E,[2,11]),I(E,[2,12]),{21:[1,37]},I(y,[2,25]),I(y,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:S(function(d,N){if(N.recoverable)this.trace(d);else{var s=new Error(d);throw s.hash=N,s}},"parseError"),parse:S(function(d){var N=this,s=[0],h=[],u=[null],p=[],A=this.table,C="",R=0,x=0,_=2,U=1,X=p.slice.call(arguments,1),M=Object.create(this.lexer),G={yy:{}};for(var F in this.yy)Object.prototype.hasOwnProperty.call(this.yy,F)&&(G.yy[F]=this.yy[F]);M.setInput(d,G.yy),G.yy.lexer=M,G.yy.parser=this,typeof M.yylloc>"u"&&(M.yylloc={});var b=M.yylloc;p.push(b);var Y=M.options&&M.options.ranges;typeof G.yy.parseError=="function"?this.parseError=G.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function k(V){s.length=s.length-2*V,u.length=u.length-V,p.length=p.length-V}S(k,"popStack");function H(){var V;return V=h.pop()||M.lex()||U,typeof V!="number"&&(V instanceof Array&&(h=V,V=h.pop()),V=N.symbols_[V]||V),V}S(H,"lex");for(var P,B,$,K,Q={},q,j,gt,J;;){if(B=s[s.length-1],this.defaultActions[B]?$=this.defaultActions[B]:((P===null||typeof P>"u")&&(P=H()),$=A[B]&&A[B][P]),typeof $>"u"||!$.length||!$[0]){var st="";J=[];for(q in A[B])this.terminals_[q]&&q>_&&J.push("'"+this.terminals_[q]+"'");M.showPosition?st="Parse error on line "+(R+1)+`:
|
|
1
|
+
import{_ as S,l as z,c as ot,K as Nt,V as mt,H as it,i as nt,W as Dt,X as Ot,Y as At,d as It,a5 as Ct,Q as Rt}from"./mermaid.core-CC8CflzC.js";import{c as dt}from"./cytoscape.esm-DHvQc-Lm.js";import{g as xt}from"./index-Dn3kYWFt.js";import"./index-COUHPq03.js";import"./aida-control-BuMafqCb.js";import"./ui-preferences-store-BmAT9G_p.js";import"./textarea-DsHM-W2p.js";import"./error-boundary-CdtTgj_c.js";import"./console-mirror-45f9-7QH.js";var tt={exports:{}},et={exports:{}},rt={exports:{}},Mt=rt.exports,ut;function wt(){return ut||(ut=1,function(I,w){(function(D,v){I.exports=v()})(Mt,function(){return function(f){var D={};function v(r){if(D[r])return D[r].exports;var t=D[r]={i:r,l:!1,exports:{}};return f[r].call(t.exports,t,t.exports,v),t.l=!0,t.exports}return v.m=f,v.c=D,v.i=function(r){return r},v.d=function(r,t,e){v.o(r,t)||Object.defineProperty(r,t,{configurable:!1,enumerable:!0,get:e})},v.n=function(r){var t=r&&r.__esModule?function(){return r.default}:function(){return r};return v.d(t,"a",t),t},v.o=function(r,t){return Object.prototype.hasOwnProperty.call(r,t)},v.p="",v(v.s=26)}([function(f,D,v){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,f.exports=r},function(f,D,v){var r=v(2),t=v(8),e=v(9);function i(g,a,y){r.call(this,y),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=y,this.bendpoints=[],this.source=g,this.target=a}i.prototype=Object.create(r.prototype);for(var o in r)i[o]=r[o];i.prototype.getSource=function(){return this.source},i.prototype.getTarget=function(){return this.target},i.prototype.isInterGraph=function(){return this.isInterGraph},i.prototype.getLength=function(){return this.length},i.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},i.prototype.getBendpoints=function(){return this.bendpoints},i.prototype.getLca=function(){return this.lca},i.prototype.getSourceInLca=function(){return this.sourceInLca},i.prototype.getTargetInLca=function(){return this.targetInLca},i.prototype.getOtherEnd=function(g){if(this.source===g)return this.target;if(this.target===g)return this.source;throw"Node is not incident with this edge"},i.prototype.getOtherEndInGraph=function(g,a){for(var y=this.getOtherEnd(g),n=a.getGraphManager().getRoot();;){if(y.getOwner()==a)return y;if(y.getOwner()==n)break;y=y.getOwner().getParent()}return null},i.prototype.updateLength=function(){var g=new Array(4);this.isOverlapingSourceAndTarget=t.getIntersection(this.target.getRect(),this.source.getRect(),g),this.isOverlapingSourceAndTarget||(this.lengthX=g[0]-g[2],this.lengthY=g[1]-g[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))},i.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)},f.exports=i},function(f,D,v){function r(t){this.vGraphObject=t}f.exports=r},function(f,D,v){var r=v(2),t=v(10),e=v(13),i=v(0),o=v(16),g=v(4);function a(n,c,l,E){l==null&&E==null&&(E=c),r.call(this,E),n.graphManager!=null&&(n=n.graphManager),this.estimatedSize=t.MIN_VALUE,this.inclusionTreeDepth=t.MAX_VALUE,this.vGraphObject=E,this.edges=[],this.graphManager=n,l!=null&&c!=null?this.rect=new e(c.x,c.y,l.width,l.height):this.rect=new e}a.prototype=Object.create(r.prototype);for(var y in r)a[y]=r[y];a.prototype.getEdges=function(){return this.edges},a.prototype.getChild=function(){return this.child},a.prototype.getOwner=function(){return this.owner},a.prototype.getWidth=function(){return this.rect.width},a.prototype.setWidth=function(n){this.rect.width=n},a.prototype.getHeight=function(){return this.rect.height},a.prototype.setHeight=function(n){this.rect.height=n},a.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},a.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},a.prototype.getCenter=function(){return new g(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},a.prototype.getLocation=function(){return new g(this.rect.x,this.rect.y)},a.prototype.getRect=function(){return this.rect},a.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},a.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},a.prototype.setRect=function(n,c){this.rect.x=n.x,this.rect.y=n.y,this.rect.width=c.width,this.rect.height=c.height},a.prototype.setCenter=function(n,c){this.rect.x=n-this.rect.width/2,this.rect.y=c-this.rect.height/2},a.prototype.setLocation=function(n,c){this.rect.x=n,this.rect.y=c},a.prototype.moveBy=function(n,c){this.rect.x+=n,this.rect.y+=c},a.prototype.getEdgeListToNode=function(n){var c=[],l=this;return l.edges.forEach(function(E){if(E.target==n){if(E.source!=l)throw"Incorrect edge source!";c.push(E)}}),c},a.prototype.getEdgesBetween=function(n){var c=[],l=this;return l.edges.forEach(function(E){if(!(E.source==l||E.target==l))throw"Incorrect edge source and/or target";(E.target==n||E.source==n)&&c.push(E)}),c},a.prototype.getNeighborsList=function(){var n=new Set,c=this;return c.edges.forEach(function(l){if(l.source==c)n.add(l.target);else{if(l.target!=c)throw"Incorrect incidency!";n.add(l.source)}}),n},a.prototype.withChildren=function(){var n=new Set,c,l;if(n.add(this),this.child!=null)for(var E=this.child.getNodes(),T=0;T<E.length;T++)c=E[T],l=c.withChildren(),l.forEach(function(m){n.add(m)});return n},a.prototype.getNoOfChildren=function(){var n=0,c;if(this.child==null)n=1;else for(var l=this.child.getNodes(),E=0;E<l.length;E++)c=l[E],n+=c.getNoOfChildren();return n==0&&(n=1),n},a.prototype.getEstimatedSize=function(){if(this.estimatedSize==t.MIN_VALUE)throw"assert failed";return this.estimatedSize},a.prototype.calcEstimatedSize=function(){return this.child==null?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},a.prototype.scatter=function(){var n,c,l=-i.INITIAL_WORLD_BOUNDARY,E=i.INITIAL_WORLD_BOUNDARY;n=i.WORLD_CENTER_X+o.nextDouble()*(E-l)+l;var T=-i.INITIAL_WORLD_BOUNDARY,m=i.INITIAL_WORLD_BOUNDARY;c=i.WORLD_CENTER_Y+o.nextDouble()*(m-T)+T,this.rect.x=n,this.rect.y=c},a.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var n=this.getChild();if(n.updateBounds(!0),this.rect.x=n.getLeft(),this.rect.y=n.getTop(),this.setWidth(n.getRight()-n.getLeft()),this.setHeight(n.getBottom()-n.getTop()),i.NODE_DIMENSIONS_INCLUDE_LABELS){var c=n.getRight()-n.getLeft(),l=n.getBottom()-n.getTop();this.labelWidth>c&&(this.rect.x-=(this.labelWidth-c)/2,this.setWidth(this.labelWidth)),this.labelHeight>l&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-l)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-l),this.setHeight(this.labelHeight))}}},a.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==t.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},a.prototype.transform=function(n){var c=this.rect.x;c>i.WORLD_BOUNDARY?c=i.WORLD_BOUNDARY:c<-i.WORLD_BOUNDARY&&(c=-i.WORLD_BOUNDARY);var l=this.rect.y;l>i.WORLD_BOUNDARY?l=i.WORLD_BOUNDARY:l<-i.WORLD_BOUNDARY&&(l=-i.WORLD_BOUNDARY);var E=new g(c,l),T=n.inverseTransformPoint(E);this.setLocation(T.x,T.y)},a.prototype.getLeft=function(){return this.rect.x},a.prototype.getRight=function(){return this.rect.x+this.rect.width},a.prototype.getTop=function(){return this.rect.y},a.prototype.getBottom=function(){return this.rect.y+this.rect.height},a.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},f.exports=a},function(f,D,v){function r(t,e){t==null&&e==null?(this.x=0,this.y=0):(this.x=t,this.y=e)}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},f.exports=r},function(f,D,v){var r=v(2),t=v(10),e=v(0),i=v(6),o=v(3),g=v(1),a=v(13),y=v(12),n=v(11);function c(E,T,m){r.call(this,m),this.estimatedSize=t.MIN_VALUE,this.margin=e.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=E,T!=null&&T instanceof i?this.graphManager=T:T!=null&&T instanceof Layout&&(this.graphManager=T.graphManager)}c.prototype=Object.create(r.prototype);for(var l in r)c[l]=r[l];c.prototype.getNodes=function(){return this.nodes},c.prototype.getEdges=function(){return this.edges},c.prototype.getGraphManager=function(){return this.graphManager},c.prototype.getParent=function(){return this.parent},c.prototype.getLeft=function(){return this.left},c.prototype.getRight=function(){return this.right},c.prototype.getTop=function(){return this.top},c.prototype.getBottom=function(){return this.bottom},c.prototype.isConnected=function(){return this.isConnected},c.prototype.add=function(E,T,m){if(T==null&&m==null){var L=E;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(L)>-1)throw"Node already in graph!";return L.owner=this,this.getNodes().push(L),L}else{var O=E;if(!(this.getNodes().indexOf(T)>-1&&this.getNodes().indexOf(m)>-1))throw"Source or target not in graph!";if(!(T.owner==m.owner&&T.owner==this))throw"Both owners must be this graph!";return T.owner!=m.owner?null:(O.source=T,O.target=m,O.isInterGraph=!1,this.getEdges().push(O),T.edges.push(O),m!=T&&m.edges.push(O),O)}},c.prototype.remove=function(E){var T=E;if(E instanceof o){if(T==null)throw"Node is null!";if(!(T.owner!=null&&T.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var m=T.edges.slice(),L,O=m.length,d=0;d<O;d++)L=m[d],L.isInterGraph?this.graphManager.remove(L):L.source.owner.remove(L);var N=this.nodes.indexOf(T);if(N==-1)throw"Node not in owner node list!";this.nodes.splice(N,1)}else if(E instanceof g){var L=E;if(L==null)throw"Edge is null!";if(!(L.source!=null&&L.target!=null))throw"Source and/or target is null!";if(!(L.source.owner!=null&&L.target.owner!=null&&L.source.owner==this&&L.target.owner==this))throw"Source and/or target owner is invalid!";var s=L.source.edges.indexOf(L),h=L.target.edges.indexOf(L);if(!(s>-1&&h>-1))throw"Source and/or target doesn't know this edge!";L.source.edges.splice(s,1),L.target!=L.source&&L.target.edges.splice(h,1);var N=L.source.owner.getEdges().indexOf(L);if(N==-1)throw"Not in owner's edge list!";L.source.owner.getEdges().splice(N,1)}},c.prototype.updateLeftTop=function(){for(var E=t.MAX_VALUE,T=t.MAX_VALUE,m,L,O,d=this.getNodes(),N=d.length,s=0;s<N;s++){var h=d[s];m=h.getTop(),L=h.getLeft(),E>m&&(E=m),T>L&&(T=L)}return E==t.MAX_VALUE?null:(d[0].getParent().paddingLeft!=null?O=d[0].getParent().paddingLeft:O=this.margin,this.left=T-O,this.top=E-O,new y(this.left,this.top))},c.prototype.updateBounds=function(E){for(var T=t.MAX_VALUE,m=-t.MAX_VALUE,L=t.MAX_VALUE,O=-t.MAX_VALUE,d,N,s,h,u,p=this.nodes,A=p.length,C=0;C<A;C++){var R=p[C];E&&R.child!=null&&R.updateBounds(),d=R.getLeft(),N=R.getRight(),s=R.getTop(),h=R.getBottom(),T>d&&(T=d),m<N&&(m=N),L>s&&(L=s),O<h&&(O=h)}var x=new a(T,L,m-T,O-L);T==t.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),p[0].getParent().paddingLeft!=null?u=p[0].getParent().paddingLeft:u=this.margin,this.left=x.x-u,this.right=x.x+x.width+u,this.top=x.y-u,this.bottom=x.y+x.height+u},c.calculateBounds=function(E){for(var T=t.MAX_VALUE,m=-t.MAX_VALUE,L=t.MAX_VALUE,O=-t.MAX_VALUE,d,N,s,h,u=E.length,p=0;p<u;p++){var A=E[p];d=A.getLeft(),N=A.getRight(),s=A.getTop(),h=A.getBottom(),T>d&&(T=d),m<N&&(m=N),L>s&&(L=s),O<h&&(O=h)}var C=new a(T,L,m-T,O-L);return C},c.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},c.prototype.getEstimatedSize=function(){if(this.estimatedSize==t.MIN_VALUE)throw"assert failed";return this.estimatedSize},c.prototype.calcEstimatedSize=function(){for(var E=0,T=this.nodes,m=T.length,L=0;L<m;L++){var O=T[L];E+=O.calcEstimatedSize()}return E==0?this.estimatedSize=e.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=E/Math.sqrt(this.nodes.length),this.estimatedSize},c.prototype.updateConnected=function(){var E=this;if(this.nodes.length==0){this.isConnected=!0;return}var T=new n,m=new Set,L=this.nodes[0],O,d,N=L.withChildren();for(N.forEach(function(C){T.push(C),m.add(C)});T.length!==0;){L=T.shift(),O=L.getEdges();for(var s=O.length,h=0;h<s;h++){var u=O[h];if(d=u.getOtherEndInGraph(L,this),d!=null&&!m.has(d)){var p=d.withChildren();p.forEach(function(C){T.push(C),m.add(C)})}}}if(this.isConnected=!1,m.size>=this.nodes.length){var A=0;m.forEach(function(C){C.owner==E&&A++}),A==this.nodes.length&&(this.isConnected=!0)}},f.exports=c},function(f,D,v){var r,t=v(1);function e(i){r=v(5),this.layout=i,this.graphs=[],this.edges=[]}e.prototype.addRoot=function(){var i=this.layout.newGraph(),o=this.layout.newNode(null),g=this.add(i,o);return this.setRootGraph(g),this.rootGraph},e.prototype.add=function(i,o,g,a,y){if(g==null&&a==null&&y==null){if(i==null)throw"Graph is null!";if(o==null)throw"Parent node is null!";if(this.graphs.indexOf(i)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(i),i.parent!=null)throw"Already has a parent!";if(o.child!=null)throw"Already has a child!";return i.parent=o,o.child=i,i}else{y=g,a=o,g=i;var n=a.getOwner(),c=y.getOwner();if(!(n!=null&&n.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(c!=null&&c.getGraphManager()==this))throw"Target not in this graph mgr!";if(n==c)return g.isInterGraph=!1,n.add(g,a,y);if(g.isInterGraph=!0,g.source=a,g.target=y,this.edges.indexOf(g)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(g),!(g.source!=null&&g.target!=null))throw"Edge source and/or target is null!";if(!(g.source.edges.indexOf(g)==-1&&g.target.edges.indexOf(g)==-1))throw"Edge already in source and/or target incidency list!";return g.source.edges.push(g),g.target.edges.push(g),g}},e.prototype.remove=function(i){if(i instanceof r){var o=i;if(o.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(o==this.rootGraph||o.parent!=null&&o.parent.graphManager==this))throw"Invalid parent node!";var g=[];g=g.concat(o.getEdges());for(var a,y=g.length,n=0;n<y;n++)a=g[n],o.remove(a);var c=[];c=c.concat(o.getNodes());var l;y=c.length;for(var n=0;n<y;n++)l=c[n],o.remove(l);o==this.rootGraph&&this.setRootGraph(null);var E=this.graphs.indexOf(o);this.graphs.splice(E,1),o.parent=null}else if(i instanceof t){if(a=i,a==null)throw"Edge is null!";if(!a.isInterGraph)throw"Not an inter-graph edge!";if(!(a.source!=null&&a.target!=null))throw"Source and/or target is null!";if(!(a.source.edges.indexOf(a)!=-1&&a.target.edges.indexOf(a)!=-1))throw"Source and/or target doesn't know this edge!";var E=a.source.edges.indexOf(a);if(a.source.edges.splice(E,1),E=a.target.edges.indexOf(a),a.target.edges.splice(E,1),!(a.source.owner!=null&&a.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(a.source.owner.getGraphManager().edges.indexOf(a)==-1)throw"Not in owner graph manager's edge list!";var E=a.source.owner.getGraphManager().edges.indexOf(a);a.source.owner.getGraphManager().edges.splice(E,1)}},e.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},e.prototype.getGraphs=function(){return this.graphs},e.prototype.getAllNodes=function(){if(this.allNodes==null){for(var i=[],o=this.getGraphs(),g=o.length,a=0;a<g;a++)i=i.concat(o[a].getNodes());this.allNodes=i}return this.allNodes},e.prototype.resetAllNodes=function(){this.allNodes=null},e.prototype.resetAllEdges=function(){this.allEdges=null},e.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},e.prototype.getAllEdges=function(){if(this.allEdges==null){var i=[],o=this.getGraphs();o.length;for(var g=0;g<o.length;g++)i=i.concat(o[g].getEdges());i=i.concat(this.edges),this.allEdges=i}return this.allEdges},e.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},e.prototype.setAllNodesToApplyGravitation=function(i){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=i},e.prototype.getRoot=function(){return this.rootGraph},e.prototype.setRootGraph=function(i){if(i.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=i,i.parent==null&&(i.parent=this.layout.newNode("Root node"))},e.prototype.getLayout=function(){return this.layout},e.prototype.isOneAncestorOfOther=function(i,o){if(!(i!=null&&o!=null))throw"assert failed";if(i==o)return!0;var g=i.getOwner(),a;do{if(a=g.getParent(),a==null)break;if(a==o)return!0;if(g=a.getOwner(),g==null)break}while(!0);g=o.getOwner();do{if(a=g.getParent(),a==null)break;if(a==i)return!0;if(g=a.getOwner(),g==null)break}while(!0);return!1},e.prototype.calcLowestCommonAncestors=function(){for(var i,o,g,a,y,n=this.getAllEdges(),c=n.length,l=0;l<c;l++){if(i=n[l],o=i.source,g=i.target,i.lca=null,i.sourceInLca=o,i.targetInLca=g,o==g){i.lca=o.getOwner();continue}for(a=o.getOwner();i.lca==null;){for(i.targetInLca=g,y=g.getOwner();i.lca==null;){if(y==a){i.lca=y;break}if(y==this.rootGraph)break;if(i.lca!=null)throw"assert failed";i.targetInLca=y.getParent(),y=i.targetInLca.getOwner()}if(a==this.rootGraph)break;i.lca==null&&(i.sourceInLca=a.getParent(),a=i.sourceInLca.getOwner())}if(i.lca==null)throw"assert failed"}},e.prototype.calcLowestCommonAncestor=function(i,o){if(i==o)return i.getOwner();var g=i.getOwner();do{if(g==null)break;var a=o.getOwner();do{if(a==null)break;if(a==g)return a;a=a.getParent().getOwner()}while(!0);g=g.getParent().getOwner()}while(!0);return g},e.prototype.calcInclusionTreeDepths=function(i,o){i==null&&o==null&&(i=this.rootGraph,o=1);for(var g,a=i.getNodes(),y=a.length,n=0;n<y;n++)g=a[n],g.inclusionTreeDepth=o,g.child!=null&&this.calcInclusionTreeDepths(g.child,o+1)},e.prototype.includesInvalidEdge=function(){for(var i,o=this.edges.length,g=0;g<o;g++)if(i=this.edges[g],this.isOneAncestorOfOther(i.source,i.target))return!0;return!1},f.exports=e},function(f,D,v){var r=v(0);function t(){}for(var e in r)t[e]=r[e];t.MAX_ITERATIONS=2500,t.DEFAULT_EDGE_LENGTH=50,t.DEFAULT_SPRING_STRENGTH=.45,t.DEFAULT_REPULSION_STRENGTH=4500,t.DEFAULT_GRAVITY_STRENGTH=.4,t.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,t.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,t.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,t.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,t.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,t.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,t.COOLING_ADAPTATION_FACTOR=.33,t.ADAPTATION_LOWER_NODE_LIMIT=1e3,t.ADAPTATION_UPPER_NODE_LIMIT=5e3,t.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,t.MAX_NODE_DISPLACEMENT=t.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,t.MIN_REPULSION_DIST=t.DEFAULT_EDGE_LENGTH/10,t.CONVERGENCE_CHECK_PERIOD=100,t.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,t.MIN_EDGE_LENGTH=1,t.GRID_CALCULATION_CHECK_PERIOD=10,f.exports=t},function(f,D,v){var r=v(12);function t(){}t.calcSeparationAmount=function(e,i,o,g){if(!e.intersects(i))throw"assert failed";var a=new Array(2);this.decideDirectionsForOverlappingNodes(e,i,a),o[0]=Math.min(e.getRight(),i.getRight())-Math.max(e.x,i.x),o[1]=Math.min(e.getBottom(),i.getBottom())-Math.max(e.y,i.y),e.getX()<=i.getX()&&e.getRight()>=i.getRight()?o[0]+=Math.min(i.getX()-e.getX(),e.getRight()-i.getRight()):i.getX()<=e.getX()&&i.getRight()>=e.getRight()&&(o[0]+=Math.min(e.getX()-i.getX(),i.getRight()-e.getRight())),e.getY()<=i.getY()&&e.getBottom()>=i.getBottom()?o[1]+=Math.min(i.getY()-e.getY(),e.getBottom()-i.getBottom()):i.getY()<=e.getY()&&i.getBottom()>=e.getBottom()&&(o[1]+=Math.min(e.getY()-i.getY(),i.getBottom()-e.getBottom()));var y=Math.abs((i.getCenterY()-e.getCenterY())/(i.getCenterX()-e.getCenterX()));i.getCenterY()===e.getCenterY()&&i.getCenterX()===e.getCenterX()&&(y=1);var n=y*o[0],c=o[1]/y;o[0]<c?c=o[0]:n=o[1],o[0]=-1*a[0]*(c/2+g),o[1]=-1*a[1]*(n/2+g)},t.decideDirectionsForOverlappingNodes=function(e,i,o){e.getCenterX()<i.getCenterX()?o[0]=-1:o[0]=1,e.getCenterY()<i.getCenterY()?o[1]=-1:o[1]=1},t.getIntersection2=function(e,i,o){var g=e.getCenterX(),a=e.getCenterY(),y=i.getCenterX(),n=i.getCenterY();if(e.intersects(i))return o[0]=g,o[1]=a,o[2]=y,o[3]=n,!0;var c=e.getX(),l=e.getY(),E=e.getRight(),T=e.getX(),m=e.getBottom(),L=e.getRight(),O=e.getWidthHalf(),d=e.getHeightHalf(),N=i.getX(),s=i.getY(),h=i.getRight(),u=i.getX(),p=i.getBottom(),A=i.getRight(),C=i.getWidthHalf(),R=i.getHeightHalf(),x=!1,_=!1;if(g===y){if(a>n)return o[0]=g,o[1]=l,o[2]=y,o[3]=p,!1;if(a<n)return o[0]=g,o[1]=m,o[2]=y,o[3]=s,!1}else if(a===n){if(g>y)return o[0]=c,o[1]=a,o[2]=h,o[3]=n,!1;if(g<y)return o[0]=E,o[1]=a,o[2]=N,o[3]=n,!1}else{var U=e.height/e.width,X=i.height/i.width,M=(n-a)/(y-g),G=void 0,F=void 0,b=void 0,Y=void 0,k=void 0,H=void 0;if(-U===M?g>y?(o[0]=T,o[1]=m,x=!0):(o[0]=E,o[1]=l,x=!0):U===M&&(g>y?(o[0]=c,o[1]=l,x=!0):(o[0]=L,o[1]=m,x=!0)),-X===M?y>g?(o[2]=u,o[3]=p,_=!0):(o[2]=h,o[3]=s,_=!0):X===M&&(y>g?(o[2]=N,o[3]=s,_=!0):(o[2]=A,o[3]=p,_=!0)),x&&_)return!1;if(g>y?a>n?(G=this.getCardinalDirection(U,M,4),F=this.getCardinalDirection(X,M,2)):(G=this.getCardinalDirection(-U,M,3),F=this.getCardinalDirection(-X,M,1)):a>n?(G=this.getCardinalDirection(-U,M,1),F=this.getCardinalDirection(-X,M,3)):(G=this.getCardinalDirection(U,M,2),F=this.getCardinalDirection(X,M,4)),!x)switch(G){case 1:Y=l,b=g+-d/M,o[0]=b,o[1]=Y;break;case 2:b=L,Y=a+O*M,o[0]=b,o[1]=Y;break;case 3:Y=m,b=g+d/M,o[0]=b,o[1]=Y;break;case 4:b=T,Y=a+-O*M,o[0]=b,o[1]=Y;break}if(!_)switch(F){case 1:H=s,k=y+-R/M,o[2]=k,o[3]=H;break;case 2:k=A,H=n+C*M,o[2]=k,o[3]=H;break;case 3:H=p,k=y+R/M,o[2]=k,o[3]=H;break;case 4:k=u,H=n+-C*M,o[2]=k,o[3]=H;break}}return!1},t.getCardinalDirection=function(e,i,o){return e>i?o:1+o%4},t.getIntersection=function(e,i,o,g){if(g==null)return this.getIntersection2(e,i,o);var a=e.x,y=e.y,n=i.x,c=i.y,l=o.x,E=o.y,T=g.x,m=g.y,L=void 0,O=void 0,d=void 0,N=void 0,s=void 0,h=void 0,u=void 0,p=void 0,A=void 0;return d=c-y,s=a-n,u=n*y-a*c,N=m-E,h=l-T,p=T*E-l*m,A=d*h-N*s,A===0?null:(L=(s*p-h*u)/A,O=(N*u-d*p)/A,new r(L,O))},t.angleOfVector=function(e,i,o,g){var a=void 0;return e!==o?(a=Math.atan((g-i)/(o-e)),o<e?a+=Math.PI:g<i&&(a+=this.TWO_PI)):g<i?a=this.ONE_AND_HALF_PI:a=this.HALF_PI,a},t.doIntersect=function(e,i,o,g){var a=e.x,y=e.y,n=i.x,c=i.y,l=o.x,E=o.y,T=g.x,m=g.y,L=(n-a)*(m-E)-(T-l)*(c-y);if(L===0)return!1;var O=((m-E)*(T-a)+(l-T)*(m-y))/L,d=((y-c)*(T-a)+(n-a)*(m-y))/L;return 0<O&&O<1&&0<d&&d<1},t.HALF_PI=.5*Math.PI,t.ONE_AND_HALF_PI=1.5*Math.PI,t.TWO_PI=2*Math.PI,t.THREE_PI=3*Math.PI,f.exports=t},function(f,D,v){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)},f.exports=r},function(f,D,v){function r(){}r.MAX_VALUE=2147483647,r.MIN_VALUE=-2147483648,f.exports=r},function(f,D,v){var r=function(){function a(y,n){for(var c=0;c<n.length;c++){var l=n[c];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(y,l.key,l)}}return function(y,n,c){return n&&a(y.prototype,n),c&&a(y,c),y}}();function t(a,y){if(!(a instanceof y))throw new TypeError("Cannot call a class as a function")}var e=function(y){return{value:y,next:null,prev:null}},i=function(y,n,c,l){return y!==null?y.next=n:l.head=n,c!==null?c.prev=n:l.tail=n,n.prev=y,n.next=c,l.length++,n},o=function(y,n){var c=y.prev,l=y.next;return c!==null?c.next=l:n.head=l,l!==null?l.prev=c:n.tail=c,y.prev=y.next=null,n.length--,y},g=function(){function a(y){var n=this;t(this,a),this.length=0,this.head=null,this.tail=null,y?.forEach(function(c){return n.push(c)})}return r(a,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(n,c){return i(c.prev,e(n),c,this)}},{key:"insertAfter",value:function(n,c){return i(c,e(n),c.next,this)}},{key:"insertNodeBefore",value:function(n,c){return i(c.prev,n,c,this)}},{key:"insertNodeAfter",value:function(n,c){return i(c,n,c.next,this)}},{key:"push",value:function(n){return i(this.tail,e(n),null,this)}},{key:"unshift",value:function(n){return i(null,e(n),this.head,this)}},{key:"remove",value:function(n){return o(n,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(n){if(n<=this.length()){for(var c=1,l=this.head;c<n;)l=l.next,c++;return l.value}}},{key:"set_object_at",value:function(n,c){if(n<=this.length()){for(var l=1,E=this.head;l<n;)E=E.next,l++;E.value=c}}}]),a}();f.exports=g},function(f,D,v){function r(t,e,i){this.x=null,this.y=null,t==null&&e==null&&i==null?(this.x=0,this.y=0):typeof t=="number"&&typeof e=="number"&&i==null?(this.x=t,this.y=e):t.constructor.name=="Point"&&e==null&&i==null&&(i=t,this.x=i.x,this.y=i.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,e,i){t.constructor.name=="Point"&&e==null&&i==null?(i=t,this.setLocation(i.x,i.y)):typeof t=="number"&&typeof e=="number"&&i==null&&(parseInt(t)==t&&parseInt(e)==e?this.move(t,e):(this.x=Math.floor(t+.5),this.y=Math.floor(e+.5)))},r.prototype.move=function(t,e){this.x=t,this.y=e},r.prototype.translate=function(t,e){this.x+=t,this.y+=e},r.prototype.equals=function(t){if(t.constructor.name=="Point"){var e=t;return this.x==e.x&&this.y==e.y}return this==t},r.prototype.toString=function(){return new r().constructor.name+"[x="+this.x+",y="+this.y+"]"},f.exports=r},function(f,D,v){function r(t,e,i,o){this.x=0,this.y=0,this.width=0,this.height=0,t!=null&&e!=null&&i!=null&&o!=null&&(this.x=t,this.y=e,this.width=i,this.height=o)}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},f.exports=r},function(f,D,v){var r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function t(){}t.lastID=0,t.createID=function(e){return t.isPrimitive(e)?e:(e.uniqueID!=null||(e.uniqueID=t.getString(),t.lastID++),e.uniqueID)},t.getString=function(e){return e==null&&(e=t.lastID),"Object#"+e},t.isPrimitive=function(e){var i=typeof e>"u"?"undefined":r(e);return e==null||i!="object"&&i!="function"},f.exports=t},function(f,D,v){function r(l){if(Array.isArray(l)){for(var E=0,T=Array(l.length);E<l.length;E++)T[E]=l[E];return T}else return Array.from(l)}var t=v(0),e=v(6),i=v(3),o=v(1),g=v(5),a=v(4),y=v(17),n=v(27);function c(l){n.call(this),this.layoutQuality=t.QUALITY,this.createBendsAsNeeded=t.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=t.DEFAULT_INCREMENTAL,this.animationOnLayout=t.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=t.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=t.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=t.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new e(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,l!=null&&(this.isRemoteUse=l)}c.RANDOM_SEED=1,c.prototype=Object.create(n.prototype),c.prototype.getGraphManager=function(){return this.graphManager},c.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},c.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},c.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},c.prototype.newGraphManager=function(){var l=new e(this);return this.graphManager=l,l},c.prototype.newGraph=function(l){return new g(null,this.graphManager,l)},c.prototype.newNode=function(l){return new i(this.graphManager,l)},c.prototype.newEdge=function(l){return new o(null,null,l)},c.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},c.prototype.runLayout=function(){this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters();var l;return this.checkLayoutSuccess()?l=!1:l=this.layout(),t.ANIMATE==="during"?!1:(l&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,l)},c.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},c.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var l=this.graphManager.getAllEdges(),E=0;E<l.length;E++)l[E];for(var T=this.graphManager.getRoot().getNodes(),E=0;E<T.length;E++)T[E];this.update(this.graphManager.getRoot())}},c.prototype.update=function(l){if(l==null)this.update2();else if(l instanceof i){var E=l;if(E.getChild()!=null)for(var T=E.getChild().getNodes(),m=0;m<T.length;m++)update(T[m]);if(E.vGraphObject!=null){var L=E.vGraphObject;L.update(E)}}else if(l instanceof o){var O=l;if(O.vGraphObject!=null){var d=O.vGraphObject;d.update(O)}}else if(l instanceof g){var N=l;if(N.vGraphObject!=null){var s=N.vGraphObject;s.update(N)}}},c.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=t.QUALITY,this.animationDuringLayout=t.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=t.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=t.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=t.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=t.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=t.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},c.prototype.transform=function(l){if(l==null)this.transform(new a(0,0));else{var E=new y,T=this.graphManager.getRoot().updateLeftTop();if(T!=null){E.setWorldOrgX(l.x),E.setWorldOrgY(l.y),E.setDeviceOrgX(T.x),E.setDeviceOrgY(T.y);for(var m=this.getAllNodes(),L,O=0;O<m.length;O++)L=m[O],L.transform(E)}}},c.prototype.positionNodesRandomly=function(l){if(l==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var E,T,m=l.getNodes(),L=0;L<m.length;L++)E=m[L],T=E.getChild(),T==null||T.getNodes().length==0?E.scatter():(this.positionNodesRandomly(T),E.updateBounds())},c.prototype.getFlatForest=function(){for(var l=[],E=!0,T=this.graphManager.getRoot().getNodes(),m=!0,L=0;L<T.length;L++)T[L].getChild()!=null&&(m=!1);if(!m)return l;var O=new Set,d=[],N=new Map,s=[];for(s=s.concat(T);s.length>0&&E;){for(d.push(s[0]);d.length>0&&E;){var h=d[0];d.splice(0,1),O.add(h);for(var u=h.getEdges(),L=0;L<u.length;L++){var p=u[L].getOtherEnd(h);if(N.get(h)!=p)if(!O.has(p))d.push(p),N.set(p,h);else{E=!1;break}}}if(!E)l=[];else{var A=[].concat(r(O));l.push(A);for(var L=0;L<A.length;L++){var C=A[L],R=s.indexOf(C);R>-1&&s.splice(R,1)}O=new Set,N=new Map}}return l},c.prototype.createDummyNodesForBendpoints=function(l){for(var E=[],T=l.source,m=this.graphManager.calcLowestCommonAncestor(l.source,l.target),L=0;L<l.bendpoints.length;L++){var O=this.newNode(null);O.setRect(new Point(0,0),new Dimension(1,1)),m.add(O);var d=this.newEdge(null);this.graphManager.add(d,T,O),E.add(O),T=O}var d=this.newEdge(null);return this.graphManager.add(d,T,l.target),this.edgeToDummyNodes.set(l,E),l.isInterGraph()?this.graphManager.remove(l):m.remove(l),E},c.prototype.createBendpointsFromDummyNodes=function(){var l=[];l=l.concat(this.graphManager.getAllEdges()),l=[].concat(r(this.edgeToDummyNodes.keys())).concat(l);for(var E=0;E<l.length;E++){var T=l[E];if(T.bendpoints.length>0){for(var m=this.edgeToDummyNodes.get(T),L=0;L<m.length;L++){var O=m[L],d=new a(O.getCenterX(),O.getCenterY()),N=T.bendpoints.get(L);N.x=d.x,N.y=d.y,O.getOwner().remove(O)}this.graphManager.add(T,T.source,T.target)}}},c.transform=function(l,E,T,m){if(T!=null&&m!=null){var L=E;if(l<=50){var O=E/T;L-=(E-O)/50*(50-l)}else{var d=E*m;L+=(d-E)/50*(l-50)}return L}else{var N,s;return l<=50?(N=9*E/500,s=E/10):(N=9*E/50,s=-8*E),N*l+s}},c.findCenterOfTree=function(l){var E=[];E=E.concat(l);var T=[],m=new Map,L=!1,O=null;(E.length==1||E.length==2)&&(L=!0,O=E[0]);for(var d=0;d<E.length;d++){var N=E[d],s=N.getNeighborsList().size;m.set(N,N.getNeighborsList().size),s==1&&T.push(N)}var h=[];for(h=h.concat(T);!L;){var u=[];u=u.concat(h),h=[];for(var d=0;d<E.length;d++){var N=E[d],p=E.indexOf(N);p>=0&&E.splice(p,1);var A=N.getNeighborsList();A.forEach(function(x){if(T.indexOf(x)<0){var _=m.get(x),U=_-1;U==1&&h.push(x),m.set(x,U)}})}T=T.concat(h),(E.length==1||E.length==2)&&(L=!0,O=E[0])}return O},c.prototype.setGraphManager=function(l){this.graphManager=l},f.exports=c},function(f,D,v){function r(){}r.seed=1,r.x=0,r.nextDouble=function(){return r.x=Math.sin(r.seed++)*1e4,r.x-Math.floor(r.x)},f.exports=r},function(f,D,v){var r=v(4);function t(e,i){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}t.prototype.getWorldOrgX=function(){return this.lworldOrgX},t.prototype.setWorldOrgX=function(e){this.lworldOrgX=e},t.prototype.getWorldOrgY=function(){return this.lworldOrgY},t.prototype.setWorldOrgY=function(e){this.lworldOrgY=e},t.prototype.getWorldExtX=function(){return this.lworldExtX},t.prototype.setWorldExtX=function(e){this.lworldExtX=e},t.prototype.getWorldExtY=function(){return this.lworldExtY},t.prototype.setWorldExtY=function(e){this.lworldExtY=e},t.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},t.prototype.setDeviceOrgX=function(e){this.ldeviceOrgX=e},t.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},t.prototype.setDeviceOrgY=function(e){this.ldeviceOrgY=e},t.prototype.getDeviceExtX=function(){return this.ldeviceExtX},t.prototype.setDeviceExtX=function(e){this.ldeviceExtX=e},t.prototype.getDeviceExtY=function(){return this.ldeviceExtY},t.prototype.setDeviceExtY=function(e){this.ldeviceExtY=e},t.prototype.transformX=function(e){var i=0,o=this.lworldExtX;return o!=0&&(i=this.ldeviceOrgX+(e-this.lworldOrgX)*this.ldeviceExtX/o),i},t.prototype.transformY=function(e){var i=0,o=this.lworldExtY;return o!=0&&(i=this.ldeviceOrgY+(e-this.lworldOrgY)*this.ldeviceExtY/o),i},t.prototype.inverseTransformX=function(e){var i=0,o=this.ldeviceExtX;return o!=0&&(i=this.lworldOrgX+(e-this.ldeviceOrgX)*this.lworldExtX/o),i},t.prototype.inverseTransformY=function(e){var i=0,o=this.ldeviceExtY;return o!=0&&(i=this.lworldOrgY+(e-this.ldeviceOrgY)*this.lworldExtY/o),i},t.prototype.inverseTransformPoint=function(e){var i=new r(this.inverseTransformX(e.x),this.inverseTransformY(e.y));return i},f.exports=t},function(f,D,v){function r(n){if(Array.isArray(n)){for(var c=0,l=Array(n.length);c<n.length;c++)l[c]=n[c];return l}else return Array.from(n)}var t=v(15),e=v(7),i=v(0),o=v(8),g=v(9);function a(){t.call(this),this.useSmartIdealEdgeLengthCalculation=e.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.idealEdgeLength=e.DEFAULT_EDGE_LENGTH,this.springConstant=e.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=e.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=e.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=e.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=e.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=e.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*e.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=e.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=e.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=e.MAX_ITERATIONS}a.prototype=Object.create(t.prototype);for(var y in t)a[y]=t[y];a.prototype.initParameters=function(){t.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=e.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},a.prototype.calcIdealEdgeLengths=function(){for(var n,c,l,E,T,m,L=this.getGraphManager().getAllEdges(),O=0;O<L.length;O++)n=L[O],n.idealLength=this.idealEdgeLength,n.isInterGraph&&(l=n.getSource(),E=n.getTarget(),T=n.getSourceInLca().getEstimatedSize(),m=n.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(n.idealLength+=T+m-2*i.SIMPLE_NODE_SIZE),c=n.getLca().getInclusionTreeDepth(),n.idealLength+=e.DEFAULT_EDGE_LENGTH*e.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(l.getInclusionTreeDepth()+E.getInclusionTreeDepth()-2*c))},a.prototype.initSpringEmbedder=function(){var n=this.getAllNodes().length;this.incremental?(n>e.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*e.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(n-e.ADAPTATION_LOWER_NODE_LIMIT)/(e.ADAPTATION_UPPER_NODE_LIMIT-e.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-e.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=e.MAX_NODE_DISPLACEMENT_INCREMENTAL):(n>e.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(e.COOLING_ADAPTATION_FACTOR,1-(n-e.ADAPTATION_LOWER_NODE_LIMIT)/(e.ADAPTATION_UPPER_NODE_LIMIT-e.ADAPTATION_LOWER_NODE_LIMIT)*(1-e.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=e.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},a.prototype.calcSpringForces=function(){for(var n=this.getAllEdges(),c,l=0;l<n.length;l++)c=n[l],this.calcSpringForce(c,c.idealLength)},a.prototype.calcRepulsionForces=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,l,E,T,m,L=this.getAllNodes(),O;if(this.useFRGridVariant)for(this.totalIterations%e.GRID_CALCULATION_CHECK_PERIOD==1&&n&&this.updateGrid(),O=new Set,l=0;l<L.length;l++)T=L[l],this.calculateRepulsionForceOfANode(T,O,n,c),O.add(T);else for(l=0;l<L.length;l++)for(T=L[l],E=l+1;E<L.length;E++)m=L[E],T.getOwner()==m.getOwner()&&this.calcRepulsionForce(T,m)},a.prototype.calcGravitationalForces=function(){for(var n,c=this.getAllNodesToApplyGravitation(),l=0;l<c.length;l++)n=c[l],this.calcGravitationalForce(n)},a.prototype.moveNodes=function(){for(var n=this.getAllNodes(),c,l=0;l<n.length;l++)c=n[l],c.move()},a.prototype.calcSpringForce=function(n,c){var l=n.getSource(),E=n.getTarget(),T,m,L,O;if(this.uniformLeafNodeSizes&&l.getChild()==null&&E.getChild()==null)n.updateLengthSimple();else if(n.updateLength(),n.isOverlapingSourceAndTarget)return;T=n.getLength(),T!=0&&(m=this.springConstant*(T-c),L=m*(n.lengthX/T),O=m*(n.lengthY/T),l.springForceX+=L,l.springForceY+=O,E.springForceX-=L,E.springForceY-=O)},a.prototype.calcRepulsionForce=function(n,c){var l=n.getRect(),E=c.getRect(),T=new Array(2),m=new Array(4),L,O,d,N,s,h,u;if(l.intersects(E)){o.calcSeparationAmount(l,E,T,e.DEFAULT_EDGE_LENGTH/2),h=2*T[0],u=2*T[1];var p=n.noOfChildren*c.noOfChildren/(n.noOfChildren+c.noOfChildren);n.repulsionForceX-=p*h,n.repulsionForceY-=p*u,c.repulsionForceX+=p*h,c.repulsionForceY+=p*u}else this.uniformLeafNodeSizes&&n.getChild()==null&&c.getChild()==null?(L=E.getCenterX()-l.getCenterX(),O=E.getCenterY()-l.getCenterY()):(o.getIntersection(l,E,m),L=m[2]-m[0],O=m[3]-m[1]),Math.abs(L)<e.MIN_REPULSION_DIST&&(L=g.sign(L)*e.MIN_REPULSION_DIST),Math.abs(O)<e.MIN_REPULSION_DIST&&(O=g.sign(O)*e.MIN_REPULSION_DIST),d=L*L+O*O,N=Math.sqrt(d),s=this.repulsionConstant*n.noOfChildren*c.noOfChildren/d,h=s*L/N,u=s*O/N,n.repulsionForceX-=h,n.repulsionForceY-=u,c.repulsionForceX+=h,c.repulsionForceY+=u},a.prototype.calcGravitationalForce=function(n){var c,l,E,T,m,L,O,d;c=n.getOwner(),l=(c.getRight()+c.getLeft())/2,E=(c.getTop()+c.getBottom())/2,T=n.getCenterX()-l,m=n.getCenterY()-E,L=Math.abs(T)+n.getWidth()/2,O=Math.abs(m)+n.getHeight()/2,n.getOwner()==this.graphManager.getRoot()?(d=c.getEstimatedSize()*this.gravityRangeFactor,(L>d||O>d)&&(n.gravitationForceX=-this.gravityConstant*T,n.gravitationForceY=-this.gravityConstant*m)):(d=c.getEstimatedSize()*this.compoundGravityRangeFactor,(L>d||O>d)&&(n.gravitationForceX=-this.gravityConstant*T*this.compoundGravityConstant,n.gravitationForceY=-this.gravityConstant*m*this.compoundGravityConstant))},a.prototype.isConverged=function(){var n,c=!1;return this.totalIterations>this.maxIterations/3&&(c=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),n=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,n||c},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 n,c=this.graphManager.getAllNodes(),l=0;l<c.length;l++)n=c[l],n.noOfChildren=n.getNoOfChildren()},a.prototype.calcGrid=function(n){var c=0,l=0;c=parseInt(Math.ceil((n.getRight()-n.getLeft())/this.repulsionRange)),l=parseInt(Math.ceil((n.getBottom()-n.getTop())/this.repulsionRange));for(var E=new Array(c),T=0;T<c;T++)E[T]=new Array(l);for(var T=0;T<c;T++)for(var m=0;m<l;m++)E[T][m]=new Array;return E},a.prototype.addNodeToGrid=function(n,c,l){var E=0,T=0,m=0,L=0;E=parseInt(Math.floor((n.getRect().x-c)/this.repulsionRange)),T=parseInt(Math.floor((n.getRect().width+n.getRect().x-c)/this.repulsionRange)),m=parseInt(Math.floor((n.getRect().y-l)/this.repulsionRange)),L=parseInt(Math.floor((n.getRect().height+n.getRect().y-l)/this.repulsionRange));for(var O=E;O<=T;O++)for(var d=m;d<=L;d++)this.grid[O][d].push(n),n.setGridCoordinates(E,T,m,L)},a.prototype.updateGrid=function(){var n,c,l=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),n=0;n<l.length;n++)c=l[n],this.addNodeToGrid(c,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},a.prototype.calculateRepulsionForceOfANode=function(n,c,l,E){if(this.totalIterations%e.GRID_CALCULATION_CHECK_PERIOD==1&&l||E){var T=new Set;n.surrounding=new Array;for(var m,L=this.grid,O=n.startX-1;O<n.finishX+2;O++)for(var d=n.startY-1;d<n.finishY+2;d++)if(!(O<0||d<0||O>=L.length||d>=L[0].length)){for(var N=0;N<L[O][d].length;N++)if(m=L[O][d][N],!(n.getOwner()!=m.getOwner()||n==m)&&!c.has(m)&&!T.has(m)){var s=Math.abs(n.getCenterX()-m.getCenterX())-(n.getWidth()/2+m.getWidth()/2),h=Math.abs(n.getCenterY()-m.getCenterY())-(n.getHeight()/2+m.getHeight()/2);s<=this.repulsionRange&&h<=this.repulsionRange&&T.add(m)}}n.surrounding=[].concat(r(T))}for(O=0;O<n.surrounding.length;O++)this.calcRepulsionForce(n,n.surrounding[O])},a.prototype.calcRepulsionRange=function(){return 0},f.exports=a},function(f,D,v){var r=v(1),t=v(7);function e(o,g,a){r.call(this,o,g,a),this.idealLength=t.DEFAULT_EDGE_LENGTH}e.prototype=Object.create(r.prototype);for(var i in r)e[i]=r[i];f.exports=e},function(f,D,v){var r=v(3);function t(i,o,g,a){r.call(this,i,o,g,a),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=[]}t.prototype=Object.create(r.prototype);for(var e in r)t[e]=r[e];t.prototype.setGridCoordinates=function(i,o,g,a){this.startX=i,this.finishX=o,this.startY=g,this.finishY=a},f.exports=t},function(f,D,v){function r(t,e){this.width=0,this.height=0,t!==null&&e!==null&&(this.height=e,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},f.exports=r},function(f,D,v){var r=v(14);function t(){this.map={},this.keys=[]}t.prototype.put=function(e,i){var o=r.createID(e);this.contains(o)||(this.map[o]=i,this.keys.push(e))},t.prototype.contains=function(e){return r.createID(e),this.map[e]!=null},t.prototype.get=function(e){var i=r.createID(e);return this.map[i]},t.prototype.keySet=function(){return this.keys},f.exports=t},function(f,D,v){var r=v(14);function t(){this.set={}}t.prototype.add=function(e){var i=r.createID(e);this.contains(i)||(this.set[i]=e)},t.prototype.remove=function(e){delete this.set[r.createID(e)]},t.prototype.clear=function(){this.set={}},t.prototype.contains=function(e){return this.set[r.createID(e)]==e},t.prototype.isEmpty=function(){return this.size()===0},t.prototype.size=function(){return Object.keys(this.set).length},t.prototype.addAllTo=function(e){for(var i=Object.keys(this.set),o=i.length,g=0;g<o;g++)e.push(this.set[i[g]])},t.prototype.size=function(){return Object.keys(this.set).length},t.prototype.addAll=function(e){for(var i=e.length,o=0;o<i;o++){var g=e[o];this.add(g)}},f.exports=t},function(f,D,v){var r=function(){function o(g,a){for(var y=0;y<a.length;y++){var n=a[y];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(g,n.key,n)}}return function(g,a,y){return a&&o(g.prototype,a),y&&o(g,y),g}}();function t(o,g){if(!(o instanceof g))throw new TypeError("Cannot call a class as a function")}var e=v(11),i=function(){function o(g,a){t(this,o),(a!==null||a!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var y=void 0;g instanceof e?y=g.size():y=g.length,this._quicksort(g,0,y-1)}return r(o,[{key:"_quicksort",value:function(a,y,n){if(y<n){var c=this._partition(a,y,n);this._quicksort(a,y,c),this._quicksort(a,c+1,n)}}},{key:"_partition",value:function(a,y,n){for(var c=this._get(a,y),l=y,E=n;;){for(;this.compareFunction(c,this._get(a,E));)E--;for(;this.compareFunction(this._get(a,l),c);)l++;if(l<E)this._swap(a,l,E),l++,E--;else return E}}},{key:"_get",value:function(a,y){return a instanceof e?a.get_object_at(y):a[y]}},{key:"_set",value:function(a,y,n){a instanceof e?a.set_object_at(y,n):a[y]=n}},{key:"_swap",value:function(a,y,n){var c=this._get(a,y);this._set(a,y,this._get(a,n)),this._set(a,n,c)}},{key:"_defaultCompareFunction",value:function(a,y){return y>a}}]),o}();f.exports=i},function(f,D,v){var r=function(){function i(o,g){for(var a=0;a<g.length;a++){var y=g[a];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(o,y.key,y)}}return function(o,g,a){return g&&i(o.prototype,g),a&&i(o,a),o}}();function t(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")}var e=function(){function i(o,g){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,y=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;t(this,i),this.sequence1=o,this.sequence2=g,this.match_score=a,this.mismatch_penalty=y,this.gap_penalty=n,this.iMax=o.length+1,this.jMax=g.length+1,this.grid=new Array(this.iMax);for(var c=0;c<this.iMax;c++){this.grid[c]=new Array(this.jMax);for(var l=0;l<this.jMax;l++)this.grid[c][l]=0}this.tracebackGrid=new Array(this.iMax);for(var E=0;E<this.iMax;E++){this.tracebackGrid[E]=new Array(this.jMax);for(var T=0;T<this.jMax;T++)this.tracebackGrid[E][T]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return r(i,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var g=1;g<this.jMax;g++)this.grid[0][g]=this.grid[0][g-1]+this.gap_penalty,this.tracebackGrid[0][g]=[!1,!1,!0];for(var a=1;a<this.iMax;a++)this.grid[a][0]=this.grid[a-1][0]+this.gap_penalty,this.tracebackGrid[a][0]=[!1,!0,!1];for(var y=1;y<this.iMax;y++)for(var n=1;n<this.jMax;n++){var c=void 0;this.sequence1[y-1]===this.sequence2[n-1]?c=this.grid[y-1][n-1]+this.match_score:c=this.grid[y-1][n-1]+this.mismatch_penalty;var l=this.grid[y-1][n]+this.gap_penalty,E=this.grid[y][n-1]+this.gap_penalty,T=[c,l,E],m=this.arrayAllMaxIndexes(T);this.grid[y][n]=T[m[0]],this.tracebackGrid[y][n]=[m.includes(0),m.includes(1),m.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var g=[];for(g.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});g[0];){var a=g[0],y=this.tracebackGrid[a.pos[0]][a.pos[1]];y[0]&&g.push({pos:[a.pos[0]-1,a.pos[1]-1],seq1:this.sequence1[a.pos[0]-1]+a.seq1,seq2:this.sequence2[a.pos[1]-1]+a.seq2}),y[1]&&g.push({pos:[a.pos[0]-1,a.pos[1]],seq1:this.sequence1[a.pos[0]-1]+a.seq1,seq2:"-"+a.seq2}),y[2]&&g.push({pos:[a.pos[0],a.pos[1]-1],seq1:"-"+a.seq1,seq2:this.sequence2[a.pos[1]-1]+a.seq2}),a.pos[0]===0&&a.pos[1]===0&&this.alignments.push({sequence1:a.seq1,sequence2:a.seq2}),g.shift()}return this.alignments}},{key:"getAllIndexes",value:function(g,a){for(var y=[],n=-1;(n=g.indexOf(a,n+1))!==-1;)y.push(n);return y}},{key:"arrayAllMaxIndexes",value:function(g){return this.getAllIndexes(g,Math.max.apply(null,g))}}]),i}();f.exports=e},function(f,D,v){var r=function(){};r.FDLayout=v(18),r.FDLayoutConstants=v(7),r.FDLayoutEdge=v(19),r.FDLayoutNode=v(20),r.DimensionD=v(21),r.HashMap=v(22),r.HashSet=v(23),r.IGeometry=v(8),r.IMath=v(9),r.Integer=v(10),r.Point=v(12),r.PointD=v(4),r.RandomSeed=v(16),r.RectangleD=v(13),r.Transform=v(17),r.UniqueIDGeneretor=v(14),r.Quicksort=v(24),r.LinkedList=v(11),r.LGraphObject=v(2),r.LGraph=v(5),r.LEdge=v(1),r.LGraphManager=v(6),r.LNode=v(3),r.Layout=v(15),r.LayoutConstants=v(0),r.NeedlemanWunsch=v(25),f.exports=r},function(f,D,v){function r(){this.listeners=[]}var t=r.prototype;t.addListener=function(e,i){this.listeners.push({event:e,callback:i})},t.removeListener=function(e,i){for(var o=this.listeners.length;o>=0;o--){var g=this.listeners[o];g.event===e&&g.callback===i&&this.listeners.splice(o,1)}},t.emit=function(e,i){for(var o=0;o<this.listeners.length;o++){var g=this.listeners[o];e===g.event&&g.callback(i)}},f.exports=r}])})}(rt)),rt.exports}var St=et.exports,ft;function Gt(){return ft||(ft=1,function(I,w){(function(D,v){I.exports=v(wt())})(St,function(f){return function(D){var v={};function r(t){if(v[t])return v[t].exports;var e=v[t]={i:t,l:!1,exports:{}};return D[t].call(e.exports,e,e.exports,r),e.l=!0,e.exports}return r.m=D,r.c=v,r.i=function(t){return t},r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=7)}([function(D,v){D.exports=f},function(D,v,r){var t=r(0).FDLayoutConstants;function e(){}for(var i in t)e[i]=t[i];e.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,e.DEFAULT_RADIAL_SEPARATION=t.DEFAULT_EDGE_LENGTH,e.DEFAULT_COMPONENT_SEPERATION=60,e.TILE=!0,e.TILING_PADDING_VERTICAL=10,e.TILING_PADDING_HORIZONTAL=10,e.TREE_REDUCTION_ON_INCREMENTAL=!1,D.exports=e},function(D,v,r){var t=r(0).FDLayoutEdge;function e(o,g,a){t.call(this,o,g,a)}e.prototype=Object.create(t.prototype);for(var i in t)e[i]=t[i];D.exports=e},function(D,v,r){var t=r(0).LGraph;function e(o,g,a){t.call(this,o,g,a)}e.prototype=Object.create(t.prototype);for(var i in t)e[i]=t[i];D.exports=e},function(D,v,r){var t=r(0).LGraphManager;function e(o){t.call(this,o)}e.prototype=Object.create(t.prototype);for(var i in t)e[i]=t[i];D.exports=e},function(D,v,r){var t=r(0).FDLayoutNode,e=r(0).IMath;function i(g,a,y,n){t.call(this,g,a,y,n)}i.prototype=Object.create(t.prototype);for(var o in t)i[o]=t[o];i.prototype.move=function(){var g=this.graphManager.getLayout();this.displacementX=g.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY=g.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren,Math.abs(this.displacementX)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementX=g.coolingFactor*g.maxNodeDisplacement*e.sign(this.displacementX)),Math.abs(this.displacementY)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementY=g.coolingFactor*g.maxNodeDisplacement*e.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),g.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},i.prototype.propogateDisplacementToChildren=function(g,a){for(var y=this.getChild().getNodes(),n,c=0;c<y.length;c++)n=y[c],n.getChild()==null?(n.moveBy(g,a),n.displacementX+=g,n.displacementY+=a):n.propogateDisplacementToChildren(g,a)},i.prototype.setPred1=function(g){this.pred1=g},i.prototype.getPred1=function(){return pred1},i.prototype.getPred2=function(){return pred2},i.prototype.setNext=function(g){this.next=g},i.prototype.getNext=function(){return next},i.prototype.setProcessed=function(g){this.processed=g},i.prototype.isProcessed=function(){return processed},D.exports=i},function(D,v,r){var t=r(0).FDLayout,e=r(4),i=r(3),o=r(5),g=r(2),a=r(1),y=r(0).FDLayoutConstants,n=r(0).LayoutConstants,c=r(0).Point,l=r(0).PointD,E=r(0).Layout,T=r(0).Integer,m=r(0).IGeometry,L=r(0).LGraph,O=r(0).Transform;function d(){t.call(this),this.toBeTiled={}}d.prototype=Object.create(t.prototype);for(var N in t)d[N]=t[N];d.prototype.newGraphManager=function(){var s=new e(this);return this.graphManager=s,s},d.prototype.newGraph=function(s){return new i(null,this.graphManager,s)},d.prototype.newNode=function(s){return new o(this.graphManager,s)},d.prototype.newEdge=function(s){return new g(null,null,s)},d.prototype.initParameters=function(){t.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.springConstant=y.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=y.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=y.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=y.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=y.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=y.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1,this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/y.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=y.CONVERGENCE_CHECK_PERIOD/this.maxIterations,this.coolingAdjuster=1)},d.prototype.layout=function(){var s=n.DEFAULT_CREATE_BENDS_AS_NEEDED;return s&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},d.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(a.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var h=new Set(this.getAllNodes()),u=this.nodesWithGravity.filter(function(C){return h.has(C)});this.graphManager.setAllNodesToApplyGravitation(u)}}else{var s=this.getFlatForest();if(s.length>0)this.positionNodesRadially(s);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var h=new Set(this.getAllNodes()),u=this.nodesWithGravity.filter(function(p){return h.has(p)});this.graphManager.setAllNodesToApplyGravitation(u),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},d.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%y.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),h=this.nodesWithGravity.filter(function(A){return s.has(A)});this.graphManager.setAllNodesToApplyGravitation(h),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=y.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=y.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var u=!this.isTreeGrowing&&!this.isGrowthFinished,p=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(u,p),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},d.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),h={},u=0;u<s.length;u++){var p=s[u].rect,A=s[u].id;h[A]={id:A,x:p.getCenterX(),y:p.getCenterY(),w:p.width,h:p.height}}return h},d.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var s=!1;if(y.ANIMATE==="during")this.emit("layoutstarted");else{for(;!s;)s=this.tick();this.graphManager.updateBounds()}},d.prototype.calculateNodesToApplyGravitationTo=function(){var s=[],h,u=this.graphManager.getGraphs(),p=u.length,A;for(A=0;A<p;A++)h=u[A],h.updateConnected(),h.isConnected||(s=s.concat(h.getNodes()));return s},d.prototype.createBendpoints=function(){var s=[];s=s.concat(this.graphManager.getAllEdges());var h=new Set,u;for(u=0;u<s.length;u++){var p=s[u];if(!h.has(p)){var A=p.getSource(),C=p.getTarget();if(A==C)p.getBendpoints().push(new l),p.getBendpoints().push(new l),this.createDummyNodesForBendpoints(p),h.add(p);else{var R=[];if(R=R.concat(A.getEdgeListToNode(C)),R=R.concat(C.getEdgeListToNode(A)),!h.has(R[0])){if(R.length>1){var x;for(x=0;x<R.length;x++){var _=R[x];_.getBendpoints().push(new l),this.createDummyNodesForBendpoints(_)}}R.forEach(function(U){h.add(U)})}}}if(h.size==s.length)break}},d.prototype.positionNodesRadially=function(s){for(var h=new c(0,0),u=Math.ceil(Math.sqrt(s.length)),p=0,A=0,C=0,R=new l(0,0),x=0;x<s.length;x++){x%u==0&&(C=0,A=p,x!=0&&(A+=a.DEFAULT_COMPONENT_SEPERATION),p=0);var _=s[x],U=E.findCenterOfTree(_);h.x=C,h.y=A,R=d.radialLayout(_,U,h),R.y>p&&(p=Math.floor(R.y)),C=Math.floor(R.x+a.DEFAULT_COMPONENT_SEPERATION)}this.transform(new l(n.WORLD_CENTER_X-R.x/2,n.WORLD_CENTER_Y-R.y/2))},d.radialLayout=function(s,h,u){var p=Math.max(this.maxDiagonalInTree(s),a.DEFAULT_RADIAL_SEPARATION);d.branchRadialLayout(h,null,0,359,0,p);var A=L.calculateBounds(s),C=new O;C.setDeviceOrgX(A.getMinX()),C.setDeviceOrgY(A.getMinY()),C.setWorldOrgX(u.x),C.setWorldOrgY(u.y);for(var R=0;R<s.length;R++){var x=s[R];x.transform(C)}var _=new l(A.getMaxX(),A.getMaxY());return C.inverseTransformPoint(_)},d.branchRadialLayout=function(s,h,u,p,A,C){var R=(p-u+1)/2;R<0&&(R+=180);var x=(R+u)%360,_=x*m.TWO_PI/360,U=A*Math.cos(_),X=A*Math.sin(_);s.setCenter(U,X);var M=[];M=M.concat(s.getEdges());var G=M.length;h!=null&&G--;for(var F=0,b=M.length,Y,k=s.getEdgesBetween(h);k.length>1;){var H=k[0];k.splice(0,1);var P=M.indexOf(H);P>=0&&M.splice(P,1),b--,G--}h!=null?Y=(M.indexOf(k[0])+1)%b:Y=0;for(var B=Math.abs(p-u)/G,$=Y;F!=G;$=++$%b){var K=M[$].getOtherEnd(s);if(K!=h){var Q=(u+F*B)%360,q=(Q+B)%360;d.branchRadialLayout(K,s,Q,q,A+C,C),F++}}},d.maxDiagonalInTree=function(s){for(var h=T.MIN_VALUE,u=0;u<s.length;u++){var p=s[u],A=p.getDiagonal();A>h&&(h=A)}return h},d.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},d.prototype.groupZeroDegreeMembers=function(){var s=this,h={};this.memberGroups={},this.idToDummyNode={};for(var u=[],p=this.graphManager.getAllNodes(),A=0;A<p.length;A++){var C=p[A],R=C.getParent();this.getNodeDegreeWithChildren(C)===0&&(R.id==null||!this.getToBeTiled(R))&&u.push(C)}for(var A=0;A<u.length;A++){var C=u[A],x=C.getParent().id;typeof h[x]>"u"&&(h[x]=[]),h[x]=h[x].concat(C)}Object.keys(h).forEach(function(_){if(h[_].length>1){var U="DummyCompound_"+_;s.memberGroups[U]=h[_];var X=h[_][0].getParent(),M=new o(s.graphManager);M.id=U,M.paddingLeft=X.paddingLeft||0,M.paddingRight=X.paddingRight||0,M.paddingBottom=X.paddingBottom||0,M.paddingTop=X.paddingTop||0,s.idToDummyNode[U]=M;var G=s.getGraphManager().add(s.newGraph(),M),F=X.getChild();F.add(M);for(var b=0;b<h[_].length;b++){var Y=h[_][b];F.remove(Y),G.add(Y)}}})},d.prototype.clearCompounds=function(){var s={},h={};this.performDFSOnCompounds();for(var u=0;u<this.compoundOrder.length;u++)h[this.compoundOrder[u].id]=this.compoundOrder[u],s[this.compoundOrder[u].id]=[].concat(this.compoundOrder[u].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[u].getChild()),this.compoundOrder[u].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(s,h)},d.prototype.clearZeroDegreeMembers=function(){var s=this,h=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(u){var p=s.idToDummyNode[u];h[u]=s.tileNodes(s.memberGroups[u],p.paddingLeft+p.paddingRight),p.rect.width=h[u].width,p.rect.height=h[u].height})},d.prototype.repopulateCompounds=function(){for(var s=this.compoundOrder.length-1;s>=0;s--){var h=this.compoundOrder[s],u=h.id,p=h.paddingLeft,A=h.paddingTop;this.adjustLocations(this.tiledMemberPack[u],h.rect.x,h.rect.y,p,A)}},d.prototype.repopulateZeroDegreeMembers=function(){var s=this,h=this.tiledZeroDegreePack;Object.keys(h).forEach(function(u){var p=s.idToDummyNode[u],A=p.paddingLeft,C=p.paddingTop;s.adjustLocations(h[u],p.rect.x,p.rect.y,A,C)})},d.prototype.getToBeTiled=function(s){var h=s.id;if(this.toBeTiled[h]!=null)return this.toBeTiled[h];var u=s.getChild();if(u==null)return this.toBeTiled[h]=!1,!1;for(var p=u.getNodes(),A=0;A<p.length;A++){var C=p[A];if(this.getNodeDegree(C)>0)return this.toBeTiled[h]=!1,!1;if(C.getChild()==null){this.toBeTiled[C.id]=!1;continue}if(!this.getToBeTiled(C))return this.toBeTiled[h]=!1,!1}return this.toBeTiled[h]=!0,!0},d.prototype.getNodeDegree=function(s){s.id;for(var h=s.getEdges(),u=0,p=0;p<h.length;p++){var A=h[p];A.getSource().id!==A.getTarget().id&&(u=u+1)}return u},d.prototype.getNodeDegreeWithChildren=function(s){var h=this.getNodeDegree(s);if(s.getChild()==null)return h;for(var u=s.getChild().getNodes(),p=0;p<u.length;p++){var A=u[p];h+=this.getNodeDegreeWithChildren(A)}return h},d.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},d.prototype.fillCompexOrderByDFS=function(s){for(var h=0;h<s.length;h++){var u=s[h];u.getChild()!=null&&this.fillCompexOrderByDFS(u.getChild().getNodes()),this.getToBeTiled(u)&&this.compoundOrder.push(u)}},d.prototype.adjustLocations=function(s,h,u,p,A){h+=p,u+=A;for(var C=h,R=0;R<s.rows.length;R++){var x=s.rows[R];h=C;for(var _=0,U=0;U<x.length;U++){var X=x[U];X.rect.x=h,X.rect.y=u,h+=X.rect.width+s.horizontalPadding,X.rect.height>_&&(_=X.rect.height)}u+=_+s.verticalPadding}},d.prototype.tileCompoundMembers=function(s,h){var u=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(p){var A=h[p];u.tiledMemberPack[p]=u.tileNodes(s[p],A.paddingLeft+A.paddingRight),A.rect.width=u.tiledMemberPack[p].width,A.rect.height=u.tiledMemberPack[p].height})},d.prototype.tileNodes=function(s,h){var u=a.TILING_PADDING_VERTICAL,p=a.TILING_PADDING_HORIZONTAL,A={rows:[],rowWidth:[],rowHeight:[],width:0,height:h,verticalPadding:u,horizontalPadding:p};s.sort(function(x,_){return x.rect.width*x.rect.height>_.rect.width*_.rect.height?-1:x.rect.width*x.rect.height<_.rect.width*_.rect.height?1:0});for(var C=0;C<s.length;C++){var R=s[C];A.rows.length==0?this.insertNodeToRow(A,R,0,h):this.canAddHorizontal(A,R.rect.width,R.rect.height)?this.insertNodeToRow(A,R,this.getShortestRowIndex(A),h):this.insertNodeToRow(A,R,A.rows.length,h),this.shiftToLastRow(A)}return A},d.prototype.insertNodeToRow=function(s,h,u,p){var A=p;if(u==s.rows.length){var C=[];s.rows.push(C),s.rowWidth.push(A),s.rowHeight.push(0)}var R=s.rowWidth[u]+h.rect.width;s.rows[u].length>0&&(R+=s.horizontalPadding),s.rowWidth[u]=R,s.width<R&&(s.width=R);var x=h.rect.height;u>0&&(x+=s.verticalPadding);var _=0;x>s.rowHeight[u]&&(_=s.rowHeight[u],s.rowHeight[u]=x,_=s.rowHeight[u]-_),s.height+=_,s.rows[u].push(h)},d.prototype.getShortestRowIndex=function(s){for(var h=-1,u=Number.MAX_VALUE,p=0;p<s.rows.length;p++)s.rowWidth[p]<u&&(h=p,u=s.rowWidth[p]);return h},d.prototype.getLongestRowIndex=function(s){for(var h=-1,u=Number.MIN_VALUE,p=0;p<s.rows.length;p++)s.rowWidth[p]>u&&(h=p,u=s.rowWidth[p]);return h},d.prototype.canAddHorizontal=function(s,h,u){var p=this.getShortestRowIndex(s);if(p<0)return!0;var A=s.rowWidth[p];if(A+s.horizontalPadding+h<=s.width)return!0;var C=0;s.rowHeight[p]<u&&p>0&&(C=u+s.verticalPadding-s.rowHeight[p]);var R;s.width-A>=h+s.horizontalPadding?R=(s.height+C)/(A+h+s.horizontalPadding):R=(s.height+C)/s.width,C=u+s.verticalPadding;var x;return s.width<h?x=(s.height+C)/h:x=(s.height+C)/s.width,x<1&&(x=1/x),R<1&&(R=1/R),R<x},d.prototype.shiftToLastRow=function(s){var h=this.getLongestRowIndex(s),u=s.rowWidth.length-1,p=s.rows[h],A=p[p.length-1],C=A.width+s.horizontalPadding;if(s.width-s.rowWidth[u]>C&&h!=u){p.splice(-1,1),s.rows[u].push(A),s.rowWidth[h]=s.rowWidth[h]-C,s.rowWidth[u]=s.rowWidth[u]+C,s.width=s.rowWidth[instance.getLongestRowIndex(s)];for(var R=Number.MIN_VALUE,x=0;x<p.length;x++)p[x].height>R&&(R=p[x].height);h>0&&(R+=s.verticalPadding);var _=s.rowHeight[h]+s.rowHeight[u];s.rowHeight[h]=R,s.rowHeight[u]<A.height+s.verticalPadding&&(s.rowHeight[u]=A.height+s.verticalPadding);var U=s.rowHeight[h]+s.rowHeight[u];s.height+=U-_,this.shiftToLastRow(s)}},d.prototype.tilingPreLayout=function(){a.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},d.prototype.tilingPostLayout=function(){a.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},d.prototype.reduceTrees=function(){for(var s=[],h=!0,u;h;){var p=this.graphManager.getAllNodes(),A=[];h=!1;for(var C=0;C<p.length;C++)u=p[C],u.getEdges().length==1&&!u.getEdges()[0].isInterGraph&&u.getChild()==null&&(A.push([u,u.getEdges()[0],u.getOwner()]),h=!0);if(h==!0){for(var R=[],x=0;x<A.length;x++)A[x][0].getEdges().length==1&&(R.push(A[x]),A[x][0].getOwner().remove(A[x][0]));s.push(R),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=s},d.prototype.growTree=function(s){for(var h=s.length,u=s[h-1],p,A=0;A<u.length;A++)p=u[A],this.findPlaceforPrunedNode(p),p[2].add(p[0]),p[2].add(p[1],p[1].source,p[1].target);s.splice(s.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},d.prototype.findPlaceforPrunedNode=function(s){var h,u,p=s[0];p==s[1].source?u=s[1].target:u=s[1].source;var A=u.startX,C=u.finishX,R=u.startY,x=u.finishY,_=0,U=0,X=0,M=0,G=[_,X,U,M];if(R>0)for(var F=A;F<=C;F++)G[0]+=this.grid[F][R-1].length+this.grid[F][R].length-1;if(C<this.grid.length-1)for(var F=R;F<=x;F++)G[1]+=this.grid[C+1][F].length+this.grid[C][F].length-1;if(x<this.grid[0].length-1)for(var F=A;F<=C;F++)G[2]+=this.grid[F][x+1].length+this.grid[F][x].length-1;if(A>0)for(var F=R;F<=x;F++)G[3]+=this.grid[A-1][F].length+this.grid[A][F].length-1;for(var b=T.MAX_VALUE,Y,k,H=0;H<G.length;H++)G[H]<b?(b=G[H],Y=1,k=H):G[H]==b&&Y++;if(Y==3&&b==0)G[0]==0&&G[1]==0&&G[2]==0?h=1:G[0]==0&&G[1]==0&&G[3]==0?h=0:G[0]==0&&G[2]==0&&G[3]==0?h=3:G[1]==0&&G[2]==0&&G[3]==0&&(h=2);else if(Y==2&&b==0){var P=Math.floor(Math.random()*2);G[0]==0&&G[1]==0?P==0?h=0:h=1:G[0]==0&&G[2]==0?P==0?h=0:h=2:G[0]==0&&G[3]==0?P==0?h=0:h=3:G[1]==0&&G[2]==0?P==0?h=1:h=2:G[1]==0&&G[3]==0?P==0?h=1:h=3:P==0?h=2:h=3}else if(Y==4&&b==0){var P=Math.floor(Math.random()*4);h=P}else h=k;h==0?p.setCenter(u.getCenterX(),u.getCenterY()-u.getHeight()/2-y.DEFAULT_EDGE_LENGTH-p.getHeight()/2):h==1?p.setCenter(u.getCenterX()+u.getWidth()/2+y.DEFAULT_EDGE_LENGTH+p.getWidth()/2,u.getCenterY()):h==2?p.setCenter(u.getCenterX(),u.getCenterY()+u.getHeight()/2+y.DEFAULT_EDGE_LENGTH+p.getHeight()/2):p.setCenter(u.getCenterX()-u.getWidth()/2-y.DEFAULT_EDGE_LENGTH-p.getWidth()/2,u.getCenterY())},D.exports=d},function(D,v,r){var t={};t.layoutBase=r(0),t.CoSEConstants=r(1),t.CoSEEdge=r(2),t.CoSEGraph=r(3),t.CoSEGraphManager=r(4),t.CoSELayout=r(6),t.CoSENode=r(5),D.exports=t}])})}(et)),et.exports}var _t=tt.exports,pt;function Ft(){return pt||(pt=1,function(I,w){(function(D,v){I.exports=v(Gt())})(_t,function(f){return function(D){var v={};function r(t){if(v[t])return v[t].exports;var e=v[t]={i:t,l:!1,exports:{}};return D[t].call(e.exports,e,e.exports,r),e.l=!0,e.exports}return r.m=D,r.c=v,r.i=function(t){return t},r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([function(D,v){D.exports=f},function(D,v,r){var t=r(0).layoutBase.LayoutConstants,e=r(0).layoutBase.FDLayoutConstants,i=r(0).CoSEConstants,o=r(0).CoSELayout,g=r(0).CoSENode,a=r(0).layoutBase.PointD,y=r(0).layoutBase.DimensionD,n={ready:function(){},stop:function(){},quality:"default",nodeDimensionsIncludeLabels:!1,refresh:30,fit:!0,padding:10,randomize:!0,nodeRepulsion:4500,idealEdgeLength:50,edgeElasticity:.45,nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,animate:"end",animationDuration:500,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.5};function c(m,L){var O={};for(var d in m)O[d]=m[d];for(var d in L)O[d]=L[d];return O}function l(m){this.options=c(n,m),E(this.options)}var E=function(L){L.nodeRepulsion!=null&&(i.DEFAULT_REPULSION_STRENGTH=e.DEFAULT_REPULSION_STRENGTH=L.nodeRepulsion),L.idealEdgeLength!=null&&(i.DEFAULT_EDGE_LENGTH=e.DEFAULT_EDGE_LENGTH=L.idealEdgeLength),L.edgeElasticity!=null&&(i.DEFAULT_SPRING_STRENGTH=e.DEFAULT_SPRING_STRENGTH=L.edgeElasticity),L.nestingFactor!=null&&(i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=e.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=L.nestingFactor),L.gravity!=null&&(i.DEFAULT_GRAVITY_STRENGTH=e.DEFAULT_GRAVITY_STRENGTH=L.gravity),L.numIter!=null&&(i.MAX_ITERATIONS=e.MAX_ITERATIONS=L.numIter),L.gravityRange!=null&&(i.DEFAULT_GRAVITY_RANGE_FACTOR=e.DEFAULT_GRAVITY_RANGE_FACTOR=L.gravityRange),L.gravityCompound!=null&&(i.DEFAULT_COMPOUND_GRAVITY_STRENGTH=e.DEFAULT_COMPOUND_GRAVITY_STRENGTH=L.gravityCompound),L.gravityRangeCompound!=null&&(i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=e.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=L.gravityRangeCompound),L.initialEnergyOnIncremental!=null&&(i.DEFAULT_COOLING_FACTOR_INCREMENTAL=e.DEFAULT_COOLING_FACTOR_INCREMENTAL=L.initialEnergyOnIncremental),L.quality=="draft"?t.QUALITY=0:L.quality=="proof"?t.QUALITY=2:t.QUALITY=1,i.NODE_DIMENSIONS_INCLUDE_LABELS=e.NODE_DIMENSIONS_INCLUDE_LABELS=t.NODE_DIMENSIONS_INCLUDE_LABELS=L.nodeDimensionsIncludeLabels,i.DEFAULT_INCREMENTAL=e.DEFAULT_INCREMENTAL=t.DEFAULT_INCREMENTAL=!L.randomize,i.ANIMATE=e.ANIMATE=t.ANIMATE=L.animate,i.TILE=L.tile,i.TILING_PADDING_VERTICAL=typeof L.tilingPaddingVertical=="function"?L.tilingPaddingVertical.call():L.tilingPaddingVertical,i.TILING_PADDING_HORIZONTAL=typeof L.tilingPaddingHorizontal=="function"?L.tilingPaddingHorizontal.call():L.tilingPaddingHorizontal};l.prototype.run=function(){var m,L,O=this.options;this.idToLNode={};var d=this.layout=new o,N=this;N.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:"layoutstart",layout:this});var s=d.newGraphManager();this.gm=s;var h=this.options.eles.nodes(),u=this.options.eles.edges();this.root=s.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(h),d);for(var p=0;p<u.length;p++){var A=u[p],C=this.idToLNode[A.data("source")],R=this.idToLNode[A.data("target")];if(C!==R&&C.getEdgesBetween(R).length==0){var x=s.add(d.newEdge(),C,R);x.id=A.id()}}var _=function(M,G){typeof M=="number"&&(M=G);var F=M.data("id"),b=N.idToLNode[F];return{x:b.getRect().getCenterX(),y:b.getRect().getCenterY()}},U=function X(){for(var M=function(){O.fit&&O.cy.fit(O.eles,O.padding),m||(m=!0,N.cy.one("layoutready",O.ready),N.cy.trigger({type:"layoutready",layout:N}))},G=N.options.refresh,F,b=0;b<G&&!F;b++)F=N.stopped||N.layout.tick();if(F){d.checkLayoutSuccess()&&!d.isSubLayout&&d.doPostLayout(),d.tilingPostLayout&&d.tilingPostLayout(),d.isLayoutFinished=!0,N.options.eles.nodes().positions(_),M(),N.cy.one("layoutstop",N.options.stop),N.cy.trigger({type:"layoutstop",layout:N}),L&&cancelAnimationFrame(L),m=!1;return}var Y=N.layout.getPositionsData();O.eles.nodes().positions(function(k,H){if(typeof k=="number"&&(k=H),!k.isParent()){for(var P=k.id(),B=Y[P],$=k;B==null&&(B=Y[$.data("parent")]||Y["DummyCompound_"+$.data("parent")],Y[P]=B,$=$.parent()[0],$!=null););return B!=null?{x:B.x,y:B.y}:{x:k.position("x"),y:k.position("y")}}}),M(),L=requestAnimationFrame(X)};return d.addListener("layoutstarted",function(){N.options.animate==="during"&&(L=requestAnimationFrame(U))}),d.runLayout(),this.options.animate!=="during"&&(N.options.eles.nodes().not(":parent").layoutPositions(N,N.options,_),m=!1),this},l.prototype.getTopMostNodes=function(m){for(var L={},O=0;O<m.length;O++)L[m[O].id()]=!0;var d=m.filter(function(N,s){typeof N=="number"&&(N=s);for(var h=N.parent()[0];h!=null;){if(L[h.id()])return!1;h=h.parent()[0]}return!0});return d},l.prototype.processChildrenList=function(m,L,O){for(var d=L.length,N=0;N<d;N++){var s=L[N],h=s.children(),u,p=s.layoutDimensions({nodeDimensionsIncludeLabels:this.options.nodeDimensionsIncludeLabels});if(s.outerWidth()!=null&&s.outerHeight()!=null?u=m.add(new g(O.graphManager,new a(s.position("x")-p.w/2,s.position("y")-p.h/2),new y(parseFloat(p.w),parseFloat(p.h)))):u=m.add(new g(this.graphManager)),u.id=s.data("id"),u.paddingLeft=parseInt(s.css("padding")),u.paddingTop=parseInt(s.css("padding")),u.paddingRight=parseInt(s.css("padding")),u.paddingBottom=parseInt(s.css("padding")),this.options.nodeDimensionsIncludeLabels&&s.isParent()){var A=s.boundingBox({includeLabels:!0,includeNodes:!1}).w,C=s.boundingBox({includeLabels:!0,includeNodes:!1}).h,R=s.css("text-halign");u.labelWidth=A,u.labelHeight=C,u.labelPos=R}if(this.idToLNode[s.data("id")]=u,isNaN(u.rect.x)&&(u.rect.x=0),isNaN(u.rect.y)&&(u.rect.y=0),h!=null&&h.length>0){var x;x=O.getGraphManager().add(O.newGraph(),u),this.processChildrenList(x,h,O)}}},l.prototype.stop=function(){return this.stopped=!0,this};var T=function(L){L("layout","cose-bilkent",l)};typeof cytoscape<"u"&&T(cytoscape),D.exports=T}])})}(tt)),tt.exports}var bt=Ft();const Ut=xt(bt);var at=function(){var I=S(function(O,d,N,s){for(N=N||{},s=O.length;s--;N[O[s]]=d);return N},"o"),w=[1,4],f=[1,13],D=[1,12],v=[1,15],r=[1,16],t=[1,20],e=[1,19],i=[6,7,8],o=[1,26],g=[1,24],a=[1,25],y=[6,7,11],n=[1,6,13,15,16,19,22],c=[1,33],l=[1,34],E=[1,6,7,11,13,15,16,19,22],T={trace:S(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:S(function(d,N,s,h,u,p,A){var C=p.length-1;switch(u){case 6:case 7:return h;case 8:h.getLogger().trace("Stop NL ");break;case 9:h.getLogger().trace("Stop EOF ");break;case 11:h.getLogger().trace("Stop NL2 ");break;case 12:h.getLogger().trace("Stop EOF2 ");break;case 15:h.getLogger().info("Node: ",p[C].id),h.addNode(p[C-1].length,p[C].id,p[C].descr,p[C].type);break;case 16:h.getLogger().trace("Icon: ",p[C]),h.decorateNode({icon:p[C]});break;case 17:case 21:h.decorateNode({class:p[C]});break;case 18:h.getLogger().trace("SPACELIST");break;case 19:h.getLogger().trace("Node: ",p[C].id),h.addNode(0,p[C].id,p[C].descr,p[C].type);break;case 20:h.decorateNode({icon:p[C]});break;case 25:h.getLogger().trace("node found ..",p[C-2]),this.$={id:p[C-1],descr:p[C-1],type:h.getType(p[C-2],p[C])};break;case 26:this.$={id:p[C],descr:p[C],type:h.nodeType.DEFAULT};break;case 27:h.getLogger().trace("node found ..",p[C-3]),this.$={id:p[C-3],descr:p[C-1],type:h.getType(p[C-2],p[C])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:w},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:w},{6:f,7:[1,10],9:9,12:11,13:D,14:14,15:v,16:r,17:17,18:18,19:t,22:e},I(i,[2,3]),{1:[2,2]},I(i,[2,4]),I(i,[2,5]),{1:[2,6],6:f,12:21,13:D,14:14,15:v,16:r,17:17,18:18,19:t,22:e},{6:f,9:22,12:11,13:D,14:14,15:v,16:r,17:17,18:18,19:t,22:e},{6:o,7:g,10:23,11:a},I(y,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:t,22:e}),I(y,[2,18]),I(y,[2,19]),I(y,[2,20]),I(y,[2,21]),I(y,[2,23]),I(y,[2,24]),I(y,[2,26],{19:[1,30]}),{20:[1,31]},{6:o,7:g,10:32,11:a},{1:[2,7],6:f,12:21,13:D,14:14,15:v,16:r,17:17,18:18,19:t,22:e},I(n,[2,14],{7:c,11:l}),I(E,[2,8]),I(E,[2,9]),I(E,[2,10]),I(y,[2,15]),I(y,[2,16]),I(y,[2,17]),{20:[1,35]},{21:[1,36]},I(n,[2,13],{7:c,11:l}),I(E,[2,11]),I(E,[2,12]),{21:[1,37]},I(y,[2,25]),I(y,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:S(function(d,N){if(N.recoverable)this.trace(d);else{var s=new Error(d);throw s.hash=N,s}},"parseError"),parse:S(function(d){var N=this,s=[0],h=[],u=[null],p=[],A=this.table,C="",R=0,x=0,_=2,U=1,X=p.slice.call(arguments,1),M=Object.create(this.lexer),G={yy:{}};for(var F in this.yy)Object.prototype.hasOwnProperty.call(this.yy,F)&&(G.yy[F]=this.yy[F]);M.setInput(d,G.yy),G.yy.lexer=M,G.yy.parser=this,typeof M.yylloc>"u"&&(M.yylloc={});var b=M.yylloc;p.push(b);var Y=M.options&&M.options.ranges;typeof G.yy.parseError=="function"?this.parseError=G.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function k(V){s.length=s.length-2*V,u.length=u.length-V,p.length=p.length-V}S(k,"popStack");function H(){var V;return V=h.pop()||M.lex()||U,typeof V!="number"&&(V instanceof Array&&(h=V,V=h.pop()),V=N.symbols_[V]||V),V}S(H,"lex");for(var P,B,$,K,Q={},q,j,gt,J;;){if(B=s[s.length-1],this.defaultActions[B]?$=this.defaultActions[B]:((P===null||typeof P>"u")&&(P=H()),$=A[B]&&A[B][P]),typeof $>"u"||!$.length||!$[0]){var st="";J=[];for(q in A[B])this.terminals_[q]&&q>_&&J.push("'"+this.terminals_[q]+"'");M.showPosition?st="Parse error on line "+(R+1)+`:
|
|
2
2
|
`+M.showPosition()+`
|
|
3
3
|
Expecting `+J.join(", ")+", got '"+(this.terminals_[P]||P)+"'":st="Parse error on line "+(R+1)+": Unexpected "+(P==U?"end of input":"'"+(this.terminals_[P]||P)+"'"),this.parseError(st,{text:M.match,token:this.terminals_[P]||P,line:M.yylineno,loc:b,expected:J})}if($[0]instanceof Array&&$.length>1)throw new Error("Parse Error: multiple actions possible at state: "+B+", token: "+P);switch($[0]){case 1:s.push(P),u.push(M.yytext),p.push(M.yylloc),s.push($[1]),P=null,x=M.yyleng,C=M.yytext,R=M.yylineno,b=M.yylloc;break;case 2:if(j=this.productions_[$[1]][1],Q.$=u[u.length-j],Q._$={first_line:p[p.length-(j||1)].first_line,last_line:p[p.length-1].last_line,first_column:p[p.length-(j||1)].first_column,last_column:p[p.length-1].last_column},Y&&(Q._$.range=[p[p.length-(j||1)].range[0],p[p.length-1].range[1]]),K=this.performAction.apply(Q,[C,x,R,G.yy,$[1],u,p].concat(X)),typeof K<"u")return K;j&&(s=s.slice(0,-1*j*2),u=u.slice(0,-1*j),p=p.slice(0,-1*j)),s.push(this.productions_[$[1]][0]),u.push(Q.$),p.push(Q._$),gt=A[s[s.length-2]][s[s.length-1]],s.push(gt);break;case 3:return!0}}return!0},"parse")},m=function(){var O={EOF:1,parseError:S(function(N,s){if(this.yy.parser)this.yy.parser.parseError(N,s);else throw new Error(N)},"parseError"),setInput:S(function(d,N){return this.yy=N||this.yy||{},this._input=d,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:S(function(){var d=this._input[0];this.yytext+=d,this.yyleng++,this.offset++,this.match+=d,this.matched+=d;var N=d.match(/(?:\r\n?|\n).*/g);return N?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),d},"input"),unput:S(function(d){var N=d.length,s=d.split(/(?:\r\n?|\n)/g);this._input=d+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-N),this.offset-=N;var h=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 u=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===h.length?this.yylloc.first_column:0)+h[h.length-s.length].length-s[0].length:this.yylloc.first_column-N},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-N]),this.yyleng=this.yytext.length,this},"unput"),more:S(function(){return this._more=!0,this},"more"),reject:S(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return 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).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:S(function(d){this.unput(this.match.slice(d))},"less"),pastInput:S(function(){var d=this.matched.substr(0,this.matched.length-this.match.length);return(d.length>20?"...":"")+d.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:S(function(){var d=this.match;return d.length<20&&(d+=this._input.substr(0,20-d.length)),(d.substr(0,20)+(d.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:S(function(){var d=this.pastInput(),N=new Array(d.length+1).join("-");return d+this.upcomingInput()+`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as n,a as G,j as l,c as V,R as re,b as se}from"./index-
|
|
1
|
+
import{r as n,a as G,j as l,c as V,R as re,b as se}from"./index-Dn3kYWFt.js";import{u as W}from"./ui-preferences-store-BmAT9G_p.js";import{e as ae,M as ie,T as oe,f as ce,t as le,g as ue,r as de,h as U,i as d,d as K,A as Y,p as fe,j as me,k as pe,S as be,l as ge,s as he,m as q,n as xe,o as ye,K as ke,q as we,v as Se,w as Ee}from"./aida-control-BuMafqCb.js";import{B as z,S as H}from"./textarea-DsHM-W2p.js";const ve=250;function Re(e){let m="idle",a=null,R=null,h=[],E=!1,k=null,x=0;function y(u){m!==u&&(m=u,e.onState(u))}function T(){if(R!==null){for(const u of R.getTracks())u.stop();R=null}a=null}async function B(){if(k!==null||m==="transcribing")return;if(typeof navigator>"u"||!navigator.mediaDevices?.getUserMedia||typeof MediaRecorder>"u"){y("error"),e.onError(ae);return}const u=x,i={startedAt:null,released:!1,aborted:!1};k=i;try{const o=await navigator.mediaDevices.getUserMedia({audio:!0});if(u!==x){for(const c of o.getTracks())c.stop();return}R=o,h=[],E=!1;const b=new MediaRecorder(o);b.ondataavailable=c=>{c.data&&c.data.size>0&&h.push(c.data)},b.onstop=()=>{C(u)},b.start(),a=b,i.startedAt=performance.now(),y("recording"),i.released&&p(i.aborted?"abort":"release")}catch(o){k=null,T(),y("error"),console.error("Error accessing microphone:",o),e.onError(ie)}}function w(u="release"){const i=k;if(i!==null){if(i.startedAt===null){i.released=!0,i.aborted=u==="abort";return}p(u)}}function N(){w("abort")}function p(u){const i=a;if(i===null)return;const o=k?.startedAt??null,b=o===null?Number.POSITIVE_INFINITY:performance.now()-o;if(k=null,u==="abort"||b<ve){E=!0,y("idle");try{i.stop()}catch{T()}return}E=!1,y("transcribing");try{i.stop()}catch{}}async function C(u){const i=new Blob(h,{type:"audio/webm"});if(h=[],T(),u===x){if(E||i.size===0){E=!1,y("idle");return}y("transcribing");try{const o=await oe.createTranscription(ce.baseUrl,{file:new File([i],"recording.webm",{type:"audio/webm"})});if(u!==x)return;const b=o.result?.text;b&&e.onResult(b),y("idle")}catch(o){if(u!==x)return;console.error("Error transcribing audio:",o),y("error"),e.onError(le(o))}}}return{get state(){return m},start:B,stop:w,cancel:N,dispose(){if(x+=1,k=null,a!==null)try{a.stop()}catch{}T(),m="idle"}}}const Te={send:"idle",seat:"pending",notice:null,retryable:!1};function Q(e,m){return e.send==="sending"||e.send==="sent"||e.seat==="blocked"?!1:m.trim().length>0}function Ne(e){return e.send!=="sending"}function Ce(e,m,a){if(e)return a?m?"mixed":"dictated":"typed"}const g={seatReady(e){return e.retryable&&e.notice!==null?{...e,seat:"ready"}:{...e,seat:"ready",notice:null,retryable:!1}},seatBlocked(e,m){return e.retryable&&e.notice!==null?{...e,seat:"blocked"}:{...e,seat:"blocked",notice:m,retryable:!1}},seatRetry(e){return{...e,seat:"pending"}},sendStarted(e){return{...e,send:"sending",notice:null,retryable:!1}},sendSucceeded(e){return{...e,send:"sent",notice:null,retryable:!1}},sendFailed(e,m,a){return{...e,send:"error",notice:m,retryable:a}},clearNotice(e){return e.notice===null?e:{...e,notice:null,retryable:!1}},summoned(e){return e.send!=="sent"?e:{...e,send:"idle"}}},De=600,Ie="aida_disabled";function je(){const[e,m]=n.useState(""),[a,R]=n.useState(Te),[h,E]=n.useState("idle"),[k,x]=n.useState(null),[y,T]=n.useState(ue),[B]=n.useState(de),w=n.useRef(a),N=n.useRef(e);n.useEffect(()=>{w.current=a},[a]),n.useEffect(()=>{N.current=e},[e]);const p=n.useRef(null),C=n.useRef(null),u=n.useRef(null),i=n.useRef(null),o=n.useRef("idle"),b=n.useRef(null),c=n.useCallback(t=>{R(s=>{const r=t(s);return w.current=r,r})},[]),D=n.useCallback(t=>{try{window.api?.miniView?.dismiss?.(t)?.catch?.(()=>{})}catch{}},[]),j=n.useRef(!1),A=n.useRef(!1),F=n.useRef(null);n.useEffect(()=>{e===""&&(j.current=!1,A.current=!1)},[e]);const $=n.useCallback(async()=>{let t=null;try{t=await U({op:"capabilities"})}catch{t=null}if(t===null)return F.current=null,p.current=null,c(s=>g.seatBlocked(s,d.seatUnreachable)),null;if(F.current=t,!K(t,"aida",1))return p.current=null,c(s=>g.seatBlocked(s,d.seatMissing)),null;try{const s=await U({op:"aida.status"});if(!s.enabled)return p.current=null,c(f=>g.seatBlocked(f,Y)),null;let r=s.session_id;return r||(r=(await U({op:"aida.control",action:"open"})).session_id),r?(p.current=r,c(f=>g.seatReady(f)),r):(p.current=null,c(f=>g.seatBlocked(f,d.seatOpenFailed)),null)}catch(s){p.current=null;const f=(s!==null&&typeof s=="object"&&"code"in s?String(s.code):"")===Ie?Y:d.seatUnreachable;return c(L=>g.seatBlocked(L,f)),null}},[c]),_=n.useCallback(()=>{if(p.current!==null)return Promise.resolve(p.current);if(C.current!==null)return C.current;const t=$().finally(()=>{C.current=null});return C.current=t,t},[$]),M=n.useCallback(async()=>{const t=N.current.trim();if(!Q(w.current,t)||o.current==="recording")return;b.current!==null&&(window.clearTimeout(b.current),b.current=null);const s=Ce(K(F.current,"input_mode"),j.current,A.current);c(r=>g.sendStarted(r));try{const r=p.current??await _();if(r===null){const v=w.current.notice??d.seatUnreachable;c(ne=>g.sendFailed(ne,v,!0));return}const f=fe(null,r,me.getState().drafts)??`send:${r}`;if(await pe(f,{text:t,attachments:[],images:[],mode:"prompt",cwd:"",inputMode:s},r)===null){c(v=>g.sendFailed(v,`${be.sendLock} ${d.keepText}`,!0));return}m(""),N.current="",j.current=!1,A.current=!1,c(v=>g.sendSucceeded(v)),b.current=window.setTimeout(()=>{b.current=null,o.current!=="recording"&&D("sent")},De)}catch(r){if(p.current=null,ge(r)){const f=he(r),L=`${f.message} ${d.keepText}`;c(v=>g.sendFailed(v,L,f.retry))}else c(f=>g.sendFailed(f,d.postAdmission,!1))}},[D,_,c]);n.useEffect(()=>{const t=Re({onState:s=>{o.current=s,E(s)},onResult:s=>{A.current=!0,m(r=>{const f=r.length===0?s:`${r}${r.endsWith(" ")?"":" "}${s}`;return N.current=f,f})},onError:s=>{x(s)}});return i.current=t,()=>{t.dispose(),i.current=null}},[]),n.useEffect(()=>(q("mini-view",h==="recording"),()=>q("mini-view",!1)),[h]);const P=n.useCallback(()=>{x(null),i.current?.start()},[]),O=n.useCallback(t=>{i.current?.stop(t??"release")},[]),J=n.useCallback(()=>{if(i.current!==null){if(o.current==="recording"){O("release");return}o.current!=="transcribing"&&P()}},[P,O]);xe("mini-view",ye.MESSAGE_INPUT,{start:P,stop:O},()=>o.current!=="recording"&&o.current!=="transcribing"&&w.current.send!=="sending"),n.useEffect(()=>window.api?.miniView?.onSummoned?.(()=>{G(W.getState().themeName),c(t=>g.summoned(t)),window.setTimeout(()=>u.current?.focus(),0),p.current===null&&_()}),[_,c]),n.useEffect(()=>{const t=r=>{typeof r?.value=="string"&&r.value!==""&&T(r.value)},s=window.api?.miniView?.onRegistration?.(t);return window.api?.miniView?.getRegistration?.()?.then?.(t)?.catch?.(()=>{}),s},[]),n.useEffect(()=>{const t=()=>{o.current!=="recording"&&D("blur")};return window.addEventListener("blur",t),()=>window.removeEventListener("blur",t)},[D]);const X=n.useCallback(t=>{if(t.key==="Escape"){if(t.nativeEvent.defaultPrevented)return;if(t.preventDefault(),o.current==="recording"){i.current?.cancel(),x(null);return}D("escape");return}if(!(t.key!=="Enter"||t.shiftKey||t.nativeEvent.isComposing||t.target?.tagName==="BUTTON")){if(t.preventDefault(),o.current==="recording"){i.current?.stop();return}M()}},[M,D]),I=a.notice??k,S=h==="recording",Z=!Q(a,e)||S,ee=S?d.recording:h==="transcribing"?d.transcribing:a.send==="sent"?d.sent:I??d.hint,te=a.send==="sent"?"text-ink-muted":S?"text-accent":a.send==="error"||I!==null&&I===k?"text-danger":"text-ink-muted";return l.jsxs("div",{className:"flex h-screen w-screen flex-col gap-2 bg-canvas p-3 text-ink",onKeyDown:X,children:[l.jsxs("div",{className:"flex h-4 shrink-0 items-center justify-between pb-0.5",children:[l.jsx("span",{className:"text-meta text-ink-muted",children:d.seatLabel}),l.jsx(ke,{shortcut:we(y,B).join("+"),joined:!0})]}),l.jsx("textarea",{ref:u,"data-tour-tag":"mini-composer-input",value:e,disabled:!Ne(a),placeholder:d.placeholder,"aria-label":d.placeholder,onChange:t=>{j.current=!0,x(null),m(t.target.value)},className:V("min-h-0 w-full flex-1 resize-none rounded-sm border border-control bg-elevated px-3 py-2","text-body-sm text-ink placeholder:text-ink-dim","transition-colors duration-fast ease-out-quart","disabled:border-hairline disabled:bg-sunken disabled:text-ink-disabled","disabled:placeholder:text-ink-disabled")}),l.jsxs("div",{className:"flex h-8 shrink-0 items-center justify-between gap-2",children:[l.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[l.jsx(z,{variant:"ghost",size:"icon-sm","data-tour-tag":"mini-composer-mic","aria-label":S?d.dictationStop:d.dictationStart,disabled:h==="transcribing"||a.send==="sending",onClick:J,children:S?l.jsx(Se,{"aria-hidden":"true"}):h==="transcribing"?l.jsx(H,{size:"xs"}):l.jsx(Ee,{"aria-hidden":"true"})}),S?l.jsxs("span",{className:"relative block size-2 shrink-0","aria-hidden":"true",children:[l.jsx("span",{className:"absolute inset-0 rounded-full border border-accent opacity-0 animate-ping"}),l.jsx("span",{className:"block size-2 rounded-full bg-accent"})]}):null,l.jsx("span",{"data-tour-tag":"mini-composer-status",role:I!==null||S?"status":void 0,"aria-live":I!==null?"polite":void 0,className:V("truncate text-meta",te),children:ee})]}),l.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[a.send==="error"&&a.retryable?l.jsx(z,{variant:"ghost",size:"sm","data-tour-tag":"mini-composer-retry",disabled:S,onClick:()=>{a.seat==="blocked"?(p.current=null,c(t=>g.seatRetry(t))):c(t=>g.clearNotice(t)),M()},children:d.retry}):null,l.jsx(z,{variant:"primary",size:"md","data-tour-tag":"mini-composer-send",disabled:Z,onClick:()=>void M(),children:a.send==="sending"?l.jsxs(l.Fragment,{children:[l.jsx(H,{size:"xs"}),d.send]}):d.send})]})]})]})}G(W.getState().themeName);document.addEventListener("DOMContentLoaded",()=>{const e=document.getElementById("mini-view");e&&re.createRoot(e).render(l.jsx(se.StrictMode,{children:l.jsx(je,{})}))});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as r,
|
|
1
|
+
import{D as r,c as t}from"./aida-control-BuMafqCb.js";const s=a=>a==="active"||a==="past_due",n=a=>a.status!=="active"?"no_access":s(a.plan.status)?"available":"plan_inactive",l=a=>a.filter(e=>n(e)==="available"),i=a=>a.filter(e=>n(e)==="plan_inactive"),u=a=>{if(!(a instanceof r))return null;switch(a.code){case"team_plan_required":return"plan";case"not_a_member":case"insufficient_role":return"no_access";default:return null}},c="Sharing agents with an organization needs a newer Local Operator backend. Update the backend and try again.",d=a=>a==="enabled",f=(a,e)=>a==="enabled"||a==="unknown"?null:t(a,e)??c;export{f as a,d as b,u as o,i as p,l as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./index-
|
|
1
|
+
import{j as e}from"./index-Dn3kYWFt.js";const l=({title:a,icon:t,subtitle:s,children:i})=>e.jsxs("div",{className:"@container flex flex-wrap items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex min-w-0 items-start gap-4",children:[e.jsx(t,{size:24,"aria-hidden":"true",className:"mt-1 shrink-0 text-ink-muted"}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("h1",{className:"text-display text-ink",children:a}),s&&e.jsx("p",{className:"max-w-200 text-body text-ink-muted",children:s})]})]}),i]});export{l as P};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as D,c as p,m as N,a as g}from"./en-US-BcB1DWxG.js";function W(t,e,n){const r=D(t,n?.in);return isNaN(e)?p(n?.in||t,NaN):(e&&r.setDate(r.getDate()+e),r)}function $(t,e){const n=()=>p(e?.in,NaN),a=I(t);let s;if(a.date){const i=x(a.date,2);s=Y(i.restDateString,i.year)}if(!s||isNaN(+s))return n();const u=+s;let o=0,c;if(a.time&&(o=w(a.time),isNaN(o)))return n();if(a.timezone){if(c=y(a.timezone),isNaN(c))return n()}else{const i=new Date(u+o),d=D(0,e?.in);return d.setFullYear(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()),d.setHours(i.getUTCHours(),i.getUTCMinutes(),i.getUTCSeconds(),i.getUTCMilliseconds()),d}return D(u+o+c,e?.in)}const f={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},U=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,h=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,C=/^([+-])(\d{2})(?::?(\d{2}))?$/;function I(t){const e={},n=t.split(f.dateTimeDelimiter);let r;if(n.length>2)return e;if(/:/.test(n[0])?r=n[0]:(e.date=n[0],r=n[1],f.timeZoneDelimiter.test(e.date)&&(e.date=t.split(f.timeZoneDelimiter)[0],r=t.substr(e.date.length,t.length))),r){const a=f.timezone.exec(r);a?(e.time=r.replace(a[1],""),e.timezone=a[1]):e.time=r}return e}function x(t,e){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=t.match(n);if(!r)return{year:NaN,restDateString:""};const a=r[1]?parseInt(r[1]):null,s=r[2]?parseInt(r[2]):null;return{year:s===null?a:s*100,restDateString:t.slice((r[1]||r[2]).length)}}function Y(t,e){if(e===null)return new Date(NaN);const n=t.match(U);if(!n)return new Date(NaN);const r=!!n[4],a=l(n[1]),s=l(n[2])-1,u=l(n[3]),o=l(n[4]),c=l(n[5])-1;if(r)return Z(e,o,c)?z(e,o,c):new Date(NaN);{const i=new Date(0);return!M(e,s,u)||!O(e,a)?new Date(NaN):(i.setUTCFullYear(e,s,Math.max(a,u)),i)}}function l(t){return t?parseInt(t):1}function w(t){const e=t.match(h);if(!e)return NaN;const n=m(e[1]),r=m(e[2]),a=m(e[3]);return k(n,r,a)?n*N+r*g+a*1e3:NaN}function m(t){return t&&parseFloat(t.replace(",","."))||0}function y(t){if(t==="Z")return 0;const e=t.match(C);if(!e)return 0;const n=e[1]==="+"?-1:1,r=parseInt(e[2]),a=e[3]&&parseInt(e[3])||0;return R(r,a)?n*(r*N+a*g):NaN}function z(t,e,n){const r=new Date(0);r.setUTCFullYear(t,0,4);const a=r.getUTCDay()||7,s=(e-1)*7+n+1-a;return r.setUTCDate(r.getUTCDate()+s),r}const F=[31,null,31,30,31,30,31,31,30,31,30,31];function T(t){return t%400===0||t%4===0&&t%100!==0}function M(t,e,n){return e>=0&&e<=11&&n>=1&&n<=(F[e]||(T(t)?29:28))}function O(t,e){return e>=1&&e<=(T(t)?366:365)}function Z(t,e,n){return e>=1&&e<=53&&n>=0&&n<=6}function k(t,e,n){return t===24?e===0&&n===0:n>=0&&n<60&&e>=0&&e<60&&t>=0&&t<25}function R(t,e){return e>=0&&e<=59}export{W as a,$ as p};
|