File: //opt/netdata/usr/share/netdata/web/v3/6839.38a3c803754e7986a338.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:"161df38a3ce485b0993d5667ea290f6097b8818b"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e785d3fc-c1e2-4cce-9e00-a2caca27ba20",e._sentryDebugIdIdentifier="sentry-dbid-e785d3fc-c1e2-4cce-9e00-a2caca27ba20")}catch(e){}}(),(globalThis.webpackChunkcloud_frontend=globalThis.webpackChunkcloud_frontend||[]).push([[6839],{3623(e,t,o){o.d(t,{A:()=>a});o(98992),o(81454);var n=o(96540),r=o(54550),s=o(74848);const i=(e,t)=>{const o=e?.domEvent,n=t?.getDiv?.();if(!o||!n)return null;const r=n.getBoundingClientRect();return{x:o.clientX-r.left,y:o.clientY-r.top}},l=e=>{let{from:t,to:o,color:s,hoveredColor:l,isHovered:a,strokeWidth:d,strokeOpacity:c,hitWidth:u,onHover:g}=e;const h=(0,r.ko)();return(0,n.useEffect)(()=>{const e=window.google?.maps;if(!h||!t||!o||!e)return;const n=[{lat:t.latitude,lng:t.longitude},{lat:o.latitude,lng:o.longitude}],r=new e.Polyline({path:n,strokeColor:a?l:s,strokeOpacity:c,strokeWeight:d,geodesic:!0,zIndex:1,map:h}),p=new e.Polyline({path:[{lat:t.latitude,lng:t.longitude},{lat:o.latitude,lng:o.longitude}],strokeColor:s,strokeOpacity:.01,strokeWeight:u,geodesic:!0,zIndex:2,map:h});return g&&(p.addListener("mouseover",e=>g(i(e,h))),p.addListener("mousemove",e=>g(i(e,h))),p.addListener("mouseout",()=>g(null))),()=>{r.setMap(null),p.setMap(null),e.event.clearInstanceListeners(p)}},[h,t,o,s,l,a,d,c,u,g]),null},a=e=>{let{links:t,nodeById:o,hoveredLinkId:n,hoveredColor:r,maxLinkBytes:i,getLinkStrokeWidths:a,onHoverLink:d}=e;return t.map(e=>{const t=o[e.fromNodeId],c=o[e.toNodeId];if(!t||!c)return null;const{strokeWidth:u,strokeOpacity:g,hitWidth:h}=a(e.bytes,i,n===e.id);return(0,s.jsx)(l,{from:t._geo,to:c._geo,color:e.color,hoveredColor:r,isHovered:n===e.id,strokeWidth:u,strokeOpacity:g,hitWidth:h,onHover:t=>d(t?{id:e.id,position:t}:null)},e.id)})}},98212(e,t,o){o.d(t,{A:()=>a});var n=o(96540),r=o(41514),s=o(38429),i=o(74848);class l extends n.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){(0,r.H)("geomap-error",{error:e.message,stack:t.componentStack})}render(){return this.state.hasError?(0,i.jsxs)(s.Flex,{column:!0,alignItems:"center",justifyContent:"center",height:"100%",gap:4,padding:[8],children:[(0,i.jsx)(s.Icon,{name:"alert_triangle",size:"large",color:"error"}),(0,i.jsx)(s.Text,{strong:!0,children:"Map failed to load"}),(0,i.jsx)(s.Text,{color:"textLite",textAlign:"center",width:{max:100},children:this.state.error?.message||"An error occurred while loading the map. Please check your network connection and try again."}),(0,i.jsx)(s.Button,{flavour:"borderless",onClick:()=>this.setState({hasError:!1,error:null}),children:"Retry"})]}):this.props.children}}const a=l},76839(e,t,o){o.r(t),o.d(t,{default:()=>y});o(98992),o(81454);var n=o(96540),r=o(54550),s=o(882),i=o(38429),l=o(2817),a=o(75811),d=o(84819),c=o(82226),u=o(15715),g=o(74848);const h=e=>{let{node:t,onClick:o}=e;const[s,i]=(0,n.useState)(!1),{hasAlert:l,critical:a}=(0,c.t3)(t),h=(0,c.qY)(t),p=(0,n.useCallback)(()=>{o&&o(t.id)},[t.id,o]);return(0,g.jsx)(r.J8,{position:{lat:t._geo.latitude,lng:t._geo.longitude},onClick:p,children:(0,g.jsxs)("div",{style:{position:"relative"},onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),children:[(0,g.jsx)(d.O9,{color:h,children:l&&(a>0?(0,g.jsx)(d.t6,{}):(0,g.jsx)(d.sH,{}))}),s&&(0,g.jsx)(d.fT,{children:(0,g.jsx)(u.A,{node:t,statusColor:h})})]})})};var p=o(53450);const f=e=>{let{cluster:t,nodes:o,onClick:s,isDark:i}=e;const{lat:l,lng:a,count:u}=t,h=(0,d.fA)(u),f=(0,c._9)(o,i),m=(0,c.OQ)(o),x=(0,n.useCallback)(()=>{s&&s(t)},[t,s]);return(0,g.jsx)(r.J8,{position:{lat:l,lng:a},onClick:x,children:(0,g.jsxs)(d.lk,{bg:f,style:{width:h,height:h},children:[m&&(0,g.jsx)(d.Hg,{color:p.s2[m]}),u]})})};var m=o(3623),x=o(98212);const k=e=>{let{visible:t}=e;const o=(0,r.ko)();return(0,n.useEffect)(()=>{if(!o||!t)return;const e=new google.maps.TrafficLayer;return e.setMap(o),()=>e.setMap(null)},[o,t]),null},b=e=>{let{onNodeClick:t,showTraffic:o,isDark:s,savedViewport:i,onViewportChange:d,linkProps:u={}}=e;const x=(0,l.A)(),b=(0,r.ko)(),[y,C]=(0,n.useState)(i?.zoom||p.aM),[v,w]=(0,n.useState)(null),j=(0,n.useRef)(y);j.current=y;const I=(0,n.useRef)(null),_=(0,n.useCallback)(e=>{const{zoom:t}=e.detail;C(t);const o=e.map?.getBounds();if(o){const e=o.getNorthEast(),t=o.getSouthWest();w({north:e.lat(),south:t.lat(),east:e.lng(),west:t.lng()})}d&&(clearTimeout(I.current),I.current=setTimeout(()=>{const{center:o}=e.detail;o&&d({lat:o.lat,lng:o.lng,zoom:t})},p.l6))},[d]);(0,n.useEffect)(()=>()=>clearTimeout(I.current),[]);const{processed:T,getClusterExpansionZoom:M,nodeById:E}=(0,a.A)(x,y,v),A=(0,n.useCallback)(e=>{if(!b)return;const t=M(e.id);b.panTo({lat:e.lat,lng:e.lng}),b.setZoom(Math.min(t,p.nD))},[b,M]),L=(0,n.useCallback)(e=>{if(j.current<p.KC&&b){const t=E[e];return void(t&&(b.panTo({lat:t._geo.latitude,lng:t._geo.longitude}),b.setZoom(p.p9)))}t&&t(e)},[b,E,t]),S=(0,n.useMemo)(()=>(0,c.bW)(x)||void 0,[x]),z=(0,n.useMemo)(()=>i?{lat:i.lat,lng:i.lng}:1===x.length?{lat:x[0]._geo.latitude,lng:x[0]._geo.longitude}:p.Ii,[x,i]),D=i?.zoom||(1===x.length?10:p.aM),B=!!i;return(0,g.jsxs)(r.T5,{defaultCenter:z,defaultZoom:D,defaultBounds:!B&&x.length>1?S:void 0,minZoom:p.DQ,maxZoom:p.nD,gestureHandling:"greedy",disableDefaultUI:!1,mapTypeControl:!0,zoomControl:!0,streetViewControl:!1,fullscreenControl:!1,mapId:"netdata-geo-map",colorScheme:s?"DARK":"LIGHT",onCameraChanged:_,style:{width:"100%",height:"100%"},children:[(0,g.jsx)(k,{visible:o}),u.links?.length>0&&(0,g.jsx)(m.A,{links:u.links,nodeById:E,selectedLinkId:u.selectedLinkId,onSelectLink:u.onSelectLink}),T.map(e=>"cluster"===e.type?(0,g.jsx)(f,{cluster:e,nodes:e.nodes,onClick:A,isDark:s},`cluster-${e.id}`):e.node?(0,g.jsx)(h,{node:e.node,onClick:L},e.id):null)]})},y=e=>{let{onNodeClick:t,showTraffic:o,savedViewport:n,onViewportChange:l,linkProps:a}=e;const d="Default"!==(0,s.useTheme)().name,c=(0,p.Sz)();return c?(0,g.jsx)(x.A,{children:(0,g.jsx)(r.c4,{apiKey:c,children:(0,g.jsx)(b,{onNodeClick:t,showTraffic:o,isDark:d,savedViewport:n,onViewportChange:l,linkProps:a})})}):(0,g.jsx)(x.A,{children:(0,g.jsx)(i.Flex,{justifyContent:"center",alignItems:"center",height:"100%",padding:[5],children:(0,g.jsx)(i.Text,{color:"textLite",children:"Google Maps API key not configured. Update your map settings."})})})}},15715(e,t,o){o.d(t,{A:()=>a});var n=o(882),r=o(38429),s=o(53450),i=o(74848);const l=(0,n.default)(r.Flex).attrs({alignItems:"center",gap:1,round:!0,padding:[0,1]}).withConfig({displayName:"nodeMapTooltip__AlertBadge",componentId:"sc-1jgq7ul-0"})(["font-size:10px;font-weight:600;background:",";color:",";"],e=>{let{bg:t}=e;return t},(0,r.getColor)("bright")),a=e=>{let{node:t,statusColor:o}=e;const n=t.health?.alerts?.critical||0,a=t.health?.alerts?.warning||0,d=t.nodeStatus||"Unknown";return(0,i.jsxs)(r.Flex,{column:!0,padding:[2,3],round:2,background:"mainBackground",border:{color:"borderSecondary"},width:{min:"200px",max:"280px"},style:{boxShadow:"0 4px 12px rgba(0,0,0,0.15)",pointerEvents:"none",whiteSpace:"nowrap"},children:[(0,i.jsx)(r.Text,{strong:!0,children:t.name||t.nm}),(0,i.jsxs)(r.Flex,{alignItems:"center",gap:1,children:[(0,i.jsx)(r.Box,{width:"8px",height:"8px",round:1,style:{background:o,flexShrink:0}}),(0,i.jsx)(r.TextSmall,{color:"textLite",children:d})]}),t.os?.nm&&(0,i.jsxs)(r.TextSmall,{color:"textLite",children:["OS: ",t.os.nm]}),(n>0||a>0)&&(0,i.jsxs)(r.Flex,{alignItems:"center",gap:1,margin:[1,0,0],children:[n>0&&(0,i.jsxs)(l,{bg:s.s2.critical,children:[n," critical"]}),a>0&&(0,i.jsxs)(l,{bg:s.s2.warning,children:[a," warning"]})]})]})}},84819(e,t,o){o.d(t,{Hg:()=>g,O9:()=>l,fA:()=>h,fT:()=>c,lk:()=>u,sH:()=>d,t6:()=>a});var n=o(882),r=o(38429),s=o(53450);const i=(0,n.keyframes)(["0%{transform:scale(1);opacity:0.8;}50%{transform:scale(1.8);opacity:0;}100%{transform:scale(1.8);opacity:0;}"]),l=(0,n.default)(r.Flex).attrs({alignItems:"center",justifyContent:"center",cursor:"pointer",position:"relative"}).withConfig({displayName:"shared__MarkerDot",componentId:"sc-27t4jv-0"})(["width:","px;height:","px;border-radius:50%;background:",";border:2px solid ",";box-shadow:0 2px 6px rgba(0,0,0,0.3);transition:transform 0.15s ease;&:hover{transform:scale(1.3);}"],s.DT,s.DT,e=>{let{color:t}=e;return t},(0,r.getRgbColor)("bright",.9)),a=(0,n.default)(r.Box).attrs({position:"absolute"}).withConfig({displayName:"shared__PulseRingCritical",componentId:"sc-27t4jv-1"})(["inset:-4px;border-radius:50%;border:2px solid ",";animation:"," ","s ease-out infinite;pointer-events:none;"],s.s2.critical,i,s.ap),d=(0,n.default)(r.Box).attrs({position:"absolute"}).withConfig({displayName:"shared__PulseRingWarning",componentId:"sc-27t4jv-2"})(["inset:-4px;border-radius:50%;border:2px solid ",";animation:"," ","s ease-out infinite;pointer-events:none;"],s.s2.warning,i,s.jf),c=(0,n.default)(r.Box).attrs({position:"absolute",zIndex:20}).withConfig({displayName:"shared__TooltipAnchor",componentId:"sc-27t4jv-3"})(["bottom:calc(100% + ","px);left:50%;transform:translateX(-50%);pointer-events:none;"],e=>{let{gap:t=12}=e;return t}),u=(0,n.default)(r.Flex).attrs({alignItems:"center",justifyContent:"center",cursor:"pointer",position:"relative"}).withConfig({displayName:"shared__ClusterDotBase",componentId:"sc-27t4jv-4"})(["border-radius:50%;background:",";border:3px solid ",";box-shadow:0 2px 8px rgba(0,0,0,0.3);font-size:13px;font-weight:700;color:",";transition:transform 0.15s ease;&:hover{transform:scale(1.15);}"],e=>{let{bg:t}=e;return t},(0,r.getRgbColor)("bright",.9),(0,r.getColor)("bright")),g=(0,n.default)(r.Box).attrs({position:"absolute"}).withConfig({displayName:"shared__ClusterAlertRing",componentId:"sc-27t4jv-5"})(["inset:-3px;border-radius:50%;border:2px solid ",";pointer-events:none;"],e=>{let{color:t}=e;return t}),h=e=>Math.min(s.zc+2*e,60)},75811(e,t,o){o.d(t,{A:()=>a});o(98992),o(54520),o(81454);var n=o(96540),r=o(22882),s=o(53450),i=o(49519);const l=r.A.default||r.A,a=(e,t,o)=>{const r=(0,n.useMemo)(()=>{const t=new l({radius:s.cF,maxZoom:s.cE}),o=e.map(e=>({type:"Feature",properties:{nodeId:e.id},geometry:{type:"Point",coordinates:[e._geo.longitude,e._geo.latitude]}}));return t.load(o),t},[e]),a=(0,n.useMemo)(()=>{if(!o)return[];const e=[o.west,o.south,o.east,o.north];return r.getClusters(e,Math.floor(t))},[r,o,t]),d=(0,i.A)(e),c=(0,n.useCallback)(e=>{try{return r.getClusterExpansionZoom(e)}catch{return t+2}},[r,t]),u=(0,n.useCallback)(e=>{try{return r.getLeaves(e,1/0).map(e=>d[e.properties.nodeId]).filter(Boolean)}catch{return[]}},[r,d]);return{processed:(0,n.useMemo)(()=>a.map(e=>{const[t,o]=e.geometry.coordinates;return e.properties.cluster?{type:"cluster",id:e.properties.cluster_id,lat:o,lng:t,count:e.properties.point_count,nodes:u(e.properties.cluster_id)}:{type:"node",id:e.properties.nodeId,node:d[e.properties.nodeId]}}),[a,d,u]),getClusterExpansionZoom:c,nodeById:d}}},82226(e,t,o){o.d(t,{OQ:()=>i,_9:()=>s,bW:()=>a,qY:()=>r,t3:()=>l});o(98992),o(54520),o(81454);var n=o(53450);const r=e=>e.isLive?n.Ez.live:e.isOffline?n.Ez.offline:"stale"===e.state?n.Ez.stale:n.Ez.unseen,s=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const o=e.length;if(0===o)return n.Ez.offline;const r=e.filter(e=>e.isLive).length/o;if(r>n.z1)return n.Ez.live;const s=(0,n.fK)(t);return r>n.e9?s.mixed:r>n.FU?s.mostOffline:n.Ez.offline},i=e=>{for(const t of e)if(t.health?.alerts?.critical)return"critical";for(const t of e)if(t.health?.alerts?.warning)return"warning";return null},l=e=>{const t=e.health?.alerts?.critical||0,o=e.health?.alerts?.warning||0;return{critical:t,warning:o,hasAlert:t>0||o>0,alertColor:t>0?n.s2.critical:n.s2.warning,alertSpeed:t>0?n.ap:n.jf}},a=e=>{if(e.length<=1)return null;let t=90,o=-90,n=180,r=-180;for(const l of e)t=Math.min(t,l._geo.latitude),o=Math.max(o,l._geo.latitude),n=Math.min(n,l._geo.longitude),r=Math.max(r,l._geo.longitude);const s=Math.max(.15*(o-t),2);if(r-n>180){const n=e.map(e=>{const t=e._geo.longitude;return t<0?t+360:t}),r=Math.min(...n),i=Math.max(...n),l=Math.max(.15*(i-r),2),a=r-l,d=i+l;return{north:o+s,south:t-s,west:a>180?a-360:a,east:d>180?d-360:d}}const i=Math.max(.15*(r-n),2);return{north:o+s,south:t-s,east:r+i,west:n-i}}}}]);