File: //opt/netdata/usr/local/local/share/netdata/web/v3/4290.cbbcc1359c75ce117fcb.chunk.js
try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4742c1b2-28aa-4747-a1da-4b2689b7b16d",e._sentryDebugIdIdentifier="sentry-dbid-4742c1b2-28aa-4747-a1da-4b2689b7b16d")}()}catch(e){}!function(){try{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"ff6b4c14193f160501d7117c313cc3a769881a66"}}catch(e){}}(),(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[4290,6026],{549:(e,t,n)=>{n.d(t,{G:()=>H,A:()=>z});var r=n(33185),o=n(80689),s=n(78152),i=(n(98992),n(72577),n(3949),n(81454),n(25509),n(65223),n(60321),n(41927),n(11632),n(64377),n(66771),n(12516),n(68931),n(52514),n(35694),n(52774),n(49536),n(21926),n(94483),n(16215),n(96540)),a=n(6304),l=n(74891),c=n(83747),d=n(80590),u=n(94404),h=(n(54520),n(37550),n(4719)),x=n(55125),g=n(74848);const m=(0,i.memo)((e=>{let{matchType:t,value:n,sublabel:r,onRemove:s}=e;return(0,g.jsx)(o.Pill,{flavour:"neutral",hollow:!0,round:1,padding:[1,2],children:(0,g.jsxs)(o.Flex,{gap:2,alignItems:"start",children:[(0,g.jsxs)(o.Flex,{column:!0,gap:0,overflow:"hidden",flex:!0,children:[(0,g.jsxs)(o.TextSmall,{strong:!0,truncate:!0,children:[t,": ",n]}),r&&(0,g.jsx)(o.TextMicro,{color:"textLite",truncate:!0,children:r})]}),(0,g.jsx)(o.Icon,{name:"x",size:"small",onClick:s,cursor:"pointer",color:"textLite",_hover:{color:"text"}})]})})}));n(71517),n(11379),n(93777),n(14190),n(12359),n(86097),n(17273),n(27415),n(19929),n(37583),n(55122),n(20230),n(57268),n(79733);var p=n(19186),f=n(87083),j=n(24609),b=n(258),v=n(60602);const y=["labels","dimensions","instances"],C=(e,t,n)=>{const[r,o]=(0,i.useState)(""),s=(0,v.A)(r,300),[a,l]=(0,i.useState)(null),[c,d]=(0,i.useState)(!1),u=(0,p.ID)(),h=(0,j.vt)(),x=(0,f.w7)({extraKey:n,merge:!1,scoped:!0}),g=(0,i.useMemo)((()=>{if(e?.contexts)return e.contexts}),[e]);(0,i.useEffect)((()=>{if(!s.trim())return l(null),void d(!1);d(!0),(0,b.Xx)(u,s,{selectedNodes:x,scopeContexts:g,spaceId:h}).then((e=>{const t=e?.data?.contexts;if(!t)return void l(null);const n={},r={dimensions:new Map},o=new Map,s=new Map,i={dimensions:0,instances:0,labels:0},a=/^\.\.\.\s+(\d+)\s+(values?|instances?|dimensions?)\s+more$/i;Object.entries(t).forEach((e=>{let[t,n]=e;const l=n.title||t;n.dimensions&&n.dimensions.forEach((e=>{const n=e.match(a);n?i.dimensions+=parseInt(n[1],10):(r.dimensions.has(e)||r.dimensions.set(e,[]),r.dimensions.get(e).push({title:l,contextId:t}))})),n.instances&&n.instances.forEach((e=>{const n=e.match(a);if(n)return void(i.instances+=parseInt(n[1],10));const r=e.split("."),s=r[r.length-1];o.has(s)||o.set(s,{contextIds:[],contextToInstance:{},contexts:[]});const c=o.get(s);c.contextIds.push(t),c.contextToInstance[t]=e,c.contexts.push({title:l,contextId:t})})),n.labels&&Object.entries(n.labels).forEach((e=>{let[n,r]=e;if(Array.isArray(r)){s.has(n)||s.set(n,new Map);const e=s.get(n);r.forEach((n=>{const r=n.match(a);r?i.labels+=parseInt(r[1],10):(e.has(n)||e.set(n,[]),e.get(n).push({title:l,contextId:t}))}))}}))})),Object.entries(r).forEach((e=>{let[t,r]=e;(r.size>0||i[t]>0)&&(n[t]=[],r.forEach(((e,r)=>{const o=e.map((e=>e.contextId)),s=e.map((e=>e.title));let i;i=1===e.length?e[0].title:2===e.length?`${e[0].title}, ${e[1].title}`:`${e[0].title}, ${e[1].title} and ${e.length-2} more`,n[t].push({value:r,label:r,sublabel:i,contextIds:o,allContextTitles:s})})),n[t].sort(((e,t)=>e.label.localeCompare(t.label))),i[t]>0&&n[t].push({value:null,label:`+${i[t]} more`,sublabel:"Keep typing to narrow results",contextIds:[],isTruncationNotice:!0}))})),(o.size>0||i.instances>0)&&(n.instances=[],o.forEach(((e,t)=>{const{contextIds:r,contextToInstance:o,contexts:s}=e,i=s.map((e=>e.title));let a;a=1===s.length?s[0].title:2===s.length?`${s[0].title}, ${s[1].title}`:`${s[0].title}, ${s[1].title} and ${s.length-2} more`,n.instances.push({value:t,label:t,sublabel:a,contextIds:r,contextToInstance:o,allContextTitles:i})})),n.instances.sort(((e,t)=>e.label.localeCompare(t.label))),i.instances>0&&n.instances.push({value:null,label:`+${i.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)),s=e.map((e=>e.title));let i;i=1===e.length?e[0].title:2===e.length?`${e[0].title}, ${e[1].title}`:`${e[0].title}, ${e[1].title} and ${e.length-2} more`,r.push({value:`${t}:${n}`,label:n,sublabel:i,contextIds:o,allContextTitles:s})})),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)),i.labels>0&&n.labels.push({labelKey:null,items:[{value:null,label:`+${i.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)}))}),[s,u,h,x,g]);const m=(0,i.useCallback)(((n,r)=>{t({matchType:n,value:r.value,label:r.label,sublabel:r.sublabel,contextIds:r.contextIds,contextToInstance:r.contextToInstance,menuId:e?.id})}),[t,e?.id]);return{searchValue:r,setSearchValue:o,debouncedSearchValue:s,searchResults:a,isLoading:c,onSelectResult:m}},w=(0,i.memo)((e=>{let{children:t,...n}=e;const r=(0,i.useRef)(null);return(0,i.useEffect)((()=>{const e=r.current;if(!e)return;const t=()=>{const t=e.scrollLeft>0,n=e.scrollLeft+e.clientWidth<e.scrollWidth,r=[];t&&r.push("inset 10px 0 10px -10px rgba(0, 0, 0, 0.2)"),n&&r.push("inset -10px 0 10px -10px rgba(0, 0, 0, 0.2)"),e.style.boxShadow=r.join(", ")};return t(),e.addEventListener("scroll",t),()=>{e.removeEventListener("scroll",t)}}),[]),(0,g.jsx)(o.Flex,{ref:r,overflow:"auto",...n,children:t})}));var I=n(45087);n(17395);const A=(0,r.default)(o.Flex).withConfig({displayName:"contextSearch__ModalContainer",componentId:"sc-93w1u0-0"})(["background:",";backdrop-filter:blur(8px);"],(0,o.getRgbColor)("modalBackground",.6)),k=(0,i.memo)((e=>{let{parentIds:t,allFilters:n,onGoToParent:r}=e;const s=(0,i.useMemo)((()=>t?.find((e=>n[e]&&Object.keys(n[e]).length>0))||null),[t,n]),a=(0,h.b)(s);if(!s||!a)return null;const l=a.shortName||a.name||"parent section";return(0,g.jsx)(I.A,{content:`Go to ${l}`,align:"bottom",children:(0,g.jsx)(o.IconButton,{icon:"arrowUp",flavour:"borderless",onClick:()=>r(s),padding:[0],small:!0})})})),S=(0,i.memo)((e=>{let{menuId:t,parentIds:n,activeMenuId:r,onMenuChange:s}=e;const a=((e,t)=>{const n=(0,h.b)(e),r=(0,h.yy)(),o=(t||[]).map((e=>r[e])).filter(Boolean);return(0,i.useMemo)((()=>{const r=[];return o.forEach(((e,n)=>{r.push({label:e.shortName||e.name,value:t[t.length-1-n]})})),n&&r.push({label:n.shortName||n.name,value:e}),r}),[e,t,n,o])})(t,n);return(0,g.jsx)(o.Menu,{value:r,items:a,onChange:s,dropProps:{align:{top:"bottom",left:"left"}},dropdownProps:{width:"200px"},caret:!0,padding:[0],small:!0})})),T=(0,i.memo)((e=>{let{menuId:t,onClose:n,flavour:r,parentIds:s,onGoToParent:a}=e;const[l,d]=(0,i.useState)(t),u=(0,h.b)(l),p=(0,x.X)(),{filters:f,addFilter:j,removeFilter:b,clearFilters:v}=(0,x.w)(u?.contexts,l),{searchValue:T,setSearchValue:F,debouncedSearchValue:N,searchResults:M,isLoading:L,onSelectResult:$}=C(u,j,r),D=(e,t)=>f.some((n=>n.matchType===e&&n.value===t)),R=(e,t)=>{if(D(e,t.value)){const n=f.find((n=>n.matchType===e&&n.value===t.value));b(n)}else $(e,t)};return(0,g.jsx)(o.Layer,{onClickOutside:n,onEsc:n,children:(0,g.jsxs)(A,{column:!0,border:!0,round:1,width:{base:"600px",max:"100%"},overflow:"hidden","data-testid":"context-search-modal",children:[(0,g.jsxs)(o.Flex,{padding:[2,4],border:{side:"bottom"},alignItems:"center",justifyContent:"between",children:[(0,g.jsxs)(o.Flex,{alignItems:"center",gap:2,children:[(0,g.jsx)(o.Text,{color:"textLite",children:"Filter chart in"}),s?.length>0?(0,g.jsx)(S,{menuId:t,parentIds:s,activeMenuId:l,onMenuChange:d}):(0,g.jsx)(o.TextSmall,{children:u?.name||"this section"})]}),(0,g.jsx)(o.Flex,{alignItems:"center",gap:2,children:a&&(0,g.jsx)(k,{parentIds:s,allFilters:p,onGoToParent:a})})]}),(0,g.jsx)(o.Flex,{padding:[3],column:!0,border:{side:"bottom"},children:(0,g.jsx)(o.TextInput,{value:T,onChange:e=>F(e.target.value),placeholder:"Search dimensions, labels...","data-testid":"context-search-input",autoFocus:!0,iconLeft:(0,g.jsx)(o.Icon,{name:L?"loading":"search",color:"textLite",size:"small"}),width:"100%"})}),(0,g.jsxs)(o.Flex,{column:!0,overflow:"auto",style:{opacity:L?.5:1,filter:L?"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===M?"152px":M&&Object.keys(M).length>0?"400px":"199px",children:[null===M&&(0,g.jsx)(o.Flex,{column:!0,gap:3,padding:[3],flex:!0,children:(0,g.jsxs)(o.Flex,{column:!0,gap:2,children:[(0,g.jsxs)(o.Flex,{alignItems:"center",gap:2,children:[(0,g.jsx)(o.Icon,{name:"search",size:"small",color:"textLite"}),(0,g.jsx)(o.TextSmall,{color:"textLite",children:"Search charts based on dimensions, instances and labels"})]}),(0,g.jsxs)(o.Flex,{alignItems:"center",gap:2,children:[(0,g.jsx)(o.Icon,{name:"filter",size:"small",color:"textLite"}),(0,g.jsxs)(o.TextSmall,{color:"textLite",children:["Results are scoped to ",u?.name||"this section"," charts"]})]})]})}),M&&Object.keys(M).length>0&&(0,g.jsx)(o.Flex,{column:!0,padding:[0,0,8],flex:!0,children:y.map((e=>{const t=M[e];return t&&0!==t.length?(0,g.jsxs)(o.Flex,{column:!0,children:[(0,g.jsx)(o.Flex,{padding:[2,4],alignItems:"center",position:"sticky",top:0,background:"modalBackground",zIndex:2,children:(0,g.jsx)(o.TextSmall,{strong:!0,color:"textLite",children:e.charAt(0).toUpperCase()+e.slice(1)})}),"labels"===e?(0,g.jsx)(o.Flex,{column:!0,children:t.map(((t,n)=>(0,g.jsxs)(o.Flex,{column:!0,border:{side:"bottom"},children:[t.labelKey&&(0,g.jsx)(o.Flex,{padding:[1,6],alignItems:"center",position:"sticky",top:"30px",background:"modalBackground",zIndex:1,children:(0,g.jsx)(o.TextMicro,{strong:!0,color:"textLite",children:t.labelKey})}),t.items.map(((t,n)=>{const r=!t.isTruncationNotice&&D(e,t.value);return(0,g.jsx)(o.Flex,{padding:[2,6],cursor:t.isTruncationNotice?"default":"pointer",background:r?"neutralHighlight":void 0,_hover:t.isTruncationNotice?{}:{background:"highlight"},onClick:t.isTruncationNotice?void 0:()=>R(e,t),opacity:t.isTruncationNotice?.7:1,children:(0,g.jsxs)(o.Flex,{gap:1,alignItems:"center",overflow:"hidden",flex:!0,children:[(0,g.jsxs)(o.Flex,{gap:.5,column:!0,overflow:"hidden",flex:!0,children:[(0,g.jsx)(o.TextSmall,{truncate:!0,children:t.label}),t.sublabel&&(0,g.jsx)(g.Fragment,{children:t.allContextTitles&&t.allContextTitles.length>2?(0,g.jsx)(I.A,{content:(0,g.jsxs)(c.A,{column:!0,gap:1,children:[(0,g.jsxs)(o.TextSmall,{strong:!0,children:["Found in ",t.allContextTitles.length," ","contexts:"]}),(0,g.jsx)(o.Flex,{flexWrap:!0,children:t.allContextTitles.map(((e,n)=>(0,g.jsxs)(o.TextSmall,{children:[e,n<t.allContextTitles.length-1?", ":""]},n)))})]}),plain:!0,children:(0,g.jsx)(o.TextMicro,{color:"textLite",children:t.sublabel})}):(0,g.jsx)(o.TextMicro,{color:"textLite",children:t.sublabel})})]}),r&&(0,g.jsx)(o.Icon,{name:"check",size:"small",color:"primary"})]})},`${e}-${t.value}-${n}`)}))]},n)))}):(0,g.jsx)(o.Flex,{column:!0,children:t.map(((t,n)=>{const r=!t.isTruncationNotice&&D(e,t.value);return(0,g.jsx)(o.Flex,{padding:[2,4],cursor:t.isTruncationNotice?"default":"pointer",background:r?"neutralHighlight":void 0,_hover:t.isTruncationNotice?{}:{background:"highlight"},onClick:t.isTruncationNotice?void 0:()=>R(e,t),opacity:t.isTruncationNotice?.7:1,children:(0,g.jsxs)(o.Flex,{gap:1,alignItems:"center",overflow:"hidden",flex:!0,children:[(0,g.jsxs)(o.Flex,{gap:.5,column:!0,overflow:"hidden",flex:!0,children:[(0,g.jsx)(o.TextSmall,{truncate:!0,children:t.label}),t.sublabel&&(0,g.jsx)(g.Fragment,{children:t.allContextTitles&&t.allContextTitles.length>2?(0,g.jsx)(I.A,{content:(0,g.jsxs)(c.A,{column:!0,gap:1,children:[(0,g.jsxs)(o.TextSmall,{strong:!0,children:["Found in ",t.allContextTitles.length," contexts:"]}),(0,g.jsx)(o.Flex,{flexWrap:!0,children:t.allContextTitles.map(((e,n)=>(0,g.jsxs)(o.TextSmall,{children:[e,n<t.allContextTitles.length-1?", ":""]},n)))})]}),plain:!0,children:(0,g.jsx)(o.TextMicro,{color:"textLite",truncate:!0,children:t.sublabel})}):(0,g.jsx)(o.TextMicro,{color:"textLite",truncate:!0,children:t.sublabel})})]}),r&&(0,g.jsx)(o.Icon,{name:"check",size:"small",color:"primary"})]})},`${e}-${t.value}-${n}`)}))})]},e):null}))}),!L&&""!==N.trim()&&null!==M&&0===Object.keys(M).length&&(0,g.jsxs)(o.Flex,{padding:[6,3],justifyContent:"center",alignItems:"center",column:!0,gap:2,flex:!0,children:[(0,g.jsx)(o.Icon,{name:"search",size:"medium",color:"textLite"}),(0,g.jsx)(o.TextSmall,{color:"textLite",children:"No results found"}),(0,g.jsx)(o.TextMicro,{color:"textLite",children:"Try different search terms"})]}),f.length>0&&(0,g.jsxs)(o.Flex,{column:!0,gap:2,padding:[3,3,0],border:{side:"top"},position:"sticky",bottom:0,background:"modalBackground",zIndex:99,children:[(0,g.jsxs)(o.Flex,{justifyContent:"between",alignItems:"center",children:[(0,g.jsxs)(o.TextMicro,{strong:!0,children:["Active Filters (",f.length,")"]}),f.length>0&&(0,g.jsx)(o.Button,{label:"Clear All",flavour:"borderless",onClick:v,"data-testid":"context-search-clear-all",padding:[0],small:!0})]}),(0,g.jsx)(w,{gap:2,padding:[0,0,3],children:f.map(((e,t)=>(0,g.jsx)(m,{matchType:e.matchType,value:e.label,sublabel:e.sublabel,onRemove:()=>b(e)},`${e.matchType}-${e.value}-${t}`)))})]})]})]})})}));var F=n(33962),N=n(49163),M=n(63928),L=n(95565),$=n(1444);const D=(0,d.A)((0,l.A)(o.Flex)),R=(0,u.A)((0,l.A)(o.IconButton)),B=(0,i.memo)((e=>{let{menuId:t,menuName:n,contexts:r}=e;const{filters:s}=(0,x.w)(r,t);return s&&0!==s.length?(0,g.jsxs)(o.Flex,{column:!0,children:[(0,g.jsxs)(o.TextMicro,{color:"textLite",children:["Filters in ",n," (",s.length,")"]}),(0,g.jsx)(o.Flex,{column:!0,children:s.map((e=>(0,g.jsxs)(o.TextSmall,{children:[e.matchType,": ",(0,g.jsx)(o.Text,{strong:!0,children:e.label})]},`${e.matchType}-${e.label}`)))})]}):null})),P=(0,i.memo)((e=>{let{parentIds:t}=e;return t&&0!==t.length?(0,g.jsx)(o.Flex,{column:!0,gap:1,children:t.map((e=>{const t=(0,h.b)(e);return t?(0,g.jsx)(B,{menuId:e,menuName:t.shortName||t.name||e,contexts:t.contexts},e):null}))}):null})),O=(0,i.memo)((e=>{let{menuId:t,menuName:n,flavour:r,parentIds:s}=e;const l=(0,h.b)(t),d=(0,x.X)(),u=(0,F.Ud)(),[m,,p,f]=(0,a.A)(),j=new Set;d[t]&&Object.values(d[t]).forEach((e=>{Array.isArray(e)&&e.forEach((e=>{j.add(`${e.matchType}-${e.value}`)}))}));const b=j.size,v=new Set;s&&s.forEach((e=>{const t=d[e];t&&Object.values(t).forEach((e=>{Array.isArray(e)&&e.forEach((e=>{v.add(`${e.matchType}-${e.value}`)}))}))}));const y=v.size,C=b>0,w=y>0,I=C||w,A=I?{side:"all",color:C?"primary":"border",width:"1px"}:void 0,k=(0,i.useCallback)((e=>{u(e),f()}),[u,f]),S=(0,i.useMemo)((()=>C||w?(0,g.jsxs)(c.A,{column:!0,gap:2,children:[(0,g.jsx)(B,{menuId:t,menuName:n,contexts:l?.contexts}),(0,g.jsx)(P,{parentIds:s})]}):`Search in ${n}`),[C,w,t,n,l?.contexts,s]);return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(D,{position:"relative",tooltip:S,payload:{menuId:t},children:(0,g.jsx)(o.Flex,{alignItems:"center",gap:.5,children:I?(0,g.jsxs)(o.Flex,{onClick:p,cursor:"pointer",border:A,round:!0,alignItems:"center",padding:[0,.5],children:[(0,g.jsx)(o.IconButton,{icon:"filterList",flavour:"borderless",padding:[0],"data-testid":"context-search-button","data-active":C,"data-indeterminate":w,height:"16px",width:"16px"}),y>0&&(0,g.jsx)(o.TextMicro,{color:"textLite",strong:!0,padding:[0,1],children:y}),b>0&&(0,g.jsx)(o.TextMicro,{color:"primary",strong:!0,padding:[0,1],children:b})]}):(0,g.jsx)(o.Flex,{opacity:0,_hover:{opacity:1},transition:"opacity 0.2s ease",children:(0,g.jsx)(o.IconButton,{icon:"filterList",onClick:p,flavour:"borderless",padding:[0],"data-testid":"context-search-button","data-active":C,"data-indeterminate":w,height:"16px",width:"16px"})})})}),m&&(0,g.jsx)(T,{menuId:t,onClose:f,flavour:r,parentIds:s,onGoToParent:k})]})})),V={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,g.jsxs)(o.Flex,{column:!0,gap:1,children:[(0,g.jsx)(o.Text,{children:"Favourites can be saved only on a paid plan."}),(0,g.jsx)(L.A,{children:(0,g.jsx)(o.Text,{color:"primary",children:"Upgrade for no limitations!"})})]}),default:null},E=(0,i.memo)((e=>{let{menuId:t,menuName:n,flavour:r}=e;const[o,,s,l]=(0,a.A)(),c=(0,N._)({params:{type:["favourites"],path:[`/${r}`],entity:t}}),d=c.find((e=>{let{entity:n}=e;return n===t}))?.id,u=!!d,h=(0,M.yK)({onResolve:l}),x=(0,M.z2)(d,{onResolve:l}),{disabled:m,reason:p}=(0,$.A)(),f=(0,i.useCallback)((()=>{m||(s(),u?x():h({type:"favourites",entity:t,path:`/${r}`,value:{menuId:t,sortOrder:Date.now()}}))}),[m,u,x,h,t,r,s]),j=(0,i.useMemo)((()=>({tooltip:m&&p?V[p]||V.default:u?`Remove ${n} from your favourites`:`Add ${n} to your favourites`,disabled:o||m,..."FreePlan"===p?{tooltipProps:{align:"bottom",activateOn:"hover",isBasic:!0,allowHoverOnTooltip:!0}}:{}})),[u,o,n,m,p]);return(0,g.jsx)(R,{icon:u?"heart":"heart_hollow",onClick:f,disabled:o||m,flavour:"borderless",padding:[0],"data-testid":"toggle-favourite-button","data-active":u,payload:{menuId:t},height:"12px",width:"12px",...j})})),_=(0,r.default)(o.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: ${(0,o.getColor)(e.hasCharts?"textNoFocus":["transparent","full"])(e)};\n fill: ${(0,o.getColor)(e.hasCharts?"textNoFocus":["transparent","full"])(e)};\n\n svg,\n path {\n fill: ${(0,o.getColor)(e.hasCharts?"textNoFocus":["transparent","full"])(e)};\n }\n `),(0,o.getColor)("textLite"),(0,o.getColor)("textLite"),(0,o.getColor)("textLite"),(0,o.getColor)("primary"),(0,o.getColor)("primary"),(0,o.getColor)("primary"),(0,o.getColor)("text"),(0,o.getColor)("text"),(0,o.getColor)("text"),(0,o.getColor)("accent"),(0,o.getColor)("accent"),(0,o.getColor)("accent")),H=e=>{let{children:t,menuId:n,menuName:r,flavour:i,parentIds:a,hasCharts:l,hasFilters:c=s.af}=e;return(0,g.jsxs)(_,{alignItems:"center",justifyContent:"between",hasCharts:l,gap:1,children:[t,(0,g.jsxs)(o.Flex,{alignItems:"center",gap:1,children:[c&&(0,g.jsx)(O,{menuId:n,menuName:r,flavour:i,parentIds:a}),(0,g.jsx)(E,{menuId:n,menuName:r,flavour:i})]})]})},z=e=>t=>t.enableFavourites&&t.contexts?.length?(0,g.jsx)(H,{menuId:t._id,menuName:t.name,flavour:t.flavour,parentIds:t.parentIds,hasCharts:!!t.selfChartIds?.length,children:(0,g.jsx)(e,{...t})}):(0,g.jsx)(e,{...t})},4703:(e,t,n)=>{n.d(t,{A:()=>u});var r=n(33185),o=n(80689),s=n(74891),i=n(74848);const a=(0,s.A)(o.IconButton),l=(0,r.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,r.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,r.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 ${(0,o.getColor)("borderSecondary")};\n `})),u=e=>{let{task:t,completed:n,onClick:r,onSkip:s,children:a}=e;return(0,i.jsxs)(c,{completed:n,onClick:r,children:[(0,i.jsx)(d,{completed:n,children:n&&(0,i.jsx)(o.Icon,{name:"check",color:"primary",width:"32px",height:"32px"})}),(0,i.jsxs)(o.Flex,{column:!0,gap:1,flex:!0,children:[(0,i.jsx)(o.Text,{strong:!0,color:n?"textLite":void 0,children:t.title}),(0,i.jsx)(o.TextSmall,{color:n?"textNoFocus":"textLite",children:a||t.description})]}),!n&&s&&(0,i.jsx)(l,{onClick:e=>{e.stopPropagation(),s?.()}})]})}},5020:(e,t,n)=>{n.d(t,{Oq:()=>o,Q:()=>s,bP:()=>i,ml:()=>r});const r=(e,t)=>e.on("sizeChanged",((e,n,r)=>{if(e.getParent()!==t)return;const o=e.getAttribute("id"),s=t.getAttribute("host"),i=`chart_height.${s}/${o}`;localStorage.setItem(i,n);const a=`chart_width.${s}/${o}`;localStorage.setItem(a,r)})),o=(e,t,n)=>{const r=`chart_height.${e.getAttribute("host")}/${t}`,o=localStorage.getItem(r);return o?/px/.test(o)?parseInt(o.replace("px",""),10):parseInt(o,10):n},s=e=>{e?.id&&localStorage.setItem(`chart_layout/${e.id}`,JSON.stringify(e))},i=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=localStorage.getItem(`chart_layout/${e}`);try{let e=JSON.parse(r);return e?(e=(e=>{let{i:t,id:n=t,x:r,left:o=r,y:s,top:i=s,w:a,width:l=a,h:c,height:d=c,expanded:u=!1}=e;return{id:n,width:l,height:d,left:o,top:i,expanded:u}})(e),{...n,...t,...e}):{...n,...t}}catch{return{...n,...t}}}},9962:(e,t,n)=>{n.d(t,{I:()=>r});const r=e=>{let{error:t,testPrefix:n,onClick:r,flavour:o,value:s}=e;return{"data-testid":n?`${n}-${o}`:o,flavour:o,...r&&{onClick:r},text:t?"-":`${s}`}}},14963:(e,t,n)=>{n.d(t,{A:()=>a});var r=n(96540),o=n(80689),s=n(50239),i=n(74848);const a=e=>{let{children:t,onClick:n,...a}=e;const l=(0,s.UH)(),c=(0,r.useCallback)((e=>{const{hash:t=""}=e.target;t.startsWith("#menu")&&(e.preventDefault(),l.goToLink(t.substr(1))),n&&n(e)}),[l]);return"string"===typeof t?(0,i.jsx)(o.TextSmall,{color:"textDescription",dangerouslySetInnerHTML:{__html:t},onClick:c,...a}):t||null}},17115:(e,t,n)=>{n.d(t,{Ay:()=>c,Ex:()=>l});var r=n(96540),o=n(24285),s=n(19186),i=n(31246);const a=()=>{const e=(0,o.xd)("onboardingFormData"),t=(0,s.XA)("memberCount")||0,n=(0,s.XA)("nodeCount")||0;return(0,r.useMemo)((()=>{const r=e?.usageType;return"Personal (homelab)"===r?i.JF.homelabber:"Work"===r?t>2||n>=50?i.JF.largeOrg:i.JF.smallOrg:i.JF.homelabber}),[e?.usageType,t,n])},l=()=>{const e=a(),t=(0,s.XA)("memberCount")||0;return e===i.JF.largeOrg&&t>10},c=a},17178:(e,t,n)=>{n.d(t,{A:()=>p});var r=n(96540),o=n(88934),s=n(19186),i=n(24609),a=n(93335),l=n(41716),c=n(93883),d=n(93912),u=n(74848);const h=()=>{const e=(0,l.s)("error"),t=(0,l.s)("updatedAt");return(0,u.jsx)(d.A,{title:"Alerts & Notifications",description:"View raised and configured alerts across your infrastructure.",children:(0,u.jsx)(c.A,{error:e,updatedAt:t})})};var x=n(99728),g=n(39175),m=n(77234);const p=()=>{const e=(0,s.r9)(),t=(0,o.RQ)("/spaces/:spaceSlug/rooms/:roomSlug/insights/report-preview/:reportId"),n=(0,x.JT)("dashboard:ReadAll"),l=(e=>{let{path:t,matchReportPreview:n}=e;return(0,r.useMemo)((()=>({[m.x.home]:{id:"home",title:"Home",icon:"room_home",path:`${t}/home`,exact:!0,dataGa:"view-picker::click-view-home::global-view",testId:"viewPicker-home",tooltip:{title:"Summary",description:"An overview of your infrastructure."}},[m.x.overview]:{id:"overview",title:"Metrics",icon:"room_overview",path:`${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."}},[m.x.nodes]:{id:"nodes",title:"Nodes",icon:"nodes_hollow",path:`${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&&{[m.x.k8s]:{id:"k8s",title:"K8s",icon:"serviceKubernetes",path:`${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."}}},[m.x.top]:{id:"top",title:"Top",icon:"top",path:`${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."}},[m.x.logs]:{id:"logs",title:"Logs",icon:"logs",path:`${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."}},[m.x.dashboards]:{id:"dashboards",title:"Dashboards",icon:"dashboard",path:`${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}},[m.x.dashboard]:{id:"dashboard",title:"Dashboard",icon:"dashboard",path:`${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:g.LA}},[m.x.alerts]:{id:"alerts",title:"Alerts",icon:"alarm",path:`${t}/alerts`,exact:!0,dataGa:"view-picker::click-view-alerts::global-view",testId:"viewPicker-alerts",tooltip:(0,u.jsx)(h,{}),children:(0,u.jsx)(a.W,{})},[m.x.ar]:{id:"ar",title:"Anomalies",icon:"anomaliesLens",path:`${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."}},[m.x.events]:{id:"events",title:"Events",icon:"feed",path:`${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."}},[m.x.insights]:{id:"insights",title:"AI Insights",icon:"ai",path:`${t}/insights`,exact:!n,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,n])})({path:e,matchReportPreview:t}),c=(0,i.dg)(),d=(0,s.GJ)();var p,f;return[(0,r.useMemo)((()=>[!c&&!d&&l.home,l.nodes,l.overview,l.top,l.logs,!c&&!window.envSettings.onprem&&l.k8s,!c&&n&&l.dashboards,c&&n&&l.dashboard,l.alerts,l.events,l.ar,l.insights].filter(Boolean)),[e,t,c]),(p=e,f=!c,(0,r.useMemo)((()=>({[`${p}/overview`]:!0,[`${p}/home`]:!0,[`${p}/nodes`]:!0,[`${p}/dashboards`]:!0,[`${p}/dashboard`]:!0,[`${p}/alerts`]:!0,[`${p}/anomalies`]:!0,[`${p}/top`]:!0,[`${p}/logs`]:!0,[`${p}/events`]:!0,[`${p}/insights`]:!0})),[p,f]))]}},27024:(e,t,n)=>{n.d(t,{A:()=>T});var r=n(96540),o=n(80689),s=n(31141),i=n(32788),a=n(29263),l=n(47410),c=n(16866),d=n(24609),u=n(19371),h=n(41579),x=n(19186),g=n(67294),m=n(5907),p=n(92726),f=n(62718),j=n(93536),b=n(38757),v=n(6304),y=n(50433),C=n(45706),w=n(28864),I=n(52795),A=n(74848);const k=(0,r.memo)((e=>{let{id:t,spaceId:n,roomId:s,chartId:i,name:a}=e;const[l,,c,h]=(0,v.A)(),{fullyLoaded:g,processing:f}=(0,p.fz)(t),j=(0,w.DH)(t,{onSuccess:()=>{(0,y.jE)(`Chart added to ${a}`),h()}}),b=l&&g,k=(0,d.ns)(n,"slug"),S=(0,x.wz)(s,"slug"),T=(0,m.nM)(t),F=(0,C.A)(l&&t,{spaceId:n,spaceSlug:k,roomId:s,roomSlug:S}),N=(0,u.eg)();(0,r.useEffect)((()=>{if(F||!b)return;const e=N.getNode({id:i}),t=(0,I.h)(e.getAttributes());T(t.contextScope,t,(()=>setTimeout(j,100)))}),[b,F]);const M=l&&(f||F);return(0,A.jsx)(o.Button,{icon:"plus",onClick:c,isLoading:M,disabled:M,alignSelf:"end"})})),S=e=>{let{spaceId:t,roomId:n,chartId:r}=e;return[{id:"name",accessorKey:"name",header:"Dashboards",cell:e=>{let{getValue:t}=e;return(0,A.jsxs)(o.Flex,{alignItems:"center",gap:3,children:[(0,A.jsx)(o.Icon,{name:"dashboards",size:"small",color:"text"}),(0,A.jsx)(o.Text,{children:t()})]})}},{id:"plusButton",accessorKey:"id",header:"",cell:e=>{let{getValue:o,row:s}=e;return(0,A.jsx)(k,{id:o(),spaceId:t,roomId:n,chartId:r,name:s.original.name})}}]},T=e=>{let{onClose:t}=e;(0,h.A)();const n=(0,x.ID)(),v=(0,x.XA)("name"),y=(0,d.vt)(),{params:C={},params:{chartId:w}}=(0,s.A)("addToDashboardModal"),I=(0,g.q)(),k=(0,p.Sf)(I),[T,F]=(0,r.useState)(""),[N,M]=(0,r.useState)(!1),L=T.length>0,$=(0,m.W6)(y,n,{onSuccess:t}),D=(0,u.eg)().getNode({id:w}),R=(0,r.useMemo)((()=>S({spaceId:y,roomId:n,chartId:w})),[y,n,w]),B=()=>{if(!D)return;const{aggregationMethod:e,selectedDimensions:t,groupBy:n,groupByLabel:r,groupingMethod:o,chartType:s,selectedLabels:i,nodesScope:a,selectedInstances:l,selectedNodes:c,contextScope:d}=D.getAttributes(),[u]=d;$(T,d,{...(0,j.L)(u),aggregationMethod:e,selectedDimensions:t,groupBy:n,groupByLabel:r,groupingMethod:o,chartType:s,selectedLabels:i,nodesScope:a,selectedInstances:l,selectedNodes:c})},P=(0,g.RQ)();return(0,A.jsxs)(i.GO,{onClose:t,children:[(0,A.jsx)(a.z,{onClose:t,title:"Add to Dashboard"}),(0,A.jsx)(l.U,{children:"Select Dashboard"}),(0,A.jsxs)(i.Yv,{gap:3,overflow:"hidden",height:"100%",children:[(0,A.jsxs)(o.H6,{children:["Add chart to one or more dashboards from the ",v]}),P?(0,A.jsx)(o.Table,{dataColumns:R,data:k}):(0,A.jsx)(f.UG,{rows:3}),(0,A.jsxs)(o.Flex,{column:!0,padding:[3,0],gap:1,children:[(0,A.jsxs)(o.H6,{children:["Create a new dashboard and add ",w," to it"]}),(0,A.jsx)(b.A,{value:T,label:"Name",onChange:e=>F(e.target.value),isValid:N,setIsValid:M,isDirty:L,instantFeedback:"all",onKeyDown:e=>e.keyCode===c.I7&&N&&B}),(0,A.jsx)(o.Button,{label:"Create & add",onClick:B,disabled:!D||!T})]})]})]})}},27496:(e,t,n)=>{n.d(t,{n:()=>i});var r=n(14963),o=n(4719),s=n(74848);const i=(0,o.aV)((e=>e.children?(0,s.jsx)(r.A,{as:"p",role:"document",...e}):null),(e=>{let{info:t}=e;return{children:t}}))},30863:(e,t,n)=>{n.d(t,{A:()=>D});n(98992),n(54520),n(81454);var r=n(96540),o=n(80689),s=n(73700),i=n(69457),a=n(51220),l=n(53749),c=n(48106),d=n(20871);n(72577);let u=null;n(25509),n(65223),n(60321),n(41927),n(11632),n(64377),n(66771),n(12516),n(68931),n(52514),n(35694),n(52774),n(49536),n(21926),n(94483),n(16215);var h=n(57530),x=n(43375);n(8872);var g=n(33185),m=n(98131),p=n(33962),f=n(4719),j=n(56876),b=n(549),v=n(74848);const y=(0,r.memo)((e=>{let{id:t,name:n,icon:s,isLast:i}=e;const{onMenuClick:a}=(0,j.A)(),l=(0,r.useCallback)((()=>{a({id:t})}),[t,a]),c=(0,r.useMemo)((()=>({alignItems:"center",gap:1,...i?{}:{cursor:"pointer",onClick:l}})),[i,l]);return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(o.Flex,{...c,children:[s?(0,v.jsx)(m.o,{icon:s,active:!0,containerProps:{width:"auto"}}):null,(0,v.jsx)(o.Text,{color:"primary",strong:!0,children:n})]}),i?null:(0,v.jsx)(o.Text,{color:"primary",strong:!0,children:">"})]})})),C=(0,r.memo)((e=>{let{menu:t}=e;const{id:n,shortName:s,name:i,icon:a,parentMenus:l}=t||{},c=(0,r.useMemo)((()=>[...l||[],{id:n,name:s||i,icon:a}]),[t]);return n?(0,v.jsx)(o.Flex,{alignItems:"center",gap:1,children:c.map(((e,t)=>(0,v.jsx)(y,{isLast:t===c.length-1,...e},e.id)))}):null})),w=(0,g.default)(o.Flex).attrs((e=>({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);"]),I=["nodes"],A=e=>{let{flavour:t,tools:n=[],hasFilters:s}=e;const i=(0,p.W2)(),a=(0,f.b)(i),l=(0,r.useContext)(g.ThemeContext);return!I.includes(t)&&a?(0,v.jsxs)(w,{background:(0,o.getRgbColor)("mainBackground",.8)({theme:l}),children:[(0,v.jsx)(C,{menu:a}),(0,v.jsx)(b.G,{menuId:i,menuName:a.shortName||a.name,hasFilters:s,flavour:t,parentIds:a.parentIds,hasCharts:!0,children:n.map((e=>{let{Component:t,...n}=e;return t?(0,v.jsx)(t,{...n},n.id):null}))})]}):null},k=(0,r.memo)(A),S="8px 2px",T="1px 2px",F={root:T,submenu:T,default:S},N=[{flavour:"root",id:"System-0"}],M=(0,r.memo)((e=>{let{getComponent:t,element:n,index:o,...s}=e;const i=(0,r.useMemo)((()=>n&&t(n)),[n?.id,o]),a=(0,r.useMemo)((()=>!!N.find((e=>{let{id:t,flavour:r}=e;return t===n.id&&r===n.flavour}))),[n]);return!i||a?null:(0,v.jsx)(i,{...n,index:o,...s,isVisible:!0},n.id)})),L=(0,r.memo)((e=>{let{flavour:t,elements:n,onScroll:i,dashboardOptions:l,getComponent:d,stickyBg:g="mainBackground",stickyRef:m,nextStickyRef:p,stickyIndexes:f,tmpStickyRef:j,containerWidth:b,headerProps:y={},ref:C}=e;const w=(e=>{const t=(0,r.useRef)(),n=(0,r.useRef)(),o=(0,r.useRef)(0),s=(0,r.useRef)(0);return(0,r.useCallback)((r=>{if(t.current!==e.length&&(s.current=0),n.current&&(s.current<5||t.current!==e.length)){s.current=s.current+1,t.current=e.length;const i=e.findIndex((e=>e.id===n.current.id));if(-1===i)return;const{start:a}=r.getMeasurements()[i];return r.scrollToOffset(a+o.current),clearTimeout(u),void(u=setTimeout((()=>s.current=5),200))}t.current=e.length;const i=r.scrollOffset;let a=0;const l=r.getMeasurements().find((e=>(a+=e.size,a>i)));l&&(n.current=e[l.index],o.current=i-l.start)}),[e])})(n),I=(0,r.useRef)(),[A,T]=(0,r.useState)(0),N=((e,t,n)=>{let{stickyRef:o,nextStickyRef:s,tmpStickyRef:i}=n;const a=(0,r.useRef)(),{active:l}=(0,x.fF)(),c=(0,r.useRef)();return c.current=l,(0,r.useCallback)((e=>{if(c.current&&c.current.data.current.isResizer)return a.current;if(!t)return a.current=(0,h.vp)(e),a.current;s.current=Number(Object.keys(t).find((t=>e.startIndex<t))),o.current=Number(Object.keys(t).reverse().find((t=>e.startIndex>=t))),s.current-e.startIndex===1&&(o.current=NaN);let n=(0,h.vp)(e);return null!==i.current&&(n=[...n,i.current]),isNaN(o.current)?a.current=[...new Set(n)].sort(((e,t)=>e-t)):a.current=[...new Set([o.current,...n])].sort(((e,t)=>e-t)),a.current}),[e,t])})(n,f,{stickyRef:m,nextStickyRef:p,tmpStickyRef:j}),L=(0,a.Te)({count:n.length,getScrollElement:()=>C.current,overscan:2,enableSmoothScroll:!1,estimateSize:e=>n[e].size,onChange:w,rangeExtractor:N,scrollPaddingStart:0});I.current=L,(0,c.A)(L,n);const $=(0,r.useCallback)((0,s.n)(100,(function(){i(...arguments),C.current&&T(C.current.scrollTop)})),[i]);return(0,v.jsxs)("div",{ref:C,style:{minHeight:"100%",width:"100%",overflow:"auto"},onScroll:$,children:[(0,v.jsx)(k,{flavour:t,...y}),(0,v.jsxs)("div",{style:{minHeight:`${L.getTotalSize()}px`,width:"100%",position:"relative"},children:[A>0&&!isNaN(m.current)&&(0,v.jsx)(o.Box,{sx:{top:0,left:0,width:"100%",padding:S,position:"sticky",zIndex:10,boxShadow:"2px 6px 6px -7px rgba(0, 0, 0, 0.4)"},background:g,children:(0,v.jsx)(M,{...l,element:n[m.current],index:m.current,getComponent:d})},m.current),L.getVirtualItems().map((e=>{const t=F[n[e.index].flavour]||F.default;return(0,v.jsx)(o.Box,{ref:L.measureElement,sx:{top:0,left:0,width:"100%",padding:t,position:"absolute",transform:`translateY(${e.start}px)`},"data-index":e.index,children:(0,v.jsx)(M,{...l,element:n[e.index],index:e.index,getComponent:d,containerWidth:b})},e.key)}))]})]})}),((e,t)=>e.elements.length===t.elements.length&&e.containerWidth===t.containerWidth)),$=e=>{let{flavour:t,onActiveMenuId:n,getComponent:o,dashboardOptions:s,initialChartName:a,checkVisibility:c,...u}=e;const h=(0,l.bD)(),x=(0,i.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:g,nextStickyRef:m,tmpStickyRef:p},f]=(e=>{const t=(0,i.Tg)(),n=(0,r.useRef)(null),o=(0,r.useMemo)((()=>e.reduce(((e,n,r)=>{let{id:o,sticky:s}=n;return t[o]&&"undefined"!==typeof s&&s&&(e[r]=!0),e}),{})),[e]),s=(0,r.useRef)(),a=(0,r.useRef)(),l=(0,r.useCallback)((e=>!!o[e]),[o]),c=(0,r.useCallback)((e=>s.current===e),[]);return[{stickyRef:s,nextStickyRef:a,isSticky:l,isActiveSticky:c,tmpStickyRef:n},o,t]})(x),j=(0,r.useRef)(),b=(0,r.useRef)(),y=(0,r.useMemo)((()=>(b.current&&b.current.cancel(),b.current=(0,d.A)({stickyRef:g}),()=>b.current(j.current,n))),[x.length,n]);return(0,r.useLayoutEffect)((()=>{x.length&&y()}),[x.length,a]),(0,v.jsx)(L,{flavour:t,elements:x,onScroll:y,dashboardOptions:s,getComponent:o,ref:j,stickyRef:g,nextStickyRef:m,stickyIndexes:f,tmpStickyRef:p,...u})},D=(0,r.memo)($)},31035:(e,t,n)=>{n.d(t,{$:()=>h,A:()=>x});var r=n(96540),o=n(30569),s=n(97940),i=n(24609),a=n(77389),l=n(63231),c=n(86706),d=n(82505),u=n(99728);const h=e=>`spaces.${e}.members`,x=e=>{const t=(0,i.vt)(),n=(0,o.yF)((0,r.useCallback)(((n,r,o)=>{let{results:s}=o;r((0,c.jX)({id:e,spaceId:t}),s)}),[e,t])),x=(0,u.JT)("user:ReadAll");(0,s.A)((()=>({key:h(e),autorun:!!e&&x,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:n,pollingOptions:{pollingInterval:315e3}})),[e,x])}},41579:(e,t,n)=>{n.d(t,{A:()=>u});n(98992),n(3949),n(81454);var r=n(96540),o=n(30569),s=n(92726),i=n(91539),a=n(24609),l=n(19186),c=n(258),d=n(67294);const u=()=>{const e=(0,a.vt)(),t=(0,l.ID)(),n=(0,o.yF)((0,r.useCallback)((function(e,n){let{data:{results:r}={}}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(n((0,d.z_)({id:t,key:"loaded"}),!0),r?.length){const e=r.sort(((e,t)=>e.name.localeCompare(t.name,void 0,{sensitivity:"accent",ignorePunctuation:!0})));e.forEach((e=>n((0,s._d)(e.id),e)));const o=e.map((e=>{let{id:t}=e;return t}));n((0,d.z_)({id:t,key:"ids"}),o)}}),[])),u=(0,r.useCallback)((()=>{(0,c.SJ)(e,t).then(n).catch((()=>{}))}),[e,t]);return(0,i.A)((()=>({polling:!1,enabled:!!e&&!!t,fetch:()=>(0,c.SJ)(e,t),onReceive:n})),[e,t]),u}},42318:(e,t,n)=>{n.d(t,{A:()=>a});var r=n(96540),o=n(61661),s=n(6988),i=n(32465);const a=()=>{const e=(0,o.AR)(),t=(0,i.A)(),[n,a]=(0,o.oE)(),l=(0,o.WB)(),c=(0,r.useMemo)((()=>(0,s.Cj)({searchTerm:n,integrations:e})),[n,e]),d=n?(0,s.M6)(c,t):l;return{integrations:(0,s.Fd)((0,s.xM)(d)),setSearchTerm:a}}},42964:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(74848);const o=e=>{let{isOnboarding:t,withOuties:n=!0}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.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,r.jsx)("g",{id:"node_inset_shadow",filter:"url(#inset_shadow)",children:(0,r.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,r.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"}),n&&(0,r.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,r.jsx)("defs",{children:(0,r.jsxs)("filter",{id:"inset_shadow",x:"56.0769",y:"42.6054",width:"207.846",height:"234.488",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[(0,r.jsx)("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),(0,r.jsx)("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),(0,r.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,r.jsx)("feOffset",{}),(0,r.jsx)("feGaussianBlur",{stdDeviation:"15"}),(0,r.jsx)("feComposite",{in2:"hardAlpha",operator:"arithmetic",k2:"-1",k3:"1"}),(0,r.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,r.jsx)("feBlend",{mode:"normal",in2:"shape",result:"effect1_innerShadow_759_2378"})]})})]}),(0,r.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,r.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"}),n&&(0,r.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"})]})]})}},44290:(e,t,n)=>{n.r(t),n.d(t,{SettingsContainer:()=>cd,default:()=>ud});var r=n(96540),o=n(39175),s=n(7960),i=n(19707),a=n(72060),l=n(55164),c=n(63474),d=n(62718),u=n(37617),h=n(1174),x=n(92318),g=n(99728),m=n(99094),p=(n(98992),n(54520),n(72577),n(81454),n(8872),n(25509),n(65223),n(60321),n(41927),n(11632),n(64377),n(66771),n(12516),n(68931),n(52514),n(35694),n(52774),n(49536),n(21926),n(94483),n(16215),n(30569)),f=n(88934),j=n(91539),b=n(24609),v=n(19186),y=n(18739),C=n(58247),w=n(16922),I=n(81685),A=n(22068),k=n(55048),S=n(63872),T=n(44245),F=n(77234),N=n(95428);const M=()=>document.querySelectorAll(`[data-testid='${N.Q}']`).length;var L=n(4204);const $=()=>{const e=(0,b.vt)(),t=(0,v.ID)(),{refresh:n}=(0,y.JN)(),o=(0,g.JT)("insights:ReadReport"),[s,i]=(0,A.A)(),[a,l]=(0,k.A)(),[c,d]=(0,S.A)(),{pathname:u}=(0,f.zy)(),h=u.includes(F.x.insights)&&!u.includes(m.p9),[,,,x]=(0,I.W5)(),[,N]=(0,T.m0)({tabId:F.x.insights}),[$]=(0,I.ly)(),D=(0,p.yF)((0,r.useCallback)(((r,o,u)=>{let{data:g}=u;const p=g?.reports||[],f=s(),j=a(),b=p.filter((e=>{let{status:t,isScheduled:n}=e;return!n&&!m.bs.includes(t)})).map((e=>{let{id:t}=e;return t})),v=f.filter((e=>b.includes(e))),y=v.filter((e=>!j.includes(e))),{COMPLETED:C,FAILED:I}=function(){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce(((t,n)=>{const r=e.find((e=>e.id===n));return r?{...t,[r.status]:[...t[r.status]||[],r.id]}:t}),{COMPLETED:[],FAILED:[]})}(y,p);if(y.length&&(C.length&&c({header:"New report",text:"A new report has been generated!"}),I.length&&(i(f.filter((e=>!I.includes(e)))),d({header:"Error",text:"Failed to generate report."})),l(Array.from(new Set([...j,...y.filter((e=>!I.includes(e)))]))),(C.length||I.length)&&(x(),n()),!h&&C.length+I.length>0)){const e=C.length>0?"success":"error";N({color:e})}o((0,w.Tj)({spaceId:e,roomId:t}),(e=>({...e,loaded:!0,reports:p.map((e=>({...e,isUnread:v.includes(e.id)})))})))}),[e,t,s,i,a,l,x,n,c,d,h,N])),R=(0,p.yF)((0,r.useCallback)(((n,r,o)=>{r((0,w.Tj)({spaceId:e,roomId:t}),(e=>({...e,loaded:!0,error:o?.response?.data||"Something went wrong"})))}),[e,t]));return(0,j.A)((()=>({enabled:!L.ei&&o&&!!e&&!!t,force:!0,polling:!!$.length,fetch:()=>(e=>{let{spaceId:t,roomId:n}=e;const r=(0,C.eF)({spaceId:t,roomId:n}),o=(0,C.XN)({spaceId:t,roomId:n});return Promise.all([r,o]).then((e=>{let[t,n]=e;const r=[...t?.data?.reports||[],...(n?.data||[]).map((e=>({...e,isScheduled:!0})))];return Promise.resolve({data:{reports:r}})}))})({spaceId:e,roomId:t}),onFail:R,onReceive:D,pollingOptions:{pollingInterval:h?5e3:15e3,checkPauseCondition:M}})),[e,t,h,o,$.length])};var D=n(83268),R=n(37479),B=n(60908),P=n(85660),O=n(88255),V=n(50271),E=n(24013),_=n(87083),H=n(49435),z=n(42790),K=n(34843),G=n(52035),W=n(84929);const q={filteredNodesIds:[],filteredNodesCount:0,nodesCount:0},U=(0,W.Iz)((()=>(0,G.eU)(q))),J=()=>{const e=(0,v.ID)();return(0,K.md)(U(e))},Z=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"nodesView";const t=(0,v.ID)();return(0,z.rW)("tocSearch",{key:t,extraKey:e,defaultValue:"",flavour:"val"})},X=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 n=t(e);return n>0?n:0}if(Array.isArray(e)){let n=0;for(const r of e){const e=X(r,t);e>n&&(n=e)}return n}if("object"===typeof e){let n=0;for(const r in e){const o=X(e[r],t);o>n&&(n=o)}return n}return 0},Y=["version","labels","hw","os","state","nodeStatus","health","replicationFactor","replication","technology"],Q=function(e,t){let{shouldHide:n=()=>!1,cacheKey:o,extraKey:s="nodesView"}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=(0,E.Gt)(e),a=function(){const e=Z(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"nodesView");return"string"!==typeof e?"":e.trim().toLowerCase()}(s),[l,c,d]=(0,r.useMemo)((()=>{let e=0,t=0;const r=i.filter((e=>!n(e)));t=r.length;const o=r.map((t=>{let n=0,r=0,o=0;if(a){const{name:e,...s}=t;r=t.name?(0,H.pe)(e,a):0,o=X(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Y.reduce(((t,n)=>(void 0!==e[n]&&null!==e[n]&&(t[n]=e[n]),t)),{})}(s),(e=>(0,H.pe)(String(e),a,{scoreFactor:.6,minScore:.6})));n=("Live"===t.nodeStatus?100:"Stale"===t.nodeStatus?50:0)+10*r+o}const s=!!a&&!(r>.3||o>.3);return s||(e+=1),{id:t.id,searchScore:n,included:!s}})).filter((e=>e.included));return[o,t,e]}),[a,i,o,n]),u=(()=>{const e=(0,v.ID)();return(0,K.Xr)(U(e))})(),h=(0,r.useMemo)((()=>l.map((e=>{let{id:t}=e;return t}))),[l]),x=(0,r.useMemo)((()=>l.reduce(((e,t)=>{let{id:n,searchScore:r}=t;return r>0&&(e[n]=r),e}),{})),[l]);return(0,r.useEffect)((()=>{u({filteredNodeIds:h,filteredNodesCount:d,nodesCount:c})}),[h,c,d,t]),[h,x,c]};var ee=n(23565),te=n(87733),ne=n(18907),re=n(46610),oe=n(80689),se=n(41514),ie=n(68531),ae=n(74848);const le=e=>{let{extraKey:t}=e;const[n,o]=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"nodesView";const t=(0,v.ID)();return(0,z.N9)("tocSearch",{key:t,extraKey:e,defaultValue:"",flavour:"val"})}(t),[s,i]=(0,r.useState)(n||"");return(0,ie.A)((()=>{o(s),(0,se.H)("toc-search","search-automatic-trigger","nodes-view",s)}),300,[s]),(0,r.useEffect)((()=>{n!==s&&i(n)}),[n]),(0,ae.jsx)(oe.TextInput,{iconLeft:(0,ae.jsx)(oe.Icon,{name:"search",color:s?"textFocus":"textLite",width:"14px",height:"14px"}),iconRight:!!s&&(0,ae.jsx)(oe.IconButton,{icon:"x",iconColor:s?"textFocus":"textLite",width:"14px",height:"14px",onClick:()=>{i(""),(0,se.H)("toc-search","clear-search-button","nodes-view")},padding:[0],neutral:!0,"data-testid":"filterNodesInput-clearButton"}),value:s,onChange:e=>i(e.target.value),size:"small",placeholder:"Search nodes",name:"Search nodes","data-testid":"filterNodesInput",containerStyles:{width:"100%"}})};var ce=n(73700);const de=(0,ce.s)(300,((e,t)=>(0,se.H)("toc-search","search-results","nodes-view",e,`${t} -- nodes`))),ue=()=>{const e=Z(),{filteredNodesCount:t,nodesCount:n}=J();return(0,r.useEffect)((()=>{e&&de(e,t)}),[e,t]),(0,ae.jsx)(ae.Fragment,{children:(0,ae.jsxs)(oe.TextMicro,{alignSelf:"end",color:"textLite",margin:[1,0,0],"data-testid":"numberOfNodesIndication",children:["Showing"," ",(0,ae.jsx)(oe.TextMicro,{strong:!0,color:"textDescription","data-testid":"numberOfNodesIndication-filteredNodesCount",children:t})," ","of total"," ",(0,ae.jsx)(oe.TextMicro,{strong:!0,color:"textDescription","data-testid":"numberOfNodesIndication-nodesCount",children:n})," ","nodes"]})})},he=()=>{const{filteredNodesCount:e}=J();return e?null:(0,ae.jsxs)(oe.Flex,{width:"100%",gap:1,margin:[4,0,0],padding:[2],alignItems:"center","data-testid":"noResultsWereFound",children:[(0,ae.jsx)(oe.Icon,{name:"information",color:"textDescription"}),(0,ae.jsx)(oe.TextMicro,{strong:!0,color:"textDescription",children:"No results were found"})]})},xe=e=>{let{extraKey:t}=e;return(0,ae.jsxs)(oe.Flex,{column:!0,alignItems:"center",children:[(0,ae.jsx)(le,{extraKey:t}),(0,ae.jsx)(ue,{}),(0,ae.jsx)(he,{})]})};var ge=n(79748);const me=()=>(0,ae.jsxs)(oe.Flex,{padding:[6],round:1,width:"600px",background:"modalInfoBackground",children:[(0,ae.jsx)(oe.Box,{margin:[0,4,0,0],children:(0,ae.jsx)(oe.Box,{as:oe.Icon,width:10,height:10,name:"nodes_update"})}),(0,ae.jsxs)(oe.Flex,{column:!0,gap:2,children:[(0,ae.jsx)(oe.Text,{strong:!0,children:"Couldn't find the node you were looking for? "}),(0,ae.jsxs)(oe.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,ae.jsx)(ge.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."]})]})]}),pe=e=>{let{children:t}=e;return(0,ae.jsxs)(oe.Flex,{column:!0,justifyContent:"center",alignItems:"center",alignSelf:"center",gap:4,children:[(0,ae.jsxs)(oe.Flex,{column:!0,justifyContent:"center",alignItems:"center",width:"300px",margin:[0,0,6],children:[(0,ae.jsx)(oe.H3,{margin:[0,0,4],children:"No nodes to display"}),(0,ae.jsx)(oe.Text,{color:"textDescription",textAlign:"center",children:"Double-check your search or filters and dates and try again with different conditions."})]}),t,(0,ae.jsx)(me,{})]})};var fe=n(50694),je=n(41061),be=n(6304),ve=n(63589),ye=n(89590),Ce=n(51571),we=n(32788),Ie=n(29263),Ae=n(47410),ke=n(32052),Se=n(22871),Te=n(25291),Fe=n(53749);const Ne=e=>{let{link:t,children:n}=e;return(0,ae.jsxs)(oe.Flex,{as:"a",target:"_blank",href:t,gap:1,alignItems:"end",children:[(0,ae.jsx)(oe.TextNano,{textDecoration:"undeline",children:n}),(0,ae.jsx)(oe.Icon,{color:"text",name:"question",width:"16px",height:"16px"})]})},Me=e=>{let{title:t,help:n,link:r,disclaimer:o,children:s,...i}=e;return(0,ae.jsxs)(oe.Flex,{gap:1,column:!0,...i,children:[(0,ae.jsxs)(oe.Flex,{justifyContent:"between",alignItems:"baseline",children:[(0,ae.jsx)(oe.Text,{as:"label",margin:[0],children:t}),n&&(0,ae.jsx)(Ne,{link:r,children:n})]}),s,o&&(0,ae.jsx)(oe.TextSmall,{children:o})]})};var Le=n(91130),$e=n(16866);const De=e=>{let{dimensions:t}=e;return{dimensions:t.map((e=>{let{name:t}=e;return{value:t,label:t}}))}},Re=e=>{let{isNew:t}=e;return(0,ae.jsxs)(oe.Flex,{as:"span",gap:1,children:["Manage room",(0,ae.jsx)(oe.TextBig,{color:"textLite",children:"/"}),(0,ae.jsxs)(oe.TextBig,{color:"textLite",children:[t?"Add":"Edit"," Metric"]})]})},Be=[{value:"value",label:"Value"},{value:"progressBar",label:"Progress Bar"}],Pe=[{value:"sum",label:"Sum"},{value:"avg",label:"Average"},{value:"min",label:"Minimum"},{value:"max",label:"Maximum"}],Oe=[{value:"left",label:"Left"},{value:"center",label:"Center"},{value:"right",label:"Right"}],Ve=e=>{let{spaceId:t,roomId:n,id:o,onClose:s,tabId:i,...a}=e;const l="new"===o,c=(0,Se.uB)(n,o),d=(0,Se.e6)(n,o),[u,h]=(0,r.useState)(d),{title:x,context:g,dimensions:m=[],totalDimensions:p=[],calculateTotal:f=!1,columnFlavour:j="value",aggregation:b="sum",fractionDigits:v=1,hideUnits:y=!1,align:C="center"}=u;(0,r.useEffect)((()=>{l&&c()}),[]);const w=(0,_.w7)({extraKey:"nodesView",merge:!1,scoped:!0}),I=(0,Te.A)(n,w,{spaceId:t});if(I)throw I;const A=(0,Fe.OL)(n),k=(0,r.useMemo)((()=>A.map((e=>({value:e,label:e})))),[A]),S=(0,Fe._0)(n),T=(0,r.useMemo)((()=>g&&{value:g,label:g}),[g]),[{dimensions:F},N]=(0,ke.A)((()=>({enabled:!!g,fetch:()=>((e,t,n)=>Le.A.get(`${$e.P8}/spaces/${e}/rooms/${t}/contexts/${encodeURIComponent(n)}`,{transform:De}))(t,n,g),initialValue:{dimensions:[]}})),[t,n,g]),M=(0,r.useCallback)((e=>{let{value:t}=e;h((e=>({...e,context:t,dimensions:[],title:t})))}),[]),L=(0,r.useMemo)((()=>F?0===m.length?[]:m.map((e=>({value:e,label:e}))):[]),[m,F]),$=(0,r.useMemo)((()=>F?0===p.length?[]:p.map((e=>({value:e,label:e}))):[]),[p,F]),D=(0,r.useCallback)((e=>{N||h((t=>({...t,dimensions:e.map((e=>{let{label:t}=e;return t}))})))}),[N]),R=(0,Se.tQ)(n),B=(0,r.useCallback)((()=>R({...u,id:o,type:i}).then(s)),[u,o,i,s,R]),P=(0,r.useCallback)((e=>{let{target:{value:t}}=e;t.length<=30&&h((e=>({...e,title:t,header:t,headerString:t})))}),[]),O=(0,r.useCallback)((e=>{N||h((t=>({...t,totalDimensions:e.map((e=>{let{label:t}=e;return t}))})))}),[N]),V=(0,r.useCallback)((e=>{let{value:t}=e;h((e=>({...e,columnFlavour:t,calculateTotal:"value"!==t&&e.calculateTotal})))}),[]),E=(0,r.useCallback)((e=>{let{value:t}=e;h((e=>({...e,aggregation:t})))}),[]),H=(0,r.useCallback)((e=>{let{value:t}=e;h((e=>({...e,align:t})))}),[]),z=(0,r.useCallback)((e=>{let{target:{value:t}}=e;const n=parseInt(t,10);!isNaN(n)&&n>=0&&n<=3&&h((e=>({...e,fractionDigits:n})))}),[]),K=(0,r.useCallback)((e=>{let{target:{checked:t}}=e;h((e=>({...e,hideUnits:t})))}),[]),G=(0,r.useCallback)((e=>{let{target:{checked:t}}=e;h((e=>({...e,calculateTotal:t,totalDimensions:t?e.totalDimensions:[]})))}),[]),W=!x||!g;return(0,ae.jsxs)(we.GO,{onClose:s,...a,children:[(0,ae.jsx)(Ie.z,{onClose:s,title:(0,ae.jsx)(Re,{isNew:l}),children:(0,ae.jsx)(oe.Button,{label:"Save",onClick:B,disabled:W})}),(0,ae.jsx)(Ae.U,{children:l?"Add a new metric (column)":"Edit metric"}),(0,ae.jsx)(we.Yv,{children:(0,ae.jsxs)(oe.Flex,{gap:6,column:!0,children:[(0,ae.jsx)(Me,{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,ae.jsx)(oe.Select,{options:k,value:T,onChange:M,isLoading:!S,"data-testid":"manageMetrics-contextSelect"})}),(0,ae.jsx)(Me,{title:"Metric Title","data-testid":"manageMetrics-title",children:(0,ae.jsx)(oe.TextInput,{name:"title",placeholder:"Type name",value:x,onChange:P})}),(0,ae.jsx)(Me,{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,ae.jsx)(oe.Select,{isMulti:!0,options:F,value:L,onChange:D,isLoading:N,isDisabled:!T,"data-testid":"manageMetrics-dimensionSelect"})}),(0,ae.jsx)(Me,{title:"Display Type","data-testid":"manageMetrics-columnFlavour",children:(0,ae.jsx)(oe.Select,{options:Be,value:{value:j,label:"value"===j?"Value":"Progress Bar"},onChange:V,"data-testid":"manageMetrics-columnFlavourSelect"})}),(0,ae.jsx)(oe.Toggle,{labelRight:"Calculate as percentage of total",checked:f,onChange:G,"data-testid":"manageMetrics-calculateTotalToggle",colored:!0}),f&&(0,ae.jsx)(Me,{title:"Total Dimensions",disclaimer:"Dimensions to use for total calculation. Leave blank to use all available dimensions.","data-testid":"manageMetrics-totalDimensions",children:(0,ae.jsx)(oe.Select,{isMulti:!0,options:F,value:$,onChange:O,isLoading:N,isDisabled:!T,"data-testid":"manageMetrics-totalDimensionSelect"})}),(0,ae.jsx)(Me,{title:"Aggregation","data-testid":"manageMetrics-aggregation",children:(0,ae.jsx)(oe.Select,{options:Pe,value:(0,r.useMemo)((()=>Pe.find((e=>e.value===(b||"sum")))),[b]),onChange:E,"data-testid":"manageMetrics-aggregationSelect"})}),(0,ae.jsx)(Me,{title:"Decimal Places","data-testid":"manageMetrics-fractionDigits",children:(0,ae.jsx)(oe.TextInput,{type:"number",name:"fractionDigits",min:"0",max:"3",value:v,onChange:z})}),(0,ae.jsx)(Me,{title:"Hide Units","data-testid":"manageMetrics-hideUnits",children:(0,ae.jsx)(oe.Toggle,{checked:y,onChange:K,"data-testid":"manageMetrics-hideUnitsToggle"})}),(0,ae.jsx)(Me,{title:"Text Alignment","data-testid":"manageMetrics-align",children:(0,ae.jsx)(oe.Select,{options:Oe,value:{value:C,label:Oe.find((e=>e.value===C))?.label},onChange:H,"data-testid":"manageMetrics-alignSelect"})})]})})]})};var Ee=n(49163),_e=n(45087),He=n(43375),ze=n(43627),Ke=n(74979);const Ge=e=>{let{onConfirm:t,children:n}=e;const[o,s]=(0,r.useState)(!1),i=(0,r.useCallback)((()=>{s(!1),t()}),[t]),a=(0,r.useCallback)((()=>{s(!1)}),[]);return o?(0,ae.jsxs)(oe.Flex,{alignItems:"center",gap:1,children:[(0,ae.jsx)(oe.Text,{color:"textLite",whiteSpace:"nowrap",children:"Delete?"}),(0,ae.jsx)(oe.IconButton,{icon:"checkmark_s",flavour:"borderless",padding:[0],onClick:i,width:"12px",height:"12px",title:"Confirm delete"}),(0,ae.jsx)(oe.IconButton,{icon:"x",flavour:"borderless",padding:[0],onClick:a,width:"12px",height:"12px",title:"Cancel"})]}):n((()=>s(!0)))},We=e=>{let{metric:t,onToggle:n,onEdit:r,onDelete:o,disabled:s}=e;const{attributes:i,listeners:a,setNodeRef:l,transform:c,transition:d}=(0,ze.gl)({id:t.id}),u={transform:Ke.Ks.Transform.toString(c),transition:d};return(0,ae.jsx)("div",{ref:l,style:u,...i,children:(0,ae.jsxs)(oe.Flex,{"data-testid":`metricsMenu-metric-${t.title}`,justifyContent:"between",alignItems:"center",padding:[1,0],children:[(0,ae.jsxs)(oe.Flex,{alignItems:"center",gap:1,children:[!s&&(0,ae.jsx)(oe.Icon,{name:"nav_dots",color:"textLite",cursor:"grab",size:"small",...a}),(0,ae.jsx)(oe.Checkbox,{checked:!t.hidden,"data-testid":"metricsMenu-metricCheckbox",label:t.title,onChange:n})]}),(0,ae.jsxs)(oe.Flex,{alignItems:"center",gap:1,children:[(0,ae.jsx)(oe.IconButton,{"data-testid":"metricsMenu-editMetric",flavour:"borderless",icon:"pencilSolid",padding:[0],onClick:r,width:"10px",height:"10px"}),(0,ae.jsx)(Ge,{onConfirm:o,children:e=>(0,ae.jsx)(oe.IconButton,{"data-testid":"metricsMenu-deleteMetric",flavour:"borderless",icon:"trashcan",padding:[0],onClick:e,width:"10px",height:"10px"})})]})]})})},qe=e=>{let{isOpen:t,onClose:n,onEdit:o,roomId:s,targetRef:i,tabId:a,metricsType:l}=e;const[c,d]=(0,Se.tY)(s),u=l||a,h=(0,r.useMemo)((()=>{const e=c.filter((e=>e.type===a));return e.length>0?e:c.filter((e=>e.type===u))}),[a,u,c]),[x,g]=(0,r.useState)(h.map((e=>e.id)));(0,r.useEffect)((()=>{g(h.map((e=>e.id)))}),[h]);const m=(0,He.FR)((0,He.MS)(He.AN),(0,He.MS)(He.uN,{coordinateGetter:ze.JR})),p=(0,Se._E)(s,a),f=(0,Se.gV)(s),j=(0,r.useCallback)((e=>{const{active:t,over:n}=e;if(t?.id&&n?.id&&t.id!==n.id){const e=x.indexOf(t.id),r=x.indexOf(n.id),o=(0,ze.be)(x,e,r);g(o),p(o)}}),[x,p]),b=(0,Ee._)({roomId:s,params:{type:"roomMetrics",entity:"metrics",path:"/nodes"}})[0],v=(0,Se.Ul)(s,a,l);if(!i.current||!t)return null;const y=e=>{o(e),n()};return(0,ae.jsxs)(oe.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:n,"data-testid":"metricsMenu",onClickOutside:n,onEsc:n,target:i.current,gap:1,children:[(0,ae.jsx)(oe.Button,{"data-testid":"metricsMenu-addMetricButton",label:"Add new metric",icon:"plus",onClick:()=>y("new"),small:!0,alignSelf:"end"}),(0,ae.jsx)(He.Mp,{sensors:m,collisionDetection:He.fp,onDragEnd:j,children:(0,ae.jsx)(ze.gB,{items:x,strategy:ze._G,children:(0,ae.jsx)(oe.Flex,{column:!0,children:x.map((e=>{const t=h.find((t=>t.id===e));return t?(0,ae.jsx)(We,{metric:t,onToggle:()=>d(t.id,(e=>({...e,hidden:!e.hidden,type:a}))),onEdit:()=>y(t.id),onDelete:()=>{return e=t.id,void f(e);var e},disabled:!1},t.id):null}))})})}),b&&(0,ae.jsx)(_e.A,{content:"All metrics will be reset to defaults",children:(0,ae.jsx)(oe.Button,{padding:[0],"data-testid":"metricsMenu-resetButton",label:"Reset to default metrics",flavour:"borderless",onClick:v,small:!0,danger:!0,alignSelf:"end"})})]})},Ue=e=>{let{spaceId:t,roomId:n,tabId:o,metricsType:s}=e;const[i,,a,l]=(0,be.A)(),[c,d]=(0,r.useState)(null),u=(0,r.useRef)();return(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(Ce.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,ae.jsx)(qe,{isOpen:i,onClose:l,onEdit:d,roomId:n,tabId:o,metricsType:s,targetRef:u}),c&&(0,ae.jsx)(Ve,{"data-testid":"metricsManagement",spaceId:t,roomId:n,tabId:o,metricsType:s,id:c,onClose:()=>d(null)})]})};var Je=n(94404);const Ze=()=>(0,se.H)("grouping","click-grouping","hm-nodes"),Xe=(0,Je.A)(ve.A),Ye=[{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"}],Qe=()=>{const e=(0,b.vt)(),t=(0,v.ID)(),[n,,o,s]=(0,be.A)(),[i,a]=(0,V.TS)(t,"groupMode"),l=(0,r.useMemo)((()=>Ye.find((e=>e.value===i))||Ye[0]),[i]),c=(0,r.useCallback)((e=>{let{value:t}=e;return a(t)}),[a]);return(0,ae.jsxs)(oe.Flex,{alignItems:"center","data-testid":"agentsHead-actions",flexWrap:!1,gap:3,children:[(0,ae.jsx)(oe.Select,{label:"Group by",onChange:c,onMenuOpen:Ze,options:Ye,value:l}),(0,ae.jsx)(Ue,{roomId:t,spaceId:e}),n&&(0,ae.jsx)(ye.A,{onClose:s}),(0,ae.jsx)(Xe,{"data-ga":"add-nodes::click-add-nodes::hm-nodes","data-testid":"agentsHead-addNode",icon:"nodes_hollow",label:"Add Nodes",onClick:o,small:!0})]})},et=()=>(0,ae.jsx)(oe.Flex,{width:"100%",justifyContent:"end",background:"mainBackground",padding:[2],children:(0,ae.jsx)(Qe,{})});n(3949);var tt=n(85163),nt=n(84535),rt=n(78152);const ot="clear",st="warning",it="critical",at="unreachable";var lt=n(58243),ct=n(49181);const dt={alertStatus:{[it]:1,[st]:2,[ot]:3,[at]:4},nodeStatus:{Live:1,Stale:2,Offline:3}},ut={nodeStatus:e=>(0,ct.GM)(e.state),alertStatus:e=>(0,ct.vt)(e),vendor:e=>e.labels?.vendor||"Unknown",type:e=>e.labels?.type||"Unknown",location:e=>e.labels?.sysLocation||e.labels?.location||"Unknown","":()=>"Nodes"},ht=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n=(0,v.ID)(),o=(0,V.Cq)(n,e),s=ut[o];return(0,r.useCallback)((e=>{if("customGroups"===o){const n=((e,t)=>{for(const n of t)if((0,lt.BW)(e,n.filters,n.selectedNodeIds))return n.name;return"Other"})(e,t),r=t.findIndex((e=>e.name===n));return{name:n,priority:"Other"===n?999:r>=0?r:998,icon:null}}const n=s?.(e);return{name:n,priority:dt[o]?.[n],icon:"nodeStatus"===o?`connectivityStatus${n}`:null}}),[o,s,t])};var xt=n(56876),gt=n(30863),mt=n(69001),pt=n(95836),ft=n(27496);const jt=e=>{let{id:t,...n}=e;return(0,ae.jsxs)(mt.h,{id:t,...n,children:[(0,ae.jsx)(pt.$,{id:t}),(0,ae.jsx)(ft.n,{id:t})]})},bt=(0,r.memo)(jt);var vt=n(16373),yt=n(90901),Ct=n(82103),wt=n(55759),It=n(77186),At=n(59400);const kt=e=>{let{connectivity:t,id:n,name:r,...o}=e;const s=(0,g.JT)("node:Delete"),i=!(0,v.XA)().untouchable,[a,,l,c]=(0,be.A)(),[d,,u,h]=(0,be.A)();return(0,ae.jsxs)(At.SS,{alignSelf:"end",gap:1,"data-testid":"node-actions",...o,children:[i&&(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(Ct.A,{badge:"actionRemove","data-testid":"remove-node-action",children:(0,ae.jsx)(At.d0,{"data-ga":"nodes-table-row::click-remove-node::nodes-view",onClick:u})}),d&&(0,ae.jsx)(It.Ay,{ids:[n],name:r,onClose:h})]}),s&&"Offline"===t&&(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(Ct.A,{badge:"actionObsolete","data-testid":"obsolete-node-action",children:(0,ae.jsx)(At.AS,{"data-ga":"nodes-table-row::click-obsolete-node::nodes-view",onClick:l})}),a&&(0,ae.jsx)(wt.Ay,{ids:[n],name:r,onClose:c})]})]})};var St=n(97336);const Tt=e=>{let{instanceType:t,name:n,providerType:r,...o}=e;return(0,ae.jsx)(Ct.A,{badge:"cloudInfo","data-testid":"node-cloud-info",nodeName:n,...o,children:(0,ae.jsxs)(oe.Flex,{alignItems:"center",gap:1,children:[(0,ae.jsx)(oe.Icon,{color:"textDescription","data-testid":"node-cloud-info-icon",name:"ipNetworking",width:"18px",height:"18px"}),(0,ae.jsxs)(oe.TextSmall,{color:"textDescription","data-testid":"node-cloud-info-text",children:[(0,ct.ws)(r)," \u2022 ",(0,ct.ws)(t)]})]})})},Ft=e=>{let{connectivity:t,name:n,...r}=e;return(0,ae.jsx)(Ct.A,{badge:"connectivity",connectivityState:t,"data-testid":"node-connectivity",nodeName:n,...r,children:(0,ae.jsx)(oe.Icon,{name:`connectivityStatus${t}`,width:"18px",height:"18px"})})},Nt=e=>{let{onClick:t,...n}=e;return(0,ae.jsx)(Ct.A,{badge:"info","data-testid":"node-info-cta",...n,children:(0,ae.jsx)(oe.Icon,{color:"textDescription",cursor:"pointer",height:"18px",width:"18px",name:"information",onClick:t})})},Mt=e=>{let{name:t,...n}=e;return(0,ae.jsx)(Ct.A,{badge:"k8s","data-testid":"node-kubernetes",nodeName:t,...n,children:(0,ae.jsxs)(oe.Flex,{alignItems:"center",gap:1,children:[(0,ae.jsx)(oe.Icon,{color:"textDescription","data-testid":"node-kubernetes-icon",name:"serviceKubernetes",width:"18px",height:"18px"}),(0,ae.jsx)(oe.TextSmall,{color:"textDescription","data-testid":"node-kubernetes-text",children:"k8s"})]})})},Lt=e=>{let{kernelName:t,kernelVersion:n,name:r,...o}=e;return(0,ae.jsx)(Ct.A,{badge:"kernel","data-testid":"node-kernel",nodeName:r,...o,children:(0,ae.jsx)(oe.TextSmall,{color:"textDescription",children:(0,ct.Ud)(t,n)})})};var $t=n(52253),Dt=n(41708),Rt=n(92834);const Bt=e=>{let{architecture:t,cpuFrequency:n,cpus:r,diskSpace:o,memory:s,name:i,os:a,osName:l,timezone:c,...d}=e;return(0,ae.jsx)(Ct.A,{badge:"systemInfo","data-testid":"node-system-info",nodeName:i,...d,children:(0,ae.jsxs)(oe.Flex,{alignItems:"center",gap:1,children:[(0,ae.jsx)(oe.Icon,{color:"textDescription","data-testid":"node-system-info-icon",name:nt.u[l]?.iconName||nt.U[a]?.iconName||"os",width:"16px",height:"16px"}),(0,ae.jsxs)(oe.TextSmall,{color:"textDescription","data-testid":"node-system-info-text",children:[(0,ct.ws)(l)," \u2022 ",(0,ct.O)(n)," \u2022"," ",(0,ct.ws)(r,1===r?"Core":"Cores")," \u2022"," ",(0,ct.ws)(t)," \u2022"," ",(0,ct.ws)((0,ct.RI)(s),"RAM")," \u2022"," ",(0,ct.ws)((0,ct.RI)(o),"HD"),!!c&&(0,ae.jsxs)(ae.Fragment,{children:[" ","\u2022 ",(0,ae.jsx)(Rt.A,{timezone:c})]})]})]})})},Pt=e=>{let{container:t,name:n,virtualization:r,...o}=e;const s=(0,ct.Pg)(t,r);return(0,ae.jsx)(Ct.A,{badge:"type","data-testid":"node-type",nodeName:n,nodeType:s.label,...o,children:(0,ae.jsxs)(oe.Flex,{alignItems:"center",gap:1,children:[(0,ae.jsx)(oe.Icon,{color:"textDescription","data-testid":"node-type-icon",name:s.icon,height:s.iconSize,width:s.iconSize}),(0,ae.jsx)(oe.TextSmall,{color:"textDescription","data-testid":"node-type-text",children:s.label})]})})};var Ot=n(71236);const Vt=e=>{let{health:t={}}=e;const{silencingState:n}=t.alerts||{},{state:r}=n||{};return"NONE"!=r?(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(At.K,{"data-testid":"nodeRow-separator"}),(0,ae.jsx)(oe.Flex,{children:(0,ae.jsx)(Ot.A,{flavour:"node",silencing:n})})]}):null};var Et=n(74891);const _t=(0,Et.A)((0,Je.A)(oe.Button)),Ht=e=>{let{id:t}=e;const n=(0,f.Zp)(),o=(0,b.bq)(),s=(0,r.useCallback)((()=>{const e={nodeId:t};n(`/spaces/${o}/settings/notifications#notificationsActiveTab=1&silencingRulePrefill=${JSON.stringify(e)}`)}),[]);return(0,ae.jsx)(_t,{feature:"SilencingNode",payload:{nodeId:""},tooltip:"Create a new silencing rule for this node",flavour:"hollow",icon:"alarm_off",iconWidth:"12px",onClick:s})};var zt=n(36504),Kt=n(92942),Gt=n(19371),Wt=n(63928);const qt=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 n=(0,Ee._)({params:{type:["favourites"],path:[`/${e}/${t}`]}}),o=(0,r.useMemo)((()=>n.filter((e=>{let{value:t}=e;return t?.nodeId})).sort(((e,t)=>(e.value.sortOrder||0)-(t.value.sortOrder||0))).map((e=>{let{value:t}=e;return t.nodeId}))),[n]),s=(0,r.useMemo)((()=>n.reduce(((e,t)=>({...e,...t.value?.nodeId?{[t.value.nodeId]:t}:{}})),{})),[n]),i=(0,Wt.xS)(),a=(0,r.useCallback)((async e=>{const t=e.map(((e,t)=>{const n=s[e];if(n)return i({...n,value:{...n.value,sortOrder:t}})}));await Promise.all(t.filter(Boolean))}),[s,i]);return{favoriteNodeIds:o,settingsByNodeId:s,handleOrderChange:a}},Ut=(e,t)=>e&&e.getRoot().getChildren().find((e=>e.match({id:`nodes-${t}`}))),Jt=(e,t)=>`table-metrics-${e}-${t}`,Zt=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"sum";const o=Ut(e,t);if(!o)return null;const s=Jt(n,r);return o.getNode({id:s})};var Xt=n(28657);const Yt=e=>{let{id:t,roomId:n,nodeId:o,context:s,dimensions:i}=e;const a=(0,Gt.eg)(),l=(0,r.useMemo)((()=>{const e=Ut(a,n),r=[t,o,s].join("-");if(!e)return null;let l=e.getNode({id:r});return l?(l.updateAttribute("selectedDimensions",i),l):(l=a.makeChart({attributes:{id:r,nodesScope:[o],contextScope:[s],pixelsPerPoint:20,selectedDimensions:i}}),e.appendChild(l),l)}),[s,t,o,n,a]);return l?(0,ae.jsx)(Xt.A,{chart:l,hasHeader:!1,hasFooter:!1,hasFilters:!1,height:100}):null},Qt=(0,r.memo)(Yt);var en=n(74518);const tn=e=>{let{id:t,context:n,nodeId:r,isLive:o,hidden:s,title:i,dimensions:a}=e;const l=(0,v.ID)();return s||!o?null:(0,ae.jsxs)(oe.Flex,{column:!0,"data-testid":`metrics-chart-${n}`,flex:"grow",basis:"174px",children:[(0,ae.jsx)(en.A,{text:i||n,TextComponent:oe.TextSmall,color:"textDescription",margin:[1,0,1,2],as:"div"}),(0,ae.jsx)(Qt,{id:t,context:n,nodeId:r,roomId:l,dimensions:a})]})};var nn=n(91421),rn=n(3319);const on=e=>{let{node:t,...n}=e;const[,o]=(0,nn.PJ)(),{sendButtonClickedLog:s}=(0,rn.A)(),i=t.capabilities?.dyncfg?.enabled,a=t.isLive&&i,l=a?"Configure this node":t.isLive?"Node cannot be configured":"Cannot configure a non live node",c=(0,r.useCallback)((()=>{a&&(o(!0,{nodeId:t.id}),s({feature:"DyncfgNode",description:"Configure node",nodeId:t?.id,nodeName:t?.name}))}),[a,t,o,s]),d=(0,r.useMemo)((()=>({name:"gear",size:"small",color:a?"text":"disabled",cursor:a?"pointer":"auto",onClick:c})),[a,c]);return(0,ae.jsx)(Ct.A,{content:l,children:(0,ae.jsx)(oe.Flex,{...n,children:(0,ae.jsx)(oe.Icon,{...d})})})};var sn=n(51262);const an=(ln=on,e=>(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(At.K,{"data-testid":"nodeRow-separator"}),(0,ae.jsx)(ln,{...e})]}));var ln;const cn=e=>{let{id:t,name:n,hw:o,os:s,ni:i,capabilities:a,container:l,updateSeverity:c,bugs:d,labels:u,isLive:h,state:x,version:g,extraKey:m,health:p,menuId:f,eligibility:j}=e;const y=(0,b.dg)(),C=(0,v.ID)(),w=a.funcs?.enabled,I=a.ml?.enabled,A=(0,ct.GM)(x),{isNodeRestricted:k}=(0,sn.A)(),{restricted:S}=k(t),{_cloud_instance_type:T,_cloud_provider_type:F,_timezone:N}=u||{},M="true"===u?._is_k8s_node,L=!(0,ct.Po)(T)||!(0,ct.Po)(F),$=(0,z.Fw)("sidebarTab",{flavour:"val",extraKey:m}),D=(0,z.Fw)("sidebarOpen",{flavour:"bool"}),R=(0,z.Fw)("sidebarNodeId",{flavour:"val",extraKey:m}),B=(0,r.useCallback)((e=>{D(!0),$(e),R(t)}),[t,R,D,$]),P=(0,r.useCallback)((()=>B("alerts")),[B]),O=(0,r.useCallback)((()=>B("info")),[B]),V=(0,vt.Id)(),E=(0,yt.I)(),_=(0,Se.Vw)(C);return(0,ae.jsxs)(oe.Flex,{"data-testid":`nodeRow-${n}`,"data-menuid":f||t,padding:[1],column:!0,gap:1,round:!0,children:[(0,ae.jsxs)(oe.Flex,{alignItems:"center","data-testid":"nodeRow-basic-info",gap:2,height:{min:6},children:[(0,ae.jsx)(Ft,{connectivity:A,"data-testid":`nodeRow-connectivity-${A.toLowerCase()}`,name:n}),(0,ae.jsx)(At.K,{"data-testid":"nodeRow-separator"}),(0,ae.jsx)(Dt.A,{"data-testid":"nodeRow-name",id:t,name:n,isLive:h,state:x,eligibility:j}),(0,ae.jsx)(At.K,{"data-testid":"nodeRow-separator"}),(0,ae.jsx)(Nt,{onClick:O,"data-testid":"nodeRow-more-info-cta"}),(0,ae.jsx)(At.K,{"data-testid":"nodeRow-separator"}),(0,ae.jsx)(St.A,{id:t,isLive:h,"data-testid":"nodeRow-alerts",name:n,onClick:P}),(0,ae.jsx)(At.K,{"data-testid":"nodeRow-separator"}),(0,ae.jsx)($t.A,{badge:"ml","data-testid":"nodeRow-machine-learning-status",enabled:I,name:n,onClick:()=>E(t),children:(0,ae.jsx)(oe.Icon,{name:"anomaliesLens",size:"small",color:"text"})}),(0,ae.jsx)(At.K,{"data-testid":"nodeRow-separator"}),(0,ae.jsx)($t.A,{badge:"fn","data-testid":"nodeRow-fn-status",enabled:w,name:n,onClick:()=>V(t),children:(0,ae.jsx)(oe.Icon,{name:"functions",size:"small",color:"text"})}),c&&(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(At.K,{"data-testid":"nodeRow-separator"}),(0,ae.jsx)(zt.A,{name:n,os:s.id,container:l,warningLevel:c,labels:u,version:g,text:c,"data-testid":"nodeRow-needs-update"})]}),!!(d||[]).length&&(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(At.K,{"data-testid":"nodeRow-separator"}),(0,ae.jsx)(Kt.A,{bugs:d,"data-testid":"nodeRow-bugs"})]}),(0,ae.jsx)(an,{node:{id:t,name:n,isLive:h,ni:i,capabilities:a}}),(0,ae.jsx)(kt,{"data-testid":"nodeRow-node-actions",id:t,name:n,connectivity:A}),y?null:(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(Vt,{health:p}),(0,ae.jsx)(Ht,{id:t})]})]}),(0,ae.jsxs)(oe.Flex,{alignItems:"center","data-testid":"nodeRow-detailed-info",gap:2,children:[(0,ae.jsx)(Bt,{architecture:o.architecture,cpuFrequency:o.cpuFrequency,cpus:o.cpus,"data-testid":"nodeRow-system-info",diskSpace:o.diskSpace,memory:o.memory,name:n,osName:s.nm,os:s.id,timezone:N}),(0,ae.jsx)(At.K,{"data-testid":"nodeRow-separator"}),!!s?.kernel&&(0,ae.jsx)(Lt,{"data-testid":"nodeRow-kernel",kernelName:s.kernel.nm,kernelVersion:s.kernel.v,name:n}),(0,ae.jsx)(At.K,{"data-testid":"nodeRow-separator"}),M&&(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(Mt,{"data-testid":"nodeRow-kubernetes",name:n}),(0,ae.jsx)(At.K,{"data-testid":"nodeRow-separator"})]}),(0,ae.jsx)(Pt,{container:o.container,"data-testid":"nodeRow-type",name:n,virtualization:o.virtualization}),L&&(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(At.K,{"data-testid":"nodeRow-separator"}),(0,ae.jsx)(Tt,{"data-testid":"nodeRow-cloud-info",instanceType:T,name:n,providerType:F})]})]}),!S&&!!_?.length&&(0,ae.jsx)(oe.Flex,{"data-testid":"nodeRow-charts",gap:1,children:_.map((e=>(0,ae.jsx)(tn,{...e,nodeId:t,isLive:h},e.id)))})]})},dn=e=>{switch(e.level){case 0:return bt;case 1:return cn;default:return null}},un=e=>{let{onChartNameChange:t,initialChartName:n,dashboardOptions:r,linkToGo:o,contextToGo:s,...i}=e;const{setActiveMenuId:a}=(0,xt.A)({onChartNameChange:t,initialChartName:n,linkToGo:o,contextToGo:s});return(0,ae.jsx)(ne.H,{...i,children:(0,ae.jsx)(gt.A,{flavour:"nodes",onActiveMenuId:a,getComponent:dn,dashboardOptions:r,initialChartName:n,checkVisibility:()=>!0})})};var hn=n(69457),xn=n(20871),gn=n(48106),mn=n(33185),pn=n(24155);const fn=(0,mn.default)(oe.Box).attrs((e=>({...e}))).withConfig({displayName:"loader__Grid",componentId:"sc-yd9b7n-0"})(["display:grid;grid-template-columns:1fr 6fr 1fr;gap:8px;"]),jn=()=>(0,ae.jsxs)(oe.Flex,{column:!0,gap:2,children:[(0,ae.jsx)(pn.A,{height:"38px"}),(0,ae.jsx)(fn,{children:Array.from(Array(15).keys()).map((e=>(0,ae.jsxs)(r.Fragment,{children:[(0,ae.jsx)(pn.A,{height:"32px"}),(0,ae.jsx)(pn.A,{height:"32px"}),(0,ae.jsx)(pn.A,{height:"32px"})]},e)))})]});var bn=n(9962),vn=(n(30670),n(36310)),yn=n(39483);const Cn=e=>{let{children:t,contextName:n,dimensions:r,aggregationMethod:o="sum",fractionDigits:s,totalDimensions:i,calculateTotal:a}=e;const{chart:l,state:c}=(0,vn.useHeadlessChart)(),{contextGroups:d}=(0,yn.useTableMatrix)();if(!d)return t({data:null,loading:!c.loaded&&c.loading,error:c.error});if(c.empty)return t({data:null,loading:!c.loaded&&c.loading,error:"No data available"});const u=d[n];if(!u)return t({data:null,loading:!c.loaded&&c.loading,error:"Context not found"});const h=l.getPayload()?.data?.length-1||0;if(a){const e=r&&r.length>0?(Array.isArray(r)?r:[r]).map((e=>u[e]?.[0])).filter(Boolean):Object.values(u).flat().filter(Boolean),n=i&&i.length>0?i.map((e=>u[e]?.[0])).filter(Boolean):Object.values(u).flat().filter(Boolean);if(0===e.length||0===n.length)return t({data:null,loading:!c.loaded&&c.loading,error:"Required dimensions not found"});const o=e.reduce(((e,t)=>e+(l.getDimensionValue(t,h)||0)),0),a=n.reduce(((e,t)=>e+(l.getDimensionValue(t,h)||0)),0),d=a>0?o/a*100:0,x=e[0];return t({data:{value:o,convertedValue:l.getConvertedValue(o,{fractionDigits:s,dimensionId:x}),total:l.getConvertedValue(a,{fractionDigits:s,dimensionId:x}),percentage:d,units:l.getUnitSign({dimensionId:x}),dimensionId:x},loading:!c.loaded&&c.loading,error:null})}let x,g,m,p,f;if(!r||Array.isArray(r)&&0===r.length){if(p=Object.values(u).flat(),f=p[0],0===p.length)return t({data:null,loading:!c.loaded&&c.loading,error:"No dimensions found"});x=l.getAggregatedDimensionValue(p,h,{aggregationMethod:o}),g=l.getConvertedValue(x,{dimensionId:f,fractionDigits:s})}else if("string"===typeof r){if(p=u[r],f=p[0],!p?.length)return t({data:null,loading:!c.loaded&&c.loading,error:"Dimension not found"});x=l.getAggregatedDimensionValue(p,h,{aggregationMethod:o}),g=l.getConvertedValue(x,{dimensionId:f,fractionDigits:s}),m=l.selectDimensionColor(p[0])}else if(Array.isArray(r)){if(p=r.flatMap((e=>u[e])).filter(Boolean),f=p[0],0===p.length)return t({data:null,loading:!c.loaded&&c.loading,error:"No valid dimensions found"});x=l.getAggregatedDimensionValue(p,h,{aggregationMethod:o}),g=l.getConvertedValue(x,{dimensionId:f,fractionDigits:s})}return t({data:{value:parseFloat(x)||0,convertedValue:g||"0",dimensionId:f,units:f?l.getUnitSign({dimensionId:f}):"",...m&&{color:m}},loading:!c.loaded&&c.loading,error:null})},wn=e=>{let{nodeId:t,contextName:n,dimensions:o,aggregationMethod:s="sum",fractionDigits:i,totalDimensions:a,calculateTotal:l,children:c}=e;const d=(0,Gt.eg)(),u=(0,v.ID)(),[h,x]=(0,r.useState)((()=>Zt(d,u,t,s)));return(0,r.useEffect)((()=>{if(h)return;const e=(e,n)=>{n.getId()!==Jt(t,s)&&n.getId()!==h?.getId()&&x(n)},n=()=>x(Zt(d,u,t,s));return d.on("nodeAdded",e),d.on("nodesContainerUpdated",n),n(),()=>{d.off("nodeAdded",e),d.off("nodesContainerUpdated",n)}}),[d,h]),h?(0,ae.jsx)(vn.default,{chart:h,children:(0,ae.jsx)(Cn,{contextName:n,dimensions:o,aggregationMethod:s,fractionDigits:i,totalDimensions:a,calculateTotal:l,children:c})}):c({data:null,loading:!0,error:"Chart not found"})},In=()=>(0,ae.jsx)(pn.A,{width:"80%",height:"8px"}),An={value:e=>({id:e.columnId,header:(0,ae.jsx)(oe.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:n}=t;const r=n.original,o=r.id||r.nd;return(0,ae.jsx)(wn,{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:n,loading:r}=t;if(r)return(0,ae.jsx)(oe.Flex,{alignItems:"end",justifyContent:"end",width:"100%",children:(0,ae.jsx)(In,{})});if(!n)return(0,ae.jsx)(oe.Flex,{alignItems:"end",justifyContent:"end",width:"100%",children:(0,ae.jsx)(oe.Text,{children:"-"})});const o=n.convertedValue&&n.total;return(0,ae.jsxs)(oe.Flex,{alignItems:"end",justifyContent:"end",width:"100%",gap:.5,children:[(0,ae.jsx)(oe.Text,{textAlign:"right",children:o?(0,ae.jsxs)(ae.Fragment,{children:[n.convertedValue,"/",n.total]}):n.convertedValue}),!e.hideUnits&&n.units&&(0,ae.jsx)(oe.TextMicro,{color:"textLite",strong:!0,textAlign:"right",children:n.units})]})}})},renderString:t=>{const n=t.original[e.columnId];return(0,ct.Po)(n)?"":`${n.convertedValue} ${e.hideUnits?"":n.units}`},sortingFn:(t,n)=>(t.original[e.columnId]?.value||0)-(n.original[e.columnId]?.value||0)}),progressBar:e=>({id:e.columnId,header:(0,ae.jsx)(oe.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:n}=t;const r=n.original,o=r.id||r.nd;return(0,ae.jsx)(wn,{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:n,loading:r}=t;if(r)return(0,ae.jsx)(oe.Flex,{alignItems:"end",justifyContent:"end",width:"100%",children:(0,ae.jsx)(In,{})});if(!n)return(0,ae.jsx)(oe.Flex,{alignItems:"end",justifyContent:"end",width:"100%",children:(0,ae.jsx)(oe.Text,{children:"-"})});const o="undefined"!==typeof n.convertedValue&&"undefined"!==typeof n.total,s=o?n.percentage:parseFloat(n.convertedValue)||0,i=Math.min(s,100);return(0,ae.jsxs)(oe.Flex,{column:!0,width:"100%",alignItems:o?"center":"end",gap:2,children:[(0,ae.jsxs)(oe.Flex,{alignItems:"end",justifyContent:o?"between":"end",width:"100%",children:[o&&(0,ae.jsxs)(oe.Flex,{alignItems:"end",gap:.5,children:[(0,ae.jsxs)(oe.Text,{children:[n.convertedValue,"/",n.total]}),!e.hideUnits&&n.units&&(0,ae.jsx)(oe.TextMicro,{color:"textLite",strong:!0,textAlign:"right",children:n.units})]}),(0,ae.jsxs)(oe.Flex,{alignItems:"end",children:[(0,ae.jsx)(oe.Text,{children:Math.round(s)}),(0,ae.jsx)(oe.TextMicro,{color:"textLite",strong:!0,children:"%"})]})]}),(0,ae.jsx)(oe.ProgressBar,{background:"panelBg",color:"textLite",height:.5,width:`${i}%`,containerWidth:"100%",border:"none",overflow:"hidden"})]})}})},renderString:t=>{const n=t.original[e.columnId];return(0,ct.Po)(n)?"":`${n.convertedValue} / ${n.total} (${n.percentage.toFixed(1)}%)`},sortingFn:(t,n)=>(t.original[e.columnId]?.percentage||t.original[e.columnId]?.value||0)-(n.original[e.columnId]?.percentage||n.original[e.columnId]?.value||0)}),metadata:e=>({id:e.columnId,header:(0,ae.jsx)(oe.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:n}=t;const r=n.original,o=e.accessorKey.split(".");let s=r;for(const e of o)if(s=s?.[e],void 0===s)break;if(e.fallbackKeys)for(const i of e.fallbackKeys){if(!(0,ct.Po)(s))break;const e=i.split(".");let t=r;for(const n of e)if(t=t?.[n],void 0===t)break;s=t}return(0,ct.Po)(s)?(0,ae.jsx)(oe.Flex,{alignItems:"end",width:"100%",children:(0,ae.jsx)(oe.Text,{children:"-"})}):(0,ae.jsx)(oe.Flex,{alignItems:"center",width:"100%",children:(0,ae.jsx)(oe.Text,{children:s})})},renderString:t=>{const n=t.original,r=e.accessorKey.split(".");let o=n;for(const e of r)if(o=o?.[e],void 0===o)break;if(e.fallbackKeys)for(const s of e.fallbackKeys){if(!(0,ct.Po)(o))break;const e=s.split(".");let t=n;for(const n of e)if(t=t?.[n],void 0===t)break;o=t}return(0,ct.Po)(o)?"-":o},sortingFn:"basic"})};var kn=n(71341);const Sn=e=>{let{osEntry:t}=e;if(!t)return(0,ae.jsx)(oe.Icon,{name:"os",width:"18px",height:"18px",color:"textDescription"});if(t.iconName)return(0,ae.jsx)(oe.Icon,{name:t.iconName,width:"18px",height:"18px",color:"textDescription",viewBox:"0 0 100 100"});if(t.logoFilename){const e=`${x.A.assetsBaseURL}/img/logos/os/${t.logoFilename}`;return(0,ae.jsx)("img",{src:e,width:"18px",height:"18px",alt:t.title})}return(0,ae.jsx)(oe.Icon,{name:"os",width:"18px",height:"18px",color:"textDescription"})},Tn=e=>{let{headerText:t="Server"}=e;return{id:"server",header:(0,ae.jsx)(oe.Text,{strong:!0,children:t}),headerString:t,accessorKey:"name",size:200,minSize:60,maxSize:400,align:"center",category:"Device",enableHiding:!1,cell:e=>{let{row:t}=e;const n=t.original,r=(0,ct.GM)(n.state),o=n.os?.nm||n.labels?.os_name,s=n.os?.id,i=n.labels?.vendor,a=nt.u[o]||nt.U[s]||nt.u[i],l="Live"===r?kn.P.live.indicatorWrapperColor:"Stale"===r?kn.P.stale.indicatorWrapperColor:kn.P.offline.indicatorWrapperColor;return(0,ae.jsxs)(oe.Flex,{alignItems:"center",gap:2,width:"100%",children:[(0,ae.jsx)(oe.Flex,{width:2,height:2,round:"50%",background:l,flex:!1}),(0,ae.jsx)(oe.Flex,{width:5,height:5,flex:!1,alignItems:"center",justifyContent:"center",children:(0,ae.jsx)(Sn,{osEntry:a})}),(0,ae.jsx)(Dt.A,{id:n.id||n.nd,name:n.nm||n.name,state:n.state,isLive:n.isLive})]})},renderString:e=>e.original.name||e.original.nm,sortingFn:"basic"}},Fn=e=>({id:"alerts",header:(0,ae.jsx)(oe.Text,{strong:!0,children:"Alerts"}),headerString:"Alerts",accessorFn:e=>{const{warning:t=0,critical:n=0}=e.health?.alerts||{};return 3*n+2*t},size:80,minSize:60,maxSize:400,align:"center",category:"Device",cell:t=>{let{row:n}=t;const o=n.original,{warning:s=0,critical:i=0}=o.health?.alerts||{},a=s+i>0,l=(0,z.Fw)("sidebarTab",{flavour:"val",extraKey:e}),c=(0,z.Fw)("sidebarOpen",{flavour:"bool"}),d=(0,z.Fw)("sidebarNodeId",{flavour:"val",extraKey:e}),u=(0,r.useCallback)((e=>{e.stopPropagation(),c(!0),l("alerts"),d(o.id)}),[o.id,d,c,l]),h=(0,bn.I)({flavour:i>0?"error":"disabledError",value:i||" "}),x=(0,bn.I)({flavour:s>0?"warning":"disabledWarning",value:s||" "});return(0,ae.jsx)(oe.Flex,{alignItems:"center",justifyContent:"center",opacity:a?1:.3,children:(0,ae.jsx)(oe.MasterCard,{"data-testid":"alertsMastercard",onClick:a?u:null,pillLeft:h,pillRight:x,size:"small",height:"20px"})})},renderString:e=>{const{warning:t=0,critical:n=0}=e.original.health?.alerts||{};return t+n},sortingFn:"basic"}),Nn=(e,t)=>{let{extraKey:n="nodesView",tabId:o="servers"}=t;return(0,r.useMemo)((()=>{const t="snmp"===o?"Device":"Server",r=(e=>e.map((e=>{const t=An[e.columnFlavour];return t?t(e):(console.warn(`Unknown column flavour: ${e.columnFlavour}`),An.value(e))})))(e)||[],s=r.reduce(((e,t)=>{const n=t.category||"Metrics";return e[n]||(e[n]=[]),e[n].push(t),e}),{});return[{id:"Server",isPlaceholder:!0,columns:[Tn({headerText:t}),Fn(n)],notFlex:!0},...Object.entries(s).map((e=>{let[t,n]=e;return{id:t,header:"",columns:n,notFlex:!0}}))]}),[e,n,o])};var Mn=n(1444),Ln=n(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,ae.jsxs)(oe.Flex,{column:!0,gap:1,children:[(0,ae.jsx)(oe.Text,{children:"Favourites can be saved only on a paid plan."}),(0,ae.jsx)(Ln.A,{children:(0,ae.jsx)(oe.Text,{color:"primary",children:"Upgrade for no limitations!"})})]}),default:null},Dn=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[n,,o,s]=(0,be.A)(),i=(0,Wt.yK)({onResolve:s}),a=(0,Wt.z2)(null,{onResolve:s}),{disabled:l,reason:c}=(0,Mn.A)(),d=(0,r.useCallback)((async function(n,r){let{tabId:s=t,flavour:c=e}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!l&&n&&(o(),r?await a(r.id):await i({type:"favourites",entity:n,path:`/${c}/${s}`,value:{nodeId:n,sortOrder:Date.now()}}))}),[l,i,a,o,e,t]);return{isLoading:n,disabled:l,reason:$n[c]||$n.default,toggleFavorite:d}};var Rn=n(85720),Bn=n(78804);const Pn=(0,mn.default)(oe.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"})([""]),On=(0,r.memo)((e=>{let{data:t,onCreateGroupWithNode:n,icon:o,name:s,...i}=e;const a=(0,r.useRef)(),[l,c,,d]=(0,be.A)(!1),u=(0,v.ID)(),h=(0,fe.Jk)(u),x=(0,fe.TV)(u),g=(0,r.useCallback)((async e=>{await x({groupId:e,nodeId:t.id}),d()}),[x,t.id,d]),m=(0,r.useCallback)((()=>{n(t.id),d()}),[n,t.id,d]);return(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(oe.IconButton,{...i,ref:a,icon:o,name:s,onClick:c}),l&&a.current&&(0,ae.jsxs)(Pn,{target:a.current,onEsc:d,onClickOutside:d,children:[h.map((e=>(0,ae.jsx)(Rn.A,{onClick:()=>g(e.id),testid:`addToGroup-${e.id}`,children:e.name},e.id))),h.length>0&&(0,ae.jsx)(Bn.c,{}),(0,ae.jsx)(Rn.A,{icon:"plus",onClick:m,testid:"addToGroup-createNew",children:"Create new group"})]})]})})),Vn=On,En={[it]:"error",[st]:"warning",[ot]:"success",[at]:"textLite"},_n={Live:"live",Stale:"stale",Offline:"offline",critical:"live",warning:"live",clear:"live"},Hn={nodeStatus:!0,critical:!0,warning:!0,clear:!0},zn=e=>{let{rows:t,name:n,groupMode:r}=e;const o=Hn[r]||Hn[n],s=t.map((e=>e.original.id)),i=(0,E.BU)(s).length,a=(0,E.Ig)(s).length,l=(0,E.GE)(s).length;return(0,ae.jsx)(_e.A,{content:(0,ae.jsxs)(oe.Flex,{alignItems:"center",gap:4,background:"dropdown",round:!0,padding:[2,3],children:[(!o||_n[n]===_n.Live)&&(0,ae.jsxs)(oe.Flex,{alignItems:"center",gap:2,children:[(0,ae.jsx)(oe.Flex,{width:2,height:2,round:"50%",background:kn.P.live.indicatorWrapperColor}),(0,ae.jsxs)(oe.Text,{children:["Live: ",i]})]}),(!o||_n[n]===_n.Stale)&&(0,ae.jsxs)(oe.Flex,{alignItems:"center",gap:2,children:[(0,ae.jsx)(oe.Flex,{width:2,height:2,round:"50%",background:kn.P.stale.indicatorWrapperColor}),(0,ae.jsxs)(oe.Text,{children:["Stale: ",a]})]}),(!o||_n[n]===_n.Offline)&&(0,ae.jsxs)(oe.Flex,{alignItems:"center",gap:2,children:[(0,ae.jsx)(oe.Flex,{width:2,height:2,round:"50%",background:kn.P.offline.indicatorWrapperColor}),(0,ae.jsxs)(oe.Text,{children:["Offline: ",l]})]})]}),align:"right",children:(0,ae.jsxs)(oe.Text,{color:"textLite",children:["(",(!o||_n[n]===_n.Live)&&(0,ae.jsx)(oe.Text,{color:kn.P.live.statusTextColor,children:i}),!o&&"/",(!o||_n[n]===_n.Stale)&&(0,ae.jsx)(oe.Text,{color:kn.P.stale.statusTextColor,children:a}),!o&&"/",(!o||_n[n]===_n.Offline)&&(0,ae.jsx)(oe.Text,{color:kn.P.offline.statusTextColor,children:l}),")"]})})},Kn=e=>{let{row:t,name:n,groupMode:r,...o}=e;const s=t.getIsExpanded(),i="Other"===(a=n)?"textLite":kn.P[a?.toLowerCase?.()]?.statusTextColor||En[a]||"text";var a;return(0,ae.jsx)(oe.Flex,{height:"44px",alignItems:"center",flex:!0,width:"100%",background:"tableRowBg2",_hover:{background:"tableRowBg2Hover"},...o,children:(0,ae.jsxs)(oe.Flex,{position:"sticky",left:"0px",width:"auto",padding:[2,3],gap:2,children:[(0,ae.jsx)(oe.Icon,{name:"chevron_left",size:"small",color:"textLite",rotate:s?1:3}),(0,ae.jsx)(oe.Text,{color:i,strong:!0,children:n}),(0,ae.jsx)(zn,{rows:t.subRows,groupMode:r,name:n})]})})},Gn=e=>{let{tabId:t,flavour:n,onClickRow:r,columnPinning:o,columnVisibility:s,columnSizing:i,onColumnSizingChange:a,sortBy:l,onSortingChange:c,rowActions:d,columns:u}=e;const{favoriteNodeIds:h}=qt(n,t),[x,g]=(0,be.A)(!0),m=(0,E.Gt)(h),p={getIsExpanded:()=>x,subRows:m.map((e=>({original:e})))};return m.length?(0,ae.jsx)(ae.Fragment,{children:(0,ae.jsxs)("div",{children:[(0,ae.jsx)(Kn,{row:p,name:"Favourites",onClick:g}),(0,ae.jsx)(oe.Collapsible,{open:x,children:(0,ae.jsx)(oe.Table,{data:m,dataColumns:u,rowActions:d,onClickRow:r,enableSorting:!0,sortBy:l,onSortingChange:c,enableColumnPinning:!0,enableResizing:!0,columnVisibility:s,columnSizing:i,onColumnSizingChange:a,background:"tableRowBg2",columnPinning:o})})]})}):null};var Wn=n(37356),qn=n(71581);const Un={right:["actions"],left:["server"]},Jn={nodeStatus:{Live:!0},default:!0},Zn=e=>{let{id:t}=e;return t},Xn=(e=>t=>{let{nodeIdsLoaded:n,...r}=t;return(0,v.XA)("fullyLoaded")&&!!n?(0,ae.jsx)(e,{...r}):(0,ae.jsx)(jn,{})})((e=>{let{nodeIds:t,tabNodeIds:n,onChartNameChange:o,initialChartName:s,tabId:i="servers",flavour:a="nodesView",onCreateGroup:l,onCreateGroupWithNode:c,matchingGroups:d}=e;const u=(0,hn.qR)(),h=(0,v.ID)(),x=(0,b.vt)(),m=(0,g.JT)("space:UpdateSettings",x),p=(0,V.Cq)(h,i),f=(0,V.A3)(h,i),j=(0,qn.rK)(i,h),y=(0,Se.vh)(h,i,j),[C,w]=(0,z.r$)("expanded",{extraKey:`${a}-${i}-${p||"ungrouped"}`,flavour:"obj",defaultValue:Jn[p]||Jn.default}),[I,A]=(0,r.useState)(null),[k,S]=(0,r.useState)(null),T=(0,r.useCallback)(((e,t)=>{A({ids:[e],name:t})}),[]),F=(0,r.useCallback)(((e,t)=>{S({ids:[e],name:t})}),[]),N=Nn(y,{extraKey:a,tabId:i}),M=(0,r.useMemo)((()=>{const e=(e=>{const t={nodeStatus:{name:"Node status",columns:[]},alertStatus:{name:"Alerts",columns:[]}};return"snmp"===e?{...t,vendor:{name:"Vendor",columns:[]},type:{name:"Type",columns:[]},location:{name:"Location",columns:[]}}:t})(i);return(0,je.b5)(i)&&d?.length>0?{...e,customGroups:{name:"Groups",columns:[]}}:e}),[i,d?.length]),L=(0,r.useMemo)((()=>y.reduce(((e,t)=>(t.hidden&&(e[t.columnId]=!1),e)),{})),[y]),[$,D]=(0,z.r$)("columnVisibility",{extraKey:`${a}-${i}`,flavour:"obj",defaultValue:L}),[R,B]=(0,z.r$)("columnSizing",{extraKey:`${a}-${i}`,flavour:"obj",defaultValue:{}}),[P,O]=(0,z.r$)("sortBy",{extraKey:`${a}-${i}`,flavour:"arrobj",defaultValue:[]}),E=(0,z.Fw)("sidebarTab",{flavour:"val",extraKey:a}),_=(0,z.Fw)("sidebarOpen",{flavour:"bool"}),H=(0,z.Fw)("sidebarNodeId",{flavour:"val",extraKey:a}),K=(0,r.useCallback)(((e,t)=>{_(!0),E(e),H(t)}),[H,_,E]),G=(0,r.useCallback)((e=>{let{data:t}=e;t.isGroup||K("info",t.id)}),[K]),W=((e,t)=>{let{flavour:n,onRemoveNode:o,onObsoleteNode:s,onClickNode:i,onCreateGroupWithNode:a}=t;const l=(0,g.JT)("node:Delete"),c=(0,b.vt)(),d=(0,g.JT)("space:UpdateSettings",c),u=(0,v.XA)(),h=(0,b.dg)(),x=!u.untouchable,{isLoading:m,toggleFavorite:p,disabled:f,reason:j}=Dn(n,e),{settingsByNodeId:y}=qt(n,e),C=(0,r.useRef)(null);return C.current=t=>{const r=y[t];p(t,r,{flavour:n,tabId:e})},(0,r.useMemo)((()=>({...!h&&x&&{remove:{icon:"remove",tooltipText:"Remove node from room",handleAction:e=>o(e.id,e.name),confirmation:!0,confirmationText:e=>`Remove ${e.name} from room?`,isDisabled:()=>!1}},...!h&&!x&&{obsolete:{icon:"delete",tooltipText:"Delete node permanently",handleAction:e=>s(e.id,e.name),confirmation:!0,confirmationText:e=>`Delete ${e.name} permanently?`,isDisabled:e=>{const t=(0,ct.GM)(e.state);return l&&"Offline"!==t}}},info:{handleAction:e=>i({data:e})},favorite:{icon:e=>y[e.id]?"heart_broken":"heart",tooltipText:e=>y[e.id]?"Remove from favorites":"Add to favorites",handleAction:e=>C.current(e.id),confirmation:!1,isVisible:()=>!0,isDisabled:m||f,iconColor:"textNoFocus",disabledTooltipText:j||"Saving..."},...rt.xH&&d&&a&&{addToGroup:{CustomComponent:Vn,icon:"groupCreate",tooltipText:"Add to group",onCreateGroupWithNode:a,confirmation:!1}}})),[l,d,h,x,o,s,m,f,y,i,a])})(i,{flavour:a,onRemoveNode:T,onObsoleteNode:F,onClickNode:G,onCreateGroupWithNode:c}),q=(0,r.useMemo)((()=>{if(rt.xH&&m&&l)return{createGroup:{handleAction:l,icon:"groupCreate",tooltipText:"Create group",alwaysEnabled:!0,confirmation:!1}}}),[m,l]),{setActiveMenuId:U}=(0,xt.A)({onChartNameChange:o,initialChartName:s}),J=(0,r.useRef)(),Z=(0,r.useRef)(),X=(0,r.useMemo)((()=>(J.current&&J.current.cancel(),J.current=(0,xn.A)({elementQueryParam:"[data-id]",dataMenuId:"data-id"}),()=>J.current(Z.current?.scrollElement,U))),[u.length,U]);(0,r.useLayoutEffect)((()=>{u.length&&X()}),[u.length,s]);const Y=(0,r.useRef)(),Q=(0,r.useMemo)((()=>({overscan:30,virtualRef:Z,onScroll:X})),[X]),ee=(0,r.useMemo)((()=>u.filter(Boolean)),[u]);(0,gn.A)(Z.current,ee);const te=(0,r.useMemo)((()=>e=>(0,ae.jsx)(Kn,{groupMode:p,...e})),[p]);return(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(Gn,{tabId:i,flavour:a,onRemoveNode:T,onObsoleteNode:F,onClickRow:G,columnPinning:Un,columnVisibility:$,columnSizing:R,onColumnSizingChange:B,sortBy:P,onSortingChange:O,rowActions:W,columns:N}),t.length?(0,ae.jsx)(oe.Table,{title:(0,ae.jsx)(Wn.A,{extraKey:`${a}-${i}`,nodeIds:n,tabId:i}),data:ee,dataColumns:N,rowActions:W,bulkActions:q,onClickRow:G,enableSorting:!0,sortBy:P,onSortingChange:O,enableColumnVisibility:!0,enableColumnPinning:!0,enableResizing:!0,columnPinning:Un,columnVisibility:$,onColumnVisibilityChange:D,columnSizing:R,onColumnSizingChange:B,groupByColumns:M,grouping:p||"",onGroupByChange:f,getSubRows:e=>e.children,enableExpanding:!0,getRowId:Zn,expanded:C,onExpandedChange:w,GroupRow:te,virtualizeOptions:Q,tableRef:Y,background:"tableRowBg2"}):(0,ae.jsx)(pe,{children:(0,ae.jsx)(oe.Flex,{gap:1,alignItems:"center",children:(0,ae.jsx)(Wn.A,{extraKey:`${a}-${i}`,nodeIds:n,tabId:i})})}),I&&(0,ae.jsx)(It.Ay,{ids:I.ids,name:I.name,onClose:()=>A(null)}),k&&(0,ae.jsx)(wt.Ay,{ids:k.ids,name:k.name,onClose:()=>S(null)})]})}));n(37550);const Yn=e=>{let{tab:t,onToggle:n,onEdit:r,onDelete:o}=e;const{attributes:s,listeners:i,setNodeRef:a,transform:l,transition:c}=(0,ze.gl)({id:t.id}),d={transform:Ke.Ks.Transform.toString(l),transition:c},u=t.isDefault,h=t.label||t.name;return(0,ae.jsx)("div",{ref:a,style:d,...s,children:(0,ae.jsxs)(oe.Flex,{"data-testid":`groupsMenu-tab-${t.id}`,justifyContent:"between",alignItems:"center",padding:[1,0],children:[(0,ae.jsxs)(oe.Flex,{alignItems:"center",gap:1,children:[(0,ae.jsx)(oe.Icon,{name:"nav_dots",color:"textLite",cursor:"grab",size:"small",...i}),(0,ae.jsx)(oe.Checkbox,{checked:!t.isHidden,"data-testid":`groupsMenu-tabCheckbox-${t.id}`,label:h,onChange:n})]}),!u&&(0,ae.jsxs)(oe.Flex,{alignItems:"center",gap:1,children:[(0,ae.jsx)(oe.IconButton,{"data-testid":`groupsMenu-editTab-${t.id}`,flavour:"borderless",icon:"pencilSolid",padding:[0],onClick:r,width:"10px",height:"10px"}),(0,ae.jsx)(Ge,{onConfirm:o,children:e=>(0,ae.jsx)(oe.IconButton,{"data-testid":`groupsMenu-deleteTab-${t.id}`,flavour:"borderless",icon:"trashcan",padding:[0],onClick:e,width:"10px",height:"10px"})})]})]})})},Qn=e=>{let{isOpen:t,onClose:n,onEdit:o,onCreate:s,allNodes:i,targetRef:a,activeTabId:l,onTabChange:c}=e;const d=(0,v.ID)(),u=(0,fe.kf)(d,i),h=(0,r.useMemo)((()=>i.some(je.ZH)),[i]),x=(0,r.useMemo)((()=>u.filter((e=>"snmp"!==e.id||h))),[u,h]),g=(0,fe.vG)(d),m=(0,fe.Jf)(d),p=(0,fe.cq)(d),[f,j]=(0,r.useState)((()=>x.map((e=>e.id))));(0,r.useEffect)((()=>{j(x.map((e=>e.id)))}),[x]);const b=(0,He.FR)((0,He.MS)(He.AN),(0,He.MS)(He.uN,{coordinateGetter:ze.JR})),y=(0,r.useCallback)((e=>{const{active:t,over:n}=e;if(t?.id&&n?.id&&t.id!==n.id){const e=f.indexOf(t.id),r=f.indexOf(n.id),o=(0,ze.be)(f,e,r);j(o),g(o)}}),[f,g]),C=(0,r.useCallback)((e=>{m(e)}),[m]),w=(0,r.useCallback)((e=>{o(e),n()}),[o,n]),I=(0,r.useCallback)((e=>{e===l&&c&&c("servers"),p(e)}),[p,l,c]),A=(0,r.useCallback)((()=>{s(),n()}),[s,n]),k=(0,r.useMemo)((()=>x.reduce(((e,t)=>({...e,[t.id]:t})),{})),[x]);return a.current&&t?(0,ae.jsxs)(oe.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:n,"data-testid":"groupsMenu",onClickOutside:n,onEsc:n,target:a.current,gap:1,children:[(0,ae.jsx)(He.Mp,{sensors:b,collisionDetection:He.fp,onDragEnd:y,children:(0,ae.jsx)(ze.gB,{items:f,strategy:ze._G,children:(0,ae.jsx)(oe.Flex,{column:!0,children:f.map((e=>{const t=k[e];return t?(0,ae.jsx)(Yn,{tab:t,onToggle:()=>C(t.id),onEdit:()=>w(t.id),onDelete:()=>I(t.id)},t.id):null}))})})}),(0,ae.jsx)(oe.Button,{"data-testid":"groupsMenu-createGroup",label:"Create group",icon:"plus",onClick:A,small:!0,alignSelf:"end"})]}):null},er=e=>{let{allNodes:t,onCreateGroup:n,onEditGroup:o,activeTabId:s,onTabChange:i}=e;const[a,,l,c]=(0,be.A)(),d=(0,r.useRef)();return(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(Ce.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,ae.jsx)(Qn,{isOpen:a,onClose:c,onEdit:o,onCreate:n,allNodes:t,targetRef:d,activeTabId:s,onTabChange:i})]})},tr=(0,Je.A)(ve.A),nr=e=>{let{children:t,tabId:n,allNodes:r,onCreateGroup:o,onEditGroup:s,onTabChange:i,...a}=e;const[l,,c,d]=(0,be.A)(),u=(0,b.vt)(),h=(0,v.ID)(),x=(0,qn.rK)(n,h),m=(0,g.JT)("space:UpdateSettings",u);return(0,ae.jsxs)(oe.Flex,{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,ae.jsxs)(oe.Flex,{justifyContent:"between",alignItems:"end",flex:!0,children:[rt.xH&&m?(0,ae.jsx)(oe.IconButton,{icon:"plus",onClick:o,"data-testid":"nodes-create-group-button",tooltip:"Create group",padding:[1],width:"16px",height:"16px"}):(0,ae.jsx)("div",{}),(0,ae.jsxs)(oe.Flex,{alignItems:"center",padding:[0,0,1,2],gap:2,children:[l&&(0,ae.jsx)(ye.A,{onClose:d}),rt.xH&&(0,ae.jsx)(er,{allNodes:r,onCreateGroup:o,onEditGroup:s,activeTabId:n,onTabChange:i}),(0,ae.jsx)(Ue,{spaceId:u,roomId:h,tabId:n,metricsType:x}),(0,ae.jsx)(tr,{"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"})]})]})]})},rr=e=>{let{allNodes:t,activeTabId:n,onTabChange:o,onCreateGroup:s,onEditGroup:i,children:a}=e;const l=(0,v.ID)(),c=(0,fe.yT)(l,t),d=(0,r.useMemo)((()=>{const e=c.findIndex((e=>e.id===n));return e>=0?e:0}),[n,c]),u=(0,r.useCallback)((e=>{const t=c[e];t&&o&&o(t.id)}),[c,o]),h=(0,r.useMemo)((()=>({tabId:n,allNodes:t,onCreateGroup:s,onEditGroup:i,onTabChange:o})),[n,t,s,i,o]);return(0,ae.jsx)(oe.Tabs,{selected:d,onChange:u,height:"100%",padding:[4,4,2],TabsHeader:nr,tabHeaderProps:h,gap:4,noDefaultBorder:!0,children:c.map(((e,t)=>(0,ae.jsx)(oe.Tab,{label:(0,ae.jsx)(oe.Text,{color:t===d?"primary":"menuItem",children:e.label||e.name}),"data-testid":`nodes-tab-${e.id}`,padding:[2,4],maxWidth:"100%",green:!0,children:a},e.id)))})},or=e=>{let{tabId:t,filteredIds:n,totalCount:r}=e;const o=(0,je.K3)(t),s=o?.label||"Nodes",i=(0,E.BU)(n).length,a=(0,E.Ig)(n).length,l=(0,E.GE)(n).length;return(0,ae.jsxs)(oe.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,ae.jsxs)(oe.Text,{strong:!0,children:["Total ",s,": ",r]}),(0,ae.jsxs)(oe.Flex,{alignItems:"center",gap:4,children:[(0,ae.jsxs)(oe.Flex,{alignItems:"center",gap:2,children:[(0,ae.jsx)(oe.Flex,{width:2,height:2,round:"50%",background:kn.P.live.indicatorWrapperColor}),(0,ae.jsxs)(oe.Text,{children:["Live: ",i]})]}),(0,ae.jsxs)(oe.Flex,{alignItems:"center",gap:2,children:[(0,ae.jsx)(oe.Flex,{width:2,height:2,round:"50%",background:kn.P.stale.indicatorWrapperColor}),(0,ae.jsxs)(oe.Text,{children:["Stale: ",a]})]}),(0,ae.jsxs)(oe.Flex,{alignItems:"center",gap:2,children:[(0,ae.jsx)(oe.Flex,{width:2,height:2,round:"50%",background:kn.P.offline.indicatorWrapperColor}),(0,ae.jsxs)(oe.Text,{children:["Offline: ",l]})]})]})]})};var sr=n(32215);const ir=e=>{let{title:t,disclaimer:n,disclaimerColor:r="textLite",children:o,...s}=e;return(0,ae.jsxs)(oe.Flex,{gap:1,column:!0,...s,children:[(0,ae.jsx)(oe.Text,{as:"label",margin:[0],children:t}),o,n&&(0,ae.jsx)(oe.TextSmall,{color:r,children:n})]})};n(71517),n(11379),n(93777),n(14190),n(12359),n(86097),n(17273),n(27415),n(19929),n(37583),n(55122),n(20230),n(57268),n(79733);var ar=n(26848);const lr={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"}},cr=(0,r.memo)((e=>{let{filters:t,onFiltersChange:n,nodes:o,selectedNodeIds:s,onSelectedNodeIdsChange:i}=e;const[a,l]=(0,r.useState)(""),c=(0,r.useMemo)((()=>{const e=Object.entries(lr).map((e=>{let[t,n]=e;return{id:t,name:n.name,category:n.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.${e}`,name:e,category:"Labels"})))]}),[o]),d=(0,r.useMemo)((()=>{const e=Object.keys(t||{});return s?.length>0&&e.push("selectedNodeIds"),e}),[t,s]),u=(0,r.useMemo)((()=>{const e={searchAction:null,topFilters:[],groupedValues:{},allFilters:[]},t=a.toLowerCase().trim();t&&(e.searchAction={query:a,text:`Search for "${a}"`});const n=new Map,r=[];return c.forEach((e=>{if(!d.includes(e.id)){const n={id:e.id,name:e.name,category:e.category,score:0};if(t){const r=e.name.toLowerCase().includes(t),o=e.id.toLowerCase().includes(t);r&&(n.score+=10),o&&(n.score+=5),e.name.toLowerCase().startsWith(t)&&(n.score+=15)}else n.score=1;(n.score>0||!t)&&r.push(n)}if(o&&o.length>0){const r=[];if("nodeStatuses"===e.id){const e=o.reduce(((e,t)=>{const n=t.nodeStatus;return e[n]||(e[n]={count:0}),e[n].count+=1,e}),{});Object.entries(e).forEach((e=>{let[n,o]=e,s=!t,i=o.count;if(t){n.toLowerCase().includes(t)&&(s=!0,i=100,n.toLowerCase().startsWith(t)&&(i+=50))}s&&r.push({value:n,label:n,count:o.count,score:i})}))}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[n,o]=e,s=!t,i=o.count;if(t){n.toLowerCase().includes(t)&&(s=!0,i=100,n.toLowerCase().startsWith(t)&&(i+=50))}s&&r.push({value:n,label:n,count:o.count,score:i})}))}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 n=o.filter((t=>t.capabilities&&e in t.capabilities)).length;let s=!t,i=n;if(t){e.toLowerCase().includes(t)&&(s=!0,i=100,e.toLowerCase().startsWith(t)&&(i+=50))}s&&r.push({value:e,label:e,count:n,score:i})}))}else if("os.nm"===e.id){const e=o.reduce(((e,t)=>(t.os?.nm&&(e[t.os.nm]||(e[t.os.nm]={count:0}),e[t.os.nm].count+=1),e)),{});Object.entries(e).forEach((e=>{let[n,o]=e,s=!t,i=o.count;if(t){n.toLowerCase().includes(t)&&(s=!0,i=100,n.toLowerCase().startsWith(t)&&(i+=50))}s&&r.push({value:n,label:n,count:o.count,score:i})}))}else if(e.id.startsWith("label.")){const n=e.id.replace("label.",""),s=o.reduce(((e,t)=>{if(t.labels&&t.labels[n]){const r=t.labels[n];e[r]||(e[r]={count:0}),e[r].count+=1}return e}),{});Object.entries(s).forEach((e=>{let[o,s]=e,i=!t,a=s.count;if(t){o.toLowerCase().includes(t)&&(i=!0,a=100,o.toLowerCase().startsWith(t)&&(a+=50))}i&&r.push({value:`${n}|${o}`,label:o,count:s.count,score:a})}))}else"selectedNodeIds"===e.id&&o.forEach((e=>{let n=!t,o=1;const i=s?.includes(e.id);if(t){const r=e.name&&e.name.toLowerCase().includes(t),s=e.id.toLowerCase().includes(t);(r||s)&&(n=!0,o=r?100:50,e.name&&e.name.toLowerCase().startsWith(t)&&(o+=50))}n&&r.push({value:e.id,label:e.name||e.id,count:i?1:0,score:o+(i?10:0)})}));r.length>0&&(r.sort(((e,t)=>t.score-e.score)),n.set(e.id,{filterName:e.name,values:r.slice(0,t?10:5)}))}})),r.sort(((e,t)=>t.score-e.score)),e.allFilters=r,e.topFilters=t?r.slice(0,5):r,n.forEach(((n,r)=>{(e.topFilters.some((e=>e.id===r))||t)&&(e.groupedValues[r]=n)})),e}),[a,o,t,c,d,s]),h=(0,r.useCallback)((e=>{n((t=>({...t,[e]:[]})))}),[n]),x=(0,r.useCallback)(((e,t)=>{if("selectedNodeIds"===e){const e=s||[],n=e.includes(t)?e.filter((e=>e!==t)):[...e,t];i(n)}else n((n=>{const r=n[e]||[],o=r.includes(t)?r.filter((e=>e!==t)):[...r,t];if(0===o.length){const{[e]:t,...r}=n;return r}return{...n,[e]:o}}))}),[n,s,i]),g=(0,r.useCallback)((()=>{}),[]);return(0,ae.jsx)(ar.A,{searchValue:a,setSearchValue:l,setSearchQuery:g,searchResults:u,onAddFilter:h,onAddFilterWithValue:x,placeholder:"Search filters..."})})),dr=cr;var ur=n(24798);const hr=e=>{const t=(0,v.ID)(),n=`nodesView-${e}`,o=(0,z.l6)("addedFilters",{extraKey:n,flavour:"arr",defaultValue:[]});return(0,p.yF)((0,r.useCallback)((e=>{const r={},s=[...ur.RT,...o];[...new Set(s)].forEach((o=>{const s=e((0,z.GA)({key:t,extraKey:n,param:o,flavour:"arr"}));s?.length&&(r[o]=s)}));const i=e((0,z.GA)({key:t,extraKey:n,param:"selectedNodeIds",flavour:"arr"}));return i?.length&&(r.selectedNodeIds=i),r}),[t,n,o]))};var xr=n(64007),gr=n(5402),mr=n(68529),pr=n(21511);const fr=(0,r.memo)((e=>{let{id:t,label:n,value:o,onChange:s,onRemove:i,nodes:a,columnInfo:l}=e;const c=(0,r.useRef)(),d=(0,r.useRef)(),[u,h]=(0,r.useState)(o||[]);(0,r.useEffect)((()=>{h(o||[])}),[o]);const x=(0,r.useMemo)((()=>a?.map((e=>e.id))||[]),[a]),g=(0,pr.A)({param:t,paramKey:l?.paramKey,extraKey:"groupForm",isLabel:l?.isLabel,labelKey:l?.labelKey,nodeIds:x,nodes:a}),{isOpen:m,handleToggle:p,handleClose:f,handleCancel:j}=(0,mr.A)({pendingChangesRef:d}),b=u.length,v=(0,r.useMemo)((()=>{if(0===b)return"No selection";if(1===b){const e=g.find((e=>e.id===u[0]));return e?e.name:u[0]}return`${b} selected`}),[b,u,g]),y=g.length,C=g.filter((e=>e.count>0)).length,w=(0,r.useMemo)((()=>0===y?"":"Labels"===l?.category?`Label: ${l.labelKey} \u2022 ${C} values`:C===y?`${C} values`:`${C} out of ${y} values used`),[y,C,l]),I=(0,r.useCallback)((e=>{h(e),s(e)}),[s]),A=(0,r.useCallback)((e=>{e.stopPropagation(),h([]),s([])}),[s]);return(0,ae.jsx)(gr.A,{id:t,label:n,triggerRef:c,onToggle:p,isOpen:m,isEnabled:!0,stale:!1,subtitleText:v,isRequired:!1,onRemove:i,onCancel:j,onClose:f,onToggleEnabled:null,isDisabled:!1,selectedCount:b,description:w,onReset:A,resetDisabled:!u?.length,canHideZeros:!1,sortAction:null,filteredOptions:g,showActions:!1,children:(0,ae.jsx)(xr.Ay,{ref:d,param:t,baseKey:"groupForm",collection:g,getValue:e=>e.id,getLabel:e=>e.name||e.id,hasSearch:!0,multi:!0,placeholder:`Search ${n.toLowerCase()}...`,searchInputProps:{autoFocus:!0},noResultsMessage:`No ${n.toLowerCase()} found`,itemProps:{multi:!0,actualCountLabel:"nodes",stale:!1},extraKey:"groupForm",height:{max:"100%"},resizeable:!1,debounceDelay:0,batchMode:"event",value:u,onBatchApply:I})})})),jr=fr;var br=n(25764),vr=n(36893),yr=n(64082),Cr=n(75687),wr=n(32660);const Ir=(0,r.memo)((e=>{let{id:t,label:n,values:r,handleReset:o,min:s,max:i,draftRange:a,currentMin:l,currentMax:c,handleRangeChange:d,step:u,containerWidth:h,unit:x}=e;return(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(wr.A,{id:t,label:n,isEnabled:!0,handleToggleEnabled:null,isDisabled:!1,description:`Range: ${s}${x} - ${i}${x}`,onReset:o,resetDisabled:!r||0===r.length,resetTooltip:"Reset to full range"}),(0,ae.jsx)(oe.MultiRangeInput,{min:s,max:i,onChange:d,initMin:a?a[0]:l,initMax:a?a[1]:c,step:u,disabled:!1,padding:[4]},`${t}-${h}`)]})})),Ar={"hw.cpuFrequency":{getter:e=>e.hw?.cpuFrequency,unit:" MHz",decimals:2},"hw.cpus":{getter:e=>e.hw?.cpus,unit:"",decimals:0},"hw.memory":{getter:e=>e.hw?.memory,unit:" GB",decimals:2},"hw.diskSpace":{getter:e=>e.hw?.diskSpace,unit:" GB",decimals:2}},kr=(0,r.memo)((e=>{let{id:t,label:n,value:o,onChange:s,onRemove:i,nodes:a}=e;const l=(0,r.useRef)(),c=(0,r.useRef)(),d=(0,r.useRef)(),[u,h]=(0,r.useState)(null),[x,g]=(0,r.useState)(320),m=(0,r.useRef)(null),{min:p,max:f,step:j,decimalPoints:b,unit:v}=(0,r.useMemo)((()=>{const e=Ar[t];if(!e||!a||0===a.length)return{min:0,max:100,step:1,decimalPoints:0,unit:""};let n=1/0,r=-1/0;if(a.forEach((t=>{const o=e.getter(t);if(void 0!==o&&null!==o){const e=parseFloat(o);isNaN(e)||(n=Math.min(n,e),r=Math.max(r,e))}})),n===1/0||r===-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(n),max:Math.ceil(r),step:o,decimalPoints:e.decimals,unit:e.unit}}),[a,t]),y=o||[],C=void 0!==y[0]?1*y[0]:p,w=void 0!==y[1]?1*y[1]:f,{isOpen:I,handleToggle:A,handleClose:k,handleCancel:S}=(0,mr.A)({pendingChangesRef:c,onOpen:()=>h(y.length>0?[...y]:null)}),T=(0,r.useCallback)((e=>{let{min:t,max:n}=e;h([t,n])}),[]),F=(0,r.useMemo)((()=>{if(!y||0===y.length)return"Full range";const e=1*y[0],t=1*y[1],n=e=>b>0?e.toFixed(b):e.toString();return`${n(e)}${v} - ${n(t)}${v}`}),[y,b,v]),N=(0,r.useCallback)((()=>{s([])}),[s]);return(0,r.useEffect)((()=>{if(!I||!d.current)return;return m.current=new ResizeObserver((e=>{for(const t of e){const e=t.contentRect.width;Math.abs(e-x)>5&&g(e)}})),m.current.observe(d.current),()=>{m.current&&m.current.disconnect()}}),[I,x]),(0,r.useEffect)((()=>{c.current={hasPendingChanges:u&&(u[0]!==C||u[1]!==w),applyChanges:()=>{u&&(u[0]===p&&u[1]===f?s([]):s(u),h(null))},cancelChanges:()=>{h(null)}}}),[u,C,w,p,f,s]),(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsxs)(br.A,{children:[(0,ae.jsx)(vr.A,{triggerRef:l,onClick:A,testId:`dropdown-filter-${t}`,isOpen:I,isEnabled:!0,stale:!1,label:n,subtitle:F}),(0,ae.jsx)("div",{className:"remove-button-wrapper",children:(0,ae.jsx)(Cr.A,{onRemove:i,tooltip:`Remove ${n} filter`})})]}),(0,ae.jsx)(yr.A,{isOpen:I,targetRef:l.current,onEsc:S,onClickOutside:k,width:{base:"320px",min:"280px",max:"500px"},height:{base:"100px",min:"100px",max:"300px"},wrapperRef:d,children:(0,ae.jsx)(Ir,{id:t,label:n,values:y,handleReset:N,min:p,max:f,draftRange:u,currentMin:C,currentMax:w,handleRangeChange:T,step:j,containerWidth:x,unit:v})})]})})),Sr=kr,Tr=(0,r.memo)((e=>{let{nodes:t,value:n=[],onChange:o,onRemove:s}=e;const i=(0,r.useRef)(),a=(0,r.useRef)(),{isOpen:l,handleToggle:c,handleClose:d,handleCancel:u}=(0,mr.A)({pendingChangesRef:a}),h=(0,r.useMemo)((()=>t?.length?t.map((e=>({id:e.id,name:e.name||e.id}))):[]),[t]),x=n?.length||0,g=(0,r.useMemo)((()=>{if(0===x)return"No selection";if(1===x){const e=t?.find((e=>e.id===n[0]));return e?.name||n[0]}return`${x} node${1===x?"":"s"} selected`}),[x,n,t]),m=(0,r.useCallback)((e=>{o(e||[])}),[o]),p=(0,r.useCallback)((e=>{e.stopPropagation(),o([])}),[o]);return n?.length?(0,ae.jsx)(gr.A,{id:"selectedNodeIds",label:"Selected Nodes",triggerRef:i,onToggle:c,isOpen:l,isEnabled:!0,stale:!1,subtitleText:g,isRequired:!1,onRemove:s,onCancel:u,onClose:d,onToggleEnabled:null,isDisabled:!1,selectedCount:x,description:`${x||"No"} node${1===x?"":"s"} explicitly selected`,onReset:p,resetDisabled:!n?.length,canHideZeros:!1,sortAction:null,filteredOptions:h,showActions:!1,children:(0,ae.jsx)(xr.Ay,{ref:a,param:"selectedNodeIds",baseKey:"groupForm",collection:h,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:n,onBatchApply:m})}):null})),Fr=Tr,Nr=e=>{let{isNew:t}=e;return(0,ae.jsxs)(oe.Flex,{as:"span",gap:1,children:["Manage room",(0,ae.jsx)(oe.TextBig,{color:"textLite",children:"/"}),(0,ae.jsxs)(oe.TextBig,{color:"textLite",children:[t?"Create":"Edit"," Group"]})]})},Mr=[{value:"servers",label:"Servers"},{value:"snmp",label:"Network Devices"}],Lr=e=>{let{id:t,onClose:n,allNodes:o,tabId:s,preselectedNodeId:i,...a}=e;const l=(0,v.ID)(),c="new"===t,d=(0,fe.oH)(l,c?null:t),u=(0,fe.oH)(l,(0,je.b5)(s)?null:s),h=(0,fe.rK)(l),x=(0,fe.EP)(l),g=hr(s),m=(0,r.useMemo)((()=>o.some(je.ZH)),[o]),[p,f]=(0,r.useState)((()=>{if(c){const e=(0,qn.AK)(s,u),t=g(),{selectedNodeIds:n,...r}=t;let o=n||[];return i&&!o.includes(i)&&(o=[i,...o]),{...sr.$e,filters:r,selectedNodeIds:o,metricsType:e}}return{...sr.$e,...d}}));(0,r.useEffect)((()=>{!c&&d?.id&&f({...sr.$e,...d})}),[c,d]);const{name:j,metricsType:b,filters:y,selectedNodeIds:C}=p,w=m||!c&&"snmp"===b,I=(0,r.useMemo)((()=>(0,lt.KN)(y)||(0,lt.OS)(C)?o.filter((e=>(0,lt.BW)(e,y,C))).length:0),[o,y,C]),A=(0,r.useCallback)((e=>{let{target:{value:t}}=e;t.length<=30&&f((e=>({...e,name:t})))}),[]),k=(0,r.useCallback)((e=>{f((t=>({...t,metricsType:e?.value||"servers"})))}),[]),S=(0,r.useCallback)((e=>{f((t=>{const n={...t.filters};return delete n[e],{...t,filters:n}}))}),[]),T=(0,r.useCallback)(((e,t)=>{f((n=>({...n,filters:{...n.filters,[e]:t}})))}),[]),F=(0,r.useCallback)((e=>{f((t=>({...t,filters:"function"===typeof e?e(t.filters):e})))}),[]),N=(0,r.useCallback)((e=>{f((t=>({...t,selectedNodeIds:e||[]})))}),[]),M=(0,r.useCallback)((()=>{f((e=>({...e,selectedNodeIds:[]})))}),[]),L=(0,r.useCallback)((async()=>{const e={...p,name:p.name.trim()};c?await h(e):await x({...e,id:t}),n()}),[p,c,t,h,x,n]),$=j.trim().length>0&&((0,lt.KN)(y)||(0,lt.OS)(C)),D=(0,r.useMemo)((()=>Mr.find((e=>e.value===b))||Mr[0]),[b]),R=(0,r.useMemo)((()=>Object.entries(y||{})),[y]);return(0,ae.jsxs)(we.GO,{onClose:n,...a,children:[(0,ae.jsx)(Ie.z,{onClose:n,title:(0,ae.jsx)(Nr,{isNew:c}),children:(0,ae.jsx)(oe.Button,{label:"Save",onClick:L,disabled:!$,"data-testid":"groupForm-save"})}),(0,ae.jsx)(Ae.U,{children:c?"Create a new node group":"Edit node group"}),(0,ae.jsx)(we.Yv,{children:(0,ae.jsxs)(oe.Flex,{gap:6,column:!0,children:[(0,ae.jsx)(ir,{title:"Group Name","data-testid":"groupForm-name",children:(0,ae.jsx)(oe.TextInput,{name:"name",placeholder:"Enter group name",value:j,onChange:A})}),w&&(0,ae.jsx)(ir,{title:"Column Configuration",disclaimer:"Choose which column set to display for nodes in this group","data-testid":"groupForm-metricsType",children:(0,ae.jsx)(oe.Select,{options:Mr,value:D,onChange:k,"data-testid":"groupForm-metricsTypeSelect"})}),(0,ae.jsx)(ir,{title:"Filters",disclaimer:(0,lt.KN)(y)||(0,lt.OS)(C)?0===I?"No nodes match the current filters":`${I} node${1===I?"":"s"} will appear in this group`:"Add at least one filter to create a group",disclaimerColor:I>0?"accent":"textLite","data-testid":"groupForm-filters",children:(0,ae.jsxs)(oe.Flex,{gap:2,flexWrap:"wrap",alignItems:"center",children:[R.map((e=>{let[t,n]=e;const r=(e=>{if(e.startsWith("label.")){const t=e.replace("label.","");return{name:t,type:"dropdown",isLabel:!0,labelKey:t}}return lr[e]||{name:e,type:"dropdown"}})(t);return"range"===r.type?(0,ae.jsx)(Sr,{id:t,label:r.name,value:n,onChange:e=>T(t,e),onRemove:()=>S(t),nodes:o},t):(0,ae.jsx)(jr,{id:t,label:r.name,value:n,onChange:e=>T(t,e),onRemove:()=>S(t),nodes:o,columnInfo:r},t)})),(0,ae.jsx)(Fr,{nodes:o,value:C,onChange:N,onRemove:M}),(0,ae.jsx)(dr,{filters:y,onFiltersChange:F,nodes:o,selectedNodeIds:C,onSelectedNodeIdsChange:N})]})})]})})]})},$r=["config"],Dr=()=>{const e=(0,b.vt)(),t=(0,v.ID)(),n=(0,D.nj)(),o=(0,ee.Hn)(),s=(0,E.dG)(),i=(0,fe.Jk)(t),a=(0,qn.rK)(s,t),l=(0,r.useMemo)((()=>(0,je.b5)(s)?i.filter((e=>e.metricsType===a)):[]),[i,a,s]),c=ht(s,l),d=(0,V.Cq)(t,s),u=(0,E.TL)(),h=(0,_.w7)({extraKey:`nodesView-${s}`,merge:!1,scoped:!0}),g=(0,E.Gt)(),m=(0,qn.On)(s,t),p=(0,r.useMemo)((()=>g.reduce(((e,t)=>(m(t)||e.push(t.id),e)),[])),[m,g]),f=(0,E.Y7)(),[j,{width:y}]=(0,P.A)(),C=(0,te.K)({spaceId:e,roomId:t}),[w,I,A]=Q(h,t,{shouldHide:rt.f9?m:void 0,cacheKey:s,extraKey:`nodesView-${s}`});!function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],{host:n,width:o,tabId:s="servers",flavour:i="nodesView"}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const a=(0,Gt.eg)(),l=(0,r.useMemo)((()=>{if(!a)return;let r=Ut(a,e);if(r)return r;o&&(r=a.makeContainer({attributes:{host:n,enabledXAxis:!1,id:`nodes-${e}`,height:"75px",groupingMethod:"average",groupBy:["dimension"],aggregationMethod:"avg",legend:!1,axisLabelFontSize:7,yAxisLabelWidth:20,hasYlabel:!1,nodesScope:t,containerWidth:o}}),a.appendChild(r))}),[e,s,o]),{favoriteNodeIds:c}=qt(i,s),d=(0,Se.vh)(e,s);(0,r.useMemo)((()=>{if(!rt.f9)return;if(!l||!t?.length&&!c?.length)return;const e=d.reduce(((e,t)=>{if(!t.context)return e;const n=t.aggregation||"sum";return e[n]||(e[n]=new Set),e[n].add(t.context),e}),{});[...t,...c].forEach((t=>{Object.entries(e).forEach((e=>{let[n,r]=e;const o=`table-metrics-${t}-${n}`;let s=l.getNode({id:o});if(s&&(i=new Set(s.getAttribute("contextScope")),c=r,i.size===c.size&&[...i].every((e=>c.has(e)))))return;var i,c;s?.destroy();const d=Array.from(r);0!==d.length&&(s=a.makeChart({attributes:{id:o,contextScope:d,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,n,a,s,o,d])}(t,w,{host:C,width:y,tabId:s,flavour:"nodesView"});const[k,S]=(0,z.N9)("nodeIdToGo",{key:t,extraKey:"nodesView",flavour:"val"}),T=(0,r.useCallback)((e=>{u(e)}),[u]),[F,N]=(0,r.useState)(null),[M,L]=(0,r.useState)(null),$=(0,r.useCallback)((()=>{L(null),N("new")}),[]),R=(0,r.useCallback)((e=>{L(e),N("new")}),[]),B=(0,r.useCallback)((e=>{L(null),N(e)}),[]),H=(0,r.useCallback)((()=>{N(null),L(null)}),[]),K=(0,r.useCallback)((function(e,t){return function(e,t){let{getGrouping:n,extraKey:r,searchScores:o,groupMode:s}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i={},a={};((e,t)=>{let{getNode:n,getGrouping:r,nodeMenus:o,menusById:s,searchScores:i}=t;e.forEach((e=>{const t=n(e);if(!t)return;const{name:s,priority:i,icon:a}=r(t);o[e]={...t,groupId:s,subMenuId:e,priority:i,groupIcon:a}})),[...e].sort(((e,t)=>{const n=i?.[e]||0,r=i?.[t]||0;if(r!==n)return r-n;const s=(o[e]?.priority||0)-(o[t]?.priority||0);if(0!==s)return s;const a=(o[e]?.groupId||"").localeCompare(o[t]?.groupId||"",void 0,{sensitivity:"accent",ignorePunctuation:!0});return 0!==a?a:(o[e]?.name||"").localeCompare(o[t]?.name||"",void 0,{sensitivity:"accent",ignorePunctuation:!0})})).forEach((e=>{const t=o[e];if(!t)return;const n=`${t.groupId}|${t.subMenuId}`;s[t.groupId]||(s[t.groupId]={byId:{},nodeIds:[]}),s[t.groupId].byId[n]||(s[t.groupId].byId[n]={byId:{},nodeIds:[]}),s[t.groupId].byId[n].nodeIds.push(t.id),s[t.groupId].nodeIds.push(t.id)}))})(e,{getNode:t,getGrouping:n,nodeMenus:i,menusById:a,searchScores:o});const l=Object.keys(a).reduce(((e,t)=>{const{nodeIds:n}=a[t],o=i[n[0]];return e[t]={level:0,name:o.groupId,id:t,childrenIds:n,link:`${(0,tt.A)(`menu_${t}`)}`,size:24,forceVisibility:!0,icon:o.groupIcon,extraKey:r,styleProps:{important:!1,grouping:!0}},n.forEach((n=>{const o=i[n],s=nt.u[o.os?.nm||o.labels?.os_name]||nt.U[o.os?.id]||nt.u[o.labels?.vendor];e[n]={...o,level:1,id:n,menuId:t,link:`${(0,tt.A)(`menu_${t}_submenu_${n}`)}`,size:24,forceVisibility:!0,icon:s?.iconName||s?.logoFilename&&`${x.A.assetsBaseURL}/img/logos/os/${s.logoFilename}`||"os",extraKey:r}})),e}),{}),c=Object.keys(a);let d=-1;const u=c.reduce(((e,t)=>{if(d+=1,!rt.f9){const n={...l[t],sticky:!0};return[...e,n,...l[t].childrenIds.reduce(((e,t)=>(d+=1,[...e,l[t]])),[])]}return s?[...e,{...l[t],isGroup:!0,children:l[t].childrenIds.reduce(((e,t)=>(d+=1,[...e,l[t]])),[])}]:[...e,...l[t].childrenIds.reduce(((e,t)=>(d+=1,[...e,l[t]])),[])]}),[]);return i=null,a=null,{stickyIds:{},allElements:u,menuIds:c,menuById:l}}(e,t,{...arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},searchScores:I})}),[I]);return(0,ae.jsx)(ne.A,{getObject:f,ids:w,getMenu:K,getGrouping:c,groupMode:d,deps:[c,I,s,d,l],extraKey:"nodesView",children:(0,ae.jsx)(O.A,{ref:j,position:"relative",sidebar:(0,ae.jsx)(re.Ay,{hiddenTabs:$r,nodeIds:p,title:"Nodes",initialChartName:k,viewFlavour:"nodesView",flavour:`nodesView-${s}`,loaded:!0,FilterInputContainer:xe,extraKey:`nodesView-${s}`}),children:!!y&&(0,ae.jsxs)(ae.Fragment,{children:[!rt.f9&&(0,ae.jsx)(et,{}),!rt.f9&&n&&!w.length&&h.length?(0,ae.jsx)(pe,{}):rt.f9&&o?(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsxs)(rr,{allNodes:g,activeTabId:s,onTabChange:T,nodesCount:A,onCreateGroup:$,onEditGroup:B,children:[(0,ae.jsx)(or,{tabId:s,filteredIds:w,totalCount:A}),(0,ae.jsx)(Xn,{nodeIdsLoaded:n,nodeIds:w,tabNodeIds:p,initialChartName:k,onChartNameChange:S,tabId:s,flavour:"nodesView",onCreateGroup:$,onCreateGroupWithNode:R,matchingGroups:l})]}),rt.xH&&F&&(0,ae.jsx)(Lr,{id:F,onClose:H,allNodes:g,tabId:s,preselectedNodeId:M})]}):(0,ae.jsx)(un,{initialChartName:k,onChartNameChange:S})]})})})},Rr=()=>{const e=(0,v.ID)(),t=(0,D.CK)();return(0,D.gr)(e,"loaded")&&!t.length?(0,ae.jsx)(B.Ay,{feature:"NodesView",mode:"NoNodesView",children:(0,ae.jsx)(R.A,{})}):(0,ae.jsx)(B.Ay,{feature:"NodesView",children:(0,ae.jsx)(Dr,{})})},Br=()=>{const e=(0,E.nl)(),t=(0,E.xY)(e,"name");return(0,T.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 Pr=n(258);var Or=n(98545),Vr=n(6196),Er=n(1705),_r=n(2626),Hr=n(41716),zr=n(65448);const Kr=function(e,t){let{polling:n=!0}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const o=(0,p.yF)((0,r.useCallback)((function(e,n){let{data:r=[]}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n((0,Hr.t)({id:t,key:"ids"}),r.map((e=>e.id))),n((0,Hr.t)({id:t,key:"loaded"}),!0),n((0,Hr.t)({id:t,key:"updatedAt"}),(new Date).toISOString()),n((0,Hr.t)({id:t,key:"error"}),null),n(Vr.Ay,(e=>r.reduce(((e,t)=>(e[t.id]={...e[t.id],loaded:!0,...t},e)),e)));const o=r.reduce(((e,t)=>{let{id:n,nodeId:r}=t;return e[r]=[...e[r]||[],n],e}),{});n(_r.l3,o)}),[e,t])),s=(0,p.yF)((0,r.useCallback)(((e,n,r)=>{n((0,Hr.t)({id:t,key:"error"}),(0,zr.A)(r))}),[]));(0,j.A)((()=>({enabled:!!e&&!!t,polling:n,pollingOptions:{checkPauseCondition:M},fetch:()=>(0,Er.l1)(e,t),onFail:s,onReceive:o,force:!0})),[e,t])},Gr=function(e,t){let{polling:n=!0}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const o=(0,p.yF)((0,r.useCallback)((function(n,r){let{data:o=[]}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r((0,Vr.xz)({spaceId:e,roomId:t}),(e=>({...e,loaded:!0,value:o,updatedAt:(new Date).toISOString(),error:null})))}),[e,t])),s=(0,p.yF)((0,r.useCallback)(((n,r,o)=>{r((0,Vr.xz)({spaceId:e,roomId:t}),(e=>({...e,loaded:!0,error:(0,zr.A)(o)})))}),[]));(0,j.A)((()=>({enabled:!!e&&!!t,polling:n,pollingOptions:{checkPauseCondition:M},fetch:()=>(0,Er.qM)(e,t),onFail:s,onReceive:o,force:!0})),[e,t])};var Wr=n(6387),qr=n(65380);const Ur=e=>t=>`histogram::${e.getAttribute("id")}::${t}`,Jr=e=>{let{container:t,...n}=e;const o=(0,Gt.eg)(),s=(0,r.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:Ur}),t.appendChild(e),e)}),[t]);return(0,r.useEffect)((()=>()=>s&&s.destroy()),[s]),(0,ae.jsx)(oe.Flex,{flex:!1,width:"100%",height:5,position:"sticky",bottom:"0",left:"0",right:"0",children:(0,ae.jsx)(Xt.A,{"data-chartid":"dummy-chart",chart:s,overflow:"hidden",hasHeader:!1,hasFooter:!1,hasFilters:!1,tile:!1,...n,round:0})})};var Zr=n(55093),Xr=n(77148),Yr=n(38773);const Qr=()=>(0,ae.jsxs)(oe.Flex,{padding:[6],round:1,width:"600px",background:"modalInfoBackground",children:[(0,ae.jsx)(oe.Box,{margin:[0,4,0,0],children:(0,ae.jsx)(oe.Box,{as:oe.Icon,width:10,height:10,name:"nodes_update"})}),(0,ae.jsxs)(oe.Flex,{column:!0,gap:2,children:[(0,ae.jsx)(oe.Text,{strong:!0,children:"Couldn't find the chart you were looking for? "}),(0,ae.jsxs)(oe.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,ae.jsx)(ge.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."]})]})]}),eo=()=>(0,ae.jsxs)(oe.Flex,{width:"100%",column:!0,gap:6,margin:[8,0,0,0],children:[(0,ae.jsx)(Xr.A,{}),(0,ae.jsxs)(oe.Flex,{gap:1,alignItems:"center",justifyContent:"center",padding:[2],background:"successSemi",children:[(0,ae.jsx)(Ln.A,{children:(0,ae.jsx)(oe.Text,{color:"primary",children:"Upgrade to Business for unlimited access"})}),(0,ae.jsx)(oe.Text,{children:"or"}),(0,ae.jsx)(Yr.A,{children:(0,ae.jsx)(oe.Text,{color:"primary",children:"review your Space active Nodes"})})]})]}),to=e=>{let{noPreferredNodesError:t,children:n}=e;return(0,ae.jsxs)(oe.Flex,{column:!0,flex:!0,justifyContent:"center",alignItems:"center",alignSelf:"center",children:[(0,ae.jsxs)(oe.Flex,{column:!0,justifyContent:"center",alignItems:"center",width:"300px",margin:[0,0,6],children:[(0,ae.jsx)(oe.H3,{margin:[0,0,4],children:"No charts to display"}),(0,ae.jsx)(oe.Text,{color:"textDescription",textAlign:"center",children:"Double-check your search or filters and dates and try again with different conditions."})]}),(0,ae.jsx)(Qr,{}),t&&(0,ae.jsx)(eo,{}),n]})};var no=n(93997);const ro=()=>{const[e,t]=(0,no.sK)(),n=(0,v.ID)(),o=(0,b.vt)(),s=(0,_.w7)(),i=(0,r.useCallback)((0,ce.s)(300,(e=>{const r=e.target.value;t(r),(0,se.H)("toc-search","search-automatic-trigger","charts-view",r),r&&(0,Pr.Xx)(n,r,{selectedNodes:s,spaceId:o}).then((e=>{console.log("Context search results:",e)})).catch((e=>{console.error("Context search error:",e)}))})),[n,o,s]),[a,l,,,{resetValue:c}]=(0,oe.useInputValue)({value:e,onChange:i}),d=(0,r.useCallback)((()=>{t(""),c(),(0,se.H)("toc-search","clear-search-button","charts-view")}),[]);return(0,ae.jsx)(oe.TextInput,{value:a,onChange:l,size:"small",iconRight:a&&(0,ae.jsx)(oe.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 oo=n(61841);const so=(0,ce.s)(300,((e,t)=>(0,se.H)("toc-search","search-results","charts-view",e,`${t} -- charts`))),io=()=>{const e=(0,f.Zp)(),[t]=(0,oo.Ay)(),n=(0,no.Um)(),{filteredChartsCount:o,chartsCount:s}=(0,no.Ad)();(0,r.useEffect)((()=>{n&&so(n,o)}),[n,o]);const i=(0,r.useCallback)((n=>{n.preventDefault(),e(`/spaces/${t}/settings/configurations`,{replace:!0})}),[t,e]);return(0,ae.jsxs)(oe.Flex,{alignItems:"center",justifyContent:"between",width:"100%",children:[(0,ae.jsxs)(oe.TextMicro,{color:"textLite",margin:[1,0,0],"data-testid":"numberOfChartsIndication",children:["Showing"," ",(0,ae.jsx)(oe.TextMicro,{strong:!0,color:"textDescription","data-testid":"numberOfChartsIndication-filteredChartsCount",children:o})," ","of total"," ",(0,ae.jsx)(oe.TextMicro,{strong:!0,color:"textDescription","data-testid":"numberOfChartsIndication-chartsCount",children:s})," ","charts"]}),(0,ae.jsx)(ge.A,{Component:oe.TextMicro,margin:[1,0,0],"data-ga":`toc-search::click-link-collectors::${name}`,onClick:i,target:"_blank",rel:"noopener noreferrer",children:"Add more charts"})]})},ao=()=>{const{filteredChartsCount:e}=(0,no.Ad)();return e||null===e?null:(0,ae.jsxs)(oe.Flex,{width:"100%",gap:1,margin:[4,0,0],padding:[2],alignItems:"center","data-testid":"noResultsWereFound",children:[(0,ae.jsx)(oe.Icon,{name:"information",color:"textDescription"}),(0,ae.jsx)(oe.TextMicro,{strong:!0,color:"textDescription",children:"No results were found"})]})};var lo=n(14512);const co=()=>(0,ae.jsxs)(oe.Flex,{column:!0,alignItems:"center",children:[(0,ae.jsx)(ro,{}),(0,ae.jsx)(io,{}),(0,ae.jsx)(lo.A,{}),(0,ae.jsx)(ao,{})]}),uo=e=>{let{width:t=443,height:n=249,videoId:r,...o}=e;return(0,ae.jsx)(oe.Flex,{...o,children:(0,ae.jsx)(oe.Box,{className:"video-responsive",children:(0,ae.jsx)("iframe",{width:t,height:n,src:`https://www.youtube.com/embed/${r}`,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,title:"Embedded youtube"})})})};var ho=n(58218),xo=n(14815);const go=()=>{const e=(0,v.ID)(),t=(0,g.JT)("node:Create");return(0,ae.jsxs)(O.A,{column:!1,"data-testid":"noNodesViewPage",gap:12,padding:[6],children:[(0,ae.jsxs)(oe.Flex,{column:!0,gap:5,flex:{shrink:0,grow:0},"data-testid":"noKubernetesView-videoSection",children:[(0,ae.jsx)(uo,{"data-testid":"noNodesView-onboardingVideo",height:350,width:850,videoId:$e.BX[0]}),(0,ae.jsx)(uo,{"data-testid":"noNodesView-onboardingVideo",height:350,width:850,videoId:$e.BX[1]})]}),(0,ae.jsxs)(oe.Flex,{column:!0,gap:4,children:[(0,ae.jsxs)(oe.Box,{border:{side:"bottom",color:"borderSecondary"},children:[(0,ae.jsx)(oe.Box,{margin:[0,0,2,0],children:(0,ae.jsx)(ge.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,ae.jsx)(oe.TextBig,{color:"primary",children:"Kubernetes monitoring with Netdata: Overview and visualizations"})})}),(0,ae.jsx)(oe.Box,{margin:[0,0,2,0],children:(0,ae.jsx)(ge.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,ae.jsx)(oe.TextBig,{color:"primary",children:"Kubernetes visualizations"})})})]}),(0,ae.jsx)(oe.Flex,{column:!0,gap:4,children:t?(0,ae.jsx)(ho.A,{integrationId:xo.v2,rooms:[e]}):(0,ae.jsx)(R.S,{})})]})]})};var mo=n(67012),po=n(77611);const fo=mn.default.div.withConfig({displayName:"selections__Separator",componentId:"sc-1cc7y18-0"})(["width:1px;height:",";background:",";"],(0,oe.getSizeBy)(2.5),(0,oe.getColor)("borderSecondary")),jo=[{label:"Volume",value:"volume"},{label:"KS2",value:"ks2"}],bo=[{label:"Average",value:"average"},{label:"Median",value:"median"},{label:"Min",value:"min"},{label:"Max",value:"max"},{label:"Stddev",value:"stddev"}],vo=[{label:"Metrics",value:""},{label:"Anomaly Rate",value:"anomaly-bit"}],yo=()=>(0,ae.jsxs)(oe.Flex,{column:!0,gap:1,alignItems:"center",width:"220px",children:[(0,ae.jsx)(oe.TextMicro,{children:"Choose the algorithm you want to be used to identify correlations across metrics:"}),(0,ae.jsxs)(oe.TextMicro,{children:[(0,ae.jsx)(oe.TextMicro,{strong:!0,children:"KS2:"})," A statistical test comparing the distribution of the highlighted window to the baseline."]}),(0,ae.jsxs)(oe.TextMicro,{children:[(0,ae.jsx)(oe.TextMicro,{strong:!0,children:"Volume:"})," Percentage change in averages between highlighted window and baseline."]})]}),Co=()=>(0,ae.jsx)(oe.Flex,{column:!0,gap:1,alignItems:"center",width:"220px",children:(0,ae.jsx)(oe.TextMicro,{children:"What aggregation function do you want to apply when aggregating multiple datapoints for metric correlations."})}),wo=()=>(0,ae.jsx)(oe.Flex,{column:!0,gap:1,alignItems:"center",width:"220px",children:(0,ae.jsx)(oe.TextMicro,{children:"Do you want to find correlations over the metric values or the anomaly rates of each metric."})}),Io=e=>{let{runGetWeights:t,nodeIds:n,flavour:o}=e;const{method:s,options:i,group:a}=(0,po.G9)({nodeIds:n,flavour:o}),l=i?.includes(vo[1].value)?vo[1].value:"",c=(0,r.useCallback)((e=>n=>{let{value:r}=n;r="options"!==e?r:r?[r]:[];t({method:s,options:[i],group:a,[e]:r})}),[s,i,a]),d=(0,r.useMemo)((()=>({method:jo.find((e=>e.value===s)),group:bo.find((e=>e.value===a)),option:vo.find((e=>e.value===l))})),[s,a,l]);return a?(0,ae.jsxs)(oe.Flex,{gap:2,children:[(0,ae.jsxs)(oe.Flex,{gap:1,alignItems:"center",children:[(0,ae.jsx)(oe.TextSmall,{color:"textLite",children:"Method:"}),(0,ae.jsx)(oe.Select,{options:jo,value:d.method,onChange:c("method")}),(0,ae.jsx)(_e.A,{isBasic:!0,plain:!0,content:yo,align:"bottom",children:(0,ae.jsx)(oe.Icon,{name:"information",color:"textDescription",size:"small"})})]}),(0,ae.jsx)(fo,{}),(0,ae.jsxs)(oe.Flex,{gap:1,alignItems:"center",children:[(0,ae.jsx)(oe.TextSmall,{color:"textLite",children:"Aggregation:"}),(0,ae.jsx)(oe.Select,{options:bo,value:d.group,onChange:c("group")}),(0,ae.jsx)(_e.A,{isBasic:!0,plain:!0,content:Co,align:"bottom",children:(0,ae.jsx)(oe.Icon,{name:"information",color:"textDescription",size:"small"})})]}),(0,ae.jsx)(fo,{}),(0,ae.jsxs)(oe.Flex,{gap:1,alignItems:"center",children:[(0,ae.jsx)(oe.TextSmall,{color:"textLite",children:"Data:"}),(0,ae.jsx)(oe.Select,{options:vo,value:d.option,onChange:c("options")}),(0,ae.jsx)(_e.A,{isBasic:!0,plain:!0,content:wo,align:"bottom",children:(0,ae.jsx)(oe.Icon,{name:"information",color:"textDescription",size:"small"})})]}),(0,ae.jsx)(fo,{})]}):null};var Ao=n(64587);const ko=e=>{let{highlightAfter:t,highlightBefore:n,baseline:r}=e;const{localeDateString:o,localeTimeString:s}=(0,Ao.$j)(),i=new Date(t),a=new Date(n),l=new Date(r),c=new Date(t),d=Math.round((n-t)/1e3),u=Math.round((t-r)/1e3),h=(0,z.rI)("highlight");return(0,ae.jsxs)(oe.Flex,{gap:4,alignItems:"center",children:[(0,ae.jsxs)(oe.Flex,{gap:2,children:[(0,ae.jsxs)(oe.Flex,{column:!0,gap:1,children:[(0,ae.jsx)(oe.TextSmall,{color:"textLite",children:"Selected area:"}),(0,ae.jsx)(oe.TextSmall,{color:"textLite",children:"Reference baseline:"})]}),(0,ae.jsxs)(oe.Flex,{column:!0,gap:1,children:[(0,ae.jsxs)(oe.TextSmall,{"data-testid":"metricCorrelation-selectedArea",children:[o(i,{long:!1}),","," ",s(i),"\xa0->\xa0",o(a,{long:!1}),","," ",s(a)]}),(0,ae.jsxs)(oe.TextSmall,{"data-testid":"metricCorrelation-referenceBaseline",children:[o(l,{long:!1}),","," ",s(l),"\xa0->\xa0",o(c,{long:!1}),","," ",s(c)]})]}),(0,ae.jsxs)(oe.Flex,{column:!0,gap:1,children:[(0,ae.jsx)(oe.TextSmall,{color:"textLite",children:"Duration:"}),(0,ae.jsx)(oe.TextSmall,{color:"textLite",children:"Duration:"})]}),(0,ae.jsxs)(oe.Flex,{column:!0,gap:1,children:[(0,ae.jsxs)(oe.TextSmall,{"data-testid":"metricCorrelation-selecteArea-duration",children:[d,"\xa0secs"]}),(0,ae.jsxs)(oe.TextSmall,{"data-testid":"metricCorrelation-referenceBaseline-duration",children:[u,"\xa0secs"]})]})]}),(0,ae.jsx)(_e.A,{content:"Clear selection",align:"bottom",isBasic:!0,children:(0,ae.jsx)(oe.Button,{neutral:!0,flavour:"borderless",icon:"trashcan",onClick:()=>{h({after:null,before:null})},"data-ga":"metric-correlation::click-delete::charts-view","data-testid":"metricCorrelation-delete"})})]})},So=(0,Je.A)(oe.Button),To=(0,mn.default)(oe.Button).withConfig({displayName:"correlation__LogoButton",componentId:"sc-15d72m3-0"})(["&&{pointer-events:none;}"]),Fo=(0,mn.default)(oe.Button).withConfig({displayName:"correlation__CloseButton",componentId:"sc-15d72m3-1"})(["position:absolute !important;top:-3px;right:-3px;"]),No=(0,Je.A)(Fo),Mo=(0,mn.default)(oe.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;}"]),Lo=e=>{let{flavour:t}=e;const n=(0,b.vt)(),o=(0,v.ID)(),s=(0,E.nl)(),i=(0,r.useMemo)((()=>s?[s]:[]),[s]),a=(0,_.w7)({extraKey:"nodesView",merge:!1,scoped:!0}),l="singleNode"===t?i:a,[c,d]=(0,r.useState)(!1),[u,h]=(0,r.useState)(),{threshold:x,totalDimensionsCount:g,dimensionsCount:m,loaded:p,loading:f,getWeights:j,resetWeights:y}=(0,po.Yy)({nodeIds:l,flavour:t},n,o),{method:C,options:w,group:I}=(0,po.G9)({nodeIds:l,flavour:t}),{after:A,before:k}=(0,z.rW)("highlight"),S=A-4*(k-A),T=!!A;(0,r.useEffect)((()=>{if(p){let e="default-result";if(I){const t=w?.includes("anomaly-bit")?"anomaly-bit":"metrics";e=`default-result-${C}-${I}-${t}`}return(0,se.H)("metrics-correlation",e,"charts-view",m.toString())}}),[p]),(0,mo.A)((()=>{A&&d(!0)}),[A]);const F=(0,z.rI)("correlation"),N=(0,z.rI)("threshold"),M=(0,z.rI)("highlight"),L=(0,r.useCallback)((()=>{F(!1),M({after:null,before:null}),N(po.UG),y(),(0,se.H)("metrics-correlation","click-close","charts-view",""+(p?"finish":"start"))}),[F,M,N,y,p]),$=(0,r.useCallback)((()=>{N(po.UG),y(),(0,se.H)("metrics-correlation","click-delete","charts-view",""+(p?"finish":"start"))}),[N,y,p]),D=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};d(!1),h(),j({highlightAfter:A,highlightBefore:k,baselineAfter:S,baselineBefore:A,method:C,options:w,group:I,nodeIds:l,...e}).then((()=>N(po.UG)))},R=!T||f;return(0,mo.A)((()=>{p&&c&&T&&D()}),[p,T,c]),(0,r.useEffect)((()=>()=>y()),[]),(0,ae.jsxs)(oe.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:[T?p?(0,ae.jsx)(B._0,{feature:"MetricCorrelations",totalDimensionsCount:g,dimensionsCount:m,children:(0,ae.jsxs)(oe.Flex,{"data-testid":"metricCorrelation-resultsContainer",column:!0,width:"100%",children:[(0,ae.jsxs)(oe.Flex,{justifyContent:"between",alignItems:"center",gap:1,children:[(0,ae.jsxs)(oe.Flex,{alignItems:"center",gap:1,children:[(0,ae.jsx)(oe.Icon,{name:"correlation",color:"primary",width:"16px",height:"16px"}),(0,ae.jsxs)(oe.TextSmall,{children:["Analysed"," ",(0,ae.jsx)(oe.TextSmall,{color:"primary","data-testid":"metricCorrelation-resultsAnalyzed",children:g})," ","and found"," ",(0,ae.jsx)(oe.TextSmall,{color:"primary","data-testid":"metricCorrelation-resultsFound",children:m})," ","correlated metrics."]}),(0,ae.jsx)(_e.A,{content:"Clear results",children:(0,ae.jsx)(Mo,{flavour:"borderless",neutral:!0,disabled:f||!p&&!T,onClick:$,"data-testid":"metricCorrelation-clear",small:!0,icon:"reload"})})]}),(0,ae.jsx)(Io,{runGetWeights:D,nodeIds:l,flavour:t})]}),(0,ae.jsxs)(oe.Flex,{width:"100%",children:[(0,ae.jsxs)(oe.Flex,{alignItems:"center",gap:3,margin:[0,2,0,5],width:"100%",children:[(0,ae.jsx)(oe.TextNano,{whiteSpace:"nowrap",color:"textDescription",children:"Show less"}),(0,ae.jsx)(oe.InputRange,{"data-testid":"metricCorrelation-resultsSlider",min:0,max:1,onChange:e=>N(e.target.value.toString()),onClick:()=>(0,se.H)("metric-correlation","click-slider","charts-view"),step:.01,value:x}),(0,ae.jsx)(oe.TextNano,{whiteSpace:"nowrap",color:"textDescription",children:"Show more"})]}),(0,ae.jsx)(ae.Fragment,{children:(0,ae.jsx)(_e.A,{content:"Give us your feedback! Was it useful?",align:"bottom",enterDelay:200,showArrow:!0,activateOn:"hover",children:(0,ae.jsxs)(oe.Flex,{children:[(0,ae.jsx)(oe.Button,{flavour:"+"===u?"hollow":"borderless",disabled:u,icon:"thumb_up",onClick:()=>h("+"),"data-ga":"metric-correlation::click-thumbs-up::charts-view","data-testid":"metricCorrelation-thumbsUp",small:!0}),(0,ae.jsx)(oe.Button,{flavour:"-"===u?"hollow":"borderless",disabled:u,icon:"thumb_down",onClick:()=>h("-"),"data-ga":"metric-correlation::click-thumbs-down::charts-view","data-testid":"metricCorrelation-thumbsDown",small:!0})]})})})]})]})}):(0,ae.jsxs)(oe.Flex,{alignItems:"center","data-testid":"correlationView-timePeriod-container",gap:4,children:[(0,ae.jsx)(To,{icon:"logo_s",isLoading:f}),f?(0,ae.jsx)(oe.H5,{"data-testid":"metricCorrelation-loadingCalculation",children:"Calculating metric correlations..."}):(0,ae.jsx)(ko,{highlightAfter:A,highlightBefore:k,baseline:S})]}):(0,ae.jsxs)(oe.Flex,{alignItems:"center",gap:1,children:[(0,ae.jsx)(oe.Icon,{name:"correlation",color:"primary"}),(0,ae.jsx)(oe.Text,{children:"Select a timeframe on any chart and find correlated metrics. Visit documentation"}),(0,ae.jsx)("a",{href:"https://learn.netdata.cloud/docs/cloud/insights/metric-correlations",target:"_blank",rel:"noreferrer",children:(0,ae.jsx)(oe.Icon,{name:"nav_arrow_goto",color:"primary",width:"12px",height:"12px"})})]}),(0,ae.jsxs)(oe.Flex,{alignItems:"center",children:[(!p||f)&&(0,ae.jsx)(_e.A,{content:R?"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,ae.jsx)(So,{label:f?"Loading...":"Find correlations",isLoading:!1,onClick:D,disabled:R,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,ae.jsx)(_e.A,{content:"Close",align:"bottom",children:(0,ae.jsx)(No,{neutral:!0,flavour:"borderless",onClick:L,"data-ga":"metric-correlation::click-close::charts-view","data-testid":"metricCorrelation-close",icon:"x",feature:"MetricCorrelations"})})]})]})},$o=e=>{let{children:t}=e;return(0,ae.jsxs)(oe.Flex,{"data-testid":"selected-nodes-container",gap:1,alignItems:"center",width:"100%",children:[(0,ae.jsx)(oe.Flex,{alignItems:"center",children:(0,ae.jsx)(oe.TextSmall,{whiteSpace:"nowrap","data-testid":"selected-nodes-container-message",color:"primary",children:"Selected filters:"})}),(0,ae.jsx)(oe.Flex,{height:{max:50},overflow:{vertical:"auto"},padding:[1],gap:1,alignItems:"center",flexWrap:!0,children:t})]})},Do=(0,r.memo)($o),Ro=e=>{let{onRemove:t}=e;return(0,ae.jsx)(oe.Box,{"data-testid":"remove-button",as:oe.Icon,name:"close_circle",onClick:t,cursor:"pointer",width:3,height:3,color:"textLite"})},Bo=e=>{let{removeFilter:t,group:n,id:r,value:o,isAnchorDisabled:s,onClick:i,ref:a}=e;const[l,c]=o.split("|"),d=c?`${l} > ${c}`:l;return(0,ae.jsx)(oe.Flex,{ref:a,"data-testid":`selected-node-item-${r}`,children:(0,ae.jsx)(oe.Pill,{flavour:"neutral",hollow:!0,children:(0,ae.jsxs)(oe.Flex,{position:"relative",gap:2,alignItems:"center",children:[i?(0,ae.jsx)(ge.A,{Component:oe.TextSmall,disabled:s,onClick:i,cursor:"pointer",color:"text",hoverColor:"primary",visitedColor:"accent",disabledColor:"textLite",children:d}):(0,ae.jsx)(oe.TextSmall,{children:d}),(0,ae.jsx)(Ro,{onRemove:()=>t({param:n,removedValue:r}),id:r})]})})})},Po=(0,r.memo)(Bo),Oo={selectedNodeIds:"Node",nodeStatuses:"Status",nodeLabels:"Host label",nodeCapabilities:"Capability",nodeVersions:"Version"},Vo=e=>{let{group:t,subGroup:n,groupLabel:o,values:s,filtersByLabel:i={},hasUnion:a,union:l="AND",removeFilter:c,Component:d=Po}=e;const u=o||Oo[t];if(!Array.isArray(s)||!s.length)return null;const h="nodeLabels"!==t||n?{}:i,x=Object.entries(h);return x.length?x.map(((e,n)=>{let[r,o]=e;return(0,ae.jsx)(Vo,{group:t,subGroup:r,groupLabel:`${Oo[t]} ${r}`,values:o,hasUnion:n>0,removeFilter:c},n)})):(0,ae.jsxs)(r.Fragment,{children:[a&&(0,ae.jsx)(oe.TextSmall,{strong:!0,children:l}),(0,ae.jsxs)(oe.Pill,{flavour:"neutral",hollow:!0,gap:1,TextComponent:oe.Flex,textProps:{alignItems:"center",gap:1},flexWrap:!0,children:[(0,ae.jsxs)(oe.TextNano,{strong:!0,children:[u,":"]}),s.map(((e,o)=>(0,ae.jsxs)(r.Fragment,{children:[o>0&&(0,ae.jsx)(oe.TextSmall,{strong:!0,children:"OR"}),(0,ae.jsx)(d,{removeFilter:c,id:n?`${n}|${e}`:e,value:e,group:t})]},e)))]})]},"filter")},Eo=e=>{let{removeFilter:t,value:n,ref:r}=e;const o=(0,E.xY)(n,"name"),s=(0,E.xY)(n,"isOffline"),i=(0,E.d3)(n);return(0,ae.jsx)(Po,{ref:r,removeFilter:t,group:"selectedNodeIds",id:n,value:o,isAnchorDisabled:s,onClick:i})},_o=(0,r.memo)((e=>{let{flavour:t}=e;const[[n,r=[]],o]=(0,_._e)({extraKey:t,merge:!1});if(!n.length&&!r.length)return(0,ae.jsx)("div",{});const s=(0,_.Pt)(n);return(0,ae.jsx)(oe.Flex,{width:"100%",overflow:"hidden",padding:[2,0],children:(0,ae.jsxs)(Do,{children:[n.map(((e,t)=>{let[n,r]=e;return(0,ae.jsx)(Vo,{group:n,values:r,filtersByLabel:s,hasUnion:t>0,removeFilter:o},n)})),(0,ae.jsx)(Vo,{group:"selectedNodeIds",values:r,hasUnion:!!n.length&&!!r.length,union:"OR",removeFilter:o,Component:Eo})]})})}));var Ho=n(88434);const zo={overview:_o,default:null},Ko=(0,r.memo)((e=>{let{flavour:t,...n}=e;const{showCorrelation:r}=(0,Ho.A)(),o=zo[t]||zo.default;return(0,ae.jsx)(oe.Flex,{alignItems:!r&&"center",background:"mainBackground",column:r,"data-testid":"overview-header",gap:2,justifyContent:r?"start":"between",padding:[0,2,0,4],width:"100%",children:r?(0,ae.jsx)(Lo,{flavour:t}):!!o&&(0,ae.jsx)(o,{...n,flavour:t})})})),Go=Ko;var Wo=n(27024),qo=n(98591),Uo=n(47213);const Jo=e=>{let{id:t,contexts:n,menuId:r,parentIds:o,...s}=e;const i=(0,Fe.bD)();return(0,Uo.q)(i)(n,r||t,o)?(0,ae.jsx)(mt.h,{id:t,...s,children:(0,ae.jsx)(pt.$,{id:t,hasTooltip:!0,flavour:s.extraKey,enableFavourites:!0,level:s.level,descendantIds:s.descendantIds,selfChartIds:s.selfChartIds})}):null},Zo=(0,r.memo)(Jo);var Xo=n(5020),Yo=n(80744),Qo=n(64156),es=n(28973),ts=n(1817),ns=n(2404),rs=n.n(ns),os=n(52795);const ss=(0,G.eU)(null),is=()=>{const e=(0,Gt.eg)(),t=(0,K.md)(ss);return e&&e.getRoot().getChildren().find((e=>e.match({id:t})))},as=e=>t=>`overview-page::${e.getAttribute("id")}::${t}`;var ls=n(54251),cs=n(77679);const ds={},us=(e,t,n)=>{const o=(0,v.ID)(),[s,i]=(0,cs.w)(),a=s?i:o,l=(0,z.rW)("contextSearchFilters",{key:a,extraKey:"chartFilters",flavour:"obj",defaultValue:ds});return(0,r.useMemo)((()=>{const r=Array.isArray(e)?e:[e];if(!r.length||!r[0])return null;const o=t?[t,...n||[]]:[];if(0===o.length)return null;const s={dimensions:[],instances:[],labels:[]};o.forEach((e=>{const t=l[e];t&&r.forEach((e=>{const n=t[e];if(!n)return;(Array.isArray(n)?n:[n]).forEach((e=>{switch(e.matchType){case"dimensions":s.dimensions.includes(e.value)||s.dimensions.push(e.value);break;case"instances":e.instanceName&&(s.instances.includes(e.instanceName)||s.instances.push(e.instanceName));break;case"labels":s.labels.includes(e.value)||s.labels.push(e.value)}}))}))}));return s.dimensions.length>0||s.instances.length>0||s.labels.length>0?s:null}),[l,e,t,n])},hs=[],xs=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{selectedDimensions:e.dimensions?Object.keys(e.dimensions):hs,selectedInstances:e.instances?Object.keys(e.instances):hs,selectedNodes:e.nodes?Object.keys(e.nodes):hs,weight:e.weight}},gs=e=>{let{style:t,handleProps:n,attributes:o,listeners:s,dragging:i,dragOverlay:a,id:l,resizeHandle:c,onChangeHeight:d,onRemove:u,expanded:h,ref:x,menuId:g,subMenuId:m,parentIds:p,...f}=e;const j=(0,r.useRef)({}),b=(0,v.ID)(),y=is(),{contextScope:C,...w}=(0,hn.aA)(l),I=(0,Gt.eg)(),{sendLog:A,isReady:k}=(0,rn.A)(),S=(0,ee.CS)({type:"chart",entity:C?C.join(","):l,path:"/"}),T=us(C,m||g,p),F=(0,r.useMemo)((()=>{if(!y)return null;let e=y.getNode({id:a?`dragOverlay-${l}`:l});const t=(0,os.A)(S,!0);if(e)return j.current=(0,os.A)({...e.getAttributes(),...e.getAttribute("pristine"),pristine:{}}),T&&!rs()(e.getAttribute("prevMatches"),T)&&e.setAttributes({selectedDimensions:Array.from(new Set([...t.selectedDimensions||[],...T.dimensions||[]])),selectedInstances:Array.from(new Set([...t.selectedInstances||[],...T.instances||[]])),selectedLabels:Array.from(new Set([...t.selectedLabels||[],...T.labels||[]])),prevMatches:T}),e;e=I.makeChart({attributes:{id:a?`dragOverlay-${l}`:l,roomId:b,expandable:!0,...w,contextScope:C,expanded:h,toolboxProps:{drag:{...n,...s,...o}}},makeTrack:as}),y.appendChild(e),j.current=(0,os.A)(e.getAttributes());const r=e.getAttribute("chartLibrary");return e.setAttributes({...j.current,...t,...T&&!rs()(e.getAttribute("prevMatches"),T)&&{selectedDimensions:Array.from(new Set([...t.selectedDimensions||[],...T.dimensions||[]])),selectedInstances:Array.from(new Set([...t.selectedInstances||[],...T.instances||[]])),selectedLabels:Array.from(new Set([...t.selectedLabels||[],...T.labels||[]])),prevMatches:T}}),(0,ls.A)(e,r,e.getAttribute("chartLibrary")),e}),[y,b,l,a]);(0,r.useLayoutEffect)((()=>{F&&k&&"function"===typeof A&&F.updateAttribute("logOptions",{sendLog:A,payload:{feature:"Overview"}})}),[F,A,k]);const{weight:N,selectedDimensions:M,selectedInstances:L,selectedNodes:$}=(0,hn.uy)(C.join("|"),xs),D=(0,ts.A)(S),R=(0,ts.A)(T,!0),B=(0,ts.A)(M.length),P=(0,ts.A)(L.length),O=(0,ts.A)($.length);return(0,mo.A)((()=>{if(!F)return;const e=F.getAttribute("chartLibrary"),t={};if(!N||B===M.length&&P===L.length&&O===$.length?S&&!rs()(D,S)&&Object.assign(t,{...j.current,...(0,os.A)(S,!0)}):Object.assign(t,{selectedDimensions:M,selectedInstances:L,selectedNodes:$}),T&&!rs()(R,T)){const e=F.getAttributes();Object.assign(t,{selectedDimensions:Array.from(new Set([...e.selectedDimensions||[],...t.selectedDimensions||[],...T.dimensions||[]])),selectedInstances:Array.from(new Set([...e.selectedInstances||[],...t.selectedInstances||[],...T.instances||[]])),selectedLabels:Array.from(new Set([...e.selectedLabels||[],...t.selectedLabels||[],...T.labels||[]])),prevMatches:T})}Object.keys(t).length>0&&(F.updateAttributes(t),(0,ls.A)(F,e,F.getAttribute("chartLibrary")),F.trigger("fetch"))}),[F,b,l,S,T,N,M.length,L.length,$.length]),(0,r.useLayoutEffect)((()=>{F&&t&&(F.updateAttributes({height:t.height,width:t.width}),F.trigger("resize"))}),[F,t.height,t.width]),(0,r.useLayoutEffect)((()=>{if(F)return(0,es.unregister)(F.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}=F.getAttributes();d(l,(e?1:-1)*t)})))}),[F]),(0,mo.A)((()=>{F&&F.updateAttributes({toolboxProps:{drag:{...n,...s,...o,dragging:i}}})}),[F,i]),F?(0,ae.jsxs)(oe.Box,{ref:x,style:t,children:[(0,ae.jsx)(Xt.A,{chart:F,"data-chartid":a?`dragOverlay-${l}`:l,"data-track":F.track("container"),height:t.height,width:"100%"}),c]},y&&y.getId()):null},ms=(0,r.memo)(gs,((e,t)=>e.id===t.id&&e.style===t.style)),ps=function(){let{id:e,layout:t={},contextScope:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,Xo.bP)(e,t,{left:0,top:0,width:12,height:6,id:e,chartId:e,...t,minWidth:12,maxWidth:12,minHeight:4,static:!1,dashboardable:!0,contextScope:n})},fs=e=>{let{id:t,menuId:n,subMenuId:o,parentIds:s,containerWidth:i,...a}=e;const l=(0,hn.aA)(t,ps),c=(0,Fe.bD)(),d=(0,Uo.q)(c),[u,h]=(0,r.useState)((()=>[l])),x=(e,t)=>{(0,Xo.Q)(t),h(e)},g=(0,r.useRef)(1),m=(e,t)=>{const n=u.findIndex((t=>t.id===e));-1!==n&&(u[n]={...u[n],height:u[n].height+t/Yo.NA,expanded:t>0},x([...u],u[n]),g.current+=1)},p=(0,Qo.A)("(max-width: 767px)"),f=(0,r.useMemo)((()=>(g.current+=1,u.filter((e=>{if(!e)return!1;const t=e.contextScope||[e.chartId]||0;return d(t,o||n,s)})))),[u,d,o,n,s]),j=(0,r.useMemo)((()=>e=>{let{id:t,...r}=e;return(0,ae.jsx)(ms,{id:t,role:"graphics-object","aria-roledescription":"chart","data-menuid":o||n,menuId:n,subMenuId:o,onChangeHeight:m,parentIds:s,...r},t)}),[o,n,s]);return(0,ae.jsx)(Yo.Ay,{cacheId:g.current,rootId:t,containerId:t,onDragEnd:x,items:f,containerWidth:i-(p?16:26),"data-menuid":o||n,...a,Item:j,rearrangeable:!0})},js=(0,r.memo)(fs);var bs=n(54025),vs=n(63996);const ys=e=>{let{id:t,contexts:n,menuId:r,parentIds:o,extraKey:s,descendantIds:i,level:a,selfChartIds:l}=e;const c=(0,Fe.bD)();return(0,Uo.q)(c)(n,r||t,o)?(0,ae.jsx)(bs.t,{gap:0,id:t,testId:"chart-sub-menu-container-overview",children:(0,ae.jsx)(vs.t,{id:t,margin:[1,0,0],hasTooltip:!0,flavour:s,enableFavourites:!0,level:a,descendantIds:i,selfChartIds:l})}):null},Cs=(0,r.memo)(ys);var ws=n(4719);const Is=e=>{let{id:t}=e;const n=(0,v.ID)(),o=(0,Gt.eg)(),s=(0,hn.Vt)(),{chartIds:i}=(0,ws.b)(t),a=is(),l=(0,r.useMemo)((()=>{const[e]=i;let r=a.getChildren().find((e=>e.match({id:t})));if(r)return r;const l=i.map((e=>({value:e,label:s(e).context})));return r=o.makeChart({attributes:{id:`custom-k8s-map-${t}`,contextScope:[e],roomId:n,composite:!0,chartLibrary:"groupBoxes",groupBy:["label"],groupByLabel:["k8s_namespace","k8s_pod_name"],aggregationMethod:"avg",eliminateZeroDimensions:!1,contextItems:l,toolboxElements:[]},makeTrack:as}),a.appendChild(r),r}),[t,a]);return(0,ae.jsx)(Xt.A,{margin:[0,0,2],chart:l,"data-chartid":t,"data-track":l.track("container")},a.getId())},As=e=>{let{id:t,...n}=e;return(0,ae.jsxs)(mt.h,{id:t,padding:[6,0,0],children:[(0,ae.jsx)(pt.$,{id:t}),(0,ae.jsx)(ft.n,{id:t,padding:[2,0,0]}),(0,ae.jsx)(Is,{id:t,...n})]})},ks=(0,r.memo)(As),Ss=[],Ts=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{selectedDimensions:e.dimensions?Object.keys(e.dimensions):Ss,selectedInstances:e.instances?Object.keys(e.instances):Ss,selectedNodes:e.nodes?Object.keys(e.nodes):Ss,weight:e.weight}},Fs=(0,hn.BK)((e=>{let{style:t,id:n,menuChartAttributes:o,resizeHandle:s,handleProps:i,listeners:a,dragging:l,dragOverlay:c,onChangeHeight:d,expanded:u,ref:h,menuId:x,subMenuId:g,parentIds:m}=e;const p=(0,r.useRef)({}),f=(0,v.ID)(),j=(0,Gt.eg)(),b=is(),y=(0,ee.CS)({type:"chart",entity:n,path:"/"}),C=us(o.contextScope,g||x,m),w=(0,r.useMemo)((()=>{let e=b.getChildren().find((e=>e.match({id:c?`dragOverlay-${n}`:n})));const t=(0,os.A)(y,!0);if(e)p.current=(0,os.A)({...e.getAttributes(),...e.getAttribute("pristine")}),C&&!rs()(e.getAttribute("prevMatches"),C)&&e.setAttributes({selectedDimensions:Array.from(new Set([...t.selectedDimensions||[],...C.dimensions||[]])),selectedInstances:Array.from(new Set([...t.selectedInstances||[],...C.instances||[]])),selectedLabels:Array.from(new Set([...t.selectedLabels||[],...C.labels||[]])),prevMatches:C});else{e=j.makeChart({attributes:{expandable:!0,...o,roomId:f,id:c?`dragOverlay-${n}`:n,isHead:!0,expanded:u},makeTrack:as,toolboxProps:{drag:{...i,...a}}}),p.current=(0,os.A)(e.getAttributes());const r=e.getAttribute("chartLibrary");e.setAttributes({...p.current,...t,...C&&rs()(e.getAttribute("prevMatches"),C)&&{selectedDimensions:Array.from(new Set([...t.selectedDimensions||[],...C.dimensions||[]])),selectedInstances:Array.from(new Set([...t.selectedInstances||[],...C.instances||[]])),selectedLabels:Array.from(new Set([...t.selectedLabels||[],...C.labels||[]])),prevMatches:C}}),(0,ls.A)(e,r,e.getAttribute("chartLibrary")),b.appendChild(e)}return e}),[f,n,b]),{weight:I,selectedDimensions:A,selectedInstances:k,selectedNodes:S}=(0,hn.uy)(o.contextScope?.join("|"),Ts),T=(0,ts.A)(y),F=(0,ts.A)(C,!0,rs()),N=(0,ts.A)(A.length),M=(0,ts.A)(k.length),L=(0,ts.A)(S.length);(0,mo.A)((()=>{if(!w)return;const e={},t=w.getAttribute("chartLibrary");if(!I||N===A.length&&M===k.length&&L===S.length?y&&!rs()(T,y)&&Object.assign(e,{...p.current,...(0,os.A)(y,!0)}):Object.assign(e,{selectedDimensions:A,selectedInstances:k,selectedNodes:S}),C&&!rs()(F,C)){const t=w.getAttributes();Object.assign(e,{selectedDimensions:Array.from(new Set([...t.selectedDimensions||[],...e.selectedDimensions||[],...C.dimensions||[]])),selectedInstances:Array.from(new Set([...t.selectedInstances||[],...e.selectedInstances||[],...C.instances||[]])),selectedLabels:Array.from(new Set([...t.selectedLabels||[],...e.selectedLabels||[],...C.labels||[]])),prevMatches:C})}Object.keys(e).length>0&&(w.updateAttributes(e),(0,ls.A)(w,t,w.getAttribute("chartLibrary")),w.trigger("fetch"))}),[w,f,n,y,C,I,A.length,k.length,S.length]),(0,r.useLayoutEffect)((()=>{w.updateAttributes({toolboxProps:{drag:{...i,...a,dragging:l}}})}),[w,l]),(0,r.useLayoutEffect)((()=>{if(w)return(0,es.unregister)(w.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}=w.getAttributes();d(n,(e?1:-1)*t)})))}),[w]),(0,mo.A)((()=>{if(!w)return;const e=parseFloat(t.height);e&&!isNaN(e)&&(w.updateAttribute("height",e),w.trigger("resize"))}),[t.height]);return(0,Fe.Bu)(o.contextScope)?(0,ae.jsxs)("div",{ref:h,style:t,children:[(0,ae.jsx)(Xt.A,{chart:w,"data-track":w.track("container"),"data-chartid":c?`dragOverlay-${n}`:n,height:t.height,width:"100%"}),s]},b.getId()):null})),Ns=(e,t,n)=>(e.layout||console.warn(t,"has no layout set, default values will be used."),(0,Xo.bP)(t,e.layout,{left:n%2,top:4*parseInt(n/2),width:6,height:4,id:e.id,contextScope:e.contextScope,minWidth:1,minHeight:1,static:!1,dashboardable:!0})),Ms=(0,r.memo)((e=>{let{itemIds:t,containerWidth:n,id:o,subMenuId:s,menuId:i,parentIds:a}=e;const l=(0,hn.dd)(t,Ns),{filteredChartsCount:c}=(0,no.Ad)(),d=(0,Qo.A)("(max-width: 767px)"),u=(0,Fe.bD)(),h=(0,Uo.q)(u),[x,g]=(0,r.useState)((()=>l)),m=(e,t)=>{(0,Xo.Q)(t),g(e)},p=(0,r.useRef)(1),[f,j]=(0,r.useState)(!1),b=(0,r.useMemo)((()=>t.some((e=>null!==localStorage.getItem(`chart_layout/${e}`)))),[t]),v=(0,r.useCallback)((()=>{t.forEach((e=>{localStorage.removeItem(`chart_layout/${e}`)})),p.current+=1,g(l)}),[t,l]);(0,r.useEffect)((()=>{const e=()=>{p.current+=1,g(l)};return window.addEventListener("resetChartLayout",e),()=>window.removeEventListener("resetChartLayout",e)}),[l,d]);const y=(0,r.useMemo)((()=>(p.current+=1,x.filter((e=>!!e&&(!!e.contextScope&&h(e.contextScope,i,a)))))),[t,x,c,h,i,a]);return y.length?(0,ae.jsxs)(oe.Flex,{position:"relative",width:"100%",onMouseEnter:()=>j(!0),onMouseLeave:()=>j(!1),children:[f&&b&&(0,ae.jsx)(oe.Flex,{position:"absolute",top:2,right:2,zIndex:10,background:"dropdown",round:1,padding:[1],border:!0,children:(0,ae.jsx)(_e.A,{content:"Reset all charts to default layout",align:"left",children:(0,ae.jsx)(oe.IconButton,{icon:"refresh",onClick:v,flavour:"borderless",padding:[1],"data-testid":"grid-reset-layout-button"})})}),(0,ae.jsx)(Yo.Ay,{cacheId:p.current,rootId:o,containerId:o,"data-chartid":o,"data-menuid":s||i,onDragEnd:m,items:y,containerWidth:n-(d?16:26),gridTracks:d?1:12,Item:Fs,rearrangeable:!0,itemProps:{onChangeHeight:(e,t)=>{const n=x.findIndex((t=>t.id===e));-1!==n&&(x[n]={...x[n],height:x[n].height+t/Yo.NA,expanded:t>0},m([...x],x[n]),p.current+=1)},menuId:i,subMenuId:s,parentIds:a},compactType:"vertical"})]}):null}),((e,t)=>e.itemIds===t.itemIds&&e.containerWidth===t.containerWidth)),Ls={k8s:ks,root:Zo,submenu:Cs,chart:js,grid:Ms},$s=e=>{if(Ls[e.flavour])return Ls[e.flavour];switch(e.level){case 0:return Zo;case 1:return Cs;case 2:return js;default:return null}},Ds=e=>{let{flavour:t,onChartNameChange:n,initialChartName:r,dashboardOptions:o,linkToGo:s,contextToGo:i,containerWidth:a}=e;const[l,,,c]=(0,qo.A)("addToDashboardModal"),{setActiveMenuId:d}=(0,xt.A)({onChartNameChange:n,initialChartName:r,linkToGo:s,contextToGo:i}),u=(0,Fe.bD)(),h=(0,Uo.q)(u);return(0,ae.jsxs)(ne.H,{children:[(0,ae.jsx)(gt.A,{flavour:t,onActiveMenuId:d,getComponent:$s,dashboardOptions:o,initialChartName:r,containerWidth:a,checkVisibility:h}),l&&(0,ae.jsx)(Wo.A,{onClose:c})]})};var Rs=n(19075);const Bs=(0,r.memo)((()=>{const[e,t]=(0,Rs.KB)(),n=(0,Gt.eg)(),o=!!e&&!!n&&n.getNode({id:e.context}),s=()=>{if(t(null),!e?.context||!o)return;const n={...o.getAttribute("overlays")};delete n.alert,o.updateAttribute("overlays",n),history.replaceState({},"")};(0,r.useEffect)((()=>s),[]);const i=(0,v.ID)(),a=(0,Fe.R7)(e?.context&&i,e?.context);if(!e||!a?.loaded)return null;const{firstEntry:l}=a;return(0,ae.jsx)(oe.Layer,{backdrop:!1,position:"top",margin:[26,0,0],padding:[26,0,0],children:(0,ae.jsxs)(oe.Flex,{background:"tooltip",padding:[1,2],gap:2,children:[(0,ae.jsxs)(oe.TextSmall,{children:["Showing alert in ",(0,ae.jsx)(oe.TextSmall,{strong:!0,children:e.instance})," on"," ",(0,ae.jsx)(oe.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,ae.jsx)(oe.Flex,{flex:!1,children:(0,ae.jsx)(oe.Icon,{name:"x",color:"tooltipText",onClick:s,size:"small"})})]})})})),Ps=Bs;var Os=n(14070);const Vs={NoChartsView:to,NoNodesView:R.A,sidebar:{title:"Filters",hiddenTabs:["info"],Component:re.Ay,props:{}},dashboardOptions:{},loadingMessage:"Loading charts...",Header:Go},Es={overview:{...Vs,sidebar:{...Vs.sidebar,title:"Metrics"},feature:"Overview"},k8s:{...Vs,NoChartsView:go,NoNodesView:go,sidebar:{...Vs.sidebar,title:"Kubernetes"},loadingMessage:"Loading k8s charts...",feature:"Kubernetes"},singleNode:{...Vs,sidebar:{...Vs.sidebar,title:"Single Node",hiddenTabs:["filters"],props:{showCollapsed:!0}},feature:"SingleNode"}},_s=()=>((0,qr.A)(),null),Hs=(0,r.memo)((e=>{let{flavour:t="overview",invalidationKey:n,nodeIds:r,loaded:o,getChart:s,chartIds:i,areChartsIdsEmpty:a,showNoChartsView:l,showNoNodesView:d,initializing:u,chartName:h,setChartName:x,chartsLoaded:g,widthRef:m,containerWidth:p,nodesKey:j,blurred:b,blurProps:v={},BlurredContent:y,noPreferredNodesError:C}=e;const{dashboardOptions:w,NoChartsView:I,NoNodesView:A,sidebar:k,Header:S,feature:T="Overview"}=Es[t],{state:F}=(0,f.zy)(),[N,,,M]=(0,Os.A)(),L=is();return d?(0,ae.jsx)(B.Ay,{feature:T,mode:"NoNodesView",children:(0,ae.jsx)(A,{})}):u?(0,ae.jsx)(Zr.A,{title:"Please wait while charts are being initialized.",body:"Thank you for your patience!"}):o?(0,ae.jsx)(B.Ay,{feature:T,children:(0,ae.jsxs)(ne.A,{getObject:s,ids:i,linkToGo:F?.chartName,extraKey:t,deps:[j],children:[(0,ae.jsx)(_s,{}),(0,ae.jsx)(Ps,{}),(0,ae.jsxs)(O.A,{ref:m,sidebar:(0,ae.jsx)(k.Component,{nodeIds:r,title:k.title,initialChartName:h,hiddenTabs:k.hiddenTabs,flavour:t,loaded:g,FilterInputContainer:co,...k.props}),blurred:b,blurProps:v,BlurredContent:y,children:[(0,ae.jsx)(S,{flavour:t}),g||C?l||a?(0,ae.jsx)(I,{noPreferredNodesError:C}):(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(Ds,{flavour:t,dashboardOptions:w,initialChartName:h,onChartNameChange:x,linkToGo:F?.chartName,contextToGo:F?.contextToGo,containerWidth:p}),N&&M]}):(0,ae.jsx)(c.O2,{}),(0,ae.jsx)(Jr,{container:L})]})]},n)}):(0,ae.jsx)(c.O2,{})})),zs=Hs,Ks=e=>t=>{const n=(0,E.nl)(),o=(0,r.useMemo)((()=>[n]),[n]);return(0,ae.jsx)(e,{flavour:"singleNode",nodeIds:o,nodeId:n,...t},n)};var Gs=n(64867),Ws=n(12407),qs=n(17829);var Us=n(13752),Js=n(92815),Zs=n(72582),Xs=n(82650),Ys=n(78072),Qs=n(95980),ei=n(91832),ti=n(6504),ni=n(22332),ri=n(62709);const oi=(0,mn.default)(oe.Icon).withConfig({displayName:"styled__StyledAlertDot",componentId:"sc-12w0ym-0"})(["position:absolute;top:0;right:-1px;width:6px;height:6px;"]);var si=n(96026);const ii=(0,Et.A)((e=>{let{alertName:t,close:n,tooltip:o,...s}=e;const[,i]=(0,Os.A)(),{sendLog:a}=(0,rn.A)(),l=(0,r.useCallback)((e=>{e.stopPropagation(),i({alertName:t}),a({feature:"MetricsChartManageAlerts",description:"Show alert",alertName:t}),n()}),[t,i,n,a]);return(0,ae.jsx)(oe.IconButton,{icon:"goToNode",iconColor:"textLite",onClick:l,neutral:!0,padding:[0],width:"16px",height:"16px",...s})})),ai=(0,Et.A)((e=>{let{alertName:t,nodes:n,close:o,tooltip:s,...i}=e;const{goToEdit:a}=(0,si.q)({alertName:t,nodeIds:n}),{sendLog:l}=(0,rn.A)(),c=(0,r.useCallback)((e=>{e.stopPropagation(),l({feature:"MetricsChartManageAlerts",description:"Edit alert",alertName:t}),a(),o()}),[n,o,a,l]);return(0,ae.jsx)(oe.IconButton,{icon:"pencilOutline",iconColor:"textLite",onClick:c,neutral:!0,padding:[0],width:"12px",height:"12px",...i})})),li=e=>{let{item:{value:t,label:n,alerts:r={},nodes:o,onClick:s,...i},index:a,style:l,close:c,onItemClick:d,...u}=e;const{cl:h=0,cr:x=0,wr:g=0}=r,m={text:x,flavour:x?"error":"disabledError"},p={text:g,flavour:g?"warning":"disabledWarning"},f={text:h,flavour:h?"clear":"disabledClear"};return(0,ae.jsxs)(oe.MenuItemContainer,{"data-index":a,onClick:e=>{s&&s(e)},...i,...u,style:l,alignItems:"center",justifyContent:"between",gap:2,padding:[1,2],overflow:"hidden",cursor:"default",children:[(0,ae.jsx)(oe.Flex,{width:{max:"180px"},alignItems:"center",children:(0,ae.jsx)(en.A,{text:n,TextComponent:oe.Text})}),(0,ae.jsxs)(oe.Flex,{alignItems:"center",gap:1,children:[(0,ae.jsx)(oe.MasterCard,{pillLeft:m,pillRight:p,pillEnd:f}),(0,ae.jsx)(ii,{alertName:t,close:c,tooltip:"Show alert instances",tooltipProps:{align:"bottom"}}),(0,ae.jsx)(ai,{alertName:t,nodes:o,close:c,disabled:!o.length,tooltip:o.length?"Edit this alert configuration":"This alert is no longer configured in any node",tooltipProps:{align:"bottom"}})]})]})};var ci=n(39423);const di={events:{extraKey:"feedFilters",page:"events",alertNamesKey:"alert_names",period:{after:-n(71336).d_,before:0}},alerts:{extraKey:"alerts",page:"alerts",alertNamesKey:"alertNames"}},ui=function(){let{flavour:e="events"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,v.ID)(),n=(0,f.Zp)(),[o,s]=(0,oo.Ay)(),i=(0,Rs.le)(),[,a]=(0,Rs.DV)(),l=(0,z.rI)(),{extraKey:c,page:d,alertNamesKey:u,period:h}=di[e]||di.events,x={defaultValue:[],key:t,extraKey:c,flavour:"arr",merge:!1},g=(0,z.rI)("alertContexts",x),m=(0,z.rI)(u,x),p=(0,z.rI)("chart_names",x),j=(0,r.useCallback)((e=>{let{name:t}=e;i(1),a({alertName:t,nodeId:null}),n(`/spaces/${o}/rooms/${s}/alerts`,{replace:!0})}),[n,o,s,i,a]),b=(0,r.useCallback)((e=>{let{context:t,name:r,instance:i}=e;h&&l((e=>({...e,...h}))),t&&g([t]),r&&m([r]),i&&p([i]),n(`/spaces/${o}/rooms/${s}/${d}`)}),[n,d,h,o,s,l,g,m,p]);return{goToAlerts:b,goToAlertConfigurations:j}},hi=(0,Je.A)((0,Et.A)(oe.Button)),xi=e=>{let{loaded:t,contexts:n=[],close:o,onAddAlertClick:s}=e;const i=(0,ni.useChart)().getId(),a=n?.[0],{setSelectedTab:l}=(0,ci.A)(),[c,d]=(0,oo.Ay)(),{goToAlerts:u}=ui({flavour:"alerts"}),h=(0,r.useMemo)((()=>a?`View the active alerts for ${a} context`:"View the active alerts for this context"),[a]),x=(0,r.useCallback)((()=>{a&&(l(0),o(),u({context:a}))}),[a,u,l,c,d,o]),g=(0,r.useCallback)((()=>{s(),o()}),[s,o]);return(0,ae.jsxs)(oe.Flex,{gap:2,padding:[2],border:{side:"top"},justifyContent:"center",children:[(0,ae.jsx)(hi,{feature:"MetricsChartManageAlerts",label:"Go to alerts",small:!0,flavour:"hollow",icon:"goToNode",onClick:x,tooltip:h,tooltipProps:{align:"bottom"},payload:{chartId:i},disabled:!a||!t}),(0,ae.jsx)(hi,{feature:"MetricsChartManageAlerts",label:"Add alert",small:!0,icon:"plus",onClick:g,tooltip:`Start adding a new alert on ${a} context`,tooltipProps:{align:"bottom"},payload:{chartId:i},disabled:!a||!t})]})};var gi=n(11520);const mi=e=>{let{disabled:t}=e;const n=(0,ni.useChart)(),o=(0,E.ss)(),{loaded:s,items:i,status:a}=(e=>{const[t,n]=(0,r.useState)(),[o,s]=(0,r.useState)([]),[i,a]=(0,r.useState)([]),[l,c]=(0,r.useState)(),d=(0,Rs.SU)();return(0,r.useEffect)((()=>{const t=()=>{const t=e.getAttribute("alerts"),r=Object.values(t||{}),o=Object.keys(e.getAttribute("nodes")||{});n(!0),s(r),a(o);for(let e=0;e<=r.length;e++){const{wr:t=0,cr:n=0}=r[e]||{};if(n>0){c("error");break}if(t>0){c("warning");break}}};return e&&e.on("successFetch",t),()=>{e&&e.off("successFetch",t)}}),[e,n,s,a,c]),{loaded:t,items:(0,r.useMemo)((()=>[...o.map((e=>{let{nm:t,cl:n,wr:r,cr:o}=e;const s=(d||[]).filter((e=>e.name===t)).map((e=>{let{nd:t}=e;return t}));return{value:t,label:t,alerts:{cl:n,wr:r,cr:o},nodes:s}}))]),[o,i]),status:l}})(n),l=n.getAttribute("contextScope"),[,c]=(0,gi.A)(),d=(0,r.useCallback)((()=>{const{selectedNodes:e,selectedInstances:t,labels:r,selectedLabels:o,contextScope:s}=n.getAttributes(),i=n.getUnitSign(),a=o.length?o:Object.entries(r).reduce(((e,t)=>{let[n,r]=t;return r.vl.forEach((t=>{let{id:r}=t;e.push(`${n}:${r}`)})),e}),[]);c({chart:s[0],viewUnits:i,...(t||[]).length?{instances:t}:{},...(e||[]).length?{nodes:e}:{},...a?{labels:a}:{}})}),[n,o,c]);return n?(0,ae.jsx)(oe.Menu,{dropProps:{align:{top:"bottom",right:"right"},"data-toolbox":n.getId()},dropdownProps:{width:"360px"},Item:li,items:i,Footer:e=>{let{close:t}=e;return(0,ae.jsx)(xi,{loaded:s,contexts:l,close:t,onAddAlertClick:d})},children:(0,ae.jsxs)(oe.Flex,{alignItems:"center",position:"relative",children:[a?(0,ae.jsx)(oi,{name:"dot",color:a}):null,(0,ae.jsx)(ti.Button,{icon:(0,ae.jsx)(ti.default,{svg:ri.A,size:"16px"}),title:"Manage alerts",disabled:t,"data-testid":"chartHeaderToolbox-manageAlerts"})]})}):null},pi=(e,t,n)=>{let{width:o,host:s}=n;if(!s)throw"No host provided";const i=(0,Gt.eg)(),a=(0,r.useRef)(),l=(0,Fe.aZ)(e,"error"),[{correlation:c},d]=(0,z.N9)(),{state:u,pathname:h}=(0,f.zy)(),x=(0,K.Xr)(ss),g=(0,Fe.jI)(e),m=(0,Fe.DQ)(e);(0,r.useLayoutEffect)((()=>{if(!e||!i||l)return;let n=i.getRoot().getChildren().find((e=>e.match({id:h})));if(!n)return n=i.makeContainer({attributes:{id:h,roomId:e,host:s,navigation:c?"highlight":"pan",overlays:{proceeded:{type:"proceeded"}},composite:!0,nodesScope:t,hasCorrelation:!0,versions:g,containerWidth:o,toolboxElements:[...rt.Dm?[mi]:[],Ys.default,Zs.default,Us.default,Js.default,Xs.default,ei.A,Qs.A]}}),i.appendChild(n),x(h),a.current=n,(0,es.unregister)(i.on("correlation",((e,t)=>{if(!Array.isArray(t))return;const[n,r]=t;d((e=>({...e,highlight:{after:1e3*n,before:1e3*r},correlation:!0})))})),n.onAttributeChange("versions",m));x(h)}),[e,l,h,s]),(0,r.useMemo)((()=>{a.current&&(a.current.setAttribute("containerWidth",o),a.current.getNodes().forEach((e=>e.updateAttribute("containerWidth",o))))}),[a.current,o]),(0,mo.A)((()=>{a.current&&a.current.setAttribute("host",s)}),[a.current,s]),(0,mo.A)((()=>{a.current&&a.current.getNodes().forEach((e=>{e.updateAttribute("nodesScope",t);e.getAttribute("active")&&"chart"===e.type&&e.fetch()}))}),[a.current,t]),(0,r.useEffect)((()=>{a.current&&a.current.getApplicableNodes({syncHighlight:!0}).forEach((e=>{e.updateAttribute("navigation",c?"highlight":"pan")}))}),[a.current,c]),(0,r.useEffect)((()=>()=>a.current&&a.current.destroy()),[]),(0,r.useEffect)((()=>{if(!a.current)return;if(!u||!u.context)return;const{context:e,chartId:t,nodeId:n}=u,r=a.current.getNode({id:e});r&&r.updateAttributes({selectedInstances:[`${t}@${n}`],selectedNodes:[n]});const o=t&&n&&a.current.on("chartLoaded",(r=>{const s=r.getAttribute("id");e===s&&(r.updateAttributes({selectedInstances:[`${t}@${n}`],selectedNodes:[n]}),o())}));return()=>u&&(0,es.unregister)(o)}),[a.current,u])};var fi=n(43116);const ji={default:{shouldHide:()=>!1},k8s:{shouldHide:e=>{let{context:t}=e;return!t.includes("k8s")}}},bi=[],vi="ErrNoPreferredNodeRequested",yi=e=>(0,r.memo)((t=>{let{flavour:n="overview",nodeIds:o=bi,nodeId:s,...i}=t;const a=(0,b.vt)(),l=(0,v.ID)(),c=(0,v.XA)("nodeId");s=s||c;let d=(0,_.w7)({extraKey:n,merge:!1,scoped:!0});d=o.length?o:d;const{isNodeRestricted:u,loaded:h}=(0,sn.A)();d=(0,r.useMemo)((()=>d.filter((e=>!u(e).restricted))),[d,h]);const x=(0,D.nj)(),g=(0,Fe._0)(l),{state:m}=(0,f.zy)(),p=(0,Fe.R7)(l),j=(0,E.TG)(d),y=(0,Te.A)(l,d,{spaceId:a}),{contexts:C,metadata:w,loaded:I,dimensionsCount:A}=(0,po.Yy)({nodeIds:d,flavour:n},a,l),[,k]=(()=>{const{state:e={}}=(0,f.zy)(),{alertId:t=null}=e||{},[n,o]=(0,Rs.KB)(),s=t||n?.id,i=(0,Rs.JL)(s);(0,Rs.yk)(i.id),(0,r.useEffect)((()=>{(i.fullyLoaded||i.id)&&o({...i,formattedLastStatusChangeValue:(0,qs.m3)(i.lastStatusChangeValue,i.units),linkToGo:(0,tt.A)(i.context)})}),[i.id,i.fullyLoaded]);const a=n?.id?(0,tt.A)(n.context):null;return[i.id,a]})(),S=o?o.join():n,T=(0,te.K)({spaceId:a,roomId:l}),[F,{width:N}]=(0,P.A)();pi(l,d,{host:T,width:N});const M=(0,Fe.OL)(l),L=(0,Fe.rx)(l),$=I?w:p,R=ji[n]||ji.default,B=(0,Fe.bo)(l),O=(0,ts.A)(B),V=(0,no.rq)(M,p,l,{...R,shouldHide:I?e=>{let{context:t}=e;return!C.includes(t)}:R.shouldHide,force:I||B!==O,cacheKey:`${n}-${A}-${S}`}),H=(0,Fe.yO)(l,w),K=(0,ts.A)(y,!0),G=V<1,[W,q]=(0,z.N9)("chartName",{key:l,extraKey:S,flavour:"val"});(0,r.useEffect)((()=>{l&&q(k||m?.chartName||W)}),[l,k]);const U=is(),J=Object.keys($).length<1&&g||d.length&&!j.length,Z=(0,D.CK)(),X=L?.errorMsgKey==vi;if(!J&&!1!==K&&y&&"No data for this period"!==y&&y!==vi&&!Object.keys($).length)return(0,ae.jsx)(fi.A,{error:y});const Y=!!l&&x&&(!!U||X),{restricted:Q}=u(s);return(0,ae.jsx)(e,{nodeIds:j,loaded:Y,getChart:H,areChartsIdsEmpty:G,showNoNodesView:x&&!Z.length,showNoChartsView:J,initializing:y&&(0,Gs.O)(y),chartName:W,setChartName:q,chartsLoaded:g&&!!N,invalidationKey:l,flavour:n,chartIds:I?C:M,widthRef:F,containerWidth:N,nodesKey:S,noPreferredNodesError:X,blurred:Q,blurProps:{value:"12px"},BlurredContent:()=>(0,ae.jsx)(Ws.A,{flavour:c?"room":"node"}),...i})}));var Ci=n(21785),wi=n(39870),Ii=n(7761);const Ai=()=>{const e=(0,b.vt)(),t=(0,v.ID)(),n=(0,Ii.N3)();(0,j.A)((()=>({enabled:!(!e||!t),force:!0,fetch:()=>(0,Pr.hn)(e,t),onReceive:e=>{let{data:t}=e;return n({...wi.jf,loaded:!0,...t})},onFail:e=>n({...wi.jf,loaded:!0,error:e}),pollingOptions:{pollingInterval:588e3}})),[e,t])};var ki=n(75669);const Si=()=>{const e=(0,b.vt)(),t=(0,v.ID)(),n=(0,_.w7)({extraKey:"home",merge:!1,scoped:!0}),r=(0,Ii.kf)();(0,j.A)((()=>({enabled:!(!e||!t),force:!0,fetch:()=>(0,Pr.TM)(e,t,n),onReceive:e=>{let{data:t}=e;return r({...wi.ul,loaded:!0,...t})},onFail:e=>r({...wi.ul,loaded:!0,error:e}),pollingOptions:{pollingInterval:588e3}})),[e,t])},Ti=()=>{const e=(0,b.vt)(),t=(0,v.ID)(),n=(0,_.w7)({extraKey:"home",merge:!1,scoped:!0}),r=(0,Ii.xs)();(0,j.A)((()=>({enabled:!(!e||!t),force:!0,fetch:()=>(0,Pr.jt)(e,t,n),onReceive:e=>{let{data:t}=e;return r({...wi.ve,loaded:!0,...t})},onFail:e=>r({...wi.ve,loaded:!0,error:e}),pollingOptions:{pollingInterval:588e3}})),[e,t,n])};var Fi=n(74290),Ni=n(56473),Mi=n(56523),Li=n(24285),$i=n(76571),Di=n(97926),Ri=n(17115),Bi=n(31246);const Pi=()=>{const{milestones:e,settingsLoaded:t}=(0,Mi.A)(),{completed:n}=e,o=(0,Di.A)(),s=(0,Ri.Ay)(),i=(0,g.Sk)(),a=(0,Ri.Ex)(),l=(0,Li.xd)("isLoaded"),c=(0,Li.xd)("onboardingFormData"),d=(0,b.vt)(),u=(0,b.ap)("loaded"),h=(0,$i.t5)(d,"channels"),x=(0,$i.t5)(d,"loaded"),m=Array.isArray(h)?h.length:0;return(0,r.useMemo)((()=>{if(!t||!x||!u||!l||!o)return[];const e=!!c?.usageType;return Object.entries(o).filter((e=>{let[,t]=e;return t})).map((e=>{let[t]=e;return t})).filter((e=>n[e]?.completedAt&&!n[e]?.seenAt)).flatMap((e=>(Bi.a7[e]||[]).map((t=>({...t,milestoneId:e}))))).filter((t=>{const r=n[t.milestoneId]?.tasks?.[t.id];return!r&&(e?!!t.segments.includes(s)&&(!(t.permission&&!i[t.permission])&&(!(t.requiresLargeTeam&&!a)&&!(void 0!==t.maxChannels&&m>t.maxChannels))):t.isFeatureAnnouncement)})).slice(0,3).map((e=>e.channelAwareContent&&m>0?{...e,title:e.channelAwareContent.title,description:e.channelAwareContent.description}:e))}),[n,o,s,i,a,m,t,x,u,l,c])};var Oi=n(81187),Vi=n(4703);const Ei=e=>{let{description:t}=e;return`${(0,Ni.PP)({extraKey:"runningAlerts"}).length} ${t}`},_i=e=>{let{onDismiss:t}=e;const{dismissOnboarding:n,resetOnboarding:o,markTaskCompleted:s}=(0,Mi.A)(),i=Pi(),a=(0,Oi.A)(),l=(0,r.useCallback)((e=>s(e.milestoneId,e.id)),[s]),c=(0,r.useCallback)((()=>{n(),t?.()}),[n,t]);return i.length?(0,ae.jsx)(oe.Flex,{column:!0,gap:4,children:(0,ae.jsxs)(oe.Flex,{column:!0,gap:4,background:"panelBg",border:!0,round:2,padding:[6],position:"relative",children:[(0,ae.jsx)(oe.IconButton,{icon:"x",neutral:!0,onClick:c,position:"absolute",top:"8px",right:"8px"}),(0,ae.jsxs)(oe.Flex,{column:!0,gap:1,children:[(0,ae.jsxs)(oe.Flex,{gap:2,alignItems:"center",children:[(0,ae.jsx)(oe.Icon,{name:"checkmark_partial_s",color:"success"}),(0,ae.jsx)(oe.Text,{strong:!0,children:"Continue your journey"})]}),(0,ae.jsx)(oe.TextSmall,{color:"textLite",children:"Here's what you can explore next"})]}),(0,ae.jsx)(oe.Flex,{column:!0,gap:2,children:i.map((e=>(0,ae.jsx)(Vi.A,{task:e,onClick:()=>a(e),onSkip:()=>l(e),children:e.dynamicDescription?(0,ae.jsx)(r.Suspense,{fallback:e.description,children:(0,ae.jsx)(Ei,{description:e.description})}):e.description},`${e.milestoneId}-${e.id}`)))}),!1]})}):null};var Hi=n(56171);const zi=[{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"}],Ki=e=>{let{item:t,onNavigate:n}=e;return(0,ae.jsxs)(oe.Flex,{alignItems:"center",gap:2,width:"100%",children:[(0,ae.jsx)(oe.Icon,{name:t.icon,color:"main"}),(0,ae.jsxs)(oe.Text,{color:"main",children:[t.text," ",(0,ae.jsx)(ge.A,{color:"main",onClick:n,style:{textDecoration:"underline"},children:t.linkText})]})]})},Gi=()=>{const e=(0,f.Zp)(),t=(0,b.bq)(),n=(0,v.QW)(),{dismissedBanners:o,dismissBanner:s}=(0,Mi.A)(),i=(0,r.useMemo)((()=>zi.find((e=>!o[e.id]))),[o]),a=(0,r.useCallback)((()=>{i&&s(i.id)}),[i,s]),l=(0,r.useCallback)((()=>{i?.route&&e(`/spaces/${t}/rooms/${n}/${i.route}`)}),[e,t,n,i]);return i?(0,ae.jsx)(Hi.A,{background:i.background,onClose:a,children:(0,ae.jsx)(Ki,{item:i,onNavigate:l})}):null};var Wi=n(58618),qi=n(42964),Ui=n(82507);const Ji={Live:"live",Stale:"stale",Offline:"offline",Unseen:"unseen"},Zi=(0,mn.default)(oe.Flex).withConfig({displayName:"nodeHero__Container",componentId:"sc-t1z79b-0"})(["position:relative;width:320px;height:320px;"]),Xi=(0,mn.default)(oe.Flex).withConfig({displayName:"nodeHero__ContentContainer",componentId:"sc-t1z79b-1"})(["position:absolute;inset:0;z-index:2;"]),Yi=e=>{let{nodeId:t}=e;const n=(0,f.Zp)(),r=(0,E.xY)(t),{loaded:o,metricsCollected:s=0}=(0,Ii.P9)(),i=(0,b.bq)(),a=(0,v.QW)(),l=(0,ct.GM)(r.state),c=Ji[l]||"offline";return(0,ae.jsxs)(Zi,{children:[(0,ae.jsx)(qi.A,{withOuties:!1}),(0,ae.jsx)(Ui.A,{withOuties:!1}),(0,ae.jsxs)(Xi,{column:!0,justifyContent:"center",alignItems:"center",gap:3,children:[(0,ae.jsx)(oe.TextBig,{color:"primary",children:r.nm}),(0,ae.jsxs)(oe.Flex,{gap:1,alignItems:"center",children:[(0,ae.jsx)(oe.Box,{width:"8px",height:"8px",round:"50%",background:c}),(0,ae.jsx)(oe.TextBig,{color:c,children:l})]})]}),(0,ae.jsxs)(oe.Flex,{column:!0,alignItems:"center",gap:2,position:"absolute",width:"100%",style:{bottom:"-60px"},children:[(0,ae.jsxs)(oe.TextBig,{children:[o?(0,Wi.$t)(s):"..."," metrics collected"]}),(0,ae.jsx)(oe.Button,{label:"View your metrics",icon:(0,ae.jsx)(oe.Icon,{name:"arrow_right"}),iconSide:"right",onClick:()=>{n(`/spaces/${i}/rooms/${a}/overview`)}})]})]})},Qi=(0,Et.A)(oe.Icon),ea=e=>{let{title:t,icon:n,iconColor:r,...o}=e;return(0,ae.jsxs)(oe.Flex,{alignItems:"center",gap:2,...o,children:[n&&(0,ae.jsx)(oe.Icon,{name:n,...r?{color:r}:{}}),(0,ae.jsx)(oe.TextBig,{children:t})]})},ta={ErrNoEligibleNodeRequested:"There are no eligible nodes.",default:"Something went wrong."},na=e=>{let{titleProps:t,loading:n,error:r,children:o,...s}=e;const i={padding:[4],gap:4,background:"panelBg",...t?{column:!0}:{}},a=r?ta[r.errorMsgKey]||ta.default:null;return(0,ae.jsxs)(oe.Flex,{...i,...s,children:[t?(0,ae.jsx)(ea,{...t}):null,n?(0,ae.jsx)(oe.Text,{textAlign:"center",children:"Loading..."}):r?null:(0,ae.jsx)(ae.Fragment,{children:o}),a?(0,ae.jsx)(oe.Flex,{width:"100%",justifyContent:"center",children:(0,ae.jsx)(Qi,{name:"warning_triangle",size:"large",color:"text",tooltip:a})}):null]})},ra=e=>{let{title:t,value:n,loading:r}=e;return(0,ae.jsxs)(na,{column:!0,alignItems:"center",justifyContent:"center",gap:2,padding:[4],width:"180px",children:[(0,ae.jsx)(oe.TextSmall,{color:"textLite",children:t}),(0,ae.jsx)(oe.TextHuge,{strong:!0,children:r?"...":(0,Wi.$t)(n)})]})},oa=()=>{const e=(0,v.ID)(),t=(0,Fe._0)(e),n=(0,Fe.R7)(e),r=Object.keys(n||{}).length;return(0,ae.jsx)(ra,{title:"Charts Visualised",value:r,loading:!t})},sa=()=>(0,ae.jsx)(oe.Flex,{column:!0,gap:4,children:(0,ae.jsx)(oa,{})}),ia=()=>{const e=(0,Ni.PP)({extraKey:"runningAlerts"});return(0,ae.jsx)(ra,{title:"Running Alerts",value:e.length,loading:!1})},aa=()=>(0,ae.jsx)(oe.Flex,{column:!0,gap:4,children:(0,ae.jsx)(r.Suspense,{fallback:(0,ae.jsx)(ra,{title:"Running Alerts",value:"...",loading:!0}),children:(0,ae.jsx)(ia,{})})}),la=e=>{let{position:t}=e;return"left"===t?(0,ae.jsx)(sa,{}):(0,ae.jsx)(aa,{})},ca=()=>((0,Ci.A)(),Ai(),(0,ki.A)(),Si(),Ti(),(0,Fi.A)(),null),da=e=>{let{nodeId:t}=e;return(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(ca,{}),(0,ae.jsx)(Gi,{}),(0,ae.jsxs)(O.A,{gap:4,padding:[4],overflow:"auto",children:[(0,ae.jsxs)(oe.Flex,{gap:4,justifyContent:"center",alignItems:"center",children:[(0,ae.jsx)(la,{position:"left"}),(0,ae.jsx)(Yi,{nodeId:t}),(0,ae.jsx)(la,{position:"right"})]}),rt.OH&&(0,ae.jsx)(_i,{})]})]})},ua=e=>function(){let{title:t="",headerInfo:n,containerProps:r={},TitleComponent:o=oe.TextBigger,...s}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,ae.jsxs)(oe.Flex,{column:!0,gap:2,alignItems:"center",justifyContent:"center",...r,children:[t&&(0,ae.jsxs)(oe.Flex,{gap:2,alignItems:"center",children:[(0,ae.jsx)(o,{children:t}),n]}),(0,ae.jsx)(e,{...s})]})},ha=ua((e=>{let{number:t=0,NumberComponent:n=oe.TextHuge}=e;return(0,ae.jsx)(n,{strong:!0,children:t})})),xa=e=>{const t=e.reduce(((e,t)=>{let{value:n}=t;return e+n}),0);return e.map((e=>({...e,width:`${Math.floor(e.value/t*100)}%`})))},ga=function(){let{data:e=[],testId:t="",numberIndicatorProps:n={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,ae.jsxs)(oe.Flex,{width:"100%",column:!0,gap:2,children:[(0,ae.jsx)(oe.Flex,{justifyContent:"around",children:e.map((e=>{let{label:t,value:r}=e;return(0,ae.jsx)(ha,{title:t,number:r,...n},`${t}-${r}`)}))}),(0,ae.jsx)(oe.ProgressBar,{background:"borderSecondary",border:"none",containerWidth:"100%","data-testid":t,height:2,value:xa(e.filter((e=>{let{omit:t}=e;return!t})))})]})},ma=ua((e=>{let{nodesLoaded:t,total:n,count:o,live:s,offline:i,stale:a,unseen:l,...c}=e;const d=(0,r.useMemo)((()=>[...[{label:"Live",value:s,color:"success"},{label:"Offline",value:i,color:"offline"},{label:"Stale",value:a,color:"stale"}],...l?[{label:"Unseen",value:l,color:"unseen"}]:[]]),[s,i,a,l]);return(0,ae.jsxs)(oe.Flex,{width:"100%",column:!0,alignItems:"center",gap:4,children:[(0,ae.jsxs)(oe.Flex,{gap:2,alignItems:"baseline",children:[t?(0,ae.jsx)(oe.TextHuge,{strong:!0,...c,children:o}):(0,ae.jsx)(oe.Text,{children:"Loading..."}),t&&n!==o&&(0,ae.jsxs)(oe.Text,{children:["of ",n]})]}),(0,ae.jsx)(ga,{data:d,numberIndicatorProps:{TitleComponent:oe.TextBig,NumberComponent:oe.TextBigger}})]})})),pa=e=>{const t=(0,D.nj)(),n=(0,D.CK)(),o=n.length,s=(0,_.eO)({keepAll:!1}),i=(0,r.useMemo)((()=>s.reduce(((e,t)=>{let{isLive:n,isOffline:r,isUnseen:o,state:s}=t;return{live:n?e.live+1:e.live,offline:r?e.offline+1:e.offline,stale:"stale"===s?e.stale+1:e.stale,unseen:o?e.unseen+1:e.unseen}}),{live:0,offline:0,stale:0,unseen:0})),[s]),a=(0,r.useMemo)((()=>{const e=s?.length||"-";return{nodesLoaded:t,total:o,count:e,title:t&&s&&o!==e?"Selected nodes":"Total nodes",...i}}),[t,n,s,o,i]);return(0,ae.jsx)(ma,{...a,...e})};var fa=n(9708);const ja=(0,mn.default)(oe.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"})),ba=(0,r.memo)((e=>{let{title:t,value:n,color:r,onClick:o=null}=e;return(0,ae.jsxs)(oe.Flex,{alignItems:"center",justifyContent:"between",width:"100%",gap:4,flex:{grow:1,shrink:0},children:[(0,ae.jsxs)(oe.Flex,{gap:1,children:[(0,ae.jsx)(oe.Flex,{width:"4px",height:"16px",background:r}),(0,ae.jsxs)(ja,{whiteSpace:"nowrap",onClick:o,children:[t,o&&(0,ae.jsx)(oe.Icon,{color:"textLite",margin:[0,0,0,1],name:"nav_arrow_goto",height:"10px",width:"10px"})]})]}),(0,ae.jsx)(oe.Text,{strong:!0,children:n??"-"})]})})),va=e=>{let{data:t}=e;return(0,ae.jsx)(oe.Flex,{column:!0,alignItems:"start",justifyContent:"center",gap:5,children:t.map(((e,t)=>{let{title:n,value:r,color:o,onClick:s}=e;return(0,ae.jsx)(ba,{title:n,value:r,color:o,onClick:s},`${n}-${r}-${t}`)}))})},ya=e=>{let{data:t,theme:n}=e;return t.map((e=>({...e,color:(0,oe.getColor)(e.color)({theme:n})})))},Ca=e=>{let{chartData:t=[],lineWidth:n=15,animate:o=!0,label:s,hasData:i}=e;const a=(0,r.useContext)(mn.ThemeContext);return(0,ae.jsxs)(oe.Flex,{gap:4,margin:[0,4],height:{min:"70px",max:"130px"},alignItems:"center",children:[(0,ae.jsx)(oe.Flex,{height:"70px",flex:{grow:1,shrink:1},children:i?(0,ae.jsx)(fa.r,{label:()=>s,labelStyle:{fontSize:"34px",fontWeight:700,lineHeight:"38px",fill:(0,oe.getColor)("textDescription")({theme:a})},labelPosition:0,data:ya({data:t,theme:a}),lineWidth:n,animate:o}):(0,ae.jsx)(oe.Icon,{color:"border",name:"pie_chart_skeleton",width:"70px",height:"70px",alignSelf:"center"})}),(0,ae.jsx)(va,{data:t})]})},wa=ua((e=>(0,ae.jsx)(oe.Flex,{gap:2,justifyContent:"between",padding:[2,0,0,0],children:(0,ae.jsx)(Ca,{...e})}))),Ia=e=>{const t=(0,Ni.QD)({extraKey:"alerts"}),{critical:n,warning:o}=(t||[]).reduce(((e,t)=>{let{status:n}=t;return{...e,[n]:e[n]+1}}),{critical:0,warning:0}),s=(0,qs.x7)(),i=(0,r.useMemo)((()=>({chartData:[{title:"Critical",value:n,color:"errorText",onClick:()=>s("critical")},{title:"Warning",value:o,color:"warningText",onClick:()=>s("warning")}],hasData:!!t?.length,label:t?.length})),[n,o,s]);return(0,ae.jsx)(wa,{title:"Active alerts",...i,...e})},Aa=()=>(0,ae.jsxs)(oe.Flex,{"data-testid":"home-nodes-overview-left-section",column:!0,gap:4,basis:"205px",children:[(0,ae.jsx)(pa,{}),(0,ae.jsx)(Xr.A,{}),(0,ae.jsx)(Ia,{})]});var ka=n(63950),Sa=n.n(ka),Ta=n(31522),Fa=n(41395);const Na=e=>{let{label:t,color:n}=e;return(0,ae.jsxs)(oe.Flex,{height:"24px",gap:1,alignItems:"center",children:[(0,ae.jsx)(oe.Flex,{width:"12px",height:"12px",background:n}),(0,ae.jsx)(oe.Text,{children:(0,Fa.Zr)(t)})]})},Ma=e=>{let{colorBy:t}=e;const n=Object.entries(Ta.Cc[t?.value]||{}),r=Ta.Ug[t?.value]||{};return n.length?(0,ae.jsx)(oe.Flex,{"data-testid":"home-nodes-overview-main-section-header-colors-legend",gap:2,children:n.map((e=>{let[t,n]=e;return(0,ae.jsx)(Na,{label:r[t]||t,color:n},t)}))}):null},La=(0,Et.A)(oe.Icon),$a=e=>{let{nodes:t=[],groupBy:n,setGroupBy:o=Sa(),colorBy:s,setColorBy:i=Sa(),onAddNode:a}=e;const l=(0,r.useMemo)((()=>function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce(((e,t)=>{const{labels:n}=t||{};return Object.entries(n||{}).forEach((t=>{let[n,r]=t;e[n]?e[n]=Array.from(new Set([...e[n],r])):e[n]=[r]})),e}),{})}(t)),[t]),c=(0,r.useMemo)((()=>function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.keys(e).map((e=>({label:`label:${e}`,value:`label:${e}`})))}(l).sort(((e,t)=>e.value.localeCompare(t.value,void 0,{sensitivity:"accent",ignorePunctuation:!0})))),[l]),d=(0,r.useMemo)((()=>[...Ta.XJ,...c]),[c]);return(0,ae.jsxs)(oe.Flex,{"data-testid":"home-nodes-overview-main-section-header",alignItems:"end",justifyContent:"between",children:[(0,ae.jsxs)(oe.Flex,{gap:3,alignItems:"end",children:[(0,ae.jsxs)(oe.Flex,{column:!0,gap:1,children:[(0,ae.jsxs)(oe.Flex,{alignItems:"center",gap:1,children:[(0,ae.jsx)(oe.Text,{color:"menuItem",children:"Group by"}),(0,ae.jsx)(La,{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,ae.jsx)(oe.Select,{isMulti:!0,options:d,value:n,onChange:o,...c?.length>0?{styles:{minWidth:"250px"}}:{}})]}),(0,ae.jsxs)(oe.Flex,{column:!0,gap:1,children:[(0,ae.jsx)(oe.Text,{color:"menuItem",children:"Color by"}),(0,ae.jsx)(oe.Select,{options:Ta.Hn,value:s,onChange:i})]}),(0,ae.jsx)(Ma,{colorBy:s})]}),(0,ae.jsx)(ve.A,{flavour:"borderless",icon:"add_node",iconColor:"text",onClick:a})]})},Da=(0,mn.default)(oe.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,oe.getColor)(t||"offline")}),(e=>{let{onClick:t}=e;return t?"pointer":"default"}),(e=>{let{isDisabled:t}=e;return t?"0.5":"1"})),Ra=(0,mn.default)(oe.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,oe.getColor)(t||"offline")}),(e=>{let{isDisabled:t}=e;return t?"0.5":"1"})),Ba=(0,mn.default)(oe.Icon).withConfig({displayName:"styled__AddNodeIcon",componentId:"sc-9bx1cv-2"})(["position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);"]),Pa=(0,mn.default)(oe.Box).withConfig({displayName:"styled__Groups",componentId:"sc-9bx1cv-3"})(["width:100%;display:grid;grid-template-columns:repeat(2,1fr);gap:16px;"]),Oa=(0,mn.default)(oe.Flex).withConfig({displayName:"styled__NodeContainer",componentId:"sc-9bx1cv-4"})(["opacity:",";"],(e=>{let{isActive:t}=e;return t?"1":".3"})),Va=(0,Et.A)((e=>{let{children:t,innerProps:n={},containerProps:r={},...o}=e;return(0,ae.jsx)(Oa,{margin:[0,0,.5,0],...o,children:(0,ae.jsx)(Da,{...r,children:(0,ae.jsx)(Ra,{...n,children:t})})})})),Ea=e=>{let{type:t,onClick:n}=e;const o=(0,v.XA)(),s=(0,b.dg)(),i=(0,g.JT)("node:Create"),a=(0,r.useMemo)((()=>({background:"success",isDisabled:!i,...i?{onClick:()=>n({type:t})}:{}})),[i]),l=i?"Add node":s?"You are viewing your local node, connect to cloud and connect multiple nodes to view at once":`Only admin users can add nodes to ${o.name}`;return(0,ae.jsx)(ae.Fragment,{children:(0,ae.jsx)(Va,{containerProps:a,innerProps:{background:"panelBg"},tooltip:l,isActive:!0,children:(0,ae.jsx)(Ba,{name:"plus",color:"success"})})})},_a=Va;var Ha=n(89284),za=n(91100);const Ka=e=>{let{architecture:t,cpuFrequency:n,cpus:r,diskSpace:o,memory:s,os:i,osName:a}=e;const l=[(0,ct.O)(n),(0,ct.ws)(r,1===r?"Core":"Cores"),(0,ct.ws)(t),(0,ct.ws)((0,ct.RI)(s),"RAM"),(0,ct.ws)((0,ct.RI)(o),"HD")];return(0,ae.jsxs)(oe.Flex,{column:!0,gap:1,children:[(0,ae.jsxs)(oe.Flex,{gap:1,children:[(0,ae.jsx)(oe.Icon,{"data-testid":"node-system-info-icon",name:nt.u[a]?.iconName||nt.U[i]?.iconName||"os",width:"16px",height:"16px",color:"text"}),(0,ae.jsx)(oe.Flex,{children:(0,ct.ws)(a)})]}),l.map(((e,t)=>(0,ae.jsxs)(oe.Text,{children:["\u2022 ",e]},t)))]})};var Ga=n(23208);const Wa=e=>{let{isStable:t}=e;const n=t?{icon:"checkmark_s",color:"primary",borderColor:"primary"}:{icon:"warning_triangle",color:"stale",borderColor:"stale"};return(0,ae.jsx)(oe.Pill,{hollow:!0,...n,children:t?"Stable":"Unstable"})},qa=function(){let{id:e,name:t,state:n,hw:o,os:s,isStable:i,setActiveNodes:a}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const l=(0,Ii.c8)(),{nodes:c}=l||{},d=c?.[e];return(0,r.useEffect)((()=>{if("function"===typeof a){const{children:t,parents:n}=d||{},r=d?[...[...n,...t].map((e=>{let{id:t}=e;return t}))||[],e]:[e];a({isHover:!0,nodes:r})}return()=>{"function"===typeof a&&a(Ta.vd)}}),[e,d]),(0,ae.jsxs)(oe.Flex,{column:!0,gap:3,width:{min:40},background:"mainBackground",padding:[2,4],children:[(0,ae.jsx)(oe.TextBig,{strong:!0,children:t}),(0,ae.jsxs)(oe.Flex,{column:!0,gap:1,children:[(0,ae.jsx)(oe.Text,{children:"Status"}),(0,ae.jsx)(oe.Flex,{children:(0,ae.jsx)(Ha.A,{state:n})})]}),(0,ae.jsxs)(oe.Flex,{column:!0,gap:1,children:[(0,ae.jsx)(oe.Text,{children:"Connection"}),(0,ae.jsx)(oe.Flex,{children:(0,ae.jsx)(Wa,{isStable:i})})]}),(0,ae.jsxs)(oe.Flex,{column:!0,gap:1,children:[(0,ae.jsx)(oe.Text,{children:"Alerts"}),(0,ae.jsx)(za.A,{id:e})]}),(0,ae.jsx)(Xr.A,{color:"textLite"}),(0,ae.jsx)(Ka,{architecture:o.architecture,cpuFrequency:o.cpuFrequency,cpus:o.cpus,"data-testid":"nodeRow-system-info",diskSpace:o.diskSpace,memory:o.memory,name:t,osName:s.nm,os:s.id}),(0,ae.jsx)(Xr.A,{color:"textLite"}),(0,ae.jsx)(Ga.A,{id:e})]})},Ua=function(){let{colorBy:e={},node:t={},isStable:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{value:o}=e,s=Ta.AZ[o],i=(0,_r.Xt)(t.id),{critical:a,warning:l}=(0,Rs.AO)(i),c=Ta.Cc[o];let d=c[s?.(t)?.group?.toLowerCase()];if(o==Ta.w9.stability.value){d=c[n?"stable":"unstable"]}return{borderColor:(0,r.useMemo)((()=>(e=>{let{critical:t,warning:n}=e;return t?"error":n?"warning":null})({critical:a,warning:l})||d),[d,a,l]),background:d}},Ja=e=>{let{colorBy:t,stability:n={},setActiveNodes:o,...s}=e;const{isStable:i}=n[s.id]||{},{borderColor:a,background:l}=Ua({colorBy:t,node:s,isStable:i}),[,c]=(0,Ii.A$)(),d=(0,r.useCallback)((()=>c(s.id)),[s.id,c]);return(0,ae.jsx)(_a,{containerProps:{background:a,onClick:d},innerProps:{background:l},tooltip:(0,ae.jsx)(qa,{isStable:i,setActiveNodes:o,...s}),...s})};var Za=n(67462);const Xa=e=>t=>{let{title:n,...o}=t;const s=(0,r.useMemo)((()=>"nolabel"===n?`${o.groupBy} (No value)`:`${o.groupBy}=${n}`),[n,o.groupBy]);return n?(0,ae.jsxs)(oe.Flex,{width:"100%",column:!0,gap:2,children:[(0,ae.jsxs)(oe.Flex,{justifyContent:"between",border:{side:"bottom",color:"border"},children:[(0,ae.jsx)(oe.Text,{strong:!0,color:"menuItem",children:s}),o.nodes?.length?(0,ae.jsx)(oe.Text,{color:"menuItem",children:`${o.nodes.length} ${(0,Za.su)(o.nodes.length)}`}):null]}),(0,ae.jsx)(e,{...o})]}):(0,ae.jsx)(e,{...o})},Ya=(0,r.memo)((e=>{let{nodes:t=[],type:n,stability:o={},groupBy:s,colorBy:i,onAddNode:a,...l}=e;const[c,d]=(0,r.useState)(Ta.vd),{isHover:u,nodes:h}=c,x=s?.canAddNodes;return(0,ae.jsxs)(oe.Flex,{flexWrap:!0,...l,children:[t.map((e=>(0,ae.jsx)(Ja,{colorBy:i,stability:o,isActive:!u||h.includes(e.id),setActiveNodes:d,...e},e.id))),x?(0,ae.jsx)(Ea,{type:n,onClick:a}):null]})})),Qa=Xa((e=>t=>{const{stability:n}=(0,Ii.SW)();return(0,ae.jsx)(e,{stability:n,...t})})(Ya)),el=e=>t=>{const n=Ta.AZ[e],r=(0,Ta.Hl)(e);return t.reduce(((e,t)=>{const{group:o="unknown",type:s}=n(t);return e[o]?e[o].nodes=[...e[o].nodes,t]:e[o]={title:r(o)||"unknown",type:s,nodes:[t]},e}),{})},tl={os:el("os"),version:el("version"),status:el("status"),technology:el("technology"),replication:el("replication"),cloudProvider:el("cloudProvider"),cloudRegion:el("cloudRegion"),instanceType:el("instanceType"),none:e=>({none:{nodes:e}})},nl=e=>{let{value:t,nodes:n}=e;return t.startsWith("label:")?(r=t.replace(/^label:/,""),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,n)=>{const{labels:r}=n||{},o=r[e]||"nolabel";return o&&(t[o]?t[o]=[...t[o],n]:t[o]=[n]),t}),{})}(e,r);return Object.entries(t).reduce(((e,t)=>{let[n,r]=t;return{...e,[n]:{title:n,nodes:r}}}),{})})?.(n):tl[t]?.(n);var r},rl=()=>(0,ae.jsx)(oe.Flex,{children:(0,ae.jsx)(oe.TextBig,{color:"menuItem",children:"No nodes found"})}),ol=e=>{let{nodes:t,groupBy:n,title:o,groupByValue:s,children:i}=e;const{value:a}=Array.isArray(n)&&n.length>0?n[0]:Ta.nv,l=nl({value:a,nodes:t}),c=(0,r.useMemo)((()=>Object.keys(l).length),[l]);return(0,ae.jsxs)(oe.Flex,{"data-testid":`nodes-group-${s}-${o}`,column:!0,gap:2,padding:[2,4],round:2,border:{side:"all",color:"border"},children:[(0,ae.jsxs)(oe.Flex,{alignItems:"center",justifyContent:"between",children:[(0,ae.jsxs)(oe.Text,{strong:!0,color:"menuItem",children:[s,": ",o]}),c>1?(0,ae.jsxs)(oe.Text,{color:"menuItem",children:[t.length," ",(0,Za.su)(t.length)]}):null]}),i]},o)},sl=e=>{let{nodes:t,groupBy:n,colorBy:o,onAddNode:s}=e;const{value:i}=Array.isArray(n)&&n.length>0?n[0]:Ta.nv,a=nl({value:i,nodes:t}),l=(0,r.useMemo)((()=>Object.values(a)),[a]);if(!a)return(0,ae.jsx)(rl,{});if(!l.length)return(0,ae.jsx)(rl,{});if(n?.value===Ta.nv.value){const{nodes:e}=l[0];return(0,ae.jsx)(Qa,{nodes:e,groupBy:n,colorBy:o,onAddNode:s})}if(n.length>1)return(0,ae.jsx)(oe.Flex,{column:!0,gap:4,children:l.map((e=>{let{title:t,nodes:r}=e;return(0,ae.jsx)(ol,{groupBy:n.slice(1),nodes:r,title:t,groupByValue:i,children:(0,ae.jsx)(sl,{nodes:r,groupBy:n.slice(1),colorBy:o,onAddNode:s})},t)}))});const c=1===l.length||n.length>1?oe.Flex:Pa;return(0,ae.jsx)(c,{children:l.map(((e,t)=>{let{title:n,type:r,nodes:a}=e;return(0,ae.jsx)(Qa,{title:n,type:r,nodes:a,groupBy:i,colorBy:o,onAddNode:s,margin:[0,0,2,0]},n||t)}))})},il=sl,al=()=>(0,ae.jsxs)(oe.Flex,{width:"100%",column:!0,gap:2,padding:[2,0],children:[(0,ae.jsxs)(oe.Flex,{gap:2,children:[(0,ae.jsx)(pn.A,{width:"22px",height:"22px",round:2}),(0,ae.jsx)(pn.A,{width:"22px",height:"22px",round:2}),(0,ae.jsx)(pn.A,{width:"22px",height:"22px",round:2}),(0,ae.jsx)(pn.A,{width:"22px",height:"22px",round:2}),(0,ae.jsx)(pn.A,{width:"22px",height:"22px",round:2}),(0,ae.jsx)(pn.A,{width:"22px",height:"22px",round:2})]}),(0,ae.jsxs)(oe.Flex,{gap:2,children:[(0,ae.jsx)(pn.A,{width:"22px",height:"22px",round:2}),(0,ae.jsx)(pn.A,{width:"22px",height:"22px",round:2}),(0,ae.jsx)(pn.A,{width:"22px",height:"22px",round:2}),(0,ae.jsx)(pn.A,{width:"22px",height:"22px",round:2}),(0,ae.jsx)(pn.A,{width:"22px",height:"22px",round:2}),(0,ae.jsx)(pn.A,{width:"22px",height:"22px",round:2})]})]}),ll=()=>{const[e,t]=(0,r.useState)([]),[n,o]=(0,r.useState)(Ta.jZ),[s,i]=(0,r.useState)(),a=(0,v.ID)(),l=(0,D.gr)(a,"loaded"),c=(0,_.eO)({keepAll:!1}),d=(0,r.useCallback)((e=>{i(e)}),[i]),u=(0,r.useCallback)((()=>i()),[i]);return(0,ae.jsxs)(oe.Flex,{"data-testid":"home-nodes-overview-main-section",column:!0,gap:4,basis:"calc(100% - 410px)",children:[(0,ae.jsx)($a,{nodes:c,groupBy:e,setGroupBy:t,colorBy:n,setColorBy:o,onAddNode:d}),(0,ae.jsx)(oe.Flex,{height:{max:150},overflow:{vertical:"auto"},children:l?(0,ae.jsx)(il,{nodes:c,groupBy:e,colorBy:n,onAddNode:d}):(0,ae.jsx)(al,{})}),s&&(0,ae.jsx)(ye.A,{nodeType:s?.type,onClose:u})]})},cl=()=>(0,ae.jsxs)(oe.Flex,{width:"100%",column:!0,gap:2,padding:[2,0],children:[(0,ae.jsxs)(oe.Flex,{justifyContent:"between",children:[(0,ae.jsx)(pn.A,{width:"30%"}),(0,ae.jsx)(pn.A,{width:"30%"}),(0,ae.jsx)(pn.A,{width:"30%"})]}),(0,ae.jsxs)(oe.Flex,{justifyContent:"between",children:[(0,ae.jsx)(pn.A,{width:"30%"}),(0,ae.jsx)(pn.A,{width:"30%"}),(0,ae.jsx)(pn.A,{width:"30%"})]}),(0,ae.jsx)(pn.A,{})]}),dl=()=>{const{loaded:e,totalChildren:t,totalParents:n,totalStandalone:o}=(0,Ii.c8)(),s=(0,r.useMemo)((()=>[{label:"Parents",value:n,color:["blue","indigo"]},{label:"Children",value:t,color:["purple","lilac"]},{label:"Standalone",value:o,color:["yellow","yellow120"]}]),[t,n]);return e?(0,ae.jsx)(ga,{numberIndicatorProps:{TitleComponent:oe.Text},data:s}):(0,ae.jsx)(cl,{height:"58px"})},ul=()=>(0,ae.jsxs)(oe.Flex,{width:"100%",column:!0,gap:2,padding:[2,0],children:[(0,ae.jsxs)(oe.Flex,{justifyContent:"between",children:[(0,ae.jsx)(pn.A,{width:"30%"}),(0,ae.jsx)(pn.A,{width:"30%"}),(0,ae.jsx)(pn.A,{width:"30%"})]}),(0,ae.jsxs)(oe.Flex,{justifyContent:"between",children:[(0,ae.jsx)(pn.A,{width:"30%"}),(0,ae.jsx)(pn.A,{width:"30%"}),(0,ae.jsx)(pn.A,{width:"30%"})]}),(0,ae.jsx)(pn.A,{})]}),hl=()=>(0,ae.jsxs)(oe.Flex,{column:!0,gap:1,alignItems:"center",width:"220px","data-testid":"nodesByDataReplication-information-text",overflow:"hidden",children:[(0,ae.jsxs)(oe.TextMicro,{children:[(0,ae.jsx)(oe.TextMicro,{strong:!0,children:"None:"})," The node's data are only on the node itself. Lose the node, lose the data!"]}),(0,ae.jsxs)(oe.TextMicro,{children:[(0,ae.jsx)(oe.TextMicro,{strong:!0,children:"Single:"})," The node's metrics are replicated to one parent. The parent can trigger alerts for the child."]}),(0,ae.jsxs)(oe.TextMicro,{children:[(0,ae.jsx)(oe.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,ae.jsx)(oe.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."})]}),xl=()=>(0,ae.jsx)(_e.A,{isBasic:!0,plain:!0,content:hl,align:"bottom",children:(0,ae.jsx)(oe.Icon,{name:"information",color:"textDescription",size:"small"})}),gl=ua((()=>{const e=(0,Ii.c8)(),{loaded:t,replicationFactor:n}=e||{},o=(0,r.useMemo)((()=>[{label:"None",value:n?.r_1||0,color:Ta.q5.r_1},{label:"Single",value:n?.r_2||0,color:Ta.q5.r_2},{label:"Multi",value:n?.["r_*"]||0,color:Ta.q5["r_*"]}]),[n]);return t?(0,ae.jsx)(ga,{data:o}):(0,ae.jsx)(ul,{})})),ml=()=>(0,ae.jsx)(gl,{title:"Data Replication",headerInfo:(0,ae.jsx)(xl,{})}),pl=()=>(0,ae.jsxs)(oe.Flex,{"data-testid":"home-nodes-overview-right-section",column:!0,gap:4,basis:"205px",children:[(0,ae.jsx)(dl,{}),(0,ae.jsx)(Xr.A,{}),(0,ae.jsx)(ml,{})]}),fl=()=>(0,ae.jsxs)(na,{children:[(0,ae.jsx)(Aa,{}),(0,ae.jsx)(Xr.A,{vertical:!0}),(0,ae.jsx)(ll,{}),(0,ae.jsx)(Xr.A,{vertical:!0}),(0,ae.jsx)(pl,{})]});var jl=n(66118),bl=n(44731);jl.t1.register(jl.PP,jl.kc,jl.A6,jl.E8,jl.m_,jl.s$);const vl={borderWidth:0,maxBarThickness:15,minBarLength:0},yl=function(){let{alertsStats:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.useContext)(mn.ThemeContext),{hosts:n}=e?.nodes||{},o={animation:!1,maintainAspectRatio:!1,plugins:{legend:{display:!1}},responsive:!0,scales:{x:{stacked:!0,grid:{color:(0,oe.getColor)("borderSecondary")({theme:t})},afterSetDimensions:e=>{e.maxHeight=50},ticks:{precision:0,callback:(e,t)=>{let n=s.labels[t];if(!n)return;let r=0;for(;n?.length>20;)n=(0,Fa.P3)(n,r),r+=1;return n}}},y:{stacked:!0,grid:{color:(0,oe.getColor)("borderSecondary")({theme:t})},afterSetDimensions:e=>{e.maxWidth=50}}}},s=(0,r.useMemo)((()=>{if(!n)return{datasets:[],labels:[]};const[e,t]=Object.entries(n).sort(((e,t)=>t[1].total-e[1].total)).reduce(((e,t)=>{let[n,{critical:r,warning:o}]=t;return e[0].push(n),e[1].critical?e[1].critical=[...e[1].critical,r]:e[1].critical=[r],e[1].warning?e[1].warning=[...e[1].warning,o]:e[1].warning=[o],e}),[[],{}]);return{datasets:Object.entries(t).map((e=>{let[t,n]=e;return{...vl,backgroundColor:"critical"===t?"#DB162F":"#FF9700",data:n,label:t}})),labels:e}}),[n]);return s.datasets?(0,ae.jsx)(oe.Flex,{width:"100%",height:40,children:(0,ae.jsx)(bl.yP,{data:s,options:o})}):null},Cl=e=>{let{alertsStats:t}=e;const{nodes:n}=t||{},{critical:o,warning:s,total:i}=n||{},a=(0,r.useMemo)((()=>[{label:"Warning",value:s,color:["yellow","yellow80"]},{label:"Critical",value:o,color:["red","red100"]},{label:"Total",value:i,color:["purple","lilacFocus"],omit:!0}]),[o,s,i]);return n?(0,ae.jsx)(ga,{data:a}):null},wl=[{id:"name",accessorKey:"name",header:"Alert name",fullWidth:!0,cell:e=>{let{getValue:t,row:n}=e;const o=t(),{goToAlerts:s}=ui(),i=(0,r.useCallback)((e=>{e.preventDefault(),s({name:o,instance:n?.original?.chart})}),[s]);return(0,ae.jsx)(_e.A,{content:"Go to events tab. Timeframe will be set to the last 24 hours.",isBasic:!0,children:(0,ae.jsx)(oe.Box,{children:(0,ae.jsx)(ge.A,{onClick:i,children:o})})})}},{id:"chart",name:"chart",fullWidth:!0,header:"Instance"},{id:"occurrences",name:"occurrences",header:"Occurrences"},{id:"duration",name:"duration",header:"Duration (seconds)"}],Il=function(){let{data:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.length?(0,ae.jsx)(oe.Flex,{height:{max:50},overflow:{vertical:"auto"},children:(0,ae.jsx)(oe.Table,{data:e,dataColumns:wl,sortBy:[{id:"occurrences",desc:!0}],enableResizing:!0})}):null},Al={title:"Nodes with the most alerts in the last 24h"},kl=e=>{const t=(0,Ii.jg)();return t.loaded?(0,ae.jsxs)(na,{"data-testid":"home-alert-nodes",titleProps:Al,...e,children:[(0,ae.jsx)(yl,{alertsStats:t}),(0,ae.jsx)(Cl,{alertsStats:t}),(0,ae.jsxs)(oe.Flex,{column:!0,gap:4,children:[(0,ae.jsx)(oe.TextBig,{children:"Top alerts in the last 24 h"}),(0,ae.jsx)(Il,{data:t?.alerts})]})]}):(0,ae.jsx)(d.nl,{})},Sl={title:"Metrics available",justifyContent:"center"},Tl=e=>{const{loaded:t,metricsCollected:n=0,error:r}=(0,Ii.P9)();return t?(0,ae.jsx)(na,{"data-testid":"home-metrics",titleProps:Sl,error:r?.response?.data,...e,children:(0,ae.jsx)(oe.Flex,{width:"100%",justifyContent:"center",children:(0,ae.jsx)(oe.TextHuge,{strong:!0,children:(0,Wi.$t)(n)})})}):(0,ae.jsx)(d.Tr,{title:"Metrics available",...e})},Fl={title:"Charts visualized",justifyContent:"center"},Nl=e=>{const t=(0,v.ID)(),n=(0,Fe._0)(t),r=(0,Fe.rx)(t),o=(0,Fe.R7)(t),s=Object.keys(o||{}).length;return n||r?(0,ae.jsx)(na,{"data-testid":"home-charts-data",titleProps:Fl,error:r,...e,children:(0,ae.jsx)(oe.Flex,{width:"100%",justifyContent:"center",children:(0,ae.jsx)(oe.TextHuge,{strong:!0,children:(0,Wi.$t)(s)})})}):(0,ae.jsx)(d.Tr,{...e})},Ml={title:"Alerts configured",justifyContent:"center"},Ll=e=>{const{loaded:t,value:n}=(0,Rs.oU)();return t?(0,ae.jsx)(na,{"data-testid":"home-alerts-data",titleProps:Ml,...e,children:(0,ae.jsx)(oe.Flex,{width:"100%",justifyContent:"center",children:(0,ae.jsx)(oe.TextHuge,{strong:!0,children:(0,Wi.$t)(n?.length||0)})})}):(0,ae.jsx)(d.Tr,{...e})};jl.t1.register(jl.PP,jl.kc,jl.A6,jl.E8,jl.m_,jl.s$);const $l=function(){let{dataRetention:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.useContext)(mn.ThemeContext),n={animation:!1,maintainAspectRatio:!1,plugins:{legend:{display:!1}},responsive:!0,scales:{x:{stacked:!0,grid:{color:(0,oe.getColor)("borderSecondary")({theme:t})},afterSetDimensions:e=>{e.maxHeight=50},ticks:{precision:0,callback:(e,t)=>{let n=o.labels[t];if(!n)return;let r=0;for(;n?.length>20;)n=(0,Fa.P3)(n,r),r+=1;return n}}},y:{stacked:!0,grid:{color:(0,oe.getColor)("borderSecondary")({theme:t})},afterSetDimensions:e=>{e.maxWidth=50}}}},o=(0,r.useMemo)((()=>{if(!e?.length)return{datasets:[],labels:[]};const{values:t,labels:n}=e.reduce(((e,t)=>{let{label:n,value:r}=t;return e.labels.push(n),e.values.push(r),e}),{values:[],labels:[]});return{datasets:[{borderWidth:0,maxBarThickness:10,backgroundColor:"#0A81AB",minBarLength:0,data:t,label:"Nodes"}],labels:n}}),[e]);return o.datasets?(0,ae.jsx)(oe.Flex,{width:"100%",height:"100%",children:(0,ae.jsx)(bl.yP,{data:o,options:n})}):null},Dl={title:"Data retention per Nodes"},Rl=e=>{const{dataRetention:t}=(0,Ii.P9)();return(0,ae.jsx)(na,{"data-testid":"home-data-retention",titleProps:Dl,...e,children:(0,ae.jsx)($l,{dataRetention:t})})},Bl=()=>((0,Ci.A)(),Ai(),(0,ki.A)(),Si(),Ti(),(0,Fi.A)(),null),Pl=new Date("2025-12-01").getTime(),Ol=()=>{const e=(0,D.CK)(),t=(0,D.nj)(),n=(0,b.ap)("createdAt");if(!t)return(0,ae.jsx)(d.WV,{});if(!e.length)return(0,ae.jsx)(B.Ay,{feature:"Home",mode:"NoNodesView",children:(0,ae.jsx)(R.A,{})});const r=new Date(n).getTime()>Pl;return rt.OH&&1===e.length&&r?(0,ae.jsx)(B.Ay,{feature:"Home",mode:"SingleNodeHome",children:(0,ae.jsx)(da,{nodeId:e[0]})}):(0,ae.jsxs)(B.Ay,{feature:"Home",children:[(0,ae.jsx)(Bl,{}),(0,ae.jsxs)(O.A,{gap:4,padding:[4],overflow:"auto",children:[rt.OH&&(0,ae.jsx)(_i,{}),(0,ae.jsx)(fl,{}),(0,ae.jsxs)(oe.Flex,{gap:4,children:[(0,ae.jsx)(kl,{width:"60%"}),(0,ae.jsxs)(oe.Flex,{column:!0,gap:4,height:"100%",width:"calc(40% - 16px)",children:[(0,ae.jsxs)(oe.Flex,{gap:4,children:[(0,ae.jsx)(Tl,{flex:{grow:"1",shrink:"0"}}),(0,ae.jsx)(Nl,{flex:{grow:"1",shrink:"0"}}),(0,ae.jsx)(Ll,{flex:{grow:"1",shrink:"0"}})]}),(0,ae.jsx)(Rl,{flex:"grow"})]})]})]})]})};var Vl=n(7234),El=n(89711);var _l=n(84060),Hl=n(31035),zl=n(2863),Kl=n(49916);var Gl=n(46587);const Wl=()=>{const e=(0,b.vt)(),t=(0,E.nl)(),n=(0,o.ES)(e),r=(0,Gl.uW)("isAnonymous"),{value:s}=(0,E.BQ)(t),i=s?.agents?.[0]||{},a="windows"==(i.application?.os?.kernel||"").toLowerCase();return{hasAccess:!(n&&r&&a),reason:"windowsAgent"}};var ql=n(14457),Ul=n(93933),Jl=n(15524);const Zl=mn.default.div.withConfig({displayName:"styled__Separator",componentId:"sc-1fhfk7c-0"})(["background:",";height:20px;width:1px;"],(0,oe.getColor)("border")),Xl=e=>{let{flavour:t,...n}=e;const o=(0,E.nl)(),s=(0,_r.Xt)(o),{critical:i,warning:a}=(0,Rs.AO)(s),l=(0,z.Fw)("sidebarTab",{flavour:"val",extraKey:t}),c=(0,z.Fw)("sidebarOpen",{flavour:"bool"}),d=(0,r.useCallback)((e=>{c(!0),l(e)}),[c,l]),{id:u,hw:h={},cpus:x,isLive:g,name:m,os:p={},state:f,updateSeverity:j,labels:b,version:v,health:y,capabilities:C}=(0,E.xY)(o),{silencingState:w}=y?.alerts||{},I={dataTestId:"singleNode",isLive:g},A=(0,ct.t3)({count:i,type:"critical",...I}),k=(0,ct.t3)({count:a,type:"warning",...I}),S=(0,ct.GM)(f),T=(0,ct.Pg)(h.container,h.virtualization),F=(0,Qo.A)("(min-width: 1760px)"),N=(0,E.TC)();return(0,ae.jsxs)(oe.Flex,{alignItems:"center",background:"panelBg",border:{side:"all",color:"border"},"data-testid":"singleNode-badges-container",flex:!1,gap:1,padding:[1,2],round:1,...n,children:[(0,ae.jsx)(oe.TextSmall,{"data-testid":`singleNode-${m}`,strong:!0,children:m}),(0,ae.jsx)(Ct.A,{badge:"info","data-testid":"singleNode-nodeInfo-cta",children:(0,ae.jsx)(oe.IconButton,{flavour:"borderless",cursor:"pointer",onClick:()=>{N(u),d("info")},icon:"information",iconColor:"nodeBadgeColor",width:"18px",height:"18px"})}),(0,ae.jsx)(Zl,{"data-testid":"singleNode-separator"}),(0,ae.jsx)(Ct.A,{badge:"alerts",nodeName:m,children:(0,ae.jsx)(oe.AlertMasterCard,{onClick:A.text||k.text?()=>N(u,{},"/alerts"):null,pillLeft:A,pillRight:k})}),(0,ae.jsx)(Zl,{"data-testid":"singleNode-separator"}),(0,ae.jsx)(on,{node:{id:u,name:m,isLive:g,capabilities:C},padding:[0,1]}),j&&(0,ae.jsx)(zt.A,{"data-testid":"singleNode-update-cta",name:m,os:p.id,container:h.container,warningLevel:j,labels:b,version:v,text:j}),(0,ae.jsx)(Zl,{"data-testid":"singleNode-separator"}),(0,ae.jsx)(Ct.A,{badge:"connectivity",connectivityState:S,"data-testid":"singleNode-connectivityStateInfo",nodeName:m,children:(0,ae.jsx)(oe.Pill,{flavour:"neutral",hollow:!0,children:S})}),(0,ae.jsx)(Ct.A,{badge:"type","data-testid":"singleNode-nodeTypeInfo",nodeName:m,nodeType:T.label,children:(0,ae.jsx)(oe.Pill,{flavour:"neutral",hollow:!0,icon:T.icon,children:T.label})}),F&&(0,ae.jsx)(Ct.A,{badge:"systemInfo","data-testid":"singleNode-systemInfo",nodeName:m,children:(0,ae.jsxs)(oe.Pill,{flavour:"neutral",hollow:!0,icon:nt.u[p.nm]?.iconName||nt.U[p.id]?.iconName||"os",children:[(0,ct.O)(h.cpuFrequency)," (",x," ",1===h.cpus?"Core":"Cores",") -"," ",(0,ct.RI)(h.memory)," RAM - ",(0,ct.RI)(h.diskSpace)]})}),(0,ae.jsx)(Ot.A,{flavour:"node",silencing:w})]})},Yl=()=>{const e=(0,E.aH)(),t=(e=>(0,r.useMemo)((()=>({overview:{id:"overview",title:"Metrics",icon:"room_overview",path:`${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:`${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:`${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:`${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:`${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:`${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,r.useMemo)((()=>[t.overview,t.top,t.logs,t.alerts,t.ar,t.events].filter(Boolean)),[e])};var Ql=n(10444);const ec=(0,mn.default)(oe.Box).attrs((e=>({width:"6px",height:"6px",round:"50%",...e}))).withConfig({displayName:"withNotification__NotificationDot",componentId:"sc-ka7a4g-0"})([""]),tc=e=>t=>{let{notificationBg:n,...r}=t;return n?(0,ae.jsxs)(oe.Flex,{position:"relative",gap:1,padding:[0,0,0,1.5],children:[(0,ae.jsx)(ec,{background:n,position:"absolute",top:-2,left:0}),(0,ae.jsx)(e,{...r})]}):(0,ae.jsx)(e,{...r})},nc=(0,mn.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);}"]),rc=(0,mn.default)(oe.Icon).attrs({name:"long_arrow_up",color:"successText"}).withConfig({displayName:"tabLink__DropHereIcon",componentId:"sc-1h4dha1-0"})(["animation:"," 1s ease-in infinite;"],nc),oc=e=>{let{active:t,highlight:n,iconColor:r}=e;return r||(n||t?"primary":"textDescription")},sc=tc(oe.Icon),ic=e=>{let{id:t,to:n,params:o,exact:s,icon:i,iconColor:a,title:l,fixed:c,dataGa:d,testId:u,children:h,type:x,tooltip:g,showBorderLeft:m,droppable:p,droppableProps:j={},ref:b,isDynamic:v,highlight:y,...C}=e;const{sendLog:w}=(0,rn.A)(),{setNodeRef:I,active:A}=(0,He.zM)({id:`droppable-tab-${t}`,disabled:!p,data:j}),k=(0,f.RQ)(s?n:`${n}/*`),S=(0,f.Zp)(),F=(0,Ql.J)(),N=!!k,M="nodes"!==x||N,L=(0,r.useCallback)((()=>{if(N)return;const e=`${n}${o?`/${o}`:""}`;S(e),w({feature:"Navigation",description:"Single page navigation using static tabs",tab:t,path:e})}),[t,n,N,o,w]),$=p&&A&&A.data.current?.dashboardable,D=(0,r.useRef)(),[R]=(0,T.m0)({tabId:t}),B=(0,r.useCallback)((e=>{let{button:t}=e;v&&1===t&&"function"===typeof C.onRemove&&C.onRemove(C.index,N)}),[v,C.index,N,C.onRemove]);return(0,ae.jsx)(_e.A,{content:g||l,align:g?"bottom":"top",isBasic:"string"===typeof(g||l),...y?{color:"primary"}:{},children:(0,ae.jsxs)(oe.NavigationTab,{ref:(0,oe.mergeRefs)(I,b,D),fixed:c,active:N,showBorderLeft:m,icon:(0,ae.jsx)(sc,{name:i,size:"small",color:oc({active:N,highlight:y,iconColor:a}),notificationBg:R?.color}),onActivate:L,"data-ga":d,"data-testid":u,"aria-selected":N,...$&&{rootProps:{background:"successSemi",cursor:"alias"}},onMouseUp:B,...C,children:[!F&&!!l&&(0,ae.jsx)(oe.Text,{alignSelf:"center",strong:y,color:oc({active:N,highlight:y,iconColor:a}),whiteSpace:"nowrap",children:l}),D.current&&$&&(0,ae.jsx)(oe.Drop,{target:D.current,align:{top:"bottom"},stretch:!1,hideShadow:!0,zIndex:1,children:(0,ae.jsx)(rc,{})}),M&&h]})})},ac={singleNode:"singleNode",logs:"logs",top:"fn",feed:"feed",anomalies:"anomalies",default:"singleNode",alerts:"alerts"},lc=(0,r.memo)((()=>{const e=Yl(),t=(0,f.RQ)("/spaces/:spaceSlug/rooms/:roomSlug/nodes/:nodeId/:path"),n=t&&ac[t.params.path]||ac.default;return(0,ae.jsxs)(oe.Flex,{justifyContent:"start",alignSelf:"start",alignItems:"end",width:"100%",height:"100%",overflow:"auto",background:"mainBackground",children:[(0,ae.jsx)(Xl,{flavour:n,background:"mainBackground",border:void 0}),(0,ae.jsx)(oe.TabSeparator,{}),e.map(((e,t)=>{let{id:n,icon:r,title:o,path:s,...i}=e;return(0,ae.jsx)(ic,{exact:!0,fixed:!0,to:s,icon:r,title:o,id:n,rootProps:{background:"mainBackground"},showBorderLeft:0===t,...i},`${n}-${t}`)}))]})})),cc=lc;var dc=n(47413),uc=n(17178),hc=n(5722);const xc=()=>{const{active:e}=(0,He.fF)(),t=(0,g.JT)("dashboard:Create"),n=(0,b.dg)();return t&&e&&!n?(0,ae.jsx)(ic,{to:"",id:"plus",icon:"plus",fixed:!0,droppable:!0,droppableProps:{dropArea:!0,dashboardId:"new"},testid:"roomDropdownMenu-roomOptions",disabled:!t||n}):null},gc=e=>{let{title:t,path:n,children:o,index:s,ref:i,tooltip:a,type:l,id:c,...d}=e;const u=(0,Rs.JL)("alerts"===l?c:null,"name"),h=(0,Rs.JL)("alerts"===l?c:null,"instanceName"),x=(0,Rs.JL)("alerts"===l?c:null,"nodeId"),g=(0,E.xY)("alerts"===l?x:null,"name"),m=(0,E.xY)("nodes"===l?c:null,"name"),p=(0,r.useMemo)((()=>{if("alerts"===l){const e=[];return h&&e.push(`Instance: ${h}`),g&&e.push(`Node: ${g}`),{title:`Alert: ${u||t||"Unknown"}`,description:e.length>0?e.join(" \u2022 "):"View detailed information about this alert"}}return"nodes"===l?{title:`Node: ${m||t||"Unknown"}`,description:"View node metrics, logs, top consumers, anomalies, and more."}:"dashboards"===l?{title:`Dashboard: ${t||"Unknown"}`,description:"View custom dashboard"}:a}),[l,a,t,u,h,g,m]);return(0,ae.jsx)(ic,{ref:i,isDynamic:!0,showBorderLeft:0===s,to:n,title:t,tooltip:p,"data-testid":`navigation-dynamicTab-${t}`,index:s,type:l,id:c,...d,children:o})},mc=e=>{let{staticPaths:t,...n}=e;const[r,o,s]=(0,dc.A)(t),i=(0,Jl.A)("horizontal");return(0,ae.jsx)(oe.BaseDraggableTabs,{onDragEnd:o,onTabClose:s,items:r,Item:gc,...n,ref:i})},pc=()=>(0,ae.jsx)(f.BV,{children:(0,ae.jsx)(f.qh,{path:"/spaces/:spaceSlug/rooms/:roomSlug/nodes/:nodeId/*",element:(0,ae.jsx)(cc,{})})}),fc=(0,r.memo)((()=>{const[e,t]=(0,uc.A)();return(0,hc.A)()?(0,ae.jsxs)(oe.NavigationTabs,{subTabs:(0,ae.jsx)(pc,{}),children:[e.map(((e,t)=>{let{id:n,icon:r,title:o,path:s,...i}=e;return(0,ae.jsx)(ic,{fixed:!0,to:s,icon:r,title:o,id:n,...i},`${n}-${t}`)})),(0,ae.jsx)(oe.TabSeparator,{}),(0,ae.jsx)(mc,{staticPaths:t}),(0,ae.jsx)(xc,{})]}):null})),jc=fc,bc=()=>{const e=(0,Gt.eg)(),t=`/spaces/${(0,b.bq)()}/rooms/${(0,v.QW)()}/overview`,n=(0,f.Zp)();(0,r.useEffect)((()=>{if(e)return(0,es.unregister)(e.on("goToLink",((e,r)=>{let o=location.pathname;return e&&e.getParent().getAttribute("roomId")&&(o=e.getParent().getId(),o=/^\/spaces/.test(o)?o:t),n(o,r?{state:{chartName:r},replace:!0}:{state:{contextToGo:e?.getAttribute("contextScope")?.[0]},replace:!0})})))}),[e,t])},vc=()=>(bc(),null);var yc=n(73937),Cc=n(21885),wc=n(65637),Ic=n(55177),Ac=n(73980),kc=n(45026);const Sc=`dyncfg-edit-alet-warning-dismiss-${window.envSettings?.visitor}`,Tc={lineHeight:1.6},Fc=e=>{let{alertName:t,nodeIds:n=[]}=e;const s="true"===localStorage.getItem(Sc),[i,,,a]=(0,be.A)(!s),[l,c]=(0,r.useState)(),d=(0,E.xY)(n[0],"name"),u=n.length-1,h=u>0?` and ${u} other nodes`:"",x=(0,r.useCallback)((e=>{c(e)}),[c]),g=(0,r.useCallback)((()=>{l&&localStorage.setItem(Sc,!0),a()}),[l,a]);return i?(0,ae.jsx)(oe.Modal,{backdropContainerProps:{zIndex:"60"},backdropProps:{backdropBlur:!0},children:(0,ae.jsxs)(oe.ModalContent,{children:[(0,ae.jsx)(oe.ModalHeader,{children:(0,ae.jsx)(oe.H4,{children:"Editing Alerts"})}),(0,ae.jsx)(oe.ModalBody,{children:(0,ae.jsxs)(oe.Flex,{column:!0,gap:2,width:{max:120},children:[(0,ae.jsxs)(oe.TextBig,{...Tc,children:["You are about to edit the alert ",(0,ae.jsx)(oe.TextBig,{color:"primary",children:t}),d?(0,ae.jsxs)(ae.Fragment,{children:[" ","on node ",(0,ae.jsx)(oe.TextBig,{color:"primary",children:d}),h]}):null,"."]}),(0,ae.jsx)(oe.TextBig,{...Tc,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,ae.jsx)(oe.TextBig,{...Tc,children:'To apply an alert on all your currently connected nodes, edit it and select "Submit to Multiple Nodes".'}):(0,ae.jsx)(oe.TextBig,{...Tc,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,ae.jsxs)(oe.ModalFooter,{justifyContent:"between",children:[(0,ae.jsxs)(oe.Flex,{gap:2,alignItems:"center",children:[(0,ae.jsx)(oe.Checkbox,{checked:l,onChange:x}),(0,ae.jsx)(oe.TextBig,{children:"Don't show this again"})]}),(0,ae.jsx)(oe.Button,{type:"button",flavour:"hollow",label:"OK",textTransform:"uppercase",onClick:g})]})]})}):null},Nc=(0,r.memo)((()=>{const{node:e}=(0,yc.Z)(),{alertName:t,nodeIds:n,title:o}=(0,kc.A)(),{loaded:s,tree:i}=(0,wc.A)(n?{value:n?.[0]}:e),a=(0,r.useMemo)((()=>i?.[Cc.$7]?.[o]||{}),[i,o]),l=(0,r.useMemo)((()=>!!Object.keys(a||{}).length),[a]);return s&&t?(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(Ac.A,{flavour:"entity",title:o,entityProps:a,isOpen:l,isEditFromState:!0,renderChildren:e=>(0,ae.jsx)(Ic.A,{id:o,...a,...e})},JSON.stringify({loaded:s,alertName:t,alertItemExists:l})),a?(0,ae.jsx)(Fc,{alertName:t,nodeIds:n}):null]}):null})),Mc=Nc,Lc=(0,r.memo)((()=>{const{node:e}=(0,yc.Z)(),{path:t}=(0,wc.A)(e),n=(0,nn.sh)({node:e,path:t}),{entityProps:r,...o}=n||{};return n?(0,ae.jsx)(Ac.A,{id:n.template,flavour:"entity",title:`${n.template}:placeholder`,entityProps:{...r,...o},isNewItem:!0,formData:n.formData,renderChildren:e=>(0,ae.jsx)(Ic.A,{...r,...e,id:n.template,isNewItem:!0})}):null})),$c=Lc,Dc=(0,s.A)((()=>Promise.all([n.e(5638),n.e(3864),n.e(3457)]).then(n.bind(n,93457))),"ManageSpaceRoute"),Rc=(0,s.A)((()=>n.e(2201).then(n.bind(n,52201))),"Trial"),Bc=(0,s.A)((()=>n.e(5302).then(n.bind(n,5302))),"PreferredNodesModal"),Pc=(0,s.A)((()=>Promise.resolve().then(n.bind(n,61314))),"JoinSpace"),Oc=(0,s.A)((()=>n.e(7530).then(n.bind(n,17530))),"NoSpaceAccess"),Vc=(0,s.A)((()=>n.e(6333).then(n.bind(n,96333))),"EmptyRoom"),Ec=(0,s.A)((()=>n.e(1910).then(n.bind(n,11910))),"AlertView"),_c=(0,s.A)((()=>n.e(7316).then(n.bind(n,74935))),"Anomalies"),Hc=(0,s.A)((()=>Promise.resolve().then(n.bind(n,19440))),"AlertsSmartboard"),zc=(0,s.A)((()=>n.e(7214).then(n.bind(n,27214))),"DashboardsOverview"),Kc=(0,s.A)((()=>Promise.all([n.e(180),n.e(4424),n.e(5297)]).then(n.bind(n,95297))),"DashboardView"),Gc=(0,s.A)((()=>Promise.all([n.e(5638),n.e(5273),n.e(7791)]).then(n.bind(n,47791))),"FunctionsView"),Wc=(0,s.A)((()=>Promise.all([n.e(687),n.e(3864),n.e(2439),n.e(4209)]).then(n.bind(n,24209))),"Insights"),qc=(0,s.A)((()=>Promise.all([n.e(687),n.e(3864),n.e(2439),n.e(3808)]).then(n.bind(n,43808))),"InsightsReport"),Uc=(0,s.A)((()=>n.e(2792).then(n.bind(n,32792))),"Onboarding"),Jc=(0,s.A)((()=>Promise.all([n.e(3864),n.e(8791),n.e(9462),n.e(5187)]).then(n.bind(n,89462))),"Integrations"),Zc=(0,s.A)((()=>Promise.all([n.e(180),n.e(2003)]).then(n.bind(n,92003))),"DropInDashboard"),Xc=(0,s.A)((()=>n.e(3185).then(n.bind(n,73185))),"Marketplace"),Yc=(0,s.A)((()=>n.e(3675).then(n.bind(n,33675))),"AlertConfigAiModal"),{demoSlug:Qc,demoDefaultRoomViews:ed,defaultRoomView:td,onboardingView:nd,integrationsView:rd}=x.A,od=Ks(yi(zs)),sd=yi(zs),id=(0,r.memo)((()=>{const[e,t]=(0,oo.Ay)(),n=Qc===e?ed[t]||ed.default:o.Ay&&t===o.Iy?o.kG:td;return(0,ae.jsxs)(r.Suspense,{fallback:(0,ae.jsx)(d.zj,{}),children:[(0,ae.jsx)(r.Suspense,{fallback:"",children:(0,ae.jsx)(Zc,{})}),(0,ae.jsx)(f.BV,{children:(0,ae.jsx)(f.qh,{path:"nodes/:nodeId/*",element:(0,ae.jsx)(Br,{})})}),(0,ae.jsxs)(f.BV,{children:[(0,ae.jsx)(f.qh,{path:nd,element:(0,ae.jsx)(r.Suspense,{fallback:(0,ae.jsx)(d.NP,{}),children:(0,ae.jsx)(Uc,{})})}),(0,ae.jsx)(f.qh,{path:rd,element:(0,ae.jsx)(r.Suspense,{fallback:(0,ae.jsx)(d.H$,{}),children:(0,ae.jsx)(Jc,{flavour:"settingsPage"})})}),(0,ae.jsx)(f.qh,{path:"nodes/:nodeId",element:(0,ae.jsx)(od,{})}),(0,ae.jsx)(f.qh,{path:"nodes/:nodeId/alerts",element:(0,ae.jsx)(Hc,{})}),(0,ae.jsx)(f.qh,{path:"nodes/:nodeId/anomalies",element:(0,ae.jsx)(r.Suspense,{fallback:(0,ae.jsx)(d.Bm,{}),children:(0,ae.jsx)(_c,{})})}),(0,ae.jsx)(f.qh,{path:"nodes/:nodeId/top",element:(0,ae.jsx)(Gc,{flavour:"fn"},"fn")}),(0,ae.jsx)(f.qh,{path:"nodes/:nodeId/logs",element:(0,ae.jsx)(Gc,{flavour:"logs"},"logs")}),(0,ae.jsx)(f.qh,{path:"nodes/:nodeId/events",element:(0,ae.jsx)(Gc,{flavour:"feed"},"feed")}),(0,ae.jsx)(f.qh,{path:"nodes",element:(0,ae.jsx)(Rr,{})}),(0,ae.jsx)(f.qh,{path:"home",element:(0,ae.jsx)(Ol,{})}),(0,ae.jsx)(f.qh,{path:"overview",element:(0,ae.jsx)(sd,{})}),(0,ae.jsx)(f.qh,{path:"alerts/:alertId",element:(0,ae.jsx)(r.Suspense,{fallback:(0,ae.jsx)(d.xh,{}),children:(0,ae.jsx)(Ec,{})})}),(0,ae.jsx)(f.qh,{path:"alerts",element:(0,ae.jsx)(Hc,{})}),(0,ae.jsx)(f.qh,{path:"alarms/:alertId",element:(0,ae.jsx)(Ec,{})}),(0,ae.jsx)(f.qh,{path:"alarms",element:(0,ae.jsx)(f.C5,{replace:!0,to:`/spaces/${e}/rooms/${t}/alerts`})}),(0,ae.jsx)(f.qh,{path:"functions",element:(0,ae.jsx)(f.C5,{replace:!0,to:`/spaces/${e}/rooms/${t}/top`})}),(0,ae.jsx)(f.qh,{path:"dashboard",element:(0,ae.jsx)(Kc,{customDashboardId:o.LA})}),(0,ae.jsx)(f.qh,{path:"dashboards/:dashboardSlug",element:(0,ae.jsx)(r.Suspense,{fallback:(0,ae.jsx)(c.O2,{}),children:(0,ae.jsx)(Kc,{})})}),(0,ae.jsx)(f.qh,{path:"dashboards",element:(0,ae.jsx)(zc,{})}),(0,ae.jsx)(f.qh,{path:"kubernetes",element:(0,ae.jsx)(sd,{flavour:"k8s"})}),(0,ae.jsx)(f.qh,{path:"anomalies",element:(0,ae.jsx)(r.Suspense,{fallback:(0,ae.jsx)(d.Bm,{}),children:(0,ae.jsx)(_c,{})})}),(0,ae.jsx)(f.qh,{path:"top",element:(0,ae.jsx)(Gc,{flavour:"fn"},"fn")}),(0,ae.jsx)(f.qh,{path:"logs",element:(0,ae.jsx)(Gc,{flavour:"logs"},"logs")}),(0,ae.jsx)(f.qh,{path:"events",element:(0,ae.jsx)(Gc,{flavour:"feed"},"feed")}),(0,ae.jsx)(f.qh,{path:`${m.p9}/:reportId`,element:(0,ae.jsx)(qc,{})}),(0,ae.jsx)(f.qh,{path:"insights/*",element:(0,ae.jsx)(r.Suspense,{fallback:(0,ae.jsx)(d.BJ,{}),children:(0,ae.jsx)(Wc,{})})}),(0,ae.jsx)(f.qh,{path:"/",element:(0,ae.jsx)(f.C5,{replace:!0,to:`/spaces/${e}/rooms/${t}/${n}`})})]})]})})),ad=()=>{const{isOnboardingPath:e,path:t}=(0,u.A)(),{isIntegrationsPath:n}=(0,ql.Q)(),[s,a]=(0,ql.A)(),l=(0,b.vt)(),c=(0,v.ID)(),h=(0,i.I)(),x=(0,D.gr)(c,"ids"),g=(0,D.gr)(c,"loaded"),m=(0,b.bE)(l,"isEmpty"),j=(0,r.useMemo)((()=>!0===g&&!x.length),[g,x]),y=(0,o.Az)(l);return((e,t)=>{const n=(0,p.yF)((0,r.useCallback)((async(n,r)=>{await n((0,v.LS)({id:t,key:"fullyLoaded"}))||(0,Pr.K8)(e,t).then((t=>{let{data:n}=t;return r((0,v.If)(n.id),{...n,spaceId:e,fullyLoaded:!0,loaded:!0})}))}),[e,t]));(0,r.useEffect)((()=>{e&&t&&n()}),[e,t])})(l,c),(0,Or.A)({spaceId:l,id:c,pollingInterval:63e3}),Kr(l,c),Gr(l,c),(0,Wr.A)(l,c),function(e,t){let{types:n,entities:o,paths:s,names:i}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const a=(0,p.yF)(((r,a)=>{(0,El.Uc)(e,t,{types:n,entities:o,paths:s,names:i}).then((n=>{let{data:r}=n;a((0,ee.Mg)({spaceId:e,roomId:t}),r),a((0,Se.n_)({spaceId:e,roomId:t})),a((0,fe.n_)({spaceId:e,roomId:t})),a((0,Vl.w7)({spaceId:e,roomId:t}),!0)}))}));(0,r.useEffect)((()=>{e&&t&&a()}),[e,t,n,o,s,i])}(l,c),$(),(0,r.useEffect)((()=>{y||a||h||m(s)}),[y,s,h,a,m]),h?(0,ae.jsx)(r.Suspense,{fallback:"",children:(0,ae.jsx)(Xc,{subCallback:h})}):a?(0,ae.jsx)(d.Qk,{}):y||!s||!t||e||n?!j||e||n?(0,ae.jsx)(id,{}):(0,ae.jsx)(Vc,{}):(0,ae.jsx)(f.C5,{to:t,replace:!0})},ld=(0,l.Xc)((0,r.memo)((()=>{const e=(0,g.JT)("space:Read"),t=(0,g.JT)("room:Read"),{hasAccess:n,reason:o}=Wl();return e?n?(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(jc,{}),(0,ae.jsx)(r.Suspense,{fallback:(0,ae.jsx)(d.Qk,{}),children:(0,ae.jsxs)(f.BV,{children:[(0,ae.jsx)(f.qh,{path:"spaces/:spaceSlug/join-space",element:(0,ae.jsx)(Pc,{})}),(0,ae.jsx)(f.qh,{path:"spaces/:spaceSlug/no-rooms",element:(0,ae.jsx)(Oc,{reason:"noRooms"})}),(0,ae.jsx)(f.qh,{path:"spaces/:spaceSlug/settings/*",element:(0,ae.jsx)(cd,{})}),(0,ae.jsx)(f.qh,{path:"spaces/:spaceSlug/rooms/:roomSlug/*",element:t?(0,ae.jsx)(ad,{}):(0,ae.jsx)(Oc,{reason:"noRoomPermission"})})]})})]}):(0,ae.jsx)(Oc,{reason:o}):(0,ae.jsx)(Oc,{reason:"noSpacePermission"})}))),cd=()=>((0,oo.KI)(),(0,ae.jsx)(Dc,{})),dd=()=>{const e=(0,b.vt)();return(0,_l.A)(e),(0,Hl.A)(e),(e=>{const t=(0,p.yF)((0,r.useCallback)((function(t,n){let{data:{results:r}}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n((0,zl.S)({id:e}),r)}),[e])),n=(0,p.yF)((0,r.useCallback)(((t,n,r)=>{n((0,zl.S)({id:e,key:"error"}),r)}),[e])),o=(0,Kl.sC)(e,"loaded"),s=(0,g.JT)("alert:ReadAll");(0,j.A)((()=>({enabled:s&&!!e&&o,fetch:()=>(0,Er.C2)(e),onFail:n,onReceive:t,pollingOptions:{pollingInterval:15e4}})),[e,!!o,s])})(e),null},ud=(0,l.Xc)((()=>{const e=(0,b.vt)();return(0,Ul.Ay)(),(0,r.useEffect)((()=>{const e=(0,a.A)(new URL(window.location.href).searchParams.get("join_callback"));e&&(window.location.href=e)}),[]),e?(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(dd,{}),(0,ae.jsx)(h.A,{permission:"space:Read",children:t=>t?(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(f.BV,{children:(0,ae.jsx)(f.qh,{path:"/*",element:(0,ae.jsx)(vc,{})})}),(0,ae.jsx)(r.Suspense,{fallback:(0,ae.jsx)(d.Qk,{}),children:(0,ae.jsx)(ld,{})})]}):(0,ae.jsx)(Oc,{reason:"noSpacePermission"},e)}),(0,ae.jsx)(r.Suspense,{fallback:"",children:(0,ae.jsx)(Rc,{})}),(0,ae.jsxs)(r.Suspense,{fallback:"",children:[(0,ae.jsx)(Bc,{}),(0,ae.jsx)($c,{}),(0,ae.jsx)(Mc,{}),(0,ae.jsx)(Yc,{})]})]}):(0,ae.jsx)(d.Qk,{})}))},47413:(e,t,n)=>{n.d(t,{A:()=>x});n(98992),n(81454);var r=n(96540),o=n(88934),s=n(1817),i=n(44245),a=n(93335),l=n(80689),c=n(19075),d=n(74848);const u={warning:"warning",critical:"error"},h=e=>{let{alertId:t}=e;const n=(0,c.JL)(t,"status");return u[n]?(0,d.jsx)(l.Flex,{alignSelf:"center",margin:[0,0,0,2],round:1,background:u[n],width:2,height:2}):null},x=e=>{const t=(0,o.Zp)(),n=(0,o.RQ)("/spaces/:spaceSlug/rooms/:roomSlug/:type/*"),l=(0,i._F)(),c=(0,i.xK)(),u=(0,i.NU)(),x=n?n.pathnameBase:"/spaces",{pathname:g}=(0,o.zy)(),m=(0,s.A)(e[g]&&g,!0),p=(0,r.useCallback)(((e,n)=>{if(!n)return c(e);const r=l[e-1],o=l[e+1],s=(n,r)=>{t(`${n}${r?`/${r}`:""}`),c(e)};return m?s(m):r?s(r.path,r.params):o?s(o.path,o.params):s(x)}),[l,c,x,m]);return[(0,r.useMemo)((()=>l.map((e=>({...e,children:e.id&&"nodes"===e.type?(0,d.jsx)(a.N,{nodeId:e.id}):"alerts"===e.type?(0,d.jsx)(h,{alertId:e.id}):null})))),[l]),(e,t)=>{-1===e&&-1===t||u({sourceIndex:e,destinationIndex:t})},p]}},48106:(e,t,n)=>{n.d(t,{A:()=>d});n(98992),n(72577);var r=n(96540),o=n(69457),s=n(4719),i=n(50239),a=n(66814);const l=e=>{const t=(0,r.useRef)();return(0,a.i7)(e,(e=>(t.current=e,!1))),t},c=(e,t)=>{for(let n=0;n<e.length;n++){const r=e[n];if(r.id===t)return n;if(r.children&&r.children.length>0){const e=c(r.children,t);if(-1!==e)return n+1+e}}return-1},d=(e,t)=>{const n=(0,o.NF)(),a=l(s.tu),d=l(o.i8),u=(0,i.Gr)(),h=(0,r.useMemo)((()=>({goToElement:function(n){let{leaf:r=!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((n=>{const r=t=>{if(0===t)return n();e(),setTimeout((()=>r(--t)))};r(t)}))}((()=>{let o=c(t,n);if(r)for(;t[o]?.level<(t[o+1]?.level??999999);)o+=1;if(-1!==o)return e.scrollToIndex(o,{align:"center"})}),5),!0)},goToLink:e=>{const t=Object.values(a.current).find((t=>t.link&&t.link===e));if(t)return h.goToElement(t.id,{leaf:!0});if(d.current){const t=Object.values(d.current).find((t=>t.link&&t.link.includes(e)));if(t)return h.goToElement(t.id,{leaf:!0})}}})),[n,t]);return(0,r.useLayoutEffect)((()=>{u(h)}),[h]),h}},51318:(e,t,n)=>{n.d(t,{A:()=>i});var r=n(96540),o=n(61661),s=n(89942);const i=()=>{const e=(0,s.PP)(),[t,n]=(0,o.XL)(),{reset:i}=(0,o.b8)(),a=(0,r.useCallback)((()=>{i(),(0,s.Z8)({...e,integrationsModalOpen:"true"}),n("true")}),[i,n,e]);return{isIntegrationsVisible:t,hideIntegrations:(0,r.useCallback)((()=>{(0,s.Z8)({...e,integrationsModalOpen:""}),n("")}),[e,n]),onIntegrationsClick:a}}},54025:(e,t,n)=>{n.d(t,{t:()=>s});var r=n(80689),o=n(74848);const s=e=>{let{id:t,testId:n="chart-sub-menu-container",...s}=e;return(0,o.jsx)(r.Flex,{column:!0,gap:2,id:t,"data-testid":n,"data-menuid":t,...s})}},55048:(e,t,n)=>{n.d(t,{A:()=>c});n(98992),n(54520);var r=n(96540),o=n(46587),s=n(24609),i=n(19186),a=n(81685),l=n(79022);const c=()=>{const e=(0,o.NJ)(),t=(0,s.vt)(),n=(0,i.ID)(),[,c]=(0,a.x)(),d=(0,r.useCallback)((()=>{const r=(0,l.l8)({userId:e,spaceId:t,roomId:n});return c(r),r}),[e,t,n,c]),u=(0,r.useCallback)((r=>{(0,l.zz)({userId:e,spaceId:t,roomId:n},r),c(r)}),[e,t,n,c]),h=(0,r.useCallback)((e=>{const t=d();u(t.filter((t=>t!==e)))}),[e,t,n]);return[d,u,h]}},60602:(e,t,n)=>{n.d(t,{A:()=>s});var r=n(96540),o=n(68531);const s=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const[s,i]=(0,r.useState)(e);return(0,o.A)((()=>i(e)),t,[e,...n]),s}},63996:(e,t,n)=>{n.d(t,{t:()=>h});var r=n(96540),o=n(80689),s=n(45087),i=n(4719),a=n(549),l=n(75144),c=n(74848);const d=e=>{let{name:t,level:n,descendantIds:s,enableFavourites:i,ref:a,...l}=e;const d=(0,r.useMemo)((()=>Array.from(Array(n)).fill("-").join("")),[n]),u=(0,r.useMemo)((()=>i?`${d} ${t}`:t),[i,d,t]),h=(0,r.useMemo)((()=>({...!i||s?.length&&!l?.selfChartIds?.length?{}:{color:"primary"},...l})),[s,l]);return"string"===typeof t?(0,c.jsx)(o.Text,{strong:!0,ref:a,...h,children:u}):t||null},u=(0,a.A)((e=>{let{hasTooltip:t,hasInfo:n,...r}=e;return t&&n?(0,c.jsx)(s.A,{content:(0,c.jsx)(l.X,{id:r.id}),isBasic:!0,children:(0,c.jsx)(d,{...r})}):(0,c.jsx)(d,{...r})})),h=(0,i.aV)(u,(e=>{let{name:t,info:n,...r}=e;return{name:t,hasInfo:!!n,...r}}))},69001:(e,t,n)=>{n.d(t,{h:()=>s});var r=n(80689),o=n(74848);const s=e=>{let{id:t,...n}=e;return(0,o.jsx)(r.Flex,{column:!0,"data-testid":"chart-menu-wrapper","data-menuid":t,...n})}},72060:(t,n,r)=>{r.d(n,{A:()=>o});const o=t=>{try{if(!t)return null;const e=document.createElement("a");return e.href=t,/https?/.test(e.protocol)?new URL(e.protocol+"//"+e.host+e.pathname+e.search+e.hash).toString():null}catch(e){return null}}},74290:(e,t,n)=>{n.d(t,{A:()=>h});n(98992),n(23215),n(54520),n(81454),n(8872);var r=n(96540),o=n(24285),s=n(99728),i=n(24609),a=n(76571),l=n(56523),c=n(97926),d=n(17115),u=n(31246);const h=()=>{const{milestones:e,recordMilestones:t,markMilestonesSeen:n,settingsLoaded:h}=(0,l.A)(),x=(0,c.A)(),g=(0,d.Ay)(),m=(0,s.Sk)(),p=(0,d.Ex)(),f=(0,o.xd)("isLoaded"),j=(0,o.xd)("onboardingFormData"),b=(0,i.vt)(),v=(0,i.ap)("loaded"),y=(0,a.t5)(b,"channels"),C=(0,a.t5)(b,"loaded"),w=Array.isArray(y)?y.length:0,I=!!j?.usageType;(0,r.useEffect)((()=>{if(!h||!x)return;const n=Object.entries(x).filter((t=>{let[n,r]=t;return r&&!e.completed[n]?.completedAt}));if(n.length>0){const e=n.map((e=>{let[t]=e;return t}));t(e)}}),[x,e.completed,t,h]),(0,r.useEffect)((()=>{if(!h||!C||!v||!f)return;const t={segment:g,permissions:m,isLargeTeam:p,channelCount:w,hasOnboarding:I},r=Object.entries(e.completed).reduce(((e,n)=>{let[r,o]=n;if(!o.completedAt||o.seenAt)return e;const s=((e,t)=>{let{segment:n,permissions:r,isLargeTeam:o,channelCount:s,hasOnboarding:i}=t;return(u.a7[e]||[]).filter((e=>i?!!e.segments.includes(n)&&!(e.permission&&!r[e.permission])&&!(e.requiresLargeTeam&&!o)&&!(void 0!==e.maxChannels&&s>e.maxChannels):e.isFeatureAnnouncement))})(r,t);if(!s.length)return e;const i=o.tasks||{};return s.every((e=>i[e.id]))&&e.push(r),e}),[]);r.length&&n(r)}),[w,C,I,p,n,m,e.completed,g,h,v,f])}},75144:(e,t,n)=>{n.d(t,{X:()=>i});var r=n(4719),o=n(14963),s=n(74848);const i=(0,r.aV)((e=>e.children?(0,s.jsx)(o.A,{as:"p",role:"document",...e}):null),(e=>{let{info:t}=e;return{children:t}}))},77234:(e,t,n)=>{n.d(t,{x:()=>r});const r={home:"home",overview:"overview",nodes:"nodes",k8s:"k8s",top:"top",logs:"logs",dashboards:"dashboards",dashboard:"dashboard",alerts:"alerts",ar:"ar",events:"events",insights:"insights"}},80744:(e,t,n)=>{n.d(t,{Ay:()=>g,NA:()=>x});n(98992),n(72577),n(81454);var r=n(96540),o=n(40961),s=n(43375),i=n(67012),a=n(43305),l=n(71123),c=n(61710),d=n(45427),u=n(74848);const h={sideEffects(e){let{active:t}=e;t.node.animate([{opacity:0},{opacity:1}],{easing:"ease-in",duration:250})}},x=40,g=e=>{let{cacheId:t,rootId:n,items:g,onRemove:m,Item:p,containerWidth:f=800,rowHeight:j=x,gridTracks:b=12,gutter:v=4,allowOverlap:y=!1,compactType:C="vertical",maxRows:w=3e5,Container:I=a.A,onDragEnd:A,onDragCancel:k,containerId:S,itemProps:T,rearrangeable:F=!0,...N}=e;const M=(0,r.useRef)(),[L,$]=(0,r.useState)((()=>(0,l.oE)((0,l.Su)(g),C,b)));(0,i.A)((()=>{$((0,l.oE)((0,l.Su)(g),C,b))}),[b,t]);const[D,R]=(0,r.useState)(null),[B,P]=(0,r.useState)(null),O=(0,r.useRef)(null),{active:V}=(0,s.fF)();(0,s.E5)((0,r.useMemo)((()=>({onDragStart:e=>{let{active:t}=e;const{itemContainerId:n}=t.data.current||{};n===S&&(R((0,l.Su)(L)),P(L))},onDragMove:e=>{let{active:t,over:n}=e;P((e=>{const{isResizer:r,isContainer:o,itemId:s,itemContainerId:i}=t.data.current||{};if(o||i!==S)return e;const{initial:a,translated:d}=t.rect.current;let u=e;const h=(0,l.GN)(u,s);if(!h)return e;const x=n?.id;if(r){if(!x)return e;if(!d||!a)return e;const t=n.rect.width+(0,c.sd)(d.right-a.right),r=n.rect.height+(0,c.sd)(d.bottom-a.bottom);let{width:o,height:s}=(0,c.tr)({gutter:v,maxRows:w,gridTracks:b,rowHeight:j,containerWidth:f},t,r,h);return h.width===o&&h.height===s?e:(h.width=o,h.height=s,u=u.map((e=>e.id===h.id?{...h,width:o,height:s}:e)),u=(0,l.oE)(u,C,b),O.current=h,u)}if(!F)return e;const g=M.current.getBoundingClientRect();let{left:m,top:p}=(0,c.zA)({gutter:v,maxRows:w,gridTracks:b,rowHeight:j,containerWidth:f},d.top-g.top,d.left-g.left,h);return h.top===p&&h.left===m?e:(u=(0,l.Pe)(u,h,m,p,!0,!1,C,b,y),u=(0,l.oE)(u,C,b),O.current=h,u)}))},onDragEnd:e=>{let{active:t,over:n}=e;const{isResizer:r,isContainer:o,itemContainerId:s}=t.data.current;if(o||s!==S)return void P(null);const i=n?.id;if(r)return B&&$(B),P(null),void A(B,O.current);null!==i?(B&&$(B),P(null),A(B,O.current)):P(null)},onDragCancel:()=>{D&&$(D),O.current=null,R(null),P(null),k&&k()}})),[L,B]));const E=(0,l.Hp)(B||L),_=E*j+(E-1)*v+"px";return(0,u.jsxs)(I,{ref:M,style:{width:f,height:_},...N,children:[(B||L).map(((e,t)=>(0,u.jsx)(d.A,{...e,index:t,containerId:S,Item:p,onRemove:m,draggable:!0,containerWidth:f,rowHeight:j,gridTracks:b,gutter:v,transformed:null!==B?B[t]:null,draggableProps:e,itemProps:T,rootId:n},e.id))),(0,o.createPortal)((0,u.jsx)(s.Hd,{adjustScale:!1,dropAnimation:h,zIndex:9999,children:V&&V.data.current.rootId===n&&V.data.current.isItem?(e=>{const t=B||L;if(!t)return null;const r=t.find((t=>t.id===e.itemId));return r?(0,u.jsx)(d.A,{rootId:n,...r,containerId:e.itemContainerId,Item:p,onRemove:m,draggable:!0,containerWidth:f,rowHeight:j,gridTracks:b,gutter:v,dragOverlay:!0,itemProps:T}):null})(V.data.current):null}),document.body)]})}},81187:(e,t,n)=>{n.d(t,{A:()=>j});var r=n(96540),o=n(88934),s=n(34843),i=n(24609),a=n(41716),l=n(19186),c=n(67294),d=n(92726),u=n(14070),h=n(96859),x=n(51318),g=n(42318),m=n(43074),p=n(97394),f=n(56523);const j=function(){let{onBeforeAction:e,skipCompletedCheck:t=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=(0,o.Zp)(),j=(0,i.bq)(),b=(0,l.QW)(),{markTaskCompleted:v}=(0,f.A)(),{onIntegrationsClick:y}=(0,x.A)(),{setSearchTerm:C}=(0,g.A)(),{open:w}=(0,h.A)(),{handleOpenProfileModal:I}=(0,m.A)(),A=(0,s.Xr)(p.TZ),k=(0,a.s)("ids"),[,S]=(0,u.A)(),T=(0,c.q)(),F=(0,d.fz)(T?.[0],"slug"),N=(0,r.useCallback)((e=>t||!e.completed),[t]);return(0,r.useCallback)((t=>{e?.();let r=location.pathname,o={};if(t.openIntegrations)return t.integrationsSearchTerm&&C(t.integrationsSearchTerm),y(),void(N(t)&&v(t.milestoneId,t.id));if(t.openAiPanel)return w(),void(N(t)&&v(t.milestoneId,t.id));if(t.openProfileModal)return I(t.openProfileModal),void(N(t)&&v(t.milestoneId,t.id));if(t.openFirstDashboard&&F)return r=`/spaces/${j}/rooms/${b}/dashboards/${F}`,n(r),t.spotlight?void A({...t.spotlight,taskId:t.id,milestoneId:t.milestoneId,targetPath:r}):void(N(t)&&v(t.milestoneId,t.id));if(t.route){const e=t.isSpaceRoute?`/spaces/${j}`:`/spaces/${j}/rooms/${b}`;void 0!==t.alertTabIndex&&(o.alertTabIndex=t.alertTabIndex),r=`${e}/${t.route}`,n(r,{state:o}),t.openFirstAlert&&k?.[0]&&S({alertId:k[0]})}t.spotlight?A({...t.spotlight,taskId:t.id,milestoneId:t.milestoneId,targetPath:r}):N(t)&&v(t.milestoneId,t.id)}),[e,n,j,b,v,y,C,w,I,A,k,S,F,N])}},82507:(e,t,n)=>{n.d(t,{A:()=>i});var r=n(33185),o=n(74848);const s=r.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;}"]),i=e=>{let{withOuties:t=!0}=e;return(0,o.jsx)(s,{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"})]})]})})}},90901:(e,t,n)=>{n.d(t,{I:()=>c,q:()=>l});n(98992),n(8872);var r=n(96540),o=n(88934),s=n(24013),i=n(19186);const a=(e,t)=>t?e[t]:e,l=e=>{const t=(0,s.BU)(),n=(0,s.Gt)(t);return(0,r.useMemo)((()=>n.reduce(((t,n)=>{const{capabilities:{ml:r}}=n;return r?.enabled?t.predicting=[...t.predicting,a(n,e)]:t.incapable=[...t.incapable,a(n,e)],t}),{predicting:[],incapable:[]})),[t.length,e])},c=e=>{const t=(0,o.Zp)(),n=(()=>{const e=(0,i.r9)();return e&&`${e}/anomalies`})();return(0,r.useCallback)((function(){t(n,{state:{nodeId:arguments.length>0&&void 0!==arguments[0]?arguments[0]:e}})}),[n,t])}},91100:(e,t,n)=>{n.d(t,{A:()=>c});var r=n(80689),o=n(9962),s=n(19075),i=n(2626),a=n(74848);const l=e=>{let{critical:t,warning:n,error:s,testPrefix:i,...l}=e;const c=(0,o.I)({error:s,testPrefix:i,flavour:t?"error":"disabledError",value:t}),d=(0,o.I)({error:s,testPrefix:i,flavour:n?"warning":"disabledWarning",value:n});return(0,a.jsx)(r.Flex,{...l,children:(0,a.jsx)(r.MasterCard,{"data-testid":"alertsMastercard",pillLeft:c,pillRight:d,size:"small"})})},c=e=>{let{id:t,testPrefix:n,...r}=e;const o=(0,i.Xt)(t),{critical:c,warning:d}=(0,s.AO)(o);return(0,a.jsx)(l,{"data-testid":"alerts",testPrefix:n,critical:c,warning:d,...r})}},93335:(e,t,n)=>{n.d(t,{N:()=>d,W:()=>u});var r=n(19075),o=n(2626),s=n(87083),i=n(41716),a=n(91100),l=n(74848);const c=e=>{let{critical:t,warning:n,error:r}=e;return(0,l.jsx)(a.A,{critical:t,"data-testid":"tabAlerts",error:r,testPrefix:"tabAlerts-alert",warning:n,margin:[0,0,0,1]})},d=e=>{let{nodeId:t}=e;const n=(0,o.Xt)(t),{critical:s,warning:i}=(0,r.AO)(n);return(0,l.jsx)(c,{critical:s,warning:i})},u=()=>{const e=(0,s.w7)({emptyIfAll:!1}),t=(0,o.YS)(e),n=(0,i.s)("error"),{critical:a,warning:d}=(0,r.AO)(t);return(0,l.jsx)(c,{critical:a,warning:d,error:n})}},95836:(e,t,n)=>{n.d(t,{$:()=>u});var r=n(80689),o=n(45087),s=n(4719),i=n(549),a=n(27496),l=n(74848);const c=e=>{let{name:t,tiny:n,...o}=e;const s=n?r.Text:r.H3;return"string"===typeof t?(0,l.jsx)(s,{strong:!0,...o,children:t}):t||null},d=(0,i.A)((e=>{let{hasTooltip:t,hasInfo:n,...r}=e;return t&&n?(0,l.jsx)(o.A,{content:(0,l.jsx)(a.n,{id:r.id}),isBasic:!0,children:(0,l.jsx)(c,{...r})}):(0,l.jsx)(c,{...r})})),u=(0,s.aV)(d,(e=>{let{name:t,info:n,...r}=e;return{name:t,hasInfo:!!n,...r}}))},96026:(e,t,n)=>{n.d(t,{l:()=>h,q:()=>u});n(25509),n(65223),n(60321),n(41927),n(11632),n(64377),n(66771),n(12516),n(68931),n(52514),n(35694),n(52774),n(49536),n(21926),n(94483),n(16215);var r=n(96540),o=n(88934),s=n(42790),i=n(61841),a=n(24609),l=n(24013),c=n(19075),d=n(91421);const u=e=>{let{alertId:t,alertName:n,nodeIds:s=[]}=e;const a=(0,o.Zp)(),{setState:u}=(0,d.$h)(),[h]=(0,i.Ay)(),{name:x}=(0,c.JL)(t),g=n||x,{isParent:m}=(0,l.xY)(s[0]),{loaded:p,value:f,hasError:j,error:b}=(0,d.wd)({node:{value:s[0],isParent:m},path:"/health"}),v=!!f?.tree?.["/health/alerts/prototypes"]?.[`health:alert:prototype:${g}`],[,y]=(0,d.PJ)();return{canEdit:p&&!j&&v,goToEdit:(0,r.useCallback)((e=>{s=e?Array.from(new Set([e,...s])):s,u({alertName:g,isAlert:!0}),y(!0,{nodeId:s[0]})}),[g,s,h,u,a]),error:b?.errorMessage||b}},h=()=>{const e=(0,o.Zp)(),{slug:t}=(0,a.ap)(),n=(0,s.rI)();return(0,r.useCallback)((r=>{r&&(n((e=>({...e,dyncfgSearchTerm:r}))),e(`/spaces/${t}/settings/configurations`,{replace:!0}))}),[e,n,t])}},97926:(e,t,n)=>{n.d(t,{A:()=>h});var r=n(96540),o=n(41716),s=n(83268),i=n(67294),a=n(24609),l=n(86706),c=n(76571),d=n(41258),u=n(31246);const h=()=>{const e=(0,s.nj)(),t=(0,s.CK)(),n=(0,o.s)("ids")||[],h=(0,o.s)("loaded"),x=(0,a.vt)();(0,d.A)(x);const g=(0,c.t5)(x,"channels"),m=(0,c.t5)(x,"loaded"),p=(0,l.Gi)(),f=(0,l.gk)(),j=(0,i.q)(),b=(0,i.RQ)();return(0,r.useMemo)((()=>e&&h&&m&&f&&b?{[u.aL.welcome]:!0,[u.aL.firstNodeConnected]:t.length>=1,[u.aL.firstAlertTriggered]:n.length>=1,[u.aL.firstNotificationSent]:Array.isArray(g)&&g.length>0,[u.aL.secondNodeConnected]:t.length>=2,[u.aL.threeOrMoreNodes]:t.length>=3,[u.aL.firstTeamMemberInvited]:Array.isArray(p)&&p.length>1,[u.aL.firstDashboardCreated]:Array.isArray(j)&&j.length>=1}:null),[e,t.length,h,n.length,m,g,f,p,b,j])}}}]);