File: //proc/self/root/opt/netdata/netdata-web-files/v3/4416.cc8e7452070c5b1d8983.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:"aeeb2702d6a0b41e7dabfc313b63e720f0845c35"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="56b6f1ae-d802-4b11-85d1-fb06ca9c5355",e._sentryDebugIdIdentifier="sentry-dbid-56b6f1ae-d802-4b11-85d1-fb06ca9c5355")}catch(e){}}(),(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[4416,6026],{72060(e,t,r){r.d(t,{A:()=>n});r(27495),r(62953),r(3296),r(27208),r(48408);const n=e=>{try{if(!e)return null;const t=document.createElement("a");return t.href=e,/https?/.test(t.protocol)?new URL(t.protocol+"//"+t.host+t.pathname+t.search+t.hash).toString():null}catch(t){return null}}},80744(e,t,r){r.d(t,{Ay:()=>j,NA:()=>x});var n=r(64467),o=r(80045),i=(r(98992),r(54520),r(72577),r(3949),r(81454),r(62953),r(96540)),s=r(40961),a=r(43375),l=r(67012),c=r(43305),d=r(71123),u=r(61710),p=r(45427),h=r(74848);const g=["cacheId","rootId","items","onRemove","Item","containerWidth","rowHeight","gridTracks","gutter","allowOverlap","compactType","maxRows","Container","onDragEnd","onDragCancel","containerId","itemProps","rearrangeable"];function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function b(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?f(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const m={sideEffects(e){let{active:t}=e;t.node.animate([{opacity:0},{opacity:1}],{easing:"ease-in",duration:250})}},x=40,j=e=>{let{cacheId:t,rootId:r,items:n,onRemove:f,Item:j,containerWidth:y=800,rowHeight:v=x,gridTracks:O=12,gutter:w=4,allowOverlap:P=!1,compactType:C="vertical",maxRows:I=3e5,Container:A=c.A,onDragEnd:k,onDragCancel:S,containerId:D,itemProps:T,rearrangeable:M=!0}=e,F=(0,o.A)(e,g);const N=(0,i.useRef)(),[E,L]=(0,i.useState)((()=>(0,d.oE)((0,d.Su)(n),C,O)));(0,l.A)((()=>{L((0,d.oE)((0,d.Su)(n),C,O))}),[O,t]);const[B,R]=(0,i.useState)(null),[V,H]=(0,i.useState)(null),_=(0,i.useRef)(null),{active:K}=(0,a.fF)();(0,a.E5)((0,i.useMemo)((()=>({onDragStart:e=>{let{active:t}=e;const{itemContainerId:r}=t.data.current||{};r===D&&(R((0,d.Su)(E)),H(E))},onDragMove:e=>{let{active:t,over:r}=e;H((e=>{const{isResizer:n,isContainer:o,itemId:i,itemContainerId:s}=t.data.current||{};if(o||s!==D)return e;const{initial:a,translated:l}=t.rect.current;let c=e;const p=(0,d.GN)(c,i);if(!p)return e;const h=null===r||void 0===r?void 0:r.id;if(n){if(!h)return e;if(!l||!a)return e;const t=r.rect.width+(0,u.sd)(l.right-a.right),n=r.rect.height+(0,u.sd)(l.bottom-a.bottom);let{width:o,height:i}=(0,u.tr)({gutter:w,maxRows:I,gridTracks:O,rowHeight:v,containerWidth:y},t,n,p);return p.width===o&&p.height===i?e:(p.width=o,p.height=i,c=c.map((e=>e.id===p.id?b(b({},p),{},{width:o,height:i}):e)),c=(0,d.oE)(c,C,O),_.current=p,c)}if(!M)return e;const g=N.current.getBoundingClientRect();let{left:f,top:m}=(0,u.zA)({gutter:w,maxRows:I,gridTracks:O,rowHeight:v,containerWidth:y},l.top-g.top,l.left-g.left,p);return p.top===m&&p.left===f?e:(c=(0,d.Pe)(c,p,f,m,!0,!1,C,O,P),c=(0,d.oE)(c,C,O),_.current=p,c)}))},onDragEnd:e=>{let{active:t,over:r}=e;const{isResizer:n,isContainer:o,itemContainerId:i}=t.data.current;if(o||i!==D)return void H(null);const s=null===r||void 0===r?void 0:r.id;if(n)return V&&L(V),H(null),void k(V,_.current);null!==s?(V&&L(V),H(null),k(V,_.current)):H(null)},onDragCancel:()=>{B&&L(B),_.current=null,R(null),H(null),S&&S()}})),[E,V]));const z=(0,d.Hp)(V||E),G=z*v+(z-1)*w+"px";return(0,h.jsxs)(A,b(b({ref:N,style:{width:y,height:G}},F),{},{children:[(V||E).map(((e,t)=>(0,h.jsx)(p.A,b(b({},e),{},{index:t,containerId:D,Item:j,onRemove:f,draggable:!0,containerWidth:y,rowHeight:v,gridTracks:O,gutter:w,transformed:null!==V?V[t]:null,draggableProps:e,itemProps:T,rootId:r}),e.id))),(0,s.createPortal)((0,h.jsx)(a.Hd,{adjustScale:!1,dropAnimation:m,zIndex:9999,children:K&&K.data.current.rootId===r&&K.data.current.isItem?(e=>{const t=V||E;if(!t)return null;const n=t.find((t=>t.id===e.itemId));return n?(0,h.jsx)(p.A,b(b({rootId:r},n),{},{containerId:e.itemContainerId,Item:j,onRemove:f,draggable:!0,containerWidth:y,rowHeight:v,gridTracks:O,gutter:w,dragOverlay:!0,itemProps:T})):null})(K.data.current):null}),document.body)]}))}},5020(e,t,r){r.d(t,{Oq:()=>a,Q:()=>l,bP:()=>c,ml:()=>s});var n=r(64467);r(33110),r(27495),r(25440),r(98992),r(54520),r(3949);function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const s=(e,t)=>e.on("sizeChanged",((e,r,n)=>{if(e.getParent()!==t)return;const o=e.getAttribute("id"),i=t.getAttribute("host"),s="chart_height.".concat(i,"/").concat(o);localStorage.setItem(s,r);const a="chart_width.".concat(i,"/").concat(o);localStorage.setItem(a,n)})),a=(e,t,r)=>{const n=e.getAttribute("host"),o="chart_height.".concat(n,"/").concat(t),i=localStorage.getItem(o);return i?/px/.test(i)?parseInt(i.replace("px",""),10):parseInt(i,10):r},l=e=>{null!==e&&void 0!==e&&e.id&&localStorage.setItem("chart_layout/".concat(e.id),JSON.stringify(e))},c=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=localStorage.getItem("chart_layout/".concat(e));try{let e=JSON.parse(n);return e?(e=(e=>{let{i:t,id:r=t,x:n,left:o=n,y:i,top:s=i,w:a,width:l=a,h:c,height:d=c,expanded:u=!1}=e;return{id:r,width:l,height:d,left:o,top:s,expanded:u}})(e),i(i(i({},r),t),e)):i(i({},r),t)}catch(o){return i(i({},r),t)}}},91100(e,t,r){r.d(t,{A:()=>f});r(98992),r(54520),r(3949);var n=r(64467),o=r(80045),i=r(68978),s=r(9962),a=r(19075),l=r(2626),c=r(74848);const d=["critical","warning","error","testPrefix"],u=["id","testPrefix"];function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function h(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const g=e=>{let{critical:t,warning:r,error:n,testPrefix:a}=e,l=(0,o.A)(e,d);const u=(0,s.I)({error:n,testPrefix:a,flavour:t?"error":"disabledError",value:t}),p=(0,s.I)({error:n,testPrefix:a,flavour:r?"warning":"disabledWarning",value:r});return(0,c.jsx)(i.Flex,h(h({},l),{},{children:(0,c.jsx)(i.MasterCard,{"data-testid":"alertsMastercard",pillLeft:u,pillRight:p,size:"small"})}))},f=e=>{let{id:t,testPrefix:r}=e,n=(0,o.A)(e,u);const i=(0,l.Xt)(t),{critical:s,warning:d}=(0,a.AO)(i);return(0,c.jsx)(g,h({"data-testid":"alerts",testPrefix:r,critical:s,warning:d},n))}},93335(e,t,r){r.d(t,{N:()=>d,W:()=>u});var n=r(19075),o=r(2626),i=r(87083),s=r(41716),a=r(91100),l=r(74848);const c=e=>{let{critical:t,warning:r,error:n}=e;return(0,l.jsx)(a.A,{critical:t,"data-testid":"tabAlerts",error:n,testPrefix:"tabAlerts-alert",warning:r,margin:[0,0,0,1]})},d=e=>{let{nodeId:t}=e;const r=(0,o.Xt)(t),{critical:i,warning:s}=(0,n.AO)(r);return(0,l.jsx)(c,{critical:i,warning:s})},u=()=>{const e=(0,i.w7)({emptyIfAll:!1}),t=(0,o.YS)(e),r=(0,s.s)("error"),{critical:a,warning:d}=(0,n.AO)(t);return(0,l.jsx)(c,{critical:a,warning:d,error:r})}},77234(e,t,r){r.d(t,{x:()=>n});const n={home:"home",overview:"overview",nodes:"nodes",k8s:"k8s",top:"top",logs:"logs",dashboards:"dashboards",dashboard:"dashboard",alerts:"alerts",ar:"ar",events:"events",insights:"insights"}},47413(e,t,r){r.d(t,{A:()=>b});var n=r(64467),o=(r(98992),r(54520),r(3949),r(81454),r(96540)),i=r(35570),s=r(1817),a=r(44245),l=r(93335),c=r(68978),d=r(19075),u=r(74848);const p={warning:"warning",critical:"error"},h=e=>{let{alertId:t}=e;const r=(0,d.JL)(t,"status");return p[r]?(0,u.jsx)(c.Flex,{alignSelf:"center",margin:[0,0,0,2],round:1,background:p[r],width:2,height:2}):null};function g(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?g(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const b=e=>{const t=(0,i.Zp)(),r=(0,i.RQ)("/spaces/:spaceSlug/rooms/:roomSlug/:type/*"),n=(0,a._F)(),c=(0,a.xK)(),d=(0,a.NU)(),p=r?r.pathnameBase:"/spaces",{pathname:g}=(0,i.zy)(),b=(0,s.A)(e[g]&&g,!0),m=(0,o.useCallback)(((e,r)=>{if(!r)return c(e);const o=n[e-1],i=n[e+1],s=(r,n)=>{const o="".concat(r).concat(n?"/".concat(n):"");t(o),c(e)};return b?s(b):o?s(o.path,o.params):i?s(i.path,i.params):s(p)}),[n,c,p,b]);return[(0,o.useMemo)((()=>n.map((e=>f(f({},e),{},{children:e.id&&"nodes"===e.type?(0,u.jsx)(l.N,{nodeId:e.id}):"alerts"===e.type?(0,u.jsx)(h,{alertId:e.id}):null})))),[n]),(e,t)=>{-1===e&&-1===t||d({sourceIndex:e,destinationIndex:t})},m]}},17178(e,t,r){r.d(t,{A:()=>j});r(98992),r(54520),r(3949);var n=r(64467),o=r(96540),i=r(35570),s=r(19186),a=r(24609),l=r(93335),c=r(41716),d=r(93883),u=r(93912),p=r(74848);const h=()=>{const e=(0,c.s)("error"),t=(0,c.s)("updatedAt");return(0,p.jsx)(u.A,{title:"Alerts & Notifications",description:"View raised and configured alerts across your infrastructure.",children:(0,p.jsx)(d.A,{error:e,updatedAt:t})})};var g=r(99728),f=r(39175),b=r(77234);function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function x(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const j=()=>{const e=(0,s.r9)(),t=(0,i.RQ)("/spaces/:spaceSlug/rooms/:roomSlug/insights/report-preview/:reportId"),r=(0,g.JT)("dashboard:ReadAll"),n=(e=>{let{path:t,matchReportPreview:r}=e;return(0,o.useMemo)((()=>x(x({[b.x.home]:{id:"home",title:"Home",icon:"room_home",path:"".concat(t,"/home"),exact:!0,dataGa:"view-picker::click-view-home::global-view",testId:"viewPicker-home",tooltip:{title:"Summary",description:"An overview of your infrastructure."}},[b.x.overview]:{id:"overview",title:"Metrics",icon:"room_overview",path:"".concat(t,"/overview"),exact:!0,dataGa:"view-picker::click-view-overview::global-view",testId:"viewPicker-overview",tooltip:{title:"Metrics Explorer",description:"All metrics from all nodes, containers, VMs, SNMP devices, applications, and synthetic checks, in one universal, aggregated, infrastructure-level dashboard."}},[b.x.nodes]:{id:"nodes",title:"Nodes",icon:"nodes_hollow",path:"".concat(t,"/nodes"),exact:!0,dataGa:"view-picker::click-view-nodes::global-view",testId:"viewPicker-nodes",tooltip:{title:"Nodes Explorer",description:"All your infrastructure nodes."}}},!window.envSettings.isAgent&&!window.envSettings.onprem&&{[b.x.k8s]:{id:"k8s",title:"K8s",icon:"serviceKubernetes",path:"".concat(t,"/kubernetes"),exact:!0,dataGa:"view-picker::click-view-kubernetes::global-view",testId:"viewPicker-kubernetes",tooltip:{title:"Kubernetes Explorer",description:"All Kubernetes clusters, pods, containers and workloads."}}}),{},{[b.x.top]:{id:"top",title:"Top",icon:"top",path:"".concat(t,"/top"),exact:!0,dataGa:"view-picker::click-view-fn::global-overview",testId:"viewPicker-fn",tooltip:{title:"Top Consumers",description:"Explore top consumers, including processes, containers, services, network connections, and more."}},[b.x.logs]:{id:"logs",title:"Logs",icon:"logs",path:"".concat(t,"/logs"),exact:!0,dataGa:"view-picker::click-view-logs::global-overview",testId:"viewPicker-logs",tooltip:{title:"Logs Explorer",description:"Search, filter, and analyze system and application logs."}},[b.x.dashboards]:{id:"dashboards",title:"Dashboards",icon:"dashboard",path:"".concat(t,"/dashboards"),exact:!0,dataGa:"view-picker::click-view-dashboard::global-view",testId:"viewPicker-customDashboards",tooltip:{title:"Custom Dashboards",description:"Create, and manage personalized dashboards tailored to your needs."},droppable:!0,droppableProps:{dropArea:!0,dropinDashboards:!0}},[b.x.dashboard]:{id:"dashboard",title:"Dashboard",icon:"dashboard",path:"".concat(t,"/dashboard"),exact:!0,dataGa:"view-picker::click-view-dashboard::global-view",testId:"viewPicker-customDashboard",tooltip:{title:"Custom Dashboard",description:"Edit a personalized dashboard tailored to your needs."},droppable:!0,droppableProps:{dropArea:!0,dashboardId:f.LA}},[b.x.alerts]:{id:"alerts",title:"Alerts",icon:"alarm",path:"".concat(t,"/alerts"),exact:!0,dataGa:"view-picker::click-view-alerts::global-view",testId:"viewPicker-alerts",tooltip:(0,p.jsx)(h,{}),children:(0,p.jsx)(l.W,{})},[b.x.ar]:{id:"ar",title:"Anomalies",icon:"anomaliesLens",path:"".concat(t,"/anomalies"),exact:!0,dataGa:"view-picker::click-view-anomalies::global-view",testId:"viewPicker-anomalies",tooltip:{title:"Anomaly Advisor",description:"Machine-learning powered root cause analysis, blast radius detection, and cascading effect tracing across nodes."}},[b.x.events]:{id:"events",title:"Events",icon:"feed",path:"".concat(t,"/events"),exact:!0,dataGa:"view-picker::click-view-feed::global-view",testId:"viewPicker-feed",tooltip:{title:"Activity Feed",description:"Alert transitions and notifications, node connections and disconnections, administrative events."}},[b.x.insights]:{id:"insights",title:"AI Insights",icon:"ai",path:"".concat(t,"/insights"),exact:!r,dataGa:"view-picker::click-view-insights::global-view",testId:"viewPicker-insights",tooltip:{title:"AI Insights and Reports",description:"Automatically investigate, troubleshoot and generate deep dive infrastructure analysis reports using Netdata AI."},iconColor:"primaryAI"}})),[t,r])})({path:e,matchReportPreview:t}),c=(0,a.dg)(),d=(0,s.GJ)();var u,m;return[(0,o.useMemo)((()=>[!c&&!d&&n.home,n.nodes,n.overview,n.top,n.logs,!c&&!window.envSettings.onprem&&n.k8s,!c&&r&&n.dashboards,c&&r&&n.dashboard,n.alerts,n.events,n.ar,n.insights].filter(Boolean)),[e,t,c]),(u=e,m=!c,(0,o.useMemo)((()=>({["".concat(u,"/overview")]:!0,["".concat(u,"/home")]:!0,["".concat(u,"/nodes")]:!0,["".concat(u,"/dashboards")]:!0,["".concat(u,"/dashboard")]:!0,["".concat(u,"/alerts")]:!0,["".concat(u,"/anomalies")]:!0,["".concat(u,"/top")]:!0,["".concat(u,"/logs")]:!0,["".concat(u,"/events")]:!0,["".concat(u,"/insights")]:!0})),[u,m]))]}},9962(e,t,r){r.d(t,{I:()=>s});r(98992),r(54520),r(3949);var n=r(64467);function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const s=e=>{let{error:t,testPrefix:r,onClick:n,flavour:o,value:s}=e;return i(i({"data-testid":r?"".concat(r,"-").concat(o):o,flavour:o},n&&{onClick:n}),{},{text:t?"-":"".concat(s)})}},82507(e,t,r){r.d(t,{A:()=>s});var n=r(51510),o=r(74848);const i=n.default.div.withConfig({displayName:"circuitLines__CircuitLinesContainer",componentId:"sc-18gzenn-0"})(["position:absolute;inset:0;z-index:1;opacity:0.8;& > svg{position:absolute;margin:auto;left:50%;transform:translateX(-50%);top:0;bottom:0;}"]),s=e=>{let{withOuties:t=!0}=e;return(0,o.jsx)(i,{children:(0,o.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"187",height:"202",viewBox:"0 0 187 202",fill:"none",children:[(0,o.jsxs)("defs",{children:[(0,o.jsxs)("linearGradient",{id:"flowGradient",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[(0,o.jsx)("stop",{offset:"0%",stopColor:"#005622",stopOpacity:"0.3",children:t&&(0,o.jsx)("animate",{attributeName:"stop-opacity",values:"0.3;0.8;0.3",dur:"3s",repeatCount:"indefinite"})}),(0,o.jsx)("stop",{offset:"50%",stopColor:"#00cd51",stopOpacity:t?"0.6":"0.3",children:t&&(0,o.jsx)("animate",{attributeName:"stop-opacity",values:"0.6;1;0.6",dur:"2.5s",repeatCount:"indefinite"})}),(0,o.jsx)("stop",{offset:"100%",stopColor:"#005622",stopOpacity:"0.3",children:t&&(0,o.jsx)("animate",{attributeName:"stop-opacity",values:"0.3;0.8;0.3",dur:"3.2s",repeatCount:"indefinite"})})]}),(0,o.jsxs)("filter",{id:"pulse",children:[(0,o.jsx)("feGaussianBlur",{stdDeviation:"1",result:"coloredBlur"}),(0,o.jsxs)("feMerge",{children:[(0,o.jsx)("feMergeNode",{in:"coloredBlur"}),(0,o.jsx)("feMergeNode",{in:"SourceGraphic"})]})]})]}),(0,o.jsx)("g",{filter:"url(#filter0_f_847_10449)",children:(0,o.jsx)("path",{d:"M57 22.0207L91.5 2.10214M100.5 3.90192L137.043 25M148.5 30L175.347 45.5M91.5 10L67.6235 23.7851C66.5333 24.4145 66.2887 25.8826 67.116 26.8315L72.5 33.007M13.5 55.5L51 33.007L55.5147 30.7444C56.3757 30.3129 57.422 30.5563 58.0042 31.3237L68 44.5M9 48L48 26M4 55.5V87C4 88.1046 4.89543 89 6 89H23.5M13 64.5V82.5M23.5 61.5L52.4294 43.0042C53.3141 42.4385 54.4856 42.6534 55.112 43.4962L64.9195 56.693C65.2968 57.2007 65.8921 57.5 66.5247 57.5H92M51 55.5L24.471 71.4174C23.8686 71.7788 23.5 72.4299 23.5 73.1324V77.5C23.5 78.6046 24.3954 79.5 25.5 79.5H33C34.1046 79.5 35 80.3954 35 81.5V87C35 88.1046 35.8954 89 37 89H63.4914C64.6067 89 65.5066 89.9124 65.4912 91.0277L65 126.5M4 97.5H55C56.1046 97.5 57 98.3954 57 99.5V110.5M46 109H23.5M4 108H11.5C12.6046 108 13.5 108.895 13.5 110V120.5C13.5 121.605 12.6046 122.5 11.5 122.5H6C4.89543 122.5 4 123.395 4 124.5V142M100.5 13.5L114.488 21.4458C115.113 21.8012 115.5 22.4652 115.5 23.1848V37V50.5C115.5 51.6046 114.605 52.5 113.5 52.5H82.5M79 26L93.4828 18.9922C94.1141 18.6867 94.8591 18.7342 95.4465 19.1173L105.093 25.4082C105.659 25.7774 106 26.4075 106 27.0834V42M79 42H96C97.1046 42 98 41.1046 98 40V30M23.5 115.5H45C45.5523 115.5 46 115.948 46 116.5V116.5C46 117.052 46.4477 117.5 47 117.5H55C56.1046 117.5 57 118.395 57 119.5V124.5M19.5 122.5H40.5M9 126.5V135C9 136.105 9.89543 137 11 137H34M19.5 130.5H48M57 130.5V140C57 141.105 56.1046 142 55 142H40.5M4 152.5H11.5C12.6046 152.5 13.5 151.605 13.5 150.5V147C13.5 145.895 14.3954 145 15.5 145H29.5M23.5 152.5V157.5C23.5 158.605 22.6046 159.5 21.5 159.5H15C13.8954 159.5 13 160.395 13 161.5V161.905C13 162.587 13.3475 163.222 13.9219 163.59L38 179M29.5 152.5H63C64.1046 152.5 65 151.605 65 150.5V137M40.5 72L54 64.5M44.5 82V78.7227C44.5 77.9721 44.9202 77.2848 45.5882 76.9426L62.0882 68.4914C63.4191 67.8097 65 68.7762 65 70.2715V79.5M73 66.5H96C97.1046 66.5 98 65.6046 98 64.5V61.5M106 61.5H123C124.105 61.5 125 60.6046 125 59.5V37M125 26L146.5 40M134 42V55.5C134 56.6046 134.895 57.5 136 57.5H148.5M142 48H156M157 57.5H174.498C175.04 57.5 175.56 57.7205 175.937 58.111L184.439 66.9188C184.799 67.2916 185 67.7896 185 68.3078V89M76 77.5V87C76 88.1046 76.8954 89 78 89H89.5C90.6046 89 91.5 88.1046 91.5 87V79.5C91.5 78.3954 92.3954 77.5 93.5 77.5H106M106 70H119H128C129.105 70 130 69.1046 130 68V66.5C130 65.3954 130.895 64.5 132 64.5H148.5M113.5 77.5H130M135 87.5V70M175.347 81L162 90.5M142 70H153M72.5 95.5H82C83.1046 95.5 84 96.3954 84 97.5V103C84 104.105 83.1046 105 82 105H74.5816C73.4457 105 72.5378 105.945 72.5832 107.08L73 117.5M77.5 110.5H94.5M89.5 95.5H98C99.1046 95.5 100 96.3954 100 97.5V108M98 84.5H122.5M106.5 91.5H119M142 79.5H156M162 64.5H169.597C170.171 64.5 170.718 64.7469 171.097 65.1777L174.847 69.4332C175.169 69.7985 175.347 70.2686 175.347 70.7555V74.2906C175.347 75.0342 174.934 75.7164 174.276 76.0617L162 82.5M162 73.5L170.5 72M106.5 97.5H125.5C126.605 97.5 127.5 96.6046 127.5 95.5V89M142 87.5H152.5C153.605 87.5 154.5 88.3954 154.5 89.5V92.4296C154.5 93.0983 154.834 93.7228 155.391 94.0937L160.5 97.5M167.5 95.5L177.5 89M185 97.5V115.5M73 126.5H80.5C81.6046 126.5 82.5 125.605 82.5 124.5V119.5C82.5 118.395 83.3954 117.5 84.5 117.5H103M109.5 108H122.5M135 95.5V106C135 107.105 135.895 108 137 108H148.576C150.297 108 151.214 105.971 150.077 104.679L148.424 102.8C146.988 101.168 148.82 98.7394 150.784 99.6722L162 105M170.5 105V120.5C170.5 121.605 171.395 122.5 172.5 122.5H179.298C179.753 122.5 180.193 122.655 180.548 122.938L185 126.5M113.5 115.5H137.043M148.5 115.5H158.5C159.605 115.5 160.5 116.395 160.5 117.5V131C160.5 132.105 161.395 133 162.5 133H170.5M72.5 137H83.2539C83.7351 137 84.2002 136.827 84.5638 136.511L90.9362 130.989C91.2998 130.673 91.7649 130.5 92.2461 130.5H104C105.105 130.5 106 129.605 106 128.5V122.5M113.5 122.5H128C129.105 122.5 130 123.395 130 124.5V128.5C130 129.605 130.895 130.5 132 130.5H146.5M182.5 137V143C182.5 144.105 181.605 145 180.5 145H157M153 137H125M113.5 130.5V143C113.5 144.105 114.395 145 115.5 145H135M76 145H91.4689C91.8169 145 92.159 144.909 92.4611 144.736L106 137M34 159.5V165.012C34 165.635 34.2903 166.222 34.7851 166.6L51 179M46 159.5H73M51 166L64.6912 175.901C65.2113 176.277 65.5192 176.88 65.5192 177.522V184C65.5192 185.105 64.6238 186 63.5192 186H48M73 170V196M79 155H97.3333C97.7661 155 98.1871 154.86 98.5333 154.6L108 147.5M115.5 152.5H142M153 152.5L166.369 158.954C167.061 159.288 167.5 159.988 167.5 160.755V164.945C167.5 165.605 167.174 166.223 166.629 166.596L148.5 179M84 166H105.715C106.219 166 106.706 165.809 107.076 165.466L112.924 160.034C113.294 159.691 113.781 159.5 114.285 159.5H130M142 163V171.796C142 172.537 141.591 173.217 140.936 173.563L125 182M84 176.5H105.484C105.823 176.5 106.155 176.414 106.452 176.25L125 166M84 186H92.5C93.6046 186 94.5 186.895 94.5 188V199.5M103 186V195.795C103 197.386 104.767 198.34 106.097 197.467L119 189M112 182L135 168.721M151 159.5L157.498 162.533C158.122 162.823 158.552 163.414 158.637 164.097L158.833 165.667C158.934 166.473 158.537 167.26 157.829 167.658L151 171.5M169.5 151H183C184.105 151 185 151.895 185 153V153.982C185 154.621 184.694 155.223 184.176 155.599L174 163",stroke:"url(#flowGradient)",strokeLinecap:"round",children:(0,o.jsx)("animate",{attributeName:"stroke-opacity",values:"0.8;1;0.8",dur:"4s",repeatCount:"indefinite"})})}),(0,o.jsx)("defs",{children:(0,o.jsxs)("filter",{id:"filter0_f_847_10449",x:"3",y:"1.10205",width:"183",height:"199.398",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[(0,o.jsx)("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),(0,o.jsx)("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),(0,o.jsx)("feGaussianBlur",{stdDeviation:"0.25",result:"effect1_foregroundBlur_847_10449"})]})}),(0,o.jsxs)("g",{className:"nodes",children:[(0,o.jsxs)("circle",{cx:"8",cy:"48.5",r:"2",fill:"#005622",filter:"url(#pulse)",children:[(0,o.jsx)("animate",{attributeName:"r",values:"2;3;2",dur:"3s",repeatCount:"indefinite"}),(0,o.jsx)("animate",{attributeName:"fill-opacity",values:"0.8;1;0.8",dur:"3s",repeatCount:"indefinite"})]}),(0,o.jsxs)("circle",{cx:"92",cy:"2.5",r:"2",fill:"#005622",filter:"url(#pulse)",children:[(0,o.jsx)("animate",{attributeName:"r",values:"2;3;2",dur:"2.5s",repeatCount:"indefinite"}),(0,o.jsx)("animate",{attributeName:"fill-opacity",values:"0.8;1;0.8",dur:"2.5s",repeatCount:"indefinite"})]}),(0,o.jsxs)("circle",{cx:"185",cy:"90.5",r:"2",fill:"#005622",filter:"url(#pulse)",children:[(0,o.jsx)("animate",{attributeName:"r",values:"2;3;2",dur:"3.5s",repeatCount:"indefinite"}),(0,o.jsx)("animate",{attributeName:"fill-opacity",values:"0.8;1;0.8",dur:"3.5s",repeatCount:"indefinite"})]}),(0,o.jsxs)("circle",{cx:"73",cy:"196.5",r:"2",fill:"#005622",filter:"url(#pulse)",children:[(0,o.jsx)("animate",{attributeName:"r",values:"2;3;2",dur:"2.8s",repeatCount:"indefinite"}),(0,o.jsx)("animate",{attributeName:"fill-opacity",values:"0.8;1;0.8",dur:"2.8s",repeatCount:"indefinite"})]}),(0,o.jsx)("circle",{cx:"13",cy:"55.5",r:"2",fill:"#005622",children:(0,o.jsx)("animate",{attributeName:"fill-opacity",values:"0.6;0.9;0.6",dur:"4s",repeatCount:"indefinite",begin:"0.5s"})}),(0,o.jsx)("circle",{cx:"4",cy:"55.5",r:"2",fill:"#005622",children:(0,o.jsx)("animate",{attributeName:"fill-opacity",values:"0.6;0.9;0.6",dur:"3.8s",repeatCount:"indefinite",begin:"1s"})}),(0,o.jsx)("circle",{cx:"13",cy:"62.5",r:"2",fill:"#005622",children:(0,o.jsx)("animate",{attributeName:"fill-opacity",values:"0.6;0.9;0.6",dur:"4.2s",repeatCount:"indefinite",begin:"1.5s"})}),(0,o.jsx)("circle",{cx:"23",cy:"62.5",r:"2",fill:"#005622",children:(0,o.jsx)("animate",{attributeName:"fill-opacity",values:"0.6;0.9;0.6",dur:"3.6s",repeatCount:"indefinite",begin:"2s"})}),(0,o.jsx)("circle",{cx:"92",cy:"57.5",r:"2",fill:"#005622",children:(0,o.jsx)("animate",{attributeName:"fill-opacity",values:"0.7;1;0.7",dur:"3.2s",repeatCount:"indefinite",begin:"0.8s"})}),(0,o.jsx)("circle",{cx:"106",cy:"77.5",r:"2",fill:"#005622",children:(0,o.jsx)("animate",{attributeName:"r",values:"2;2.5;2",dur:"3.8s",repeatCount:"indefinite",begin:"1.2s"})}),(0,o.jsx)("circle",{cx:"162",cy:"90.5",r:"2",fill:"#005622",children:(0,o.jsx)("animate",{attributeName:"fill-opacity",values:"0.6;0.95;0.6",dur:"4.5s",repeatCount:"indefinite",begin:"1.8s"})}),(0,o.jsx)("circle",{cx:"125",cy:"36.5",r:"2",fill:"#005622",children:(0,o.jsx)("animate",{attributeName:"fill-opacity",values:"0.7;1;0.7",dur:"3.4s",repeatCount:"indefinite",begin:"2.2s"})}),(0,o.jsx)("circle",{cx:"98",cy:"60.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"72",cy:"66.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"76",cy:"76.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"73",cy:"95.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"73",cy:"116.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"79",cy:"110.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"95",cy:"110.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"91",cy:"95.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"100",cy:"107.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"99",cy:"84.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"124",cy:"84.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"118",cy:"91.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"108",cy:"91.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"108",cy:"97.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"128",cy:"90.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"113",cy:"77.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"130",cy:"77.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"106",cy:"69.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"106",cy:"61.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"134",cy:"40.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"149",cy:"57.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"156",cy:"57.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"156",cy:"47.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"141",cy:"47.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"147",cy:"40.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"125",cy:"26.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"135",cy:"69.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"141",cy:"69.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"154",cy:"69.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"150",cy:"64.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"176",cy:"80.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"135",cy:"87.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"82",cy:"52.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"80",cy:"41.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"98",cy:"28.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"106",cy:"42.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"79",cy:"26.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"99",cy:"12.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"99",cy:"3.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"138",cy:"25.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"148",cy:"29.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"177",cy:"46.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"53",cy:"54.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"53",cy:"64.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"40",cy:"72.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"44",cy:"82.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"65",cy:"81.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"65",cy:"127.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"13",cy:"82.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"23",cy:"88.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"3",cy:"97.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"57",cy:"110.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"47",cy:"108.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"57",cy:"124.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"57",cy:"130.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"47",cy:"130.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"17",cy:"130.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"9",cy:"127.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"34",cy:"136.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"41",cy:"141.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"31",cy:"144.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"2",cy:"152.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"23",cy:"152.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"39",cy:"179.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"30",cy:"152.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"34",cy:"159.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"51",cy:"179.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"48",cy:"185.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"50",cy:"165.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"47",cy:"159.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"74",cy:"159.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"73",cy:"169.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"83",cy:"185.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"94",cy:"199.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"103",cy:"186.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"120",cy:"187.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"125",cy:"181.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"142",cy:"162.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"152",cy:"152.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"148",cy:"178.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"157",cy:"144.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"170",cy:"150.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"173",cy:"163.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"183",cy:"137.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"185",cy:"126.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"170",cy:"104.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"160",cy:"104.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"135",cy:"94.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"124",cy:"107.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"109",cy:"107.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"104",cy:"117.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"74",cy:"126.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"74",cy:"136.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"106",cy:"123.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"106",cy:"136.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"76",cy:"144.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"79",cy:"154.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"109",cy:"146.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"114",cy:"130.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"114",cy:"122.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"137",cy:"115.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"146",cy:"130.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"147",cy:"115.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"170",cy:"132.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"153",cy:"136.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"124",cy:"136.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"134",cy:"144.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"144",cy:"152.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"150",cy:"159.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"150",cy:"171.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"114",cy:"152.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"129",cy:"159.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"83",cy:"165.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"83",cy:"176.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"113",cy:"181.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"135",cy:"168.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"124",cy:"166.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"114",cy:"115.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"65",cy:"137.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"18",cy:"122.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"41",cy:"122.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"23",cy:"108.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"23",cy:"115.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"3",cy:"107.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"4",cy:"141.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"48",cy:"25.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"56",cy:"22.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"68",cy:"44.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"73",cy:"33.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"92",cy:"9.5",r:"2",fill:"#005622"})]})]})})}},42964(e,t,r){r.d(t,{A:()=>o});var n=r(74848);const o=e=>{let{isOnboarding:t,withOuties:r=!0}=e;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("svg",{width:t?"120":"320",height:t?"120":"320",viewBox:"0 0 320 320",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{position:"absolute"},children:[(0,n.jsx)("g",{id:"node_inset_shadow",filter:"url(#inset_shadow)",children:(0,n.jsx)("path",{d:"M152.015 44.7406C156.958 41.8937 163.042 41.8937 167.985 44.7406L255.908 95.3794C260.867 98.2354 263.923 103.522 263.923 109.244V210.455C263.923 216.177 260.867 221.464 255.908 224.319L167.985 274.958C163.042 277.805 156.958 277.805 152.015 274.958L64.0916 224.319C59.1329 221.464 56.077 216.177 56.077 210.455V109.244C56.077 103.522 59.1329 98.2354 64.0916 95.3795L152.015 44.7406Z",fill:"rgba(0,0,0,.3)"})}),(0,n.jsx)("path",{id:"outtie_1",d:"M152.264 24.9838C157.053 22.2259 162.947 22.2259 167.736 24.9838L272.979 85.5983C277.783 88.365 280.744 93.4864 280.744 99.0299V220.192C280.744 225.735 277.783 230.856 272.979 233.623L167.736 294.238C162.947 296.996 157.053 296.996 152.264 294.238L47.0206 233.623C42.2169 230.856 39.2564 225.735 39.2564 220.192V99.0299C39.2564 93.4864 42.2169 88.365 47.0206 85.5983L152.264 24.9838Z",stroke:"#003314"}),r&&(0,n.jsx)("path",{id:"outtie_2",d:"M152.264 5.03243C157.053 2.2745 162.947 2.2745 167.736 5.03242L290.3 75.6226C295.104 78.3893 298.064 83.5108 298.064 89.0542V230.167C298.064 235.711 295.104 240.832 290.3 243.599L167.736 314.189C162.947 316.947 157.053 316.947 152.264 314.189L29.7001 243.599C24.8964 240.832 21.9359 235.711 21.9359 230.167V89.0542C21.9359 83.5107 24.8964 78.3893 29.7001 75.6226L152.264 5.03243Z",stroke:"#003314"}),(0,n.jsx)("defs",{children:(0,n.jsxs)("filter",{id:"inset_shadow",x:"56.0769",y:"42.6054",width:"207.846",height:"234.488",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[(0,n.jsx)("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),(0,n.jsx)("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),(0,n.jsx)("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),(0,n.jsx)("feOffset",{}),(0,n.jsx)("feGaussianBlur",{stdDeviation:"15"}),(0,n.jsx)("feComposite",{in2:"hardAlpha",operator:"arithmetic",k2:"-1",k3:"1"}),(0,n.jsx)("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0.2 0 0 0 0 0.0784314 0 0 0 1 0"}),(0,n.jsx)("feBlend",{mode:"normal",in2:"shape",result:"effect1_innerShadow_759_2378"})]})})]}),(0,n.jsxs)("svg",{width:t?"120":"320",height:t?"120":"320",viewBox:"0 0 320 320",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{position:"absolute"},children:[(0,n.jsx)("path",{id:"outtie_1_highlight",d:"M152.264 24.9838C157.053 22.2259 162.947 22.2259 167.736 24.9838L272.979 85.5983C277.783 88.365 280.744 93.4864 280.744 99.0299V220.192C280.744 225.735 277.783 230.856 272.979 233.623L167.736 294.238C162.947 296.996 157.053 296.996 152.264 294.238L47.0206 233.623C42.2169 230.856 39.2564 225.735 39.2564 220.192V99.0299C39.2564 93.4864 42.2169 88.365 47.0206 85.5983L152.264 24.9838Z",stroke:"#34ff84"}),r&&(0,n.jsx)("path",{id:"outtie_2_highlight",d:"M152.264 5.03243C157.053 2.2745 162.947 2.2745 167.736 5.03242L290.3 75.6226C295.104 78.3893 298.064 83.5108 298.064 89.0542V230.167C298.064 235.711 295.104 240.832 290.3 243.599L167.736 314.189C162.947 316.947 157.053 316.947 152.264 314.189L29.7001 243.599C24.8964 240.832 21.9359 235.711 21.9359 230.167V89.0542C21.9359 83.5107 24.8964 78.3893 29.7001 75.6226L152.264 5.03243Z",stroke:"#bbffd6"})]})]})}},24416(e,t,r){r.r(t),r.d(t,{SettingsContainer:()=>Vg,default:()=>_g});r(62953),r(3296),r(27208),r(48408);var n=r(96540),o=r(39175),i=r(7960),s=r(19707),a=r(72060),l=r(55164),c=r(63474),d=r(62718),u=r(37617),p=r(1174),h=r(92318),g=r(99728),f=r(99094),b=r(64467),m=(r(98992),r(54520),r(72577),r(3949),r(81454),r(8872),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),r(30569)),x=r(35570),j=r(91539),y=r(24609),v=r(19186),O=r(18739),w=r(58247),P=r(16922),C=r(81685),I=r(22068),A=r(55048),k=r(63872),S=r(44245),D=r(77234),T=r(95428);const M=()=>document.querySelectorAll("[data-testid='".concat(T.Q,"']")).length;var F=r(4204);function N(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function E(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?N(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):N(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const L=()=>{const e=(0,y.vt)(),t=(0,v.ID)(),{refresh:r}=(0,O.JN)(),o=(0,g.JT)("insights:ReadReport"),[i,s]=(0,I.A)(),[a,l]=(0,A.A)(),[c,d]=(0,k.A)(),{pathname:u}=(0,x.zy)(),p=u.includes(D.x.insights)&&!u.includes(f.p9),[,,,h]=(0,C.W5)(),[,b]=(0,S.m0)({tabId:D.x.insights}),[T]=(0,C.ly)(),[N]=(0,C.uN)(),L=(0,m.yF)((0,n.useCallback)(((n,o,u)=>{let{data:g}=u;const m=(null===g||void 0===g?void 0:g.reports)||[],x=i(),j=a(),y=m.filter((e=>{let{status:t,isScheduled:r}=e;return!r&&!f.bs.includes(t)})).map((e=>{let{id:t}=e;return t})),v=x.filter((e=>y.includes(e))),O=v.filter((e=>!j.includes(e))),{COMPLETED:w,FAILED:C}=function(){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce(((t,r)=>{const n=e.find((e=>e.id===r));return n?E(E({},t),{},{[n.status]:[...t[n.status]||[],n.id]}):t}),{COMPLETED:[],FAILED:[]})}(O,m);if(O.length&&(w.length&&c({header:"New report",text:"A new report has been generated!"}),C.length&&(s(x.filter((e=>!C.includes(e)))),d({header:"Error",text:"Failed to generate report."})),l(Array.from(new Set([...j,...O.filter((e=>!C.includes(e)))]))),(w.length||C.length)&&(h(),r()),!p&&w.length+C.length>0)){const e=w.length>0?"success":"error";b({color:e})}o((0,P.Tj)({spaceId:e,roomId:t}),(e=>E(E({},e),{},{loaded:!0,reports:m.map((e=>E(E({},e),{},{isUnread:v.includes(e.id)})))})))}),[e,t,i,s,a,l,h,r,c,d,p,b])),B=(0,m.yF)((0,n.useCallback)(((r,n,o)=>{n((0,P.Tj)({spaceId:e,roomId:t}),(e=>{var t;return E(E({},e),{},{loaded:!0,error:(null===o||void 0===o||null===(t=o.response)||void 0===t?void 0:t.data)||"Something went wrong"})}))}),[e,t]));return(0,j.A)((()=>({enabled:N&&!F.ei&&o&&!!e&&!!t,force:!0,polling:N&&!!T.length,fetch:()=>(e=>{let{spaceId:t,roomId:r}=e;const n=(0,w.eF)({spaceId:t,roomId:r}),o=(0,w.XN)({spaceId:t,roomId:r});return Promise.all([n,o]).then((e=>{var t;let[r,n]=e;const o=[...(null===r||void 0===r||null===(t=r.data)||void 0===t?void 0:t.reports)||[],...((null===n||void 0===n?void 0:n.data)||[]).map((e=>E(E({},e),{},{isScheduled:!0})))];return Promise.resolve({data:{reports:o}})}))})({spaceId:e,roomId:t}),onFail:B,onReceive:L,pollingOptions:{pollingInterval:p?5e3:15e3,checkPauseCondition:M}})),[e,t,p,o,N,T.length])};var B=r(10602),R=r(37479),V=r(60908),H=r(85660),_=r(88255),K=r(50271),z=r(24013),G=r(87083),W=r(80045),q=(r(42762),r(49435)),U=r(42790),J=r(34843),Z=r(52035),X=r(18790);const $={filteredNodesIds:[],filteredNodesCount:0,nodesCount:0},Y=(0,X.I)((()=>(0,Z.eU)($))),Q=["name"],ee=()=>{const e=(0,v.ID)();return(0,J.md)(Y(e))},te=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"nodesView";const t=(0,v.ID)();return(0,U.rW)("tocSearch",{key:t,extraKey:e,defaultValue:"",flavour:"val"})},re=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;if(null===e)return 0;if("string"===typeof e){const r=t(e);return r>0?r:0}if(Array.isArray(e)){let r=0;for(const n of e){const e=re(n,t);e>r&&(r=e)}return r}if("object"===typeof e){let r=0;for(const n in e){const o=re(e[n],t);o>r&&(r=o)}return r}return 0},ne=["version","labels","hw","os","state","nodeStatus","health","replicationFactor","replication","technology"],oe=function(e,t){let{shouldHide:r=()=>!1,cacheKey:o,extraKey:i="nodesView"}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const s=(0,z.Gt)(e),a=function(){const e=te(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"nodesView");return"string"!==typeof e?"":e.trim().toLowerCase()}(i),[l,c,d]=(0,n.useMemo)((()=>{let e=0,t=0;const n=s.filter((e=>!r(e)));t=n.length;const o=n.map((t=>{let r=0,n=0,o=0;if(a){const{name:e}=t,i=(0,W.A)(t,Q);n=t.name?(0,q.pe)(e,a):0,o=re(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ne.reduce(((t,r)=>(void 0!==e[r]&&null!==e[r]&&(t[r]=e[r]),t)),{})}(i),(e=>(0,q.pe)(String(e),a,{scoreFactor:.6,minScore:.6})));r=("Live"===t.nodeStatus?100:"Stale"===t.nodeStatus?50:0)+10*n+o}const i=!!a&&!(n>.3||o>.3);return i||(e+=1),{id:t.id,searchScore:r,included:!i}})).filter((e=>e.included));return[o,t,e]}),[a,s,o,r]),u=(()=>{const e=(0,v.ID)();return(0,J.Xr)(Y(e))})(),p=(0,n.useMemo)((()=>l.map((e=>{let{id:t}=e;return t}))),[l]),h=(0,n.useMemo)((()=>l.reduce(((e,t)=>{let{id:r,searchScore:n}=t;return n>0&&(e[r]=n),e}),{})),[l]);return(0,n.useEffect)((()=>{u({filteredNodeIds:p,filteredNodesCount:d,nodesCount:c})}),[p,c,d,t]),[p,h,c]};var ie=r(23565),se=r(87733),ae=r(39906),le=r(73385),ce=r(68978),de=r(41514),ue=r(68531),pe=r(74848);const he=e=>{let{extraKey:t}=e;const[r,o]=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"nodesView";const t=(0,v.ID)();return(0,U.N9)("tocSearch",{key:t,extraKey:e,defaultValue:"",flavour:"val"})}(t),[i,s]=(0,n.useState)(r||"");return(0,ue.A)((()=>{o(i),(0,de.H)("toc-search","search-automatic-trigger","nodes-view",i)}),300,[i]),(0,n.useEffect)((()=>{r!==i&&s(r)}),[r]),(0,pe.jsx)(ce.TextInput,{iconLeft:(0,pe.jsx)(ce.Icon,{name:"search",color:i?"textFocus":"textLite",width:"14px",height:"14px"}),iconRight:!!i&&(0,pe.jsx)(ce.IconButton,{icon:"x",iconColor:i?"textFocus":"textLite",width:"14px",height:"14px",onClick:()=>{s(""),(0,de.H)("toc-search","clear-search-button","nodes-view")},padding:[0],neutral:!0,"data-testid":"filterNodesInput-clearButton"}),value:i,onChange:e=>s(e.target.value),size:"small",placeholder:"Search nodes",name:"Search nodes","data-testid":"filterNodesInput",containerStyles:{width:"100%"}})};var ge=r(73700);const fe=(0,ge.s)(300,((e,t)=>(0,de.H)("toc-search","search-results","nodes-view",e,"".concat(t," -- nodes")))),be=()=>{const e=te(),{filteredNodesCount:t,nodesCount:r}=ee();return(0,n.useEffect)((()=>{e&&fe(e,t)}),[e,t]),(0,pe.jsx)(pe.Fragment,{children:(0,pe.jsxs)(ce.TextMicro,{alignSelf:"end",color:"textLite",margin:[1,0,0],"data-testid":"numberOfNodesIndication",children:["Showing"," ",(0,pe.jsx)(ce.TextMicro,{strong:!0,color:"textDescription","data-testid":"numberOfNodesIndication-filteredNodesCount",children:t})," ","of total"," ",(0,pe.jsx)(ce.TextMicro,{strong:!0,color:"textDescription","data-testid":"numberOfNodesIndication-nodesCount",children:r})," ","nodes"]})})},me=()=>{const{filteredNodesCount:e}=ee();return e?null:(0,pe.jsxs)(ce.Flex,{width:"100%",gap:1,margin:[4,0,0],padding:[2],alignItems:"center","data-testid":"noResultsWereFound",children:[(0,pe.jsx)(ce.Icon,{name:"information",color:"textDescription"}),(0,pe.jsx)(ce.TextMicro,{strong:!0,color:"textDescription",children:"No results were found"})]})},xe=e=>{let{extraKey:t}=e;return(0,pe.jsxs)(ce.Flex,{column:!0,alignItems:"center",children:[(0,pe.jsx)(he,{extraKey:t}),(0,pe.jsx)(be,{}),(0,pe.jsx)(me,{})]})};var je=r(79748);const ye=()=>(0,pe.jsxs)(ce.Flex,{padding:[6],round:1,width:"600px",background:"modalInfoBackground",children:[(0,pe.jsx)(ce.Box,{margin:[0,4,0,0],children:(0,pe.jsx)(ce.Box,{as:ce.Icon,width:10,height:10,name:"nodes_update"})}),(0,pe.jsxs)(ce.Flex,{column:!0,gap:2,children:[(0,pe.jsx)(ce.Text,{strong:!0,children:"Couldn't find the node you were looking for? "}),(0,pe.jsxs)(ce.Text,{color:"textDescription",children:["Netdata can be used to monitor all kinds of infrastructure, from tiny stand-alone IoT devices to complex hybrid setups combining on-premise and cloud infrastructure, mixing bare-metal servers, virtual machines and containers. Check our"," ",(0,pe.jsx)(je.A,{href:"https://learn.netdata.cloud/docs/deployment-guides",target:"_blank","data-ga":"node-area::click-link-collectors::nodes-view",children:"deployments guides"})," ","and start monitor your infrastructure."]})]})]}),ve=e=>{let{children:t}=e;return(0,pe.jsxs)(ce.Flex,{column:!0,justifyContent:"center",alignItems:"center",alignSelf:"center",gap:4,children:[(0,pe.jsxs)(ce.Flex,{column:!0,justifyContent:"center",alignItems:"center",width:"300px",margin:[0,0,6],children:[(0,pe.jsx)(ce.H3,{margin:[0,0,4],children:"No nodes to display"}),(0,pe.jsx)(ce.Text,{color:"textDescription",textAlign:"center",children:"Double-check your search or filters and dates and try again with different conditions."})]}),t,(0,pe.jsx)(ye,{})]})};var Oe=r(50694),we=r(41061),Pe=r(6304),Ce=r(63589),Ie=r(89590),Ae=r(51571),ke=r(32788),Se=r(29263),De=r(47410),Te=r(32052),Me=r(22871),Fe=r(25291),Ne=r(24582);const Ee=["title","help","link","disclaimer","children"];function Le(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Be(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Le(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Le(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Re=e=>{let{link:t,children:r}=e;return(0,pe.jsxs)(ce.Flex,{as:"a",target:"_blank",href:t,gap:1,alignItems:"end",children:[(0,pe.jsx)(ce.TextNano,{textDecoration:"undeline",children:r}),(0,pe.jsx)(ce.Icon,{color:"text",name:"question",width:"16px",height:"16px"})]})},Ve=e=>{let{title:t,help:r,link:n,disclaimer:o,children:i}=e,s=(0,W.A)(e,Ee);return(0,pe.jsxs)(ce.Flex,Be(Be({gap:1,column:!0},s),{},{children:[(0,pe.jsxs)(ce.Flex,{justifyContent:"between",alignItems:"baseline",children:[(0,pe.jsx)(ce.Text,{as:"label",margin:[0],children:t}),r&&(0,pe.jsx)(Re,{link:n,children:r})]}),i,o&&(0,pe.jsx)(ce.TextSmall,{children:o})]}))};var He=r(91130),_e=r(16866);const Ke=e=>{let{dimensions:t}=e;return{dimensions:t.map((e=>{let{name:t}=e;return{value:t,label:t}}))}};r(26910);const ze=[{value:"version",label:"Netdata Version"},{value:"nodeStatus",label:"Node Status"},{value:"os.nm",label:"OS Name"},{value:"os.v",label:"OS Version"},{value:"os.kernel.nm",label:"Kernel"},{value:"os.kernel.v",label:"Kernel Version"},{value:"hw.architecture",label:"Architecture"},{value:"hw.cpuFrequency",label:"CPU Frequency"},{value:"hw.cpus",label:"CPU Cores"},{value:"hw.memory",label:"Memory"},{value:"hw.diskSpace",label:"Disk Space"}],Ge=()=>{const e=(0,z.Gt)();return(0,n.useMemo)((()=>{const t=new Set;e.forEach((e=>{e.labels&&Object.keys(e.labels).forEach((e=>t.add(e)))}));const r=Array.from(t).sort().map((e=>({value:"labels.".concat(e),label:e})));return[...ze,...r]}),[e])},We=["spaceId","roomId","id","onClose","tabId"];function qe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ue(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qe(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Je=e=>{let{isNew:t}=e;return(0,pe.jsxs)(ce.Flex,{as:"span",gap:1,children:["Manage room",(0,pe.jsx)(ce.TextBig,{color:"textLite",children:"/"}),(0,pe.jsxs)(ce.TextBig,{color:"textLite",children:[t?"Add":"Edit"," Metric"]})]})},Ze=[{value:"value",label:"Value"},{value:"progressBar",label:"Progress Bar"}],Xe=[{value:"sum",label:"Sum"},{value:"avg",label:"Average"},{value:"min",label:"Minimum"},{value:"max",label:"Maximum"}],$e=[{value:"left",label:"Left"},{value:"center",label:"Center"},{value:"right",label:"Right"}],Ye=[{value:"Metrics",label:"Metrics"},{value:"Labels",label:"Labels"}],Qe=e=>{let{spaceId:t,roomId:r,id:o,onClose:i,tabId:s}=e,a=(0,W.A)(e,We);const l="new"===o,c=(0,Me.uB)(r,o),d=(0,Me.e6)(r,o),[u,p]=(0,n.useState)(d),{title:h,context:g,dimensions:f=[],totalDimensions:b=[],calculateTotal:m=!1,columnFlavour:x="value",aggregation:j="sum",fractionDigits:y=1,hideUnits:v=!1,align:O="center",category:w="Metrics",accessorKey:P="",fallbackKeys:C=[]}=u;(0,n.useEffect)((()=>{l&&c()}),[]);const I=(0,G.w7)({extraKey:"nodesView",merge:!1,scoped:!0}),A=(0,Fe.A)(r,I,{spaceId:t});if(A)throw A;const k=(0,Ne.OL)(r),S=(0,n.useMemo)((()=>k.map((e=>({value:e,label:e})))),[k]),D=(0,Ne._0)(r),T=Ge(),M="Labels"===w,F=(0,n.useMemo)((()=>g&&{value:g,label:g}),[g]),[{dimensions:N},E]=(0,Te.A)((()=>({enabled:!!g,fetch:()=>((e,t,r)=>He.A.get("".concat(_e.P8,"/spaces/").concat(e,"/rooms/").concat(t,"/contexts/").concat(encodeURIComponent(r)),{transform:Ke}))(t,r,g),initialValue:{dimensions:[]}})),[t,r,g]),L=(0,n.useCallback)((e=>{let{value:t}=e;p((e=>Ue(Ue({},e),{},{context:t,dimensions:[],title:t})))}),[]),B=(0,n.useMemo)((()=>N?0===f.length?[]:f.map((e=>({value:e,label:e}))):[]),[f,N]),R=(0,n.useMemo)((()=>N?0===b.length?[]:b.map((e=>({value:e,label:e}))):[]),[b,N]),V=(0,n.useMemo)((()=>Xe.find((e=>e.value===(j||"sum")))),[j]),H=(0,n.useMemo)((()=>{var e;return{value:O,label:null===(e=$e.find((e=>e.value===O)))||void 0===e?void 0:e.label}}),[O]),_=(0,n.useMemo)((()=>C.map((e=>T.find((t=>t.value===e))||{value:e,label:e}))),[C,T]),K=(0,n.useMemo)((()=>P?T.find((e=>e.value===P))||{value:P,label:P}:null),[P,T]),z=(0,n.useMemo)((()=>T.filter((e=>e.value!==P))),[T,P]),q=(0,n.useCallback)((e=>{E||p((t=>Ue(Ue({},t),{},{dimensions:e.map((e=>{let{label:t}=e;return t}))})))}),[E]),U=(0,Me.tQ)(r),J=(0,n.useCallback)((()=>U(Ue(Ue({},u),{},{id:o,type:s})).then(i)),[u,o,s,i,U]),Z=(0,n.useCallback)((e=>{let{target:{value:t}}=e;t.length<=30&&p((e=>Ue(Ue({},e),{},{title:t,header:t,headerString:t})))}),[]),X=(0,n.useCallback)((e=>{E||p((t=>Ue(Ue({},t),{},{totalDimensions:e.map((e=>{let{label:t}=e;return t}))})))}),[E]),$=(0,n.useCallback)((e=>{let{value:t}=e;p((e=>Ue(Ue({},e),{},{columnFlavour:t,calculateTotal:"value"!==t&&e.calculateTotal})))}),[]),Y=(0,n.useCallback)((e=>{let{value:t}=e;p((e=>Ue(Ue({},e),{},{aggregation:t})))}),[]),Q=(0,n.useCallback)((e=>{let{value:t}=e;p((e=>Ue(Ue({},e),{},{align:t})))}),[]),ee=(0,n.useCallback)((e=>{let{target:{value:t}}=e;const r=parseInt(t,10);!isNaN(r)&&r>=0&&r<=3&&p((e=>Ue(Ue({},e),{},{fractionDigits:r})))}),[]),te=(0,n.useCallback)((e=>{let{target:{checked:t}}=e;p((e=>Ue(Ue({},e),{},{hideUnits:t})))}),[]),re=(0,n.useCallback)((e=>{let{target:{checked:t}}=e;p((e=>Ue(Ue({},e),{},{calculateTotal:t,totalDimensions:t?e.totalDimensions:[]})))}),[]),ne=(0,n.useCallback)((e=>{let{value:t}=e;p((e=>Ue(Ue({},e),{},{category:t,columnFlavour:"Labels"===t?"metadata":"metadata"===e.columnFlavour?"value":e.columnFlavour,align:"Labels"===t?"left":e.align,accessorKey:"Labels"===t?e.accessorKey:"",fallbackKeys:"Labels"===t?e.fallbackKeys:[],context:"Metrics"===t?e.context:"",dimensions:"Metrics"===t?e.dimensions:[]})))}),[]),oe=(0,n.useCallback)((e=>{let{value:t,label:r}=e;p((e=>Ue(Ue({},e),{},{accessorKey:t,title:e.title||r,header:e.title||r,headerString:e.title||r})))}),[]),ie=(0,n.useCallback)((e=>{p((t=>Ue(Ue({},t),{},{fallbackKeys:e.map((e=>{let{value:t}=e;return t}))})))}),[]),se=!h||(M?!P:!g);return(0,pe.jsxs)(ke.GO,Ue(Ue({onClose:i},a),{},{children:[(0,pe.jsx)(Se.z,{onClose:i,title:(0,pe.jsx)(Je,{isNew:l}),children:(0,pe.jsx)(ce.Button,{label:"Save",onClick:J,disabled:se})}),(0,pe.jsx)(De.U,{children:l?"Add a new column":"Edit ".concat(M?"attribute":"metric")}),(0,pe.jsx)(ke.Yv,{children:(0,pe.jsxs)(ce.Flex,{gap:6,column:!0,children:[(0,pe.jsx)(Ve,{title:"Column Type","data-testid":"manageMetrics-category",children:(0,pe.jsx)(ce.Select,{options:Ye,value:Ye.find((e=>e.value===w)),onChange:ne,"data-testid":"manageMetrics-categorySelect"})}),M?(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(Ve,{title:"Attribute","data-testid":"manageMetrics-accessorKey",children:(0,pe.jsx)(ce.Select,{options:T,value:K,onChange:oe,"data-testid":"manageMetrics-accessorKeySelect"})}),(0,pe.jsx)(Ve,{title:"Column Title","data-testid":"manageMetrics-title",children:(0,pe.jsx)(ce.TextInput,{name:"title",placeholder:"Type name",value:h,onChange:Z})}),(0,pe.jsx)(Ve,{title:"Fallback Keys",disclaimer:"Alternative attribute paths to check if the primary attribute is empty.","data-testid":"manageMetrics-fallbackKeys",children:(0,pe.jsx)(ce.Select,{isMulti:!0,options:z,value:_,onChange:ie,"data-testid":"manageMetrics-fallbackKeysSelect"})}),(0,pe.jsx)(Ve,{title:"Text Alignment","data-testid":"manageMetrics-align",children:(0,pe.jsx)(ce.Select,{options:$e,value:H,onChange:Q,"data-testid":"manageMetrics-alignSelect"})})]}):(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(Ve,{title:"Context",help:"What is a context?",link:"https://learn.netdata.cloud/docs/dashboards-and-charts/netdata-charts#contexts","data-testid":"manageMetrics-context",children:(0,pe.jsx)(ce.Select,{options:S,value:F,onChange:L,isLoading:!D,"data-testid":"manageMetrics-contextSelect"})}),(0,pe.jsx)(Ve,{title:"Metric Title","data-testid":"manageMetrics-title",children:(0,pe.jsx)(ce.TextInput,{name:"title",placeholder:"Type name",value:h,onChange:Z})}),(0,pe.jsx)(Ve,{title:"Dimensions",help:"What is a dimension?",link:"https://learn.netdata.cloud/docs/dashboards-and-charts/netdata-charts#dimensions",disclaimer:"Dimensions to use for value calculation. Leave blank to use all available dimensions.","data-testid":"manageMetrics-dimensions",children:(0,pe.jsx)(ce.Select,{isMulti:!0,options:N,value:B,onChange:q,isLoading:E,isDisabled:!F,"data-testid":"manageMetrics-dimensionSelect"})}),(0,pe.jsx)(Ve,{title:"Display Type","data-testid":"manageMetrics-columnFlavour",children:(0,pe.jsx)(ce.Select,{options:Ze,value:{value:x,label:"value"===x?"Value":"Progress Bar"},onChange:$,"data-testid":"manageMetrics-columnFlavourSelect"})}),(0,pe.jsx)(ce.Toggle,{labelRight:"Calculate as percentage of total",checked:m,onChange:re,"data-testid":"manageMetrics-calculateTotalToggle",colored:!0}),m&&(0,pe.jsx)(Ve,{title:"Total Dimensions",disclaimer:"Dimensions to use for total calculation. Leave blank to use all available dimensions.","data-testid":"manageMetrics-totalDimensions",children:(0,pe.jsx)(ce.Select,{isMulti:!0,options:N,value:R,onChange:X,isLoading:E,isDisabled:!F,"data-testid":"manageMetrics-totalDimensionSelect"})}),(0,pe.jsx)(Ve,{title:"Aggregation","data-testid":"manageMetrics-aggregation",children:(0,pe.jsx)(ce.Select,{options:Xe,value:V,onChange:Y,"data-testid":"manageMetrics-aggregationSelect"})}),(0,pe.jsx)(Ve,{title:"Decimal Places","data-testid":"manageMetrics-fractionDigits",children:(0,pe.jsx)(ce.TextInput,{type:"number",name:"fractionDigits",min:"0",max:"3",value:y,onChange:ee})}),(0,pe.jsx)(Ve,{title:"Hide Units","data-testid":"manageMetrics-hideUnits",children:(0,pe.jsx)(ce.Toggle,{checked:v,onChange:te,"data-testid":"manageMetrics-hideUnitsToggle"})}),(0,pe.jsx)(Ve,{title:"Text Alignment","data-testid":"manageMetrics-align",children:(0,pe.jsx)(ce.Select,{options:$e,value:H,onChange:Q,"data-testid":"manageMetrics-alignSelect"})})]})]})})]}))};var et=r(49163),tt=r(45087),rt=r(43375),nt=r(43627),ot=r(74979);const it=e=>{let{onConfirm:t,children:r}=e;const[o,i]=(0,n.useState)(!1),s=(0,n.useCallback)((()=>{i(!1),t()}),[t]),a=(0,n.useCallback)((()=>{i(!1)}),[]);return o?(0,pe.jsxs)(ce.Flex,{alignItems:"center",gap:1,children:[(0,pe.jsx)(ce.Text,{color:"textLite",whiteSpace:"nowrap",children:"Delete?"}),(0,pe.jsx)(ce.IconButton,{icon:"checkmark_s",flavour:"borderless",padding:[0],onClick:s,width:"12px",height:"12px",title:"Confirm delete"}),(0,pe.jsx)(ce.IconButton,{icon:"x",flavour:"borderless",padding:[0],onClick:a,width:"12px",height:"12px",title:"Cancel"})]}):r((()=>i(!0)))};function st(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function at(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?st(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):st(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const lt=e=>{let{metric:t,onToggle:r,onEdit:n,onDelete:o,disabled:i}=e;const{attributes:s,listeners:a,setNodeRef:l,transform:c,transition:d}=(0,nt.gl)({id:t.id}),u={transform:ot.Ks.Transform.toString(c),transition:d};return(0,pe.jsx)("div",at(at({ref:l,style:u},s),{},{children:(0,pe.jsxs)(ce.Flex,{"data-testid":"metricsMenu-metric-".concat(t.title),justifyContent:"between",alignItems:"center",padding:[1,0],children:[(0,pe.jsxs)(ce.Flex,{alignItems:"center",gap:1,children:[!i&&(0,pe.jsx)(ce.Icon,at({name:"nav_dots",color:"textLite",cursor:"grab",size:"small"},a)),(0,pe.jsx)(ce.Checkbox,{checked:!t.hidden,"data-testid":"metricsMenu-metricCheckbox",label:t.title,onChange:r})]}),(0,pe.jsxs)(ce.Flex,{alignItems:"center",gap:1,children:[(0,pe.jsx)(ce.IconButton,{"data-testid":"metricsMenu-editMetric",flavour:"borderless",icon:"pencilSolid",padding:[0],onClick:n,width:"10px",height:"10px"}),(0,pe.jsx)(it,{onConfirm:o,children:e=>(0,pe.jsx)(ce.IconButton,{"data-testid":"metricsMenu-deleteMetric",flavour:"borderless",icon:"trashcan",padding:[0],onClick:e,width:"10px",height:"10px"})})]})]})}))};function ct(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function dt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ct(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ct(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const ut=e=>{let{isOpen:t,onClose:r,onEdit:o,roomId:i,targetRef:s,tabId:a,metricsType:l}=e;const[c,d]=(0,Me.tY)(i),u=l||a,p=(0,n.useMemo)((()=>{const e=c.filter((e=>e.type===a));return e.length>0?e:c.filter((e=>e.type===u))}),[a,u,c]),[h,g]=(0,n.useState)(p.map((e=>e.id)));(0,n.useEffect)((()=>{g(p.map((e=>e.id)))}),[p]);const f=(0,rt.FR)((0,rt.MS)(rt.AN),(0,rt.MS)(rt.uN,{coordinateGetter:nt.JR})),b=(0,Me._E)(i,a),m=(0,Me.gV)(i),x=(0,n.useCallback)((e=>{const{active:t,over:r}=e;if(null!==t&&void 0!==t&&t.id&&null!==r&&void 0!==r&&r.id&&t.id!==r.id){const e=h.indexOf(t.id),n=h.indexOf(r.id),o=(0,nt.be)(h,e,n);g(o),b(o)}}),[h,b]),j=(0,et._)({roomId:i,params:{type:"roomMetrics",entity:"metrics",path:"/nodes"}})[0],y=(0,Me.Ul)(i,a,l);if(!s.current||!t)return null;const v=e=>{o(e),r()};return(0,pe.jsxs)(ce.Drop,{align:{top:"bottom",right:"right"},animation:!0,background:"dropdown",column:!0,margin:[.5,0,0],overflow:{vertical:"auto"},padding:[3],round:!0,width:70,close:r,"data-testid":"metricsMenu",onClickOutside:r,onEsc:r,target:s.current,gap:1,children:[(0,pe.jsx)(ce.Button,{"data-testid":"metricsMenu-addMetricButton",label:"Add new metric",icon:"plus",onClick:()=>v("new"),small:!0,alignSelf:"end"}),(0,pe.jsx)(rt.Mp,{sensors:f,collisionDetection:rt.fp,onDragEnd:x,children:(0,pe.jsx)(nt.gB,{items:h,strategy:nt._G,children:(0,pe.jsx)(ce.Flex,{column:!0,children:h.map((e=>{const t=p.find((t=>t.id===e));return t?(0,pe.jsx)(lt,{metric:t,onToggle:()=>d(t.id,(e=>dt(dt({},e),{},{hidden:!e.hidden,type:a}))),onEdit:()=>v(t.id),onDelete:()=>{return e=t.id,void m(e);var e},disabled:!1},t.id):null}))})})}),j&&(0,pe.jsx)(tt.A,{content:"All metrics will be reset to defaults",children:(0,pe.jsx)(ce.Button,{padding:[0],"data-testid":"metricsMenu-resetButton",label:"Reset to default metrics",flavour:"borderless",onClick:y,small:!0,danger:!0,alignSelf:"end"})})]})},pt=e=>{let{spaceId:t,roomId:r,tabId:o,metricsType:i}=e;const[s,,a,l]=(0,Pe.A)(),[c,d]=(0,n.useState)(null),u=(0,n.useRef)();return(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(Ae.A,{permission:"space:UpdateSettings",ifForbidden:"hide","data-ga":"metric-setting::click-metric-setting::hm-nodes","data-testid":"metricSettings-button",flavour:"hollow",icon:"gear",neutral:!0,onClick:a,ref:u,label:"Metrics",small:!0}),(0,pe.jsx)(ut,{isOpen:s,onClose:l,onEdit:d,roomId:r,tabId:o,metricsType:i,targetRef:u}),c&&(0,pe.jsx)(Qe,{"data-testid":"metricsManagement",spaceId:t,roomId:r,tabId:o,metricsType:i,id:c,onClose:()=>d(null)})]})};var ht=r(94404);const gt=()=>(0,de.H)("grouping","click-grouping","hm-nodes"),ft=(0,ht.A)(Ce.A),bt=[{icon:"node",label:"Node status",value:"nodeStatus","data-ga":"grouping::click-grouping-node-status::hm-nodes"},{icon:"alarm_bell",label:"Alert status",value:"alertStatus","data-ga":"grouping::click-grouping-status::hm-nodes"}],mt=()=>{const e=(0,y.vt)(),t=(0,v.ID)(),[r,,o,i]=(0,Pe.A)(),[s,a]=(0,K.TS)(t,"groupMode"),l=(0,n.useMemo)((()=>bt.find((e=>e.value===s))||bt[0]),[s]),c=(0,n.useCallback)((e=>{let{value:t}=e;return a(t)}),[a]);return(0,pe.jsxs)(ce.Flex,{alignItems:"center","data-testid":"agentsHead-actions",flexWrap:!1,gap:3,children:[(0,pe.jsx)(ce.Select,{label:"Group by",onChange:c,onMenuOpen:gt,options:bt,value:l}),(0,pe.jsx)(pt,{roomId:t,spaceId:e}),r&&(0,pe.jsx)(Ie.A,{onClose:i}),(0,pe.jsx)(ft,{"data-ga":"add-nodes::click-add-nodes::hm-nodes","data-testid":"agentsHead-addNode",icon:"nodes_hollow",label:"Add Nodes",onClick:o,small:!0})]})},xt=()=>(0,pe.jsx)(ce.Flex,{width:"100%",justifyContent:"end",background:"mainBackground",padding:[2],children:(0,pe.jsx)(mt,{})});var jt=r(85163),yt=r(84535),vt=r(78152);function Ot(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function wt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ot(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ot(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Pt=function(e,t){let{getGrouping:r,extraKey:n,searchScores:o,groupMode:i}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s={},a={};((e,t)=>{let{getNode:r,getGrouping:n,nodeMenus:o,menusById:i,searchScores:s}=t;e.forEach((e=>{const t=r(e);if(!t)return;const{name:i,priority:s,icon:a}=n(t);o[e]=wt(wt({},t),{},{groupId:i,subMenuId:e,priority:s,groupIcon:a})})),[...e].sort(((e,t)=>{var r,n,i,a,l,c;const d=(null===s||void 0===s?void 0:s[e])||0,u=(null===s||void 0===s?void 0:s[t])||0;if(u!==d)return u-d;const p=((null===(r=o[e])||void 0===r?void 0:r.priority)||0)-((null===(n=o[t])||void 0===n?void 0:n.priority)||0);if(0!==p)return p;const h=((null===(i=o[e])||void 0===i?void 0:i.groupId)||"").localeCompare((null===(a=o[t])||void 0===a?void 0:a.groupId)||"",void 0,{sensitivity:"accent",ignorePunctuation:!0});return 0!==h?h:((null===(l=o[e])||void 0===l?void 0:l.name)||"").localeCompare((null===(c=o[t])||void 0===c?void 0:c.name)||"",void 0,{sensitivity:"accent",ignorePunctuation:!0})})).forEach((e=>{const t=o[e];if(!t)return;const r="".concat(t.groupId,"|").concat(t.subMenuId);i[t.groupId]||(i[t.groupId]={byId:{},nodeIds:[]}),i[t.groupId].byId[r]||(i[t.groupId].byId[r]={byId:{},nodeIds:[]}),i[t.groupId].byId[r].nodeIds.push(t.id),i[t.groupId].nodeIds.push(t.id)}))})(e,{getNode:t,getGrouping:r,nodeMenus:s,menusById:a,searchScores:o});const l=Object.keys(a).reduce(((e,t)=>{const{nodeIds:r}=a[t],o=s[r[0]];return e[t]={level:0,name:o.groupId,id:t,childrenIds:r,link:"".concat((0,jt.A)("menu_".concat(t))),size:24,forceVisibility:!0,icon:o.groupIcon,extraKey:n,styleProps:{important:!1,grouping:!0}},r.forEach((r=>{var o,i,a,l;const c=s[r],d=yt.u[(null===(o=c.os)||void 0===o?void 0:o.nm)||(null===(i=c.labels)||void 0===i?void 0:i.os_name)]||yt.U[null===(a=c.os)||void 0===a?void 0:a.id]||yt.u[null===(l=c.labels)||void 0===l?void 0:l.vendor];e[r]=wt(wt({},c),{},{level:1,id:r,menuId:t,link:"".concat((0,jt.A)("menu_".concat(t,"_submenu_").concat(r))),size:24,forceVisibility:!0,icon:(null===d||void 0===d?void 0:d.iconName)||(null===d||void 0===d?void 0:d.logoFilename)&&"".concat(h.A.assetsBaseURL,"/img/logos/os/").concat(d.logoFilename)||"os",extraKey:n})})),e}),{}),c=Object.keys(a);let d=-1;const u=c.reduce(((e,t)=>{if(d+=1,!vt.f9){const r=wt(wt({},l[t]),{},{sticky:!0});return[...e,r,...l[t].childrenIds.reduce(((e,t)=>{d+=1;return[...e,l[t]]}),[])]}return i?[...e,wt(wt({},l[t]),{},{isGroup:!0,children:l[t].childrenIds.reduce(((e,t)=>{d+=1;return[...e,l[t]]}),[])})]:[...e,...l[t].childrenIds.reduce(((e,t)=>{d+=1;return[...e,l[t]]}),[])]}),[]);return s=null,a=null,{stickyIds:{},allElements:u,menuIds:c,menuById:l}},Ct="clear",It="warning",At="critical",kt="unreachable";var St=r(58243),Dt=r(49181);const Tt={alertStatus:{[At]:1,[It]:2,[Ct]:3,[kt]:4},nodeStatus:{Live:1,Stale:2,Offline:3}},Mt={nodeStatus:e=>(0,Dt.GM)(e.state),alertStatus:e=>(0,Dt.vt)(e),vendor:e=>{var t;return(null===(t=e.labels)||void 0===t?void 0:t.vendor)||"Unknown"},type:e=>{var t;return(null===(t=e.labels)||void 0===t?void 0:t.type)||"Unknown"},location:e=>{var t,r;return(null===(t=e.labels)||void 0===t?void 0:t.sysLocation)||(null===(r=e.labels)||void 0===r?void 0:r.location)||"Unknown"},"":()=>"Nodes"},Ft=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const r=(0,v.ID)(),o=(0,K.Cq)(r,e),i=Mt[o];return(0,n.useCallback)((e=>{var r;if("customGroups"===o){const r=((e,t)=>{for(const r of t)if((0,St.BW)(e,r.filters,r.selectedNodeIds))return r.name;return"Other"})(e,t),n=t.findIndex((e=>e.name===r));return{name:r,priority:"Other"===r?999:n>=0?n:998,icon:null}}const n=null===i||void 0===i?void 0:i(e);return{name:n,priority:null===(r=Tt[o])||void 0===r?void 0:r[n],icon:"nodeStatus"===o?"connectivityStatus".concat(n):null}}),[o,i,t])};var Nt=r(56876),Et=r(30863),Lt=r(69001),Bt=r(95836),Rt=r(27496);const Vt=["id"];function Ht(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _t(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ht(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ht(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Kt=e=>{let{id:t}=e,r=(0,W.A)(e,Vt);return(0,pe.jsxs)(Lt.h,_t(_t({id:t},r),{},{children:[(0,pe.jsx)(Bt.$,{id:t}),(0,pe.jsx)(Rt.n,{id:t})]}))},zt=(0,n.memo)(Kt);var Gt=r(16373),Wt=r(90901),qt=r(82103),Ut=r(55759),Jt=r(77186),Zt=r(59400);const Xt=["connectivity","id","name"];function $t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Yt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?$t(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$t(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Qt=e=>{let{connectivity:t,id:r,name:n}=e,o=(0,W.A)(e,Xt);const i=(0,g.JT)("node:Delete"),s=!(0,v.XA)().untouchable,[a,,l,c]=(0,Pe.A)(),[d,,u,p]=(0,Pe.A)();return(0,pe.jsxs)(Zt.SS,Yt(Yt({alignSelf:"end",gap:1,"data-testid":"node-actions"},o),{},{children:[s&&(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(qt.A,{badge:"actionRemove","data-testid":"remove-node-action",children:(0,pe.jsx)(Zt.d0,{"data-ga":"nodes-table-row::click-remove-node::nodes-view",onClick:u})}),d&&(0,pe.jsx)(Jt.Ay,{ids:[r],name:n,onClose:p})]}),i&&"Offline"===t&&(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(qt.A,{badge:"actionObsolete","data-testid":"obsolete-node-action",children:(0,pe.jsx)(Zt.AS,{"data-ga":"nodes-table-row::click-obsolete-node::nodes-view",onClick:l})}),a&&(0,pe.jsx)(Ut.Ay,{ids:[r],name:n,onClose:c})]})]}))};var er=r(97336);const tr=["instanceType","name","providerType"];function rr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function nr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?rr(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const or=e=>{let{instanceType:t,name:r,providerType:n}=e,o=(0,W.A)(e,tr);return(0,pe.jsx)(qt.A,nr(nr({badge:"cloudInfo","data-testid":"node-cloud-info",nodeName:r},o),{},{children:(0,pe.jsxs)(ce.Flex,{alignItems:"center",gap:1,children:[(0,pe.jsx)(ce.Icon,{color:"textDescription","data-testid":"node-cloud-info-icon",name:"ipNetworking",width:"18px",height:"18px"}),(0,pe.jsxs)(ce.TextSmall,{color:"textDescription","data-testid":"node-cloud-info-text",children:[(0,Dt.ws)(n)," \u2022 ",(0,Dt.ws)(t)]})]})}))},ir=["connectivity","name"];function sr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ar(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?sr(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const lr=e=>{let{connectivity:t,name:r}=e,n=(0,W.A)(e,ir);return(0,pe.jsx)(qt.A,ar(ar({badge:"connectivity",connectivityState:t,"data-testid":"node-connectivity",nodeName:r},n),{},{children:(0,pe.jsx)(ce.Icon,{name:"connectivityStatus".concat(t),width:"18px",height:"18px"})}))},cr=["onClick"];function dr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ur(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?dr(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):dr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const pr=e=>{let{onClick:t}=e,r=(0,W.A)(e,cr);return(0,pe.jsx)(qt.A,ur(ur({badge:"info","data-testid":"node-info-cta"},r),{},{children:(0,pe.jsx)(ce.Icon,{color:"textDescription",cursor:"pointer",height:"18px",width:"18px",name:"information",onClick:t})}))},hr=["name"];function gr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function fr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?gr(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const br=e=>{let{name:t}=e,r=(0,W.A)(e,hr);return(0,pe.jsx)(qt.A,fr(fr({badge:"k8s","data-testid":"node-kubernetes",nodeName:t},r),{},{children:(0,pe.jsxs)(ce.Flex,{alignItems:"center",gap:1,children:[(0,pe.jsx)(ce.Icon,{color:"textDescription","data-testid":"node-kubernetes-icon",name:"serviceKubernetes",width:"18px",height:"18px"}),(0,pe.jsx)(ce.TextSmall,{color:"textDescription","data-testid":"node-kubernetes-text",children:"k8s"})]})}))},mr=["kernelName","kernelVersion","name"];function xr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function jr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?xr(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const yr=e=>{let{kernelName:t,kernelVersion:r,name:n}=e,o=(0,W.A)(e,mr);return(0,pe.jsx)(qt.A,jr(jr({badge:"kernel","data-testid":"node-kernel",nodeName:n},o),{},{children:(0,pe.jsx)(ce.TextSmall,{color:"textDescription",children:(0,Dt.Ud)(t,r)})}))};var vr=r(52253),Or=r(41708),wr=r(92834);const Pr=["architecture","cpuFrequency","cpus","diskSpace","memory","name","os","osName","timezone"];function Cr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ir(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Cr(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Cr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Ar=e=>{var t,r;let{architecture:n,cpuFrequency:o,cpus:i,diskSpace:s,memory:a,name:l,os:c,osName:d,timezone:u}=e,p=(0,W.A)(e,Pr);return(0,pe.jsx)(qt.A,Ir(Ir({badge:"systemInfo","data-testid":"node-system-info",nodeName:l},p),{},{children:(0,pe.jsxs)(ce.Flex,{alignItems:"center",gap:1,children:[(0,pe.jsx)(ce.Icon,{color:"textDescription","data-testid":"node-system-info-icon",name:(null===(t=yt.u[d])||void 0===t?void 0:t.iconName)||(null===(r=yt.U[c])||void 0===r?void 0:r.iconName)||"os",width:"16px",height:"16px"}),(0,pe.jsxs)(ce.TextSmall,{color:"textDescription","data-testid":"node-system-info-text",children:[(0,Dt.ws)(d)," \u2022 ",(0,Dt.O)(o)," \u2022"," ",(0,Dt.ws)(i,1===i?"Core":"Cores")," \u2022"," ",(0,Dt.ws)(n)," \u2022"," ",(0,Dt.ws)((0,Dt.RI)(a),"RAM")," \u2022"," ",(0,Dt.ws)((0,Dt.RI)(s),"HD"),!!u&&(0,pe.jsxs)(pe.Fragment,{children:[" ","\u2022 ",(0,pe.jsx)(wr.A,{timezone:u})]})]})]})}))},kr=["container","name","virtualization"];function Sr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Dr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Sr(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Sr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Tr=e=>{let{container:t,name:r,virtualization:n}=e,o=(0,W.A)(e,kr);const i=(0,Dt.Pg)(t,n);return(0,pe.jsx)(qt.A,Dr(Dr({badge:"type","data-testid":"node-type",nodeName:r,nodeType:i.label},o),{},{children:(0,pe.jsxs)(ce.Flex,{alignItems:"center",gap:1,children:[(0,pe.jsx)(ce.Icon,{color:"textDescription","data-testid":"node-type-icon",name:i.icon,height:i.iconSize,width:i.iconSize}),(0,pe.jsx)(ce.TextSmall,{color:"textDescription","data-testid":"node-type-text",children:i.label})]})}))};var Mr=r(71236);const Fr=e=>{let{health:t={}}=e;const{silencingState:r}=t.alerts||{},{state:n}=r||{};return"NONE"!=n?(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(Zt.K,{"data-testid":"nodeRow-separator"}),(0,pe.jsx)(ce.Flex,{children:(0,pe.jsx)(Mr.A,{flavour:"node",silencing:r})})]}):null};r(33110);var Nr=r(74891);const Er=(0,Nr.A)((0,ht.A)(ce.Button)),Lr=e=>{let{id:t}=e;const r=(0,x.Zp)(),o=(0,y.bq)(),i=(0,n.useCallback)((()=>{const e={nodeId:t};r("/spaces/".concat(o,"/settings/notifications#notificationsActiveTab=1&silencingRulePrefill=").concat(JSON.stringify(e)))}),[]);return(0,pe.jsx)(Er,{feature:"SilencingNode",payload:{nodeId:""},tooltip:"Create a new silencing rule for this node",flavour:"hollow",icon:"alarm_off",iconWidth:"12px",onClick:i})};var Br=r(36504),Rr=r(92942),Vr=r(19371),Hr=(r(27495),r(63928));function _r(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Kr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_r(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_r(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const zr=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"nodesView",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"servers";const r=(0,et._)({params:{type:["favourites"],path:["/".concat(e,"/").concat(t)]}}),o=(0,n.useMemo)((()=>r.filter((e=>{let{value:t}=e;return null===t||void 0===t?void 0:t.nodeId})).sort(((e,t)=>(e.value.sortOrder||0)-(t.value.sortOrder||0))).map((e=>{let{value:t}=e;return t.nodeId}))),[r]),i=(0,n.useMemo)((()=>r.reduce(((e,t)=>{var r;return Kr(Kr({},e),null!==(r=t.value)&&void 0!==r&&r.nodeId?{[t.value.nodeId]:t}:{})}),{})),[r]),s=(0,Hr.xS)(),a=(0,n.useCallback)((async e=>{const t=e.map(((e,t)=>{const r=i[e];if(r)return s(Kr(Kr({},r),{},{value:Kr(Kr({},r.value),{},{sortOrder:t})}))}));await Promise.all(t.filter(Boolean))}),[i,s]);return{favoriteNodeIds:o,settingsByNodeId:i,handleOrderChange:a}},Gr=(e,t)=>e&&e.getRoot().getChildren().find((e=>e.match({id:"nodes-".concat(t)}))),Wr=(e,t)=>"table-metrics-".concat(e,"-").concat(t),qr=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"sum";const o=Gr(e,t);if(!o)return null;const i=Wr(r,n);return o.getNode({id:i})};var Ur=r(28657);const Jr=e=>{let{id:t,roomId:r,nodeId:o,context:i,dimensions:s}=e;const a=(0,Vr.eg)(),l=(0,n.useMemo)((()=>{const e=Gr(a,r),n=[t,o,i].join("-");if(!e)return null;let l=e.getNode({id:n});return l?(l.updateAttribute("selectedDimensions",s),l):(l=a.makeChart({attributes:{id:n,nodesScope:[o],contextScope:[i],pixelsPerPoint:20,selectedDimensions:s}}),e.appendChild(l),l)}),[i,t,o,r,a]);return l?(0,pe.jsx)(Ur.A,{chart:l,hasHeader:!1,hasFooter:!1,hasFilters:!1,height:100}):null},Zr=(0,n.memo)(Jr);var Xr=r(74518);const $r=e=>{let{id:t,context:r,nodeId:n,isLive:o,hidden:i,title:s,dimensions:a}=e;const l=(0,v.ID)();return i||!o?null:(0,pe.jsxs)(ce.Flex,{column:!0,"data-testid":"metrics-chart-".concat(r),flex:"grow",basis:"174px",children:[(0,pe.jsx)(Xr.A,{text:s||r,TextComponent:ce.TextSmall,color:"textDescription",margin:[1,0,1,2],as:"div"}),(0,pe.jsx)(Zr,{id:t,context:r,nodeId:n,roomId:l,dimensions:a})]})};var Yr=r(91421),Qr=r(3319);const en=["node"];function tn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function rn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?tn(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const nn=e=>{var t;let{node:r}=e,o=(0,W.A)(e,en);const[,i]=(0,Yr.PJ)(),{sendButtonClickedLog:s}=(0,Qr.A)(),a=null===(t=r.capabilities)||void 0===t||null===(t=t.dyncfg)||void 0===t?void 0:t.enabled,l=r.isLive&&a,c=l?"Configure this node":r.isLive?"Node cannot be configured":"Cannot configure a non live node",d=(0,n.useCallback)((()=>{l&&(i(!0,{nodeId:r.id}),s({feature:"DyncfgNode",description:"Configure node",nodeId:null===r||void 0===r?void 0:r.id,nodeName:null===r||void 0===r?void 0:r.name}))}),[l,r,i,s]),u=(0,n.useMemo)((()=>({name:"gear",size:"small",color:l?"text":"disabled",cursor:l?"pointer":"auto",onClick:d})),[l,d]);return(0,pe.jsx)(qt.A,{content:c,children:(0,pe.jsx)(ce.Flex,rn(rn({},o),{},{children:(0,pe.jsx)(ce.Icon,rn({},u))}))})};var on=r(51262);function sn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function an(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?sn(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const ln=(cn=nn,e=>(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(Zt.K,{"data-testid":"nodeRow-separator"}),(0,pe.jsx)(cn,rn({},e))]}));var cn;const dn=e=>{var t,r;let{id:o,name:i,hw:s,os:a,ni:l,capabilities:c,container:d,updateSeverity:u,bugs:p,labels:h,isLive:g,state:f,version:b,extraKey:m,health:x,menuId:j,eligibility:O}=e;const w=(0,y.dg)(),P=(0,v.ID)(),C=null===(t=c.funcs)||void 0===t?void 0:t.enabled,I=null===(r=c.ml)||void 0===r?void 0:r.enabled,A=(0,Dt.GM)(f),{isNodeRestricted:k}=(0,on.A)(),{restricted:S}=k(o),{_cloud_instance_type:D,_cloud_provider_type:T,_timezone:M}=h||{},F="true"===(null===h||void 0===h?void 0:h._is_k8s_node),N=!(0,Dt.Po)(D)||!(0,Dt.Po)(T),E=(0,U.Fw)("sidebarTab",{flavour:"val",extraKey:m}),L=(0,U.Fw)("sidebarOpen",{flavour:"bool"}),B=(0,U.Fw)("sidebarNodeId",{flavour:"val",extraKey:m}),R=(0,n.useCallback)((e=>{L(!0),E(e),B(o)}),[o,B,L,E]),V=(0,n.useCallback)((()=>R("alerts")),[R]),H=(0,n.useCallback)((()=>R("info")),[R]),_=(0,Gt.Id)(),K=(0,Wt.I)(),z=(0,Me.Vw)(P);return(0,pe.jsxs)(ce.Flex,{"data-testid":"nodeRow-".concat(i),"data-menuid":j||o,padding:[1],column:!0,gap:1,round:!0,children:[(0,pe.jsxs)(ce.Flex,{alignItems:"center","data-testid":"nodeRow-basic-info",gap:2,height:{min:6},children:[(0,pe.jsx)(lr,{connectivity:A,"data-testid":"nodeRow-connectivity-".concat(A.toLowerCase()),name:i}),(0,pe.jsx)(Zt.K,{"data-testid":"nodeRow-separator"}),(0,pe.jsx)(Or.A,{"data-testid":"nodeRow-name",id:o,name:i,isLive:g,state:f,eligibility:O}),(0,pe.jsx)(Zt.K,{"data-testid":"nodeRow-separator"}),(0,pe.jsx)(pr,{onClick:H,"data-testid":"nodeRow-more-info-cta"}),(0,pe.jsx)(Zt.K,{"data-testid":"nodeRow-separator"}),(0,pe.jsx)(er.A,{id:o,isLive:g,"data-testid":"nodeRow-alerts",name:i,onClick:V}),(0,pe.jsx)(Zt.K,{"data-testid":"nodeRow-separator"}),(0,pe.jsx)(vr.A,{badge:"ml","data-testid":"nodeRow-machine-learning-status",enabled:I,name:i,onClick:()=>K(o),children:(0,pe.jsx)(ce.Icon,{name:"anomaliesLens",size:"small",color:"text"})}),(0,pe.jsx)(Zt.K,{"data-testid":"nodeRow-separator"}),(0,pe.jsx)(vr.A,{badge:"fn","data-testid":"nodeRow-fn-status",enabled:C,name:i,onClick:()=>_(o),children:(0,pe.jsx)(ce.Icon,{name:"functions",size:"small",color:"text"})}),u&&(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(Zt.K,{"data-testid":"nodeRow-separator"}),(0,pe.jsx)(Br.A,{name:i,os:a.id,container:d,warningLevel:u,labels:h,version:b,text:u,"data-testid":"nodeRow-needs-update"})]}),!!(p||[]).length&&(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(Zt.K,{"data-testid":"nodeRow-separator"}),(0,pe.jsx)(Rr.A,{bugs:p,"data-testid":"nodeRow-bugs"})]}),(0,pe.jsx)(ln,{node:{id:o,name:i,isLive:g,ni:l,capabilities:c}}),(0,pe.jsx)(Qt,{"data-testid":"nodeRow-node-actions",id:o,name:i,connectivity:A}),w?null:(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(Fr,{health:x}),(0,pe.jsx)(Lr,{id:o})]})]}),(0,pe.jsxs)(ce.Flex,{alignItems:"center","data-testid":"nodeRow-detailed-info",gap:2,children:[(0,pe.jsx)(Ar,{architecture:s.architecture,cpuFrequency:s.cpuFrequency,cpus:s.cpus,"data-testid":"nodeRow-system-info",diskSpace:s.diskSpace,memory:s.memory,name:i,osName:a.nm,os:a.id,timezone:M}),(0,pe.jsx)(Zt.K,{"data-testid":"nodeRow-separator"}),!(null===a||void 0===a||!a.kernel)&&(0,pe.jsx)(yr,{"data-testid":"nodeRow-kernel",kernelName:a.kernel.nm,kernelVersion:a.kernel.v,name:i}),(0,pe.jsx)(Zt.K,{"data-testid":"nodeRow-separator"}),F&&(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(br,{"data-testid":"nodeRow-kubernetes",name:i}),(0,pe.jsx)(Zt.K,{"data-testid":"nodeRow-separator"})]}),(0,pe.jsx)(Tr,{container:s.container,"data-testid":"nodeRow-type",name:i,virtualization:s.virtualization}),N&&(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(Zt.K,{"data-testid":"nodeRow-separator"}),(0,pe.jsx)(or,{"data-testid":"nodeRow-cloud-info",instanceType:D,name:i,providerType:T})]})]}),!S&&!(null===z||void 0===z||!z.length)&&(0,pe.jsx)(ce.Flex,{"data-testid":"nodeRow-charts",gap:1,children:z.map((e=>(0,pe.jsx)($r,an(an({},e),{},{nodeId:o,isLive:g}),e.id)))})]})},un=e=>{switch(e.level){case 0:return zt;case 1:return dn;default:return null}},pn=["onChartNameChange","initialChartName","dashboardOptions","linkToGo","contextToGo"];function hn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function gn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?hn(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const fn=e=>{let{onChartNameChange:t,initialChartName:r,dashboardOptions:n,linkToGo:o,contextToGo:i}=e,s=(0,W.A)(e,pn);const{setActiveMenuId:a}=(0,Nt.A)({onChartNameChange:t,initialChartName:r,linkToGo:o,contextToGo:i});return(0,pe.jsx)(ae.H,gn(gn({},s),{},{children:(0,pe.jsx)(Et.A,{flavour:"nodes",onActiveMenuId:a,getComponent:un,dashboardOptions:n,initialChartName:r,checkVisibility:()=>!0})}))};var bn=r(69457),mn=r(20871),xn=r(48106),jn=r(51510),yn=r(24155);function vn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}const On=(0,jn.default)(ce.Box).attrs((e=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?vn(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e))).withConfig({displayName:"loader__Grid",componentId:"sc-yd9b7n-0"})(["display:grid;grid-template-columns:1fr 6fr 1fr;gap:8px;"]),wn=()=>(0,pe.jsxs)(ce.Flex,{column:!0,gap:2,children:[(0,pe.jsx)(yn.A,{height:"38px"}),(0,pe.jsx)(On,{children:Array.from(Array(15).keys()).map((e=>(0,pe.jsxs)(n.Fragment,{children:[(0,pe.jsx)(yn.A,{height:"32px"}),(0,pe.jsx)(yn.A,{height:"32px"}),(0,pe.jsx)(yn.A,{height:"32px"})]},e)))})]});var Pn=r(9962),Cn=(r(46449),r(78350),r(93514),r(30237),r(30670),r(36310)),In=r(39483);function An(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}const kn=e=>{var t;let{children:r,contextName:n,dimensions:o,aggregationMethod:i="sum",fractionDigits:s,totalDimensions:a,calculateTotal:l}=e;const{chart:c,state:d}=(0,Cn.useHeadlessChart)(),{contextGroups:u}=(0,In.useTableMatrix)();if(!u)return r({data:null,loading:!d.loaded&&d.loading,error:d.error});if(d.empty)return r({data:null,loading:!d.loaded&&d.loading,error:"No data available"});const p=u[n];if(!p)return r({data:null,loading:!d.loaded&&d.loading,error:"Context not found"});const h=(null===(t=c.getPayload())||void 0===t||null===(t=t.data)||void 0===t?void 0:t.length)-1||0;if(l){const e=o&&o.length>0?(Array.isArray(o)?o:[o]).map((e=>{var t;return null===(t=p[e])||void 0===t?void 0:t[0]})).filter(Boolean):Object.values(p).flat().filter(Boolean),t=a&&a.length>0?a.map((e=>{var t;return null===(t=p[e])||void 0===t?void 0:t[0]})).filter(Boolean):Object.values(p).flat().filter(Boolean);if(0===e.length||0===t.length)return r({data:null,loading:!d.loaded&&d.loading,error:"Required dimensions not found"});const n=e.reduce(((e,t)=>e+(c.getDimensionValue(t,h)||0)),0),i=t.reduce(((e,t)=>e+(c.getDimensionValue(t,h)||0)),0),l=i>0?n/i*100:0,u=e[0];return r({data:{value:n,convertedValue:c.getConvertedValue(n,{fractionDigits:s,dimensionId:u}),total:c.getConvertedValue(i,{fractionDigits:s,dimensionId:u}),percentage:l,units:c.getUnitSign({dimensionId:u}),dimensionId:u},loading:!d.loaded&&d.loading,error:null})}let g,f,m,x,j;if(!o||Array.isArray(o)&&0===o.length){if(x=Object.values(p).flat(),j=x[0],0===x.length)return r({data:null,loading:!d.loaded&&d.loading,error:"No dimensions found"});g=c.getAggregatedDimensionValue(x,h,{aggregationMethod:i}),f=c.getConvertedValue(g,{dimensionId:j,fractionDigits:s})}else if("string"===typeof o){var y;if(x=p[o],j=x[0],null===(y=x)||void 0===y||!y.length)return r({data:null,loading:!d.loaded&&d.loading,error:"Dimension not found"});g=c.getAggregatedDimensionValue(x,h,{aggregationMethod:i}),f=c.getConvertedValue(g,{dimensionId:j,fractionDigits:s}),m=c.selectDimensionColor(x[0])}else if(Array.isArray(o)){if(x=o.flatMap((e=>p[e])).filter(Boolean),j=x[0],0===x.length)return r({data:null,loading:!d.loaded&&d.loading,error:"No valid dimensions found"});g=c.getAggregatedDimensionValue(x,h,{aggregationMethod:i}),f=c.getConvertedValue(g,{dimensionId:j,fractionDigits:s})}const v=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?An(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):An(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({value:parseFloat(g)||0,convertedValue:f||"0",dimensionId:j,units:j?c.getUnitSign({dimensionId:j}):""},m&&{color:m});return r({data:v,loading:!d.loaded&&d.loading,error:null})},Sn=e=>{let{nodeId:t,contextName:r,dimensions:o,aggregationMethod:i="sum",fractionDigits:s,totalDimensions:a,calculateTotal:l,children:c}=e;const d=(0,Vr.eg)(),u=(0,v.ID)(),[p,h]=(0,n.useState)((()=>qr(d,u,t,i)));return(0,n.useEffect)((()=>{if(p)return;const e=(e,r)=>{r.getId()!==Wr(t,i)&&r.getId()!==(null===p||void 0===p?void 0:p.getId())&&h(r)},r=()=>h(qr(d,u,t,i));return d.on("nodeAdded",e),d.on("nodesContainerUpdated",r),r(),()=>{d.off("nodeAdded",e),d.off("nodesContainerUpdated",r)}}),[d,p]),p?(0,pe.jsx)(Cn.default,{chart:p,children:(0,pe.jsx)(kn,{contextName:r,dimensions:o,aggregationMethod:i,fractionDigits:s,totalDimensions:a,calculateTotal:l,children:c})}):c({data:null,loading:!0,error:"Chart not found"})};function Dn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Tn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Dn(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Dn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Mn=()=>(0,pe.jsx)(yn.A,{width:"80%",height:"8px"}),Fn={value:e=>Tn(Tn({id:e.columnId,header:(0,pe.jsx)(ce.Text,{strong:!0,children:e.header}),headerString:e.headerString,accessorKey:e.columnId,size:e.size,minSize:e.minSize,maxSize:e.maxSize,align:e.align,category:"Metrics",enableSorting:!1},e.labelProps&&{labelProps:e.labelProps}),{},{cell:t=>{let{row:r}=t;const n=r.original,o=n.id||n.nd;return(0,pe.jsx)(Sn,{nodeId:o,contextName:e.context,dimensions:e.dimensions,aggregationMethod:e.aggregation||"sum",fractionDigits:e.fractionDigits,totalDimensions:e.totalDimensions,calculateTotal:e.calculateTotal,children:t=>{let{data:r,loading:n}=t;if(n)return(0,pe.jsx)(ce.Flex,{alignItems:"end",justifyContent:"end",width:"100%",children:(0,pe.jsx)(Mn,{})});if(!r)return(0,pe.jsx)(ce.Flex,{alignItems:"end",justifyContent:"end",width:"100%",children:(0,pe.jsx)(ce.Text,{children:"-"})});const o=r.convertedValue&&r.total;return(0,pe.jsxs)(ce.Flex,{alignItems:"end",justifyContent:"end",width:"100%",gap:.5,children:[(0,pe.jsx)(ce.Text,{textAlign:"right",children:o?(0,pe.jsxs)(pe.Fragment,{children:[r.convertedValue,"/",r.total]}):r.convertedValue}),!e.hideUnits&&r.units&&(0,pe.jsx)(ce.TextMicro,{color:"textLite",strong:!0,textAlign:"right",children:r.units})]})}})},renderString:t=>{const r=t.original[e.columnId];return(0,Dt.Po)(r)?"":"".concat(r.convertedValue," ").concat(e.hideUnits?"":r.units)},sortingFn:(t,r)=>{var n,o;return((null===(n=t.original[e.columnId])||void 0===n?void 0:n.value)||0)-((null===(o=r.original[e.columnId])||void 0===o?void 0:o.value)||0)}}),progressBar:e=>Tn(Tn({id:e.columnId,header:(0,pe.jsx)(ce.Text,{strong:!0,children:e.header}),headerString:e.headerString,accessorKey:e.columnId,size:e.size,minSize:e.minSize,maxSize:e.maxSize,align:e.align,category:"Metrics",enableSorting:!1},e.labelProps&&{labelProps:e.labelProps}),{},{cell:t=>{let{row:r}=t;const n=r.original,o=n.id||n.nd;return(0,pe.jsx)(Sn,{nodeId:o,contextName:e.context,dimensions:e.dimensions,aggregationMethod:e.aggregation||"sum",fractionDigits:e.fractionDigits,totalDimensions:e.totalDimensions,calculateTotal:e.calculateTotal,children:t=>{let{data:r,loading:n}=t;if(n)return(0,pe.jsx)(ce.Flex,{alignItems:"end",justifyContent:"end",width:"100%",children:(0,pe.jsx)(Mn,{})});if(!r)return(0,pe.jsx)(ce.Flex,{alignItems:"end",justifyContent:"end",width:"100%",children:(0,pe.jsx)(ce.Text,{children:"-"})});const o="undefined"!==typeof r.convertedValue&&"undefined"!==typeof r.total,i=o?r.percentage:parseFloat(r.convertedValue)||0,s=Math.min(i,100);return(0,pe.jsxs)(ce.Flex,{column:!0,width:"100%",alignItems:o?"center":"end",gap:2,children:[(0,pe.jsxs)(ce.Flex,{alignItems:"end",justifyContent:o?"between":"end",width:"100%",children:[o&&(0,pe.jsxs)(ce.Flex,{alignItems:"end",gap:.5,children:[(0,pe.jsxs)(ce.Text,{children:[r.convertedValue,"/",r.total]}),!e.hideUnits&&r.units&&(0,pe.jsx)(ce.TextMicro,{color:"textLite",strong:!0,textAlign:"right",children:r.units})]}),(0,pe.jsxs)(ce.Flex,{alignItems:"end",children:[(0,pe.jsx)(ce.Text,{children:Math.round(i)}),(0,pe.jsx)(ce.TextMicro,{color:"textLite",strong:!0,children:"%"})]})]}),(0,pe.jsx)(ce.ProgressBar,{background:"panelBg",color:"textLite",height:.5,width:"".concat(s,"%"),containerWidth:"100%",border:"none",overflow:"hidden"})]})}})},renderString:t=>{const r=t.original[e.columnId];return(0,Dt.Po)(r)?"":"".concat(r.convertedValue," / ").concat(r.total," (").concat(r.percentage.toFixed(1),"%)")},sortingFn:(t,r)=>{var n,o,i,s;return((null===(n=t.original[e.columnId])||void 0===n?void 0:n.percentage)||(null===(o=t.original[e.columnId])||void 0===o?void 0:o.value)||0)-((null===(i=r.original[e.columnId])||void 0===i?void 0:i.percentage)||(null===(s=r.original[e.columnId])||void 0===s?void 0:s.value)||0)}}),metadata:e=>({id:e.columnId,header:(0,pe.jsx)(ce.Text,{strong:!0,children:e.header}),headerString:e.headerString,accessorKey:e.accessorKey,size:e.size,minSize:e.minSize,maxSize:e.maxSize,align:e.align||"left",category:"Labels",cell:t=>{let{row:r}=t;const n=r.original,o=e.accessorKey.split(".");let i=n;for(const e of o){var s;if(i=null===(s=i)||void 0===s?void 0:s[e],void 0===i)break}if(e.fallbackKeys)for(const l of e.fallbackKeys){if(!(0,Dt.Po)(i))break;const e=l.split(".");let t=n;for(const r of e){var a;if(t=null===(a=t)||void 0===a?void 0:a[r],void 0===t)break}i=t}return(0,Dt.Po)(i)?(0,pe.jsx)(ce.Flex,{alignItems:"end",width:"100%",children:(0,pe.jsx)(ce.Text,{children:"-"})}):(0,pe.jsx)(ce.Flex,{alignItems:"center",width:"100%",children:(0,pe.jsx)(ce.Text,{children:i})})},renderString:t=>{const r=t.original,n=e.accessorKey.split(".");let o=r;for(const e of n){var i;if(o=null===(i=o)||void 0===i?void 0:i[e],void 0===o)break}if(e.fallbackKeys)for(const a of e.fallbackKeys){if(!(0,Dt.Po)(o))break;const e=a.split(".");let t=r;for(const r of e){var s;if(t=null===(s=t)||void 0===s?void 0:s[r],void 0===t)break}o=t}return(0,Dt.Po)(o)?"-":o},sortingFn:"basic"})};var Nn=r(71341);const En=e=>{let{osEntry:t}=e;if(!t)return(0,pe.jsx)(ce.Icon,{name:"os",width:"18px",height:"18px",color:"textDescription"});if(t.iconName)return(0,pe.jsx)(ce.Icon,{name:t.iconName,width:"18px",height:"18px",color:"textDescription",viewBox:"0 0 100 100"});if(t.logoFilename){const e="".concat(h.A.assetsBaseURL,"/img/logos/os/").concat(t.logoFilename);return(0,pe.jsx)("img",{src:e,width:"18px",height:"18px",alt:t.title})}return(0,pe.jsx)(ce.Icon,{name:"os",width:"18px",height:"18px",color:"textDescription"})},Ln=e=>{let{headerText:t="Server"}=e;return{id:"server",header:(0,pe.jsx)(ce.Text,{strong:!0,children:t}),headerString:t,accessorKey:"name",size:200,minSize:60,maxSize:400,align:"center",category:"Device",enableHiding:!1,cell:e=>{var t,r,n,o;let{row:i}=e;const s=i.original,a=(0,Dt.GM)(s.state),l=(null===(t=s.os)||void 0===t?void 0:t.nm)||(null===(r=s.labels)||void 0===r?void 0:r.os_name),c=null===(n=s.os)||void 0===n?void 0:n.id,d=null===(o=s.labels)||void 0===o?void 0:o.vendor,u=yt.u[l]||yt.U[c]||yt.u[d],p="Live"===a?Nn.P.live.indicatorWrapperColor:"Stale"===a?Nn.P.stale.indicatorWrapperColor:Nn.P.offline.indicatorWrapperColor;return(0,pe.jsxs)(ce.Flex,{alignItems:"center",gap:2,width:"100%",children:[(0,pe.jsx)(ce.Flex,{width:2,height:2,round:"50%",background:p,flex:!1}),(0,pe.jsx)(ce.Flex,{width:5,height:5,flex:!1,alignItems:"center",justifyContent:"center",children:(0,pe.jsx)(En,{osEntry:u})}),(0,pe.jsx)(Or.A,{id:s.id||s.nd,name:s.nm||s.name,state:s.state,isLive:s.isLive})]})},renderString:e=>e.original.name||e.original.nm,sortingFn:"basic"}},Bn=e=>({id:"alerts",header:(0,pe.jsx)(ce.Text,{strong:!0,children:"Alerts"}),headerString:"Alerts",accessorFn:e=>{var t;const{warning:r=0,critical:n=0}=(null===(t=e.health)||void 0===t?void 0:t.alerts)||{};return 3*n+2*r},size:80,minSize:60,maxSize:400,align:"center",category:"Device",cell:t=>{var r;let{row:o}=t;const i=o.original,{warning:s=0,critical:a=0}=(null===(r=i.health)||void 0===r?void 0:r.alerts)||{},l=s+a>0,c=(0,U.Fw)("sidebarTab",{flavour:"val",extraKey:e}),d=(0,U.Fw)("sidebarOpen",{flavour:"bool"}),u=(0,U.Fw)("sidebarNodeId",{flavour:"val",extraKey:e}),p=(0,n.useCallback)((e=>{e.stopPropagation(),d(!0),c("alerts"),u(i.id)}),[i.id,u,d,c]),h=(0,Pn.I)({flavour:a>0?"error":"disabledError",value:a||" "}),g=(0,Pn.I)({flavour:s>0?"warning":"disabledWarning",value:s||" "});return(0,pe.jsx)(ce.Flex,{alignItems:"center",justifyContent:"center",opacity:l?1:.3,children:(0,pe.jsx)(ce.MasterCard,{"data-testid":"alertsMastercard",onClick:l?p:null,pillLeft:h,pillRight:g,size:"small",height:"20px"})})},renderString:e=>{var t;const{warning:r=0,critical:n=0}=(null===(t=e.original.health)||void 0===t?void 0:t.alerts)||{};return r+n},sortingFn:"basic"}),Rn=(e,t)=>{let{extraKey:r="nodesView",tabId:o="servers"}=t;return(0,n.useMemo)((()=>{const t="snmp"===o?"Device":"Server",n=(e=>e.map((e=>{const t=Fn[e.columnFlavour];return t?t(e):(console.warn("Unknown column flavour: ".concat(e.columnFlavour)),Fn.value(e))})))(e)||[],i=n.reduce(((e,t)=>{const r=t.category||"Metrics";return e[r]||(e[r]=[]),e[r].push(t),e}),{});return[{id:"Server",isPlaceholder:!0,columns:[Ln({headerText:t}),Bn(r)],notFlex:!0},...Object.entries(i).map((e=>{let[t,r]=e;return{id:t,header:"",columns:r,notFlex:!0}}))]}),[e,r,o])};var Vn=r(1444),Hn=r(95565);const _n={LocalDashboard:"Favourites can be saved when the agent is part of a Netdata cloud space.",DemoSpace:"Favourites cannot be saved on a demo space.",FreePlan:()=>(0,pe.jsxs)(ce.Flex,{column:!0,gap:1,children:[(0,pe.jsx)(ce.Text,{children:"Favourites can be saved only on a paid plan."}),(0,pe.jsx)(Hn.A,{children:(0,pe.jsx)(ce.Text,{color:"primary",children:"Upgrade for no limitations!"})})]}),default:null},Kn=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"nodesView",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"servers";const[r,,o,i]=(0,Pe.A)(),s=(0,Hr.yK)({onResolve:i}),a=(0,Hr.z2)(null,{onResolve:i}),{disabled:l,reason:c}=(0,Vn.A)(),d=(0,n.useCallback)((async function(r,n){let{tabId:i=t,flavour:c=e}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!l&&r&&(o(),n?await a(n.id):await s({type:"favourites",entity:r,path:"/".concat(c,"/").concat(i),value:{nodeId:r,sortOrder:Date.now()}}))}),[l,s,a,o,e,t]);return{isLoading:r,disabled:l,reason:_n[c]||_n.default,toggleFavorite:d}};var zn=r(85720),Gn=r(78804);const Wn=["data","onCreateGroupWithNode","icon","name"];function qn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Un(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qn(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Jn=(0,jn.default)(ce.Drop).attrs({align:{top:"bottom",right:"right"},animation:!0,column:!0,padding:[2,0],background:"dropdown",round:1,overflow:{vertical:"auto"},margin:[.5,0,0],width:{min:40,max:60},height:{max:60}}).withConfig({displayName:"addToGroupAction__Dropdown",componentId:"sc-5vhb1z-0"})([""]),Zn=(0,n.memo)((e=>{let{data:t,onCreateGroupWithNode:r,icon:o,name:i}=e,s=(0,W.A)(e,Wn);const a=(0,n.useRef)(),[l,c,,d]=(0,Pe.A)(!1),u=(0,v.ID)(),p=(0,Oe.Jk)(u),h=(0,Oe.TV)(u),g=(0,n.useCallback)((async e=>{await h({groupId:e,nodeId:t.id}),d()}),[h,t.id,d]),f=(0,n.useCallback)((()=>{r(t.id),d()}),[r,t.id,d]);return(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(ce.IconButton,Un(Un({},s),{},{ref:a,icon:o,name:i,onClick:c})),l&&a.current&&(0,pe.jsxs)(Jn,{target:a.current,onEsc:d,onClickOutside:d,children:[p.map((e=>(0,pe.jsx)(zn.A,{onClick:()=>g(e.id),testid:"addToGroup-".concat(e.id),children:e.name},e.id))),p.length>0&&(0,pe.jsx)(Gn.c,{}),(0,pe.jsx)(zn.A,{icon:"plus",onClick:f,testid:"addToGroup-createNew",children:"Create new group"})]})]})})),Xn=Zn;function $n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Yn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?$n(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Qn=["row","name","groupMode"];function eo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function to(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?eo(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):eo(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const ro={[At]:"error",[It]:"warning",[Ct]:"success",[kt]:"textLite"},no={Live:"live",Stale:"stale",Offline:"offline",critical:"live",warning:"live",clear:"live"},oo={nodeStatus:!0,critical:!0,warning:!0,clear:!0},io=e=>{let{rows:t,name:r,groupMode:n}=e;const o=oo[n]||oo[r],i=t.map((e=>e.original.id)),s=(0,z.BU)(i).length,a=(0,z.Ig)(i).length,l=(0,z.GE)(i).length;return(0,pe.jsx)(tt.A,{content:(0,pe.jsxs)(ce.Flex,{alignItems:"center",gap:4,background:"dropdown",round:!0,padding:[2,3],children:[(!o||no[r]===no.Live)&&(0,pe.jsxs)(ce.Flex,{alignItems:"center",gap:2,children:[(0,pe.jsx)(ce.Flex,{width:2,height:2,round:"50%",background:Nn.P.live.indicatorWrapperColor}),(0,pe.jsxs)(ce.Text,{children:["Live: ",s]})]}),(!o||no[r]===no.Stale)&&(0,pe.jsxs)(ce.Flex,{alignItems:"center",gap:2,children:[(0,pe.jsx)(ce.Flex,{width:2,height:2,round:"50%",background:Nn.P.stale.indicatorWrapperColor}),(0,pe.jsxs)(ce.Text,{children:["Stale: ",a]})]}),(!o||no[r]===no.Offline)&&(0,pe.jsxs)(ce.Flex,{alignItems:"center",gap:2,children:[(0,pe.jsx)(ce.Flex,{width:2,height:2,round:"50%",background:Nn.P.offline.indicatorWrapperColor}),(0,pe.jsxs)(ce.Text,{children:["Offline: ",l]})]})]}),align:"right",children:(0,pe.jsxs)(ce.Text,{color:"textLite",children:["(",(!o||no[r]===no.Live)&&(0,pe.jsx)(ce.Text,{color:Nn.P.live.statusTextColor,children:s}),!o&&"/",(!o||no[r]===no.Stale)&&(0,pe.jsx)(ce.Text,{color:Nn.P.stale.statusTextColor,children:a}),!o&&"/",(!o||no[r]===no.Offline)&&(0,pe.jsx)(ce.Text,{color:Nn.P.offline.statusTextColor,children:l}),")"]})})},so=e=>{let{row:t,name:r,groupMode:n}=e,o=(0,W.A)(e,Qn);const i=t.getIsExpanded(),s=(e=>{var t,r;return"Other"===e?"textLite":(null===(t=Nn.P[null===e||void 0===e||null===(r=e.toLowerCase)||void 0===r?void 0:r.call(e)])||void 0===t?void 0:t.statusTextColor)||ro[e]||"text"})(r);return(0,pe.jsx)(ce.Flex,to(to({height:"44px",alignItems:"center",flex:!0,width:"100%",background:"tableRowBg2",_hover:{background:"tableRowBg2Hover"}},o),{},{children:(0,pe.jsxs)(ce.Flex,{position:"sticky",left:"0px",width:"auto",padding:[2,3],gap:2,children:[(0,pe.jsx)(ce.Icon,{name:"chevron_left",size:"small",color:"textLite",rotate:i?1:3}),(0,pe.jsx)(ce.Text,{color:s,strong:!0,children:r}),(0,pe.jsx)(io,{rows:t.subRows,groupMode:n,name:r})]})}))},ao=e=>{let{tabId:t,flavour:r,onClickRow:n,columnPinning:o,columnVisibility:i,columnSizing:s,onColumnSizingChange:a,sortBy:l,onSortingChange:c,rowActions:d,columns:u}=e;const{favoriteNodeIds:p}=zr(r,t),[h,g]=(0,Pe.A)(!0),f=(0,z.Gt)(p),b={getIsExpanded:()=>h,subRows:f.map((e=>({original:e})))};return f.length?(0,pe.jsx)(pe.Fragment,{children:(0,pe.jsxs)("div",{children:[(0,pe.jsx)(so,{row:b,name:"Favourites",onClick:g}),(0,pe.jsx)(ce.Collapsible,{open:h,children:(0,pe.jsx)(ce.Table,{data:f,dataColumns:u,rowActions:d,onClickRow:n,enableSorting:!0,sortBy:l,onSortingChange:c,enableColumnPinning:!0,enableResizing:!0,columnVisibility:i,columnSizing:s,onColumnSizingChange:a,background:"tableRowBg2",columnPinning:o})})]})}):null};var lo=r(37356),co=r(71581);const uo=["nodeIdsLoaded"];function po(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ho(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?po(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):po(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const go={right:["actions"],left:["server"]},fo={nodeStatus:{Live:!0},default:!0},bo=e=>{let{id:t}=e;return t},mo=(e=>t=>{let{nodeIdsLoaded:r}=t,n=(0,W.A)(t,uo);return(0,v.XA)("fullyLoaded")&&!!r?(0,pe.jsx)(e,ho({},n)):(0,pe.jsx)(wn,{})})((e=>{let{nodeIds:t,tabNodeIds:r,onChartNameChange:o,initialChartName:i,tabId:s="servers",flavour:a="nodesView",onCreateGroup:l,onCreateGroupWithNode:c,matchingGroups:d}=e;const u=(0,bn.qR)(),p=(0,v.ID)(),h=(0,y.vt)(),f=(0,g.JT)("space:UpdateSettings",h),b=(0,K.Cq)(p,s),m=(0,K.A3)(p,s),x=(0,co.rK)(s,p),j=(0,Me.vh)(p,s,x),[O,w]=(0,U.r$)("expanded",{extraKey:"".concat(a,"-").concat(s,"-").concat(b||"ungrouped"),flavour:"obj",defaultValue:fo[b]||fo.default}),[P,C]=(0,n.useState)(null),[I,A]=(0,n.useState)(null),k=(0,n.useCallback)(((e,t)=>{C({ids:[e],name:t})}),[]),S=(0,n.useCallback)(((e,t)=>{A({ids:[e],name:t})}),[]),D=Rn(j,{extraKey:a,tabId:s}),T=(0,n.useMemo)((()=>{const e=(e=>{const t={nodeStatus:{name:"Node status",columns:[]},alertStatus:{name:"Alerts",columns:[]}};return"snmp"===e?ho(ho({},t),{},{vendor:{name:"Vendor",columns:[]},type:{name:"Type",columns:[]},location:{name:"Location",columns:[]}}):t})(s);return(0,we.b5)(s)&&(null===d||void 0===d?void 0:d.length)>0?ho(ho({},e),{},{customGroups:{name:"Groups",columns:[]}}):e}),[s,null===d||void 0===d?void 0:d.length]),M=(0,n.useMemo)((()=>j.reduce(((e,t)=>(t.hidden&&(e[t.columnId]=!1),e)),{})),[j]),[F,N]=(0,U.r$)("columnVisibility",{extraKey:"".concat(a,"-").concat(s),flavour:"obj",defaultValue:M}),[E,L]=(0,U.r$)("columnSizing",{extraKey:"".concat(a,"-").concat(s),flavour:"obj",defaultValue:{}}),[B,R]=(0,U.r$)("sortBy",{extraKey:"".concat(a,"-").concat(s),flavour:"arrobj",defaultValue:[]}),V=(0,U.Fw)("sidebarTab",{flavour:"val",extraKey:a}),H=(0,U.Fw)("sidebarOpen",{flavour:"bool"}),_=(0,U.Fw)("sidebarNodeId",{flavour:"val",extraKey:a}),z=(0,n.useCallback)(((e,t)=>{H(!0),V(e),_(t)}),[_,H,V]),G=(0,n.useCallback)((e=>{let{data:t}=e;t.isGroup||z("info",t.id)}),[z]),W=((e,t)=>{let{flavour:r,onRemoveNode:o,onObsoleteNode:i,onClickNode:s,onCreateGroupWithNode:a}=t;const l=(0,g.JT)("node:Delete"),c=(0,y.vt)(),d=(0,g.JT)("space:UpdateSettings",c),u=(0,v.XA)(),p=(0,y.dg)(),h=!u.untouchable,{isLoading:f,toggleFavorite:b,disabled:m,reason:x}=Kn(r,e),{settingsByNodeId:j}=zr(r,e),O=(0,n.useRef)(null);return O.current=t=>{const n=j[t];b(t,n,{flavour:r,tabId:e})},(0,n.useMemo)((()=>Yn(Yn(Yn({},!p&&h&&{remove:{icon:"remove",tooltipText:"Remove node from room",handleAction:e=>o(e.id,e.name),confirmation:!0,confirmationText:e=>"Remove ".concat(e.name," from room?"),isDisabled:()=>!1}}),!p&&!h&&{obsolete:{icon:"delete",tooltipText:"Delete node permanently",handleAction:e=>i(e.id,e.name),confirmation:!0,confirmationText:e=>"Delete ".concat(e.name," permanently?"),isDisabled:e=>{const t=(0,Dt.GM)(e.state);return l&&"Offline"!==t}}}),{},{info:{handleAction:e=>s({data:e})},favorite:{icon:e=>j[e.id]?"heart_broken":"heart",tooltipText:e=>j[e.id]?"Remove from favorites":"Add to favorites",handleAction:e=>O.current(e.id),confirmation:!1,isVisible:()=>!0,isDisabled:f||m,iconColor:"textNoFocus",disabledTooltipText:x||"Saving..."}},vt.xH&&d&&a&&{addToGroup:{CustomComponent:Xn,icon:"groupCreate",tooltipText:"Add to group",onCreateGroupWithNode:a,confirmation:!1}})),[l,d,p,h,o,i,f,m,j,s,a])})(s,{flavour:a,onRemoveNode:k,onObsoleteNode:S,onClickNode:G,onCreateGroupWithNode:c}),q=(0,n.useMemo)((()=>{if(vt.xH&&f&&l)return{createGroup:{handleAction:l,icon:"groupCreate",tooltipText:"Create group",alwaysEnabled:!0,confirmation:!1}}}),[f,l]),{setActiveMenuId:J}=(0,Nt.A)({onChartNameChange:o,initialChartName:i}),Z=(0,n.useRef)(),X=(0,n.useRef)(),$=(0,n.useMemo)((()=>(Z.current&&Z.current.cancel(),Z.current=(0,mn.A)({elementQueryParam:"[data-id]",dataMenuId:"data-id"}),()=>{var e;return Z.current(null===(e=X.current)||void 0===e?void 0:e.scrollElement,J)})),[u.length,J]);(0,n.useLayoutEffect)((()=>{u.length&&$()}),[u.length,i]);const Y=(0,n.useRef)(),Q=(0,n.useMemo)((()=>({overscan:30,virtualRef:X,onScroll:$})),[$]),ee=(0,n.useMemo)((()=>u.filter(Boolean)),[u]);(0,xn.A)(X.current,ee);const te=(0,n.useMemo)((()=>e=>(0,pe.jsx)(so,ho({groupMode:b},e))),[b]);return(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(ao,{tabId:s,flavour:a,onRemoveNode:k,onObsoleteNode:S,onClickRow:G,columnPinning:go,columnVisibility:F,columnSizing:E,onColumnSizingChange:L,sortBy:B,onSortingChange:R,rowActions:W,columns:D}),t.length?(0,pe.jsx)(ce.Table,{title:(0,pe.jsx)(lo.A,{extraKey:"".concat(a,"-").concat(s),nodeIds:r,tabId:s}),data:ee,dataColumns:D,rowActions:W,bulkActions:q,onClickRow:G,enableSorting:!0,sortBy:B,onSortingChange:R,enableColumnVisibility:!0,enableColumnPinning:!0,enableResizing:!0,columnPinning:go,columnVisibility:F,onColumnVisibilityChange:N,columnSizing:E,onColumnSizingChange:L,groupByColumns:T,grouping:b||"",onGroupByChange:m,getSubRows:e=>e.children,enableExpanding:!0,getRowId:bo,expanded:O,onExpandedChange:w,GroupRow:te,virtualizeOptions:Q,tableRef:Y,background:"tableRowBg2"}):(0,pe.jsx)(ve,{children:(0,pe.jsx)(ce.Flex,{gap:1,alignItems:"center",children:(0,pe.jsx)(lo.A,{extraKey:"".concat(a,"-").concat(s),nodeIds:r,tabId:s})})}),P&&(0,pe.jsx)(Jt.Ay,{ids:P.ids,name:P.name,onClose:()=>C(null)}),I&&(0,pe.jsx)(Ut.Ay,{ids:I.ids,name:I.name,onClose:()=>A(null)})]})}));r(37550);function xo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function jo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?xo(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xo(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const yo=e=>{let{tab:t,onToggle:r,onEdit:n,onDelete:o}=e;const{attributes:i,listeners:s,setNodeRef:a,transform:l,transition:c}=(0,nt.gl)({id:t.id}),d={transform:ot.Ks.Transform.toString(l),transition:c},u=t.isDefault,p=t.label||t.name;return(0,pe.jsx)("div",jo(jo({ref:a,style:d},i),{},{children:(0,pe.jsxs)(ce.Flex,{"data-testid":"groupsMenu-tab-".concat(t.id),justifyContent:"between",alignItems:"center",padding:[1,0],children:[(0,pe.jsxs)(ce.Flex,{alignItems:"center",gap:1,children:[(0,pe.jsx)(ce.Icon,jo({name:"nav_dots",color:"textLite",cursor:"grab",size:"small"},s)),(0,pe.jsx)(ce.Checkbox,{checked:!t.isHidden,"data-testid":"groupsMenu-tabCheckbox-".concat(t.id),label:p,onChange:r})]}),!u&&(0,pe.jsxs)(ce.Flex,{alignItems:"center",gap:1,children:[(0,pe.jsx)(ce.IconButton,{"data-testid":"groupsMenu-editTab-".concat(t.id),flavour:"borderless",icon:"pencilSolid",padding:[0],onClick:n,width:"10px",height:"10px"}),(0,pe.jsx)(it,{onConfirm:o,children:e=>(0,pe.jsx)(ce.IconButton,{"data-testid":"groupsMenu-deleteTab-".concat(t.id),flavour:"borderless",icon:"trashcan",padding:[0],onClick:e,width:"10px",height:"10px"})})]})]})}))};function vo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Oo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?vo(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vo(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const wo=e=>{let{isOpen:t,onClose:r,onEdit:o,onCreate:i,allNodes:s,targetRef:a,activeTabId:l,onTabChange:c}=e;const d=(0,v.ID)(),u=(0,Oe.kf)(d,s),p=(0,n.useMemo)((()=>s.some(we.ZH)),[s]),h=(0,n.useMemo)((()=>u.filter((e=>"snmp"!==e.id||p))),[u,p]),g=(0,Oe.vG)(d),f=(0,Oe.Jf)(d),b=(0,Oe.cq)(d),[m,x]=(0,n.useState)((()=>h.map((e=>e.id))));(0,n.useEffect)((()=>{x(h.map((e=>e.id)))}),[h]);const j=(0,rt.FR)((0,rt.MS)(rt.AN),(0,rt.MS)(rt.uN,{coordinateGetter:nt.JR})),y=(0,n.useCallback)((e=>{const{active:t,over:r}=e;if(null!==t&&void 0!==t&&t.id&&null!==r&&void 0!==r&&r.id&&t.id!==r.id){const e=m.indexOf(t.id),n=m.indexOf(r.id),o=(0,nt.be)(m,e,n);x(o),g(o)}}),[m,g]),O=(0,n.useCallback)((e=>{f(e)}),[f]),w=(0,n.useCallback)((e=>{o(e),r()}),[o,r]),P=(0,n.useCallback)((e=>{e===l&&c&&c("servers"),b(e)}),[b,l,c]),C=(0,n.useCallback)((()=>{i(),r()}),[i,r]),I=(0,n.useMemo)((()=>h.reduce(((e,t)=>Oo(Oo({},e),{},{[t.id]:t})),{})),[h]);return a.current&&t?(0,pe.jsxs)(ce.Drop,{align:{top:"bottom",right:"right"},animation:!0,background:"dropdown",column:!0,margin:[.5,0,0],overflow:{vertical:"auto"},padding:[3],round:!0,width:70,close:r,"data-testid":"groupsMenu",onClickOutside:r,onEsc:r,target:a.current,gap:1,children:[(0,pe.jsx)(rt.Mp,{sensors:j,collisionDetection:rt.fp,onDragEnd:y,children:(0,pe.jsx)(nt.gB,{items:m,strategy:nt._G,children:(0,pe.jsx)(ce.Flex,{column:!0,children:m.map((e=>{const t=I[e];return t?(0,pe.jsx)(yo,{tab:t,onToggle:()=>O(t.id),onEdit:()=>w(t.id),onDelete:()=>P(t.id)},t.id):null}))})})}),(0,pe.jsx)(ce.Button,{"data-testid":"groupsMenu-createGroup",label:"Create group",icon:"plus",onClick:C,small:!0,alignSelf:"end"})]}):null},Po=e=>{let{allNodes:t,onCreateGroup:r,onEditGroup:o,activeTabId:i,onTabChange:s}=e;const[a,,l,c]=(0,Pe.A)(),d=(0,n.useRef)();return(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(Ae.A,{permission:"space:UpdateSettings",ifForbidden:"hide","data-ga":"group-setting::click-group-setting::hm-nodes","data-testid":"groupSettings-button","data-onboarding-id":"groups-menu-button",flavour:"hollow",icon:"navVertical_s",neutral:!0,onClick:l,ref:d,label:"Groups",small:!0}),(0,pe.jsx)(wo,{isOpen:a,onClose:c,onEdit:o,onCreate:r,allNodes:t,targetRef:d,activeTabId:i,onTabChange:s})]})},Co=["children","tabId","allNodes","onCreateGroup","onEditGroup","onTabChange"];function Io(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ao(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Io(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Io(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const ko=(0,ht.A)(Ce.A),So=e=>{let{children:t,tabId:r,allNodes:n,onCreateGroup:o,onEditGroup:i,onTabChange:s}=e,a=(0,W.A)(e,Co);const[l,,c,d]=(0,Pe.A)(),u=(0,y.vt)(),p=(0,v.ID)(),h=(0,co.rK)(r,p),f=(0,g.JT)("space:UpdateSettings",u);return(0,pe.jsxs)(ce.Flex,Ao(Ao({alignItems:"end",justifyContent:"between",width:"100%",background:"mainBackground",padding:[0,0,0,4],border:{side:"bottom",size:"1px",type:"solid",color:"borderSecondary"}},a),{},{children:[t,(0,pe.jsxs)(ce.Flex,{justifyContent:"between",alignItems:"end",flex:!0,children:[vt.xH&&f?(0,pe.jsx)(ce.IconButton,{icon:"plus",onClick:o,"data-testid":"nodes-create-group-button",tooltip:"Create group",padding:[1],width:"16px",height:"16px"}):(0,pe.jsx)("div",{}),(0,pe.jsxs)(ce.Flex,{alignItems:"center",padding:[0,0,1,2],gap:2,children:[l&&(0,pe.jsx)(Ie.A,{onClose:d}),vt.xH&&(0,pe.jsx)(Po,{allNodes:n,onCreateGroup:o,onEditGroup:i,activeTabId:r,onTabChange:s}),(0,pe.jsx)(pt,{spaceId:u,roomId:p,tabId:r,metricsType:h}),(0,pe.jsx)(ko,{"data-ga":"add-nodes::click-add-nodes::hm-nodes-table","data-testid":"nodesTable-addNode",icon:"nodes_hollow",label:"Add Nodes",onClick:c,small:!0,flavour:"hollow"})]})]})]}))},Do=e=>{let{allNodes:t,activeTabId:r,onTabChange:o,onCreateGroup:i,onEditGroup:s,children:a}=e;const l=(0,v.ID)(),c=(0,Oe.yT)(l,t),d=(0,n.useMemo)((()=>{const e=c.findIndex((e=>e.id===r));return e>=0?e:0}),[r,c]),u=(0,n.useCallback)((e=>{const t=c[e];t&&o&&o(t.id)}),[c,o]),p=(0,n.useMemo)((()=>({tabId:r,allNodes:t,onCreateGroup:i,onEditGroup:s,onTabChange:o})),[r,t,i,s,o]);return(0,pe.jsx)(ce.Tabs,{selected:d,onChange:u,height:"100%",padding:[4,4,2],TabsHeader:So,tabHeaderProps:p,gap:4,noDefaultBorder:!0,children:c.map(((e,t)=>(0,pe.jsx)(ce.Tab,{label:(0,pe.jsx)(ce.Text,{color:t===d?"primary":"menuItem",children:e.label||e.name}),"data-testid":"nodes-tab-".concat(e.id),padding:[2,4],maxWidth:"100%",green:!0,children:a},e.id)))})},To=e=>{let{tabId:t,filteredIds:r,totalCount:n}=e;const o=(0,we.K3)(t),i=(null===o||void 0===o?void 0:o.label)||"Nodes",s=(0,z.BU)(r).length,a=(0,z.Ig)(r).length,l=(0,z.GE)(r).length;return(0,pe.jsxs)(ce.Flex,{"data-testid":"nodes-view-stats-header",width:"100%",height:"44px",justifyContent:"between",alignItems:"center",background:"mainBackground",padding:[0,3],border:"border",round:!0,children:[(0,pe.jsxs)(ce.Text,{strong:!0,children:["Total ",i,": ",n]}),(0,pe.jsxs)(ce.Flex,{alignItems:"center",gap:4,children:[(0,pe.jsxs)(ce.Flex,{alignItems:"center",gap:2,children:[(0,pe.jsx)(ce.Flex,{width:2,height:2,round:"50%",background:Nn.P.live.indicatorWrapperColor}),(0,pe.jsxs)(ce.Text,{children:["Live: ",s]})]}),(0,pe.jsxs)(ce.Flex,{alignItems:"center",gap:2,children:[(0,pe.jsx)(ce.Flex,{width:2,height:2,round:"50%",background:Nn.P.stale.indicatorWrapperColor}),(0,pe.jsxs)(ce.Text,{children:["Stale: ",a]})]}),(0,pe.jsxs)(ce.Flex,{alignItems:"center",gap:2,children:[(0,pe.jsx)(ce.Flex,{width:2,height:2,round:"50%",background:Nn.P.offline.indicatorWrapperColor}),(0,pe.jsxs)(ce.Text,{children:["Offline: ",l]})]})]})]})};var Mo=r(32215);const Fo=["title","disclaimer","disclaimerColor","children"];function No(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Eo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?No(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):No(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Lo=e=>{let{title:t,disclaimer:r,disclaimerColor:n="textLite",children:o}=e,i=(0,W.A)(e,Fo);return(0,pe.jsxs)(ce.Flex,Eo(Eo({gap:1,column:!0},i),{},{children:[(0,pe.jsx)(ce.Text,{as:"label",margin:[0],children:t}),o,r&&(0,pe.jsx)(ce.TextSmall,{color:n,children:r})]}))};r(25440),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);var Bo=r(26848);const Ro={nodeStatuses:{name:"Node status",category:"Core",paramKey:"nodeStatus"},nodeVersions:{name:"Node version",category:"Core",paramKey:"version"},nodeCapabilities:{name:"Capabilities",category:"Core",paramKey:"capabilityKeys"},"os.nm":{name:"Operating System",category:"System",paramKey:"os.nm"},"hw.cpuFrequency":{name:"CPU Frequency",category:"Hardware",type:"range"},"hw.cpus":{name:"CPU Cores",category:"Hardware",type:"range"},"hw.memory":{name:"Memory",category:"Hardware",type:"range"},"hw.diskSpace":{name:"Disk Space",category:"Hardware",type:"range"}};function Vo(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function Ho(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ho(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ho(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Ko=(0,n.memo)((e=>{let{filters:t,onFiltersChange:r,nodes:o,selectedNodeIds:i,onSelectedNodeIdsChange:s}=e;const[a,l]=(0,n.useState)(""),c=(0,n.useMemo)((()=>{const e=Object.entries(Ro).map((e=>{let[t,r]=e;return{id:t,name:r.name,category:r.category}})),t=new Set;o.forEach((e=>{e.labels&&Object.keys(e.labels).forEach((e=>t.add(e)))}));return[...e,{id:"selectedNodeIds",name:"Selected Nodes",category:"Nodes"},...Array.from(t).map((e=>({id:"label.".concat(e),name:e,category:"Labels"})))]}),[o]),d=(0,n.useMemo)((()=>{const e=Object.keys(t||{});return(null===i||void 0===i?void 0:i.length)>0&&e.push("selectedNodeIds"),e}),[t,i]),u=(0,n.useMemo)((()=>{const e={searchAction:null,topFilters:[],groupedValues:{},allFilters:[]},t=a.toLowerCase().trim();t&&(e.searchAction={query:a,text:'Search for "'.concat(a,'"')});const r=new Map,n=[];return c.forEach((e=>{if(!d.includes(e.id)){const r={id:e.id,name:e.name,category:e.category,score:0};if(t){const n=e.name.toLowerCase().includes(t),o=e.id.toLowerCase().includes(t);n&&(r.score+=10),o&&(r.score+=5),e.name.toLowerCase().startsWith(t)&&(r.score+=15)}else r.score=1;(r.score>0||!t)&&n.push(r)}if(o&&o.length>0){const n=[];if("nodeStatuses"===e.id){const e=o.reduce(((e,t)=>{const r=t.nodeStatus;return e[r]||(e[r]={count:0}),e[r].count+=1,e}),{});Object.entries(e).forEach((e=>{let[r,o]=e,i=!t,s=o.count;if(t){r.toLowerCase().includes(t)&&(i=!0,s=100,r.toLowerCase().startsWith(t)&&(s+=50))}i&&n.push({value:r,label:r,count:o.count,score:s})}))}else if("nodeVersions"===e.id){const e=o.reduce(((e,t)=>(t.version&&(e[t.version]||(e[t.version]={count:0}),e[t.version].count+=1),e)),{});Object.entries(e).forEach((e=>{let[r,o]=e,i=!t,s=o.count;if(t){r.toLowerCase().includes(t)&&(i=!0,s=100,r.toLowerCase().startsWith(t)&&(s+=50))}i&&n.push({value:r,label:r,count:o.count,score:s})}))}else if("nodeCapabilities"===e.id){const e=new Set;o.forEach((t=>{t.capabilities&&Object.keys(t.capabilities).forEach((t=>e.add(t)))})),Array.from(e).forEach((e=>{const r=o.filter((t=>t.capabilities&&e in t.capabilities)).length;let i=!t,s=r;if(t){e.toLowerCase().includes(t)&&(i=!0,s=100,e.toLowerCase().startsWith(t)&&(s+=50))}i&&n.push({value:e,label:e,count:r,score:s})}))}else if("os.nm"===e.id){const e=o.reduce(((e,t)=>{var r;return null!==(r=t.os)&&void 0!==r&&r.nm&&(e[t.os.nm]||(e[t.os.nm]={count:0}),e[t.os.nm].count+=1),e}),{});Object.entries(e).forEach((e=>{let[r,o]=e,i=!t,s=o.count;if(t){r.toLowerCase().includes(t)&&(i=!0,s=100,r.toLowerCase().startsWith(t)&&(s+=50))}i&&n.push({value:r,label:r,count:o.count,score:s})}))}else if(e.id.startsWith("label.")){const r=e.id.replace("label.",""),i=o.reduce(((e,t)=>{if(t.labels&&t.labels[r]){const n=t.labels[r];e[n]||(e[n]={count:0}),e[n].count+=1}return e}),{});Object.entries(i).forEach((e=>{let[o,i]=e,s=!t,a=i.count;if(t){o.toLowerCase().includes(t)&&(s=!0,a=100,o.toLowerCase().startsWith(t)&&(a+=50))}s&&n.push({value:"".concat(r,"|").concat(o),label:o,count:i.count,score:a})}))}else"selectedNodeIds"===e.id&&o.forEach((e=>{let r=!t,o=1;const s=null===i||void 0===i?void 0:i.includes(e.id);if(t){const n=e.name&&e.name.toLowerCase().includes(t),i=e.id.toLowerCase().includes(t);(n||i)&&(r=!0,o=n?100:50,e.name&&e.name.toLowerCase().startsWith(t)&&(o+=50))}r&&n.push({value:e.id,label:e.name||e.id,count:s?1:0,score:o+(s?10:0)})}));n.length>0&&(n.sort(((e,t)=>t.score-e.score)),r.set(e.id,{filterName:e.name,values:n.slice(0,t?10:5)}))}})),n.sort(((e,t)=>t.score-e.score)),e.allFilters=n,e.topFilters=t?n.slice(0,5):n,r.forEach(((r,n)=>{(e.topFilters.some((e=>e.id===n))||t)&&(e.groupedValues[n]=r)})),e}),[a,o,t,c,d,i]),p=(0,n.useCallback)((e=>{r((t=>_o(_o({},t),{},{[e]:[]})))}),[r]),h=(0,n.useCallback)(((e,t)=>{if("selectedNodeIds"===e){const e=i||[],r=e.includes(t)?e.filter((e=>e!==t)):[...e,t];s(r)}else r((r=>{const n=r[e]||[],o=n.includes(t)?n.filter((e=>e!==t)):[...n,t];if(0===o.length){const{[e]:t}=r;return(0,W.A)(r,[e].map(Vo))}return _o(_o({},r),{},{[e]:o})}))}),[r,i,s]),g=(0,n.useCallback)((()=>{}),[]);return(0,pe.jsx)(Bo.A,{searchValue:a,setSearchValue:l,setSearchQuery:g,searchResults:u,onAddFilter:p,onAddFilterWithValue:h,placeholder:"Search filters..."})})),zo=Ko;var Go=r(24798);const Wo=e=>{const t=(0,v.ID)(),r="nodesView-".concat(e),o=(0,U.l6)("addedFilters",{extraKey:r,flavour:"arr",defaultValue:[]});return(0,m.yF)((0,n.useCallback)((e=>{const n={},i=[...Go.RT,...o];[...new Set(i)].forEach((o=>{const i=e((0,U.GA)({key:t,extraKey:r,param:o,flavour:"arr"}));null!==i&&void 0!==i&&i.length&&(n[o]=i)}));const s=e((0,U.GA)({key:t,extraKey:r,param:"selectedNodeIds",flavour:"arr"}));return null!==s&&void 0!==s&&s.length&&(n.selectedNodeIds=s),n}),[t,r,o]))};var qo=r(64007),Uo=r(5402),Jo=r(68529),Zo=r(21511);const Xo=(0,n.memo)((e=>{let{id:t,label:r,value:o,onChange:i,onRemove:s,nodes:a,columnInfo:l}=e;const c=(0,n.useRef)(),d=(0,n.useRef)(),[u,p]=(0,n.useState)(o||[]),h="select"!==(null===l||void 0===l?void 0:l.type);(0,n.useEffect)((()=>{p(o||[])}),[o]);const g=(0,n.useMemo)((()=>(null===a||void 0===a?void 0:a.map((e=>e.id)))||[]),[a]),f=(0,Zo.A)({param:t,paramKey:null===l||void 0===l?void 0:l.paramKey,extraKey:"groupForm",isLabel:null===l||void 0===l?void 0:l.isLabel,labelKey:null===l||void 0===l?void 0:l.labelKey,nodeIds:g,nodes:a}),{isOpen:b,handleToggle:m,handleClose:x,handleCancel:j}=(0,Jo.A)({pendingChangesRef:d}),y=u.length,v=(0,n.useMemo)((()=>{if(0===y)return"No selection";if(1===y){const e=f.find((e=>e.id===u[0]));return e?e.name:u[0]}return"".concat(y," selected")}),[y,u,f]),O=f.length,w=f.filter((e=>e.count>0)).length,P=(0,n.useMemo)((()=>0===O?"":"Labels"===(null===l||void 0===l?void 0:l.category)?"Label: ".concat(l.labelKey," \u2022 ").concat(w," values"):w===O?"".concat(w," values"):"".concat(w," out of ").concat(O," values used")),[O,w,l]),C=(0,n.useCallback)((e=>{p(e),i(e)}),[i]),I=(0,n.useCallback)((e=>{e.stopPropagation(),p([]),i([])}),[i]);return(0,pe.jsx)(Uo.A,{id:t,label:r,triggerRef:c,onToggle:m,isOpen:b,isEnabled:!0,stale:!1,subtitleText:v,isRequired:!1,onRemove:s,onCancel:j,onClose:x,onToggleEnabled:null,isDisabled:!1,selectedCount:y,description:P,onReset:I,resetDisabled:!(null!==u&&void 0!==u&&u.length),canHideZeros:!1,sortAction:null,filteredOptions:f,showActions:!1,children:(0,pe.jsx)(qo.Ay,{ref:d,param:t,baseKey:"groupForm",collection:f,getValue:e=>e.id,getLabel:e=>e.name||e.id,hasSearch:!0,multi:h,placeholder:"Search ".concat(r.toLowerCase(),"..."),searchInputProps:{autoFocus:!0},noResultsMessage:"No ".concat(r.toLowerCase()," found"),itemProps:{multi:h,actualCountLabel:"nodes",stale:!1},extraKey:"groupForm",height:{max:"100%"},resizeable:!1,debounceDelay:0,batchMode:"event",value:u,onBatchApply:C})})})),$o=Xo;var Yo=r(25764),Qo=r(36893),ei=r(64082),ti=r(75687),ri=r(32660);const ni=(0,n.memo)((e=>{let{id:t,label:r,values:n,handleReset:o,min:i,max:s,draftRange:a,currentMin:l,currentMax:c,handleRangeChange:d,step:u,containerWidth:p,unit:h}=e;return(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(ri.A,{id:t,label:r,isEnabled:!0,handleToggleEnabled:null,isDisabled:!1,description:"Range: ".concat(i).concat(h," - ").concat(s).concat(h),onReset:o,resetDisabled:!n||0===n.length,resetTooltip:"Reset to full range"}),(0,pe.jsx)(ce.MultiRangeInput,{min:i,max:s,onChange:d,initMin:a?a[0]:l,initMax:a?a[1]:c,step:u,disabled:!1,padding:[4]},"".concat(t,"-").concat(p))]})})),oi={"hw.cpuFrequency":{getter:e=>{var t;return null===(t=e.hw)||void 0===t?void 0:t.cpuFrequency},unit:" MHz",decimals:2},"hw.cpus":{getter:e=>{var t;return null===(t=e.hw)||void 0===t?void 0:t.cpus},unit:"",decimals:0},"hw.memory":{getter:e=>{var t;return null===(t=e.hw)||void 0===t?void 0:t.memory},unit:" GB",decimals:2},"hw.diskSpace":{getter:e=>{var t;return null===(t=e.hw)||void 0===t?void 0:t.diskSpace},unit:" GB",decimals:2}},ii=(0,n.memo)((e=>{let{id:t,label:r,value:o,onChange:i,onRemove:s,nodes:a}=e;const l=(0,n.useRef)(),c=(0,n.useRef)(),d=(0,n.useRef)(),[u,p]=(0,n.useState)(null),[h,g]=(0,n.useState)(320),f=(0,n.useRef)(null),{min:b,max:m,step:x,decimalPoints:j,unit:y}=(0,n.useMemo)((()=>{const e=oi[t];if(!e||!a||0===a.length)return{min:0,max:100,step:1,decimalPoints:0,unit:""};let r=1/0,n=-1/0;if(a.forEach((t=>{const o=e.getter(t);if(void 0!==o&&null!==o){const e=parseFloat(o);isNaN(e)||(r=Math.min(r,e),n=Math.max(n,e))}})),r===1/0||n===-1/0)return{min:0,max:100,step:1,decimalPoints:0,unit:""};const o=0===e.decimals?1:Math.pow(10,-e.decimals);return{min:Math.floor(r),max:Math.ceil(n),step:o,decimalPoints:e.decimals,unit:e.unit}}),[a,t]),v=o||[],O=void 0!==v[0]?1*v[0]:b,w=void 0!==v[1]?1*v[1]:m,{isOpen:P,handleToggle:C,handleClose:I,handleCancel:A}=(0,Jo.A)({pendingChangesRef:c,onOpen:()=>p(v.length>0?[...v]:null)}),k=(0,n.useCallback)((e=>{let{min:t,max:r}=e;p([t,r])}),[]),S=(0,n.useMemo)((()=>{if(!v||0===v.length)return"Full range";const e=1*v[0],t=1*v[1],r=e=>j>0?e.toFixed(j):e.toString();return"".concat(r(e)).concat(y," - ").concat(r(t)).concat(y)}),[v,j,y]),D=(0,n.useCallback)((()=>{i([])}),[i]);return(0,n.useEffect)((()=>{if(!P||!d.current)return;return f.current=new ResizeObserver((e=>{for(const t of e){const e=t.contentRect.width;Math.abs(e-h)>5&&g(e)}})),f.current.observe(d.current),()=>{f.current&&f.current.disconnect()}}),[P,h]),(0,n.useEffect)((()=>{c.current={hasPendingChanges:u&&(u[0]!==O||u[1]!==w),applyChanges:()=>{u&&(u[0]===b&&u[1]===m?i([]):i(u),p(null))},cancelChanges:()=>{p(null)}}}),[u,O,w,b,m,i]),(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsxs)(Yo.A,{children:[(0,pe.jsx)(Qo.A,{triggerRef:l,onClick:C,testId:"dropdown-filter-".concat(t),isOpen:P,isEnabled:!0,stale:!1,label:r,subtitle:S}),(0,pe.jsx)("div",{className:"remove-button-wrapper",children:(0,pe.jsx)(ti.A,{onRemove:s,tooltip:"Remove ".concat(r," filter")})})]}),(0,pe.jsx)(ei.A,{isOpen:P,targetRef:l.current,onEsc:A,onClickOutside:I,width:{base:"320px",min:"280px",max:"500px"},height:{base:"100px",min:"100px",max:"300px"},wrapperRef:d,children:(0,pe.jsx)(ni,{id:t,label:r,values:v,handleReset:D,min:b,max:m,draftRange:u,currentMin:O,currentMax:w,handleRangeChange:k,step:x,containerWidth:h,unit:y})})]})})),si=ii,ai=(0,n.memo)((e=>{let{nodes:t,value:r=[],onChange:o,onRemove:i}=e;const s=(0,n.useRef)(),a=(0,n.useRef)(),{isOpen:l,handleToggle:c,handleClose:d,handleCancel:u}=(0,Jo.A)({pendingChangesRef:a}),p=(0,n.useMemo)((()=>null!==t&&void 0!==t&&t.length?t.map((e=>({id:e.id,name:e.name||e.id}))):[]),[t]),h=(null===r||void 0===r?void 0:r.length)||0,g=(0,n.useMemo)((()=>{if(0===h)return"No selection";if(1===h){const e=null===t||void 0===t?void 0:t.find((e=>e.id===r[0]));return(null===e||void 0===e?void 0:e.name)||r[0]}return"".concat(h," node").concat(1===h?"":"s"," selected")}),[h,r,t]),f=(0,n.useCallback)((e=>{o(e||[])}),[o]),b=(0,n.useCallback)((e=>{e.stopPropagation(),o([])}),[o]);return null!==r&&void 0!==r&&r.length?(0,pe.jsx)(Uo.A,{id:"selectedNodeIds",label:"Selected Nodes",triggerRef:s,onToggle:c,isOpen:l,isEnabled:!0,stale:!1,subtitleText:g,isRequired:!1,onRemove:i,onCancel:u,onClose:d,onToggleEnabled:null,isDisabled:!1,selectedCount:h,description:"".concat(h||"No"," node").concat(1===h?"":"s"," explicitly selected"),onReset:b,resetDisabled:!(null!==r&&void 0!==r&&r.length),canHideZeros:!1,sortAction:null,filteredOptions:p,showActions:!1,children:(0,pe.jsx)(qo.Ay,{ref:a,param:"selectedNodeIds",baseKey:"groupForm",collection:p,getValue:e=>e.id,getLabel:e=>e.name,hasSearch:!0,multi:!0,placeholder:"Search nodes...",searchInputProps:{autoFocus:!0},noResultsMessage:"No nodes found",itemProps:{multi:!0,actualCountLabel:"selected",stale:!1},extraKey:"groupForm",height:{max:"100%"},resizeable:!1,debounceDelay:0,batchMode:"event",value:r,onBatchApply:f})}):null})),li=ai,ci=["id","onClose","allNodes","tabId","preselectedNodeId"],di=["selectedNodeIds"];function ui(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function pi(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ui(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ui(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const hi=e=>{let{isNew:t}=e;return(0,pe.jsxs)(ce.Flex,{as:"span",gap:1,children:["Manage room",(0,pe.jsx)(ce.TextBig,{color:"textLite",children:"/"}),(0,pe.jsxs)(ce.TextBig,{color:"textLite",children:[t?"Create":"Edit"," Group"]})]})},gi=[{value:"servers",label:"Servers"},{value:"snmp",label:"Network Devices"}],fi=e=>{let{id:t,onClose:r,allNodes:o,tabId:i,preselectedNodeId:s}=e,a=(0,W.A)(e,ci);const l=(0,v.ID)(),c="new"===t,d=(0,Oe.oH)(l,c?null:t),u=(0,Oe.oH)(l,(0,we.b5)(i)?null:i),p=(0,Oe.rK)(l),h=(0,Oe.EP)(l),g=Wo(i),f=(0,n.useMemo)((()=>o.some(we.ZH)),[o]),[b,m]=(0,n.useState)((()=>{if(c){const e=(0,co.AK)(i,u),t=g(),{selectedNodeIds:r}=t,n=(0,W.A)(t,di);let o=r||[];return s&&!o.includes(s)&&(o=[s,...o]),pi(pi({},Mo.$e),{},{filters:n,selectedNodeIds:o,metricsType:e})}return pi(pi({},Mo.$e),d)}));(0,n.useEffect)((()=>{!c&&null!==d&&void 0!==d&&d.id&&m(pi(pi({},Mo.$e),d))}),[c,d]);const{name:x,metricsType:j,filters:y,selectedNodeIds:O}=b,w=f||!c&&"snmp"===j,P=(0,n.useMemo)((()=>(0,St.KN)(y)||(0,St.OS)(O)?o.filter((e=>(0,St.BW)(e,y,O))).length:0),[o,y,O]),C=(0,n.useCallback)((e=>{let{target:{value:t}}=e;t.length<=30&&m((e=>pi(pi({},e),{},{name:t})))}),[]),I=(0,n.useCallback)((e=>{m((t=>pi(pi({},t),{},{metricsType:(null===e||void 0===e?void 0:e.value)||"servers"})))}),[]),A=(0,n.useCallback)((e=>{m((t=>{const r=pi({},t.filters);return delete r[e],pi(pi({},t),{},{filters:r})}))}),[]),k=(0,n.useCallback)(((e,t)=>{m((r=>pi(pi({},r),{},{filters:pi(pi({},r.filters),{},{[e]:t})})))}),[]),S=(0,n.useCallback)((e=>{m((t=>pi(pi({},t),{},{filters:"function"===typeof e?e(t.filters):e})))}),[]),D=(0,n.useCallback)((e=>{m((t=>pi(pi({},t),{},{selectedNodeIds:e||[]})))}),[]),T=(0,n.useCallback)((()=>{m((e=>pi(pi({},e),{},{selectedNodeIds:[]})))}),[]),M=(0,n.useCallback)((async()=>{const e=pi(pi({},b),{},{name:b.name.trim()});c?await p(e):await h(pi(pi({},e),{},{id:t})),r()}),[b,c,t,p,h,r]),F=x.trim().length>0&&((0,St.KN)(y)||(0,St.OS)(O)),N=(0,n.useMemo)((()=>gi.find((e=>e.value===j))||gi[0]),[j]),E=(0,n.useMemo)((()=>Object.entries(y||{})),[y]);return(0,pe.jsxs)(ke.GO,pi(pi({onClose:r},a),{},{children:[(0,pe.jsx)(Se.z,{onClose:r,title:(0,pe.jsx)(hi,{isNew:c}),children:(0,pe.jsx)(ce.Button,{label:"Save",onClick:M,disabled:!F,"data-testid":"groupForm-save"})}),(0,pe.jsx)(De.U,{children:c?"Create a new node group":"Edit node group"}),(0,pe.jsx)(ke.Yv,{children:(0,pe.jsxs)(ce.Flex,{gap:6,column:!0,children:[(0,pe.jsx)(Lo,{title:"Group Name","data-testid":"groupForm-name",children:(0,pe.jsx)(ce.TextInput,{name:"name",placeholder:"Enter group name",value:x,onChange:C})}),w&&(0,pe.jsx)(Lo,{title:"Column Configuration",disclaimer:"Choose which column set to display for nodes in this group","data-testid":"groupForm-metricsType",children:(0,pe.jsx)(ce.Select,{options:gi,value:N,onChange:I,"data-testid":"groupForm-metricsTypeSelect"})}),(0,pe.jsx)(Lo,{title:"Filters",disclaimer:(0,St.KN)(y)||(0,St.OS)(O)?0===P?"No nodes match the current filters":"".concat(P," node").concat(1===P?"":"s"," will appear in this group"):"Add at least one filter to create a group",disclaimerColor:P>0?"accent":"textLite","data-testid":"groupForm-filters",children:(0,pe.jsxs)(ce.Flex,{gap:2,flexWrap:"wrap",alignItems:"center",children:[E.map((e=>{let[t,r]=e;const n=(e=>{if(e.startsWith("label.")){const t=e.replace("label.","");return{name:t,type:"dropdown",isLabel:!0,labelKey:t}}return Ro[e]||{name:e,type:"dropdown"}})(t);return"range"===n.type?(0,pe.jsx)(si,{id:t,label:n.name,value:r,onChange:e=>k(t,e),onRemove:()=>A(t),nodes:o},t):(0,pe.jsx)($o,{id:t,label:n.name,value:r,onChange:e=>k(t,e),onRemove:()=>A(t),nodes:o,columnInfo:n},t)})),(0,pe.jsx)(li,{nodes:o,value:O,onChange:D,onRemove:T}),(0,pe.jsx)(zo,{filters:y,onFiltersChange:S,nodes:o,selectedNodeIds:O,onSelectedNodeIdsChange:D})]})})]})})]}))};function bi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function mi(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?bi(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bi(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const xi=["config"],ji=()=>{const e=(0,y.vt)(),t=(0,v.ID)(),r=(0,B.nj)(),o=(0,ie.Hn)(),i=(0,z.dG)(),s=(0,Oe.Jk)(t),a=(0,co.rK)(i,t),l=(0,n.useMemo)((()=>(0,we.b5)(i)?s.filter((e=>e.metricsType===a)):[]),[s,a,i]),c=Ft(i,l),d=(0,K.Cq)(t,i),u=(0,z.TL)(),p=(0,G.w7)({extraKey:"nodesView-".concat(i),merge:!1,scoped:!0}),h=(0,z.Gt)(),g=(0,co.On)(i,t),f=(0,n.useMemo)((()=>h.reduce(((e,t)=>(g(t)||e.push(t.id),e)),[])),[g,h]),b=(0,z.Y7)(),[m,{width:x}]=(0,H.A)(),j=(0,se.K)({spaceId:e,roomId:t}),[O,w,P]=oe(p,t,{shouldHide:vt.f9?g:void 0,cacheKey:i,extraKey:"nodesView-".concat(i)});!function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],{host:r,width:o,tabId:i="servers",flavour:s="nodesView"}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const a=(0,Vr.eg)(),l=(0,n.useMemo)((()=>{if(!a)return;let n=Gr(a,e);if(n)return n;o&&(n=a.makeContainer({attributes:{host:r,enabledXAxis:!1,id:"nodes-".concat(e),height:"75px",groupingMethod:"average",groupBy:["dimension"],aggregationMethod:"avg",legend:!1,axisLabelFontSize:7,yAxisLabelWidth:20,hasYlabel:!1,nodesScope:t,containerWidth:o}}),a.appendChild(n))}),[e,i,o]),{favoriteNodeIds:c}=zr(s,i),d=(0,Me.vh)(e,i);(0,n.useMemo)((()=>{if(!vt.f9)return;if(!l||(null===t||void 0===t||!t.length)&&(null===c||void 0===c||!c.length))return;const e=d.reduce(((e,t)=>{if(!t.context)return e;const r=t.aggregation||"sum";return e[r]||(e[r]=new Set),e[r].add(t.context),e}),{});[...t,...c].forEach((t=>{Object.entries(e).forEach((e=>{var r;let[n,o]=e;const i="table-metrics-".concat(t,"-").concat(n);let s=l.getNode({id:i});if(s&&(c=new Set(s.getAttribute("contextScope")),d=o,c.size===d.size&&[...c].every((e=>d.has(e)))))return;var c,d;null===(r=s)||void 0===r||r.destroy();const u=Array.from(o);0!==u.length&&(s=a.makeChart({attributes:{id:i,contextScope:u,nodesScope:[t],aggregationMethod:n,groupingMethod:"average",groupBy:["label","dimension","context","node"],groupByLabel:["device"],tableColumns:["context","dimension"],chartLibrary:"table",points:1}}),l.appendChild(s))}))})),a.trigger("nodesContainerUpdated")}),[l,t,c,r,a,i,o,d])}(t,O,{host:j,width:x,tabId:i,flavour:"nodesView"});const[C,I]=(0,U.N9)("nodeIdToGo",{key:t,extraKey:"nodesView",flavour:"val"}),A=(0,n.useCallback)((e=>{u(e)}),[u]),[k,S]=(0,n.useState)(null),[D,T]=(0,n.useState)(null),M=(0,n.useCallback)((()=>{T(null),S("new")}),[]),F=(0,n.useCallback)((e=>{T(e),S("new")}),[]),N=(0,n.useCallback)((e=>{T(null),S(e)}),[]),E=(0,n.useCallback)((()=>{S(null),T(null)}),[]),L=(0,n.useCallback)((function(e,t){return Pt(e,t,mi(mi({},arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}),{},{searchScores:w}))}),[w]);return(0,pe.jsx)(ae.A,{getObject:b,ids:O,getMenu:L,getGrouping:c,groupMode:d,deps:[c,w,i,d,l],extraKey:"nodesView",children:(0,pe.jsx)(_.A,{ref:m,position:"relative",sidebar:(0,pe.jsx)(le.Ay,{hiddenTabs:xi,nodeIds:f,title:"Nodes",initialChartName:C,viewFlavour:"nodesView",flavour:"nodesView-".concat(i),loaded:!0,FilterInputContainer:xe,extraKey:"nodesView-".concat(i)}),children:!!x&&(0,pe.jsxs)(pe.Fragment,{children:[!vt.f9&&(0,pe.jsx)(xt,{}),!vt.f9&&r&&!O.length&&p.length?(0,pe.jsx)(ve,{}):vt.f9&&o?(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsxs)(Do,{allNodes:h,activeTabId:i,onTabChange:A,nodesCount:P,onCreateGroup:M,onEditGroup:N,children:[(0,pe.jsx)(To,{tabId:i,filteredIds:O,totalCount:P}),(0,pe.jsx)(mo,{nodeIdsLoaded:r,nodeIds:O,tabNodeIds:f,initialChartName:C,onChartNameChange:I,tabId:i,flavour:"nodesView",onCreateGroup:M,onCreateGroupWithNode:F,matchingGroups:l})]}),vt.xH&&k&&(0,pe.jsx)(fi,{id:k,onClose:E,allNodes:h,tabId:i,preselectedNodeId:D})]}):(0,pe.jsx)(fn,{initialChartName:C,onChartNameChange:I})]})})})},yi=()=>{const e=(0,v.ID)(),t=(0,B.CK)();return(0,B.gr)(e,"loaded")&&!t.length?(0,pe.jsx)(V.Ay,{feature:"NodesView",mode:"NoNodesView",children:(0,pe.jsx)(R.A,{})}):(0,pe.jsx)(V.Ay,{feature:"NodesView",children:(0,pe.jsx)(ji,{})})},vi=()=>{const e=(0,z.nl)(),t=(0,z.xY)(e,"name");return(0,S.ZB)({title:t,id:e,destination:e,tooltip:{title:t,description:"Monitor and analyze metrics, alerts, and performance for this specific node in your infrastructure."}}),null};var Oi=r(258);function wi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Pi(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?wi(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wi(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ci=r(98545),Ii=r(6196),Ai=r(1705),ki=r(2626),Si=r(41716),Di=r(65448);function Ti(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Mi(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ti(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ti(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Fi=function(e,t){let{polling:r=!0}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const o=(0,m.yF)((0,n.useCallback)((function(e,r){let{data:n=[]}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r((0,Si.t)({id:t,key:"ids"}),n.map((e=>e.id))),r((0,Si.t)({id:t,key:"loaded"}),!0),r((0,Si.t)({id:t,key:"updatedAt"}),(new Date).toISOString()),r((0,Si.t)({id:t,key:"error"}),null),r(Ii.Ay,(e=>n.reduce(((e,t)=>(e[t.id]=Mi(Mi({},e[t.id]),{},{loaded:!0},t),e)),e)));const o=n.reduce(((e,t)=>{let{id:r,nodeId:n}=t;return e[n]=[...e[n]||[],r],e}),{});r(ki.l3,o)}),[e,t])),i=(0,m.yF)((0,n.useCallback)(((e,r,n)=>{r((0,Si.t)({id:t,key:"error"}),(0,Di.A)(n))}),[]));(0,j.A)((()=>({enabled:!!e&&!!t,polling:r,pollingOptions:{checkPauseCondition:M},fetch:()=>(0,Ai.l1)(e,t),onFail:i,onReceive:o,force:!0})),[e,t])};function Ni(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ei(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ni(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ni(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Li=function(e,t){let{polling:r=!0}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const o=(0,m.yF)((0,n.useCallback)((function(r,n){let{data:o=[]}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n((0,Ii.xz)({spaceId:e,roomId:t}),(e=>Ei(Ei({},e),{},{loaded:!0,value:o,updatedAt:(new Date).toISOString(),error:null})))}),[e,t])),i=(0,m.yF)((0,n.useCallback)(((r,n,o)=>{n((0,Ii.xz)({spaceId:e,roomId:t}),(e=>Ei(Ei({},e),{},{loaded:!0,error:(0,Di.A)(o)})))}),[]));(0,j.A)((()=>({enabled:!!e&&!!t,polling:r,pollingOptions:{checkPauseCondition:M},fetch:()=>(0,Ai.qM)(e,t),onFail:i,onReceive:o,force:!0})),[e,t])};var Bi=r(6387),Ri=r(65380);const Vi=["container"];function Hi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Hi(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Hi(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Ki=e=>t=>"histogram::".concat(e.getAttribute("id"),"::").concat(t),zi=e=>{let{container:t}=e,r=(0,W.A)(e,Vi);const o=(0,Vr.eg)(),i=(0,n.useMemo)((()=>{if(!t)return null;let e=t.getNode({id:"dummy-chart"});return e||(e=o.makeChart({attributes:{id:"dummy-chart",chartLibrary:"dygraph",sparkline:!0,hasToolbox:!1,hasHoverPopover:!1,contextScope:["anomaly_detection.anomaly_rate"],aggregationMethod:"max",postAggregationMethod:"max",postgroupBy:["selected"],showPostAggregations:!0,groupingMethod:"max",expandable:!1,chartType:"stacked",colors:[["#DBE1E1","#353F3F"]],showAnomalies:!1,showAnnotations:!1,overlays:{latestTime:{type:"latestTime"}}},makeTrack:Ki}),t.appendChild(e),e)}),[t]);return(0,n.useEffect)((()=>()=>i&&i.destroy()),[i]),(0,pe.jsx)(ce.Flex,{flex:!1,width:"100%",height:5,position:"sticky",bottom:"0",left:"0",right:"0",children:(0,pe.jsx)(Ur.A,_i(_i({"data-chartid":"dummy-chart",chart:i,overflow:"hidden",hasHeader:!1,hasFooter:!1,hasFilters:!1,tile:!1},r),{},{round:0}))})};var Gi=r(55093),Wi=r(77148),qi=r(38773);const Ui=()=>(0,pe.jsxs)(ce.Flex,{padding:[6],round:1,width:"600px",background:"modalInfoBackground",children:[(0,pe.jsx)(ce.Box,{margin:[0,4,0,0],children:(0,pe.jsx)(ce.Box,{as:ce.Icon,width:10,height:10,name:"nodes_update"})}),(0,pe.jsxs)(ce.Flex,{column:!0,gap:2,children:[(0,pe.jsx)(ce.Text,{strong:!0,children:"Couldn't find the chart you were looking for? "}),(0,pe.jsxs)(ce.Text,{color:"textDescription",children:["Netdata has zero-configuration auto-detection for most applications and systems, this is achieved using collectors. If you miss some specific chart please check our"," ",(0,pe.jsx)(je.A,{href:"https://learn.netdata.cloud/docs/agent/collectors",target:"_blank","data-ga":"chart-area::click-link-collectors::charts-view",children:"list of collectors"})," ","to see if any additional step is needed."]})]})]}),Ji=()=>(0,pe.jsxs)(ce.Flex,{width:"100%",column:!0,gap:6,margin:[8,0,0,0],children:[(0,pe.jsx)(Wi.A,{}),(0,pe.jsxs)(ce.Flex,{gap:1,alignItems:"center",justifyContent:"center",padding:[2],background:"successSemi",children:[(0,pe.jsx)(Hn.A,{children:(0,pe.jsx)(ce.Text,{color:"primary",children:"Upgrade to Business for unlimited access"})}),(0,pe.jsx)(ce.Text,{children:"or"}),(0,pe.jsx)(qi.A,{children:(0,pe.jsx)(ce.Text,{color:"primary",children:"review your Space active Nodes"})})]})]}),Zi=e=>{let{noPreferredNodesError:t,children:r}=e;return(0,pe.jsxs)(ce.Flex,{column:!0,flex:!0,justifyContent:"center",alignItems:"center",alignSelf:"center",children:[(0,pe.jsxs)(ce.Flex,{column:!0,justifyContent:"center",alignItems:"center",width:"300px",margin:[0,0,6],children:[(0,pe.jsx)(ce.H3,{margin:[0,0,4],children:"No charts to display"}),(0,pe.jsx)(ce.Text,{color:"textDescription",textAlign:"center",children:"Double-check your search or filters and dates and try again with different conditions."})]}),(0,pe.jsx)(Ui,{}),t&&(0,pe.jsx)(Ji,{}),r]})};var Xi=r(93997);const $i=()=>{const[e,t]=(0,Xi.sK)(),r=(0,v.ID)(),o=(0,y.vt)(),i=(0,G.w7)(),s=(0,n.useCallback)((0,ge.s)(300,(e=>{const n=e.target.value;t(n),(0,de.H)("toc-search","search-automatic-trigger","charts-view",n),n&&(0,Oi.Xx)(r,n,{selectedNodes:i,spaceId:o}).then((e=>{console.log("Context search results:",e)})).catch((e=>{console.error("Context search error:",e)}))})),[r,o,i]),[a,l,,,{resetValue:c}]=(0,ce.useInputValue)({value:e,onChange:s}),d=(0,n.useCallback)((()=>{t(""),c(),(0,de.H)("toc-search","clear-search-button","charts-view")}),[]);return(0,pe.jsx)(ce.TextInput,{value:a,onChange:l,size:"small",iconRight:a&&(0,pe.jsx)(ce.Icon,{name:"x",color:"textLite",cursor:"pointer",size:"small",onClick:d,"data-testid":"filterChartsInput-clearButton"}),placeholder:"Search charts",name:"Search charts","data-testid":"filterChartsInput",containerStyles:{width:"100%"}})};var Yi=r(61841);const Qi=(0,ge.s)(300,((e,t)=>(0,de.H)("toc-search","search-results","charts-view",e,"".concat(t," -- charts")))),es=()=>{const e=(0,x.Zp)(),[t]=(0,Yi.Ay)(),r=(0,Xi.Um)(),{filteredChartsCount:o,chartsCount:i}=(0,Xi.Ad)();(0,n.useEffect)((()=>{r&&Qi(r,o)}),[r,o]);const s=(0,n.useCallback)((r=>{r.preventDefault(),e("/spaces/".concat(t,"/settings/configurations"),{replace:!0})}),[t,e]);return(0,pe.jsxs)(ce.Flex,{alignItems:"center",justifyContent:"between",width:"100%",children:[(0,pe.jsxs)(ce.TextMicro,{color:"textLite",margin:[1,0,0],"data-testid":"numberOfChartsIndication",children:["Showing"," ",(0,pe.jsx)(ce.TextMicro,{strong:!0,color:"textDescription","data-testid":"numberOfChartsIndication-filteredChartsCount",children:o})," ","of total"," ",(0,pe.jsx)(ce.TextMicro,{strong:!0,color:"textDescription","data-testid":"numberOfChartsIndication-chartsCount",children:i})," ","charts"]}),(0,pe.jsx)(je.A,{Component:ce.TextMicro,margin:[1,0,0],"data-ga":"toc-search::click-link-collectors::".concat(name),onClick:s,target:"_blank",rel:"noopener noreferrer",children:"Add more charts"})]})},ts=()=>{const{filteredChartsCount:e}=(0,Xi.Ad)();return e||null===e?null:(0,pe.jsxs)(ce.Flex,{width:"100%",gap:1,margin:[4,0,0],padding:[2],alignItems:"center","data-testid":"noResultsWereFound",children:[(0,pe.jsx)(ce.Icon,{name:"information",color:"textDescription"}),(0,pe.jsx)(ce.TextMicro,{strong:!0,color:"textDescription",children:"No results were found"})]})};var rs=r(14512);const ns=()=>(0,pe.jsxs)(ce.Flex,{column:!0,alignItems:"center",children:[(0,pe.jsx)($i,{}),(0,pe.jsx)(es,{}),(0,pe.jsx)(rs.A,{}),(0,pe.jsx)(ts,{})]}),os=["width","height","videoId"];function is(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ss(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?is(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):is(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const as=e=>{let{width:t=443,height:r=249,videoId:n}=e,o=(0,W.A)(e,os);return(0,pe.jsx)(ce.Flex,ss(ss({},o),{},{children:(0,pe.jsx)(ce.Box,{className:"video-responsive",children:(0,pe.jsx)("iframe",{width:t,height:r,src:"https://www.youtube.com/embed/".concat(n),frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,title:"Embedded youtube"})})}))};var ls=r(58218),cs=r(14815);const ds=()=>{const e=(0,v.ID)(),t=(0,g.JT)("node:Create");return(0,pe.jsxs)(_.A,{column:!1,"data-testid":"noNodesViewPage",gap:12,padding:[6],children:[(0,pe.jsxs)(ce.Flex,{column:!0,gap:5,flex:{shrink:0,grow:0},"data-testid":"noKubernetesView-videoSection",children:[(0,pe.jsx)(as,{"data-testid":"noNodesView-onboardingVideo",height:350,width:850,videoId:_e.BX[0]}),(0,pe.jsx)(as,{"data-testid":"noNodesView-onboardingVideo",height:350,width:850,videoId:_e.BX[1]})]}),(0,pe.jsxs)(ce.Flex,{column:!0,gap:4,children:[(0,pe.jsxs)(ce.Box,{border:{side:"bottom",color:"borderSecondary"},children:[(0,pe.jsx)(ce.Box,{margin:[0,0,2,0],children:(0,pe.jsx)(je.A,{href:"https://learn.netdata.cloud/docs/netdata-agent/installation/kubernetes",target:"_blank",rel:"noopener noreferrer","data-ga":"k8s-tab::click-link-guides::kubernetes-overview-and-visualizations",children:(0,pe.jsx)(ce.TextBig,{color:"primary",children:"Kubernetes monitoring with Netdata: Overview and visualizations"})})}),(0,pe.jsx)(ce.Box,{margin:[0,0,2,0],children:(0,pe.jsx)(je.A,{href:"https://learn.netdata.cloud/docs/dashboards-and-charts/kubernetes-tab",target:"_blank",rel:"noopener noreferrer","data-ga":"k8s-tab::click-link-guides::kubernetes-visualizations",children:(0,pe.jsx)(ce.TextBig,{color:"primary",children:"Kubernetes visualizations"})})})]}),(0,pe.jsx)(ce.Flex,{column:!0,gap:4,children:t?(0,pe.jsx)(ls.A,{integrationId:cs.v2,rooms:[e]}):(0,pe.jsx)(R.S,{})})]})]})};var us=r(67012),ps=r(77611);const hs=jn.default.div.withConfig({displayName:"selections__Separator",componentId:"sc-1cc7y18-0"})(["width:1px;height:",";background:",";"],(0,ce.getSizeBy)(2.5),(0,ce.getColor)("borderSecondary")),gs=[{label:"Volume",value:"volume"},{label:"KS2",value:"ks2"}],fs=[{label:"Average",value:"average"},{label:"Median",value:"median"},{label:"Min",value:"min"},{label:"Max",value:"max"},{label:"Stddev",value:"stddev"}],bs=[{label:"Metrics",value:""},{label:"Anomaly Rate",value:"anomaly-bit"}],ms=()=>(0,pe.jsxs)(ce.Flex,{column:!0,gap:1,alignItems:"center",width:"220px",children:[(0,pe.jsx)(ce.TextMicro,{children:"Choose the algorithm you want to be used to identify correlations across metrics:"}),(0,pe.jsxs)(ce.TextMicro,{children:[(0,pe.jsx)(ce.TextMicro,{strong:!0,children:"KS2:"})," A statistical test comparing the distribution of the highlighted window to the baseline."]}),(0,pe.jsxs)(ce.TextMicro,{children:[(0,pe.jsx)(ce.TextMicro,{strong:!0,children:"Volume:"})," Percentage change in averages between highlighted window and baseline."]})]}),xs=()=>(0,pe.jsx)(ce.Flex,{column:!0,gap:1,alignItems:"center",width:"220px",children:(0,pe.jsx)(ce.TextMicro,{children:"What aggregation function do you want to apply when aggregating multiple datapoints for metric correlations."})}),js=()=>(0,pe.jsx)(ce.Flex,{column:!0,gap:1,alignItems:"center",width:"220px",children:(0,pe.jsx)(ce.TextMicro,{children:"Do you want to find correlations over the metric values or the anomaly rates of each metric."})}),ys=e=>{let{runGetWeights:t,nodeIds:r,flavour:o}=e;const{method:i,options:s,group:a}=(0,ps.G9)({nodeIds:r,flavour:o}),l=null!==s&&void 0!==s&&s.includes(bs[1].value)?bs[1].value:"",c=(0,n.useCallback)((e=>r=>{let{value:n}=r;n="options"!==e?n:n?[n]:[];t({method:i,options:[s],group:a,[e]:n})}),[i,s,a]),d=(0,n.useMemo)((()=>({method:gs.find((e=>e.value===i)),group:fs.find((e=>e.value===a)),option:bs.find((e=>e.value===l))})),[i,a,l]);return a?(0,pe.jsxs)(ce.Flex,{gap:2,children:[(0,pe.jsxs)(ce.Flex,{gap:1,alignItems:"center",children:[(0,pe.jsx)(ce.TextSmall,{color:"textLite",children:"Method:"}),(0,pe.jsx)(ce.Select,{options:gs,value:d.method,onChange:c("method")}),(0,pe.jsx)(tt.A,{isBasic:!0,plain:!0,content:ms,align:"bottom",children:(0,pe.jsx)(ce.Icon,{name:"information",color:"textDescription",size:"small"})})]}),(0,pe.jsx)(hs,{}),(0,pe.jsxs)(ce.Flex,{gap:1,alignItems:"center",children:[(0,pe.jsx)(ce.TextSmall,{color:"textLite",children:"Aggregation:"}),(0,pe.jsx)(ce.Select,{options:fs,value:d.group,onChange:c("group")}),(0,pe.jsx)(tt.A,{isBasic:!0,plain:!0,content:xs,align:"bottom",children:(0,pe.jsx)(ce.Icon,{name:"information",color:"textDescription",size:"small"})})]}),(0,pe.jsx)(hs,{}),(0,pe.jsxs)(ce.Flex,{gap:1,alignItems:"center",children:[(0,pe.jsx)(ce.TextSmall,{color:"textLite",children:"Data:"}),(0,pe.jsx)(ce.Select,{options:bs,value:d.option,onChange:c("options")}),(0,pe.jsx)(tt.A,{isBasic:!0,plain:!0,content:js,align:"bottom",children:(0,pe.jsx)(ce.Icon,{name:"information",color:"textDescription",size:"small"})})]}),(0,pe.jsx)(hs,{})]}):null};var vs=r(64587);const Os=e=>{let{highlightAfter:t,highlightBefore:r,baseline:n}=e;const{localeDateString:o,localeTimeString:i}=(0,vs.$j)(),s=new Date(t),a=new Date(r),l=new Date(n),c=new Date(t),d=Math.round((r-t)/1e3),u=Math.round((t-n)/1e3),p=(0,U.rI)("highlight");return(0,pe.jsxs)(ce.Flex,{gap:4,alignItems:"center",children:[(0,pe.jsxs)(ce.Flex,{gap:2,children:[(0,pe.jsxs)(ce.Flex,{column:!0,gap:1,children:[(0,pe.jsx)(ce.TextSmall,{color:"textLite",children:"Selected area:"}),(0,pe.jsx)(ce.TextSmall,{color:"textLite",children:"Reference baseline:"})]}),(0,pe.jsxs)(ce.Flex,{column:!0,gap:1,children:[(0,pe.jsxs)(ce.TextSmall,{"data-testid":"metricCorrelation-selectedArea",children:[o(s,{long:!1}),","," ",i(s),"\xa0->\xa0",o(a,{long:!1}),","," ",i(a)]}),(0,pe.jsxs)(ce.TextSmall,{"data-testid":"metricCorrelation-referenceBaseline",children:[o(l,{long:!1}),","," ",i(l),"\xa0->\xa0",o(c,{long:!1}),","," ",i(c)]})]}),(0,pe.jsxs)(ce.Flex,{column:!0,gap:1,children:[(0,pe.jsx)(ce.TextSmall,{color:"textLite",children:"Duration:"}),(0,pe.jsx)(ce.TextSmall,{color:"textLite",children:"Duration:"})]}),(0,pe.jsxs)(ce.Flex,{column:!0,gap:1,children:[(0,pe.jsxs)(ce.TextSmall,{"data-testid":"metricCorrelation-selecteArea-duration",children:[d,"\xa0secs"]}),(0,pe.jsxs)(ce.TextSmall,{"data-testid":"metricCorrelation-referenceBaseline-duration",children:[u,"\xa0secs"]})]})]}),(0,pe.jsx)(tt.A,{content:"Clear selection",align:"bottom",isBasic:!0,children:(0,pe.jsx)(ce.Button,{neutral:!0,flavour:"borderless",icon:"trashcan",onClick:()=>{p({after:null,before:null})},"data-ga":"metric-correlation::click-delete::charts-view","data-testid":"metricCorrelation-delete"})})]})};function ws(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}const Ps=(0,ht.A)(ce.Button),Cs=(0,jn.default)(ce.Button).withConfig({displayName:"correlation__LogoButton",componentId:"sc-15d72m3-0"})(["&&{pointer-events:none;}"]),Is=(0,jn.default)(ce.Button).withConfig({displayName:"correlation__CloseButton",componentId:"sc-15d72m3-1"})(["position:absolute !important;top:-3px;right:-3px;"]),As=(0,ht.A)(Is),ks=(0,jn.default)(ce.Button).attrs({padding:[0],margin:[0,0,0,1.5],width:"auto"}).withConfig({displayName:"correlation__StyledButton",componentId:"sc-15d72m3-2"})(["height:16px !important;> span{margin:0 !important;}"]),Ss=e=>{let{flavour:t}=e;const r=(0,y.vt)(),o=(0,v.ID)(),i=(0,z.nl)(),s=(0,n.useMemo)((()=>i?[i]:[]),[i]),a=(0,G.w7)({extraKey:"nodesView",merge:!1,scoped:!0}),l="singleNode"===t?s:a,[c,d]=(0,n.useState)(!1),[u,p]=(0,n.useState)(),{threshold:h,totalDimensionsCount:g,dimensionsCount:f,loaded:m,loading:x,getWeights:j,resetWeights:O}=(0,ps.Yy)({nodeIds:l,flavour:t},r,o),{method:w,options:P,group:C}=(0,ps.G9)({nodeIds:l,flavour:t}),{after:I,before:A}=(0,U.rW)("highlight"),k=I-4*(A-I),S=!!I;(0,n.useEffect)((()=>{if(m){let e="default-result";if(C){const t=null!==P&&void 0!==P&&P.includes("anomaly-bit")?"anomaly-bit":"metrics";e="default-result-".concat(w,"-").concat(C,"-").concat(t)}return(0,de.H)("metrics-correlation",e,"charts-view",f.toString())}}),[m]),(0,us.A)((()=>{I&&d(!0)}),[I]);const D=(0,U.rI)("correlation"),T=(0,U.rI)("threshold"),M=(0,U.rI)("highlight"),F=(0,n.useCallback)((()=>{D(!1),M({after:null,before:null}),T(ps.UG),O(),(0,de.H)("metrics-correlation","click-close","charts-view","".concat(m?"finish":"start"))}),[D,M,T,O,m]),N=(0,n.useCallback)((()=>{T(ps.UG),O(),(0,de.H)("metrics-correlation","click-delete","charts-view","".concat(m?"finish":"start"))}),[T,O,m]),E=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};d(!1),p(),j(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ws(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ws(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({highlightAfter:I,highlightBefore:A,baselineAfter:k,baselineBefore:I,method:w,options:P,group:C,nodeIds:l},e)).then((()=>T(ps.UG)))},L=!S||x;return(0,us.A)((()=>{m&&c&&S&&E()}),[m,S,c]),(0,n.useEffect)((()=>()=>O()),[]),(0,pe.jsxs)(ce.Flex,{round:2,background:"elementBackground",padding:[2,6,2,2],margin:[2,0],alignItems:"center",justifyContent:"between",flex:!0,"data-testid":"correlation",position:"relative",height:{min:"64px"},gap:2,children:[S?m?(0,pe.jsx)(V._0,{feature:"MetricCorrelations",totalDimensionsCount:g,dimensionsCount:f,children:(0,pe.jsxs)(ce.Flex,{"data-testid":"metricCorrelation-resultsContainer",column:!0,width:"100%",children:[(0,pe.jsxs)(ce.Flex,{justifyContent:"between",alignItems:"center",gap:1,children:[(0,pe.jsxs)(ce.Flex,{alignItems:"center",gap:1,children:[(0,pe.jsx)(ce.Icon,{name:"correlation",color:"primary",width:"16px",height:"16px"}),(0,pe.jsxs)(ce.TextSmall,{children:["Analysed"," ",(0,pe.jsx)(ce.TextSmall,{color:"primary","data-testid":"metricCorrelation-resultsAnalyzed",children:g})," ","and found"," ",(0,pe.jsx)(ce.TextSmall,{color:"primary","data-testid":"metricCorrelation-resultsFound",children:f})," ","correlated metrics."]}),(0,pe.jsx)(tt.A,{content:"Clear results",children:(0,pe.jsx)(ks,{flavour:"borderless",neutral:!0,disabled:x||!m&&!S,onClick:N,"data-testid":"metricCorrelation-clear",small:!0,icon:"reload"})})]}),(0,pe.jsx)(ys,{runGetWeights:E,nodeIds:l,flavour:t})]}),(0,pe.jsxs)(ce.Flex,{width:"100%",children:[(0,pe.jsxs)(ce.Flex,{alignItems:"center",gap:3,margin:[0,2,0,5],width:"100%",children:[(0,pe.jsx)(ce.TextNano,{whiteSpace:"nowrap",color:"textDescription",children:"Show less"}),(0,pe.jsx)(ce.InputRange,{"data-testid":"metricCorrelation-resultsSlider",min:0,max:1,onChange:e=>T(e.target.value.toString()),onClick:()=>(0,de.H)("metric-correlation","click-slider","charts-view"),step:.01,value:h}),(0,pe.jsx)(ce.TextNano,{whiteSpace:"nowrap",color:"textDescription",children:"Show more"})]}),(0,pe.jsx)(pe.Fragment,{children:(0,pe.jsx)(tt.A,{content:"Give us your feedback! Was it useful?",align:"bottom",enterDelay:200,showArrow:!0,activateOn:"hover",children:(0,pe.jsxs)(ce.Flex,{children:[(0,pe.jsx)(ce.Button,{flavour:"+"===u?"hollow":"borderless",disabled:u,icon:"thumb_up",onClick:()=>p("+"),"data-ga":"metric-correlation::click-thumbs-up::charts-view","data-testid":"metricCorrelation-thumbsUp",small:!0}),(0,pe.jsx)(ce.Button,{flavour:"-"===u?"hollow":"borderless",disabled:u,icon:"thumb_down",onClick:()=>p("-"),"data-ga":"metric-correlation::click-thumbs-down::charts-view","data-testid":"metricCorrelation-thumbsDown",small:!0})]})})})]})]})}):(0,pe.jsxs)(ce.Flex,{alignItems:"center","data-testid":"correlationView-timePeriod-container",gap:4,children:[(0,pe.jsx)(Cs,{icon:"logo_s",isLoading:x}),x?(0,pe.jsx)(ce.H5,{"data-testid":"metricCorrelation-loadingCalculation",children:"Calculating metric correlations..."}):(0,pe.jsx)(Os,{highlightAfter:I,highlightBefore:A,baseline:k})]}):(0,pe.jsxs)(ce.Flex,{alignItems:"center",gap:1,children:[(0,pe.jsx)(ce.Icon,{name:"correlation",color:"primary"}),(0,pe.jsx)(ce.Text,{children:"Select a timeframe on any chart and find correlated metrics. Visit documentation"}),(0,pe.jsx)("a",{href:"https://learn.netdata.cloud/docs/cloud/insights/metric-correlations",target:"_blank",rel:"noreferrer",children:(0,pe.jsx)(ce.Icon,{name:"nav_arrow_goto",color:"primary",width:"12px",height:"12px"})})]}),(0,pe.jsxs)(ce.Flex,{alignItems:"center",children:[(!m||x)&&(0,pe.jsx)(tt.A,{content:L?"Select an area of interest on any chart":"Click to find correlated metrics for the selected area",align:"bottom",enterDelay:200,showArrow:!0,activateOn:"hover",children:(0,pe.jsx)(Ps,{label:x?"Loading...":"Find correlations",isLoading:!1,onClick:E,disabled:L,flavour:"hollow","data-ga":"metric-correlation::click-find-correlation::charts-view","data-testid":"metricCorrelation-find",small:!0,margin:[0,2,0,0],feature:"MetricCorrelations"})}),(0,pe.jsx)(tt.A,{content:"Close",align:"bottom",children:(0,pe.jsx)(As,{neutral:!0,flavour:"borderless",onClick:F,"data-ga":"metric-correlation::click-close::charts-view","data-testid":"metricCorrelation-close",icon:"x",feature:"MetricCorrelations"})})]})]})},Ds=e=>{let{children:t}=e;return(0,pe.jsxs)(ce.Flex,{"data-testid":"selected-nodes-container",gap:1,alignItems:"center",width:"100%",children:[(0,pe.jsx)(ce.Flex,{alignItems:"center",children:(0,pe.jsx)(ce.TextSmall,{whiteSpace:"nowrap","data-testid":"selected-nodes-container-message",color:"primary",children:"Selected filters:"})}),(0,pe.jsx)(ce.Flex,{height:{max:50},overflow:{vertical:"auto"},padding:[1],gap:1,alignItems:"center",flexWrap:!0,children:t})]})},Ts=(0,n.memo)(Ds),Ms=e=>{let{onRemove:t}=e;return(0,pe.jsx)(ce.Box,{"data-testid":"remove-button",as:ce.Icon,name:"close_circle",onClick:t,cursor:"pointer",width:3,height:3,color:"textLite"})},Fs=e=>{let{removeFilter:t,group:r,id:n,value:o,isAnchorDisabled:i,onClick:s,ref:a}=e;const[l,c]=o.split("|"),d=c?"".concat(l," > ").concat(c):l;return(0,pe.jsx)(ce.Flex,{ref:a,"data-testid":"selected-node-item-".concat(n),children:(0,pe.jsx)(ce.Pill,{flavour:"neutral",hollow:!0,children:(0,pe.jsxs)(ce.Flex,{position:"relative",gap:2,alignItems:"center",children:[s?(0,pe.jsx)(je.A,{Component:ce.TextSmall,disabled:i,onClick:s,cursor:"pointer",color:"text",hoverColor:"primary",visitedColor:"accent",disabledColor:"textLite",children:d}):(0,pe.jsx)(ce.TextSmall,{children:d}),(0,pe.jsx)(Ms,{onRemove:()=>t({param:r,removedValue:n}),id:n})]})})})},Ns=(0,n.memo)(Fs),Es={selectedNodeIds:"Node",nodeStatuses:"Status",nodeLabels:"Host label",nodeCapabilities:"Capability",nodeVersions:"Version"},Ls=e=>{let{group:t,subGroup:r,groupLabel:o,values:i,filtersByLabel:s={},hasUnion:a,union:l="AND",removeFilter:c,Component:d=Ns}=e;const u=o||Es[t];if(!Array.isArray(i)||!i.length)return null;const p="nodeLabels"!==t||r?{}:s,h=Object.entries(p);return h.length?h.map(((e,r)=>{let[n,o]=e;return(0,pe.jsx)(Ls,{group:t,subGroup:n,groupLabel:"".concat(Es[t]," ").concat(n),values:o,hasUnion:r>0,removeFilter:c},r)})):(0,pe.jsxs)(n.Fragment,{children:[a&&(0,pe.jsx)(ce.TextSmall,{strong:!0,children:l}),(0,pe.jsxs)(ce.Pill,{flavour:"neutral",hollow:!0,gap:1,TextComponent:ce.Flex,textProps:{alignItems:"center",gap:1},flexWrap:!0,children:[(0,pe.jsxs)(ce.TextNano,{strong:!0,children:[u,":"]}),i.map(((e,o)=>(0,pe.jsxs)(n.Fragment,{children:[o>0&&(0,pe.jsx)(ce.TextSmall,{strong:!0,children:"OR"}),(0,pe.jsx)(d,{removeFilter:c,id:r?"".concat(r,"|").concat(e):e,value:e,group:t})]},e)))]})]},"filter")},Bs=e=>{let{removeFilter:t,value:r,ref:n}=e;const o=(0,z.xY)(r,"name"),i=(0,z.xY)(r,"isOffline"),s=(0,z.d3)(r);return(0,pe.jsx)(Ns,{ref:n,removeFilter:t,group:"selectedNodeIds",id:r,value:o,isAnchorDisabled:i,onClick:s})},Rs=(0,n.memo)((e=>{let{flavour:t}=e;const[[r,n=[]],o]=(0,G._e)({extraKey:t,merge:!1});if(!r.length&&!n.length)return(0,pe.jsx)("div",{});const i=(0,G.Pt)(r);return(0,pe.jsx)(ce.Flex,{width:"100%",overflow:"hidden",padding:[2,0],children:(0,pe.jsxs)(Ts,{children:[r.map(((e,t)=>{let[r,n]=e;return(0,pe.jsx)(Ls,{group:r,values:n,filtersByLabel:i,hasUnion:t>0,removeFilter:o},r)})),(0,pe.jsx)(Ls,{group:"selectedNodeIds",values:n,hasUnion:!!r.length&&!!n.length,union:"OR",removeFilter:o,Component:Bs})]})})}));var Vs=r(88434);const Hs=["flavour"];function _s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ks(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_s(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const zs={overview:Rs,default:null},Gs=(0,n.memo)((e=>{let{flavour:t}=e,r=(0,W.A)(e,Hs);const{showCorrelation:n}=(0,Vs.A)(),o=zs[t]||zs.default;return(0,pe.jsx)(ce.Flex,{alignItems:!n&&"center",background:"mainBackground",column:n,"data-testid":"overview-header",gap:2,justifyContent:n?"start":"between",padding:[0,2,0,4],width:"100%",children:n?(0,pe.jsx)(Ss,{flavour:t}):!!o&&(0,pe.jsx)(o,Ks(Ks({},r),{},{flavour:t}))})})),Ws=Gs;var qs=r(27024),Us=r(98591),Js=r(47213);const Zs=["id","contexts","menuId","parentIds"];function Xs(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function $s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Xs(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xs(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Ys=e=>{let{id:t,contexts:r,menuId:n,parentIds:o}=e,i=(0,W.A)(e,Zs);const s=(0,Ne.bD)();return(0,Js.q)(s)(r,n||t,o)?(0,pe.jsx)(Lt.h,$s($s({id:t},i),{},{children:(0,pe.jsx)(Bt.$,{id:t,hasTooltip:!0,flavour:i.extraKey,enableFavourites:!0,level:i.level,descendantIds:i.descendantIds,selfChartIds:i.selfChartIds})})):null},Qs=(0,n.memo)(Ys);var ea=r(5020),ta=r(80744),ra=r(64156),na=r(28973),oa=r(1817),ia=r(2404),sa=r.n(ia),aa=r(52795);const la=(0,Z.eU)(null),ca=()=>{const e=(0,Vr.eg)(),t=(0,J.md)(la);return e&&e.getRoot().getChildren().find((e=>e.match({id:t})))},da=e=>t=>"overview-page::".concat(e.getAttribute("id"),"::").concat(t);var ua=r(54251),pa=r(77679);const ha={},ga=(e,t,r)=>{const o=(0,v.ID)(),[i,s]=(0,pa.w)(),a=i?s:o,l=(0,U.rW)("contextSearchFilters",{key:a,extraKey:"chartFilters",flavour:"obj",defaultValue:ha});return(0,n.useMemo)((()=>{const n=Array.isArray(e)?e:[e];if(!n.length||!n[0])return null;const o=t?[t,...r||[]]:[];if(0===o.length)return null;const i={dimensions:[],instances:[],labels:[]};o.forEach((e=>{const t=l[e];t&&n.forEach((e=>{const r=t[e];if(!r)return;(Array.isArray(r)?r:[r]).forEach((e=>{switch(e.matchType){case"dimensions":i.dimensions.includes(e.value)||i.dimensions.push(e.value);break;case"instances":e.instanceName&&(i.instances.includes(e.instanceName)||i.instances.push(e.instanceName));break;case"labels":i.labels.includes(e.value)||i.labels.push(e.value)}}))}))}));return i.dimensions.length>0||i.instances.length>0||i.labels.length>0?i:null}),[l,e,t,r])},fa=["style","handleProps","attributes","listeners","dragging","dragOverlay","id","resizeHandle","onChangeHeight","onRemove","expanded","ref","menuId","subMenuId","parentIds"],ba=["contextScope"];function ma(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function xa(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ma(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ma(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const ja=[],ya=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{selectedDimensions:e.dimensions?Object.keys(e.dimensions):ja,selectedInstances:e.instances?Object.keys(e.instances):ja,selectedNodes:e.nodes?Object.keys(e.nodes):ja,weight:e.weight}},va=e=>{let{style:t,handleProps:r,attributes:o,listeners:i,dragging:s,dragOverlay:a,id:l,resizeHandle:c,onChangeHeight:d,onRemove:u,expanded:p,ref:h,menuId:g,subMenuId:f,parentIds:b}=e;(0,W.A)(e,fa);const m=(0,n.useRef)({}),x=(0,v.ID)(),j=ca(),y=(0,bn.aA)(l),{contextScope:O}=y,w=(0,W.A)(y,ba),P=(0,Vr.eg)(),{sendLog:C,isReady:I}=(0,Qr.A)(),A=(0,ie.CS)({type:"chart",entity:O?O.join(","):l,path:"/"}),k=ga(O,f||g,b),S=(0,n.useMemo)((()=>{if(!j)return null;let e=j.getNode({id:a?"dragOverlay-".concat(l):l});const t=(0,aa.A)(A,!0);if(e)return m.current=(0,aa.A)(xa(xa(xa({},e.getAttributes()),e.getAttribute("pristine")),{},{pristine:{}})),k&&!sa()(e.getAttribute("prevMatches"),k)&&e.setAttributes({selectedDimensions:Array.from(new Set([...t.selectedDimensions||[],...k.dimensions||[]])),selectedInstances:Array.from(new Set([...t.selectedInstances||[],...k.instances||[]])),selectedLabels:Array.from(new Set([...t.selectedLabels||[],...k.labels||[]])),prevMatches:k}),e;e=P.makeChart({attributes:xa(xa({id:a?"dragOverlay-".concat(l):l,roomId:x,expandable:!0},w),{},{contextScope:O,expanded:p,toolboxProps:{drag:xa(xa(xa({},r),i),o)}}),makeTrack:da}),j.appendChild(e),m.current=(0,aa.A)(e.getAttributes());const n=e.getAttribute("chartLibrary");return e.setAttributes(xa(xa(xa({},m.current),t),k&&!sa()(e.getAttribute("prevMatches"),k)&&{selectedDimensions:Array.from(new Set([...t.selectedDimensions||[],...k.dimensions||[]])),selectedInstances:Array.from(new Set([...t.selectedInstances||[],...k.instances||[]])),selectedLabels:Array.from(new Set([...t.selectedLabels||[],...k.labels||[]])),prevMatches:k})),(0,ua.A)(e,n,e.getAttribute("chartLibrary")),e}),[j,x,l,a]);(0,n.useLayoutEffect)((()=>{S&&I&&"function"===typeof C&&S.updateAttribute("logOptions",{sendLog:C,payload:{feature:"Overview"}})}),[S,C,I]);const{weight:D,selectedDimensions:T,selectedInstances:M,selectedNodes:F}=(0,bn.uy)(O.join("|"),ya),N=(0,oa.A)(A),E=(0,oa.A)(k,!0),L=(0,oa.A)(T.length),B=(0,oa.A)(M.length),R=(0,oa.A)(F.length);return(0,us.A)((()=>{if(!S)return;const e=S.getAttribute("chartLibrary"),t={};if(!D||L===T.length&&B===M.length&&R===F.length?A&&!sa()(N,A)&&Object.assign(t,xa(xa({},m.current),(0,aa.A)(A,!0))):Object.assign(t,{selectedDimensions:T,selectedInstances:M,selectedNodes:F}),k&&!sa()(E,k)){const e=S.getAttributes();Object.assign(t,{selectedDimensions:Array.from(new Set([...e.selectedDimensions||[],...t.selectedDimensions||[],...k.dimensions||[]])),selectedInstances:Array.from(new Set([...e.selectedInstances||[],...t.selectedInstances||[],...k.instances||[]])),selectedLabels:Array.from(new Set([...e.selectedLabels||[],...t.selectedLabels||[],...k.labels||[]])),prevMatches:k})}Object.keys(t).length>0&&(S.updateAttributes(t),(0,ua.A)(S,e,S.getAttribute("chartLibrary")),S.trigger("fetch"))}),[S,x,l,A,k,D,T.length,M.length,F.length]),(0,n.useLayoutEffect)((()=>{S&&t&&(S.updateAttributes({height:t.height,width:t.width}),S.trigger("resize"))}),[S,t.height,t.width]),(0,n.useLayoutEffect)((()=>{if(S)return(0,na.unregister)(S.onAttributeChange("expanded",(function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e===(arguments.length>1&&void 0!==arguments[1]&&arguments[1]))return;const{expandedHeight:t}=S.getAttributes();d(l,(e?1:-1)*t)})))}),[S]),(0,us.A)((()=>{S&&S.updateAttributes({toolboxProps:{drag:xa(xa(xa(xa({},r),i),o),{},{dragging:s})}})}),[S,s]),S?(0,pe.jsxs)(ce.Box,{ref:h,style:t,children:[(0,pe.jsx)(Ur.A,{chart:S,"data-chartid":a?"dragOverlay-".concat(l):l,"data-track":S.track("container"),height:t.height,width:"100%"}),c]},j&&j.getId()):null},Oa=(0,n.memo)(va,((e,t)=>e.id===t.id&&e.style===t.style)),wa=["id","menuId","subMenuId","parentIds","containerWidth"],Pa=["id"];function Ca(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ia(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ca(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ca(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Aa=function(){let{id:e,layout:t={},contextScope:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,ea.bP)(e,t,Ia(Ia({left:0,top:0,width:12,height:6,id:e,chartId:e},t),{},{minWidth:12,maxWidth:12,minHeight:4,static:!1,dashboardable:!0,contextScope:r}))},ka=e=>{let{id:t,menuId:r,subMenuId:o,parentIds:i,containerWidth:s}=e,a=(0,W.A)(e,wa);const l=(0,bn.aA)(t,Aa),c=(0,Ne.bD)(),d=(0,Js.q)(c),[u,p]=(0,n.useState)((()=>[l])),h=(e,t)=>{(0,ea.Q)(t),p(e)},g=(0,n.useRef)(1),f=(e,t)=>{const r=u.findIndex((t=>t.id===e));-1!==r&&(u[r]=Ia(Ia({},u[r]),{},{height:u[r].height+t/ta.NA,expanded:t>0}),h([...u],u[r]),g.current+=1)},b=(0,ra.A)("(max-width: 767px)"),m=(0,n.useMemo)((()=>(g.current+=1,u.filter((e=>{if(!e)return!1;const t=e.contextScope||[e.chartId]||0;return d(t,o||r,i)})))),[u,d,o,r,i]),x=(0,n.useMemo)((()=>e=>{let{id:t}=e,n=(0,W.A)(e,Pa);return(0,pe.jsx)(Oa,Ia({id:t,role:"graphics-object","aria-roledescription":"chart","data-menuid":o||r,menuId:r,subMenuId:o,onChangeHeight:f,parentIds:i},n),t)}),[o,r,i]);return(0,pe.jsx)(ta.Ay,Ia(Ia({cacheId:g.current,rootId:t,containerId:t,onDragEnd:h,items:m,containerWidth:s-(b?16:26),"data-menuid":o||r},a),{},{Item:x,rearrangeable:!0}))},Sa=(0,n.memo)(ka);var Da=r(54025),Ta=r(63996);const Ma=e=>{let{id:t,contexts:r,menuId:n,parentIds:o,extraKey:i,descendantIds:s,level:a,selfChartIds:l}=e;const c=(0,Ne.bD)();return(0,Js.q)(c)(r,n||t,o)?(0,pe.jsx)(Da.t,{gap:0,id:t,testId:"chart-sub-menu-container-overview",children:(0,pe.jsx)(Ta.t,{id:t,margin:[1,0,0],hasTooltip:!0,flavour:i,enableFavourites:!0,level:a,descendantIds:s,selfChartIds:l})}):null},Fa=(0,n.memo)(Ma);var Na=r(4719);const Ea=e=>{let{id:t}=e;const r=(0,v.ID)(),o=(0,Vr.eg)(),i=(0,bn.Vt)(),{chartIds:s}=(0,Na.b)(t),a=ca(),l=(0,n.useMemo)((()=>{const[e]=s;let n=a.getChildren().find((e=>e.match({id:t})));if(n)return n;const l=s.map((e=>({value:e,label:i(e).context})));return n=o.makeChart({attributes:{id:"custom-k8s-map-".concat(t),contextScope:[e],roomId:r,composite:!0,chartLibrary:"groupBoxes",groupBy:["label"],groupByLabel:["k8s_namespace","k8s_pod_name"],aggregationMethod:"avg",eliminateZeroDimensions:!1,contextItems:l,toolboxElements:[]},makeTrack:da}),a.appendChild(n),n}),[t,a]);return(0,pe.jsx)(Ur.A,{margin:[0,0,2],chart:l,"data-chartid":t,"data-track":l.track("container")},a.getId())},La=["id"];function Ba(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ra(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ba(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ba(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Va=e=>{let{id:t}=e,r=(0,W.A)(e,La);return(0,pe.jsxs)(Lt.h,{id:t,padding:[6,0,0],children:[(0,pe.jsx)(Bt.$,{id:t}),(0,pe.jsx)(Rt.n,{id:t,padding:[2,0,0]}),(0,pe.jsx)(Ea,Ra({id:t},r))]})},Ha=(0,n.memo)(Va);function _a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ka(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_a(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const za=[],Ga=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{selectedDimensions:e.dimensions?Object.keys(e.dimensions):za,selectedInstances:e.instances?Object.keys(e.instances):za,selectedNodes:e.nodes?Object.keys(e.nodes):za,weight:e.weight}},Wa=(0,bn.BK)((e=>{var t;let{style:r,id:o,menuChartAttributes:i,resizeHandle:s,handleProps:a,listeners:l,dragging:c,dragOverlay:d,onChangeHeight:u,expanded:p,ref:h,menuId:g,subMenuId:f,parentIds:b}=e;const m=(0,n.useRef)({}),x=(0,v.ID)(),j=(0,Vr.eg)(),y=ca(),O=(0,ie.CS)({type:"chart",entity:o,path:"/"}),w=ga(i.contextScope,f||g,b),P=(0,n.useMemo)((()=>{let e=y.getChildren().find((e=>e.match({id:d?"dragOverlay-".concat(o):o})));const t=(0,aa.A)(O,!0);if(e)m.current=(0,aa.A)(Ka(Ka({},e.getAttributes()),e.getAttribute("pristine"))),w&&!sa()(e.getAttribute("prevMatches"),w)&&e.setAttributes({selectedDimensions:Array.from(new Set([...t.selectedDimensions||[],...w.dimensions||[]])),selectedInstances:Array.from(new Set([...t.selectedInstances||[],...w.instances||[]])),selectedLabels:Array.from(new Set([...t.selectedLabels||[],...w.labels||[]])),prevMatches:w});else{e=j.makeChart({attributes:Ka(Ka({expandable:!0},i),{},{roomId:x,id:d?"dragOverlay-".concat(o):o,isHead:!0,expanded:p}),makeTrack:da,toolboxProps:{drag:Ka(Ka({},a),l)}}),m.current=(0,aa.A)(e.getAttributes());const r=e.getAttribute("chartLibrary");e.setAttributes(Ka(Ka(Ka({},m.current),t),w&&sa()(e.getAttribute("prevMatches"),w)&&{selectedDimensions:Array.from(new Set([...t.selectedDimensions||[],...w.dimensions||[]])),selectedInstances:Array.from(new Set([...t.selectedInstances||[],...w.instances||[]])),selectedLabels:Array.from(new Set([...t.selectedLabels||[],...w.labels||[]])),prevMatches:w})),(0,ua.A)(e,r,e.getAttribute("chartLibrary")),y.appendChild(e)}return e}),[x,o,y]),{weight:C,selectedDimensions:I,selectedInstances:A,selectedNodes:k}=(0,bn.uy)(null===(t=i.contextScope)||void 0===t?void 0:t.join("|"),Ga),S=(0,oa.A)(O),D=(0,oa.A)(w,!0,sa()),T=(0,oa.A)(I.length),M=(0,oa.A)(A.length),F=(0,oa.A)(k.length);(0,us.A)((()=>{if(!P)return;const e={},t=P.getAttribute("chartLibrary");if(!C||T===I.length&&M===A.length&&F===k.length?O&&!sa()(S,O)&&Object.assign(e,Ka(Ka({},m.current),(0,aa.A)(O,!0))):Object.assign(e,{selectedDimensions:I,selectedInstances:A,selectedNodes:k}),w&&!sa()(D,w)){const t=P.getAttributes();Object.assign(e,{selectedDimensions:Array.from(new Set([...t.selectedDimensions||[],...e.selectedDimensions||[],...w.dimensions||[]])),selectedInstances:Array.from(new Set([...t.selectedInstances||[],...e.selectedInstances||[],...w.instances||[]])),selectedLabels:Array.from(new Set([...t.selectedLabels||[],...e.selectedLabels||[],...w.labels||[]])),prevMatches:w})}Object.keys(e).length>0&&(P.updateAttributes(e),(0,ua.A)(P,t,P.getAttribute("chartLibrary")),P.trigger("fetch"))}),[P,x,o,O,w,C,I.length,A.length,k.length]),(0,n.useLayoutEffect)((()=>{P.updateAttributes({toolboxProps:{drag:Ka(Ka(Ka({},a),l),{},{dragging:c})}})}),[P,c]),(0,n.useLayoutEffect)((()=>{if(P)return(0,na.unregister)(P.onAttributeChange("expanded",(function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e===(arguments.length>1&&void 0!==arguments[1]&&arguments[1]))return;const{expandedHeight:t}=P.getAttributes();u(o,(e?1:-1)*t)})))}),[P]),(0,us.A)((()=>{if(!P)return;const e=parseFloat(r.height);e&&!isNaN(e)&&(P.updateAttribute("height",e),P.trigger("resize"))}),[r.height]);return(0,Ne.Bu)(i.contextScope)?(0,pe.jsxs)("div",{ref:h,style:r,children:[(0,pe.jsx)(Ur.A,{chart:P,"data-track":P.track("container"),"data-chartid":d?"dragOverlay-".concat(o):o,height:r.height,width:"100%"}),s]},y.getId()):null})),qa=(e,t,r)=>(e.layout||console.warn(t,"has no layout set, default values will be used."),(0,ea.bP)(t,e.layout,{left:r%2,top:4*parseInt(r/2),width:6,height:4,id:e.id,contextScope:e.contextScope,minWidth:1,minHeight:1,static:!1,dashboardable:!0})),Ua=(0,n.memo)((e=>{let{itemIds:t,containerWidth:r,id:o,subMenuId:i,menuId:s,parentIds:a}=e;const l=(0,bn.dd)(t,qa),{filteredChartsCount:c}=(0,Xi.Ad)(),d=(0,ra.A)("(max-width: 767px)"),u=(0,Ne.bD)(),p=(0,Js.q)(u),[h,g]=(0,n.useState)((()=>l)),f=(e,t)=>{(0,ea.Q)(t),g(e)},b=(0,n.useRef)(1),[m,x]=(0,n.useState)(!1),j=(0,n.useMemo)((()=>t.some((e=>null!==localStorage.getItem("chart_layout/".concat(e))))),[t]),y=(0,n.useCallback)((()=>{t.forEach((e=>{localStorage.removeItem("chart_layout/".concat(e))})),b.current+=1,g(l)}),[t,l]);(0,n.useEffect)((()=>{const e=()=>{b.current+=1,g(l)};return window.addEventListener("resetChartLayout",e),()=>window.removeEventListener("resetChartLayout",e)}),[l,d]);const v=(0,n.useMemo)((()=>(b.current+=1,h.filter((e=>!!e&&(!!e.contextScope&&p(e.contextScope,s,a)))))),[t,h,c,p,s,a]);return v.length?(0,pe.jsxs)(ce.Flex,{position:"relative",width:"100%",onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1),children:[m&&j&&(0,pe.jsx)(ce.Flex,{position:"absolute",top:2,right:2,zIndex:10,background:"dropdown",round:1,padding:[1],border:!0,children:(0,pe.jsx)(tt.A,{content:"Reset all charts to default layout",align:"left",children:(0,pe.jsx)(ce.IconButton,{icon:"refresh",onClick:y,flavour:"borderless",padding:[1],"data-testid":"grid-reset-layout-button"})})}),(0,pe.jsx)(ta.Ay,{cacheId:b.current,rootId:o,containerId:o,"data-chartid":o,"data-menuid":i||s,onDragEnd:f,items:v,containerWidth:r-(d?16:26),gridTracks:d?1:12,Item:Wa,rearrangeable:!0,itemProps:{onChangeHeight:(e,t)=>{const r=h.findIndex((t=>t.id===e));-1!==r&&(h[r]=Ka(Ka({},h[r]),{},{height:h[r].height+t/ta.NA,expanded:t>0}),f([...h],h[r]),b.current+=1)},menuId:s,subMenuId:i,parentIds:a},compactType:"vertical"})]}):null}),((e,t)=>e.itemIds===t.itemIds&&e.containerWidth===t.containerWidth)),Ja={k8s:Ha,root:Qs,submenu:Fa,chart:Sa,grid:Ua},Za=e=>{if(Ja[e.flavour])return Ja[e.flavour];switch(e.level){case 0:return Qs;case 1:return Fa;case 2:return Sa;default:return null}},Xa=e=>{let{flavour:t,onChartNameChange:r,initialChartName:n,dashboardOptions:o,linkToGo:i,contextToGo:s,containerWidth:a}=e;const[l,,,c]=(0,Us.A)("addToDashboardModal"),{setActiveMenuId:d}=(0,Nt.A)({onChartNameChange:r,initialChartName:n,linkToGo:i,contextToGo:s}),u=(0,Ne.bD)(),p=(0,Js.q)(u);return(0,pe.jsxs)(ae.H,{children:[(0,pe.jsx)(Et.A,{flavour:t,onActiveMenuId:d,getComponent:Za,dashboardOptions:o,initialChartName:n,containerWidth:a,checkVisibility:p}),l&&(0,pe.jsx)(qs.A,{onClose:c})]})};var $a=r(19075);function Ya(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}const Qa=(0,n.memo)((()=>{const[e,t]=(0,$a.KB)(),r=(0,Vr.eg)(),o=!!e&&!!r&&r.getNode({id:e.context}),i=()=>{if(t(null),null===e||void 0===e||!e.context||!o)return;const r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ya(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ya(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},o.getAttribute("overlays"));delete r.alert,o.updateAttribute("overlays",r),history.replaceState({},"")};(0,n.useEffect)((()=>i),[]);const s=(0,v.ID)(),a=(0,Ne.R7)((null===e||void 0===e?void 0:e.context)&&s,null===e||void 0===e?void 0:e.context);if(!e||null===a||void 0===a||!a.loaded)return null;const{firstEntry:l}=a;return(0,pe.jsx)(ce.Layer,{backdrop:!1,position:"top",margin:[26,0,0],padding:[26,0,0],children:(0,pe.jsxs)(ce.Flex,{background:"tooltip",padding:[1,2],gap:2,children:[(0,pe.jsxs)(ce.TextSmall,{children:["Showing alert in ",(0,pe.jsx)(ce.TextSmall,{strong:!0,children:e.instance})," on"," ",(0,pe.jsx)(ce.TextSmall,{strong:!0,children:new Date(1e3*e.lastStatusChange).toLocaleString()}),!l&&" doesn't exist on the node anymore",!!l&&l>e.lastStatusChange&&" exceeds agent data retention settings"]}),(0,pe.jsx)(ce.Flex,{flex:!1,children:(0,pe.jsx)(ce.Icon,{name:"x",color:"tooltipText",onClick:i,size:"small"})})]})})})),el=Qa;var tl=r(14070);function rl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function nl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?rl(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rl(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const ol={NoChartsView:Zi,NoNodesView:R.A,sidebar:{title:"Filters",hiddenTabs:["info"],Component:le.Ay,props:{}},dashboardOptions:{},loadingMessage:"Loading charts...",Header:Ws},il={overview:nl(nl({},ol),{},{sidebar:nl(nl({},ol.sidebar),{},{title:"Metrics"}),feature:"Overview"}),k8s:nl(nl({},ol),{},{NoChartsView:ds,NoNodesView:ds,sidebar:nl(nl({},ol.sidebar),{},{title:"Kubernetes"}),loadingMessage:"Loading k8s charts...",feature:"Kubernetes"}),singleNode:nl(nl({},ol),{},{sidebar:nl(nl({},ol.sidebar),{},{title:"Single Node",hiddenTabs:["filters"],props:{showCollapsed:!0}}),feature:"SingleNode"})},sl=()=>((0,Ri.A)(),null),al=(0,n.memo)((e=>{let{flavour:t="overview",invalidationKey:r,nodeIds:n,loaded:o,getChart:i,chartIds:s,areChartsIdsEmpty:a,showNoChartsView:l,showNoNodesView:d,initializing:u,chartName:p,setChartName:h,chartsLoaded:g,widthRef:f,containerWidth:b,nodesKey:m,blurred:j,blurProps:y={},BlurredContent:v,noPreferredNodesError:O}=e;const{dashboardOptions:w,NoChartsView:P,NoNodesView:C,sidebar:I,Header:A,feature:k="Overview"}=il[t],{state:S}=(0,x.zy)(),[D,,,T]=(0,tl.A)(),M=ca();return d?(0,pe.jsx)(V.Ay,{feature:k,mode:"NoNodesView",children:(0,pe.jsx)(C,{})}):u?(0,pe.jsx)(Gi.A,{title:"Please wait while charts are being initialized.",body:"Thank you for your patience!"}):o?(0,pe.jsx)(V.Ay,{feature:k,children:(0,pe.jsxs)(ae.A,{getObject:i,ids:s,linkToGo:null===S||void 0===S?void 0:S.chartName,extraKey:t,deps:[m],children:[(0,pe.jsx)(sl,{}),(0,pe.jsx)(el,{}),(0,pe.jsxs)(_.A,{ref:f,sidebar:(0,pe.jsx)(I.Component,nl({nodeIds:n,title:I.title,initialChartName:p,hiddenTabs:I.hiddenTabs,flavour:t,loaded:g,FilterInputContainer:ns},I.props)),blurred:j,blurProps:y,BlurredContent:v,children:[(0,pe.jsx)(A,{flavour:t}),g||O?l||a?(0,pe.jsx)(P,{noPreferredNodesError:O}):(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(Xa,{flavour:t,dashboardOptions:w,initialChartName:p,onChartNameChange:h,linkToGo:null===S||void 0===S?void 0:S.chartName,contextToGo:null===S||void 0===S?void 0:S.contextToGo,containerWidth:b}),D&&T]}):(0,pe.jsx)(c.O2,{}),(0,pe.jsx)(zi,{container:M})]})]},r)}):(0,pe.jsx)(c.O2,{})})),ll=al;function cl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}const dl=e=>t=>{const r=(0,z.nl)(),o=(0,n.useMemo)((()=>[r]),[r]);return(0,pe.jsx)(e,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?cl(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cl(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({flavour:"singleNode",nodeIds:o,nodeId:r},t),r)};var ul=r(64867),pl=r(12407),hl=r(17829);function gl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function fl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?gl(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gl(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var bl=r(13752),ml=r(92815),xl=r(72582),jl=r(82650),yl=r(78072),vl=r(95980),Ol=r(91832),wl=r(6504),Pl=r(22332),Cl=r(12897),Il=r.n(Cl),Al=r(55042),kl=r.n(Al),Sl=new(Il())({id:"alarm_bell",use:"alarm_bell-usage",viewBox:"0 0 12 14",content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 14" id="alarm_bell"><path d="M11.45 8.11A2.61 2.61 0 0 1 10 5.77V5c0-1.97-1.44-3.6-3.31-3.93 0-.02.01-.04.01-.07 0-.39-.31-.7-.7-.7s-.7.31-.7.7c0 .02.01.05.01.07C3.44 1.4 2 3.03 2 5v.76c0 1-.55 1.9-1.45 2.34L0 8.38v2.82c0 .99.81 1.8 1.8 1.8H5c0 .55.45 1 1 1s1-.45 1-1h3.2c.99 0 1.8-.81 1.8-1.8V8.38zM11 11.2c0 .44-.36.8-.8.8H1.8c-.44 0-.8-.36-.8-.8V10h5.5c.55 0 1-.45 1-1H1c1.23-.61 2-1.87 2-3.24V5c0-1.66 1.34-3 3-3s3 1.34 3 3v.76c0 1.37.77 2.62 2 3.24z" /></symbol>'});kl().add(Sl);const Dl=Sl,Tl=(0,jn.default)(ce.Icon).withConfig({displayName:"styled__StyledAlertDot",componentId:"sc-12w0ym-0"})(["position:absolute;top:0;right:-1px;width:6px;height:6px;"]);var Ml=r(96026);const Fl=["alertName","close","tooltip"],Nl=["alertName","nodes","close","tooltip"],El=["value","label","alerts","nodes","onClick"],Ll=["item","index","style","close","onItemClick"];function Bl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Rl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Bl(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Bl(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Vl=(0,Nr.A)((e=>{let{alertName:t,close:r,tooltip:o}=e,i=(0,W.A)(e,Fl);const[,s]=(0,tl.A)(),{sendLog:a}=(0,Qr.A)(),l=(0,n.useCallback)((e=>{e.stopPropagation(),s({alertName:t}),a({feature:"MetricsChartManageAlerts",description:"Show alert",alertName:t}),r()}),[t,s,r,a]);return(0,pe.jsx)(ce.IconButton,Rl({icon:"goToNode",iconColor:"textLite",onClick:l,neutral:!0,padding:[0],width:"16px",height:"16px"},i))})),Hl=(0,Nr.A)((e=>{let{alertName:t,nodes:r,close:o,tooltip:i}=e,s=(0,W.A)(e,Nl);const{goToEdit:a}=(0,Ml.q)({alertName:t,nodeIds:r}),{sendLog:l}=(0,Qr.A)(),c=(0,n.useCallback)((e=>{e.stopPropagation(),l({feature:"MetricsChartManageAlerts",description:"Edit alert",alertName:t}),a(),o()}),[r,o,a,l]);return(0,pe.jsx)(ce.IconButton,Rl({icon:"pencilOutline",iconColor:"textLite",onClick:c,neutral:!0,padding:[0],width:"12px",height:"12px"},s))})),_l=e=>{let{item:{value:t,label:r,alerts:n={},nodes:o,onClick:i},index:s,style:a,close:l,onItemClick:c}=e,d=(0,W.A)(e.item,El),u=(0,W.A)(e,Ll);const{cl:p=0,cr:h=0,wr:g=0}=n,f={text:h,flavour:h?"error":"disabledError"},b={text:g,flavour:g?"warning":"disabledWarning"},m={text:p,flavour:p?"clear":"disabledClear"};return(0,pe.jsxs)(ce.MenuItemContainer,Rl(Rl(Rl({"data-index":s,onClick:e=>{i&&i(e)}},d),u),{},{style:a,alignItems:"center",justifyContent:"between",gap:2,padding:[1,2],overflow:"hidden",cursor:"default",children:[(0,pe.jsx)(ce.Flex,{width:{max:"180px"},alignItems:"center",children:(0,pe.jsx)(Xr.A,{text:r,TextComponent:ce.Text})}),(0,pe.jsxs)(ce.Flex,{alignItems:"center",gap:1,children:[(0,pe.jsx)(ce.MasterCard,{pillLeft:f,pillRight:b,pillEnd:m}),(0,pe.jsx)(Vl,{alertName:t,close:l,tooltip:"Show alert instances",tooltipProps:{align:"bottom"}}),(0,pe.jsx)(Hl,{alertName:t,nodes:o,close:l,disabled:!o.length,tooltip:o.length?"Edit this alert configuration":"This alert is no longer configured in any node",tooltipProps:{align:"bottom"}})]})]}))};var Kl=r(39423);function zl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Gl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?zl(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zl(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Wl={events:{extraKey:"feedFilters",page:"events",alertNamesKey:"alert_names",period:{after:-r(71336).d_,before:0}},alerts:{extraKey:"alerts",page:"alerts",alertNamesKey:"alertNames"}},ql=function(){let{flavour:e="events"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,v.ID)(),r=(0,x.Zp)(),[o,i]=(0,Yi.Ay)(),s=(0,$a.le)(),[,a]=(0,$a.DV)(),l=(0,U.rI)(),{extraKey:c,page:d,alertNamesKey:u,period:p}=Wl[e]||Wl.events,h={defaultValue:[],key:t,extraKey:c,flavour:"arr",merge:!1},g=(0,U.rI)("alertContexts",h),f=(0,U.rI)(u,h),b=(0,U.rI)("chart_names",h),m=(0,n.useCallback)((e=>{let{name:t}=e;s(1),a({alertName:t,nodeId:null}),r("/spaces/".concat(o,"/rooms/").concat(i,"/alerts"),{replace:!0})}),[r,o,i,s,a]),j=(0,n.useCallback)((e=>{let{context:t,name:n,instance:s}=e;p&&l((e=>Gl(Gl({},e),p))),t&&g([t]),n&&f([n]),s&&b([s]),r("/spaces/".concat(o,"/rooms/").concat(i,"/").concat(d))}),[r,d,p,o,i,l,g,f,b]);return{goToAlerts:j,goToAlertConfigurations:m}},Ul=(0,ht.A)((0,Nr.A)(ce.Button)),Jl=e=>{let{loaded:t,contexts:r=[],close:o,onAddAlertClick:i}=e;const s=(0,Pl.useChart)().getId(),a=null===r||void 0===r?void 0:r[0],{setSelectedTab:l}=(0,Kl.A)(),[c,d]=(0,Yi.Ay)(),{goToAlerts:u}=ql({flavour:"alerts"}),p=(0,n.useMemo)((()=>a?"View the active alerts for ".concat(a," context"):"View the active alerts for this context"),[a]),h=(0,n.useCallback)((()=>{a&&(l(0),o(),u({context:a}))}),[a,u,l,c,d,o]),g=(0,n.useCallback)((()=>{i(),o()}),[i,o]);return(0,pe.jsxs)(ce.Flex,{gap:2,padding:[2],border:{side:"top"},justifyContent:"center",children:[(0,pe.jsx)(Ul,{feature:"MetricsChartManageAlerts",label:"Go to alerts",small:!0,flavour:"hollow",icon:"goToNode",onClick:h,tooltip:p,tooltipProps:{align:"bottom"},payload:{chartId:s},disabled:!a||!t}),(0,pe.jsx)(Ul,{feature:"MetricsChartManageAlerts",label:"Add alert",small:!0,icon:"plus",onClick:g,tooltip:"Start adding a new alert on ".concat(a," context"),tooltipProps:{align:"bottom"},payload:{chartId:s},disabled:!a||!t})]})};var Zl=r(40952);function Xl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function $l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Xl(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xl(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Yl=e=>{let{disabled:t}=e;const r=(0,Pl.useChart)(),o=(0,z.ss)(),{loaded:i,items:s,status:a}=(e=>{const[t,r]=(0,n.useState)(),[o,i]=(0,n.useState)([]),[s,a]=(0,n.useState)([]),[l,c]=(0,n.useState)(),d=(0,$a.SU)();return(0,n.useEffect)((()=>{const t=()=>{const t=e.getAttribute("alerts"),n=Object.values(t||{}),o=Object.keys(e.getAttribute("nodes")||{});r(!0),i(n),a(o);for(let e=0;e<=n.length;e++){const{wr:t=0,cr:r=0}=n[e]||{};if(r>0){c("error");break}if(t>0){c("warning");break}}};return e&&e.on("successFetch",t),()=>{e&&e.off("successFetch",t)}}),[e,r,i,a,c]),{loaded:t,items:(0,n.useMemo)((()=>[...o.map((e=>{let{nm:t,cl:r,wr:n,cr:o}=e;const i=(d||[]).filter((e=>e.name===t)).map((e=>{let{nd:t}=e;return t}));return{value:t,label:t,alerts:{cl:r,wr:n,cr:o},nodes:i}}))]),[o,s]),status:l}})(r),l=r.getAttribute("contextScope"),[,c]=(0,Zl.A)(),d=(0,n.useCallback)((()=>{const{selectedNodes:e,selectedInstances:t,labels:n,selectedLabels:o,contextScope:i}=r.getAttributes(),s=r.getUnitSign(),a=o.length?o:Object.entries(n).reduce(((e,t)=>{let[r,n]=t;return n.vl.forEach((t=>{let{id:n}=t;e.push("".concat(r,":").concat(n))})),e}),[]);c($l($l($l({chart:i[0],viewUnits:s},(t||[]).length?{instances:t}:{}),(e||[]).length?{nodes:e}:{}),a?{labels:a}:{}))}),[r,o,c]);return r?(0,pe.jsx)(ce.Menu,{dropProps:{align:{top:"bottom",right:"right"},"data-toolbox":r.getId()},dropdownProps:{width:"360px"},Item:_l,items:s,Footer:e=>{let{close:t}=e;return(0,pe.jsx)(Jl,{loaded:i,contexts:l,close:t,onAddAlertClick:d})},children:(0,pe.jsxs)(ce.Flex,{alignItems:"center",position:"relative",children:[a?(0,pe.jsx)(Tl,{name:"dot",color:a}):null,(0,pe.jsx)(wl.Button,{icon:(0,pe.jsx)(wl.default,{svg:Dl,size:"16px"}),title:"Manage alerts",disabled:t,"data-testid":"chartHeaderToolbox-manageAlerts"})]})}):null};function Ql(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ec(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ql(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ql(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const tc=(e,t,r)=>{let{width:o,host:i}=r;if(!i)throw"No host provided";const s=(0,Vr.eg)(),a=(0,n.useRef)(),l=(0,Ne.aZ)(e,"error"),[{correlation:c},d]=(0,U.N9)(),{state:u,pathname:p}=(0,x.zy)(),h=(0,J.Xr)(la),g=(0,Ne.jI)(e),f=(0,Ne.DQ)(e);(0,n.useLayoutEffect)((()=>{if(!e||!s||l)return;let r=s.getRoot().getChildren().find((e=>e.match({id:p})));if(!r)return r=s.makeContainer({attributes:{id:p,roomId:e,host:i,navigation:c?"highlight":"pan",overlays:{proceeded:{type:"proceeded"}},composite:!0,nodesScope:t,hasCorrelation:!0,versions:g,containerWidth:o,toolboxElements:[...vt.Dm?[Yl]:[],yl.default,xl.default,bl.default,ml.default,jl.default,Ol.A,vl.A]}}),s.appendChild(r),h(p),a.current=r,(0,na.unregister)(s.on("correlation",((e,t)=>{if(!Array.isArray(t))return;const[r,n]=t;d((e=>ec(ec({},e),{},{highlight:{after:1e3*r,before:1e3*n},correlation:!0})))})),r.onAttributeChange("versions",f));h(p)}),[e,l,p,i]),(0,n.useMemo)((()=>{a.current&&(a.current.setAttribute("containerWidth",o),a.current.getNodes().forEach((e=>e.updateAttribute("containerWidth",o))))}),[a.current,o]),(0,us.A)((()=>{a.current&&a.current.setAttribute("host",i)}),[a.current,i]),(0,us.A)((()=>{a.current&&a.current.getNodes().forEach((e=>{e.updateAttribute("nodesScope",t);e.getAttribute("active")&&"chart"===e.type&&e.fetch()}))}),[a.current,t]),(0,n.useEffect)((()=>{a.current&&a.current.getApplicableNodes({syncHighlight:!0}).forEach((e=>{e.updateAttribute("navigation",c?"highlight":"pan")}))}),[a.current,c]),(0,n.useEffect)((()=>()=>a.current&&a.current.destroy()),[]),(0,n.useEffect)((()=>{if(!a.current)return;if(!u||!u.context)return;const{context:e,chartId:t,nodeId:r}=u,n=a.current.getNode({id:e});n&&n.updateAttributes({selectedInstances:["".concat(t,"@").concat(r)],selectedNodes:[r]});const o=t&&r&&a.current.on("chartLoaded",(n=>{const i=n.getAttribute("id");e===i&&(n.updateAttributes({selectedInstances:["".concat(t,"@").concat(r)],selectedNodes:[r]}),o())}));return()=>u&&(0,na.unregister)(o)}),[a.current,u])};var rc=r(43116);const nc=["flavour","nodeIds","nodeId"];function oc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ic(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?oc(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const sc={default:{shouldHide:()=>!1},k8s:{shouldHide:e=>{let{context:t}=e;return!t.includes("k8s")}}},ac=[],lc="ErrNoPreferredNodeRequested",cc=e=>(0,n.memo)((t=>{let{flavour:r="overview",nodeIds:o=ac,nodeId:i}=t,s=(0,W.A)(t,nc);const a=(0,y.vt)(),l=(0,v.ID)(),c=(0,v.XA)("nodeId");i=i||c;let d=(0,G.w7)({extraKey:r,merge:!1,scoped:!0});d=o.length?o:d;const{isNodeRestricted:u,loaded:p}=(0,on.A)();d=(0,n.useMemo)((()=>d.filter((e=>!u(e).restricted))),[d,p]);const h=(0,B.nj)(),g=(0,Ne._0)(l),{state:f}=(0,x.zy)(),b=(0,Ne.R7)(l),m=(0,z.TG)(d),j=(0,Fe.A)(l,d,{spaceId:a}),{contexts:O,metadata:w,loaded:P,dimensionsCount:C}=(0,ps.Yy)({nodeIds:d,flavour:r},a,l),[,I]=(()=>{const{state:e={}}=(0,x.zy)(),{alertId:t=null}=e||{},[r,o]=(0,$a.KB)(),i=t||(null===r||void 0===r?void 0:r.id),s=(0,$a.JL)(i);(0,$a.yk)(s.id),(0,n.useEffect)((()=>{(s.fullyLoaded||s.id)&&o(fl(fl({},s),{},{formattedLastStatusChangeValue:(0,hl.m3)(s.lastStatusChangeValue,s.units),linkToGo:(0,jt.A)(s.context)}))}),[s.id,s.fullyLoaded]);const a=null!==r&&void 0!==r&&r.id?(0,jt.A)(r.context):null;return[s.id,a]})(),A=o?o.join():r,k=(0,se.K)({spaceId:a,roomId:l}),[S,{width:D}]=(0,H.A)();tc(l,d,{host:k,width:D});const T=(0,Ne.OL)(l),M=(0,Ne.rx)(l),F=P?w:b,N=sc[r]||sc.default,E=(0,Ne.bo)(l),L=(0,oa.A)(E),R=(0,Xi.rq)(T,b,l,ic(ic({},N),{},{shouldHide:P?e=>{let{context:t}=e;return!O.includes(t)}:N.shouldHide,force:P||E!==L,cacheKey:"".concat(r,"-").concat(C,"-").concat(A)})),V=(0,Ne.yO)(l,w),_=(0,oa.A)(j,!0),K=R<1,[q,J]=(0,U.N9)("chartName",{key:l,extraKey:A,flavour:"val"});(0,n.useEffect)((()=>{l&&J(I||(null===f||void 0===f?void 0:f.chartName)||q)}),[l,I]);const Z=ca(),X=Object.keys(F).length<1&&g||d.length&&!m.length,$=(0,B.CK)(),Y=(null===M||void 0===M?void 0:M.errorMsgKey)==lc;if(!X&&!1!==_&&j&&"No data for this period"!==j&&j!==lc&&!Object.keys(F).length)return(0,pe.jsx)(rc.A,{error:j});const Q=!!l&&h&&(!!Z||Y),{restricted:ee}=u(i);return(0,pe.jsx)(e,ic({nodeIds:m,loaded:Q,getChart:V,areChartsIdsEmpty:K,showNoNodesView:h&&!$.length,showNoChartsView:X,initializing:j&&(0,ul.O)(j),chartName:q,setChartName:J,chartsLoaded:g&&!!D,invalidationKey:l,flavour:r,chartIds:P?O:T,widthRef:S,containerWidth:D,nodesKey:A,noPreferredNodesError:Y,blurred:ee,blurProps:{value:"12px"},BlurredContent:()=>(0,pe.jsx)(pl.A,{flavour:c?"room":"node"})},s))}));var dc=r(21785),uc=r(39870),pc=r(7761);function hc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function gc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?hc(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const fc=()=>{const e=(0,y.vt)(),t=(0,v.ID)(),r=(0,pc.N3)();(0,j.A)((()=>({enabled:!(!e||!t),force:!0,fetch:()=>(0,Oi.hn)(e,t),onReceive:e=>{let{data:t}=e;return r(gc(gc({},uc.jf),{},{loaded:!0},t))},onFail:e=>r(gc(gc({},uc.jf),{},{loaded:!0,error:e})),pollingOptions:{pollingInterval:588e3}})),[e,t])};var bc=r(75669);function mc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function xc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?mc(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const jc=()=>{const e=(0,y.vt)(),t=(0,v.ID)(),r=(0,G.w7)({extraKey:"home",merge:!1,scoped:!0}),n=(0,pc.kf)();(0,j.A)((()=>({enabled:!(!e||!t),force:!0,fetch:()=>(0,Oi.TM)(e,t,r),onReceive:e=>{let{data:t}=e;return n(xc(xc({},uc.ul),{},{loaded:!0},t))},onFail:e=>n(xc(xc({},uc.ul),{},{loaded:!0,error:e})),pollingOptions:{pollingInterval:588e3}})),[e,t])};function yc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function vc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?yc(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Oc=()=>{const e=(0,y.vt)(),t=(0,v.ID)(),r=(0,G.w7)({extraKey:"home",merge:!1,scoped:!0}),n=(0,pc.xs)();(0,j.A)((()=>({enabled:!(!e||!t),force:!0,fetch:()=>(0,Oi.jt)(e,t,r),onReceive:e=>{let{data:t}=e;return n(vc(vc({},uc.ve),{},{loaded:!0},t))},onFail:e=>n(vc(vc({},uc.ve),{},{loaded:!0,error:e})),pollingOptions:{pollingInterval:588e3}})),[e,t,r])};var wc=r(74290),Pc=(r(89463),r(56473)),Cc=r(56523),Ic=r(24285),Ac=r(76571),kc=r(97926),Sc=r(17115),Dc=r(31246);function Tc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Mc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Tc(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Tc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Fc=()=>{const{milestones:e,settingsLoaded:t}=(0,Cc.A)(),{completed:r}=e,o=(0,kc.A)(),i=(0,Sc.Ay)(),s=(0,g.Sk)(),a=(0,Sc.Ex)(),l=(0,Ic.xd)("isLoaded"),c=(0,Ic.xd)("onboardingFormData"),d=(0,y.vt)(),u=(0,y.ap)("loaded"),p=(0,Ac.t5)(d,"channels"),h=(0,Ac.t5)(d,"loaded"),f=Array.isArray(p)?p.length:0;return(0,n.useMemo)((()=>{if(!t||!h||!u||!l||!o)return[];const e=!(null===c||void 0===c||!c.usageType);return Object.entries(o).filter((e=>{let[,t]=e;return t})).map((e=>{let[t]=e;return t})).filter((e=>{var t,n;return(null===(t=r[e])||void 0===t?void 0:t.completedAt)&&!(null!==(n=r[e])&&void 0!==n&&n.seenAt)})).flatMap((e=>(Dc.a7[e]||[]).map((t=>Mc(Mc({},t),{},{milestoneId:e}))))).filter((t=>{var n;return!(null===(n=r[t.milestoneId])||void 0===n||null===(n=n.tasks)||void 0===n?void 0:n[t.id])&&(e?!!t.segments.includes(i)&&(!(t.permission&&!s[t.permission])&&(!(t.requiresLargeTeam&&!a)&&!(void 0!==t.maxChannels&&f>t.maxChannels))):t.isFeatureAnnouncement)})).slice(0,3).map((e=>e.channelAwareContent&&f>0?Mc(Mc({},e),{},{title:e.channelAwareContent.title,description:e.channelAwareContent.description}):e))}),[r,o,i,s,a,f,t,h,u,l,c])};var Nc=r(81187),Ec=r(4703);const Lc=e=>{let{description:t}=e;const r=(0,Pc.PP)({extraKey:"runningAlerts"});return"".concat(r.length," ").concat(t)},Bc=e=>{let{onDismiss:t}=e;const{dismissOnboarding:r,resetOnboarding:o,markTaskCompleted:i}=(0,Cc.A)(),s=Fc(),a=(0,Nc.A)(),l=(0,n.useCallback)((e=>i(e.milestoneId,e.id)),[i]),c=(0,n.useCallback)((()=>{r(),null===t||void 0===t||t()}),[r,t]);return s.length?(0,pe.jsx)(ce.Flex,{column:!0,gap:4,children:(0,pe.jsxs)(ce.Flex,{column:!0,gap:4,background:"panelBg",border:!0,round:2,padding:[6],position:"relative",children:[(0,pe.jsx)(ce.IconButton,{icon:"x",neutral:!0,onClick:c,position:"absolute",top:"8px",right:"8px"}),(0,pe.jsxs)(ce.Flex,{column:!0,gap:1,children:[(0,pe.jsxs)(ce.Flex,{gap:2,alignItems:"center",children:[(0,pe.jsx)(ce.Icon,{name:"checkmark_partial_s",color:"success"}),(0,pe.jsx)(ce.Text,{strong:!0,children:"Continue your journey"})]}),(0,pe.jsx)(ce.TextSmall,{color:"textLite",children:"Here's what you can explore next"})]}),(0,pe.jsx)(ce.Flex,{column:!0,gap:2,children:s.map((e=>(0,pe.jsx)(Ec.A,{task:e,onClick:()=>a(e),onSkip:()=>l(e),children:e.dynamicDescription?(0,pe.jsx)(n.Suspense,{fallback:e.description,children:(0,pe.jsx)(Lc,{description:e.description})}):e.description},"".concat(e.milestoneId,"-").concat(e.id))))}),!1]})}):null};var Rc=r(56171);const Vc=[{id:"ai-insights",icon:"ai",background:"secondaryHighlightAI",text:"Ready to unlock AI-powered analysis? Netdata has collected enough data to generate Intelligent Insights. Try your first AI report for detailed recommendations and forecasts.",linkText:"Explore Insights.",route:"insights"}],Hc=e=>{let{item:t,onNavigate:r}=e;return(0,pe.jsxs)(ce.Flex,{alignItems:"center",gap:2,width:"100%",children:[(0,pe.jsx)(ce.Icon,{name:t.icon,color:"main"}),(0,pe.jsxs)(ce.Text,{color:"main",children:[t.text," ",(0,pe.jsx)(je.A,{color:"main",onClick:r,style:{textDecoration:"underline"},children:t.linkText})]})]})},_c=()=>{const e=(0,x.Zp)(),t=(0,y.bq)(),r=(0,v.QW)(),{dismissedBanners:o,dismissBanner:i}=(0,Cc.A)(),s=(0,n.useMemo)((()=>Vc.find((e=>!o[e.id]))),[o]),a=(0,n.useCallback)((()=>{s&&i(s.id)}),[s,i]),l=(0,n.useCallback)((()=>{null!==s&&void 0!==s&&s.route&&e("/spaces/".concat(t,"/rooms/").concat(r,"/").concat(s.route))}),[e,t,r,s]);return s?(0,pe.jsx)(Rc.A,{background:s.background,onClose:a,children:(0,pe.jsx)(Hc,{item:s,onNavigate:l})}):null};var Kc=r(58618),zc=r(42964),Gc=r(82507);const Wc={Live:"live",Stale:"stale",Offline:"offline",Unseen:"unseen"},qc=(0,jn.default)(ce.Flex).withConfig({displayName:"nodeHero__Container",componentId:"sc-t1z79b-0"})(["position:relative;width:320px;height:320px;"]),Uc=(0,jn.default)(ce.Flex).withConfig({displayName:"nodeHero__ContentContainer",componentId:"sc-t1z79b-1"})(["position:absolute;inset:0;z-index:2;"]),Jc=e=>{let{nodeId:t}=e;const r=(0,x.Zp)(),n=(0,z.xY)(t),{loaded:o,metricsCollected:i=0}=(0,pc.P9)(),s=(0,y.bq)(),a=(0,v.QW)(),l=(0,Dt.GM)(n.state),c=Wc[l]||"offline";return(0,pe.jsxs)(qc,{children:[(0,pe.jsx)(zc.A,{withOuties:!1}),(0,pe.jsx)(Gc.A,{withOuties:!1}),(0,pe.jsxs)(Uc,{column:!0,justifyContent:"center",alignItems:"center",gap:3,children:[(0,pe.jsx)(ce.TextBig,{color:"primary",children:n.nm}),(0,pe.jsxs)(ce.Flex,{gap:1,alignItems:"center",children:[(0,pe.jsx)(ce.Box,{width:"8px",height:"8px",round:"50%",background:c}),(0,pe.jsx)(ce.TextBig,{color:c,children:l})]})]}),(0,pe.jsxs)(ce.Flex,{column:!0,alignItems:"center",gap:2,position:"absolute",width:"100%",style:{bottom:"-60px"},children:[(0,pe.jsxs)(ce.TextBig,{children:[o?(0,Kc.$t)(i):"..."," metrics collected"]}),(0,pe.jsx)(ce.Button,{label:"View your metrics",icon:(0,pe.jsx)(ce.Icon,{name:"arrow_right"}),iconSide:"right",onClick:()=>{r("/spaces/".concat(s,"/rooms/").concat(a,"/overview"))}})]})]})},Zc=["title","icon","iconColor"],Xc=["titleProps","loading","error","children"];function $c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Yc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?$c(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$c(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Qc=(0,Nr.A)(ce.Icon),ed=e=>{let{title:t,icon:r,iconColor:n}=e,o=(0,W.A)(e,Zc);return(0,pe.jsxs)(ce.Flex,Yc(Yc({alignItems:"center",gap:2},o),{},{children:[r&&(0,pe.jsx)(ce.Icon,Yc({name:r},n?{color:n}:{})),(0,pe.jsx)(ce.TextBig,{children:t})]}))},td={ErrNoEligibleNodeRequested:"There are no eligible nodes.",default:"Something went wrong."},rd=e=>{let{titleProps:t,loading:r,error:n,children:o}=e,i=(0,W.A)(e,Xc);const s=Yc({padding:[4],gap:4,background:"panelBg"},t?{column:!0}:{}),a=n?td[n.errorMsgKey]||td.default:null;return(0,pe.jsxs)(ce.Flex,Yc(Yc(Yc({},s),i),{},{children:[t?(0,pe.jsx)(ed,Yc({},t)):null,r?(0,pe.jsx)(ce.Text,{textAlign:"center",children:"Loading..."}):n?null:(0,pe.jsx)(pe.Fragment,{children:o}),a?(0,pe.jsx)(ce.Flex,{width:"100%",justifyContent:"center",children:(0,pe.jsx)(Qc,{name:"warning_triangle",size:"large",color:"text",tooltip:a})}):null]}))},nd=e=>{let{title:t,value:r,loading:n}=e;return(0,pe.jsxs)(rd,{column:!0,alignItems:"center",justifyContent:"center",gap:2,padding:[4],width:"180px",children:[(0,pe.jsx)(ce.TextSmall,{color:"textLite",children:t}),(0,pe.jsx)(ce.TextHuge,{strong:!0,children:n?"...":(0,Kc.$t)(r)})]})},od=()=>{const e=(0,v.ID)(),t=(0,Ne._0)(e),r=(0,Ne.R7)(e),n=Object.keys(r||{}).length;return(0,pe.jsx)(nd,{title:"Charts Visualised",value:n,loading:!t})},id=()=>(0,pe.jsx)(ce.Flex,{column:!0,gap:4,children:(0,pe.jsx)(od,{})}),sd=()=>{const e=(0,Pc.PP)({extraKey:"runningAlerts"});return(0,pe.jsx)(nd,{title:"Running Alerts",value:e.length,loading:!1})},ad=()=>(0,pe.jsx)(ce.Flex,{column:!0,gap:4,children:(0,pe.jsx)(n.Suspense,{fallback:(0,pe.jsx)(nd,{title:"Running Alerts",value:"...",loading:!0}),children:(0,pe.jsx)(sd,{})})}),ld=e=>{let{position:t}=e;return"left"===t?(0,pe.jsx)(id,{}):(0,pe.jsx)(ad,{})},cd=()=>((0,dc.A)(),fc(),(0,bc.A)(),jc(),Oc(),(0,wc.A)(),null),dd=e=>{let{nodeId:t}=e;return(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(cd,{}),(0,pe.jsx)(_c,{}),(0,pe.jsxs)(_.A,{gap:4,padding:[4],overflow:"auto",children:[(0,pe.jsxs)(ce.Flex,{gap:4,justifyContent:"center",alignItems:"center",children:[(0,pe.jsx)(ld,{position:"left"}),(0,pe.jsx)(Jc,{nodeId:t}),(0,pe.jsx)(ld,{position:"right"})]}),vt.OH&&(0,pe.jsx)(Bc,{})]})]})},ud=["title","headerInfo","containerProps","TitleComponent"];function pd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function hd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?pd(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pd(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const gd=e=>function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{title:r="",headerInfo:n,containerProps:o={},TitleComponent:i=ce.TextBigger}=t,s=(0,W.A)(t,ud);return(0,pe.jsxs)(ce.Flex,hd(hd({column:!0,gap:2,alignItems:"center",justifyContent:"center"},o),{},{children:[r&&(0,pe.jsxs)(ce.Flex,{gap:2,alignItems:"center",children:[(0,pe.jsx)(i,{children:r}),n]}),(0,pe.jsx)(e,hd({},s))]}))},fd=gd((e=>{let{number:t=0,NumberComponent:r=ce.TextHuge}=e;return(0,pe.jsx)(r,{strong:!0,children:t})}));function bd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function md(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?bd(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bd(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const xd=e=>{const t=e.reduce(((e,t)=>{let{value:r}=t;return e+r}),0);return e.map((e=>md(md({},e),{},{width:"".concat(Math.floor(e.value/t*100),"%")})))},jd=function(){let{data:e=[],testId:t="",numberIndicatorProps:r={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,pe.jsxs)(ce.Flex,{width:"100%",column:!0,gap:2,children:[(0,pe.jsx)(ce.Flex,{justifyContent:"around",children:e.map((e=>{let{label:t,value:n}=e;return(0,pe.jsx)(fd,md({title:t,number:n},r),"".concat(t,"-").concat(n))}))}),(0,pe.jsx)(ce.ProgressBar,{background:"borderSecondary",border:"none",containerWidth:"100%","data-testid":t,height:2,value:xd(e.filter((e=>{let{omit:t}=e;return!t})))})]})},yd=["nodesLoaded","total","count","live","offline","stale","unseen"];function vd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Od(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?vd(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vd(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const wd=gd((e=>{let{nodesLoaded:t,total:r,count:o,live:i,offline:s,stale:a,unseen:l}=e,c=(0,W.A)(e,yd);const d=(0,n.useMemo)((()=>[...[{label:"Live",value:i,color:"success"},{label:"Offline",value:s,color:"offline"},{label:"Stale",value:a,color:"stale"}],...l?[{label:"Unseen",value:l,color:"unseen"}]:[]]),[i,s,a,l]);return(0,pe.jsxs)(ce.Flex,{width:"100%",column:!0,alignItems:"center",gap:4,children:[(0,pe.jsxs)(ce.Flex,{gap:2,alignItems:"baseline",children:[t?(0,pe.jsx)(ce.TextHuge,Od(Od({strong:!0},c),{},{children:o})):(0,pe.jsx)(ce.Text,{children:"Loading..."}),t&&r!==o&&(0,pe.jsxs)(ce.Text,{children:["of ",r]})]}),(0,pe.jsx)(jd,{data:d,numberIndicatorProps:{TitleComponent:ce.TextBig,NumberComponent:ce.TextBigger}})]})})),Pd=e=>{const t=(0,B.nj)(),r=(0,B.CK)(),o=r.length,i=(0,G.eO)({keepAll:!1}),s=(0,n.useMemo)((()=>i.reduce(((e,t)=>{let{isLive:r,isOffline:n,isUnseen:o,state:i}=t;return{live:r?e.live+1:e.live,offline:n?e.offline+1:e.offline,stale:"stale"===i?e.stale+1:e.stale,unseen:o?e.unseen+1:e.unseen}}),{live:0,offline:0,stale:0,unseen:0})),[i]),a=(0,n.useMemo)((()=>{const e=(null===i||void 0===i?void 0:i.length)||"-";return Od({nodesLoaded:t,total:o,count:e,title:t&&i&&o!==e?"Selected nodes":"Total nodes"},s)}),[t,r,i,o,s]);return(0,pe.jsx)(wd,Od(Od({},a),e))};var Cd=r(50916),Id=r.n(Cd);function Ad(e){return e*Math.PI/180}function kd(e,t,r){return e>r?r:e<t?t:e}function Sd(e,t){return t/100*e}function Dd(e,t){return e+t/2}function Td(e,t){const r=Ad(e);return{dx:t*Math.cos(r),dy:t*Math.sin(r)}}function Md(e){return"number"===typeof e}function Fd(e,t){return"function"===typeof e?e(t):e}function Nd({renderLabel:e,labelProps:t}){const r=e(t);if("string"===typeof r||"number"===typeof r){const{dataEntry:e,dataIndex:o,...i}=t;return n.createElement("text",{dominantBaseline:"central",...i},r)}return n.isValidElement(r)?r:null}function Ed({labelPosition:e,lineWidth:t,labelHorizontalShift:r}){const n=function(e){const t=1e14;return Math.round((e+Number.EPSILON)*t)/t}(r);if(0===n)return"middle";if(e>100)return n>0?"start":"end";return e<100-t?n>0?"end":"start":"middle"}function Ld(e,t){const{label:r}=t;if(r)return function(e,t){return e.map(((e,r)=>{const n=Fd(t.segmentsShift,r)??0,o=Sd(t.radius,t.labelPosition)+n,{dx:i,dy:s}=Td(Dd(e.startAngle,e.degrees),o);return{x:t.center[0],y:t.center[1],dx:i,dy:s,textAnchor:Ed({labelPosition:t.labelPosition,lineWidth:t.lineWidth,labelHorizontalShift:i}),dataEntry:e,dataIndex:r,style:Fd(t.labelStyle,r)}}))}(e,t).map(((e,t)=>n.createElement(Nd,{key:`label-${e.dataEntry.key||t}`,renderLabel:r,labelProps:e})))}function Bd({cx:e,cy:t,lengthAngle:r,lineWidth:o,radius:i,shift:s=0,reveal:a,rounded:l,startAngle:c,title:d,...u}){const p=i-o/2,{dx:h,dy:g}=Td(Dd(c,r),s),f=function(e,t,r,n,o){const i=kd(n,-359.999,359.999);return Id()(e,t,o,Ad(r),Ad(r+i)).map((e=>e.join(" "))).join(" ")}(e+h,t+g,c,r,p);let b,m;if(Md(a)){const e=Ad(p)*r;b=Math.abs(e),m=b-Sd(b,a)}return n.createElement("path",{d:f,fill:"none",strokeWidth:o,strokeDasharray:b,strokeDashoffset:m,strokeLinecap:l?"round":void 0,...u},d&&n.createElement("title",null,d))}function Rd(e,t,r){let n=`stroke-dashoffset ${e}ms ${t}`;return r&&r.transition&&(n=`${n},${r.transition}`),{transition:n}}function Vd(e,t){return e&&(r=>{e(r,t)})}function Hd(e,t,r){const o=r??function({reveal:e,animate:t}){return t&&!Md(e)?100:e}(t),{radius:i,center:[s,a]}=t,l=Sd(i,t.lineWidth),c=e.map(((e,r)=>{const c=Fd(t.segmentsStyle,r);return n.createElement(Bd,{cx:s,cy:a,key:e.key||r,lengthAngle:e.degrees,lineWidth:l,radius:i,rounded:t.rounded,reveal:o,shift:Fd(t.segmentsShift,r),startAngle:e.startAngle,title:e.title,style:Object.assign({},c,t.animate&&Rd(t.animationDuration,t.animationEasing,c)),stroke:e.color,tabIndex:t.segmentsTabIndex,onBlur:Vd(t.onBlur,r),onClick:Vd(t.onClick,r),onFocus:Vd(t.onFocus,r),onKeyDown:Vd(t.onKeyDown,r),onMouseOver:Vd(t.onMouseOver,r),onMouseOut:Vd(t.onMouseOut,r)})}));return t.background&&c.unshift(n.createElement(Bd,{cx:s,cy:a,key:"bg",lengthAngle:t.lengthAngle,lineWidth:l,radius:i,rounded:t.rounded,startAngle:t.startAngle,stroke:t.background})),c}const _d={animationDuration:500,animationEasing:"ease-out",center:[50,50],data:[],labelPosition:50,lengthAngle:360,lineWidth:100,paddingAngle:0,radius:50,startAngle:0,viewBoxSize:[100,100]};function Kd(e){const t=function(e){const t=Object.assign({},_d,e);let r;for(r in _d)void 0===e[r]&&(t[r]=_d[r]);return t}(e),[r,o]=(0,n.useState)(t.animate?0:null);(0,n.useEffect)((()=>{t.animate&&o(null)}),[]);const i=function({data:e,lengthAngle:t,totalValue:r,paddingAngle:n,startAngle:o}){const i=r||function(e){let t=0;for(let r=0;r<e.length;r++)t+=e[r].value;return t}(e),s=kd(t,-360,360),a=360===Math.abs(s)?e.length:e.length-1,l=Math.abs(n)*Math.sign(t),c=s-l*a;let d=0;const u=[];for(let p=0;p<e.length;p++){const t=e[p],r=0===i?0:t.value/i*100,n=Sd(c,r),s=d+o;d=d+n+l,u.push(Object.assign({percentage:r,startAngle:s,degrees:n},t))}return u}(t);return n.createElement("svg",{viewBox:`0 0 ${t.viewBoxSize[0]} ${t.viewBoxSize[1]}`,width:"100%",height:"100%",className:t.className,style:t.style},Hd(i,t,r),Ld(i,t),t.children)}const zd=(0,jn.default)(ce.TextSmall).withConfig({displayName:"pieChartLabels__StyledText",componentId:"sc-3919ls-0"})(["display:flex;align-items:center;cursor:",";&:hover{opacity:",";}"],(e=>{let{onClick:t}=e;return t?"pointer":"auto"}),(e=>{let{onClick:t}=e;return t?"0.7":"1"})),Gd=(0,n.memo)((e=>{let{title:t,value:r,color:n,onClick:o=null}=e;return(0,pe.jsxs)(ce.Flex,{alignItems:"center",justifyContent:"between",width:"100%",gap:4,flex:{grow:1,shrink:0},children:[(0,pe.jsxs)(ce.Flex,{gap:1,children:[(0,pe.jsx)(ce.Flex,{width:"4px",height:"16px",background:n}),(0,pe.jsxs)(zd,{whiteSpace:"nowrap",onClick:o,children:[t,o&&(0,pe.jsx)(ce.Icon,{color:"textLite",margin:[0,0,0,1],name:"nav_arrow_goto",height:"10px",width:"10px"})]})]}),(0,pe.jsx)(ce.Text,{strong:!0,children:null!==r&&void 0!==r?r:"-"})]})})),Wd=e=>{let{data:t}=e;return(0,pe.jsx)(ce.Flex,{column:!0,alignItems:"start",justifyContent:"center",gap:5,children:t.map(((e,t)=>{let{title:r,value:n,color:o,onClick:i}=e;return(0,pe.jsx)(Gd,{title:r,value:n,color:o,onClick:i},"".concat(r,"-").concat(n,"-").concat(t))}))})};function qd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ud(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qd(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qd(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Jd=e=>{let{data:t,theme:r}=e;return t.map((e=>Ud(Ud({},e),{},{color:(0,ce.getColor)(e.color)({theme:r})})))},Zd=e=>{let{chartData:t=[],lineWidth:r=15,animate:o=!0,label:i,hasData:s}=e;const a=(0,n.useContext)(jn.ThemeContext);return(0,pe.jsxs)(ce.Flex,{gap:4,margin:[0,4],height:{min:"70px",max:"130px"},alignItems:"center",children:[(0,pe.jsx)(ce.Flex,{height:"70px",flex:{grow:1,shrink:1},children:s?(0,pe.jsx)(Kd,{label:()=>i,labelStyle:{fontSize:"34px",fontWeight:700,lineHeight:"38px",fill:(0,ce.getColor)("textDescription")({theme:a})},labelPosition:0,data:Jd({data:t,theme:a}),lineWidth:r,animate:o}):(0,pe.jsx)(ce.Icon,{color:"border",name:"pie_chart_skeleton",width:"70px",height:"70px",alignSelf:"center"})}),(0,pe.jsx)(Wd,{data:t})]})};function Xd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function $d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Xd(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xd(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Yd=gd((e=>(0,pe.jsx)(ce.Flex,{gap:2,justifyContent:"between",padding:[2,0,0,0],children:(0,pe.jsx)(Zd,$d({},e))}))),Qd=e=>{const t=(0,Pc.QD)({extraKey:"alerts"}),{critical:r,warning:o}=(t||[]).reduce(((e,t)=>{let{status:r}=t;return $d($d({},e),{},{[r]:e[r]+1})}),{critical:0,warning:0}),i=(0,hl.x7)(),s=(0,n.useMemo)((()=>({chartData:[{title:"Critical",value:r,color:"errorText",onClick:()=>i("critical")},{title:"Warning",value:o,color:"warningText",onClick:()=>i("warning")}],hasData:!(null===t||void 0===t||!t.length),label:null===t||void 0===t?void 0:t.length})),[r,o,i]);return(0,pe.jsx)(Yd,$d($d({title:"Active alerts"},s),e))},eu=()=>(0,pe.jsxs)(ce.Flex,{"data-testid":"home-nodes-overview-left-section",column:!0,gap:4,basis:"205px",children:[(0,pe.jsx)(Pd,{}),(0,pe.jsx)(Wi.A,{}),(0,pe.jsx)(Qd,{})]});var tu=r(63950),ru=r.n(tu),nu=r(31522),ou=r(41395);const iu=e=>{let{label:t,color:r}=e;return(0,pe.jsxs)(ce.Flex,{height:"24px",gap:1,alignItems:"center",children:[(0,pe.jsx)(ce.Flex,{width:"12px",height:"12px",background:r}),(0,pe.jsx)(ce.Text,{children:(0,ou.Zr)(t)})]})},su=e=>{let{colorBy:t}=e;const r=Object.entries(nu.Cc[null===t||void 0===t?void 0:t.value]||{}),n=nu.Ug[null===t||void 0===t?void 0:t.value]||{};return r.length?(0,pe.jsx)(ce.Flex,{"data-testid":"home-nodes-overview-main-section-header-colors-legend",gap:2,children:r.map((e=>{let[t,r]=e;return(0,pe.jsx)(iu,{label:n[t]||t,color:r},t)}))}):null};function au(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function lu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?au(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):au(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const cu=(0,Nr.A)(ce.Icon),du=e=>{let{nodes:t=[],groupBy:r,setGroupBy:o=ru(),colorBy:i,setColorBy:s=ru(),onAddNode:a}=e;const l=(0,n.useMemo)((()=>function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce(((e,t)=>{const{labels:r}=t||{};return Object.entries(r||{}).forEach((t=>{let[r,n]=t;e[r]?e[r]=Array.from(new Set([...e[r],n])):e[r]=[n]})),e}),{})}(t)),[t]),c=(0,n.useMemo)((()=>function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.keys(e).map((e=>({label:"label:".concat(e),value:"label:".concat(e)})))}(l).sort(((e,t)=>e.value.localeCompare(t.value,void 0,{sensitivity:"accent",ignorePunctuation:!0})))),[l]),d=(0,n.useMemo)((()=>[...nu.XJ,...c]),[c]);return(0,pe.jsxs)(ce.Flex,{"data-testid":"home-nodes-overview-main-section-header",alignItems:"end",justifyContent:"between",children:[(0,pe.jsxs)(ce.Flex,{gap:3,alignItems:"end",children:[(0,pe.jsxs)(ce.Flex,{column:!0,gap:1,children:[(0,pe.jsxs)(ce.Flex,{alignItems:"center",gap:1,children:[(0,pe.jsx)(ce.Text,{color:"menuItem",children:"Group by"}),(0,pe.jsx)(cu,{name:"information",color:"menuItem",tooltip:{title:"Group nodes",description:"Group nodes by attributes like status, OS, or custom host labels. You can select multiple for multi-level grouping."},tooltipProps:{align:"bottom"},noWrapper:!0})]}),(0,pe.jsx)(ce.Select,lu({isMulti:!0,options:d,value:r,onChange:o},(null===c||void 0===c?void 0:c.length)>0?{styles:{minWidth:"250px"}}:{}))]}),(0,pe.jsxs)(ce.Flex,{column:!0,gap:1,children:[(0,pe.jsx)(ce.Text,{color:"menuItem",children:"Color by"}),(0,pe.jsx)(ce.Select,{options:nu.Hn,value:i,onChange:s})]}),(0,pe.jsx)(su,{colorBy:i})]}),(0,pe.jsx)(Ce.A,{flavour:"borderless",icon:"add_node",iconColor:"text",onClick:a})]})},uu=(0,jn.default)(ce.Box).withConfig({displayName:"styled__PolygonContainer",componentId:"sc-9bx1cv-0"})(["width:22px;position:relative;aspect-ratio:1;background-color:",";cursor:",";opacity:",";clip-path:polygon( 93.56% 74.55%,50.52% 100%,6.96% 75.45%,6.44% 25.45%,49.48% 0%,93.04% 24.55%,93.56% 74.55% );"],(e=>{let{background:t}=e;return(0,ce.getColor)(t||"offline")}),(e=>{let{onClick:t}=e;return t?"pointer":"default"}),(e=>{let{isDisabled:t}=e;return t?"0.5":"1"})),pu=(0,jn.default)(ce.Box).withConfig({displayName:"styled__PolygonInner",componentId:"sc-9bx1cv-1"})(["width:18px;position:absolute;top:2px;left:2px;aspect-ratio:1;background-color:",";opacity:",";clip-path:polygon( 93.56% 74.55%,50.52% 100%,6.96% 75.45%,6.44% 25.45%,49.48% 0%,93.04% 24.55%,93.56% 74.55% );"],(e=>{let{background:t}=e;return(0,ce.getColor)(t||"offline")}),(e=>{let{isDisabled:t}=e;return t?"0.5":"1"})),hu=(0,jn.default)(ce.Icon).withConfig({displayName:"styled__AddNodeIcon",componentId:"sc-9bx1cv-2"})(["position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);"]),gu=(0,jn.default)(ce.Box).withConfig({displayName:"styled__Groups",componentId:"sc-9bx1cv-3"})(["width:100%;display:grid;grid-template-columns:repeat(2,1fr);gap:16px;"]),fu=(0,jn.default)(ce.Flex).withConfig({displayName:"styled__NodeContainer",componentId:"sc-9bx1cv-4"})(["opacity:",";"],(e=>{let{isActive:t}=e;return t?"1":".3"})),bu=["children","innerProps","containerProps"];function mu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function xu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?mu(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const ju=(0,Nr.A)((e=>{let{children:t,innerProps:r={},containerProps:n={}}=e,o=(0,W.A)(e,bu);return(0,pe.jsx)(fu,xu(xu({margin:[0,0,.5,0]},o),{},{children:(0,pe.jsx)(uu,xu(xu({},n),{},{children:(0,pe.jsx)(pu,xu(xu({},r),{},{children:t}))}))}))})),yu=e=>{let{type:t,onClick:r}=e;const o=(0,v.XA)(),i=(0,y.dg)(),s=(0,g.JT)("node:Create"),a=(0,n.useMemo)((()=>xu({background:"success",isDisabled:!s},s?{onClick:()=>r({type:t})}:{})),[s]),l=s?"Add node":i?"You are viewing your local node, connect to cloud and connect multiple nodes to view at once":"Only admin users can add nodes to ".concat(o.name);return(0,pe.jsx)(pe.Fragment,{children:(0,pe.jsx)(ju,{containerProps:a,innerProps:{background:"panelBg"},tooltip:l,isActive:!0,children:(0,pe.jsx)(hu,{name:"plus",color:"success"})})})},vu=ju;var Ou=r(89284),wu=r(91100);const Pu=e=>{var t,r;let{architecture:n,cpuFrequency:o,cpus:i,diskSpace:s,memory:a,os:l,osName:c}=e;const d=[(0,Dt.O)(o),(0,Dt.ws)(i,1===i?"Core":"Cores"),(0,Dt.ws)(n),(0,Dt.ws)((0,Dt.RI)(a),"RAM"),(0,Dt.ws)((0,Dt.RI)(s),"HD")];return(0,pe.jsxs)(ce.Flex,{column:!0,gap:1,children:[(0,pe.jsxs)(ce.Flex,{gap:1,children:[(0,pe.jsx)(ce.Icon,{"data-testid":"node-system-info-icon",name:(null===(t=yt.u[c])||void 0===t?void 0:t.iconName)||(null===(r=yt.U[l])||void 0===r?void 0:r.iconName)||"os",width:"16px",height:"16px",color:"text"}),(0,pe.jsx)(ce.Flex,{children:(0,Dt.ws)(c)})]}),d.map(((e,t)=>(0,pe.jsxs)(ce.Text,{children:["\u2022 ",e]},t)))]})};var Cu=r(23208);function Iu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Au(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Iu(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Iu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const ku=e=>{let{isStable:t}=e;const r=t?{icon:"checkmark_s",color:"primary",borderColor:"primary"}:{icon:"warning_triangle",color:"stale",borderColor:"stale"};return(0,pe.jsx)(ce.Pill,Au(Au({hollow:!0},r),{},{children:t?"Stable":"Unstable"}))},Su=function(){let{id:e,name:t,state:r,hw:o,os:i,isStable:s,setActiveNodes:a}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const l=(0,pc.c8)(),{nodes:c}=l||{},d=null===c||void 0===c?void 0:c[e];return(0,n.useEffect)((()=>{if("function"===typeof a){const{children:t,parents:r}=d||{},n=d?[...[...r,...t].map((e=>{let{id:t}=e;return t}))||[],e]:[e];a({isHover:!0,nodes:n})}return()=>{"function"===typeof a&&a(nu.vd)}}),[e,d]),(0,pe.jsxs)(ce.Flex,{column:!0,gap:3,width:{min:40},background:"mainBackground",padding:[2,4],children:[(0,pe.jsx)(ce.TextBig,{strong:!0,children:t}),(0,pe.jsxs)(ce.Flex,{column:!0,gap:1,children:[(0,pe.jsx)(ce.Text,{children:"Status"}),(0,pe.jsx)(ce.Flex,{children:(0,pe.jsx)(Ou.A,{state:r})})]}),(0,pe.jsxs)(ce.Flex,{column:!0,gap:1,children:[(0,pe.jsx)(ce.Text,{children:"Connection"}),(0,pe.jsx)(ce.Flex,{children:(0,pe.jsx)(ku,{isStable:s})})]}),(0,pe.jsxs)(ce.Flex,{column:!0,gap:1,children:[(0,pe.jsx)(ce.Text,{children:"Alerts"}),(0,pe.jsx)(wu.A,{id:e})]}),(0,pe.jsx)(Wi.A,{color:"textLite"}),(0,pe.jsx)(Pu,{architecture:o.architecture,cpuFrequency:o.cpuFrequency,cpus:o.cpus,"data-testid":"nodeRow-system-info",diskSpace:o.diskSpace,memory:o.memory,name:t,osName:i.nm,os:i.id}),(0,pe.jsx)(Wi.A,{color:"textLite"}),(0,pe.jsx)(Cu.A,{id:e})]})};const Du=function(){var e;let{colorBy:t={},node:r={},isStable:o}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{value:i}=t,s=nu.AZ[i],a=(0,ki.Xt)(r.id),{critical:l,warning:c}=(0,$a.AO)(a),d=nu.Cc[i];let u=d[null===s||void 0===s||null===(e=s(r))||void 0===e||null===(e=e.group)||void 0===e?void 0:e.toLowerCase()];if(i==nu.w9.stability.value){u=d[o?"stable":"unstable"]}return{borderColor:(0,n.useMemo)((()=>(e=>{let{critical:t,warning:r}=e;return t?"error":r?"warning":null})({critical:l,warning:c})||u),[u,l,c]),background:u}},Tu=["colorBy","stability","setActiveNodes"];function Mu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Fu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Mu(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Nu=e=>{let{colorBy:t,stability:r={},setActiveNodes:o}=e,i=(0,W.A)(e,Tu);const{isStable:s}=r[i.id]||{},{borderColor:a,background:l}=Du({colorBy:t,node:i,isStable:s}),[,c]=(0,pc.A$)(),d=(0,n.useCallback)((()=>c(i.id)),[i.id,c]);return(0,pe.jsx)(vu,Fu({containerProps:{background:a,onClick:d},innerProps:{background:l},tooltip:(0,pe.jsx)(Su,Fu({isStable:s,setActiveNodes:o},i))},i))};var Eu=r(67462);const Lu=["title"];function Bu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ru(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Bu(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Bu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Vu=e=>t=>{var r;let{title:o}=t,i=(0,W.A)(t,Lu);const s=(0,n.useMemo)((()=>"nolabel"===o?"".concat(i.groupBy," (No value)"):"".concat(i.groupBy,"=").concat(o)),[o,i.groupBy]);return o?(0,pe.jsxs)(ce.Flex,{width:"100%",column:!0,gap:2,children:[(0,pe.jsxs)(ce.Flex,{justifyContent:"between",border:{side:"bottom",color:"border"},children:[(0,pe.jsx)(ce.Text,{strong:!0,color:"menuItem",children:s}),null!==(r=i.nodes)&&void 0!==r&&r.length?(0,pe.jsx)(ce.Text,{color:"menuItem",children:"".concat(i.nodes.length," ").concat((0,Eu.su)(i.nodes.length))}):null]}),(0,pe.jsx)(e,Ru({},i))]}):(0,pe.jsx)(e,Ru({},i))},Hu=["nodes","type","stability","groupBy","colorBy","onAddNode"];function _u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ku(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_u(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const zu=(0,n.memo)((e=>{let{nodes:t=[],type:r,stability:o={},groupBy:i,colorBy:s,onAddNode:a}=e,l=(0,W.A)(e,Hu);const[c,d]=(0,n.useState)(nu.vd),{isHover:u,nodes:p}=c,h=null===i||void 0===i?void 0:i.canAddNodes;return(0,pe.jsxs)(ce.Flex,Ku(Ku({flexWrap:!0},l),{},{children:[t.map((e=>(0,pe.jsx)(Nu,Ku({colorBy:s,stability:o,isActive:!u||p.includes(e.id),setActiveNodes:d},e),e.id))),h?(0,pe.jsx)(yu,{type:r,onClick:a}):null]}))})),Gu=Vu((e=>t=>{const{stability:r}=(0,pc.SW)();return(0,pe.jsx)(e,Ku({stability:r},t))})(zu));function Wu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function qu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Wu(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Wu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Uu=e=>t=>{const r=nu.AZ[e],n=(0,nu.Hl)(e);return t.reduce(((e,t)=>{const{group:o="unknown",type:i}=r(t);return e[o]?e[o].nodes=[...e[o].nodes,t]:e[o]={title:n(o)||"unknown",type:i,nodes:[t]},e}),{})},Ju={os:Uu("os"),version:Uu("version"),status:Uu("status"),technology:Uu("technology"),replication:Uu("replication"),cloudProvider:Uu("cloudProvider"),cloudRegion:Uu("cloudRegion"),instanceType:Uu("instanceType"),none:e=>({none:{nodes:e}})},Zu=e=>{var t,r;let{value:n,nodes:o}=e;return n.startsWith("label:")?null===(i=n.replace(/^label:/,""),t=e=>{const t=function(){let e=arguments.length>1?arguments[1]:void 0;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce(((t,r)=>{const{labels:n}=r||{},o=n[e]||"nolabel";return o&&(t[o]?t[o]=[...t[o],r]:t[o]=[r]),t}),{})}(e,i);return Object.entries(t).reduce(((e,t)=>{let[r,n]=t;return qu(qu({},e),{},{[r]:{title:r,nodes:n}})}),{})})||void 0===t?void 0:t(o):null===(r=Ju[n])||void 0===r?void 0:r.call(Ju,o);var i},Xu=()=>(0,pe.jsx)(ce.Flex,{children:(0,pe.jsx)(ce.TextBig,{color:"menuItem",children:"No nodes found"})}),$u=e=>{let{nodes:t,groupBy:r,title:o,groupByValue:i,children:s}=e;const{value:a}=Array.isArray(r)&&r.length>0?r[0]:nu.nv,l=Zu({value:a,nodes:t}),c=(0,n.useMemo)((()=>Object.keys(l).length),[l]);return(0,pe.jsxs)(ce.Flex,{"data-testid":"nodes-group-".concat(i,"-").concat(o),column:!0,gap:2,padding:[2,4],round:2,border:{side:"all",color:"border"},children:[(0,pe.jsxs)(ce.Flex,{alignItems:"center",justifyContent:"between",children:[(0,pe.jsxs)(ce.Text,{strong:!0,color:"menuItem",children:[i,": ",o]}),c>1?(0,pe.jsxs)(ce.Text,{color:"menuItem",children:[t.length," ",(0,Eu.su)(t.length)]}):null]}),s]},o)},Yu=e=>{let{nodes:t,groupBy:r,colorBy:o,onAddNode:i}=e;const{value:s}=Array.isArray(r)&&r.length>0?r[0]:nu.nv,a=Zu({value:s,nodes:t}),l=(0,n.useMemo)((()=>Object.values(a)),[a]);if(!a)return(0,pe.jsx)(Xu,{});if(!l.length)return(0,pe.jsx)(Xu,{});if((null===r||void 0===r?void 0:r.value)===nu.nv.value){const{nodes:e}=l[0];return(0,pe.jsx)(Gu,{nodes:e,groupBy:r,colorBy:o,onAddNode:i})}if(r.length>1)return(0,pe.jsx)(ce.Flex,{column:!0,gap:4,children:l.map((e=>{let{title:t,nodes:n}=e;return(0,pe.jsx)($u,{groupBy:r.slice(1),nodes:n,title:t,groupByValue:s,children:(0,pe.jsx)(Yu,{nodes:n,groupBy:r.slice(1),colorBy:o,onAddNode:i})},t)}))});const c=1===l.length||r.length>1?ce.Flex:gu;return(0,pe.jsx)(c,{children:l.map(((e,t)=>{let{title:r,type:n,nodes:a}=e;return(0,pe.jsx)(Gu,{title:r,type:n,nodes:a,groupBy:s,colorBy:o,onAddNode:i,margin:[0,0,2,0]},r||t)}))})},Qu=Yu,ep=()=>(0,pe.jsxs)(ce.Flex,{width:"100%",column:!0,gap:2,padding:[2,0],children:[(0,pe.jsxs)(ce.Flex,{gap:2,children:[(0,pe.jsx)(yn.A,{width:"22px",height:"22px",round:2}),(0,pe.jsx)(yn.A,{width:"22px",height:"22px",round:2}),(0,pe.jsx)(yn.A,{width:"22px",height:"22px",round:2}),(0,pe.jsx)(yn.A,{width:"22px",height:"22px",round:2}),(0,pe.jsx)(yn.A,{width:"22px",height:"22px",round:2}),(0,pe.jsx)(yn.A,{width:"22px",height:"22px",round:2})]}),(0,pe.jsxs)(ce.Flex,{gap:2,children:[(0,pe.jsx)(yn.A,{width:"22px",height:"22px",round:2}),(0,pe.jsx)(yn.A,{width:"22px",height:"22px",round:2}),(0,pe.jsx)(yn.A,{width:"22px",height:"22px",round:2}),(0,pe.jsx)(yn.A,{width:"22px",height:"22px",round:2}),(0,pe.jsx)(yn.A,{width:"22px",height:"22px",round:2}),(0,pe.jsx)(yn.A,{width:"22px",height:"22px",round:2})]})]}),tp=()=>{const[e,t]=(0,n.useState)([]),[r,o]=(0,n.useState)(nu.jZ),[i,s]=(0,n.useState)(),a=(0,v.ID)(),l=(0,B.gr)(a,"loaded"),c=(0,G.eO)({keepAll:!1}),d=(0,n.useCallback)((e=>{s(e)}),[s]),u=(0,n.useCallback)((()=>s()),[s]);return(0,pe.jsxs)(ce.Flex,{"data-testid":"home-nodes-overview-main-section",column:!0,gap:4,basis:"calc(100% - 410px)",children:[(0,pe.jsx)(du,{nodes:c,groupBy:e,setGroupBy:t,colorBy:r,setColorBy:o,onAddNode:d}),(0,pe.jsx)(ce.Flex,{height:{max:150},overflow:{vertical:"auto"},children:l?(0,pe.jsx)(Qu,{nodes:c,groupBy:e,colorBy:r,onAddNode:d}):(0,pe.jsx)(ep,{})}),i&&(0,pe.jsx)(Ie.A,{nodeType:null===i||void 0===i?void 0:i.type,onClose:u})]})},rp=()=>(0,pe.jsxs)(ce.Flex,{width:"100%",column:!0,gap:2,padding:[2,0],children:[(0,pe.jsxs)(ce.Flex,{justifyContent:"between",children:[(0,pe.jsx)(yn.A,{width:"30%"}),(0,pe.jsx)(yn.A,{width:"30%"}),(0,pe.jsx)(yn.A,{width:"30%"})]}),(0,pe.jsxs)(ce.Flex,{justifyContent:"between",children:[(0,pe.jsx)(yn.A,{width:"30%"}),(0,pe.jsx)(yn.A,{width:"30%"}),(0,pe.jsx)(yn.A,{width:"30%"})]}),(0,pe.jsx)(yn.A,{})]}),np=()=>{const{loaded:e,totalChildren:t,totalParents:r,totalStandalone:o}=(0,pc.c8)(),i=(0,n.useMemo)((()=>[{label:"Parents",value:r,color:["blue","indigo"]},{label:"Children",value:t,color:["purple","lilac"]},{label:"Standalone",value:o,color:["yellow","yellow120"]}]),[t,r]);return e?(0,pe.jsx)(jd,{numberIndicatorProps:{TitleComponent:ce.Text},data:i}):(0,pe.jsx)(rp,{height:"58px"})},op=()=>(0,pe.jsxs)(ce.Flex,{width:"100%",column:!0,gap:2,padding:[2,0],children:[(0,pe.jsxs)(ce.Flex,{justifyContent:"between",children:[(0,pe.jsx)(yn.A,{width:"30%"}),(0,pe.jsx)(yn.A,{width:"30%"}),(0,pe.jsx)(yn.A,{width:"30%"})]}),(0,pe.jsxs)(ce.Flex,{justifyContent:"between",children:[(0,pe.jsx)(yn.A,{width:"30%"}),(0,pe.jsx)(yn.A,{width:"30%"}),(0,pe.jsx)(yn.A,{width:"30%"})]}),(0,pe.jsx)(yn.A,{})]}),ip=()=>(0,pe.jsxs)(ce.Flex,{column:!0,gap:1,alignItems:"center",width:"220px","data-testid":"nodesByDataReplication-information-text",overflow:"hidden",children:[(0,pe.jsxs)(ce.TextMicro,{children:[(0,pe.jsx)(ce.TextMicro,{strong:!0,children:"None:"})," The node's data are only on the node itself. Lose the node, lose the data!"]}),(0,pe.jsxs)(ce.TextMicro,{children:[(0,pe.jsx)(ce.TextMicro,{strong:!0,children:"Single:"})," The node's metrics are replicated to one parent. The parent can trigger alerts for the child."]}),(0,pe.jsxs)(ce.TextMicro,{children:[(0,pe.jsx)(ce.TextMicro,{strong:!0,children:"Multi:"})," Same as dual replication, but with the metrics replicated to more than one parent. Each parent in the hierarchy can trigger alerts for its children."]}),(0,pe.jsx)(ce.TextMicro,{margin:[2,0],children:"Aim to have most of your nodes with at least a dual replication and your critical ones with a multiple one."})]}),sp=()=>(0,pe.jsx)(tt.A,{isBasic:!0,plain:!0,content:ip,align:"bottom",children:(0,pe.jsx)(ce.Icon,{name:"information",color:"textDescription",size:"small"})}),ap=gd((()=>{const e=(0,pc.c8)(),{loaded:t,replicationFactor:r}=e||{},o=(0,n.useMemo)((()=>[{label:"None",value:(null===r||void 0===r?void 0:r.r_1)||0,color:nu.q5.r_1},{label:"Single",value:(null===r||void 0===r?void 0:r.r_2)||0,color:nu.q5.r_2},{label:"Multi",value:(null===r||void 0===r?void 0:r["r_*"])||0,color:nu.q5["r_*"]}]),[r]);return t?(0,pe.jsx)(jd,{data:o}):(0,pe.jsx)(op,{})})),lp=()=>(0,pe.jsx)(ap,{title:"Data Replication",headerInfo:(0,pe.jsx)(sp,{})}),cp=()=>(0,pe.jsxs)(ce.Flex,{"data-testid":"home-nodes-overview-right-section",column:!0,gap:4,basis:"205px",children:[(0,pe.jsx)(np,{}),(0,pe.jsx)(Wi.A,{}),(0,pe.jsx)(lp,{})]}),dp=()=>(0,pe.jsxs)(rd,{children:[(0,pe.jsx)(eu,{}),(0,pe.jsx)(Wi.A,{vertical:!0}),(0,pe.jsx)(tp,{}),(0,pe.jsx)(Wi.A,{vertical:!0}),(0,pe.jsx)(cp,{})]});var up=r(66118),pp=r(44731);function hp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function gp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?hp(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hp(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}up.t1.register(up.PP,up.kc,up.A6,up.E8,up.m_,up.s$);const fp={borderWidth:0,maxBarThickness:15,minBarLength:0},bp=function(){let{alertsStats:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,n.useContext)(jn.ThemeContext),{hosts:r}=(null===e||void 0===e?void 0:e.nodes)||{},o={animation:!1,maintainAspectRatio:!1,plugins:{legend:{display:!1}},responsive:!0,scales:{x:{stacked:!0,grid:{color:(0,ce.getColor)("borderSecondary")({theme:t})},afterSetDimensions:e=>{e.maxHeight=50},ticks:{precision:0,callback:(e,t)=>{let r=i.labels[t];if(!r)return;let n=0;for(;(null===(o=r)||void 0===o?void 0:o.length)>20;){var o;r=(0,ou.P3)(r,n),n+=1}return r}}},y:{stacked:!0,grid:{color:(0,ce.getColor)("borderSecondary")({theme:t})},afterSetDimensions:e=>{e.maxWidth=50}}}},i=(0,n.useMemo)((()=>{if(!r)return{datasets:[],labels:[]};const[e,t]=Object.entries(r).sort(((e,t)=>t[1].total-e[1].total)).reduce(((e,t)=>{let[r,{critical:n,warning:o}]=t;return e[0].push(r),e[1].critical?e[1].critical=[...e[1].critical,n]:e[1].critical=[n],e[1].warning?e[1].warning=[...e[1].warning,o]:e[1].warning=[o],e}),[[],{}]);return{datasets:Object.entries(t).map((e=>{let[t,r]=e;return gp(gp({},fp),{},{backgroundColor:"critical"===t?"#DB162F":"#FF9700",data:r,label:t})})),labels:e}}),[r]);return i.datasets?(0,pe.jsx)(ce.Flex,{width:"100%",height:40,children:(0,pe.jsx)(pp.yP,{data:i,options:o})}):null},mp=e=>{let{alertsStats:t}=e;const{nodes:r}=t||{},{critical:o,warning:i,total:s}=r||{},a=(0,n.useMemo)((()=>[{label:"Warning",value:i,color:["yellow","yellow80"]},{label:"Critical",value:o,color:["red","red100"]},{label:"Total",value:s,color:["purple","lilacFocus"],omit:!0}]),[o,i,s]);return r?(0,pe.jsx)(jd,{data:a}):null},xp=[{id:"name",accessorKey:"name",header:"Alert name",fullWidth:!0,cell:e=>{let{getValue:t,row:r}=e;const o=t(),{goToAlerts:i}=ql(),s=(0,n.useCallback)((e=>{var t;e.preventDefault(),i({name:o,instance:null===r||void 0===r||null===(t=r.original)||void 0===t?void 0:t.chart})}),[i]);return(0,pe.jsx)(tt.A,{content:"Go to events tab. Timeframe will be set to the last 24 hours.",isBasic:!0,children:(0,pe.jsx)(ce.Box,{children:(0,pe.jsx)(je.A,{onClick:s,children:o})})})}},{id:"chart",name:"chart",fullWidth:!0,header:"Instance"},{id:"occurrences",name:"occurrences",header:"Occurrences"},{id:"duration",name:"duration",header:"Duration (seconds)"}],jp=function(){let{data:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.length?(0,pe.jsx)(ce.Flex,{height:{max:50},overflow:{vertical:"auto"},children:(0,pe.jsx)(ce.Table,{data:e,dataColumns:xp,sortBy:[{id:"occurrences",desc:!0}],enableResizing:!0})}):null};function yp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function vp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?yp(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yp(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Op={title:"Nodes with the most alerts in the last 24h"},wp=e=>{const t=(0,pc.jg)();return t.loaded?(0,pe.jsxs)(rd,vp(vp({"data-testid":"home-alert-nodes",titleProps:Op},e),{},{children:[(0,pe.jsx)(bp,{alertsStats:t}),(0,pe.jsx)(mp,{alertsStats:t}),(0,pe.jsxs)(ce.Flex,{column:!0,gap:4,children:[(0,pe.jsx)(ce.TextBig,{children:"Top alerts in the last 24 h"}),(0,pe.jsx)(jp,{data:null===t||void 0===t?void 0:t.alerts})]})]})):(0,pe.jsx)(d.nl,{})};function Pp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Cp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Pp(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pp(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Ip={title:"Metrics available",justifyContent:"center"},Ap=e=>{var t;const{loaded:r,metricsCollected:n=0,error:o}=(0,pc.P9)();return r?(0,pe.jsx)(rd,Cp(Cp({"data-testid":"home-metrics",titleProps:Ip,error:null===o||void 0===o||null===(t=o.response)||void 0===t?void 0:t.data},e),{},{children:(0,pe.jsx)(ce.Flex,{width:"100%",justifyContent:"center",children:(0,pe.jsx)(ce.TextHuge,{strong:!0,children:(0,Kc.$t)(n)})})})):(0,pe.jsx)(d.Tr,Cp({title:"Metrics available"},e))};function kp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Sp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?kp(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kp(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Dp={title:"Charts visualized",justifyContent:"center"},Tp=e=>{const t=(0,v.ID)(),r=(0,Ne._0)(t),n=(0,Ne.rx)(t),o=(0,Ne.R7)(t),i=Object.keys(o||{}).length;return r||n?(0,pe.jsx)(rd,Sp(Sp({"data-testid":"home-charts-data",titleProps:Dp,error:n},e),{},{children:(0,pe.jsx)(ce.Flex,{width:"100%",justifyContent:"center",children:(0,pe.jsx)(ce.TextHuge,{strong:!0,children:(0,Kc.$t)(i)})})})):(0,pe.jsx)(d.Tr,Sp({},e))};function Mp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Fp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Mp(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mp(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Np={title:"Alerts configured",justifyContent:"center"},Ep=e=>{const{loaded:t,value:r}=(0,$a.oU)();return t?(0,pe.jsx)(rd,Fp(Fp({"data-testid":"home-alerts-data",titleProps:Np},e),{},{children:(0,pe.jsx)(ce.Flex,{width:"100%",justifyContent:"center",children:(0,pe.jsx)(ce.TextHuge,{strong:!0,children:(0,Kc.$t)((null===r||void 0===r?void 0:r.length)||0)})})})):(0,pe.jsx)(d.Tr,Fp({},e))};up.t1.register(up.PP,up.kc,up.A6,up.E8,up.m_,up.s$);const Lp=function(){let{dataRetention:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,n.useContext)(jn.ThemeContext),r={animation:!1,maintainAspectRatio:!1,plugins:{legend:{display:!1}},responsive:!0,scales:{x:{stacked:!0,grid:{color:(0,ce.getColor)("borderSecondary")({theme:t})},afterSetDimensions:e=>{e.maxHeight=50},ticks:{precision:0,callback:(e,t)=>{let r=o.labels[t];if(!r)return;let n=0;for(;(null===(i=r)||void 0===i?void 0:i.length)>20;){var i;r=(0,ou.P3)(r,n),n+=1}return r}}},y:{stacked:!0,grid:{color:(0,ce.getColor)("borderSecondary")({theme:t})},afterSetDimensions:e=>{e.maxWidth=50}}}},o=(0,n.useMemo)((()=>{if(null===e||void 0===e||!e.length)return{datasets:[],labels:[]};const{values:t,labels:r}=e.reduce(((e,t)=>{let{label:r,value:n}=t;return e.labels.push(r),e.values.push(n),e}),{values:[],labels:[]});return{datasets:[{borderWidth:0,maxBarThickness:10,backgroundColor:"#0A81AB",minBarLength:0,data:t,label:"Nodes"}],labels:r}}),[e]);return o.datasets?(0,pe.jsx)(ce.Flex,{width:"100%",height:"100%",children:(0,pe.jsx)(pp.yP,{data:o,options:r})}):null};function Bp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Rp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Bp(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Bp(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Vp={title:"Data retention per Nodes"},Hp=e=>{const{dataRetention:t}=(0,pc.P9)();return(0,pe.jsx)(rd,Rp(Rp({"data-testid":"home-data-retention",titleProps:Vp},e),{},{children:(0,pe.jsx)(Lp,{dataRetention:t})}))},_p=()=>((0,dc.A)(),fc(),(0,bc.A)(),jc(),Oc(),(0,wc.A)(),null),Kp=new Date("2025-12-01").getTime(),zp=()=>{const e=(0,B.CK)(),t=(0,B.nj)(),r=(0,y.ap)("createdAt");if(!t)return(0,pe.jsx)(d.WV,{});if(!e.length)return(0,pe.jsx)(V.Ay,{feature:"Home",mode:"NoNodesView",children:(0,pe.jsx)(R.A,{})});const n=new Date(r).getTime()>Kp;return vt.OH&&1===e.length&&n?(0,pe.jsx)(V.Ay,{feature:"Home",mode:"SingleNodeHome",children:(0,pe.jsx)(dd,{nodeId:e[0]})}):(0,pe.jsxs)(V.Ay,{feature:"Home",children:[(0,pe.jsx)(_p,{}),(0,pe.jsxs)(_.A,{gap:4,padding:[4],overflow:"auto",children:[vt.OH&&(0,pe.jsx)(Bc,{}),(0,pe.jsx)(dp,{}),(0,pe.jsxs)(ce.Flex,{gap:4,children:[(0,pe.jsx)(wp,{width:"60%"}),(0,pe.jsxs)(ce.Flex,{column:!0,gap:4,height:"100%",width:"calc(40% - 16px)",children:[(0,pe.jsxs)(ce.Flex,{gap:4,children:[(0,pe.jsx)(Ap,{flex:{grow:"1",shrink:"0"}}),(0,pe.jsx)(Tp,{flex:{grow:"1",shrink:"0"}}),(0,pe.jsx)(Ep,{flex:{grow:"1",shrink:"0"}})]}),(0,pe.jsx)(Hp,{flex:"grow"})]})]})]})]})};var Gp=r(7234),Wp=r(89711);var qp=r(84060),Up=r(31035),Jp=r(2863),Zp=r(49916);var Xp=r(46587);const $p=()=>{var e,t;const r=(0,y.vt)(),n=(0,z.nl)(),i=(0,o.ES)(r),s=(0,Xp.uW)("isAnonymous"),{value:a}=(0,z.BQ)(n),l="windows"==((null===(t=((null===a||void 0===a||null===(e=a.agents)||void 0===e?void 0:e[0])||{}).application)||void 0===t||null===(t=t.os)||void 0===t?void 0:t.kernel)||"").toLowerCase();return{hasAccess:!(i&&s&&l),reason:"windowsAgent"}};var Yp=r(14457),Qp=r(93933),eh=r(15524);const th=jn.default.div.withConfig({displayName:"styled__Separator",componentId:"sc-1fhfk7c-0"})(["background:",";height:20px;width:1px;"],(0,ce.getColor)("border")),rh=["flavour"];function nh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function oh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?nh(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):nh(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const ih=e=>{var t,r;let{flavour:o}=e,i=(0,W.A)(e,rh);const s=(0,z.nl)(),a=(0,ki.Xt)(s),{critical:l,warning:c}=(0,$a.AO)(a),d=(0,U.Fw)("sidebarTab",{flavour:"val",extraKey:o}),u=(0,U.Fw)("sidebarOpen",{flavour:"bool"}),p=(0,n.useCallback)((e=>{u(!0),d(e)}),[u,d]),{id:h,hw:g={},cpus:f,isLive:b,name:m,os:x={},state:j,updateSeverity:y,labels:v,version:O,health:w,capabilities:P}=(0,z.xY)(s),{silencingState:C}=(null===w||void 0===w?void 0:w.alerts)||{},I={dataTestId:"singleNode",isLive:b},A=(0,Dt.t3)(oh({count:l,type:"critical"},I)),k=(0,Dt.t3)(oh({count:c,type:"warning"},I)),S=(0,Dt.GM)(j),D=(0,Dt.Pg)(g.container,g.virtualization),T=(0,ra.A)("(min-width: 1760px)"),M=(0,z.TC)();return(0,pe.jsxs)(ce.Flex,oh(oh({alignItems:"center",background:"panelBg",border:{side:"all",color:"border"},"data-testid":"singleNode-badges-container",flex:!1,gap:1,padding:[1,2],round:1},i),{},{children:[(0,pe.jsx)(ce.TextSmall,{"data-testid":"singleNode-".concat(m),strong:!0,children:m}),(0,pe.jsx)(qt.A,{badge:"info","data-testid":"singleNode-nodeInfo-cta",children:(0,pe.jsx)(ce.IconButton,{flavour:"borderless",cursor:"pointer",onClick:()=>{M(h),p("info")},icon:"information",iconColor:"nodeBadgeColor",width:"18px",height:"18px"})}),(0,pe.jsx)(th,{"data-testid":"singleNode-separator"}),(0,pe.jsx)(qt.A,{badge:"alerts",nodeName:m,children:(0,pe.jsx)(ce.AlertMasterCard,{onClick:A.text||k.text?()=>M(h,{},"/alerts"):null,pillLeft:A,pillRight:k})}),(0,pe.jsx)(th,{"data-testid":"singleNode-separator"}),(0,pe.jsx)(nn,{node:{id:h,name:m,isLive:b,capabilities:P},padding:[0,1]}),y&&(0,pe.jsx)(Br.A,{"data-testid":"singleNode-update-cta",name:m,os:x.id,container:g.container,warningLevel:y,labels:v,version:O,text:y}),(0,pe.jsx)(th,{"data-testid":"singleNode-separator"}),(0,pe.jsx)(qt.A,{badge:"connectivity",connectivityState:S,"data-testid":"singleNode-connectivityStateInfo",nodeName:m,children:(0,pe.jsx)(ce.Pill,{flavour:"neutral",hollow:!0,children:S})}),(0,pe.jsx)(qt.A,{badge:"type","data-testid":"singleNode-nodeTypeInfo",nodeName:m,nodeType:D.label,children:(0,pe.jsx)(ce.Pill,{flavour:"neutral",hollow:!0,icon:D.icon,children:D.label})}),T&&(0,pe.jsx)(qt.A,{badge:"systemInfo","data-testid":"singleNode-systemInfo",nodeName:m,children:(0,pe.jsxs)(ce.Pill,{flavour:"neutral",hollow:!0,icon:(null===(t=yt.u[x.nm])||void 0===t?void 0:t.iconName)||(null===(r=yt.U[x.id])||void 0===r?void 0:r.iconName)||"os",children:[(0,Dt.O)(g.cpuFrequency)," (",f," ",1===g.cpus?"Core":"Cores",") -"," ",(0,Dt.RI)(g.memory)," RAM - ",(0,Dt.RI)(g.diskSpace)]})}),(0,pe.jsx)(Mr.A,{flavour:"node",silencing:C})]}))},sh=()=>{const e=(0,z.aH)(),t=(e=>(0,n.useMemo)((()=>({overview:{id:"overview",title:"Metrics",icon:"room_overview",path:"".concat(e),dataGa:"view-picker::click-view-overview::node-view",testId:"viewPicker-singleNode-overview",tooltip:{title:"Node Metrics",description:"View real-time and historical metrics for system resources, containers, VMs, and applications on this node"}},top:{id:"top",title:"Top",icon:"top",path:"".concat(e,"/top"),dataGa:"view-picker::click-view-fn::global-overview",testId:"viewPicker-singleNode-fn",tooltip:{title:"Node Top Consumers",description:"Monitor resource-heavy processes, containers, VMs, services, queries, and system components in real-time"}},logs:{id:"logs",title:"Logs",icon:"logs",path:"".concat(e,"/logs"),dataGa:"view-picker::click-view-logs::global-overview",testId:"viewPicker-singleNode-logs",tooltip:{title:"Node Logs",description:"Browse and search through system logs, application logs, and service logs from this node"}},alerts:{id:"alerts",title:"Alerts",icon:"alarm",path:"".concat(e,"/alerts"),dataGa:"view-picker::click-view-alerts::node-view",testId:"viewPicker-singleNode-alerts",tooltip:{title:"Node Alerts",description:"View active alerts, alert history, and alert configurations for this specific node"}},ar:{id:"ar",title:"Anomalies",icon:"anomaliesLens",path:"".concat(e,"/anomalies"),dataGa:"view-picker::click-view-anomalies::node-view",testId:"viewPicker-singleNode-anomalies",tooltip:{title:"Node Anomaly Advisor",description:"AI-powered anomaly detection showing unusual patterns and deviations in node metrics"}},events:{id:"events",title:"Events",icon:"feed",path:"".concat(e,"/events"),dataGa:"view-picker::click-view-feed::node-view",testId:"viewPicker-singleNode-feed",tooltip:{title:"Node Events",description:"Track configuration changes, deployments, restarts, and other significant events on this node"}}})),[e]))(e);return(0,n.useMemo)((()=>[t.overview,t.top,t.logs,t.alerts,t.ar,t.events].filter(Boolean)),[e])};var ah=r(10444);const lh=["notificationBg"];function ch(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function dh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ch(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ch(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const uh=(0,jn.default)(ce.Box).attrs((e=>dh({width:"6px",height:"6px",round:"50%"},e))).withConfig({displayName:"withNotification__NotificationDot",componentId:"sc-ka7a4g-0"})([""]),ph=e=>t=>{let{notificationBg:r}=t,n=(0,W.A)(t,lh);return r?(0,pe.jsxs)(ce.Flex,{position:"relative",gap:1,padding:[0,0,0,1.5],children:[(0,pe.jsx)(uh,{background:r,position:"absolute",top:-2,left:0}),(0,pe.jsx)(e,dh({},n))]}):(0,pe.jsx)(e,dh({},n))};var hh=r(9509);const gh=["id","to","params","exact","icon","iconColor","title","fixed","dataGa","testId","children","type","tooltip","showBorderLeft","droppable","droppableProps","ref","isDynamic","highlight"];function fh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function bh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?fh(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fh(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const mh=(0,jn.keyframes)(["0%{transform:translateY(-5px) scale(1);}25%{transform:translateY(-10px) scale(0.7);}50%{transform:translateY(-5px) scale(1);}75%{transform:translateY(0) scale(1.3);}100%{transform:translateY(-5px) scale(1);}"]),xh=(0,jn.default)(ce.Icon).attrs({name:"long_arrow_up",color:"successText"}).withConfig({displayName:"tabLink__DropHereIcon",componentId:"sc-1h4dha1-0"})(["animation:"," 1s ease-in infinite;"],mh),jh=e=>{let{active:t,highlight:r,iconColor:n}=e;return n||(r||t?"primary":"textDescription")},yh=ph(ce.Icon),vh=e=>{var t;let{id:r,to:o,params:i,exact:s,icon:a,iconColor:l,title:c,fixed:d,dataGa:u,testId:p,children:h,type:g,tooltip:f,showBorderLeft:b,droppable:m,droppableProps:j={},ref:y,isDynamic:v,highlight:O}=e,w=(0,W.A)(e,gh);const{sendLog:P}=(0,Qr.A)(),{onTabChange:C}=(0,hh.D)(),{setNodeRef:I,active:A}=(0,rt.zM)({id:"droppable-tab-".concat(r),disabled:!m,data:j}),k=(0,x.RQ)(s?o:"".concat(o,"/*")),D=(0,x.Zp)(),T=(0,ah.J)(),M=!!k,F="nodes"!==g||M,N=(0,n.useCallback)((()=>{if(M)return;const e="".concat(o).concat(i?"/".concat(i):"");D(e),C(r),P({feature:"Navigation",description:"Single page navigation using static tabs",tab:r,path:e})}),[r,o,M,i,C,P]),E=m&&A&&(null===(t=A.data.current)||void 0===t?void 0:t.dashboardable),L=(0,n.useRef)(),[B]=(0,S.m0)({tabId:r}),R=(0,n.useCallback)((e=>{let{button:t}=e;v&&1===t&&"function"===typeof w.onRemove&&w.onRemove(w.index,M)}),[v,w.index,M,w.onRemove]);return(0,pe.jsx)(tt.A,bh(bh({content:f||c,align:f?"bottom":"top",isBasic:"string"===typeof(f||c)},O?{color:"primary"}:{}),{},{children:(0,pe.jsxs)(ce.NavigationTab,bh(bh(bh({ref:(0,ce.mergeRefs)(I,y,L),fixed:d,active:M,showBorderLeft:b,icon:(0,pe.jsx)(yh,{name:a,size:"small",color:jh({active:M,highlight:O,iconColor:l}),notificationBg:null===B||void 0===B?void 0:B.color}),onActivate:N,"data-ga":u,"data-testid":p,"aria-selected":M},E&&{rootProps:{background:"successSemi",cursor:"alias"}}),{},{onMouseUp:R},w),{},{children:[!T&&!!c&&(0,pe.jsx)(ce.Text,{alignSelf:"center",strong:O,color:jh({active:M,highlight:O,iconColor:l}),whiteSpace:"nowrap",children:c}),L.current&&E&&(0,pe.jsx)(ce.Drop,{target:L.current,align:{top:"bottom"},stretch:!1,hideShadow:!0,zIndex:1,children:(0,pe.jsx)(xh,{})}),F&&h]}))}))},Oh=["id","icon","title","path"];function wh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}const Ph={singleNode:"singleNode",logs:"logs",top:"fn",feed:"feed",anomalies:"anomalies",default:"singleNode",alerts:"alerts"},Ch=(0,n.memo)((()=>{const e=sh(),t=(0,x.RQ)("/spaces/:spaceSlug/rooms/:roomSlug/nodes/:nodeId/:path"),r=t&&Ph[t.params.path]||Ph.default;return(0,pe.jsxs)(ce.Flex,{justifyContent:"start",alignSelf:"start",alignItems:"end",width:"100%",height:"100%",overflow:"auto",background:"mainBackground",children:[(0,pe.jsx)(ih,{flavour:r,background:"mainBackground",border:void 0}),(0,pe.jsx)(ce.TabSeparator,{}),e.map(((e,t)=>{let{id:r,icon:n,title:o,path:i}=e,s=(0,W.A)(e,Oh);return(0,pe.jsx)(vh,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?wh(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wh(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({exact:!0,fixed:!0,to:i,icon:n,title:o,id:r,rootProps:{background:"mainBackground"},showBorderLeft:0===t},s),"".concat(r,"-").concat(t))}))]})})),Ih=Ch;var Ah=r(47413),kh=r(17178),Sh=r(5722);const Dh=()=>{const{active:e}=(0,rt.fF)(),t=(0,g.JT)("dashboard:Create"),r=(0,y.dg)();return t&&e&&!r?(0,pe.jsx)(vh,{to:"",id:"plus",icon:"plus",fixed:!0,droppable:!0,droppableProps:{dropArea:!0,dashboardId:"new"},testid:"roomDropdownMenu-roomOptions",disabled:!t||r}):null},Th=["title","path","children","index","ref","tooltip","type","id"],Mh=["staticPaths"],Fh=["id","icon","title","path"];function Nh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Eh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Nh(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Nh(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Lh=e=>{let{title:t,path:r,children:o,index:i,ref:s,tooltip:a,type:l,id:c}=e,d=(0,W.A)(e,Th);const u=(0,$a.JL)("alerts"===l?c:null,"name"),p=(0,$a.JL)("alerts"===l?c:null,"instanceName"),h=(0,$a.JL)("alerts"===l?c:null,"nodeId"),g=(0,z.xY)("alerts"===l?h:null,"name"),f=(0,z.xY)("nodes"===l?c:null,"name"),b=(0,n.useMemo)((()=>{if("alerts"===l){const e=[];return p&&e.push("Instance: ".concat(p)),g&&e.push("Node: ".concat(g)),{title:"Alert: ".concat(u||t||"Unknown"),description:e.length>0?e.join(" \u2022 "):"View detailed information about this alert"}}return"nodes"===l?{title:"Node: ".concat(f||t||"Unknown"),description:"View node metrics, logs, top consumers, anomalies, and more."}:"dashboards"===l?{title:"Dashboard: ".concat(t||"Unknown"),description:"View custom dashboard"}:a}),[l,a,t,u,p,g,f]);return(0,pe.jsx)(vh,Eh(Eh({ref:s,isDynamic:!0,showBorderLeft:0===i,to:r,title:t,tooltip:b,"data-testid":"navigation-dynamicTab-".concat(t),index:i,type:l,id:c},d),{},{children:o}))},Bh=e=>{let{staticPaths:t}=e,r=(0,W.A)(e,Mh);const[n,o,i]=(0,Ah.A)(t),s=(0,eh.A)("horizontal");return(0,pe.jsx)(ce.BaseDraggableTabs,Eh(Eh({onDragEnd:o,onTabClose:i,items:n,Item:Lh},r),{},{ref:s}))},Rh=()=>(0,pe.jsx)(x.BV,{children:(0,pe.jsx)(x.qh,{path:"/spaces/:spaceSlug/rooms/:roomSlug/nodes/:nodeId/*",element:(0,pe.jsx)(Ih,{})})}),Vh=(0,n.memo)((()=>{const[e,t]=(0,kh.A)();return(0,Sh.A)()?(0,pe.jsxs)(ce.NavigationTabs,{subTabs:(0,pe.jsx)(Rh,{}),children:[e.map(((e,t)=>{let{id:r,icon:n,title:o,path:i}=e,s=(0,W.A)(e,Fh);return(0,pe.jsx)(vh,Eh({fixed:!0,to:i,icon:n,title:o,id:r},s),"".concat(r,"-").concat(t))})),(0,pe.jsx)(ce.TabSeparator,{}),(0,pe.jsx)(Bh,{staticPaths:t}),(0,pe.jsx)(Dh,{})]}):null})),Hh=Vh,_h=()=>{const e=(0,Vr.eg)(),t=(()=>{const e=(0,y.bq)(),t=(0,v.QW)();return"/spaces/".concat(e,"/rooms/").concat(t,"/overview")})(),r=(0,x.Zp)();(0,n.useEffect)((()=>{if(e)return(0,na.unregister)(e.on("goToLink",((e,n)=>{var o;let i=location.pathname;return e&&e.getParent().getAttribute("roomId")&&(i=e.getParent().getId(),i=/^\/spaces/.test(i)?i:t),r(i,n?{state:{chartName:n},replace:!0}:{state:{contextToGo:null===e||void 0===e||null===(o=e.getAttribute("contextScope"))||void 0===o?void 0:o[0]},replace:!0})})))}),[e,t])},Kh=()=>(_h(),null);var zh,Gh=r(73937),Wh=r(21885),qh=r(65637),Uh=r(55177),Jh=r(73980),Zh=r(45026);function Xh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function $h(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Xh(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xh(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Yh="dyncfg-edit-alet-warning-dismiss-".concat(null===(zh=window.envSettings)||void 0===zh?void 0:zh.visitor),Qh={lineHeight:1.6},eg=e=>{let{alertName:t,nodeIds:r=[]}=e;const i="true"===localStorage.getItem(Yh),[s,,,a]=(0,Pe.A)(!i),[l,c]=(0,n.useState)(),d=(0,z.xY)(r[0],"name"),u=r.length-1,p=u>0?" and ".concat(u," other nodes"):"",h=(0,n.useCallback)((e=>{c(e)}),[c]),g=(0,n.useCallback)((()=>{l&&localStorage.setItem(Yh,!0),a()}),[l,a]);return s?(0,pe.jsx)(ce.Modal,{backdropContainerProps:{zIndex:"60"},backdropProps:{backdropBlur:!0},children:(0,pe.jsxs)(ce.ModalContent,{children:[(0,pe.jsx)(ce.ModalHeader,{children:(0,pe.jsx)(ce.H4,{children:"Editing Alerts"})}),(0,pe.jsx)(ce.ModalBody,{children:(0,pe.jsxs)(ce.Flex,{column:!0,gap:2,width:{max:120},children:[(0,pe.jsxs)(ce.TextBig,$h($h({},Qh),{},{children:["You are about to edit the alert ",(0,pe.jsx)(ce.TextBig,{color:"primary",children:t}),d?(0,pe.jsxs)(pe.Fragment,{children:[" ","on node ",(0,pe.jsx)(ce.TextBig,{color:"primary",children:d}),p]}):null,"."]})),(0,pe.jsx)(ce.TextBig,$h($h({},Qh),{},{children:'Keep in mind that alerts in Netdata are templates that are applied to all instances of the same kind (e.g. editing a disk alert, means you are changing the alerts for all disks on that node). If you want to overwrite the rules for a single instance, do not change the current rules. Instead add a new rule and select "Apply to a specific instance" for that rule, matching the instance you want to overwrite.'})),o.Ay?(0,pe.jsx)(ce.TextBig,$h($h({},Qh),{},{children:'To apply an alert on all your currently connected nodes, edit it and select "Submit to Multiple Nodes".'})):(0,pe.jsx)(ce.TextBig,$h($h({},Qh),{},{children:'When having parents and you have connected both parents and children to Netdata Cloud, the alert needs to be altered on both Netdata parents and children, otherwise one of the two will be using the old version. To apply an alert on multiple nodes, edit it and select "Submit to Multiple Nodes".'}))]})}),(0,pe.jsxs)(ce.ModalFooter,{justifyContent:"between",children:[(0,pe.jsxs)(ce.Flex,{gap:2,alignItems:"center",children:[(0,pe.jsx)(ce.Checkbox,{checked:l,onChange:h}),(0,pe.jsx)(ce.TextBig,{children:"Don't show this again"})]}),(0,pe.jsx)(ce.Button,{type:"button",flavour:"hollow",label:"OK",textTransform:"uppercase",onClick:g})]})]})}):null};function tg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function rg(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?tg(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tg(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const ng=(0,n.memo)((()=>{const{node:e}=(0,Gh.Z)(),{alertName:t,nodeIds:r,title:o}=(0,Zh.A)(),{loaded:i,tree:s}=(0,qh.A)(r?{value:null===r||void 0===r?void 0:r[0]}:e),a=(0,n.useMemo)((()=>{var e;return(null===s||void 0===s||null===(e=s[Wh.$7])||void 0===e?void 0:e[o])||{}}),[s,o]),l=(0,n.useMemo)((()=>!!Object.keys(a||{}).length),[a]);return i&&t?(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(Jh.A,{flavour:"entity",title:o,entityProps:a,isOpen:l,isEditFromState:!0,renderChildren:e=>(0,pe.jsx)(Uh.A,rg(rg({id:o},a),e))},JSON.stringify({loaded:i,alertName:t,alertItemExists:l})),a?(0,pe.jsx)(eg,{alertName:t,nodeIds:r}):null]}):null})),og=ng,ig=["entityProps"];function sg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ag(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?sg(Object(r),!0).forEach((function(t){(0,b.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sg(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const lg=(0,n.memo)((()=>{const{node:e}=(0,Gh.Z)(),{path:t}=(0,qh.A)(e),r=(0,Yr.sh)({node:e,path:t}),n=r||{},{entityProps:o}=n,i=(0,W.A)(n,ig);return r?(0,pe.jsx)(Jh.A,{id:r.template,flavour:"entity",title:"".concat(r.template,":placeholder"),entityProps:ag(ag({},o),i),isNewItem:!0,formData:r.formData,renderChildren:e=>(0,pe.jsx)(Uh.A,ag(ag(ag({},o),e),{},{id:r.template,isNewItem:!0}))}):null})),cg=lg,dg=(0,i.A)((()=>Promise.all([r.e(5638),r.e(3864),r.e(3457)]).then(r.bind(r,93457))),"ManageSpaceRoute"),ug=(0,i.A)((()=>r.e(2201).then(r.bind(r,52201))),"Trial"),pg=(0,i.A)((()=>r.e(5302).then(r.bind(r,5302))),"PreferredNodesModal"),hg=(0,i.A)((()=>Promise.resolve().then(r.bind(r,61314))),"JoinSpace"),gg=(0,i.A)((()=>r.e(7530).then(r.bind(r,17530))),"NoSpaceAccess"),fg=(0,i.A)((()=>r.e(6333).then(r.bind(r,96333))),"EmptyRoom"),bg=(0,i.A)((()=>r.e(1910).then(r.bind(r,11910))),"AlertView"),mg=(0,i.A)((()=>r.e(7316).then(r.bind(r,74935))),"Anomalies"),xg=(0,i.A)((()=>Promise.resolve().then(r.bind(r,19440))),"AlertsSmartboard"),jg=(0,i.A)((()=>r.e(7214).then(r.bind(r,27214))),"DashboardsOverview"),yg=(0,i.A)((()=>Promise.all([r.e(180),r.e(4424),r.e(5297)]).then(r.bind(r,95297))),"DashboardView"),vg=(0,i.A)((()=>Promise.all([r.e(5638),r.e(517),r.e(1330)]).then(r.bind(r,91330))),"FunctionsView"),Og=(0,i.A)((()=>Promise.all([r.e(8876),r.e(3864),r.e(4835),r.e(4868),r.e(3941),r.e(4209)]).then(r.bind(r,24209))),"Insights"),wg=(0,i.A)((()=>Promise.all([r.e(8876),r.e(3864),r.e(4835),r.e(4868),r.e(3941),r.e(3808)]).then(r.bind(r,43808))),"InsightsReport"),Pg=(0,i.A)((()=>r.e(2792).then(r.bind(r,32792))),"Onboarding"),Cg=(0,i.A)((()=>Promise.all([r.e(3864),r.e(8791),r.e(9462),r.e(5187)]).then(r.bind(r,89462))),"Integrations"),Ig=(0,i.A)((()=>Promise.all([r.e(180),r.e(2003)]).then(r.bind(r,92003))),"DropInDashboard"),Ag=(0,i.A)((()=>r.e(3185).then(r.bind(r,73185))),"Marketplace"),kg=(0,i.A)((()=>r.e(677).then(r.bind(r,90677))),"AlertConfigAiModal"),{demoSlug:Sg,demoDefaultRoomViews:Dg,defaultRoomView:Tg,onboardingView:Mg,integrationsView:Fg}=h.A,Ng=dl(cc(ll)),Eg=cc(ll),Lg=(0,n.memo)((()=>{const[e,t]=(0,Yi.Ay)(),r=Sg===e?Dg[t]||Dg.default:o.Ay&&t===o.Iy?o.kG:Tg;return(0,pe.jsxs)(n.Suspense,{fallback:(0,pe.jsx)(d.zj,{}),children:[(0,pe.jsx)(n.Suspense,{fallback:"",children:(0,pe.jsx)(Ig,{})}),(0,pe.jsx)(x.BV,{children:(0,pe.jsx)(x.qh,{path:"nodes/:nodeId/*",element:(0,pe.jsx)(vi,{})})}),(0,pe.jsxs)(x.BV,{children:[(0,pe.jsx)(x.qh,{path:Mg,element:(0,pe.jsx)(n.Suspense,{fallback:(0,pe.jsx)(d.NP,{}),children:(0,pe.jsx)(Pg,{})})}),(0,pe.jsx)(x.qh,{path:Fg,element:(0,pe.jsx)(n.Suspense,{fallback:(0,pe.jsx)(d.H$,{}),children:(0,pe.jsx)(Cg,{flavour:"settingsPage"})})}),(0,pe.jsx)(x.qh,{path:"nodes/:nodeId",element:(0,pe.jsx)(Ng,{})}),(0,pe.jsx)(x.qh,{path:"nodes/:nodeId/alerts",element:(0,pe.jsx)(xg,{})}),(0,pe.jsx)(x.qh,{path:"nodes/:nodeId/anomalies",element:(0,pe.jsx)(n.Suspense,{fallback:(0,pe.jsx)(d.Bm,{}),children:(0,pe.jsx)(mg,{})})}),(0,pe.jsx)(x.qh,{path:"nodes/:nodeId/top",element:(0,pe.jsx)(vg,{flavour:"fn"},"fn")}),(0,pe.jsx)(x.qh,{path:"nodes/:nodeId/logs",element:(0,pe.jsx)(vg,{flavour:"logs"},"logs")}),(0,pe.jsx)(x.qh,{path:"nodes/:nodeId/events",element:(0,pe.jsx)(vg,{flavour:"feed"},"feed")}),(0,pe.jsx)(x.qh,{path:"nodes",element:(0,pe.jsx)(yi,{})}),(0,pe.jsx)(x.qh,{path:"home",element:(0,pe.jsx)(zp,{})}),(0,pe.jsx)(x.qh,{path:"overview",element:(0,pe.jsx)(Eg,{})}),(0,pe.jsx)(x.qh,{path:"alerts/:alertId",element:(0,pe.jsx)(n.Suspense,{fallback:(0,pe.jsx)(d.xh,{}),children:(0,pe.jsx)(bg,{})})}),(0,pe.jsx)(x.qh,{path:"alerts",element:(0,pe.jsx)(xg,{})}),(0,pe.jsx)(x.qh,{path:"alarms/:alertId",element:(0,pe.jsx)(bg,{})}),(0,pe.jsx)(x.qh,{path:"alarms",element:(0,pe.jsx)(x.C5,{replace:!0,to:"/spaces/".concat(e,"/rooms/").concat(t,"/alerts")})}),(0,pe.jsx)(x.qh,{path:"functions",element:(0,pe.jsx)(x.C5,{replace:!0,to:"/spaces/".concat(e,"/rooms/").concat(t,"/top")})}),(0,pe.jsx)(x.qh,{path:"dashboard",element:(0,pe.jsx)(yg,{customDashboardId:o.LA})}),(0,pe.jsx)(x.qh,{path:"dashboards/:dashboardSlug",element:(0,pe.jsx)(n.Suspense,{fallback:(0,pe.jsx)(c.O2,{}),children:(0,pe.jsx)(yg,{})})}),(0,pe.jsx)(x.qh,{path:"dashboards",element:(0,pe.jsx)(jg,{})}),(0,pe.jsx)(x.qh,{path:"kubernetes",element:(0,pe.jsx)(Eg,{flavour:"k8s"})}),(0,pe.jsx)(x.qh,{path:"anomalies",element:(0,pe.jsx)(n.Suspense,{fallback:(0,pe.jsx)(d.Bm,{}),children:(0,pe.jsx)(mg,{})})}),(0,pe.jsx)(x.qh,{path:"top",element:(0,pe.jsx)(vg,{flavour:"fn"},"fn")}),(0,pe.jsx)(x.qh,{path:"logs",element:(0,pe.jsx)(vg,{flavour:"logs"},"logs")}),(0,pe.jsx)(x.qh,{path:"events",element:(0,pe.jsx)(vg,{flavour:"feed"},"feed")}),(0,pe.jsx)(x.qh,{path:"".concat(f.p9,"/:reportId"),element:(0,pe.jsx)(wg,{})}),(0,pe.jsx)(x.qh,{path:"insights/*",element:(0,pe.jsx)(n.Suspense,{fallback:(0,pe.jsx)(d.BJ,{}),children:(0,pe.jsx)(Og,{})})}),(0,pe.jsx)(x.qh,{path:"/",element:(0,pe.jsx)(x.C5,{replace:!0,to:"/spaces/".concat(e,"/rooms/").concat(t,"/").concat(r)})})]})]})})),Bg=()=>{const{isOnboardingPath:e,path:t}=(0,u.A)(),{isIntegrationsPath:r}=(0,Yp.Q)(),[i,a]=(0,Yp.A)(),l=(0,y.vt)(),c=(0,v.ID)(),p=(0,s.I)(),h=(0,B.gr)(c,"ids"),g=(0,B.gr)(c,"loaded"),f=(0,y.bE)(l,"isEmpty"),b=(0,n.useMemo)((()=>!0===g&&!h.length),[g,h]),j=(0,o.Az)(l);return((e,t)=>{const r=(0,m.yF)((0,n.useCallback)((async(r,n)=>{await r((0,v.LS)({id:t,key:"fullyLoaded"}))||(0,Oi.K8)(e,t).then((t=>{let{data:r}=t;return n((0,v.If)(r.id),Pi(Pi({},r),{},{spaceId:e,fullyLoaded:!0,loaded:!0}))}))}),[e,t]));(0,n.useEffect)((()=>{e&&t&&r()}),[e,t])})(l,c),(0,Ci.A)({spaceId:l,id:c,pollingInterval:63e3}),Fi(l,c),Li(l,c),(0,Bi.A)(l,c),function(e,t){let{types:r,entities:o,paths:i,names:s}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const a=(0,m.yF)(((n,a)=>{(0,Wp.Uc)(e,t,{types:r,entities:o,paths:i,names:s}).then((r=>{let{data:n}=r;a((0,ie.Mg)({spaceId:e,roomId:t}),n),a((0,Me.n_)({spaceId:e,roomId:t})),a((0,Oe.n_)({spaceId:e,roomId:t})),a((0,Gp.w7)({spaceId:e,roomId:t}),!0)}))}));(0,n.useEffect)((()=>{e&&t&&a()}),[e,t,r,o,i,s])}(l,c),L(),(0,n.useEffect)((()=>{j||a||p||f(i)}),[j,i,p,a,f]),p?(0,pe.jsx)(n.Suspense,{fallback:"",children:(0,pe.jsx)(Ag,{subCallback:p})}):a?(0,pe.jsx)(d.Qk,{}):j||!i||!t||e||r?!b||e||r?(0,pe.jsx)(Lg,{}):(0,pe.jsx)(fg,{}):(0,pe.jsx)(x.C5,{to:t,replace:!0})},Rg=(0,l.Xc)((0,n.memo)((()=>{const e=(0,g.JT)("space:Read"),t=(0,g.JT)("room:Read"),{hasAccess:r,reason:o}=$p();return e?r?(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(Hh,{}),(0,pe.jsx)(n.Suspense,{fallback:(0,pe.jsx)(d.Qk,{}),children:(0,pe.jsxs)(x.BV,{children:[(0,pe.jsx)(x.qh,{path:"spaces/:spaceSlug/join-space",element:(0,pe.jsx)(hg,{})}),(0,pe.jsx)(x.qh,{path:"spaces/:spaceSlug/no-rooms",element:(0,pe.jsx)(gg,{reason:"noRooms"})}),(0,pe.jsx)(x.qh,{path:"spaces/:spaceSlug/settings/*",element:(0,pe.jsx)(Vg,{})}),(0,pe.jsx)(x.qh,{path:"spaces/:spaceSlug/rooms/:roomSlug/*",element:t?(0,pe.jsx)(Bg,{}):(0,pe.jsx)(gg,{reason:"noRoomPermission"})})]})})]}):(0,pe.jsx)(gg,{reason:o}):(0,pe.jsx)(gg,{reason:"noSpacePermission"})}))),Vg=()=>((0,Yi.KI)(),(0,pe.jsx)(dg,{})),Hg=()=>{const e=(0,y.vt)();return(0,qp.A)(e),(0,Up.A)(e),(e=>{const t=(0,m.yF)((0,n.useCallback)((function(t,r){let{data:{results:n}}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r((0,Jp.S)({id:e}),n)}),[e])),r=(0,m.yF)((0,n.useCallback)(((t,r,n)=>{r((0,Jp.S)({id:e,key:"error"}),n)}),[e])),o=(0,Zp.sC)(e,"loaded"),i=(0,g.JT)("alert:ReadAll");(0,j.A)((()=>({enabled:i&&!!e&&o,fetch:()=>(0,Ai.C2)(e),onFail:r,onReceive:t,pollingOptions:{pollingInterval:15e4}})),[e,!!o,i])})(e),null},_g=(0,l.Xc)((()=>{const e=(0,y.vt)();return(0,Qp.Ay)(),(0,n.useEffect)((()=>{const e=(0,a.A)(new URL(window.location.href).searchParams.get("join_callback"));e&&(window.location.href=e)}),[]),e?(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(Hg,{}),(0,pe.jsx)(p.A,{permission:"space:Read",children:t=>t?(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(x.BV,{children:(0,pe.jsx)(x.qh,{path:"/*",element:(0,pe.jsx)(Kh,{})})}),(0,pe.jsx)(n.Suspense,{fallback:(0,pe.jsx)(d.Qk,{}),children:(0,pe.jsx)(Rg,{})})]}):(0,pe.jsx)(gg,{reason:"noSpacePermission"},e)}),(0,pe.jsx)(n.Suspense,{fallback:"",children:(0,pe.jsx)(ug,{})}),(0,pe.jsxs)(n.Suspense,{fallback:"",children:[(0,pe.jsx)(pg,{}),(0,pe.jsx)(cg,{}),(0,pe.jsx)(og,{}),(0,pe.jsx)(kg,{})]})]}):(0,pe.jsx)(d.Qk,{})}))},90901(e,t,r){r.d(t,{I:()=>c,q:()=>l});r(98992),r(8872),r(62953);var n=r(96540),o=r(35570),i=r(24013),s=r(19186);const a=(e,t)=>t?e[t]:e,l=e=>{const t=(0,i.BU)(),r=(0,i.Gt)(t);return(0,n.useMemo)((()=>r.reduce(((t,r)=>{const{capabilities:{ml:n}}=r;return null!==n&&void 0!==n&&n.enabled?t.predicting=[...t.predicting,a(r,e)]:t.incapable=[...t.incapable,a(r,e)],t}),{predicting:[],incapable:[]})),[t.length,e])},c=e=>{const t=(0,o.Zp)(),r=(()=>{const e=(0,s.r9)();return e&&"".concat(e,"/anomalies")})();return(0,n.useCallback)((function(){t(r,{state:{nodeId:arguments.length>0&&void 0!==arguments[0]?arguments[0]:e}})}),[r,t])}},27496(e,t,r){r.d(t,{n:()=>l});r(98992),r(54520),r(3949);var n=r(64467),o=r(14963),i=r(4719),s=r(74848);function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}const l=(0,i.aV)((e=>e.children?(0,s.jsx)(o.A,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({as:"p",role:"document"},e)):null),(e=>{let{info:t}=e;return{children:t}}))},95836(e,t,r){r.d(t,{$:()=>x});r(98992),r(54520),r(3949);var n=r(64467),o=r(80045),i=r(68978),s=r(45087),a=r(4719),l=r(549),c=r(27496),d=r(74848);const u=["name","tiny"],p=["hasTooltip","hasInfo"],h=["name","info"];function g(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?g(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const b=e=>{let{name:t,tiny:r}=e,n=(0,o.A)(e,u);const s=r?i.Text:i.H3;return"string"===typeof t?(0,d.jsx)(s,f(f({strong:!0},n),{},{children:t})):t||null},m=(0,l.A)((e=>{let{hasTooltip:t,hasInfo:r}=e,n=(0,o.A)(e,p);return t&&r?(0,d.jsx)(s.A,{content:(0,d.jsx)(c.n,{id:n.id}),isBasic:!0,children:(0,d.jsx)(b,f({},n))}):(0,d.jsx)(b,f({},n))})),x=(0,a.aV)(m,(e=>{let{name:t,info:r}=e;return f({name:t,hasInfo:!!r},(0,o.A)(e,h))}))},69001(e,t,r){r.d(t,{h:()=>c});r(98992),r(54520),r(3949);var n=r(64467),o=r(80045),i=r(68978),s=r(74848);const a=["id"];function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}const c=e=>{let{id:t}=e,r=(0,o.A)(e,a);return(0,s.jsx)(i.Flex,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({column:!0,"data-testid":"chart-menu-wrapper","data-menuid":t},r))}},75144(e,t,r){r.d(t,{X:()=>l});r(98992),r(54520),r(3949);var n=r(64467),o=r(4719),i=r(14963),s=r(74848);function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}const l=(0,o.aV)((e=>e.children?(0,s.jsx)(i.A,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({as:"p",role:"document"},e)):null),(e=>{let{info:t}=e;return{children:t}}))},63996(e,t,r){r.d(t,{t:()=>j});r(98992),r(54520),r(3949);var n=r(64467),o=r(80045),i=r(96540),s=r(68978),a=r(45087),l=r(4719),c=r(549),d=r(75144),u=r(74848);const p=["name","level","descendantIds","enableFavourites","ref"],h=["hasTooltip","hasInfo"],g=["name","info"];function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function b(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?f(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const m=e=>{let{name:t,level:r,descendantIds:n,enableFavourites:a,ref:l}=e,c=(0,o.A)(e,p);const d=(0,i.useMemo)((()=>Array.from(Array(r)).fill("-").join("")),[r]),h=(0,i.useMemo)((()=>a?"".concat(d," ").concat(t):t),[a,d,t]),g=(0,i.useMemo)((()=>{var e;return b(b({},a&&(null===n||void 0===n||!n.length||null!==c&&void 0!==c&&null!==(e=c.selfChartIds)&&void 0!==e&&e.length)?{color:"primary"}:{}),c)}),[n,c]);return"string"===typeof t?(0,u.jsx)(s.Text,b(b({strong:!0,ref:l},g),{},{children:h})):t||null},x=(0,c.A)((e=>{let{hasTooltip:t,hasInfo:r}=e,n=(0,o.A)(e,h);return t&&r?(0,u.jsx)(a.A,{content:(0,u.jsx)(d.X,{id:n.id}),isBasic:!0,children:(0,u.jsx)(m,b({},n))}):(0,u.jsx)(m,b({},n))})),j=(0,l.aV)(x,(e=>{let{name:t,info:r}=e;return b({name:t,hasInfo:!!r},(0,o.A)(e,g))}))},54025(e,t,r){r.d(t,{t:()=>c});r(98992),r(54520),r(3949);var n=r(64467),o=r(80045),i=r(68978),s=r(74848);const a=["id","testId"];function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}const c=e=>{let{id:t,testId:r="chart-sub-menu-container"}=e,c=(0,o.A)(e,a);return(0,s.jsx)(i.Flex,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({column:!0,gap:2,id:t,"data-testid":r,"data-menuid":t},c))}},14963(e,t,r){r.d(t,{A:()=>u});r(98992),r(54520),r(3949);var n=r(64467),o=r(80045),i=r(96540),s=r(68978),a=r(50239),l=r(74848);const c=["children","onClick"];function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}const u=e=>{let{children:t,onClick:r}=e,u=(0,o.A)(e,c);const p=(0,a.UH)(),h=(0,i.useCallback)((e=>{const{hash:t=""}=e.target;t.startsWith("#menu")&&(e.preventDefault(),p.goToLink(t.substr(1))),r&&r(e)}),[p]);return"string"===typeof t?(0,l.jsx)(s.TextSmall,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({color:"textDescription",dangerouslySetInnerHTML:{__html:t},onClick:h},u)):t||null}},30863(e,t,r){r.d(t,{A:()=>z});var n=r(64467),o=r(80045),i=(r(98992),r(54520),r(3949),r(81454),r(62953),r(96540)),s=r(68978),a=r(73700),l=r(69457),c=r(51220),d=r(24582),u=r(48106),p=r(20871);r(72577);let h=null;r(94490),r(26910),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 g=r(57530),f=r(43375);r(8872);var b=r(51510),m=r(98131),x=r(33962),j=r(4719),y=r(56876),v=r(549),O=r(74848);const w=["Component"];function P(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function C(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?P(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):P(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const I=(0,i.memo)((e=>{let{id:t,name:r,icon:n,isLast:o}=e;const{onMenuClick:a}=(0,y.A)(),l=(0,i.useCallback)((()=>{a({id:t})}),[t,a]),c=(0,i.useMemo)((()=>C({alignItems:"center",gap:1},o?{}:{cursor:"pointer",onClick:l})),[o,l]);return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(s.Flex,C(C({},c),{},{children:[n?(0,O.jsx)(m.o,{icon:n,active:!0,containerProps:{width:"auto"}}):null,(0,O.jsx)(s.Text,{color:"primary",strong:!0,children:r})]})),o?null:(0,O.jsx)(s.Text,{color:"primary",strong:!0,children:">"})]})})),A=(0,i.memo)((e=>{let{menu:t}=e;const{id:r,shortName:n,name:o,icon:a,parentMenus:l}=t||{},c=(0,i.useMemo)((()=>[...l||[],{id:r,name:n||o,icon:a}]),[t]);return r?(0,O.jsx)(s.Flex,{alignItems:"center",gap:1,children:c.map(((e,t)=>(0,O.jsx)(I,C({isLast:t===c.length-1},e),e.id)))}):null})),k=(0,b.default)(s.Flex).attrs((e=>C({position:"sticky",top:0,width:"100%",alignItems:"center",justifyContent:"between",padding:[2,1,2,2],zIndex:15},e))).withConfig({displayName:"headerAggregator__StyledContainer",componentId:"sc-10l70s7-0"})(["backdrop-filter:blur(5px);"]),S=["nodes"],D=e=>{let{flavour:t,tools:r=[],hasFilters:n}=e;const a=(0,x.W2)(),l=(0,j.b)(a),c=(0,i.useContext)(b.ThemeContext);return!S.includes(t)&&l?(0,O.jsxs)(k,{background:(0,s.getRgbColor)("mainBackground",.8)({theme:c}),children:[(0,O.jsx)(A,{menu:l}),(0,O.jsx)(v.G,{menuId:a,menuName:l.shortName||l.name,hasFilters:n,flavour:t,parentIds:l.parentIds,hasCharts:!0,children:r.map((e=>{let{Component:t}=e,r=(0,o.A)(e,w);return t?(0,O.jsx)(t,C({},r),r.id):null}))})]}):null},T=(0,i.memo)(D),M=["getComponent","element","index"],F=["flavour","onActiveMenuId","getComponent","dashboardOptions","initialChartName","checkVisibility"];function N(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function E(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?N(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):N(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const L="8px 2px",B="1px 2px",R={root:B,submenu:B,default:L},V=[{flavour:"root",id:"System-0"}],H=(0,i.memo)((e=>{let{getComponent:t,element:r,index:n}=e,s=(0,o.A)(e,M);const a=(0,i.useMemo)((()=>r&&t(r)),[null===r||void 0===r?void 0:r.id,n]),l=(0,i.useMemo)((()=>!!V.find((e=>{let{id:t,flavour:n}=e;return t===r.id&&n===r.flavour}))),[r]);return!a||l?null:(0,O.jsx)(a,E(E(E({},r),{},{index:n},s),{},{isVisible:!0}),r.id)})),_=(0,i.memo)((e=>{let{flavour:t,elements:r,onScroll:n,dashboardOptions:o,getComponent:l,stickyBg:d="mainBackground",stickyRef:p,nextStickyRef:b,stickyIndexes:m,tmpStickyRef:x,containerWidth:j,headerProps:y={},ref:v}=e;const w=(e=>{const t=(0,i.useRef)(),r=(0,i.useRef)(),n=(0,i.useRef)(0),o=(0,i.useRef)(0);return(0,i.useCallback)((i=>{if(t.current!==e.length&&(o.current=0),r.current&&(o.current<5||t.current!==e.length)){o.current=o.current+1,t.current=e.length;const s=e.findIndex((e=>e.id===r.current.id));if(-1===s)return;const{start:a}=i.getMeasurements()[s];return i.scrollToOffset(a+n.current),clearTimeout(h),void(h=setTimeout((()=>o.current=5),200))}t.current=e.length;const s=i.scrollOffset;let a=0;const l=i.getMeasurements().find((e=>(a+=e.size,a>s)));l&&(r.current=e[l.index],n.current=s-l.start)}),[e])})(r),P=(0,i.useRef)(),[C,I]=(0,i.useState)(0),A=((e,t,r)=>{let{stickyRef:n,nextStickyRef:o,tmpStickyRef:s}=r;const a=(0,i.useRef)(),{active:l}=(0,f.fF)(),c=(0,i.useRef)();return c.current=l,(0,i.useCallback)((e=>{if(c.current&&c.current.data.current.isResizer)return a.current;if(!t)return a.current=(0,g.vp)(e),a.current;o.current=Number(Object.keys(t).find((t=>e.startIndex<t))),n.current=Number(Object.keys(t).reverse().find((t=>e.startIndex>=t))),o.current-e.startIndex===1&&(n.current=NaN);let r=(0,g.vp)(e);return null!==s.current&&(r=[...r,s.current]),isNaN(n.current)?a.current=[...new Set(r)].sort(((e,t)=>e-t)):a.current=[...new Set([n.current,...r])].sort(((e,t)=>e-t)),a.current}),[e,t])})(r,m,{stickyRef:p,nextStickyRef:b,tmpStickyRef:x}),k=(0,c.Te)({count:r.length,getScrollElement:()=>v.current,overscan:2,enableSmoothScroll:!1,estimateSize:e=>r[e].size,onChange:w,rangeExtractor:A,scrollPaddingStart:0});P.current=k,(0,u.A)(k,r);const S=(0,i.useCallback)((0,a.n)(100,(function(){n(...arguments),v.current&&I(v.current.scrollTop)})),[n]);return(0,O.jsxs)("div",{ref:v,style:{minHeight:"100%",width:"100%",overflow:"auto"},onScroll:S,children:[(0,O.jsx)(T,E({flavour:t},y)),(0,O.jsxs)("div",{style:{minHeight:"".concat(k.getTotalSize(),"px"),width:"100%",position:"relative"},children:[C>0&&!isNaN(p.current)&&(0,O.jsx)(s.Box,{sx:{top:0,left:0,width:"100%",padding:L,position:"sticky",zIndex:10,boxShadow:"2px 6px 6px -7px rgba(0, 0, 0, 0.4)"},background:d,children:(0,O.jsx)(H,E(E({},o),{},{element:r[p.current],index:p.current,getComponent:l}))},p.current),k.getVirtualItems().map((e=>{const t=R[r[e.index].flavour]||R.default;return(0,O.jsx)(s.Box,{ref:k.measureElement,sx:{top:0,left:0,width:"100%",padding:t,position:"absolute",transform:"translateY(".concat(e.start,"px)")},"data-index":e.index,children:(0,O.jsx)(H,E(E({},o),{},{element:r[e.index],index:e.index,getComponent:l,containerWidth:j}))},e.key)}))]})]})}),((e,t)=>e.elements.length===t.elements.length&&e.containerWidth===t.containerWidth)),K=e=>{let{flavour:t,onActiveMenuId:r,getComponent:n,dashboardOptions:s,initialChartName:a,checkVisibility:c}=e,u=(0,o.A)(e,F);const h=(0,d.bD)(),g=(0,l.qR)((e=>e.filter((e=>{const t=e.contexts||e.contextScope||e.chartIds||[e.id];return c?c(t,e.menuId||e.id,e.parentIds):h(t)})))),[{stickyRef:f,nextStickyRef:b,tmpStickyRef:m},x]=(e=>{const t=(0,l.Tg)(),r=(0,i.useRef)(null),n=(0,i.useMemo)((()=>e.reduce(((e,r,n)=>{let{id:o,sticky:i}=r;return t[o]&&"undefined"!==typeof i&&i&&(e[n]=!0),e}),{})),[e]),o=(0,i.useRef)(),s=(0,i.useRef)(),a=(0,i.useCallback)((e=>!!n[e]),[n]),c=(0,i.useCallback)((e=>o.current===e),[]);return[{stickyRef:o,nextStickyRef:s,isSticky:a,isActiveSticky:c,tmpStickyRef:r},n,t]})(g),j=(0,i.useRef)(),y=(0,i.useRef)(),v=(0,i.useMemo)((()=>(y.current&&y.current.cancel(),y.current=(0,p.A)({stickyRef:f}),()=>y.current(j.current,r))),[g.length,r]);return(0,i.useLayoutEffect)((()=>{g.length&&v()}),[g.length,a]),(0,O.jsx)(_,E({flavour:t,elements:g,onScroll:v,dashboardOptions:s,getComponent:n,ref:j,stickyRef:f,nextStickyRef:b,stickyIndexes:x,tmpStickyRef:m},u))},z=(0,i.memo)(K)},48106(e,t,r){r.d(t,{A:()=>d});r(98992),r(72577);var n=r(96540),o=r(69457),i=r(4719),s=r(50239),a=r(66814);const l=e=>{const t=(0,n.useRef)();return(0,a.i7)(e,(e=>(t.current=e,!1))),t},c=(e,t)=>{for(let r=0;r<e.length;r++){const n=e[r];if(n.id===t)return r;if(n.children&&n.children.length>0){const e=c(n.children,t);if(-1!==e)return r+1+e}}return-1},d=(e,t)=>{const r=(0,o.NF)(),a=l(i.tu),d=l(o.i8),u=(0,s.Gr)(),p=(0,n.useMemo)((()=>({goToElement:function(r){let{leaf:n=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!(!t.length||!e)&&(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;new Promise((r=>{const n=t=>{if(0===t)return r();e(),setTimeout((()=>n(--t)))};n(t)}))}((()=>{let o=c(t,r);if(n)for(;(null===(i=t[o])||void 0===i?void 0:i.level)<(null!==(s=null===(a=t[o+1])||void 0===a?void 0:a.level)&&void 0!==s?s:999999);){var i,s,a;o+=1}if(-1!==o)return e.scrollToIndex(o,{align:"center"})}),5),!0)},goToLink:function(e){let{leaf:t=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=Object.values(a.current).find((t=>t.link&&t.link===e));if(r)return p.goToElement(r.id,{leaf:t});if(d.current){const r=Object.values(d.current).find((t=>t.link&&t.link.includes(e)));if(r)return p.goToElement(r.id,{leaf:t})}}})),[r,t]);return(0,n.useLayoutEffect)((()=>{u(p)}),[p]),p}},96026(e,t,r){r.d(t,{l:()=>f,q:()=>g});var n=r(64467),o=(r(98992),r(54520),r(3949),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),r(62953),r(96540)),i=r(35570),s=r(42790),a=r(61841),l=r(24609),c=r(24013),d=r(19075),u=r(91421);function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function h(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const g=e=>{var t;let{alertId:r,alertName:n,nodeIds:s=[]}=e;const l=(0,i.Zp)(),{setState:p}=(0,u.$h)(),[h]=(0,a.Ay)(),{name:g}=(0,d.JL)(r),f=n||g,{isParent:b}=(0,c.xY)(s[0]),{loaded:m,value:x,hasError:j,error:y}=(0,u.wd)({node:{value:s[0],isParent:b},path:"/health"}),v=!(null===x||void 0===x||null===(t=x.tree)||void 0===t||null===(t=t["/health/alerts/prototypes"])||void 0===t||!t["health:alert:prototype:".concat(f)]),[,O]=(0,u.PJ)();return{canEdit:m&&!j&&v,goToEdit:(0,o.useCallback)((e=>{s=e?Array.from(new Set([e,...s])):s,p({alertName:f,isAlert:!0}),O(!0,{nodeId:s[0]})}),[f,s,h,p,l]),error:(null===y||void 0===y?void 0:y.errorMessage)||y}},f=()=>{const e=(0,i.Zp)(),{slug:t}=(0,l.ap)(),r=(0,s.rI)();return(0,o.useCallback)((n=>{n&&(r((e=>h(h({},e),{},{dyncfgSearchTerm:n}))),e("/spaces/".concat(t,"/settings/configurations"),{replace:!0}))}),[e,r,t])}},27024(e,t,r){r.d(t,{A:()=>T});var n=r(64467),o=(r(98992),r(54520),r(3949),r(62953),r(96540)),i=r(68978),s=r(31141),a=r(32788),l=r(29263),c=r(47410),d=r(16866),u=r(24609),p=r(19371),h=r(41579),g=r(19186),f=r(67294),b=r(5907),m=r(92726),x=r(62718),j=r(93536),y=r(38757),v=r(6304),O=r(50433),w=r(45706),P=r(28864),C=r(52795),I=r(74848);const A=(0,o.memo)((e=>{let{id:t,spaceId:r,roomId:n,chartId:s,name:a}=e;const[l,,c,d]=(0,v.A)(),{fullyLoaded:h,processing:f}=(0,m.fz)(t),x=(0,P.DH)(t,{onSuccess:()=>{(0,O.jE)("Chart added to ".concat(a)),d()}}),j=l&&h,y=(0,u.ns)(r,"slug"),A=(0,g.wz)(n,"slug"),k=(0,b.nM)(t),S=(0,w.A)(l&&t,{spaceId:r,spaceSlug:y,roomId:n,roomSlug:A}),D=(0,p.eg)();(0,o.useEffect)((()=>{if(S||!j)return;const e=D.getNode({id:s}),t=(0,C.h)(e.getAttributes());k(t.contextScope,t,(()=>setTimeout(x,100)))}),[j,S]);const T=l&&(f||S);return(0,I.jsx)(i.Button,{icon:"plus",onClick:c,isLoading:T,disabled:T,alignSelf:"end"})})),k=e=>{let{spaceId:t,roomId:r,chartId:n}=e;return[{id:"name",accessorKey:"name",header:"Dashboards",cell:e=>{let{getValue:t}=e;return(0,I.jsxs)(i.Flex,{alignItems:"center",gap:3,children:[(0,I.jsx)(i.Icon,{name:"dashboards",size:"small",color:"text"}),(0,I.jsx)(i.Text,{children:t()})]})}},{id:"plusButton",accessorKey:"id",header:"",cell:e=>{let{getValue:o,row:i}=e;return(0,I.jsx)(A,{id:o(),spaceId:t,roomId:r,chartId:n,name:i.original.name})}}]};function S(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function D(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?S(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):S(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const T=e=>{let{onClose:t}=e;(0,h.A)();const r=(0,g.ID)(),n=(0,g.XA)("name"),v=(0,u.vt)(),{params:O={},params:{chartId:w}}=(0,s.A)("addToDashboardModal"),P=(0,f.q)(),C=(0,m.Sf)(P),[A,S]=(0,o.useState)(""),[T,M]=(0,o.useState)(!1),F=A.length>0,N=(0,b.W6)(v,r,{onSuccess:t}),E=(0,p.eg)().getNode({id:w}),L=(0,o.useMemo)((()=>k({spaceId:v,roomId:r,chartId:w})),[v,r,w]),B=()=>{if(!E)return;const{aggregationMethod:e,selectedDimensions:t,groupBy:r,groupByLabel:n,groupingMethod:o,chartType:i,selectedLabels:s,nodesScope:a,selectedInstances:l,selectedNodes:c,contextScope:d}=E.getAttributes(),[u]=d;N(A,d,D(D({},(0,j.L)(u)),{},{aggregationMethod:e,selectedDimensions:t,groupBy:r,groupByLabel:n,groupingMethod:o,chartType:i,selectedLabels:s,nodesScope:a,selectedInstances:l,selectedNodes:c}))},R=(0,f.RQ)();return(0,I.jsxs)(a.GO,{onClose:t,children:[(0,I.jsx)(l.z,{onClose:t,title:"Add to Dashboard"}),(0,I.jsx)(c.U,{children:"Select Dashboard"}),(0,I.jsxs)(a.Yv,{gap:3,overflow:"hidden",height:"100%",children:[(0,I.jsxs)(i.H6,{children:["Add chart to one or more dashboards from the ",n]}),R?(0,I.jsx)(i.Table,{dataColumns:L,data:C}):(0,I.jsx)(x.UG,{rows:3}),(0,I.jsxs)(i.Flex,{column:!0,padding:[3,0],gap:1,children:[(0,I.jsxs)(i.H6,{children:["Create a new dashboard and add ",w," to it"]}),(0,I.jsx)(y.A,{value:A,label:"Name",onChange:e=>S(e.target.value),isValid:T,setIsValid:M,isDirty:F,instantFeedback:"all",onKeyDown:e=>e.keyCode===d.I7&&T&&B}),(0,I.jsx)(i.Button,{label:"Create & add",onClick:B,disabled:!E||!A})]})]})]})}},55048(e,t,r){r.d(t,{A:()=>c});r(98992),r(54520),r(62953);var n=r(96540),o=r(46587),i=r(24609),s=r(19186),a=r(81685),l=r(79022);const c=()=>{const e=(0,o.NJ)(),t=(0,i.vt)(),r=(0,s.ID)(),[,c]=(0,a.x)(),d=(0,n.useCallback)((()=>{const n=(0,l.l8)({userId:e,spaceId:t,roomId:r});return c(n),n}),[e,t,r,c]),u=(0,n.useCallback)((n=>{(0,l.zz)({userId:e,spaceId:t,roomId:r},n),c(n)}),[e,t,r,c]),p=(0,n.useCallback)((e=>{const t=d();u(t.filter((t=>t!==e)))}),[e,t,r]);return[d,u,p]}},42318(e,t,r){r.d(t,{A:()=>a});r(62953);var n=r(96540),o=r(61661),i=r(6988),s=r(32465);const a=()=>{const e=(0,o.AR)(),t=(0,s.A)(),[r,a]=(0,o.oE)(),l=(0,o.WB)(),c=(0,n.useMemo)((()=>(0,i.Cj)({searchTerm:r,integrations:e})),[r,e]),d=r?(0,i.M6)(c,t):l;return{integrations:(0,i.Fd)((0,i.xM)(d)),setSearchTerm:a}}},51318(e,t,r){r.d(t,{A:()=>c});var n=r(64467),o=(r(98992),r(54520),r(3949),r(62953),r(96540)),i=r(61661),s=r(89942);function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const c=()=>{const e=(0,s.PP)(),[t,r]=(0,i.XL)(),{reset:n}=(0,i.b8)(),a=(0,o.useCallback)((()=>{n(),(0,s.Z8)(l(l({},e),{},{integrationsModalOpen:"true"})),r("true")}),[n,r,e]);return{isIntegrationsVisible:t,hideIntegrations:(0,o.useCallback)((()=>{(0,s.Z8)(l(l({},e),{},{integrationsModalOpen:""})),r("")}),[e,r]),onIntegrationsClick:a}}},4703(e,t,r){r.d(t,{A:()=>u});r(89463);var n=r(51510),o=r(68978),i=r(74891),s=r(74848);const a=(0,i.A)(o.IconButton),l=(0,n.default)(a).attrs({icon:"x",neutral:!0,tooltip:"Skip, doesn't apply to me"}).withConfig({displayName:"taskItem__SkipButton",componentId:"sc-1mf27rk-0"})(["opacity:0;transition:opacity 0.2s;"]),c=(0,n.default)(o.Flex).attrs({gap:3,alignItems:"center",padding:[4],border:!0,round:1,cursor:"pointer"}).withConfig({displayName:"taskItem__ChecklistItem",componentId:"sc-1mf27rk-1"})(["background:",";transition:border-color 0.2s,background 0.2s;&:hover{border-color:",";background:",";","{opacity:1;}}"],(e=>{let{completed:t}=e;return(0,o.getColor)(t?"mainBackground":"panelBg")}),(0,o.getColor)("primary"),(0,o.getColor)("mainBackground"),l),d=(0,n.default)(o.Flex).attrs({width:"24px",height:"24px",alignItems:"center",justifyContent:"center",flex:!1}).withConfig({displayName:"taskItem__CheckIcon",componentId:"sc-1mf27rk-2"})(["",""],(e=>{let{completed:t}=e;return!t&&"\n border-radius: 50%;\n border: 2px solid ".concat((0,o.getColor)("borderSecondary"),";\n ")})),u=e=>{let{task:t,completed:r,onClick:n,onSkip:i,children:a}=e;return(0,s.jsxs)(c,{completed:r,onClick:n,children:[(0,s.jsx)(d,{completed:r,children:r&&(0,s.jsx)(o.Icon,{name:"check",color:"primary",width:"32px",height:"32px"})}),(0,s.jsxs)(o.Flex,{column:!0,gap:1,flex:!0,children:[(0,s.jsx)(o.Text,{strong:!0,color:r?"textLite":void 0,children:t.title}),(0,s.jsx)(o.TextSmall,{color:r?"textNoFocus":"textLite",children:a||t.description})]}),!r&&i&&(0,s.jsx)(l,{onClick:e=>{e.stopPropagation(),null===i||void 0===i||i()}})]})}},97926(e,t,r){r.d(t,{A:()=>u});var n=r(96540),o=r(41716),i=r(10602),s=r(67294),a=r(24609),l=r(86706),c=r(41258),d=r(31246);const u=()=>{const e=(0,i.nj)(),t=(0,i.CK)(),r=(0,o.s)("ids")||[],u=(0,o.s)("loaded"),p=(0,a.vt)();(0,c.A)(p);const h=(0,l.Gi)(),g=(0,l.gk)(),f=(0,s.q)(),b=(0,s.RQ)();return(0,n.useMemo)((()=>e&&u&&g&&b?{[d.aL.welcome]:!0,[d.aL.firstNodeConnected]:t.length>=1,[d.aL.firstAlertTriggered]:r.length>=1,[d.aL.secondNodeConnected]:t.length>=2,[d.aL.threeOrMoreNodes]:t.length>=3,[d.aL.firstTeamMemberInvited]:Array.isArray(h)&&h.length>1,[d.aL.firstDashboardCreated]:Array.isArray(f)&&f.length>=1}:null),[e,t.length,u,r.length,g,h,b,f])}},74290(e,t,r){r.d(t,{A:()=>p});r(98992),r(23215),r(54520),r(81454),r(8872),r(62953);var n=r(96540),o=r(24285),i=r(99728),s=r(24609),a=r(76571),l=r(56523),c=r(97926),d=r(17115),u=r(31246);const p=()=>{const{milestones:e,recordMilestones:t,markMilestonesSeen:r,settingsLoaded:p}=(0,l.A)(),h=(0,c.A)(),g=(0,d.Ay)(),f=(0,i.Sk)(),b=(0,d.Ex)(),m=(0,o.xd)("isLoaded"),x=(0,o.xd)("onboardingFormData"),j=(0,s.vt)(),y=(0,s.ap)("loaded"),v=(0,a.t5)(j,"channels"),O=(0,a.t5)(j,"loaded"),w=Array.isArray(v)?v.length:0,P=!(null===x||void 0===x||!x.usageType);(0,n.useEffect)((()=>{if(!p||!h)return;const r=Object.entries(h).filter((t=>{var r;let[n,o]=t;return o&&!(null!==(r=e.completed[n])&&void 0!==r&&r.completedAt)}));if(r.length>0){const e=r.map((e=>{let[t]=e;return t}));t(e)}}),[h,e.completed,t,p]),(0,n.useEffect)((()=>{if(!p||!O||!y||!m)return;const t={segment:g,permissions:f,isLargeTeam:b,channelCount:w,hasOnboarding:P},n=Object.entries(e.completed).reduce(((e,r)=>{let[n,o]=r;if(!o.completedAt||o.seenAt)return e;const i=((e,t)=>{let{segment:r,permissions:n,isLargeTeam:o,channelCount:i,hasOnboarding:s}=t;return(u.a7[e]||[]).filter((e=>s?!!e.segments.includes(r)&&!(e.permission&&!n[e.permission])&&!(e.requiresLargeTeam&&!o)&&!(void 0!==e.maxChannels&&i>e.maxChannels):e.isFeatureAnnouncement))})(n,t);if(!i.length)return e;const s=o.tasks||{};return i.every((e=>s[e.id]))&&e.push(n),e}),[]);n.length&&r(n)}),[w,O,P,b,r,f,e.completed,g,p,y,m])}},81187(e,t,r){r.d(t,{A:()=>v});var n=r(64467),o=(r(98992),r(54520),r(3949),r(62953),r(96540)),i=r(35570),s=r(34843),a=r(24609),l=r(41716),c=r(19186),d=r(67294),u=r(92726),p=r(14070),h=r(96859),g=r(51318),f=r(42318),b=r(43074),m=r(97394),x=r(56523);function j(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?j(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const v=function(){let{onBeforeAction:e,skipCompletedCheck:t=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=(0,i.Zp)(),n=(0,a.bq)(),j=(0,c.QW)(),{markTaskCompleted:v}=(0,x.A)(),{onIntegrationsClick:O}=(0,g.A)(),{setSearchTerm:w}=(0,f.A)(),{open:P}=(0,h.A)(),{handleOpenProfileModal:C}=(0,b.A)(),I=(0,s.Xr)(m.TZ),A=(0,l.s)("ids"),[,k]=(0,p.A)(),S=(0,d.q)(),D=(0,u.fz)(null===S||void 0===S?void 0:S[0],"slug"),T=(0,o.useCallback)((e=>t||!e.completed),[t]);return(0,o.useCallback)((t=>{null===e||void 0===e||e();let o=location.pathname,i={};if(t.openIntegrations)return t.integrationsSearchTerm&&w(t.integrationsSearchTerm),O(),void(T(t)&&v(t.milestoneId,t.id));if(t.openAiPanel)return P(),void(T(t)&&v(t.milestoneId,t.id));if(t.openProfileModal)return C(t.openProfileModal),void(T(t)&&v(t.milestoneId,t.id));if(t.openFirstDashboard&&D)return o="/spaces/".concat(n,"/rooms/").concat(j,"/dashboards/").concat(D),r(o),t.spotlight?void I(y(y({},t.spotlight),{},{taskId:t.id,milestoneId:t.milestoneId,targetPath:o})):void(T(t)&&v(t.milestoneId,t.id));if(t.route){const e=t.isSpaceRoute?"/spaces/".concat(n):"/spaces/".concat(n,"/rooms/").concat(j);void 0!==t.alertTabIndex&&(i.alertTabIndex=t.alertTabIndex),o="".concat(e,"/").concat(t.route),r(o,{state:i}),t.openFirstAlert&&null!==A&&void 0!==A&&A[0]&&k({alertId:A[0]})}t.spotlight?I(y(y({},t.spotlight),{},{taskId:t.id,milestoneId:t.milestoneId,targetPath:o})):T(t)&&v(t.milestoneId,t.id)}),[e,r,n,j,v,O,w,P,C,I,A,k,D,T])}},17115(e,t,r){r.d(t,{Ay:()=>c,Ex:()=>l});var n=r(96540),o=r(24285),i=r(19186),s=r(31246);const a=()=>{const e=(0,o.xd)("onboardingFormData"),t=(0,i.XA)("memberCount")||0,r=(0,i.XA)("nodeCount")||0;return(0,n.useMemo)((()=>{const n=null===e||void 0===e?void 0:e.usageType;return"Personal (homelab)"===n?s.JF.homelabber:"Work"===n?t>2||r>=50?s.JF.largeOrg:s.JF.smallOrg:s.JF.homelabber}),[null===e||void 0===e?void 0:e.usageType,t,r])},l=()=>{const e=a(),t=(0,i.XA)("memberCount")||0;return e===s.JF.largeOrg&&t>10},c=a},549(e,t,r){r.d(t,{G:()=>$,A:()=>Y});r(98992),r(54520),r(3949);var n=r(64467),o=r(51510),i=r(68978),s=r(78152),a=(r(72577),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),r(62953),r(96540)),l=r(6304),c=r(74891),d=r(83747),u=r(80590),p=r(94404),h=(r(42762),r(37550),r(4719)),g=r(55125),f=r(74848);const b=(0,a.memo)((e=>{let{matchType:t,value:r,sublabel:n,onRemove:o}=e;return(0,f.jsx)(i.Pill,{flavour:"neutral",hollow:!0,round:1,padding:[1,2],children:(0,f.jsxs)(i.Flex,{gap:2,alignItems:"start",children:[(0,f.jsxs)(i.Flex,{column:!0,gap:0,overflow:"hidden",flex:!0,children:[(0,f.jsxs)(i.TextSmall,{strong:!0,truncate:!0,children:[t,": ",r]}),n&&(0,f.jsx)(i.TextMicro,{color:"textLite",truncate:!0,children:n})]}),(0,f.jsx)(i.Icon,{name:"x",size:"small",onClick:o,cursor:"pointer",color:"textLite",_hover:{color:"text"}})]})})}));r(26910),r(27495),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);var m=r(19186),x=r(87083),j=r(24609),y=r(258),v=r(60602);const O=["labels","dimensions","instances"],w=(e,t,r)=>{const[n,o]=(0,a.useState)(""),i=(0,v.A)(n,300),[s,l]=(0,a.useState)(null),[c,d]=(0,a.useState)(!1),u=(0,m.ID)(),p=(0,j.vt)(),h=(0,x.w7)({extraKey:r,merge:!1,scoped:!0}),g=(0,a.useMemo)((()=>{if(null!==e&&void 0!==e&&e.contexts)return e.contexts}),[e]);(0,a.useEffect)((()=>{if(!i.trim())return l(null),void d(!1);d(!0),(0,y.Xx)(u,i,{selectedNodes:h,scopeContexts:g,spaceId:p}).then((e=>{var t;const r=null===e||void 0===e||null===(t=e.data)||void 0===t?void 0:t.contexts;if(!r)return void l(null);const n={},o={dimensions:new Map},i=new Map,s=new Map,a={dimensions:0,instances:0,labels:0},c=/^\.\.\.\s+(\d+)\s+(values?|instances?|dimensions?)\s+more$/i;Object.entries(r).forEach((e=>{let[t,r]=e;const n=r.title||t;r.dimensions&&r.dimensions.forEach((e=>{const r=e.match(c);r?a.dimensions+=parseInt(r[1],10):(o.dimensions.has(e)||o.dimensions.set(e,[]),o.dimensions.get(e).push({title:n,contextId:t}))})),r.instances&&r.instances.forEach((e=>{const r=e.match(c);if(r)return void(a.instances+=parseInt(r[1],10));const o=e.split("."),s=o[o.length-1];i.has(s)||i.set(s,{contextIds:[],contextToInstance:{},contexts:[]});const l=i.get(s);l.contextIds.push(t),l.contextToInstance[t]=e,l.contexts.push({title:n,contextId:t})})),r.labels&&Object.entries(r.labels).forEach((e=>{let[r,o]=e;if(Array.isArray(o)){s.has(r)||s.set(r,new Map);const e=s.get(r);o.forEach((r=>{const o=r.match(c);o?a.labels+=parseInt(o[1],10):(e.has(r)||e.set(r,[]),e.get(r).push({title:n,contextId:t}))}))}}))})),Object.entries(o).forEach((e=>{let[t,r]=e;(r.size>0||a[t]>0)&&(n[t]=[],r.forEach(((e,r)=>{const o=e.map((e=>e.contextId)),i=e.map((e=>e.title));let s;s=1===e.length?e[0].title:2===e.length?"".concat(e[0].title,", ").concat(e[1].title):"".concat(e[0].title,", ").concat(e[1].title," and ").concat(e.length-2," more"),n[t].push({value:r,label:r,sublabel:s,contextIds:o,allContextTitles:i})})),n[t].sort(((e,t)=>e.label.localeCompare(t.label))),a[t]>0&&n[t].push({value:null,label:"+".concat(a[t]," more"),sublabel:"Keep typing to narrow results",contextIds:[],isTruncationNotice:!0}))})),(i.size>0||a.instances>0)&&(n.instances=[],i.forEach(((e,t)=>{const{contextIds:r,contextToInstance:o,contexts:i}=e,s=i.map((e=>e.title));let a;a=1===i.length?i[0].title:2===i.length?"".concat(i[0].title,", ").concat(i[1].title):"".concat(i[0].title,", ").concat(i[1].title," and ").concat(i.length-2," more"),n.instances.push({value:t,label:t,sublabel:a,contextIds:r,contextToInstance:o,allContextTitles:s})})),n.instances.sort(((e,t)=>e.label.localeCompare(t.label))),a.instances>0&&n.instances.push({value:null,label:"+".concat(a.instances," more"),sublabel:"Keep typing to narrow results",contextIds:[],isTruncationNotice:!0})),s.size>0&&(n.labels=[],s.forEach(((e,t)=>{const r=[];e.forEach(((e,n)=>{const o=e.map((e=>e.contextId)),i=e.map((e=>e.title));let s;s=1===e.length?e[0].title:2===e.length?"".concat(e[0].title,", ").concat(e[1].title):"".concat(e[0].title,", ").concat(e[1].title," and ").concat(e.length-2," more"),r.push({value:"".concat(t,":").concat(n),label:n,sublabel:s,contextIds:o,allContextTitles:i})})),r.sort(((e,t)=>e.label.localeCompare(t.label))),n.labels.push({labelKey:t,items:r})})),n.labels.sort(((e,t)=>e.labelKey?t.labelKey?e.labelKey.localeCompare(t.labelKey):-1:1)),a.labels>0&&n.labels.push({labelKey:null,items:[{value:null,label:"+".concat(a.labels," more"),sublabel:"Keep typing to narrow results",contextIds:[],isTruncationNotice:!0}]})),l(n),d(!1)})).catch((e=>{console.error("Context search error:",e),l(null),d(!1)}))}),[i,u,p,h,g]);const f=(0,a.useCallback)(((r,n)=>{t({matchType:r,value:n.value,label:n.label,sublabel:n.sublabel,contextIds:n.contextIds,contextToInstance:n.contextToInstance,menuId:null===e||void 0===e?void 0:e.id})}),[t,null===e||void 0===e?void 0:e.id]);return{searchValue:n,setSearchValue:o,debouncedSearchValue:i,searchResults:s,isLoading:c,onSelectResult:f}};var P=r(80045);const C=["children"];function I(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function A(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?I(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):I(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const k=(0,a.memo)((e=>{let{children:t}=e,r=(0,P.A)(e,C);const n=(0,a.useRef)(null);return(0,a.useEffect)((()=>{const e=n.current;if(!e)return;const t=()=>{const t=e.scrollLeft>0,r=e.scrollLeft+e.clientWidth<e.scrollWidth,n=[];t&&n.push("inset 10px 0 10px -10px rgba(0, 0, 0, 0.2)"),r&&n.push("inset -10px 0 10px -10px rgba(0, 0, 0, 0.2)"),e.style.boxShadow=n.join(", ")};return t(),e.addEventListener("scroll",t),()=>{e.removeEventListener("scroll",t)}}),[]),(0,f.jsx)(i.Flex,A(A({ref:n,overflow:"auto"},r),{},{children:t}))}));var S=r(45087);const D=(0,o.default)(i.Flex).attrs({background:"modalBackground",backgroundOpacity:.6}).withConfig({displayName:"contextSearch__ModalContainer",componentId:"sc-93w1u0-0"})(["backdrop-filter:blur(8px);"]),T=(0,a.memo)((e=>{let{parentIds:t,allFilters:r,onGoToParent:n}=e;const o=(0,a.useMemo)((()=>(null===t||void 0===t?void 0:t.find((e=>r[e]&&Object.keys(r[e]).length>0)))||null),[t,r]),s=(0,h.b)(o);if(!o||!s)return null;const l=s.shortName||s.name||"parent section";return(0,f.jsx)(S.A,{content:"Go to ".concat(l),align:"bottom",children:(0,f.jsx)(i.IconButton,{icon:"arrowUp",flavour:"borderless",onClick:()=>n(o),padding:[0],small:!0})})})),M=(0,a.memo)((e=>{let{menuId:t,parentIds:r,activeMenuId:n,onMenuChange:o}=e;const s=((e,t)=>{const r=(0,h.b)(e),n=(0,h.yy)(),o=(t||[]).map((e=>n[e])).filter(Boolean);return(0,a.useMemo)((()=>{const n=[];return o.forEach(((e,r)=>{n.push({label:e.shortName||e.name,value:t[t.length-1-r]})})),r&&n.push({label:r.shortName||r.name,value:e}),n}),[e,t,r,o])})(t,r);return(0,f.jsx)(i.Menu,{value:n,items:s,onChange:o,dropProps:{align:{top:"bottom",left:"left"}},dropdownProps:{width:"200px"},caret:!0,padding:[0],small:!0})})),F=(0,a.memo)((e=>{let{menuId:t,onClose:r,flavour:n,parentIds:o,onGoToParent:s}=e;const[l,c]=(0,a.useState)(t),u=(0,h.b)(l),p=(0,g.X)(),{filters:m,addFilter:x,removeFilter:j,clearFilters:y}=(0,g.w)(null===u||void 0===u?void 0:u.contexts,l),{searchValue:v,setSearchValue:P,debouncedSearchValue:C,searchResults:I,isLoading:A,onSelectResult:F}=w(u,x,n),N=(e,t)=>m.some((r=>r.matchType===e&&r.value===t)),E=(e,t)=>{if(N(e,t.value)){const r=m.find((r=>r.matchType===e&&r.value===t.value));j(r)}else F(e,t)};return(0,f.jsx)(i.Layer,{onClickOutside:r,onEsc:r,children:(0,f.jsxs)(D,{column:!0,border:!0,round:1,width:{base:"600px",max:"100%"},overflow:"hidden","data-testid":"context-search-modal",children:[(0,f.jsxs)(i.Flex,{padding:[2,4],border:{side:"bottom"},alignItems:"center",justifyContent:"between",children:[(0,f.jsxs)(i.Flex,{alignItems:"center",gap:2,children:[(0,f.jsx)(i.Text,{color:"textLite",children:"Filter chart in"}),(null===o||void 0===o?void 0:o.length)>0?(0,f.jsx)(M,{menuId:t,parentIds:o,activeMenuId:l,onMenuChange:c}):(0,f.jsx)(i.TextSmall,{children:(null===u||void 0===u?void 0:u.name)||"this section"})]}),(0,f.jsx)(i.Flex,{alignItems:"center",gap:2,children:s&&(0,f.jsx)(T,{parentIds:o,allFilters:p,onGoToParent:s})})]}),(0,f.jsx)(i.Flex,{padding:[3],column:!0,border:{side:"bottom"},children:(0,f.jsx)(i.TextInput,{value:v,onChange:e=>P(e.target.value),placeholder:"Search dimensions, labels...","data-testid":"context-search-input",autoFocus:!0,iconLeft:(0,f.jsx)(i.Icon,{name:A?"loading":"search",color:"textLite",size:"small"}),width:"100%"})}),(0,f.jsxs)(i.Flex,{column:!0,overflow:"auto",style:{opacity:A?.5:1,filter:A?"blur(2px)":"none",transition:"height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease, filter 0.2s ease"},height:null===I?"152px":I&&Object.keys(I).length>0?"400px":"199px",children:[null===I&&(0,f.jsx)(i.Flex,{column:!0,gap:3,padding:[3],flex:!0,children:(0,f.jsxs)(i.Flex,{column:!0,gap:2,children:[(0,f.jsxs)(i.Flex,{alignItems:"center",gap:2,children:[(0,f.jsx)(i.Icon,{name:"search",size:"small",color:"textLite"}),(0,f.jsx)(i.TextSmall,{color:"textLite",children:"Search charts based on dimensions, instances and labels"})]}),(0,f.jsxs)(i.Flex,{alignItems:"center",gap:2,children:[(0,f.jsx)(i.Icon,{name:"filter",size:"small",color:"textLite"}),(0,f.jsxs)(i.TextSmall,{color:"textLite",children:["Results are scoped to ",(null===u||void 0===u?void 0:u.name)||"this section"," charts"]})]})]})}),I&&Object.keys(I).length>0&&(0,f.jsx)(i.Flex,{column:!0,padding:[0,0,8],flex:!0,children:O.map((e=>{const t=I[e];return t&&0!==t.length?(0,f.jsxs)(i.Flex,{column:!0,children:[(0,f.jsx)(i.Flex,{padding:[2,4],alignItems:"center",position:"sticky",top:0,zIndex:2,children:(0,f.jsx)(i.TextSmall,{strong:!0,color:"textLite",children:e.charAt(0).toUpperCase()+e.slice(1)})}),"labels"===e?(0,f.jsx)(i.Flex,{column:!0,children:t.map(((t,r)=>(0,f.jsxs)(i.Flex,{column:!0,border:{side:"bottom"},children:[t.labelKey&&(0,f.jsx)(i.Flex,{padding:[1,6],alignItems:"center",position:"sticky",top:"30px",zIndex:1,children:(0,f.jsx)(i.TextMicro,{strong:!0,color:"textLite",children:t.labelKey})}),t.items.map(((t,r)=>{const n=!t.isTruncationNotice&&N(e,t.value);return(0,f.jsx)(i.Flex,{padding:[2,6],cursor:t.isTruncationNotice?"default":"pointer",background:n?"neutralHighlight":void 0,_hover:t.isTruncationNotice?{}:{background:"highlight"},onClick:t.isTruncationNotice?void 0:()=>E(e,t),opacity:t.isTruncationNotice?.7:1,children:(0,f.jsxs)(i.Flex,{gap:1,alignItems:"center",overflow:"hidden",flex:!0,children:[(0,f.jsxs)(i.Flex,{gap:.5,column:!0,overflow:"hidden",flex:!0,children:[(0,f.jsx)(i.TextSmall,{truncate:!0,children:t.label}),t.sublabel&&(0,f.jsx)(f.Fragment,{children:t.allContextTitles&&t.allContextTitles.length>2?(0,f.jsx)(S.A,{content:(0,f.jsxs)(d.A,{column:!0,gap:1,children:[(0,f.jsxs)(i.TextSmall,{strong:!0,children:["Found in ",t.allContextTitles.length," ","contexts:"]}),(0,f.jsx)(i.Flex,{flexWrap:!0,children:t.allContextTitles.map(((e,r)=>(0,f.jsxs)(i.TextSmall,{children:[e,r<t.allContextTitles.length-1?", ":""]},r)))})]}),plain:!0,children:(0,f.jsx)(i.TextMicro,{color:"textLite",children:t.sublabel})}):(0,f.jsx)(i.TextMicro,{color:"textLite",children:t.sublabel})})]}),n&&(0,f.jsx)(i.Icon,{name:"check",size:"small",color:"primary"})]})},"".concat(e,"-").concat(t.value,"-").concat(r))}))]},r)))}):(0,f.jsx)(i.Flex,{column:!0,children:t.map(((t,r)=>{const n=!t.isTruncationNotice&&N(e,t.value);return(0,f.jsx)(i.Flex,{padding:[2,4],cursor:t.isTruncationNotice?"default":"pointer",background:n?"neutralHighlight":void 0,_hover:t.isTruncationNotice?{}:{background:"highlight"},onClick:t.isTruncationNotice?void 0:()=>E(e,t),opacity:t.isTruncationNotice?.7:1,children:(0,f.jsxs)(i.Flex,{gap:1,alignItems:"center",overflow:"hidden",flex:!0,children:[(0,f.jsxs)(i.Flex,{gap:.5,column:!0,overflow:"hidden",flex:!0,children:[(0,f.jsx)(i.TextSmall,{truncate:!0,children:t.label}),t.sublabel&&(0,f.jsx)(f.Fragment,{children:t.allContextTitles&&t.allContextTitles.length>2?(0,f.jsx)(S.A,{content:(0,f.jsxs)(d.A,{column:!0,gap:1,children:[(0,f.jsxs)(i.TextSmall,{strong:!0,children:["Found in ",t.allContextTitles.length," contexts:"]}),(0,f.jsx)(i.Flex,{flexWrap:!0,children:t.allContextTitles.map(((e,r)=>(0,f.jsxs)(i.TextSmall,{children:[e,r<t.allContextTitles.length-1?", ":""]},r)))})]}),plain:!0,children:(0,f.jsx)(i.TextMicro,{color:"textLite",truncate:!0,children:t.sublabel})}):(0,f.jsx)(i.TextMicro,{color:"textLite",truncate:!0,children:t.sublabel})})]}),n&&(0,f.jsx)(i.Icon,{name:"check",size:"small",color:"primary"})]})},"".concat(e,"-").concat(t.value,"-").concat(r))}))})]},e):null}))}),!A&&""!==C.trim()&&null!==I&&0===Object.keys(I).length&&(0,f.jsxs)(i.Flex,{padding:[6,3],justifyContent:"center",alignItems:"center",column:!0,gap:2,flex:!0,children:[(0,f.jsx)(i.Icon,{name:"search",size:"medium",color:"textLite"}),(0,f.jsx)(i.TextSmall,{color:"textLite",children:"No results found"}),(0,f.jsx)(i.TextMicro,{color:"textLite",children:"Try different search terms"})]}),m.length>0&&(0,f.jsxs)(i.Flex,{column:!0,gap:2,padding:[3,3,0],border:{side:"top"},position:"sticky",bottom:0,zIndex:99,children:[(0,f.jsxs)(i.Flex,{justifyContent:"between",alignItems:"center",children:[(0,f.jsxs)(i.TextMicro,{strong:!0,children:["Active Filters (",m.length,")"]}),m.length>0&&(0,f.jsx)(i.Button,{label:"Clear All",flavour:"borderless",onClick:y,"data-testid":"context-search-clear-all",padding:[0],small:!0})]}),(0,f.jsx)(k,{gap:2,padding:[0,0,3],children:m.map(((e,t)=>(0,f.jsx)(b,{matchType:e.matchType,value:e.label,sublabel:e.sublabel,onRemove:()=>j(e)},"".concat(e.matchType,"-").concat(e.value,"-").concat(t))))})]})]})]})})}));var N=r(33962),E=r(49163),L=r(63928),B=r(95565),R=r(1444);function V(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function H(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?V(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):V(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const _=(0,u.A)((0,c.A)(i.Flex)),K=(0,p.A)((0,c.A)(i.IconButton)),z=(0,a.memo)((e=>{let{menuId:t,menuName:r,contexts:n}=e;const{filters:o}=(0,g.w)(n,t);return o&&0!==o.length?(0,f.jsxs)(i.Flex,{column:!0,children:[(0,f.jsxs)(i.TextMicro,{color:"textLite",children:["Filters in ",r," (",o.length,")"]}),(0,f.jsx)(i.Flex,{column:!0,children:o.map((e=>(0,f.jsxs)(i.TextSmall,{children:[e.matchType,": ",(0,f.jsx)(i.Text,{strong:!0,children:e.label})]},"".concat(e.matchType,"-").concat(e.label))))})]}):null})),G=(0,a.memo)((e=>{let{parentIds:t}=e;return t&&0!==t.length?(0,f.jsx)(i.Flex,{column:!0,gap:1,children:t.map((e=>{const t=(0,h.b)(e);return t?(0,f.jsx)(z,{menuId:e,menuName:t.shortName||t.name||e,contexts:t.contexts},e):null}))}):null})),W=(0,a.memo)((e=>{let{menuId:t,menuName:r,flavour:n,parentIds:o}=e;const s=(0,h.b)(t),c=(0,g.X)(),u=(0,N.Ud)(),[p,,b,m]=(0,l.A)(),x=new Set;c[t]&&Object.values(c[t]).forEach((e=>{Array.isArray(e)&&e.forEach((e=>{x.add("".concat(e.matchType,"-").concat(e.value))}))}));const j=x.size,y=new Set;o&&o.forEach((e=>{const t=c[e];t&&Object.values(t).forEach((e=>{Array.isArray(e)&&e.forEach((e=>{y.add("".concat(e.matchType,"-").concat(e.value))}))}))}));const v=y.size,O=j>0,w=v>0,P=O||w,C=P?{side:"all",color:O?"primary":"border",width:"1px"}:void 0,I=(0,a.useCallback)((e=>{u(e),m()}),[u,m]),A=(0,a.useMemo)((()=>O||w?(0,f.jsxs)(d.A,{column:!0,gap:2,children:[(0,f.jsx)(z,{menuId:t,menuName:r,contexts:null===s||void 0===s?void 0:s.contexts}),(0,f.jsx)(G,{parentIds:o})]}):"Search in ".concat(r)),[O,w,t,r,null===s||void 0===s?void 0:s.contexts,o]);return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(_,{position:"relative",tooltip:A,payload:{menuId:t},children:(0,f.jsx)(i.Flex,{alignItems:"center",gap:.5,children:P?(0,f.jsxs)(i.Flex,{onClick:b,cursor:"pointer",border:C,round:!0,alignItems:"center",padding:[0,.5],children:[(0,f.jsx)(i.IconButton,{icon:"filterList",flavour:"borderless",padding:[0],"data-testid":"context-search-button","data-active":O,"data-indeterminate":w,height:"16px",width:"16px"}),v>0&&(0,f.jsx)(i.TextMicro,{color:"textLite",strong:!0,padding:[0,1],children:v}),j>0&&(0,f.jsx)(i.TextMicro,{color:"primary",strong:!0,padding:[0,1],children:j})]}):(0,f.jsx)(i.Flex,{opacity:0,_hover:{opacity:1},transition:"opacity 0.2s ease",children:(0,f.jsx)(i.IconButton,{icon:"filterList",onClick:b,flavour:"borderless",padding:[0],"data-testid":"context-search-button","data-active":O,"data-indeterminate":w,height:"16px",width:"16px"})})})}),p&&(0,f.jsx)(F,{menuId:t,onClose:m,flavour:n,parentIds:o,onGoToParent:I})]})})),q={LocalDashboard:"Favourites can be saved when the agent is part of a Netdata cloud space.",DemoSpace:"Favourites cannot be saved on a demo space.",FreePlan:()=>(0,f.jsxs)(i.Flex,{column:!0,gap:1,children:[(0,f.jsx)(i.Text,{children:"Favourites can be saved only on a paid plan."}),(0,f.jsx)(B.A,{children:(0,f.jsx)(i.Text,{color:"primary",children:"Upgrade for no limitations!"})})]}),default:null},U=(0,a.memo)((e=>{var t;let{menuId:r,menuName:n,flavour:o}=e;const[i,,s,c]=(0,l.A)(),d=null===(t=(0,E._)({params:{type:["favourites"],path:["/".concat(o)],entity:r}}).find((e=>{let{entity:t}=e;return t===r})))||void 0===t?void 0:t.id,u=!!d,p=(0,L.yK)({onResolve:c}),h=(0,L.z2)(d,{onResolve:c}),{disabled:g,reason:b}=(0,R.A)(),m=(0,a.useCallback)((()=>{g||(s(),u?h():p({type:"favourites",entity:r,path:"/".concat(o),value:{menuId:r,sortOrder:Date.now()}}))}),[g,u,h,p,r,o,s]),x=(0,a.useMemo)((()=>H({tooltip:g&&b?q[b]||q.default:u?"Remove ".concat(n," from your favourites"):"Add ".concat(n," to your favourites"),disabled:i||g},"FreePlan"===b?{tooltipProps:{align:"bottom",activateOn:"hover",isBasic:!0,allowHoverOnTooltip:!0}}:{})),[u,i,n,g,b]);return(0,f.jsx)(K,H({icon:u?"heart":"heart_hollow",onClick:m,disabled:i||g,flavour:"borderless",padding:[0],"data-testid":"toggle-favourite-button","data-active":u,payload:{menuId:r},height:"12px",width:"12px"},x))}));function J(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Z(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?J(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):J(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const X=(0,o.default)(i.Flex).withConfig({displayName:"withMenuActions__StyledWrapper",componentId:"sc-vbh3xj-0"})(["&&& button[data-indeterminate],&&& button[data-active]{",' &[data-indeterminate="true"]{color:',";fill:",";svg,path{fill:",';}}&[data-active="true"]{color:',";fill:",";svg,path{fill:",";}}&:hover{color:",";fill:",";svg,path{fill:",';}}&[data-active="true"]:hover{color:',";fill:",";svg,path{fill:",";}}}"],(e=>"\n color: ".concat((0,i.getColor)(e.hasCharts?"textNoFocus":["transparent","full"])(e),";\n fill: ").concat((0,i.getColor)(e.hasCharts?"textNoFocus":["transparent","full"])(e),";\n\n svg,\n path {\n fill: ").concat((0,i.getColor)(e.hasCharts?"textNoFocus":["transparent","full"])(e),";\n }\n ")),(0,i.getColor)("textLite"),(0,i.getColor)("textLite"),(0,i.getColor)("textLite"),(0,i.getColor)("primary"),(0,i.getColor)("primary"),(0,i.getColor)("primary"),(0,i.getColor)("text"),(0,i.getColor)("text"),(0,i.getColor)("text"),(0,i.getColor)("accent"),(0,i.getColor)("accent"),(0,i.getColor)("accent")),$=e=>{let{children:t,menuId:r,menuName:n,flavour:o,parentIds:a,hasCharts:l,hasFilters:c=s.af}=e;return(0,f.jsxs)(X,{alignItems:"center",justifyContent:"between",hasCharts:l,gap:1,children:[t,(0,f.jsxs)(i.Flex,{alignItems:"center",gap:1,children:[c&&(0,f.jsx)(W,{menuId:r,menuName:n,flavour:o,parentIds:a}),(0,f.jsx)(U,{menuId:r,menuName:n,flavour:o})]})]})},Y=e=>t=>{var r,n;return t.enableFavourites&&null!==(r=t.contexts)&&void 0!==r&&r.length?(0,f.jsx)($,{menuId:t._id,menuName:t.name,flavour:t.flavour,parentIds:t.parentIds,hasCharts:!(null===(n=t.selfChartIds)||void 0===n||!n.length),children:(0,f.jsx)(e,Z({},t))}):(0,f.jsx)(e,Z({},t))}},41579(e,t,r){r.d(t,{A:()=>u});r(26910),r(98992),r(3949),r(81454);var n=r(96540),o=r(30569),i=r(92726),s=r(91539),a=r(24609),l=r(19186),c=r(258),d=r(67294);const u=()=>{const e=(0,a.vt)(),t=(0,l.ID)(),r=(0,o.yF)((0,n.useCallback)((function(e,r){let{data:{results:n}={}}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(r((0,d.z_)({id:t,key:"loaded"}),!0),null!==n&&void 0!==n&&n.length){const e=n.sort(((e,t)=>e.name.localeCompare(t.name,void 0,{sensitivity:"accent",ignorePunctuation:!0})));e.forEach((e=>r((0,i._d)(e.id),e)));const o=e.map((e=>{let{id:t}=e;return t}));r((0,d.z_)({id:t,key:"ids"}),o)}}),[])),u=(0,n.useCallback)((()=>{(0,c.SJ)(e,t).then(r).catch((()=>{}))}),[e,t]);return(0,s.A)((()=>({polling:!1,enabled:!!e&&!!t,fetch:()=>(0,c.SJ)(e,t),onReceive:r})),[e,t]),u}},31035(e,t,r){r.d(t,{$:()=>p,A:()=>h});var n=r(96540),o=r(30569),i=r(97940),s=r(24609),a=r(77389),l=r(63231),c=r(86706),d=r(82505),u=r(99728);const p=e=>"spaces.".concat(e,".members"),h=e=>{const t=(0,s.vt)(),r=(0,o.yF)((0,n.useCallback)(((r,n,o)=>{let{results:i}=o;n((0,c.jX)({id:e,spaceId:t}),i)}),[e,t])),h=(0,u.JT)("user:ReadAll");(0,i.A)((()=>({key:p(e),autorun:!!e&&h,fetch:()=>(0,a.kE)(e),association:{getError:()=>(0,d.x2)({id:e,key:"error"}),getIds:()=>(0,c.kd)({id:e,key:"ids"}),getLoaded:()=>(0,c.kd)({id:e,key:"loaded"}),getUpdatedAt:()=>(0,c.kd)({id:e,key:"updatedAt"})},sort:(e,t)=>e.name.localeCompare(t.name,void 0,{sensitivity:"accent",ignorePunctuation:!0}),getResource:e=>(0,l.m)({id:e}),getResourcesInitializer:()=>l.WJ,onReceive:r,pollingOptions:{pollingInterval:315e3}})),[e,h])}},60602(e,t,r){r.d(t,{A:()=>i});r(62953);var n=r(96540),o=r(68531);const i=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const[i,s]=(0,n.useState)(e);return(0,o.A)((()=>s(e)),t,[e,...r]),i}},50916(e){e.exports=(e,t,r,n,o)=>{const i=o-n;if(0===i)return[];const s=r*Math.cos(n)+e,a=r*Math.sin(n)+t,l=r*Math.cos(o)+e,c=r*Math.sin(o)+t;return[["M",s,a],["A",r,r,0,Math.abs(i)<=Math.PI?"0":"1",i<0?"0":"1",l,c]]}}}]);