MOON
Server: Apache
System: Linux server1.studioinfinity.com.br 2.6.32-954.3.5.lve1.4.90.el6.x86_64 #1 SMP Tue Feb 21 12:26:30 UTC 2023 x86_64
User: artinside (517)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //proc/self/root/opt/netdata/netdata-web-files/v3/5219.e0ec574cd9766c24d96c.chunk.js
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"b06348a4787b660201b18f5fa878e4faccd4b679"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7ef2e771-21c3-45e4-8b94-82c59dd047b8",e._sentryDebugIdIdentifier="sentry-dbid-7ef2e771-21c3-45e4-8b94-82c59dd047b8")}catch(e){}}(),(globalThis.webpackChunkcloud_frontend=globalThis.webpackChunkcloud_frontend||[]).push([[5219],{82276(e,t,r){r.d(t,{A:()=>Re,z:()=>Te});r(74423),r(98992),r(23215),r(54520),r(72577),r(3949),r(81454),r(71517),r(11379),r(93777),r(14190),r(12359),r(86097),r(17273),r(27415),r(19929),r(37583),r(55122),r(20230),r(57268),r(79733),r(25509),r(65223),r(60321),r(41927),r(11632),r(64377),r(66771),r(12516),r(68931),r(52514),r(35694),r(52774),r(49536),r(21926),r(94483),r(16215);var o=r(96540),n=r(38429),s=r(882),a=r(43905),i=r(85660),l=r(69982);var c=r(49440),d=r(32981),u=r(15036);const h=(e,t)=>e&&"transparent"!==e?e.startsWith("#")?e:(0,n.getColor)(e)({theme:t}):e,p={primary:{color:"primary",border:"bright",label:1,linkWidth:1.5,linkOpacity:.95},secondary:{color:"generic",border:"generic",label:.95,linkWidth:1,linkOpacity:.92},accent:{color:"accent",border:"bright",label:1,linkWidth:2,linkOpacity:.98},self:{color:"textDescription",nodeColor:"elementBackground",border:"text",label:1,linkWidth:1,linkOpacity:.82},neutral:{color:"textDescription",border:"borderSecondary",label:.9,linkWidth:1,linkOpacity:.8},muted:{color:"stale",border:"transparent",label:.72,linkWidth:1,linkOpacity:.62},dim:{color:"offline",border:"transparent",label:.72,linkWidth:1,linkOpacity:.7},derived:{color:"unseen",border:"unseen",label:.9,linkWidth:1,linkOpacity:.92},info:{color:"strokeMain",border:"strokeMain",label:.92,linkWidth:1,linkOpacity:.92},structural:{color:"textDescription",border:"text",label:.95,linkWidth:1,linkOpacity:.8},warning:{color:"warning",border:"bright",label:1,linkWidth:1,linkOpacity:.95}},g={color:"textDescription",border:"borderSecondary",label:.82,linkWidth:1,linkOpacity:.82},f=(e,t)=>{if(!e)return{fill:h(g.color,t),sizeFactor:1,borderColor:h(g.border,t),borderWidth:1,labelOpacity:g.label};const r=((e,t,r)=>{const o=p[e]||g;return{fill:h(o.nodeColor||o.color,r),border:h(o.border,r),labelOpacity:t>0?t:o.label}})(e.color_slot,e.opacity,t);return{fill:r.fill,sizeFactor:1,borderColor:e.border?r.border:"transparent",borderWidth:e.border?1:0,labelOpacity:r.labelOpacity,sizeByLinks:!!e.size_by_links,showPortBullets:!!e.show_port_bullets}},m=(e,t)=>{if(!e)return{color:h(g.color,t),widthFactor:1,opacity:g.linkOpacity};const r=((e,t,r,o)=>{const n=p[e]||g;return{color:h(n.color,o),width:r>0?r:n.linkWidth,opacity:t>0?t:n.linkOpacity}})(e.color_slot,e.opacity,e.width,t);return{color:r.color,widthFactor:r.width,opacity:r.opacity,dashArray:e.dash?"4 4":void 0}},y=(e,t)=>h((p[e]||g).color,t),x=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return e.replace(/S/g,`stroke="#fff" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="${t}"`)},b={router:x('<g S><line x1="12" y1="1" x2="12" y2="9"/><polyline points="9,6 12,9 15,6"/><line x1="12" y1="23" x2="12" y2="15"/><polyline points="9,18 12,15 15,18"/><line x1="1" y1="12" x2="9" y2="12"/><polyline points="6,9 9,12 6,15"/><line x1="23" y1="12" x2="15" y2="12"/><polyline points="18,9 15,12 18,15"/></g>'),switch:x('<g S><line x1="2" y1="9" x2="22" y2="9"/><polyline points="6,6 2,9 6,12"/><line x1="22" y1="15" x2="2" y2="15"/><polyline points="18,12 22,15 18,18"/></g>'),firewall:x('<g S><path d="M12 2L4 6v6c0 5.5 3.4 8.7 8 10 4.6-1.3 8-4.5 8-10V6z"/><line x1="8" y1="11" x2="16" y2="11"/><line x1="12" y1="7" x2="12" y2="15"/></g>'),access_point:x('<g S><line x1="12" y1="14" x2="12" y2="22"/><circle cx="12" cy="14" r="1.5" fill="#fff"/><path d="M8.5 10.5a5 5 0 0 1 7 0"/><path d="M5.5 7.5a9 9 0 0 1 13 0"/></g>'),server:x('<g S><rect x="4" y="2" width="16" height="7" rx="1.5"/><rect x="4" y="11" width="16" height="7" rx="1.5"/><circle cx="8" cy="5.5" r="1" fill="#fff"/><circle cx="8" cy="14.5" r="1" fill="#fff"/><line x1="12" y1="5.5" x2="17" y2="5.5"/><line x1="12" y1="14.5" x2="17" y2="14.5"/></g>',1.5),storage:x('<g S><ellipse cx="12" cy="5" rx="8" ry="3"/><path d="M4 5v14c0 1.7 3.6 3 8 3s8-1.3 8-3V5"/><path d="M4 12c0 1.7 3.6 3 8 3s8-1.3 8-3"/></g>',1.5),load_balancer:x('<g S><line x1="3" y1="12" x2="10" y2="12"/><line x1="10" y1="12" x2="20" y2="5"/><line x1="10" y1="12" x2="20" y2="12"/><line x1="10" y1="12" x2="20" y2="19"/><polyline points="17,3 20,5 17,7"/><polyline points="17,10 20,12 17,14"/><polyline points="17,17 20,19 17,21"/></g>'),printer:x('<g S><path d="M6 9V2h12v7"/><rect x="6" y="15" width="12" height="6" rx="1"/><path d="M6 15H4a1 1 0 0 1-1-1v-4a1 1 0 0 1 1-1h16a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-2"/></g>',1.5),phone:x('<g S><rect x="7" y="2" width="10" height="20" rx="2.5"/><line x1="10" y1="18" x2="14" y2="18"/></g>'),ups:x('<g S><rect x="6" y="4" width="12" height="18" rx="2"/><line x1="10" y1="2" x2="10" y2="4"/><line x1="14" y1="2" x2="14" y2="4"/><polyline points="13,10 11,13 14,13 12,16"/></g>',1.5),camera:x('<g S><path d="M2 8h3l2-3h10l2 3h3v11a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V8z"/><circle cx="12" cy="14" r="3.5"/></g>',1.5),process:x('<g S><circle cx="12" cy="12" r="3"/><line x1="12" y1="1" x2="12" y2="5"/><line x1="12" y1="19" x2="12" y2="23"/><line x1="4.2" y1="4.2" x2="7" y2="7"/><line x1="17" y1="17" x2="19.8" y2="19.8"/><line x1="1" y1="12" x2="5" y2="12"/><line x1="19" y1="12" x2="23" y2="12"/><line x1="4.2" y1="19.8" x2="7" y2="17"/><line x1="17" y1="7" x2="19.8" y2="4.2"/></g>',1.5),agent:x('<g S><rect x="3" y="3" width="18" height="13" rx="2"/><polyline points="7,12 10,7 13,13 16,9"/><line x1="8" y1="20" x2="16" y2="20"/><line x1="12" y1="16" x2="12" y2="20"/></g>'),"netdata-agent":x('<g S><rect x="3" y="3" width="18" height="13" rx="2"/><polyline points="7,12 10,7 13,13 16,9"/><line x1="8" y1="20" x2="16" y2="20"/><line x1="12" y1="16" x2="12" y2="20"/></g>'),parent:x('<g S><rect x="4" y="6" width="16" height="14" rx="1.5"/><line x1="12" y1="6" x2="12" y2="2"/><polyline points="9,4 12,1 15,4"/><circle cx="8" cy="10" r="1" fill="#fff"/><line x1="12" y1="10" x2="17" y2="10"/><circle cx="8" cy="16" r="1" fill="#fff"/><line x1="12" y1="16" x2="17" y2="16"/></g>',1.5),"remote-endpoint":x('<g S><circle cx="12" cy="12" r="10"/><path d="M2 12h20"/><path d="M12 2c-3 3-3 17 0 20"/><path d="M12 2c3 3 3 17 0 20"/></g>',1.5),"local-endpoint":x('<g S><circle cx="12" cy="10" r="8"/><circle cx="12" cy="10" r="1.5" fill="#fff"/><path d="M12 18v4"/><line x1="8" y1="22" x2="16" y2="22"/></g>',1.5),segment:x('<g S><path d="M6 20a4 4 0 0 1-.8-7.9 7 7 0 0 1 13.3-2.6A4.5 4.5 0 0 1 19 18H6z"/></g>'),self:x('<g S><rect x="2" y="3" width="20" height="13" rx="2"/><line x1="2" y1="20" x2="22" y2="20"/><line x1="7" y1="16" x2="7" y2="20"/><line x1="17" y1="16" x2="17" y2="20"/></g>'),ip:x('<g S><circle cx="12" cy="12" r="10"/><path d="M2 12h20"/><path d="M12 2c-3 3-3 17 0 20"/><path d="M12 2c3 3 3 17 0 20"/></g>',1.5),cloud:x('<g S><path d="M6 20a4 4 0 0 1-.8-7.9 7 7 0 0 1 13.3-2.6A4.5 4.5 0 0 1 19 18H6z"/><polyline points="12,13 12,7"/><polyline points="9,10 12,7 15,10"/></g>'),container:x('<g S><rect x="3" y="4" width="18" height="16" rx="2"/><line x1="3" y1="10" x2="21" y2="10"/><line x1="9" y1="4" x2="9" y2="10"/><line x1="15" y1="4" x2="15" y2="10"/></g>',1.5),vm:x('<g S><rect x="3" y="3" width="18" height="13" rx="2" stroke-dasharray="3 2"/><line x1="8" y1="20" x2="16" y2="20"/><line x1="12" y1="16" x2="12" y2="20"/></g>'),database:x('<g S><ellipse cx="12" cy="5" rx="8" ry="3"/><path d="M4 5v14c0 1.7 3.6 3 8 3s8-1.3 8-3V5"/><path d="M4 10c0 1.7 3.6 3 8 3s8-1.3 8-3"/><path d="M4 15c0 1.7 3.6 3 8 3s8-1.3 8-3"/></g>',1.5),service:x('<g S><circle cx="12" cy="6" r="3"/><circle cx="5" cy="18" r="3"/><circle cx="19" cy="18" r="3"/><line x1="12" y1="9" x2="5" y2="15"/><line x1="12" y1="9" x2="19" y2="15"/><line x1="5" y1="18" x2="19" y2="18"/></g>',1.5)},v=e=>b[e]||null;var w=r(69531);r(8872);let k=null;const _=async(e,t,o)=>{const n=performance.now();try{const s=await(k||(k=r.e(7080).then(r.bind(r,74699)).then(async e=>(await e.default(),e)).catch(e=>(console.warn("WASM module load failed:",e),k=null,null))),k);if(!s)return{positions:null,wasmMs:0,initMs:performance.now()-n,totalMs:performance.now()-n};const a=performance.now(),i={},l=[],c=[];e.forEach((e,t)=>{i[e.id]=t,l.push(e.x??o[0]+200*(Math.random()-.5),e.y??o[1]+200*(Math.random()-.5)),c.push(1)});const d=[],u=[];t.forEach(e=>{const t="object"===typeof e.source?e.source.id:e.source,r="object"===typeof e.target?e.target.id:e.target,o=i[t],n=i[r];void 0!==o&&void 0!==n&&(d.push([n,o]),u.push(e.weight||1),c[o]+=e.weight||1,c[n]+=e.weight||1)});const h=performance.now(),p=s.force({name:0,dimensions:2,chunk_size:256,nodes:l,edges:d,masses:c,weights:u,iterations:100,min_movement:.5,distance_threshold_mode:0,center:o,ka:1,kg:5,kr:10,speed:.1,prevent_overlapping:!1,node_radius:10,kr_prime:10,strong_gravity:!1,lin_log:!1,dissuade_hubs:!1,edge_strength:0,link_distance:0,node_strength:0,coulomb_dis_scale:0,factor:0,interval:0,damping:0,max_speed:0,max_distance:100}),g=performance.now(),f=new Map;return e.forEach((e,t)=>{f.set(e.id,{x:p[2*t],y:p[2*t+1]})}),{positions:f,wasmMs:g-h,initMs:a-n,totalMs:g-n}}catch(s){return console.warn("WASM ForceAtlas2 failed, falling back to D3:",s),k=null,{positions:null,wasmMs:0,initMs:performance.now()-n,totalMs:performance.now()-n}}},C=(e,t,r)=>Math.min(r,Math.max(t,e)),j=function(e,t,r){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;if(!e.length||!t||!r)return a.zoomIdentity;let n=1/0,s=-1/0,i=1/0,l=-1/0;e.forEach(e=>{const t=e.x||0,r=e.y||0;t<n&&(n=t),t>s&&(s=t),r<i&&(i=r),r>l&&(l=r)});const c=(t-120)*o/(s-n||1),d=(r-120)*o/(l-i||1),u=Math.min(c,d,2),h=(n+s)/2,p=(i+l)/2;return a.zoomIdentity.translate(t/2,r/2).scale(u).translate(-h,-p)},M=100,S=e=>{if(!Number.isFinite(e)||e<=1)return 0;const t=6.8*e/(2*Math.PI);return Math.max(8,t-9)},I=e=>e<=0||e<=8?1:e<=16?1.08:e<=24?1.18:e<=32?1.28:e<=48?1.42:e<=64?1.56:e<=96?1.8:2,L=(e,t)=>{const r=C(80+14*Math.log10((e.weight||1)+1),70,210),o=e.source?.id??e.source,n=e.target?.id??e.target;return(t?.get(o)||0)+r+(t?.get(n)||0)},T=e=>{let{graphData:t,portObservationLinks:r,width:n,height:s,filterKey:i,targetRef:l,positionsRef:h,hasInitialLayoutRef:p,prevFilterKeyRef:g,pendingFilterResetRef:f,zoomBehaviorRef:m,forcesOnRef:y,setZoomTransform:x}=e;const[b,v]=(0,o.useState)({nodes:[],links:[]}),[w,k]=(0,o.useState)(!1),C=(0,o.useRef)(null),T=(0,o.useRef)(new Map),$=(0,o.useRef)(""),E=(0,o.useRef)(null);return(0,o.useEffect)(()=>()=>{C.current?.stop(),C.current=null,$.current="",E.current&&(cancelAnimationFrame(E.current),E.current=null)},[]),(0,o.useEffect)(()=>{i!==g.current&&(g.current=i,f.current=!0)},[i]),(0,o.useEffect)(()=>{if(!n||!t.nodes.length)return C.current?.stop(),C.current=null,$.current="",void v({nodes:[],links:[]});f.current&&(f.current=!1,h.current.clear(),p.current=!1,$.current="");const e=`${t.nodes.map(e=>e.id).sort().join("|")}::${t.links.map(e=>`${e.source}->${e.target}`).sort().join("|")}`,o=e!==$.current;if($.current=e,o){const e=new Set(t.nodes.map(e=>e.id));h.current.forEach((t,r)=>{e.has(r)||h.current.delete(r)})}const i=t.nodes.every(e=>h.current.has(e.id));if(!o&&i)return void v({nodes:t.nodes.map(e=>{const t=h.current.get(e.id);return{...e,x:t?.x??e.x,y:t?.y??e.y}}),links:t.links});C.current?.stop(),E.current&&(cancelAnimationFrame(E.current),E.current=null);const g=t.nodes.map(e=>({...e})),b=new Map(g.map(e=>[e.id,e])),w=g.filter(e=>h.current.has(e.id)).length,R=w>.5*g.length,A=t.links.map(e=>({...e,source:b.get(e.source),target:b.get(e.target)})).filter(e=>e.source&&e.target);T.current=b;let N=n/2,P=s/2;if(R&&w>0){let e=0,t=0,r=0;g.forEach(o=>{const n=h.current.get(o.id);n&&(e+=n.x,t+=n.y,r++)}),r>0&&(N=e/r,P=t/r)}const F=new Set;A.forEach(e=>{F.add(e.source.id),F.add(e.target.id)});const B=new Map;g.forEach(e=>{B.set(e.id,(0,d.gl)(e))});const z=new Map,O=(e,t)=>{e&&(z.has(e)||z.set(e,new Set),z.get(e).add(t))};(Array.isArray(r)?r:A).forEach(e=>{const t=e.source?.id??e.source,r=e.target?.id??e.target;O(t,(0,d.EF)(B.get(t),e.sourcePort)),O(r,(0,d.EF)(B.get(r),e.targetPort))});const D=new Map;g.forEach(e=>{const t=B.get(e.id),r=!!t?.ports?.size,o=new Set;r&&t.ports.forEach((e,t)=>o.add(t)),(z.get(e.id)||new Set).forEach(e=>{r&&e===u.Lc||o.add(e)});const n=[...o].filter(e=>e!==u.Lc).length+(o.has(u.Lc)?1:0),s=n>1?n:0,a=Math.min(s,M),i=(0,d.Yh)(e,t),l=(0,c.pV)(e)&&!e?.inferred?I(i):1,h=`${e?.actorType||e?.kind||""}`.toLowerCase(),p=`${e?.details?.labels?.actor_class||e?.details?.attributes?.actor_class||""}`.toLowerCase(),g=9*l*("self"===h||"self"===p?1.18:1),f=S(a),m=((e,t)=>{const r=Number.isFinite(e)?e:0;return t>0?r+9+3.2:r})(Math.min(120,Math.max(g,f)),a);D.set(e.id,m+2)});const W=e=>F.has(e.id)?.01:.25,Y=((e,t,r,o)=>{const n=new Map;if(!e.length)return n;const s=new Map;e.forEach(e=>s.set(e.id,[])),t.forEach(e=>{const t=e.source?.id??e.source,r=e.target?.id??e.target;s.has(t)&&s.get(t).push(r),s.has(r)&&s.get(r).push(t)});const a=[...e].sort((e,t)=>{const r=s.get(e.id)?.length||0,o=s.get(t.id)?.length||0;return o!==r?o-r:e.id<t.id?-1:e.id>t.id?1:0}),i=new Set,l=(e,t,r)=>{n.set(e,{x:t,y:r}),i.add(e);let o=[e],a=1;for(;o.length;){const e=[];if(o.forEach(t=>{(s.get(t)||[]).slice().sort().forEach(t=>{i.has(t)||(i.add(t),e.push(t))})}),!e.length)break;e.sort();const l=70*e.length,c=Math.max(120*a,l/(2*Math.PI)),d=2*Math.PI/e.length;e.forEach((e,o)=>{const s=o*d-Math.PI/2;n.set(e,{x:t+c*Math.cos(s),y:r+c*Math.sin(s)})}),o=e,a++}return a};let c=l(a[0].id,r,o),d=0;for(;;){const e=a.find(e=>!i.has(e.id)&&(s.get(e.id)?.length||0)>0);if(!e)break;d++;const t=2*d*Math.PI/Math.max(d+1,4),n=120*(c+2);c=Math.max(c,l(e.id,r+n*Math.cos(t),o+n*Math.sin(t)))}const u=a.filter(e=>!i.has(e.id));if(u.length){const e=70*u.length,t=Math.max(120*(c+1),e/(2*Math.PI)),s=2*Math.PI/u.length;u.forEach((e,a)=>{const i=a*s-Math.PI/2;n.set(e.id,{x:r+t*Math.cos(i),y:o+t*Math.sin(i)})})}return n})(g,A,N,P);g.forEach(e=>{if(R){const t=h.current.get(e.id);if(t)e.x=t.x,e.y=t.y;else{const t=Y.get(e.id);t&&(e.x=t.x,e.y=t.y)}}else{const t=Y.get(e.id);t&&(e.x=t.x,e.y=t.y)}e.vx=0,e.vy=0});const V=()=>{const e=g.map(e=>{const t=e.x||0,r=e.y||0;return h.current.set(e.id,{x:t,y:r}),{...e,x:t,y:r}}),t=A.map(e=>({...e,source:e.source.id,target:e.target.id}));v({nodes:e,links:t})},U=e=>{const t=!F.has(e.id);return(0,c.Po)(e)?-90:(0,c._B)(e)?t?-150:-440:(0,c._N)(e)?t?-350:-1100:(0,c.Lf)(e)?t?-280:-860:(0,c.FL)(e)?t?-90:-260:t?-170:-520};let K=!1;return(async()=>{k(!0);const e=await _(g,A,[N,P]);if(K)return void k(!1);let t;if(e.positions){g.forEach(t=>{if(!F.has(t.id))return;if(R&&h.current.has(t.id))return;const r=e.positions.get(t.id);r&&(t.x=r.x,t.y=r.y,t.vx=0,t.vy=0)});const r=(()=>{const e=a.forceSimulation(g).randomSource(a.randomLcg(42)).alpha(.8).alphaDecay(0).velocityDecay(.3).force("link",a.forceLink(A).id(e=>e.id).distance(e=>L(e,D)).strength(.55)).force("charge",a.forceManyBody().strength(U)).force("center",a.forceCenter(N,P)).force("x",a.forceX(N).strength(W)).force("y",a.forceY(P).strength(W)).force("collide",a.forceCollide().radius(e=>D.get(e.id)||32).iterations(2));e.stop(),g.forEach(e=>{F.has(e.id)?R&&h.current.has(e.id)&&(e.fx=e.x,e.fy=e.y):(e.fx=e.x,e.fy=e.y)});let t=0;for(let r=0;r<200&&(e.tick(),t++,!(g.reduce((e,t)=>Math.max(e,Math.abs(t.vx||0),Math.abs(t.vy||0)),0)<.5));r++);return{simulation:e,ticks:t}})();t=r.simulation}else t=(()=>{const e=a.forceSimulation(g).randomSource(a.randomLcg(42)).alpha(R?.3:1).alphaDecay(0).velocityDecay(.3).force("link",a.forceLink(A).id(e=>e.id).distance(e=>L(e,D)).strength(.55)).force("charge",a.forceManyBody().strength(U)).force("center",a.forceCenter(N,P)).force("x",a.forceX(N).strength(W)).force("y",a.forceY(P).strength(W)).force("collide",a.forceCollide().radius(e=>D.get(e.id)||32).iterations(2));e.stop(),g.forEach(e=>{F.has(e.id)?R&&h.current.has(e.id)&&(e.fx=e.x,e.fy=e.y):(e.fx=e.x,e.fy=e.y)});for(let t=0;t<600&&(e.tick(),!(g.reduce((e,t)=>Math.max(e,Math.abs(t.vx||0),Math.abs(t.vy||0)),0)<.5));t++);return e})();if(K)return t.stop(),void k(!1);let r=0,o=0;g.forEach(e=>{r+=e.x||0,o+=e.y||0}),r/=g.length||1,o/=g.length||1,t.force("center",a.forceCenter(r,o)),t.force("x",a.forceX(r).strength(.002)),t.force("y",a.forceY(o).strength(.002)),g.forEach(e=>{e.vx=0,e.vy=0}),t.alpha(.1),t.alphaDecay(0);for(let n=0;n<100;n++){t.tick();if(g.reduce((e,t)=>Math.max(e,Math.abs(t.vx||0),Math.abs(t.vy||0)),0)<.3)break}if(g.forEach(e=>{e.fx=null,e.fy=null,e.vx=0,e.vy=0}),t.alphaDecay(.0228),t.alpha(0),g.forEach(e=>{h.current.set(e.id,{x:e.x||0,y:e.y||0})}),V(),!p.current){const e=j(g,n,s);x(e),m.current&&l.current&&a.select(l.current).call(m.current.transform,e),p.current=!0}t.on("tick",()=>{E.current||(E.current=requestAnimationFrame(()=>{E.current=null,V()}))}),t.on("end",V),C.current=t,y.current&&t.alphaTarget(.01).restart(),k(!1)})(),()=>{K=!0}},[t,n,s]),{layout:b,setLayout:v,layoutComputing:w,simulationRef:C,nodesByIdRef:T,graphStructureKeyRef:$,frameRef:E}},$=new Map,E=(e,t)=>{if(!e)return null;const r=$.get(e);if(r)return r.complete&&r.naturalWidth>0?r:null;const o=((e,t)=>{const r=new Blob([`<svg xmlns="http://www.w3.org/2000/svg" width="256" height="256" viewBox="0 0 24 24">${e}</svg>`],{type:"image/svg+xml;charset=utf-8"}),o=URL.createObjectURL(r),n=new Image;return n.onload=()=>{URL.revokeObjectURL(o),t?.()},n.onerror=()=>{URL.revokeObjectURL(o)},n.src=o,n})(e,t);return $.set(e,o),null},R=/[\s,]+/,A=e=>e?`${e}`.split(R).map(e=>Number(e)).filter(e=>Number.isFinite(e)&&e>0):[],N=(e,t,r)=>e?(e.width!==t&&(e.width=t),e.height!==r&&(e.height=r),e):((e,t)=>{if("undefined"!==typeof OffscreenCanvas)return new OffscreenCanvas(e,t);const r=document.createElement("canvas");return r.width=e,r.height=t,r})(t,r),P=(e,t,r)=>{let o=e.get(t);if(o)return o;const n=Te(t,r);return o={...n,dash:A(n.dashArray)},e.set(t,o),o};function*F(e,t){const{canvas:r,dpr:o,zoomTransform:s,nodeDrawOrder:a,aggregatedLinks:i,nodePositions:d,nodePerimeterRadiusById:u,nodeRenderStateById:h,nodeKinds:p,portBulletTemplates:g,visiblePortsByActor:f,dragFocus:y,selectedLinkId:x,isolationMode:b,isolationActorId:v,hasSearch:w,matchedNodeIds:k,presentation:_,theme:j,onIconLoaded:M}=t;if(!e||!r)return;const{offscreen:S}=t;if(!S)return;const I=S.getContext("2d");if(!I)return;I.setTransform(1,0,0,1,0,0),I.clearRect(0,0,S.width,S.height),I.setTransform(o,0,0,o,0,0),I.translate(s.x,s.y),I.scale(s.k,s.k),I.lineCap="round",I.lineJoin="round";const L=(0,n.getColor)("text")({theme:j}),T=(0,n.getColor)("warning")({theme:j}),$=(0,n.getColor)("offline")({theme:j}),R=(0,n.getColor)("strokeMain")({theme:j}),N=((e,t)=>{const r=new Map,o=e?.link_types;if(!o)return r;for(const n of Object.keys(o)){const e=o[n],s=m(e,t);r.set(n,{...s,dash:A(s.dashArray)})}return r})(_,j);for(let n=0;n<i.length;n+=1){const e=i[n],t=d.get(e.source),r=d.get(e.target);if(!t||!r){(0,l.unstable_shouldYield)()&&(yield);continue}const o=u.get(e.source)||0,s=u.get(e.target)||0,a=r.x-t.x,h=r.y-t.y,g=Math.hypot(a,h),f=g>0?a/g:0,m=g>0?h/g:0,M=Math.max(g-1,0);let S=Math.min(o+0,M),L=Math.min(s+0,M);const E=S+L;if(E>M&&E>0){const e=M/E;S*=e,L*=e}const R=t.x+f*S,A=t.y+m*S,F=r.x-f*L,B=r.y-m*L,z=x&&x===e.id,O=p.get(e.source)||"default",D=p.get(e.target)||"default",W=e.linkType||e.link_type,Y=W&&_?.link_types?W:(0,c.Z4)({link:e,sourceKind:O,targetKind:D}),V=P(N,Y,j),U=y.linkIds.has(e.id),K=b&&e.source!==v&&e.target!==v,G=b?$:z?T:V.color,Z=(z?3:C(1+Math.log10((e.weight||1)+1),1,4))*V.widthFactor,q=y.active&&U?1.2*Z:Z,H=w&&!(k.has(e.source)||k.has(e.target))?.06:K?.15:b?.5:y.active?U?1:.12:z?1:V.opacity;I.strokeStyle=G,I.lineWidth=q,I.globalAlpha=H,I.setLineDash(V.dash),I.beginPath(),I.moveTo(R,A),I.lineTo(F,B),I.stroke(),(0,l.unstable_shouldYield)()&&(yield)}I.setLineDash([]),I.globalAlpha=1,(0,l.unstable_shouldYield)()&&(yield);for(let n=0;n<g.length;n+=1){const e=g[n],t=d.get(e.nodeId);if(!t){(0,l.unstable_shouldYield)()&&(yield);continue}const r=t.x+Math.cos(e.angle)*e.orbitRadius,o=t.y+Math.sin(e.angle)*e.orbitRadius,s=w&&!k.has(e.nodeId)?.1:e.opacity;I.globalAlpha=s,I.fillStyle=e.fill,I.beginPath(),I.arc(r,o,e.radius,0,2*Math.PI),I.fill(),e.stroke&&"none"!==e.stroke&&e.strokeWidth>0&&(I.strokeStyle=e.stroke,I.lineWidth=e.strokeWidth,I.stroke()),(0,l.unstable_shouldYield)()&&(yield)}I.globalAlpha=1,(0,l.unstable_shouldYield)()&&(yield);for(let n=0;n<a.length;n+=1){const e=a[n],t=d.get(e),r=h.get(e);if(!t||!r){(0,l.unstable_shouldYield)()&&(yield);continue}const{nodeVisual:o,radius:s,nodeOpacity:i,strokeColor:c,strokeWidth:u,fillOverride:p}=r,g=w&&k.has(e),f=w&&!g?.15:i,m=g?R:c,y=g?Math.max(u,2.5):u;g&&(I.globalAlpha=.5,I.strokeStyle=R,I.lineWidth=1.5,I.beginPath(),I.arc(t.x,t.y,s+6,0,2*Math.PI),I.stroke()),I.globalAlpha=f,I.fillStyle=p||o.fill,I.beginPath(),I.arc(t.x,t.y,s,0,2*Math.PI),I.fill(),m&&y>0&&(I.strokeStyle=m,I.lineWidth=y,I.stroke()),(0,l.unstable_shouldYield)()&&(yield)}(0,l.unstable_shouldYield)()&&(yield);for(let n=0;n<a.length;n+=1){const e=a[n],t=h.get(e),r=d.get(e);if(!t||!r||!t.iconSvg){(0,l.unstable_shouldYield)()&&(yield);continue}const o=E(t.iconSvg,M);if(!o){(0,l.unstable_shouldYield)()&&(yield);continue}const s=w&&k.has(e),i=w&&!s?.1:y.active?t.focused?.9:.25:.9;I.globalAlpha=i;const c=1.1*t.radius;I.drawImage(o,r.x-c/2,r.y-c/2,c,c),(0,l.unstable_shouldYield)()&&(yield)}I.globalAlpha=1,I.font="11px monospace",I.textAlign="center",I.textBaseline="alphabetic",(0,l.unstable_shouldYield)()&&(yield);for(let n=0;n<a.length;n+=1){const e=a[n],t=h.get(e),r=d.get(e);if(!t||!r){(0,l.unstable_shouldYield)()&&(yield);continue}const o=w&&k.has(e),s=w&&!o?.1:y.active?t.focused?1:.24:t.nodeVisual.labelOpacity;I.globalAlpha=s,I.fillStyle=t.labelColorOverride||L;const i=f.get(e)||[],c=r.y+t.radius+(i.length>0?13:0)+12;I.fillText(r.label||"",r.x,c),(0,l.unstable_shouldYield)()&&(yield)}I.globalAlpha=1,I.setTransform(1,0,0,1,0,0),e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,r.width,r.height),e.drawImage(S,0,0,r.width,r.height)}const B=(e,t,r)=>{if(!t||!r)return null;const o=t.getBoundingClientRect(),n=e.clientX-o.left,s=e.clientY-o.top,[a,i]=r.invert([n,s]);return{cssX:n,cssY:s,gx:a,gy:i}},z=(e,t,r,o,n,s)=>{const a=n-r,i=s-o,l=a*a+i*i;if(0===l)return Math.hypot(e-r,t-o);let c=((e-r)*a+(t-o)*i)/l;c=Math.max(0,Math.min(1,c));const d=r+c*a,u=o+c*i;return Math.hypot(e-d,t-u)},O=(e,t,r,o,n)=>{if(!Array.isArray(r))return null;let s=null,a=1/0;for(let i=0;i<r.length;i+=1){const l=r[i],c=o.get(l.source),d=o.get(l.target);if(!c||!d)continue;const u=z(e,t,c.x,c.y,d.x,d.y);u<=n&&u<a&&(s=l,a=u)}return s},D=(e,t,r)=>{if(!r)return null;const{cells:o,cellSize:n}=r,s=Math.floor(e/n),a=Math.floor(t/n);for(let i=-1;i<=1;i+=1)for(let r=-1;r<=1;r+=1){const n=o.get(`${s+i}:${a+r}`);if(n)for(let r=n.length-1;r>=0;r-=1){const{position:o,render:s}=n[r],a=o.x-e,i=o.y-t;if(Math.hypot(a,i)<=s.radius)return o}}return null};r(33110),r(37550);var W=r(40961),Y=r(93331),V=r(22007),U=r(44862),K=r(74848);const G=(0,s.default)(n.Text).withConfig({displayName:"graphTooltip__TooltipTitle",componentId:"sc-1qowm5u-0"})(["font-size:17px;line-height:1.25;font-weight:600;"]),Z=(0,s.default)(n.TextSmall).withConfig({displayName:"graphTooltip__TooltipMetaLine",componentId:"sc-1qowm5u-1"})(["font-size:13px;line-height:1.28;color:",";max-width:100%;overflow-wrap:anywhere;"],(0,n.getColor)("textDescription")),q=(0,s.default)(n.Flex).withConfig({displayName:"graphTooltip__InlineRow",componentId:"sc-1qowm5u-2"})(["display:flex;align-items:flex-start;gap:6px;min-width:0;"]),H=(0,s.default)(n.TextSmall).withConfig({displayName:"graphTooltip__InlineLabel",componentId:"sc-1qowm5u-3"})(["font-size:11px;line-height:1.25;font-weight:500;color:",";min-width:68px;white-space:nowrap;flex:0 0 auto;"],(0,n.getColor)("textDescription")),X=(0,s.default)(n.Flex).withConfig({displayName:"graphTooltip__BadgeRow",componentId:"sc-1qowm5u-4"})(["display:flex;flex-wrap:wrap;gap:4px;align-items:flex-start;align-content:flex-start;flex:1 1 auto;min-width:0;max-width:100%;overflow-x:hidden;"]),J=(0,s.default)(n.Box).attrs({padding:[.3,.6],round:.35}).withConfig({displayName:"graphTooltip__Badge",componentId:"sc-1qowm5u-5"})(["border:none;font-family:",";font-size:12px;line-height:1.25;white-space:normal;overflow-wrap:anywhere;max-width:100%;background:rgba(255,255,255,0.02);"],e=>{let{theme:t}=e;return t.typography?.fontFamily||"inherit"}),Q=(0,s.default)(n.TextSmall).withConfig({displayName:"graphTooltip__InlineValuesText",componentId:"sc-1qowm5u-6"})(["font-size:13px;line-height:1.28;color:",";flex:1 1 auto;min-width:0;overflow-wrap:anywhere;"],(0,n.getColor)("text")),ee=e=>{if(null===e||void 0===e||""===e)return"";if(Array.isArray(e)){const t=e.map(e=>e&&"object"===typeof e?ee(e):`${e??""}`.trim()).filter(Boolean);return t.length?t.join(", "):""}if("object"===typeof e){const t=Object.entries(e).filter(e=>{let[,t]=e;return null!==t&&void 0!==t&&""!==t});return t.length?t.map(e=>{let[t,r]=e;return`${t}: ${r}`}).join(", "):""}return"boolean"===typeof e?e?"yes":"no":`${e}`.trim()},te=new Set(["vendor","manufacturer","organization","vendor_source","vendorSource","vendor_confidence","vendorConfidence","protocols","learned_sources","learnedSources","protocolsCollected","protocols_collected","capabilities","capabilities_enabled","capabilities_supported","capabilitiesEnabled","capabilitiesSupported","ports_up","portsUp","ports_down","portsDown","ports_admin_down","portsAdminDown","portsTotal","ports_total","fdb_total_macs","fdbTotalMacs","vlan_count","vlanCount","lldp_neighbor_count","lldpNeighborCount","cdp_neighbor_count","cdpNeighborCount","chart_id_prefix","chartIdPrefix","netdata_host_id","netdataHostId","inferred","port_inventory","portInventory","vendorDerived","vendor_derived","vendorDerivedConfidence","vendor_derived_confidence","vendorDerivedMatchPrefix","vendor_derived_match_prefix","vendorDerivedSource","vendor_derived_source","vendorMatchPrefix","vendor_match_prefix","ifStatuses","if_statuses","ifNames","if_names","ifIndexes","if_indexes","ifAdminStatusCounts","if_admin_status_counts","ifOperStatusCounts","if_oper_status_counts","ifLinkModeCounts","if_link_mode_counts","ifTopologyRoleCounts","if_topology_role_counts","displayName","display_name","displaySource","display_source","deviceId","device_id","discovered","deviceCharts","device_charts","chartContextPrefix","chart_context_prefix","managementAddresses","management_addresses","managementIp","management_ip","sys_name","sysName","sys_descr","sysDescr","sys_location","sysLocation","sys_contact","sysContact","model"]),re=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;const r=e?.details?.attributes||{},o=[];return Object.entries(r).forEach(e=>{let[r,n]=e;if(te.has(r)||o.length>=t)return;const s=ee(n);s&&o.push({key:r,value:s})}),o},oe=e=>e&&"unknown"!==e?e:"",ne=e=>null===e||"undefined"===typeof e?"-":Array.isArray(e)?e.join(", "):"object"===typeof e?JSON.stringify(e):`${e}`,se=e=>{let{label:t,values:r,badgeStyle:o,maxItems:n=14}=e;const s=(0,c.cn)(r||[],n);return s.length?(0,K.jsxs)(q,{children:[(0,K.jsx)(H,{children:t}),(0,K.jsx)(X,{children:s.map((e,r)=>(0,K.jsx)(J,{style:o?o(e):void 0,children:e},`${t}-${r}-${e}`))})]}):null},ae=(e,t,r)=>{const{nodeKinds:s,nodeProtocolsById:a,portInventoryByActor:i,tooltipPortsByActor:l,incidentLinksByNodeId:h,nodePositions:p,portDetectedTypeByKey:g,presentation:f}=t,m=e.id,x=s.get(m)||"default",b=(0,c.NI)(e),v=(0,c._u)(e),w=(0,c.xd)([...a.get(m)||new Set]),k=i.get(m),_=(0,d.Yh)(e,k),C=l.get(m)||[],j=(0,c.OR)(e),M="segment"===x?(h.get(m)||[]).map(e=>{const t=e.source===m,r=t?e.target:e.source,o=p.get(r),n=o?.label||r,s=(0,d.EF)(i.get(r),t?e.targetPort:e.sourcePort),a=oe(s);return{key:`${n}|${s}|${r}`,value:a?`${n} \xb7 ${a}`:n}}).reduce((e,t)=>(!t?.key||e.some(e=>e.key===t.key)||e.push(t),e),[]).sort((e,t)=>e.value.localeCompare(t.value,void 0,{sensitivity:"base",numeric:!0})):[];return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(G,{children:e.label}),(0,K.jsxs)(Z,{children:["type: ",e.actorType||"-"," (",x,") \xb7 vendor: ",j]}),se({label:"protocols",values:w}),se({label:"caps",values:v}),b.length>0&&b.filter(e=>"actor_id"!==e.key).map(e=>(0,K.jsx)(o.Fragment,{children:se({label:e.key,values:e.values})},`identity-${e.key}`)),re(e).map(e=>(0,K.jsxs)(q,{children:[(0,K.jsx)(H,{children:e.key}),(0,K.jsx)(Q,{children:e.value})]},`extra-${e.key}`)),M.length>0&&(0,K.jsxs)(q,{children:[(0,K.jsx)(H,{children:"participants"}),(0,K.jsx)(n.Flex,{column:!0,gap:.2,flex:"1 1 auto",overflow:"hidden",children:M.map(e=>(0,K.jsx)(Z,{children:e.value},`${m}-participant-${e.key}`))})]}),_>0&&se({label:`ports (${_})`,values:C.filter(e=>e!==u.Lc),maxItems:48,badgeStyle:e=>{const t=(0,d.Tm)(m,e);return((e,t,r)=>{const o=t?.port_types?.[e];if(o)return{background:y(o.color_slot,r),color:(0,n.getColor)("bright")({theme:r}),fontWeight:600};const s=(0,d.IV)(e);return{background:s.bullet,color:s.popoverColor,fontWeight:600}})(g.get(t)||"unknown",f,r)}})]})},ie=(e,t)=>{const{nodePositions:r,portInventoryByActor:o}=t,n=r.get(e.source),s=r.get(e.target),a=n?.label||e.source,i=s?.label||e.target,l=Number(e.count)||1,c=l>1,u=c?"":oe((0,d.EF)(o.get(e.source),e.sourcePort)),h=c?"":oe((0,d.EF)(o.get(e.target),e.targetPort)),p=Number(e.metricBytes)||0,g=Number(e.metricPackets)||0,f=Number(e.metricFlows)||0,m=p>0||g>0||f>0,y="bidirectional"===e.direction||/bi/i.test(e.direction),x=y?"peer1":"source",b=y?"peer2":"target",v=c?((e,t)=>{if(!e||!t)return"";const r=[];return e.out&&r.push(`${Math.round(e.out/t*100)}% out`),e.in&&r.push(`${Math.round(e.in/t*100)}% in`),e.other&&r.push(`${Math.round(e.other/t*100)}% other`),r.join(" / ")})(e.directions,l)||e.direction||"-":e.direction||"-",w=c?function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return e&&0!==e.size?[...e.entries()].filter(e=>{let[t]=e;return t}).sort((e,t)=>t[1]-e[1]).slice(0,t).map(e=>{let[t,r]=e;return r>1?`${t}\xd7${r}`:t}).join(", "):""}(e.protocols)||e.protocol||"-":e.protocol||"-";return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(G,{children:e.label||e.linkType||"link"}),c&&(0,K.jsxs)(Z,{children:[l," underlying links \xb7 ",e.linkType||e.protocol||"link"]}),(0,K.jsxs)(q,{children:[(0,K.jsx)(H,{children:x}),(0,K.jsx)(Q,{children:u?`${a} \xb7 ${u}`:a})]}),(0,K.jsxs)(q,{children:[(0,K.jsx)(H,{children:b}),(0,K.jsx)(Q,{children:h?`${i} \xb7 ${h}`:i})]}),(0,K.jsxs)(q,{children:[(0,K.jsx)(H,{children:"protocol"}),(0,K.jsx)(Q,{children:w})]}),(0,K.jsxs)(q,{children:[(0,K.jsx)(H,{children:"direction"}),(0,K.jsx)(Q,{children:v})]}),e.state&&(0,K.jsxs)(q,{children:[(0,K.jsx)(H,{children:"state"}),(0,K.jsx)(Q,{children:e.state})]}),m&&(0,K.jsxs)(q,{children:[(0,K.jsx)(H,{children:"metrics"}),(0,K.jsxs)(Q,{children:["bytes ",ne(p)," \xb7 packets ",ne(g)," \xb7 flows"," ",ne(f)]})]}),(0,K.jsxs)(q,{children:[(0,K.jsx)(H,{children:"weight"}),(0,K.jsx)(Q,{children:ne(e.weight)})]})]})},le=(e,t,r)=>e?"node"===e.type?ae(e,t,r):"link"===e.type?ie(e,t):(e=>(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(G,{children:["Port: ",e.label||e.id]}),(0,K.jsxs)(q,{children:[(0,K.jsx)(H,{children:"actor"}),(0,K.jsx)(Q,{children:e.details?.actor||"-"})]}),e.details?.tooltipFields?.map((e,t)=>(0,K.jsxs)(q,{children:[(0,K.jsx)(H,{children:e.label}),(0,K.jsx)(Q,{children:e.value})]},t))]}))(e):null,ce={right:"left",bottom:"top"},de={right:"left",top:"bottom"},ue={left:"right",bottom:"top"},he={left:"right",top:"bottom"},pe=e=>{let{hovered:t,svgRef:r,containerElement:i,data:l}=e;const c=(0,s.useTheme)(),d=(0,o.useRef)(),[u,h]=(0,o.useState)(),p=(0,o.useRef)(),g=(0,o.useRef)(),f=(0,o.useRef)(null),m=(0,o.useRef)(he),[y,x]=(0,o.useState)(he),b=i||r?.current||null;p.current=u,g.current=(0,V.default)(u,d,y,"width");const v=(0,U.default)(),w=(0,o.useCallback)(e=>{let{x:t,y:o}=e;if(f.current={x:t,y:o},!p.current)return;p.current.style.left=`${t}px`,p.current.style.top=`${o}px`;const n=i||r?.current;if(!d.current||!n)return void g.current?.();const s=n.getBoundingClientRect(),{width:a,height:l}=d.current.getBoundingClientRect(),c=s.left+t,u=s.top+o,h=(y=c+a>s.right,b=u+l>s.bottom,y&&b?ce:y?de:b?ue:he);var y,b;if(h!==m.current)return m.current=h,x(h),void requestAnimationFrame(()=>g.current?.());g.current?.()},[i,r]);return(0,o.useLayoutEffect)(()=>{t&&f.current&&w(f.current)},[t]),(0,o.useEffect)(()=>{if(!b)return;const e=e=>{const[t,r]=a.pointer(e,b);w({x:t,y:r})};return b.addEventListener("mousemove",e),()=>b.removeEventListener("mousemove",e)},[b]),t?(0,K.jsxs)(o.Fragment,{children:[(0,K.jsx)(n.Flex,{ref:e=>h(e),position:"absolute"}),W.createPortal((0,K.jsx)(Y.default,{ref:d,column:!0,margin:[y.top?2:-2,y.right?-2:2],background:"mainBackground",padding:[1],round:.5,width:{max:"360px"},height:{max:"calc(100vh - 24px)"},overflow:{vertical:"auto"},sx:{pointerEvents:"none"},zIndex:101,"data-testid":"drop",children:le(t,l,c)}),v)]}):null},ge=(0,s.default)(n.Box).withConfig({displayName:"graphLegend__LegendSection",componentId:"sc-as0hpi-0"})(["&:not(:last-child){margin-bottom:10px;padding-bottom:8px;border-bottom:1px solid rgba(255,255,255,0.06);}"]),fe=(0,s.default)(n.TextSmall).attrs({textTransform:"uppercase",strong:!0,margin:[0,0,1.5]}).withConfig({displayName:"graphLegend__LegendSectionTitle",componentId:"sc-as0hpi-1"})([""]),me=(0,s.default)(n.Flex).attrs({gap:2,alignItems:"center",padding:[.5,0]}).withConfig({displayName:"graphLegend__LegendRow",componentId:"sc-as0hpi-2"})([""]),ye=(0,s.default)(n.Box).attrs({round:"50%"}).withConfig({displayName:"graphLegend__LegendCircle",componentId:"sc-as0hpi-3"})(["display:inline-block;width:","px;height:","px;background:",";border:",";flex-shrink:0;"],e=>{let{size:t}=e;return t||10},e=>{let{size:t}=e;return t||10},e=>{let{color:t}=e;return t},e=>{let{border:t}=e;return t||"none"}),xe=(0,s.default)(n.Box).attrs({round:"1px",width:"20px"}).withConfig({displayName:"graphLegend__LegendLine",componentId:"sc-as0hpi-4"})(["display:inline-block;height:","px;background:",";flex-shrink:0;"],e=>{let{lineWidth:t}=e;return t||2},e=>{let{color:t}=e;return t}),be=e=>{let{presentation:t}=e;const r=(0,s.useTheme)();return t?.legend?(0,K.jsxs)(K.Fragment,{children:[t.legend.actors?.length>0&&(0,K.jsxs)(ge,{children:[(0,K.jsx)(fe,{children:"Actors"}),t.legend.actors.map(e=>{const o=t.actor_types?.[e.type],s=o?f(o,r):null;return(0,K.jsxs)(me,{children:[(0,K.jsx)(ye,{color:s?.fill||(0,n.getColor)("textDescription")({theme:r}),border:s?.borderColor&&"transparent"!==s.borderColor?`2px solid ${s.borderColor}`:void 0,size:12})," ",(0,K.jsx)(n.TextSmall,{children:e.label})]},e.type)})]}),t.legend.ports?.length>0&&(0,K.jsxs)(ge,{children:[(0,K.jsx)(fe,{children:"Ports"}),t.legend.ports.map(e=>{const o=t.port_types?.[e.type],s=o?y(o.color_slot,r):(0,n.getColor)("textDescription")({theme:r});return(0,K.jsxs)(me,{children:[(0,K.jsx)(ye,{color:s,size:8})," ",(0,K.jsx)(n.TextSmall,{children:e.label})]},e.type)})]}),t.legend.links?.length>0&&(0,K.jsxs)(ge,{children:[(0,K.jsx)(fe,{children:"Links"}),t.legend.links.map(e=>{const o=t.link_types?.[e.type],s=o?m(o,r):null;return(0,K.jsxs)(me,{children:[(0,K.jsx)(xe,{color:s?.color||(0,n.getColor)("textDescription")({theme:r}),lineWidth:s?.widthFactor>1?3:void 0})," ",(0,K.jsx)(n.TextSmall,{children:e.label})]},e.type)})]})]}):null},ve=(0,s.default)(n.Flex).attrs({position:"absolute",top:2,right:2,zIndex:5,alignItems:"center",_hover:{opacity:1}}).withConfig({displayName:"graphToolbar__ToolbarOverlay",componentId:"sc-1a3n01f-0"})(["gap:3px;border-radius:6px;padding:3px;background:rgba(15,24,24,0.65);opacity:",";transition:opacity 0.18s;"],e=>{let{active:t}=e;return t?1:.45}),we=(0,s.default)(n.Box).attrs({height:"18px",width:"1px"}).withConfig({displayName:"graphToolbar__ToolbarSep",componentId:"sc-1a3n01f-1"})(["background:rgba(255,255,255,0.1);margin:0 1px;"]),ke=function(e){let{delay:t=350,interval:r=60}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=(0,o.useRef)(null),s=(0,o.useRef)(null),a=(0,o.useCallback)(()=>{e(),n.current=setTimeout(()=>{s.current=setInterval(e,r)},t)},[e,t,r]),i=(0,o.useCallback)(()=>{clearTimeout(n.current),clearInterval(s.current),n.current=null,s.current=null},[]);return(0,o.useEffect)(()=>i,[i]),{onPointerDown:a,onPointerUp:i,onPointerLeave:i}},_e=e=>{let{onZoomIn:t,onZoomOut:r,onZoomAll:o,onRotateCW:s,onRotateCCW:a,onToggleForces:i,onToggleLegend:l,forcesOn:c,legendOpen:d,legendBtnRef:u}=e;const h=ke(t),p=ke(r),g=ke(s),f=ke(a);return(0,K.jsxs)(ve,{active:c||d,children:[(0,K.jsx)(n.Tooltip,{content:c?"Hold nodes still":"Auto-arrange nodes",children:(0,K.jsx)(n.Button,{icon:"thunder",flavour:"hollow",active:c,iconColor:c?"primary":"textLite",onClick:i,small:!0})}),(0,K.jsx)(we,{}),(0,K.jsx)(n.IconButton,{icon:"zoomReset",onClick:o,tooltip:"Zoom to fit"}),(0,K.jsx)(n.IconButton,{icon:"zoomIn",...h,tooltip:"Zoom in"}),(0,K.jsx)(n.IconButton,{icon:"zoomOut",...p,tooltip:"Zoom out"}),(0,K.jsx)(we,{}),(0,K.jsx)(n.IconButton,{icon:"rotate_ccw",iconColor:"textLite",hoverColor:"text",...f,tooltip:"Rotate left"}),(0,K.jsx)(n.IconButton,{icon:"rotate_cw",iconColor:"textLite",hoverColor:"text",...g,tooltip:"Rotate right"}),(0,K.jsx)(we,{}),(0,K.jsx)(n.Button,{ref:u,icon:"information",flavour:"hollow",active:d,onClick:l,tooltip:"Legend",small:!0})]})},Ce=(0,s.default)(n.Flex).attrs({column:!0,gap:2}).withConfig({displayName:"forceGraph__GraphContainer",componentId:"sc-zcty40-0"})([""]),je=(0,s.default)(n.Box).attrs({position:"relative",overflow:"hidden"}).withConfig({displayName:"forceGraph__GraphSurface",componentId:"sc-zcty40-1"})(["background:",";"],e=>{let{bare:t,theme:r}=e;return t?"transparent":`\n    radial-gradient(circle at 25% 20%, rgba(80, 184, 255, 0.08), transparent 42%),\n    radial-gradient(circle at 78% 75%, rgba(244, 166, 35, 0.08), transparent 36%),\n    ${(0,n.getColor)("mainBackground")({theme:r})}`}),Me=(0,s.default)(n.Flex).attrs({position:"absolute",top:2,zIndex:5,_hover:{opacity:1},_focusWithin:{opacity:1}}).withConfig({displayName:"forceGraph__SearchOverlay",componentId:"sc-zcty40-2"})(["gap:4px;border-radius:6px;padding:3px 8px;background:rgba(15,24,24,0.65);border:1px solid rgba(255,255,255,0.08);opacity:",";transition:opacity 0.18s;"],e=>{let{active:t}=e;return t?1:.55}),Se=e=>{if(!e)return"";const t=e.details?.match||{},r=e.details?.attributes||{},o=e.details?.labels||{};return[e.label||"",...Array.isArray(t.hostnames)?t.hostnames:[],t.sys_name||t.sysName||"",r.sys_name||r.sysName||"",r.display_name||r.displayName||"",o.display_name||o.displayName||"",...Array.isArray(t.ipAddresses)?t.ipAddresses:[],...Array.isArray(t.ip_addresses)?t.ip_addresses:[],r.management_ip||r.managementIp||"",...Array.isArray(t.macAddresses)?t.macAddresses:[],...Array.isArray(t.mac_addresses)?t.mac_addresses:[]].filter(Boolean).join(" ").toLowerCase()},Ie="__overflow__",Le=e=>{if(!e)return 0;let t=0;for(let r=0;r<e.length;r+=1)t=(t<<5)-t+e.charCodeAt(r),t|=0;return Math.abs(t)},Te=(e,t)=>{switch(e){case"ownership":return{color:(0,n.getColor)("generic")({theme:t}),widthFactor:.8,opacity:.62,dashArray:"4 4"};case"socket":return{color:(0,n.getColor)("textDescription")({theme:t}),widthFactor:1.05,opacity:.9};case"lldp":return{color:(0,n.getColor)("primary")({theme:t}),widthFactor:2,opacity:.98};case"snmp":return{color:(0,n.getColor)("warning")({theme:t}),widthFactor:1,opacity:.95};case"segment":return{color:(0,n.getColor)("offline")({theme:t}),widthFactor:1,opacity:.8};case"derived":return{color:(0,n.getColor)("unseen")({theme:t}),widthFactor:1,opacity:.92};case"probable":return{color:(0,n.getColor)("generic")({theme:t}),widthFactor:1,opacity:.98};default:return{color:(0,n.getColor)("textDescription")({theme:t}),widthFactor:1,opacity:.82}}},$e=e=>{let{nodes:t,links:r,width:o,height:n,positionMemory:s}=e;if(!Array.isArray(t)||!t.length||o<10||n<10)return{nodes:[],links:[]};const a=new Map;t.forEach(e=>{if(!e?.id||a.has(e.id))return;const t=s.get(e.id),r=((e,t,r)=>{const o=Math.max(t-48,1),n=Math.max(r-48,1);return{x:24+Le(`${e}:x`)%o,y:24+Le(`${e}:y`)%n}})(e.id,o,n);a.set(e.id,{...e,x:t?.x??r.x,y:t?.y??r.y})});const i=[...a.values()].sort((e,t)=>`${e.label||""}|${e.id}`.localeCompare(`${t.label||""}|${t.id}`)),l=new Set,c=[];return(r||[]).forEach(e=>{if(!e?.source||!e?.target)return;if(!a.has(e.source)||!a.has(e.target))return;const t=e.id||`${e.source}->${e.target}`;l.has(t)||(l.add(t),c.push({...e,id:t,source:e.source,target:e.target}))}),c.sort((e,t)=>`${e.source}|${e.target}|${e.label||""}|${e.id}`.localeCompare(`${t.source}|${t.target}|${t.label||""}|${t.id}`)),{nodes:i,links:c}},Ee=(0,o.memo)(e=>{let{title:t,nodes:r=[],links:h=[],portStateLinks:p=[],height:g=420,selectedNodeId:m,selectedLinkId:x,emptyMessage:b="No graph data",onNodeClick:k,onLinkClick:_,filterKey:C,presentation:L,isolationMode:$=!1,isolationActorId:E}=e;const R=(0,s.useTheme)(),[A,{width:P}]=(0,i.A)(),[z,W]=(0,o.useState)(null),Y=(0,o.useRef)(null),[V,U]=(0,o.useState)(!1),G=(0,o.useRef)(null),[Z,q]=(0,o.useState)(()=>a.zoomIdentity),[H,X]=(0,o.useState)(""),J=(0,o.useRef)(null),Q=(0,o.useRef)(null),[ee,te]=(0,o.useState)(0),[re,oe]=(()=>{const e=(0,o.useRef)(),t=(0,o.useRef)(),r=(0,o.useCallback)(()=>{e.current&&((0,l.unstable_cancelCallback)(e.current),e.current=void 0),t.current&&(t.current(),t.current=void 0)},[]),n=(0,o.useCallback)(function(o){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.unstable_NormalPriority;r();const s=o(),a=()=>{const r=s.next();if(r.value&&(t.current=r.value),!r.done)return a;e.current=void 0},i=(0,l.unstable_runWithPriority)(n,a);i&&(e.current=(0,l.unstable_scheduleCallback)(n,i))},[]);return(0,o.useEffect)(()=>r,[]),[n,r]})(),ne=(0,o.useRef)(null),se=(0,o.useRef)(null),ae=(0,o.useRef)(null),ie=(0,o.useRef)(a.zoomIdentity),le=(0,o.useRef)(null),ce=(0,o.useRef)(!1),de=(0,o.useRef)(!1),ue=(0,o.useRef)({width:0,height:0}),[he,ge]=(0,o.useState)(null),fe=(0,o.useCallback)(e=>{J.current=e,ge(e)},[]),me=(0,o.useRef)(new Map),ye=(0,o.useRef)(null),xe=(0,o.useRef)(null),ve=(0,o.useRef)(""),we=(0,o.useRef)(!1),ke=(0,o.useRef)(!1),Le=(0,o.useRef)(C),[Te,Ee]=(0,o.useState)(!1),Re=(0,o.useRef)(!1),[Ae,Ne]=(0,o.useState)(""),Pe=(0,o.useRef)(!1),Fe=(e,t,r)=>{if(we.current)return;if(xe.current)return;const o=r||J.current;if(!o)return;const[n,s]=a.pointer(e,o);Y.current={x:n,y:s},W(t)},Be=()=>{W(null)},ze=(0,o.useMemo)(()=>$e({nodes:r,links:h,width:P||0,height:g,positionMemory:me.current}),[r,h,P,g]),Oe=(0,o.useMemo)(()=>(0,w.d)(ze.links),[ze.links]),De=(0,o.useMemo)(()=>({nodes:ze.nodes,links:Oe}),[ze.nodes,Oe]),{layout:We,setLayout:Ye,layoutComputing:Ve,simulationRef:Ue,nodesByIdRef:Ke}=T({graphData:De,portObservationLinks:ze.links,width:P,height:g,filterKey:C,targetRef:J,positionsRef:me,hasInitialLayoutRef:ke,prevFilterKeyRef:Le,pendingFilterResetRef:Pe,zoomBehaviorRef:ye,forcesOnRef:Re,setZoomTransform:q});(0,o.useEffect)(()=>{const e=J.current;if(!e||!We.nodes.length)return;const t=a.zoom().scaleExtent([.1,6]).on("zoom",e=>q(e.transform));t.filter(e=>{if("mousedown"!==e.type&&"touchstart"!==e.type)return!e.ctrlKey;const t=Q.current?.(e);return!t}),ye.current=t;const r=a.select(e);return r.call(t),r.on("dblclick.zoom",null),Z!==a.zoomIdentity&&r.call(t.transform,Z),()=>{r.on(".zoom",null),ye.current=null}},[We.nodes.length]),(0,o.useEffect)(()=>{if(!$||!We.nodes.length||!P||!g)return;const e=j(We.nodes,P,g);q(e);const t=J.current;ye.current&&t&&a.select(t).call(ye.current.transform,e)},[$,P,g,We.nodes]),(0,o.useEffect)(()=>{const e=e=>{const t=xe.current,r=J.current;if(!t||!r||!P)return;const o=Ke.current.get(t.nodeId);if(!o)return;const[n,s]=a.pointer(e,r),[i,l]=Z.invert([n,s]);o.fx=i,o.fy=l,Math.abs(e.clientX-t.startX)+Math.abs(e.clientY-t.startY)>4&&(t.moved=!0),o&&(o.anchorX=o.fx,o.anchorY=o.fy),Ue.current?.alphaTarget(.05).restart()},t=()=>{we.current=!1;const e=xe.current;if(!e)return;const t=Ke.current.get(e.nodeId);t&&(t.anchorX=t.x,t.anchorY=t.y,t.fx=null,t.fy=null),e.moved&&(ve.current=e.nodeId),xe.current=null,X(""),Ue.current?.alphaTarget(0)};return window.addEventListener("pointermove",e),window.addEventListener("pointerup",t),()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",t)}},[P,g,Z]);const Ge=(0,o.useMemo)(()=>new Map(We.nodes.map(e=>[e.id,e])),[We.nodes]),Ze=(0,o.useMemo)(()=>new Set(ze.nodes.filter(e=>(0,c.Po)(e)).map(e=>e.id)),[ze.nodes]),qe=(0,o.useMemo)(()=>{const e=new Set;return ze.links.forEach(t=>{(0,c.TV)(t)&&(e.add(t.source),e.add(t.target))}),e},[ze.links]),He=(0,o.useMemo)(()=>{const e=new Map;return ze.nodes.forEach(t=>{L?.actor_types?e.set(t.id,t.actorType||"default"):e.set(t.id,(0,c.Dh)({node:t,lldpNodeIds:qe,segmentNodeIds:Ze}))}),e},[ze.nodes,qe,Ze,L]),Xe=(0,o.useMemo)(()=>{const e=new Map;return ze.nodes.forEach(t=>e.set(t.id,[])),ze.links.forEach(t=>{e.has(t.source)||e.set(t.source,[]),e.has(t.target)||e.set(t.target,[]),e.get(t.source).push(t),e.get(t.target).push(t)}),e},[ze.nodes,ze.links]),Je=(0,o.useMemo)(()=>{const e=new Map;return ze.nodes.forEach(t=>{const r=new Set;(0,c._N)(t)&&r.add("SNMP");[...(0,c.oU)(t?.details?.attributes?.protocols_collected),...(0,c.oU)(t?.details?.attributes?.protocols),...(0,c.oU)(t?.details?.labels?.protocols_observed),...(0,c.oU)(t?.details?.labels?.protocols_collected)].map(e=>e.toUpperCase()).forEach(e=>{e&&r.add(e)}),e.set(t.id,r)}),ze.links.forEach(t=>{const r=`${t.protocol||""}`.trim().toUpperCase();r&&(e.has(t.source)||e.set(t.source,new Set),e.has(t.target)||e.set(t.target,new Set),e.get(t.source).add(r),e.get(t.target).add(r))}),ze.nodes.forEach(t=>{const r=(0,c.oU)(t?.details?.attributes?.learned_sources).map(e=>e.toUpperCase()),o=e.get(t.id)||new Set;r.forEach(e=>o.add(e)),e.set(t.id,o)}),e},[ze.nodes,ze.links]),Qe=(0,o.useMemo)(()=>{const e=new Map;return ze.nodes.forEach(t=>{e.set(t.id,(0,d.gl)(t))}),e},[ze.nodes]),et=L?.actor_click_behavior||"highlight_connections",tt=(0,o.useMemo)(()=>{const e=!!H,t=new Set,r=new Set;if(!e)return{active:e,nodeIds:t,linkIds:r};if(t.add(H),"highlight_path"===et){const e=ze.nodes.find(e=>e.id===H),o=e?.streamingPath;if(o&&o.length>0){o.forEach(e=>t.add(e));const e=t;Oe.forEach(t=>{if(e.has(t.source)&&e.has(t.target)){const e=o.indexOf(t.source),n=o.indexOf(t.target);e>=0&&n>=0&&1===Math.abs(e-n)&&r.add(t.id)}})}else Oe.forEach(e=>{e.source!==H&&e.target!==H||(r.add(e.id),t.add(e.source),t.add(e.target))})}else Oe.forEach(e=>{e.source!==H&&e.target!==H||(r.add(e.id),t.add(e.source),t.add(e.target))});return{active:e,nodeIds:t,linkIds:r}},[ze.nodes,Oe,H,et]),rt=(0,o.useMemo)(()=>{const e=new Map,t=(t,r)=>{t&&(e.has(t)||e.set(t,new Set),e.get(t).add(r))};return ze.links.forEach(e=>{t(e.source,(0,d.EF)(Qe.get(e.source),e.sourcePort)),t(e.target,(0,d.EF)(Qe.get(e.target),e.targetPort))}),e},[ze.links,Qe]),[ot,nt]=(0,o.useMemo)(()=>{const e=new Map,t=new Map;return ze.nodes.forEach(r=>{const o=new Set,n=Qe.get(r.id),s=!!n?.ports?.size;s&&n.ports.forEach((e,t)=>o.add(t));const a=r.receivedNodes||r.received_nodes;Array.isArray(a)&&a.forEach(e=>{if(!e)return;const n="string"===typeof e?e:e.name,s="string"===typeof e?null:e.type;n&&(o.add(n),s&&t.set((0,d.Tm)(r.id,n),s))});(rt.get(r.id)||new Set).forEach(e=>{s&&e===u.Lc||o.add(e)});const i=[...o].filter(e=>e!==u.Lc).sort(d.yl);o.has(u.Lc)&&i.length>0&&!s&&i.push(u.Lc),e.set(r.id,i)}),[e,t]},[ze.nodes,Qe,rt]),[st,at]=(0,o.useMemo)(()=>{const e=new Map,t=new Map;return ze.nodes.forEach(r=>{if(L?.actor_types){const t=L.actor_types[r.actorType];if(t&&!t.show_port_bullets)return void e.set(r.id,[])}const o=ot.get(r.id)||[],n=o.filter(e=>e!==u.Lc),s=o.includes(u.Lc);if(n.length+(s?1:0)<=1)return void e.set(r.id,[]);const a=rt.get(r.id)||new Set,i=[],l=[];o.forEach(e=>{a.has(e)?i.push(e):l.push(e)});const c=i.concat(l);if(c.length<=M)return void e.set(r.id,c);const d=c.slice(0,M);d.push(Ie),e.set(r.id,d),t.set(r.id,c.length-M)}),[e,t]},[ze.nodes,ot,rt,L]),it=(0,o.useMemo)(()=>{const e=new Map;return ze.nodes.forEach(t=>{const r=!!m&&m===t.id,o=He.get(t.id)||"default",s=L?.actor_types?.[o],a=s?f(s,R):(e=>{let{kind:t,theme:r}=e;switch(t){case"lldp":return{fill:(0,n.getColor)("primary")({theme:r}),sizeFactor:1,borderColor:(0,n.getColor)("bright")({theme:r}),borderWidth:1,labelOpacity:1};case"snmp":return{fill:(0,n.getColor)("warning")({theme:r}),sizeFactor:1,borderColor:(0,n.getColor)("bright")({theme:r}),borderWidth:1,labelOpacity:1};case"self":return{fill:(0,n.getColor)("elementBackground")({theme:r}),sizeFactor:1.18,borderColor:(0,n.getColor)("text")({theme:r}),borderWidth:1,labelOpacity:1};case"inferred":return{fill:(0,n.getColor)("textDescription")({theme:r}),sizeFactor:1,borderColor:(0,n.getColor)("text")({theme:r}),borderWidth:1,labelOpacity:.95};case"segment":return{fill:(0,n.getColor)("offline")({theme:r}),sizeFactor:1,borderColor:"transparent",borderWidth:0,labelOpacity:.72};case"derived":return{fill:(0,n.getColor)("unseen")({theme:r}),sizeFactor:1,borderColor:(0,n.getColor)("unseen")({theme:r}),borderWidth:1,labelOpacity:.9};default:return{fill:f(void 0,r).fill,sizeFactor:1,borderColor:(0,n.getColor)("borderSecondary")({theme:r}),borderWidth:1,labelOpacity:1}}})({kind:o,theme:R}),i=(e=>{let{node:t,nodeVisual:r,portInventory:o}=e;if(!r.sizeByLinks&&(r.sizeByLinks||!(0,c.pV)(t)||t?.inferred))return r.sizeFactor;const n=(0,d.Yh)(t,o);return r.sizeFactor*I(n)})({node:t,nodeVisual:a,portInventory:Qe.get(t.id)}),l=tt.nodeIds.has(t.id),u=(r?11:9)*i,h=st.get(t.id)||[],p=S(h.length),g=Math.min(120,Math.max(u,p)),y=tt.active&&l?1.2*g:g,x=$&&t.id===E,b=$&&!x,w=b?.45:tt.active?l?1:.2:1,k=x?(0,n.getColor)("warning")({theme:R}):b?(0,n.getColor)("offline")({theme:R}):r?(0,n.getColor)("warning")({theme:R}):tt.active&&l?(0,n.getColor)("bright")({theme:R}):a.borderColor,_=x||tt.active&&l?2.4:r?2:a.borderWidth,C=b?(0,n.getColor)("offline")({theme:R}):null,j=b?(0,n.getColor)("offline")({theme:R}):null;var M;e.set(t.id,{selected:r||x,nodeKind:o,nodeVisual:a,focused:l,radius:y,nodeOpacity:w,strokeColor:k,strokeWidth:_,fillOverride:C,labelColorOverride:j,iconSvg:s?.icon_svg?(M=s.icon_svg,M&&"string"===typeof M?M.replace(/<script[\s\S]*?<\/script>/gi,"").replace(/<style[\s\S]*?<\/style>/gi,"").replace(/<foreignObject[\s\S]*?<\/foreignObject>/gi,"").replace(/<(iframe|embed|object|handler)[\s\S]*?>/gi,"").replace(/<!\[CDATA\[[\s\S]*?\]\]>/gi,"").replace(/\bon\w+\s*=/gi,"data-removed=").replace(/javascript\s*:/gi,""):""):v(o)||v((0,c._l)((0,c._u)(t)))||null})}),e},[ze.nodes,m,He,tt,Qe,st,$,E,R]),lt=(0,o.useMemo)(()=>{const e=new Map;return ze.nodes.forEach(t=>{const r=it.get(t.id);r&&e.set(t.id,r.radius)}),e},[ze.nodes,it]),ct=(0,o.useMemo)(()=>ze.nodes.map(e=>e.id).sort((e,t)=>{const r=it.get(e)?.radius||0;return(it.get(t)?.radius||0)-r}),[ze.nodes,it]),dt=(0,o.useMemo)(()=>{const e=new Set,t=(t,r,o)=>{if(!t)return;if(!(0,c.vF)(o))return;const n=(0,d.EF)(Qe.get(t),r);e.add((0,d.Tm)(t,n))};return(p||[]).forEach(e=>{t(e.source,e.sourcePort,e.protocol),t(e.target,e.targetPort,e.protocol)}),e},[p,Qe]),ut=(0,o.useMemo)(()=>{const e=new Map;return ot.forEach((t,r)=>{const o=Qe.get(r),n=rt.get(r)||new Set;t.forEach(t=>{const s=(0,d.Tm)(r,t),a=o?.ports?.get(t),i="up"===`${a?.operStatus||""}`.trim().toLowerCase(),l=!a&&n.has(t);i||l?e.set(s,dt.has(s)?"discovery":"topology"):e.set(s,"idle")})}),e},[ot,Qe,rt,dt]),ht=(0,o.useMemo)(()=>{const e=new Map;return ot.forEach((t,r)=>{const o=Qe.get(r);t.forEach(t=>{const n=(0,d.Tm)(r,t),s=o?.ports?.get(t);e.set(n,(0,d.vC)(s?.linkMode))})}),e},[ot,Qe]),pt=(0,o.useMemo)(()=>{const e=new Map;return ot.forEach((t,r)=>{const o=Qe.get(r);t.forEach(t=>{const n=(0,d.Tm)(r,t),s=o?.ports?.get(t);e.set(n,{role:(0,d.DV)(s?.topologyRole),confidence:(0,d.qk)(s?.topologyRoleConfidence),sources:(0,d.te)(s?.topologyRoleSources)})})}),e},[ot,Qe]),gt=(0,o.useMemo)(()=>{const e=new Map;return ot.forEach((t,r)=>{t.forEach(t=>{const o=(0,d.Tm)(r,t),n=nt.get(o);if(n)return void e.set(o,n);const s=ut.get(o)||"idle",a=ht.get(o)||"unknown",i=pt.get(o)?.role||"unknown";e.set(o,(0,d.Zc)({status:s,role:i,mode:a}))})}),e},[ot,nt,ut,ht,pt]),ft=(0,o.useMemo)(()=>{const e=[];return ze.nodes.forEach(t=>{const r=st.get(t.id)||[];if(!r.length)return;const o=it.get(t.id);if(!o)return;const s=o.radius+9,a=2*Math.PI/r.length,i=t.label||"";r.forEach((r,l)=>{const c=-Math.PI/2+a*l,h=(0,d.Tm)(t.id,r);if(r===Ie){const a=at.get(t.id)||0;return void e.push({id:h,nodeId:t.id,port:r,angle:c,orbitRadius:s,fill:(0,n.getColor)("textDescription")({theme:R}),opacity:o.fillOverride?.35:tt.active?o.focused?.75:.2:.8,radius:3.2,stroke:"none",strokeWidth:0,actorLabel:i,tooltipFields:[{label:"hidden",value:`${a} more ports`}],type:"overflow",overflowCount:a})}const p=ut.get(h)||"idle",g=ht.get(h)||"unknown",f=pt.get(h)||{role:"unknown",confidence:"low",sources:[]},m=gt.get(h)||"unknown",x=(0,d.IV)(m),b=L?.port_types?.[m],v=b?y(b.color_slot,R):x.bullet,w=L?.port_fields,k=w?w.map(e=>{let t;switch(e.key){case"type":t=b?.label||x.label||m;break;case"role":if("unknown"===f.role)return null;t=`${f.role} (${f.confidence})`;break;case"status":t=p;break;case"mode":if("unknown"===g)return null;t=g;break;case"sources":if(!f.sources?.length)return null;t=f.sources.join(", ");break;default:return null}return{label:e.label,value:t}}).filter(Boolean):null;e.push({id:h,nodeId:t.id,port:r,angle:c,orbitRadius:s,fill:o.fillOverride||v,opacity:o.fillOverride?.35:tt.active?o.focused?.7:.15:r===u.Lc?.55:.7,radius:"lldp"===m||"trunk"===m?3.2:"idle"===p?2.4:2.9,stroke:"none",strokeWidth:0,actorLabel:i,tooltipFields:k,type:m})})}),e.sort((e,t)=>{const r=it.get(e.nodeId)?.radius||0;return(it.get(t.nodeId)?.radius||0)-r}),e},[ze.nodes,st,it,ut,ht,pt,gt,at,tt,L,R]),mt=(0,o.useMemo)(()=>ze.nodes.length?ze.nodes.filter(e=>!(0,c.Po)(e)).map(e=>({node:e,text:Se(e)})):[],[ze.nodes]),yt=(0,o.useMemo)(()=>{const e=Ae.trim().toLowerCase();if(!e)return null;const t=new Set;return mt.forEach(r=>{let{node:o,text:n}=r;n.includes(e)&&t.add(o.id)}),t},[Ae,mt]),xt=null!==yt;(0,o.useEffect)(()=>{if(!yt||!yt.size||!P||!g||!ye.current||!J.current)return;const e=We.nodes.filter(e=>yt.has(e.id));if(!e.length)return;if(e.every(e=>{const[t,r]=Z.apply([e.x,e.y]);return t>=0&&t<=P&&r>=0&&r<=g}))return;let t=1/0,r=-1/0,o=1/0,n=-1/0;e.forEach(e=>{e.x<t&&(t=e.x),e.x>r&&(r=e.x),e.y<o&&(o=e.y),e.y>n&&(n=e.y)});const s=r-t||1,i=n-o||1,l=(t+r)/2,c=(o+n)/2,d=Z.k,u=Math.min((P-120)/s,(g-120)/i,2),h=Math.min(d,u),p=a.zoomIdentity.translate(P/2,g/2).scale(h).translate(-l,-c);q(p),a.select(J.current).call(ye.current.transform,p)},[yt,We.nodes,P,g]);const bt=(0,o.useCallback)(()=>{Ee(e=>{const t=!e;return Re.current=t,Ue.current&&(t?Ue.current.alpha(.15).alphaTarget(.01).restart():Ue.current.alphaTarget(0).alpha(0).stop()),t})},[]),vt=(0,o.useCallback)(()=>{const e=J.current;if(!We.nodes.length||!P||!g||!ye.current||!e)return;const t=j(We.nodes,P,g);q(t),a.select(e).call(ye.current.transform,t)},[We.nodes,P,g]),wt=(0,o.useCallback)(e=>{const t=J.current;ye.current&&t&&P&&a.select(t).call(ye.current.scaleBy,e,[P/2,g/2])},[P,g]),kt=(0,o.useCallback)(()=>wt(1.25),[wt]),_t=(0,o.useCallback)(()=>wt(.8),[wt]),Ct=(0,o.useCallback)(e=>{if(!We.nodes.length||!P||!g)return;const[t,r]=Z.invert([P/2,g/2]),o=e*Math.PI/180,n=Math.cos(o),s=Math.sin(o);me.current.forEach((e,o)=>{const a=e.x-t,i=e.y-r;me.current.set(o,{x:t+a*n-i*s,y:r+a*s+i*n})}),Ye(e=>({...e,nodes:e.nodes.map(e=>{const t=me.current.get(e.id);return t?{...e,x:t.x,y:t.y}:e})}));const a=Ke.current;a.size&&a.forEach(e=>{const t=me.current.get(e.id);t&&(e.x=t.x,e.y=t.y,e.anchorX=t.x,e.anchorY=t.y)})},[We.nodes.length,P,g,Z]),jt=(0,o.useCallback)(()=>Ct(8),[Ct]),Mt=(0,o.useCallback)(()=>Ct(-8),[Ct]),St=(0,o.useCallback)(e=>Ne(e),[]),It=(0,o.useCallback)(()=>Ne(""),[]),Lt=(0,o.useMemo)(()=>({nodeKinds:He,nodeProtocolsById:Je,portInventoryByActor:Qe,tooltipPortsByActor:ot,incidentLinksByNodeId:Xe,nodePositions:Ge,portDetectedTypeByKey:gt,presentation:L}),[He,Je,Qe,ot,Xe,Ge,gt,L]);return(0,o.useEffect)(()=>{const e=J.current;if(!e)return;Q.current=t=>{const r=B(t,e,ie.current);return r?D(r.gx,r.gy,se.current):null};const t=e=>e&&"unknown"!==e?e:"",r=r=>{if(we.current||xe.current)return;const o=ae.current;if(!o)return;const n=B(r,e,ie.current);if(!n)return;const s=D(n.gx,n.gy,se.current);if(s)return Fe(r,{type:"node",...s},e),void(e.style.cursor=k?"pointer":"grab");const a=((e,t,r,o)=>{if(!Array.isArray(r))return null;let n=null,s=1/0;for(let a=r.length-1;a>=0;a-=1){const i=r[a],l=o.get(i.nodeId);if(!l)continue;const c=l.x+Math.cos(i.angle)*i.orbitRadius,d=l.y+Math.sin(i.angle)*i.orbitRadius,u=c-e,h=d-t,p=Math.hypot(u,h);p<=i.radius+1&&p<s&&(n={...i,x:c,y:d},s=p)}return n})(n.gx,n.gy,o.portBulletTemplates,o.nodePositions);if(a)return Fe(r,{type:"port",label:"overflow"===a.type?`${a.actorLabel} :: +${a.overflowCount} more`:t(a.port)?`${a.actorLabel} :: ${a.port}`:a.actorLabel,details:{actor:a.actorLabel,..."overflow"===a.type?{}:t(a.port)?{port:a.port}:{},tooltipFields:a.tooltipFields}},e),void(e.style.cursor="pointer");const i=6/Math.max(ie.current.k,.01),l=O(n.gx,n.gy,o.aggregatedLinks,o.nodePositions,i);if(l)return Fe(r,{type:"link",...l},e),void(e.style.cursor=_?"pointer":"default");Be(),e.style.cursor="grab"},o=()=>Be(),n=t=>{const r=ae.current;if(!r)return;const o=B(t,e,ie.current);if(!o)return;const n=D(o.gx,o.gy,se.current);if(n)return ve.current===n.id?void(ve.current=""):(Be(),void k?.(n));const s=6/Math.max(ie.current.k,.01),a=O(o.gx,o.gy,r.aggregatedLinks,r.nodePositions,s);a&&(Be(),_?.(a))},s=t=>{const r=B(t,e,ie.current);if(!r)return;const o=D(r.gx,r.gy,se.current);if(!o)return;t.preventDefault(),t.stopPropagation(),we.current=!0,Be(),X(o.id);const n=Ke.current.get(o.id);n&&(n.fx=o.x,n.fy=o.y,n.anchorX=o.x,n.anchorY=o.y),Ue.current?.alpha(.1).alphaTarget(.05).restart(),xe.current={nodeId:o.id,startX:t.clientX,startY:t.clientY,moved:!1}};return e.addEventListener("mousemove",r),e.addEventListener("mouseleave",o),e.addEventListener("click",n),e.addEventListener("pointerdown",s),()=>{e.removeEventListener("mousemove",r),e.removeEventListener("mouseleave",o),e.removeEventListener("click",n),e.removeEventListener("pointerdown",s),Q.current=null}},[k,_]),ae.current={zoomTransform:Z,nodeDrawOrder:ct,aggregatedLinks:Oe,nodePositions:Ge,nodePerimeterRadiusById:lt,nodeRenderStateById:it,nodeKinds:He,portBulletTemplates:ft,visiblePortsByActor:st,dragFocus:tt,selectedLinkId:x,isolationMode:$,isolationActorId:E,hasSearch:xt,matchedNodeIds:yt,presentation:L,theme:R},ie.current=Z,ue.current={width:P,height:g},(0,o.useEffect)(()=>{const{width:e,height:t}=ue.current;if(!e||!t)return;if(null!==le.current)return;const r=()=>{const e=J.current,t=ae.current,r=ue.current;if(!e||!t||!r.width||!r.height)return;const n=e.getContext("2d");if(!n)return;const s=((e,t,r,o)=>{const n=o||window.devicePixelRatio||1,s=Math.min(n,2),a=Math.round(t*s),i=Math.round(r*s);return e.width!==a&&(e.width=a),e.height!==i&&(e.height=i),e.style.width=`${t}px`,e.style.height=`${r}px`,s})(e,r.width,r.height);ne.current=N(ne.current,e.width,e.height),se.current=(e=>{let{nodeDrawOrder:t,nodePositions:r,nodeRenderStateById:o}=e;const n=new Map;let s=0;for(let i=0;i<t.length;i+=1){const e=t[i],n=r.get(e),a=o.get(e);n&&a&&a.radius>s&&(s=a.radius)}const a=Math.max(32,4*s);for(let i=0;i<t.length;i+=1){const e=t[i],s=r.get(e),l=o.get(e);if(!s||!l)continue;const c=`${Math.floor(s.x/a)}:${Math.floor(s.y/a)}`;let d=n.get(c);d||(d=[],n.set(c,d)),d.push({id:e,position:s,render:l})}return{cells:n,cellSize:a}})(t),ce.current=!0,de.current=!1,re(function*(){yield*F(n,{...t,canvas:e,dpr:s,offscreen:ne.current,onIconLoaded:()=>te(e=>e+1)}),ce.current=!1,de.current&&null===le.current&&(le.current=requestAnimationFrame(o))})},o=()=>{le.current=null,ce.current?de.current=!0:r()};le.current=requestAnimationFrame(o)}),(0,o.useEffect)(()=>()=>{null!==le.current&&(cancelAnimationFrame(le.current),le.current=null),oe()},[oe]),(0,K.jsxs)(Ce,{children:[!!t&&(0,K.jsx)(n.TextSmall,{color:"textDescription",children:t}),(0,K.jsxs)(je,{ref:A,height:`${g}px`,bare:$,children:[Ve&&!We.nodes.length&&P>0&&(0,K.jsx)(n.Flex,{alignItems:"center",justifyContent:"center",sx:{position:"absolute",inset:0},children:(0,K.jsx)(n.Text,{color:"textDescription",children:"Computing layout\u2026"})}),P>0&&We.nodes.length?(0,K.jsx)("canvas",{ref:fe,style:{display:"block",width:`${P}px`,height:`${g}px`}}):(0,K.jsx)(n.Flex,{height:"100%",alignItems:"center",justifyContent:"center",children:(0,K.jsx)(n.Text,{color:"textDescription",children:b})}),!$&&(0,K.jsxs)(Me,{active:!!Ae,children:[(0,K.jsx)(n.SearchInput,{value:Ae,onChange:St,onReset:It,placeholder:"Search actors..."}),xt&&(0,K.jsxs)(n.TextSmall,{color:"textLite",children:[yt.size," found"]})]}),!$&&(0,K.jsx)(_e,{onZoomIn:kt,onZoomOut:_t,onZoomAll:vt,onRotateCW:jt,onRotateCCW:Mt,onToggleForces:bt,onToggleLegend:()=>U(e=>!e),forcesOn:Te,legendOpen:V,legendBtnRef:G}),!$&&V&&G.current&&(0,K.jsx)(n.Drop,{target:G.current,align:{bottom:"top",right:"right"},onClickOutside:()=>U(!1),onEsc:()=>U(!1),background:"mainBackground",padding:[2],round:2,width:"260px",height:{max:"70vh"},overflow:{vertical:"auto"},children:(0,K.jsx)(be,{presentation:L})}),(0,K.jsx)(pe,{hovered:z,containerElement:he,svgRef:J,initialPositionRef:Y,data:Lt})]})]})}),Re=Ee},25219(e,t,r){r.d(t,{A:()=>D});r(98992),r(54520),r(3949),r(81454),r(37550),r(71517),r(11379),r(93777),r(14190),r(12359),r(86097),r(17273),r(27415),r(19929),r(37583),r(55122),r(20230),r(57268),r(79733),r(25509),r(65223),r(60321),r(41927),r(11632),r(64377),r(66771),r(12516),r(68931),r(52514),r(35694),r(52774),r(49536),r(21926),r(94483),r(16215);var o=r(96540),n=r(38429),s=r(85660),a=r(427),i=r(82276),l=r(49440),c=r(32981),d=r(15036);const u=e=>{if(null===e||void 0===e||""===e)return"";if(Array.isArray(e)){const t=e.map(e=>e&&"object"===typeof e?u(e):`${e??""}`.trim()).filter(Boolean);return t.length?t.join(", "):""}if("object"===typeof e){const t=Object.entries(e).filter(e=>{let[,t]=e;return null!==t&&void 0!==t&&""!==t});return t.length?t.map(e=>{let[t,r]=e;return`${t}: ${r}`}).join(", "):""}return"boolean"===typeof e?e?"yes":"no":`${e}`.trim()},h=e=>e.replace(/([-_][a-z])/g,e=>e[1].toUpperCase()),p=(e,t)=>{if(!Array.isArray(t)||!e)return"";const r={actor_type:e.actorType,source:e.source,layer:e.layer};for(const o of t){if(void 0!==r[o]){const e=u(r[o]);if(e)return e;continue}const t=o.split(".");let n=e.details;for(const e of t){if(null===n||void 0===n){n=void 0;break}const t=Number(e);n=Number.isFinite(t)&&Array.isArray(n)?n[t]:void 0!==n[e]?n[e]:n[h(e)]}if(void 0!==n&&null!==n&&""!==n)return u(n)}return""};var g=r(51220),f=r(79748),m=r(882);const y=(0,m.default)(n.Box).withConfig({displayName:"styled__SummaryGrid",componentId:"sc-n2rgc1-0"})(["display:grid;grid-template-columns:auto 1fr;gap:4px 12px;font-size:12px;line-height:1.5;"]),x=(0,m.default)(n.TextSmall).attrs({as:"span",color:"text"}).withConfig({displayName:"styled__SummaryValue",componentId:"sc-n2rgc1-1"})(["overflow-wrap:anywhere;"]),b=(0,m.default)(n.TextSmall).attrs({as:"span",whiteSpace:"nowrap",strong:!0,round:"3px"}).withConfig({displayName:"styled__Badge",componentId:"sc-n2rgc1-2"})(["display:inline-block;padding:1px 6px;line-height:1.4;"]),v=(0,m.default)(n.Box).attrs({as:"table"}).withConfig({displayName:"styled__StyledTable",componentId:"sc-n2rgc1-3"})(["width:100%;border-collapse:collapse;font-family:monospace;font-size:11px;th,td{border-bottom:1px solid ",";padding:5px 8px;text-align:left;white-space:nowrap;}th{position:sticky;top:0;z-index:1;background:",";color:",";font-weight:600;}tbody tr{cursor:pointer;}tbody tr:hover{background:",";}"],(0,n.getColor)("border"),(0,n.getColor)("mainBackground"),(0,n.getColor)("textDescription"),(0,n.getColor)("secondaryHighlight")),w=(0,m.default)(n.Box).attrs({as:"tr"}).withConfig({displayName:"styled__ExpandedRow",componentId:"sc-n2rgc1-4"})(["td{padding:8px 12px;background:rgba(0,171,68,0.03);}"]),k=(0,m.default)(n.Box).attrs({position:"relative",height:{min:"200px"}}).withConfig({displayName:"styled__InfoOverlayContainer",componentId:"sc-n2rgc1-5"})(["flex:1;"]),_=(0,m.default)(n.Box).attrs({position:"absolute",top:0,right:0,width:"75%",height:"100%",zIndex:0,overflow:"hidden"}).withConfig({displayName:"styled__DiagramBackground",componentId:"sc-n2rgc1-6"})(["pointer-events:none;mask-image:linear-gradient( to right,rgba(0,0,0,0.08) 0%,rgba(0,0,0,0.35) 25%,rgba(0,0,0,1) 40% );-webkit-mask-image:linear-gradient( to right,rgba(0,0,0,0.08) 0%,rgba(0,0,0,0.35) 25%,rgba(0,0,0,1) 40% );"]),C=(0,m.default)(n.ModalContent).attrs({overflow:"auto",width:{min:"600px"},height:{min:"400px"}}).withConfig({displayName:"styled__ResizableModalContent",componentId:"sc-n2rgc1-7"})(["resize:both;display:flex;flex-direction:column;background:",";border:1px solid rgba(45,138,154,0.2);box-shadow:0 8px 48px rgba(0,0,0,0.6),0 0 0 1px rgba(45,138,154,0.08);"],(0,n.getColor)("mainBackground")),j=(0,m.default)(n.Box).attrs({padding:[2]}).withConfig({displayName:"styled__KeyValueGrid",componentId:"sc-n2rgc1-8"})(["display:grid;grid-template-columns:auto 1fr;gap:4px 12px;font-size:12px;line-height:1.5;"]),M=(0,m.default)(n.H3).withConfig({displayName:"styled__SectionTitle",componentId:"sc-n2rgc1-9"})(["font-size:16px;margin:",";"],e=>{let{marginBottom:t}=e;return t?`0 0 ${t}px`:"0"}),S=(0,m.default)(b).withConfig({displayName:"styled__DynamicBadge",componentId:"sc-n2rgc1-10"})(["background:",";color:",";font-size:",";"],e=>{let{bg:t,theme:r}=e;return t?(0,n.getColor)(t)({theme:r}):"transparent"},e=>{let{color:t,theme:r}=e;return t?(0,n.getColor)(t)({theme:r}):"inherit"},e=>{let{fontSize:t}=e;return t?`${t}px`:"inherit"}),I=(0,m.default)(n.ModalBody).attrs({height:{min:0}}).withConfig({displayName:"styled__FlexibleModalBody",componentId:"sc-n2rgc1-11"})(["flex:1;"]),L=(0,m.default)(n.Box).attrs({as:"td"}).withConfig({displayName:"styled__BoldCell",componentId:"sc-n2rgc1-12"})(["font-weight:600;"]);var T=r(74848);const $=(0,o.memo)(e=>{let{node:t,summaryFields:r}=e;if(!t||!r?.length)return null;const s=r.map(e=>({label:e.label,value:p(t,e.sources)})).filter(e=>e.value);return(0,T.jsxs)(n.Box,{children:[(0,T.jsx)(M,{marginBottom:8,children:t.label}),(0,T.jsx)(y,{children:s.map(e=>(0,T.jsxs)(o.Fragment,{children:[(0,T.jsx)(n.TextSmall,{children:e.label}),(0,T.jsx)(x,{children:e.value})]},e.label))})]})}),E=new Set(["vendor","manufacturer","organization","vendor_source","vendorSource","vendor_confidence","vendorConfidence","model","sys_descr","sysDescr","sys_name","sysName","sys_location","sysLocation","sys_contact","sysContact","protocols","learned_sources","learnedSources","protocolsCollected","protocols_collected","capabilities","capabilities_enabled","capabilities_supported","capabilitiesEnabled","capabilitiesSupported","ports_up","portsUp","ports_down","portsDown","ports_admin_down","portsAdminDown","portsTotal","ports_total","fdb_total_macs","fdbTotalMacs","vlan_count","vlanCount","lldp_neighbor_count","lldpNeighborCount","cdp_neighbor_count","cdpNeighborCount","chart_id_prefix","chartIdPrefix","netdata_host_id","netdataHostId","inferred","port_inventory","portInventory","vendorDerived","vendor_derived","vendorDerivedConfidence","vendor_derived_confidence","vendorDerivedMatchPrefix","vendor_derived_match_prefix","vendorDerivedSource","vendor_derived_source","vendorMatchPrefix","vendor_match_prefix","ifStatuses","if_statuses","ifNames","if_names","ifIndexes","if_indexes","ifAdminStatusCounts","if_admin_status_counts","ifOperStatusCounts","if_oper_status_counts","ifLinkModeCounts","if_link_mode_counts","ifTopologyRoleCounts","if_topology_role_counts","displayName","display_name","displaySource","display_source","deviceId","device_id","discovered","deviceCharts","device_charts","chartContextPrefix","chart_context_prefix","managementAddresses","management_addresses","managementIp","management_ip"]),R=(0,o.memo)(e=>{let{node:t,portInventory:r}=e;if(!t)return null;const s=t.details?.attributes||{},a=(0,l.OR)(t),i=(0,l.LG)(s,"vendor_source","vendorSource"),d=(0,l.LG)(s,"vendor_confidence","vendorConfidence"),h=(0,l.LG)(s,"model"),p=(0,l.LG)(s,"sys_descr","sysDescr"),g=(0,l.LG)(s,"sys_location","sysLocation"),f=(0,l.LG)(s,"sys_contact","sysContact"),m=(0,l._u)(t),b=(0,l.SE)(m),v=(0,l.xd)([...(0,l.oU)(s.protocols),...(0,l.oU)(s.learned_sources)]),w=(0,c.Yh)(t,r),k=Number(s.ports_up??s.portsUp??0),_=Number(s.ports_down??s.portsDown??0),C=Number(s.ports_admin_down??s.portsAdminDown??0),j=Number(s.fdb_total_macs??s.fdbTotalMacs??0),I=Number(s.vlan_count??s.vlanCount??0),L=Number(s.lldp_neighbor_count??s.lldpNeighborCount??0),$=Number(s.cdp_neighbor_count??s.cdpNeighborCount??0),R=(0,l.LG)(s,"chart_id_prefix","chartIdPrefix"),A=(0,l.LG)(s,"netdata_host_id","netdataHostId"),N=[],P=(e,t)=>{t&&"-"!==t&&N.push({label:e,value:t})};P("Type",`${t.actorType||"-"}${b?` (${b})`:""}`),P("Vendor",`${a}${i?` [${i}${d?`/${d}`:""}]`:""}`),P("Model",h),P("Description",p),P("Location",g),P("Contact",f),v.length&&P("Protocols",v.join(", ")),m.length&&P("Capabilities",m.join(", ")),w>0&&P("Ports",`${w} total (${k} up, ${_} down, ${C} admin-down)`),I>0&&P("VLANs",`${I}`),j>0&&P("FDB MACs",`${j}`),(L>0||$>0)&&P("Neighbors",`LLDP: ${L}, CDP: ${$}`),R&&P("Chart Prefix",R),A&&P("Netdata Host",A),P("Source",t.source||"-"),P("Layer",t.layer||"-"),t.inferred&&P("Inferred","yes");const F=[];return Object.entries(s).forEach(e=>{let[t,r]=e;if(E.has(t))return;const o=u(r);o&&F.push({label:t,value:o})}),(0,T.jsxs)(n.Box,{children:[(0,T.jsxs)(n.Flex,{alignItems:"center",gap:3,margin:[0,0,1.5],children:[(0,T.jsx)(M,{children:t.label}),b&&(0,T.jsx)(S,{bg:"#f5a623",color:"#0f1818",fontSize:12,children:b})]}),(0,T.jsxs)(y,{children:[N.map(e=>(0,T.jsxs)(o.Fragment,{children:[(0,T.jsx)(n.TextSmall,{children:e.label}),(0,T.jsx)(x,{children:e.value})]},e.label)),F.map(e=>(0,T.jsxs)(o.Fragment,{children:[(0,T.jsx)(n.TextSmall,{children:e.label}),(0,T.jsx)(x,{children:e.value})]},`extra-${e.label}`))]})]})}),A=(0,o.memo)(e=>{let{node:t}=e;const r=t?.details?.labels||{},s=Object.entries(r).map(e=>{let[t,r]=e;return{key:t,value:u(r)}}).filter(e=>e.value);return s.length?(0,T.jsx)(j,{children:s.map(e=>(0,T.jsxs)(o.Fragment,{children:[(0,T.jsx)(n.TextSmall,{children:e.key}),(0,T.jsx)(x,{children:e.value})]},e.key))}):(0,T.jsx)(n.TextSmall,{color:"textDescription",padding:[2],children:"No labels available for this actor."})}),N=(0,o.memo)(e=>{let{node:t}=e;const r=t?.details?.match||{},s=Object.entries(r).map(e=>{let[t,r]=e;return{key:t,value:u(r)}}).filter(e=>e.value);return s.length?(0,T.jsx)(j,{children:s.map(e=>(0,T.jsxs)(o.Fragment,{children:[(0,T.jsx)(n.TextSmall,{children:e.key}),(0,T.jsx)(x,{children:e.value})]},e.key))}):(0,T.jsx)(n.TextSmall,{color:"textDescription",padding:[2],children:"No identity/match data available for this actor."})}),P=(0,o.memo)(e=>{let{node:t,graphLinks:r,graphNodes:s,graphNodesById:a,navigateTo:i}=e;const l=t?.id,c=(0,o.useMemo)(()=>{if(a)return a;const e=new Map;return(s||[]).forEach(t=>e.set(t.id,t)),e},[a,s]),d=(0,o.useMemo)(()=>l?r.filter(e=>e.source===l||e.target===l).map(e=>{const t=e.source===l,r=t?e.target:e.source,o=c.get(r),n=t?e.sourcePort:e.targetPort,s=t?e.targetPort:e.sourcePort,a=n&&"unknown"!==n?n:"",i=s&&"unknown"!==s?s:"";return{id:e.id,remoteId:r,remoteLabel:o?.label||r,localPort:a,remotePort:i,protocol:e.protocol||"",direction:e.direction||""}}):[],[l,r,c]),u=(0,o.useRef)(null),h=d.length>200,p=(0,g.Te)({count:h?d.length:0,getScrollElement:()=>u.current,estimateSize:()=>28,overscan:20});if(!d.length)return(0,T.jsx)(n.TextSmall,{color:"textDescription",padding:[2],children:"No links connected to this actor."});const m=h?p.getVirtualItems():[],y=h?p.getTotalSize():0,x=m.length>0?m[0].start:0,b=m.length>0?y-m[m.length-1].end:0,w=e=>(0,T.jsxs)("tr",{onClick:()=>i(e.remoteId),children:[(0,T.jsx)("td",{children:e.localPort||"-"}),(0,T.jsx)("td",{children:(0,T.jsx)(f.A,{onClick:t=>{t.stopPropagation(),i(e.remoteId)},children:e.remoteLabel})}),(0,T.jsx)("td",{children:e.remotePort||"-"}),(0,T.jsx)("td",{children:e.protocol||"-"}),(0,T.jsx)("td",{children:e.direction||"-"})]},e.id);return(0,T.jsx)(n.Box,{ref:u,overflow:"auto",height:{max:"420px"},children:(0,T.jsxs)(v,{children:[(0,T.jsx)("thead",{children:(0,T.jsxs)("tr",{children:[(0,T.jsx)("th",{children:"Local Port"}),(0,T.jsx)("th",{children:"Remote Actor"}),(0,T.jsx)("th",{children:"Remote Port"}),(0,T.jsx)("th",{children:"Protocol"}),(0,T.jsx)("th",{children:"Direction"})]})}),(0,T.jsx)("tbody",{children:h?(0,T.jsxs)(o.Fragment,{children:[x>0&&(0,T.jsx)("tr",{"aria-hidden":"true",children:(0,T.jsx)("td",{colSpan:5,style:{height:`${x}px`,padding:0,border:"none"}})}),m.map(e=>w(d[e.index])),b>0&&(0,T.jsx)("tr",{"aria-hidden":"true",children:(0,T.jsx)("td",{colSpan:5,style:{height:`${b}px`,padding:0,border:"none"}})})]}):d.map(w)})]})})});r(74423);const F=(e,t)=>{const r=e[t];return void 0!==r?r:e[h(t)]},B=(0,o.memo)(e=>{let{node:t,tableKey:r,tableDef:s,navigateTo:a,timezone:i,locale:l}=e;const[c,d]=(0,o.useState)(""),u=s?.columns||[],p=t?.details?.tables?.[r]||t?.details?.tables?.[h(r)]||[],m=(0,o.useMemo)(()=>{if(!c.trim())return p;const e=c.trim().toLowerCase();return p.filter(t=>u.some(r=>{const o=F(t,r.key);return null!==o&&void 0!==o&&(Array.isArray(o)?o.some(t=>`${t}`.toLowerCase().includes(e)):`${o}`.toLowerCase().includes(e))}))},[p,c,u]),y=(0,o.useCallback)((e,t)=>{const r=F(e,t.key);if(null===r||void 0===r||""===r)return"-";switch(t.type){case"badge":return(0,T.jsx)(S,{bg:"rgba(45,138,154,0.15)",color:"textLite",children:`${r}`});case"count":return Array.isArray(r)?`${r.length}`:`${r}`;case"number":{const e=Number(r);return isNaN(e)?`${r}`:e.toLocaleString()}case"timestamp":{const e=Number(r);if(isNaN(e)||0===e)return"-";const t=e>1e12?e:1e3*e;try{return new Date(t).toLocaleString(l||void 0,{timeZone:i||void 0})}catch{return new Date(t).toLocaleString()}}case"duration":{const e=Number(r);if(isNaN(e)||0===e)return"-";const t=Math.abs(e);return t<60?`${t}s`:t<3600?`${Math.floor(t/60)}m ${t%60}s`:t<86400?`${Math.floor(t/3600)}h ${Math.floor(t%3600/60)}m`:`${Math.floor(t/86400)}d ${Math.floor(t%86400/3600)}h`}case"bytes":{const e=Number(r);return isNaN(e)||0===e?"0":e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:e<1073741824?`${(e/1048576).toFixed(1)} MB`:`${(e/1073741824).toFixed(2)} GB`}case"actor_link":{const o=F(e,`${t.key}_id`);return o?(0,T.jsx)(f.A,{onClick:e=>{e.stopPropagation(),a(o)},children:`${r}`}):`${r}`}default:return Array.isArray(r)?r.join(", "):`${r}`}},[a,i,l]),x=(0,o.useRef)(null),b=m.length>200,w=(0,g.Te)({count:b?m.length:0,getScrollElement:()=>x.current,estimateSize:()=>28,overscan:20});if(!p.length)return(0,T.jsxs)(n.TextSmall,{color:"textDescription",padding:[2],children:["No ",s?.label||r," data available."]});const k=b?w.getVirtualItems():[],_=b?w.getTotalSize():0,C=k.length>0?k[0].start:0,j=k.length>0?_-k[k.length-1].end:0;return(0,T.jsxs)(n.Flex,{column:!0,gap:1,children:[(0,T.jsxs)(n.Flex,{alignItems:"center",gap:2,children:[(0,T.jsxs)(n.TextSmall,{strong:!0,color:"textDescription",children:[s?.label||r," (",m.length,m.length!==p.length?` of ${p.length}`:"",")"]}),(0,T.jsx)(n.SearchInput,{value:c,onChange:d,placeholder:`Search ${s?.label||r}...`})]}),(0,T.jsx)(n.Box,{ref:x,overflow:"auto",height:{max:"420px"},children:(0,T.jsxs)(v,{children:[(0,T.jsx)("thead",{children:(0,T.jsx)("tr",{children:u.map(e=>(0,T.jsx)("th",{children:e.label||e.key},e.key))})}),(0,T.jsx)("tbody",{children:b?(0,T.jsxs)(T.Fragment,{children:[C>0&&(0,T.jsx)("tr",{"aria-hidden":"true",children:(0,T.jsx)("td",{colSpan:u.length,style:{height:`${C}px`,padding:0,border:"none"}})}),k.map(e=>{const t=m[e.index];return(0,T.jsx)("tr",{children:u.map(e=>(0,T.jsx)("td",{children:y(t,e)},e.key))},e.index)}),j>0&&(0,T.jsx)("tr",{"aria-hidden":"true",children:(0,T.jsx)("td",{colSpan:u.length,style:{height:`${j}px`,padding:0,border:"none"}})})]}):m.map((e,t)=>(0,T.jsx)("tr",{children:u.map(t=>(0,T.jsx)("td",{children:y(e,t)},t.key))},t))})]})})]})}),z=(0,o.memo)(e=>{let{node:t,portInventory:r,graphLinks:s,graphNodes:a,graphNodesById:i,navigateTo:u,search:h,setSearch:p,linkedOnly:g,setLinkedOnly:m,expandedPort:y,setExpandedPort:x}=e;const b=t?.id,k=(0,o.useMemo)(()=>{if(i)return i;const e=new Map;return a.forEach(t=>e.set(t.id,t)),e},[i,a]),_=(0,o.useMemo)(()=>{const e=new Map;return k.forEach((t,r)=>{r!==b&&e.set(r,(0,c.gl)(t))}),e},[k,b]),C=(0,o.useMemo)(()=>{if(!b)return new Map;const e=new Map;return s.forEach(t=>{if(t.source!==b&&t.target!==b)return;const o=t.source===b,n=o?t.sourcePort:t.targetPort,s=(0,c.EF)(r,n),a=o?t.target:t.source,i=o?t.targetPort:t.sourcePort,l=k.get(a),d=_.get(a)||null,u=d?(0,c.EF)(d,i):i||"-";e.has(s)||e.set(s,[]),e.get(s).push({id:t.id,protocol:t.protocol||"-",direction:t.direction||"-",remoteId:a,remoteLabel:l?.label||a,remotePort:u,weight:t.weight||0})}),e},[b,s,k,_,r]),j=(0,o.useMemo)(()=>{const e=new Set;return s.forEach(t=>{(0,l.vF)(t.protocol)&&(t.source===b&&e.add((0,c.EF)(r,t.sourcePort)),t.target===b&&e.add((0,c.EF)(r,t.targetPort)))}),e},[b,s,r]),M=(0,o.useMemo)(()=>{const e=new Set;return s.forEach(t=>{t.source===b&&e.add((0,c.EF)(r,t.sourcePort)),t.target===b&&e.add((0,c.EF)(r,t.targetPort))}),e},[b,s,r]),I=(0,o.useMemo)(()=>{const e=r?.ports||new Map,t=new Map;return[...e.entries()].forEach(e=>{let[r,o]=e;const n=C.has(r)||M.has(r),s=j.has(r),a="up"===`${o.operStatus||""}`.trim().toLowerCase(),i=!o.operStatus&&M.has(r);let l="idle";(a||i)&&(l=s?"discovery":"topology");const d=(0,c.Zc)({status:l,role:o.topologyRole,mode:o.linkMode});t.set(r,{name:r,ifIndex:o.ifIndex||"",adminStatus:o.adminStatus||"",operStatus:o.operStatus||"",linkMode:(0,c.vC)(o.linkMode),topologyRole:(0,c.DV)(o.topologyRole),stpState:o.stpState||"",fdbMacCount:o.fdbMacCount||0,vlanIds:o.vlanIds||[],neighbors:o.neighbors||[],chartIdSuffix:o.chartIdSuffix||"",availableMetrics:o.availableMetrics||[],portState:l,portType:d,hasLinks:n,linkCount:(C.get(r)||[]).length,neighborCount:(o.neighbors||[]).length})}),M.forEach(e=>{if(!e||e===d.Lc)return;if(t.has(e))return;const r=C.has(e),o=j.has(e),n=r?o?"discovery":"topology":"idle",s=(0,c.Zc)({status:n,role:"unknown",mode:"unknown"});t.set(e,{name:e,ifIndex:"",adminStatus:"",operStatus:"",linkMode:"unknown",topologyRole:"unknown",stpState:"",fdbMacCount:0,vlanIds:[],neighbors:[],chartIdSuffix:"",availableMetrics:[],portState:n,portType:s,hasLinks:r,linkCount:(C.get(e)||[]).length,neighborCount:0})}),[...t.values()].sort((e,t)=>(0,c.yl)(e.name,t.name))},[r,C,M,j]),$=(0,o.useMemo)(()=>{let e=I;if(g&&(e=e.filter(e=>e.hasLinks)),h.trim()){const t=h.trim().toLowerCase();e=e.filter(e=>{if(e.name.toLowerCase().includes(t))return!0;if(e.operStatus.toLowerCase().includes(t))return!0;if(e.linkMode.toLowerCase().includes(t))return!0;if(e.topologyRole.toLowerCase().includes(t))return!0;if(e.stpState.toLowerCase().includes(t))return!0;return!!(C.get(e.name)||[]).some(e=>e.remoteLabel.toLowerCase().includes(t))||!!e.neighbors.some(e=>`${e.remote_device||""}`.toLowerCase().includes(t))})}return e},[I,g,h,C]),E=(0,o.useCallback)(e=>{x(y===e?null:e)},[y,x]);return I.length?(0,T.jsxs)(n.Flex,{column:!0,gap:1,children:[(0,T.jsxs)(n.Flex,{alignItems:"center",justifyContent:"between",children:[(0,T.jsxs)(n.Flex,{alignItems:"center",gap:2,children:[(0,T.jsxs)(n.TextSmall,{strong:!0,color:"textDescription",children:["Ports (",$.length,g?` of ${I.length}`:"",")"]}),(0,T.jsx)(n.SearchInput,{value:h,onChange:p,placeholder:"Search ports..."})]}),(0,T.jsx)(n.Button,{flavour:"hollow",active:g,small:!0,onClick:()=>m(!g),children:g?"Linked only":"All ports"})]}),(0,T.jsx)(n.Box,{overflow:"auto",height:{max:"420px"},children:(0,T.jsxs)(v,{children:[(0,T.jsx)("thead",{children:(0,T.jsxs)("tr",{children:[(0,T.jsx)("th",{children:"Port"}),(0,T.jsx)("th",{children:"Status"}),(0,T.jsx)("th",{children:"Admin"}),(0,T.jsx)("th",{children:"Type"}),(0,T.jsx)("th",{children:"Mode"}),(0,T.jsx)("th",{children:"Role"}),(0,T.jsx)("th",{children:"STP"}),(0,T.jsx)("th",{children:"VLANs"}),(0,T.jsx)("th",{children:"FDB"}),(0,T.jsx)("th",{children:"Links"}),(0,T.jsx)("th",{children:"Neighbors"})]})}),(0,T.jsx)("tbody",{children:$.map(e=>{const t=y===e.name,r=(e=>{const t=`${e||""}`.trim().toLowerCase();return"up"===t?{bg:"#00ab44",color:"#fff",label:"UP"}:"down"===t||"lowerlayerdown"===t?{bg:"#f44",color:"#fff",label:"DOWN"}:"notpresent"===t?{bg:"#666",color:"#ddd",label:"N/P"}:"testing"===t?{bg:"#ff8a00",color:"#fff",label:"TEST"}:{bg:"#444",color:"#aaa",label:t||"-"}})(e.operStatus),s=(0,c.IV)(e.portType),a=(e=>{const t=`${e||""}`.trim().toLowerCase();return"forwarding"===t?{bg:"#00ab44",color:"#fff",label:"FWD"}:"blocking"===t?{bg:"#f44",color:"#fff",label:"BLK"}:"learning"===t?{bg:"#ff8a00",color:"#fff",label:"LRN"}:"listening"===t?{bg:"#ffcc00",color:"#222",label:"LSN"}:"disabled"===t?{bg:"#666",color:"#ddd",label:"DIS"}:null})(e.stpState),i=C.get(e.name)||[];return(0,T.jsxs)(o.Fragment,{children:[(0,T.jsxs)("tr",{onClick:()=>E(e.name),children:[(0,T.jsxs)(L,{children:[t?"\u25bc ":"\u25b6 ",e.name]}),(0,T.jsx)("td",{children:(0,T.jsx)(S,{bg:r.bg,color:r.color,children:r.label})}),(0,T.jsx)("td",{children:e.adminStatus||"-"}),(0,T.jsx)("td",{children:(0,T.jsx)(S,{bg:s.bullet,color:s.popoverColor,children:s.label})}),(0,T.jsx)("td",{children:"unknown"!==e.linkMode?(0,T.jsx)(S,{bg:"trunk"===e.linkMode?"#ff8a00":"#6ea8ff",color:"trunk"===e.linkMode?"#2d1700":"#0b2440",children:e.linkMode}):"-"}),(0,T.jsx)("td",{children:"unknown"!==e.topologyRole?(0,T.jsx)(S,{bg:"switch_facing"===e.topologyRole?"#f5a623":"host_facing"===e.topologyRole?"#2e9bff":"#50b8ff",color:"#0f1818",children:e.topologyRole.replace("_","-")}):"-"}),(0,T.jsx)("td",{children:a?(0,T.jsx)(S,{bg:a.bg,color:a.color,children:a.label}):"-"}),(0,T.jsx)("td",{children:e.vlanIds.length||"-"}),(0,T.jsx)("td",{children:e.fdbMacCount||"-"}),(0,T.jsx)("td",{children:e.linkCount||"-"}),(0,T.jsx)("td",{children:e.neighborCount||"-"})]}),t&&(0,T.jsx)(w,{children:(0,T.jsx)("td",{colSpan:11,children:(0,T.jsxs)(n.Flex,{column:!0,gap:1,children:[i.length>0&&(0,T.jsxs)(n.Flex,{column:!0,gap:.5,children:[(0,T.jsxs)(n.TextSmall,{strong:!0,children:["Links (",i.length,")"]}),i.map(e=>(0,T.jsxs)(n.Flex,{gap:2,alignItems:"center",children:[(0,T.jsx)(n.TextSmall,{children:e.protocol}),(0,T.jsx)(n.TextSmall,{children:e.direction}),(0,T.jsxs)(n.TextSmall,{children:[(0,T.jsx)(f.A,{onClick:t=>{t.stopPropagation(),u(e.remoteId,{expandPort:e.remotePort})},children:e.remoteLabel}),e.remotePort&&"-"!==e.remotePort?` : ${e.remotePort}`:""]})]},e.id))]}),e.neighbors.length>0&&(0,T.jsxs)(n.Flex,{column:!0,gap:.5,children:[(0,T.jsxs)(n.TextSmall,{strong:!0,children:["LLDP/CDP Neighbors (",e.neighbors.length,")"]}),e.neighbors.map((e,t)=>(0,T.jsxs)(n.Flex,{gap:2,alignItems:"center",children:[(0,T.jsx)(S,{bg:"rgba(0,171,68,0.2)",color:"#43ea7f",fontSize:10,children:e.protocol||"?"}),(0,T.jsx)(n.TextSmall,{children:e.remote_device||"-"}),(0,T.jsxs)(n.TextSmall,{children:["port: ",e.remote_port||"-"]}),e.remote_ip&&(0,T.jsxs)(n.TextSmall,{children:["IP: ",e.remote_ip]})]},t))]}),e.chartIdSuffix&&(0,T.jsxs)(n.Flex,{column:!0,gap:.3,children:[(0,T.jsx)(n.TextSmall,{strong:!0,children:"Charts"}),(0,T.jsxs)(n.TextSmall,{color:"primary",children:["suffix: ",e.chartIdSuffix,e.availableMetrics.length>0&&(0,T.jsxs)(T.Fragment,{children:[" \xb7 metrics: ",e.availableMetrics.join(", ")]})]})]}),!i.length&&!e.neighbors.length&&!e.chartIdSuffix&&(0,T.jsx)(n.TextSmall,{children:"No additional details"})]})})})]},e.name)})})]})})]}):(0,T.jsx)(n.TextSmall,{color:"textDescription",padding:[2],children:"No ports available for this actor."})}),O=(0,o.memo)(e=>{let{actorId:t,graphNodes:r,graphLinks:h,aggregatedLinks:p,allLinks:g,presentation:f,onClose:m}=e;const{timezone:y,locale:x}=(0,a.bO)(),[b,v]=(0,o.useState)([{actorId:t,activeTab:"info",subTab:"ports",portSearch:"",linkedOnly:!1,expandedPort:null}]),[w,j]=(0,o.useState)(0),[M,{height:S}]=(0,s.A)(),L=b[w],E=L.actorId,F=(0,o.useMemo)(()=>{const e=new Map;return r.forEach(t=>e.set(t.id,t)),e},[r]),O=(0,o.useMemo)(()=>h.filter(e=>e.source===E||e.target===E),[h,E]),D=(0,o.useCallback)(e=>{v(t=>t.map((t,r)=>r===w?{...t,...e}:t))},[w]),W=(0,o.useCallback)(e=>D({activeTab:e}),[D]),Y=(0,o.useCallback)(e=>D({subTab:e}),[D]),V=(0,o.useCallback)(e=>D({portSearch:e}),[D]),U=(0,o.useCallback)(e=>D({linkedOnly:e}),[D]),K=(0,o.useCallback)(e=>D({expandedPort:e}),[D]),G=(0,o.useCallback)(function(e){let{expandPort:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e||e===E)return;if(!F.has(e))return;const r={actorId:e,activeTab:"info",subTab:"ports",portSearch:"",linkedOnly:!1,expandedPort:null,expandedPort:t||null};v(e=>[...e.slice(0,w+1),r]),j(e=>e+1)},[w,E,F]),Z=(0,o.useCallback)(()=>{j(e=>Math.max(0,e-1))},[]),q=(0,o.useCallback)(()=>{j(e=>Math.min(b.length-1,e+1))},[b.length]),H=(0,o.useMemo)(()=>F.get(E)||null,[F,E]),X=(0,o.useMemo)(()=>f?.actor_types?.[H?.actorType]||null,[f,H?.actorType]),J=(0,o.useMemo)(()=>X?.modal_tabs?.length?X.modal_tabs:[{id:"info",label:"Info"}],[X]),Q=(0,o.useMemo)(()=>X?.tables?X.tables:{},[X]),ee=(0,o.useMemo)(()=>Object.entries(Q).sort((e,t)=>{let[,r]=e,[,o]=t;return(r.order||0)-(o.order||0)}),[Q]);(0,o.useEffect)(()=>{ee.length&&!ee.some(e=>{let[t]=e;return t===L.subTab})&&"labels"!==L.subTab&&"matches"!==L.subTab&&Y(ee[0][0])},[ee,L.subTab,Y]);const te=(0,o.useMemo)(()=>(0,l.mt)({actorId:E,nodes:r,links:p||h}),[E,r,p,h]),re=(0,o.useMemo)(()=>H?(0,c.gl)(H):{ports:new Map,aliases:new Map},[H]),oe=(0,o.useMemo)(()=>{const e=H?.details?.labels||{},t=H?.details?.match||{},r=Object.entries(e).filter(e=>{let[,t]=e;return u(t)}).length,o=Object.entries(t).filter(e=>{let[,t]=e;return u(t)}).length,n=O.length,s=new Set;H&&O.forEach(e=>{if(e.source===H.id){const t=(0,c.EF)(re,e.sourcePort);t&&t!==d.Lc&&s.add(t)}if(e.target===H.id){const t=(0,c.EF)(re,e.targetPort);t&&t!==d.Lc&&s.add(t)}});return{ports:Math.max(re?.ports?.size||0,s.size),labels:r,matches:o,links:n}},[H,O,re]),ne=w>0,se=w<b.length-1;return(0,T.jsx)(n.Modal,{onClickOutside:m,onEsc:m,children:(0,T.jsxs)(C,{width:"75vw",height:{max:"95vh"},children:[(0,T.jsxs)(n.ModalHeader,{children:[(0,T.jsxs)(n.Flex,{alignItems:"center",gap:2,flex:!0,children:[(0,T.jsx)(n.IconButton,{icon:"chevron_left",flavour:"hollow",disabled:!ne,onClick:Z,tooltip:"Back",iconSize:"small"}),(0,T.jsx)(n.IconButton,{icon:"chevron_right",flavour:"hollow",disabled:!se,onClick:q,tooltip:"Forward",iconSize:"small"}),(0,T.jsx)(n.H3,{children:H?.label||E})]}),(0,T.jsx)(n.ModalCloseButton,{onClose:m})]}),(0,T.jsx)(n.Flex,{children:J.map(e=>(0,T.jsx)(n.Tab,{label:e.label,active:L.activeTab===e.id,onClick:()=>W(e.id)},e.id))}),(0,T.jsxs)(I,{overflow:{vertical:"auto"},padding:[2],children:["info"===L.activeTab&&H&&(0,T.jsxs)(n.Flex,{column:!0,gap:2,flex:!0,children:[(0,T.jsxs)(k,{ref:M,children:[(0,T.jsx)(_,{children:(0,T.jsx)(i.A,{nodes:te.nodes,links:te.links,portStateLinks:g||h,height:Math.max(200,S||200),selectedNodeId:E,emptyMessage:"",presentation:f,isolationMode:!0,isolationActorId:E})}),(0,T.jsx)(n.Box,{position:"relative",zIndex:1,children:X?.summary_fields?(0,T.jsx)($,{node:H,summaryFields:X.summary_fields}):(0,T.jsx)(R,{node:H,portInventory:re})})]}),(0,T.jsxs)(n.Flex,{children:[ee.map(e=>{let[t,r]=e;return(0,T.jsx)(n.Tab,{label:r.label||t,active:L.subTab===t,onClick:()=>Y(t)},t)}),!ee.length&&(0,T.jsxs)(o.Fragment,{children:[(0,T.jsx)(n.Tab,{label:`Ports (${oe.ports})`,active:"ports"===L.subTab,onClick:()=>Y("ports")}),(0,T.jsx)(n.Tab,{label:`Links (${oe.links})`,active:"links"===L.subTab,onClick:()=>Y("links")})]}),(0,T.jsx)(n.Tab,{label:`Labels (${oe.labels})`,active:"labels"===L.subTab,onClick:()=>Y("labels")}),(0,T.jsx)(n.Tab,{label:`Matches (${oe.matches})`,active:"matches"===L.subTab,onClick:()=>Y("matches")})]}),ee.map(e=>{let[t,r]=e;return L.subTab!==t?null:"links"===r.source?(0,T.jsx)(P,{node:H,graphLinks:O,graphNodesById:F,navigateTo:G},t):"data"===r.source?(0,T.jsx)(B,{node:H,tableKey:t,tableDef:r,navigateTo:G,timezone:y,locale:x},t):null}),!ee.length&&"ports"===L.subTab&&(0,T.jsx)(z,{node:H,portInventory:re,graphLinks:O,graphNodes:r,graphNodesById:F,navigateTo:G,search:L.portSearch,setSearch:V,linkedOnly:L.linkedOnly,setLinkedOnly:U,expandedPort:L.expandedPort,setExpandedPort:K}),!ee.length&&"links"===L.subTab&&(0,T.jsx)(P,{node:H,graphLinks:O,graphNodesById:F,navigateTo:G}),"labels"===L.subTab&&(0,T.jsx)(A,{node:H}),"matches"===L.subTab&&(0,T.jsx)(N,{node:H})]}),"info"===L.activeTab&&!H&&(0,T.jsx)(n.Box,{padding:[2],children:(0,T.jsxs)(n.Text,{color:"textDescription",children:["Actor not found: ",E]})})]})]})})}),D=O},15036(e,t,r){r.d(t,{Cd:()=>n,Lc:()=>o,d4:()=>a,fO:()=>s});const o="unknown",n={unknown:0,host_candidate:1,host_facing:2,switch_facing:3},s={low:1,medium:2,high:3},a={lldp:{bullet:"#00ab44",popoverBackground:"#43ea7f",popoverColor:"#06280f",label:"lldp/cdp"},switch_facing:{bullet:"#f5a623",popoverBackground:"#ffc76f",popoverColor:"#2d1700",label:"switch-facing"},host_facing:{bullet:"#a855f7",popoverBackground:"#c4b5fd",popoverColor:"#2e1065",label:"host-facing"},host_candidate:{bullet:"#22d3ee",popoverBackground:"#67e8f9",popoverColor:"#083344",label:"host-candidate"},trunk:{bullet:"#f43f5e",popoverBackground:"#fda4af",popoverColor:"#4c0519",label:"trunk"},access:{bullet:"#a3e635",popoverBackground:"#d9f99d",popoverColor:"#1a2e05",label:"access"},topology:{bullet:"#38bdf8",popoverBackground:"#7dd3fc",popoverColor:"#082f49",label:"unclassified"},idle:{bullet:"#5b6568",popoverBackground:"#5b6568",popoverColor:"#e8efef",label:"idle"},unknown:{bullet:"#667174",popoverBackground:"#b6c0c4",popoverColor:"#1f2a2c",label:"unknown"}}},32981(e,t,r){r.d(t,{DV:()=>i,EF:()=>v,IV:()=>b,Tm:()=>s,Yh:()=>_,Zc:()=>x,gl:()=>w,qk:()=>l,te:()=>c,vC:()=>a,yl:()=>f});r(98992),r(54520),r(72577),r(3949),r(81454),r(37550),r(71517),r(11379),r(93777),r(14190),r(12359),r(86097),r(17273),r(27415),r(19929),r(37583),r(55122),r(20230),r(57268),r(79733),r(25509),r(65223),r(60321),r(41927),r(11632),r(64377),r(66771),r(12516),r(68931),r(52514),r(35694),r(52774),r(49536),r(21926),r(94483),r(16215);var o=r(15036),n=r(49440);const s=(e,t)=>`${e}|${t}`,a=e=>{const t=`${e||""}`.trim().toLowerCase();return"trunk"===t||"access"===t?t:"unknown"},i=e=>{const t=`${e||""}`.trim().toLowerCase();return"switch_facing"===t||"host_facing"===t||"host_candidate"===t?t:"unknown"},l=e=>{const t=`${e||""}`.trim().toLowerCase();return"high"===t||"medium"===t||"low"===t?t:"low"},c=e=>(0,n.xd)((0,n.oU)(e).map(e=>e.toLowerCase())),d=(e,t)=>{const r=a(e),o=a(t);return"trunk"===r||"trunk"===o?"trunk":"access"===r||"access"===o?"access":"unknown"},u=(e,t)=>{const r=i(e),n=i(t);return o.Cd[n]>o.Cd[r]?n:r},h=(e,t)=>{const r=l(e),n=l(t);return o.fO[n]>o.fO[r]?n:r},p=(e,t)=>(0,n.xd)([...e||[],...t||[]]),g=e=>{const t=`${e||""}`.trim();return t&&"-"!==t?t:o.Lc},f=(e,t)=>e.localeCompare(t,void 0,{numeric:!0,sensitivity:"base"}),m=e=>`${e||""}`.trim().toLowerCase().replace(/[\s_-]+/g,""),y=new Set(["ethernetcsmacd"]),x=e=>{let{status:t,role:r,mode:o}=e;if("discovery"===`${t}`.toLowerCase())return"lldp";const n=i(r);if("unknown"!==n)return n;const s=a(o);return"trunk"===s?"trunk":"access"===s?"access":"topology"===`${t}`.toLowerCase()?"topology":"idle"===`${t}`.toLowerCase()?"idle":"unknown"},b=e=>o.d4[e]||o.d4.unknown,v=(e,t)=>{const r=(e=>{const t=`${e||""}`.trim();if(!t)return[o.Lc];const r=t.split("|").map(e=>g(e)).filter(Boolean);return r.length?[...new Set(r)]:[o.Lc]})(t),n=e?.ports,s=e?.aliases;if(s?.size){const e=r.find(e=>s.has(e));if(e)return s.get(e)}if(n?.size){const e=r.find(e=>n.has(e));if(e)return e;const t=r.find(e=>e&&e!==o.Lc);return t||o.Lc}return r[0]||o.Lc},w=e=>{const t=e?.details?.attributes||{},r=Array.isArray(t?.if_statuses)?t.if_statuses:Array.isArray(t?.ifStatuses)?t.ifStatuses:[],n=Array.isArray(t?.if_names)?t.if_names:Array.isArray(t?.ifNames)?t.ifNames:[],s=Array.isArray(t?.if_indexes)?t.if_indexes:Array.isArray(t?.ifIndexes)?t.ifIndexes:[],f=new Map,x=new Map,b=r.some(e=>Boolean(m(e?.if_type??e?.ifType))),v=(e,t)=>{const r=g(e);r&&r!==o.Lc&&x.set(r,t)};if(r.forEach(e=>{const t=`${e?.if_name??e?.ifName??""}`.trim(),r=`${e?.if_index??e?.ifIndex??""}`.trim(),n=`${e?.admin_status??e?.adminStatus??""}`.trim(),s=`${e?.oper_status??e?.operStatus??""}`.trim(),x=m(e?.if_type??e?.ifType),w=a(e?.link_mode??e?.linkMode),k=i(e?.topology_role??e?.topologyRole),_=l(e?.topology_role_confidence??e?.topologyRoleConfidence),C=c(e?.topology_role_sources??e?.topologyRoleSources);if(b&&!(e=>{const t=m(e);return!!t&&y.has(t)})(x))return;const j=g(t||r);if(!j||j===o.Lc)return;const M=f.get(j);!M||!M.adminStatus&&n||!M.operStatus&&s?f.set(j,{name:j,ifIndex:r,ifType:x,adminStatus:n,operStatus:s,linkMode:d(M?.linkMode,w),topologyRole:u(M?.topologyRole,k),topologyRoleConfidence:h(M?.topologyRoleConfidence,_),topologyRoleSources:p(M?.topologyRoleSources,C),stpState:`${e?.stp_state??e?.stpState??""}`.trim()||"",fdbMacCount:Number(e?.fdb_mac_count??e?.fdbMacCount??0)||0,vlanIds:Array.isArray(e?.vlan_ids??e?.vlanIds)?e?.vlan_ids??e?.vlanIds:[],neighbors:Array.isArray(e?.neighbors)?e.neighbors:[],chartIdSuffix:`${e?.chart_id_suffix??e?.chartIdSuffix??""}`.trim()||"",availableMetrics:Array.isArray(e?.available_metrics??e?.availableMetrics)?e?.available_metrics??e?.availableMetrics:[]}):M&&(M.linkMode=d(M.linkMode,w),M.topologyRole=u(M.topologyRole,k),M.topologyRoleConfidence=h(M.topologyRoleConfidence,_),M.topologyRoleSources=p(M.topologyRoleSources,C)),v(t,j),v(r,j)}),!r.length){const e={ifType:"",adminStatus:"",operStatus:"",linkMode:"unknown",topologyRole:"unknown",topologyRoleConfidence:"low",topologyRoleSources:[],stpState:"",fdbMacCount:0,vlanIds:[],neighbors:[],chartIdSuffix:"",availableMetrics:[]};n.length?n.forEach((t,r)=>{const n=g(t);n&&n!==o.Lc&&!f.has(n)&&(f.set(n,{...e,name:n,ifIndex:""}),v(t,n),v(s[r],n))}):s.forEach(t=>{const r=g(t);r&&r!==o.Lc&&!f.has(r)&&(f.set(r,{...e,name:r,ifIndex:`${t}`}),v(t,r))})}return{ports:f,aliases:x}},k=e=>{const t=Number(e);return!Number.isFinite(t)||t<=0?0:t},_=(e,t)=>{const r=e?.details?.attributes||{},o=k(r?.ports_total??r?.portsTotal);if(o>0)return o;const n=k(t?.ports?.size);return n>0?n:0}},49440(e,t,r){r.d(t,{Dh:()=>C,FL:()=>v,LG:()=>i,Lf:()=>x,NI:()=>d,OR:()=>g,Po:()=>f,SE:()=>h,TV:()=>k,Z4:()=>j,_B:()=>b,_N:()=>w,_l:()=>p,_u:()=>u,cn:()=>a,mt:()=>M,oU:()=>n,pV:()=>y,vF:()=>_,xd:()=>s});r(74423),r(98992),r(54520),r(81454),r(25509),r(65223),r(60321),r(41927),r(11632),r(64377),r(66771),r(12516),r(68931),r(52514),r(35694),r(52774),r(49536),r(21926),r(94483),r(16215);const o=e=>"[unset]"===e||"unset"===e||"[unknown]"===e,n=e=>Array.isArray(e)?e.map(e=>`${e??""}`.trim()).filter(e=>e&&!o(e)):"string"===typeof e?e.split(/[,\s]+/).map(e=>e.trim()).filter(e=>e&&!o(e)):[],s=e=>[...new Set(e.map(e=>`${e??""}`.trim()).filter(Boolean))].sort((e,t)=>e.localeCompare(t,void 0,{sensitivity:"base",numeric:!0})),a=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;const r=Array.isArray(e)?e:[];if(r.length<=t)return r;const o=r.length-t;return[...r.slice(0,t),`+${o} more`]},i=function(e){if(!e||"object"!==typeof e)return"";for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];for(const n of r){const t=e[n];if("string"===typeof t&&t.trim())return t.trim()}return""},l=function(e){if(!e||"object"!==typeof e)return[];for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];for(const n of r)if(Array.isArray(e[n]))return e[n];return[]},c=e=>{const t=l(e||{},"management_addresses","managementAddresses");return s(t.map(e=>"string"===typeof e?e:e&&"object"===typeof e?`${e.address||e.ip||""}`.trim():"").filter(Boolean))},d=e=>{const t=e?.details?.match||{},r=e?.details?.attributes||{},o=e?.details?.labels||{};return[{key:"actor_id",values:s([e?.id])},{key:"ip",values:s([...l(t,"ipAddresses","ip_addresses"),i(r,"management_ip","managementIp"),...c(r)])},{key:"mac",values:s(l(t,"macAddresses","mac_addresses"))},{key:"chassis",values:s(l(t,"chassisIds","chassis_ids"))},{key:"hostname",values:s([...l(t,"hostnames"),i(t,"sys_name","sysName"),i(r,"sys_name","sysName"),i(r,"display_name","displayName"),i(o,"display_name","displayName")])},{key:"netdata",values:s([i(t,"netdataMachineGuid","netdata_machine_guid"),i(t,"netdataNodeId","netdata_node_id")])}].filter(e=>e.values.length)},u=e=>{const t=e?.details?.attributes||{},r=[...n(t.capabilities),...n(t.capabilities_enabled),...n(t.capabilities_supported),...n(t.capabilitiesEnabled),...n(t.capabilitiesSupported)];return s(r.map(e=>e.toLowerCase()))},h=e=>{const t=new Set(e||[]);return t.has("firewall")?"FW":t.has("router")?"R":t.has("bridge")?"SW":t.has("wlanaccesspoint")||t.has("wlan-ap")||t.has("wlanap")?"AP":""},p=e=>{const t=new Set(e||[]);return t.has("firewall")?"firewall":t.has("router")?"router":t.has("bridge")?"switch":t.has("wlanaccesspoint")||t.has("wlan-ap")||t.has("wlanap")?"access_point":t.has("telephone")?"phone":""},g=e=>{const t=e?.details?.attributes||{},r=e?.details?.labels||{},o=e?.details?.match||{};return i(t,"vendor","manufacturer","organization")||i(r,"vendor","manufacturer","organization")||i(o,"vendor","manufacturer","organization")||"-"},f=e=>{if(!e)return!1;return`${e.actorType||e.kind||""}`.toLowerCase().includes("segment")},m=new Set(["device","router","switch","firewall","access_point","server","storage","load_balancer","printer","phone","ups","camera"]),y=e=>{const t=`${e?.actorType||e?.kind||""}`.toLowerCase();return m.has(t)},x=e=>y(e)&&!e?.inferred,b=e=>!f(e)&&!!e?.inferred,v=e=>{const t=`${e?.actorType||e?.kind||""}`.toLowerCase();return t.includes("endpoint")||t.includes("derived")},w=e=>x(e)&&"snmp"===`${e?.source||""}`.trim().toLowerCase(),k=e=>"lldp"===`${e?.protocol||""}`.toLowerCase(),_=e=>{const t=`${e||""}`.toLowerCase();return"lldp"===t||"cdp"===t},C=e=>{let{node:t,lldpNodeIds:r,segmentNodeIds:o}=e;return(e=>{const t=`${e?.actorType||e?.kind||""}`.toLowerCase(),r=`${e?.details?.labels?.actor_class||e?.details?.attributes?.actor_class||""}`.toLowerCase();return"self"===t||"self"===r})(t)?"self":o.has(t.id)?"segment":b(t)?"inferred":r.has(t.id)?"lldp":v(t)?"derived":(e=>!(!e||f(e)||v(e)||b(e))&&y(e))(t)?"snmp":"default"},j=e=>{let{link:t,sourceKind:r,targetKind:o}=e;const n=`${t?.details?.labels?.link_class||""}`.trim().toLowerCase();if("ownership"===n||"ownership"===`${t?.protocol||""}`.trim().toLowerCase())return"ownership";if("socket"===n)return"socket";if(k(t))return"lldp";const s=`${t?.details?.metrics?.inference||t?.details?.state||""}`.trim().toLowerCase(),a=`${t?.details?.metrics?.attachment_mode||""}`.trim().toLowerCase();return"probable"===s||a.startsWith("probable_")?"probable":"segment"===r||"segment"===o?"segment":"derived"===r||"derived"===o?"derived":"snmp"===r||"snmp"===o?"snmp":"default"},M=e=>{let{actorId:t,nodes:r,links:o}=e;const n=new Set;n.add(t);const s=o.filter(e=>(e.source===t||e.target===t)&&(n.add(e.source),n.add(e.target),!0));return{nodes:r.filter(e=>n.has(e.id)),links:s}}}}]);