!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="1df98f68-5fbc-4150-8079-c9894daf86c8",e._sentryDebugIdIdentifier="sentry-dbid-1df98f68-5fbc-4150-8079-c9894daf86c8")}catch(e){}}();var _global="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};_global.SENTRY_RELEASE={id:"30b1ba65cc8722be7e184f4a401fb43e6b21634d"},(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[3104],{3104:(e,t,a)=>{a.r(t),a.d(t,{default:()=>Ke});var n=a(96540),o=a(11128),r=(a(14905),a(98992),a(8872),a(62953),a(47762));const l=(e,t)=>t?e[t]:e;var i=a(99739),s=a(67990),d=a(83199),c=a(12897),m=a.n(c),h=a(55042),u=a.n(h),p=new(m())({id:"notCapableNodes",use:"notCapableNodes-usage",viewBox:"0 0 231 230",content:''});u().add(p);const L=p,f=()=>n.createElement(d.Flex,{width:"100%",justifyContent:"center",alignItems:"center",gap:3},n.createElement("svg",{viewBox:L.viewBox,height:"222px"},n.createElement("use",{xlinkHref:"#".concat(L.id)})),n.createElement(d.TextBig,{strong:!0},"Your nodes are either offline or not configured for ML"));var g=a(4659);const y=()=>n.createElement(d.Flex,{height:10.5,width:{min:10.5},background:"warningText",justifyContent:"center",alignItems:"center",round:"50%",sx:{borderRadius:"50%"}},n.createElement(d.Icon,{color:"warningBackground",name:"informationPress"})),v=e=>{let{to:t,children:a}=e;return n.createElement(g.A,{Component:d.Text,href:t,target:"_blank",rel:"noopener noreferrer"},a)},E=()=>n.createElement(d.Flex,{column:!0,gap:1},n.createElement(d.Text,{strong:!0,color:"textDescription"},"Not Configured Nodes"),n.createElement(d.Text,{color:"textDescription"},"Learn how to configure your nodes"," ",n.createElement(v,{to:"https://learn.netdata.cloud/docs/cloud/insights/anomaly-advisor#enable-ml-on-netdata-agent"},"to support anomaly advisor"),".")),M=()=>n.createElement(d.Flex,{column:!0,gap:1},n.createElement(d.Text,{strong:!0,color:"textDescription"},"Not Capable Nodes"),n.createElement(d.Text,{color:"textDescription"},"All nodes need to be updated to a version higher than"," ",n.createElement(d.Text,{strong:!0,color:"textDescription"},"1.32"),". Learn how to"," ",n.createElement(v,{to:"https://learn.netdata.cloud/docs/agent/packaging/installer/update"},"update to the latest Netdata version"),".")),b=()=>n.createElement(d.Box,{round:!0,background:"elementBackground",padding:[4]},n.createElement(d.Flex,{gap:4,alignItems:"start"},n.createElement(y,null),n.createElement(d.Flex,{gap:4,column:!0},n.createElement(E,null),n.createElement(M,null)))),A=()=>n.createElement(d.Flex,{column:!0,width:"100%",height:"100%",justifyContent:"start",padding:[8,4]},n.createElement(d.Flex,{column:!0,gap:8},n.createElement(f,null),n.createElement(b,null)));var w=a(58168),x=a(3705),C=a(83084),k=a(69765),I=a(23931),Z=a(3914),D=a(16579),_=a(81416),H=a(27467),T=a(99292),z=a(79304),B=(a(9920),a(41393),a(3949),a(81454),a(25509),a(65223),a(60321),a(41927),a(11632),a(64377),a(66771),a(12516),a(68931),a(52514),a(35694),a(52774),a(49536),a(21926),a(94483),a(16215),a(45387)),N=a(61427),S=a(21290),F=a(93658);const V=e=>Math.floor(e/1e3),R=()=>{const[e,t]=(0,_.yD)(),{localeTimeString:a}=(0,S.$j)(),[o,r,l]=(0,n.useMemo)((()=>{const n=V(e),o=V(t);return[(0,F.getDateDiff)(n,o),a(e,{secs:!0}),a(t,{secs:!0})]}),[e,t]);return e&&t?n.createElement(d.Flex,{gap:1,alignItems:"baseline"},n.createElement(d.TextMicro,{strong:!0,color:"textLite"},n.createElement(d.TextSmall,{strong:!0,color:"textLite"},r," \u2192 ",l," \u2022")," ","Duration: ",o)):null};var G=a(8711);const O=(0,G.keyframes)(["from{transform:translate(412px,0);}"]),U=G.default.g.withConfig({displayName:"skeleton__Animated",componentId:"sc-gwkfye-0"})(["animation:",";"],(e=>{let{animate:t}=e;return t?(0,G.css)([""," 1s linear infinite"],O):""})),j=e=>{let{animate:t=!1}=e;return n.createElement("svg",{width:"1140",height:"80",viewBox:"0 0 1140 80",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n.createElement("mask",{id:"mask0_467_73096",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"1140",height:"80"},n.createElement("rect",{width:"1140",height:"80",fill:"#C4C4C4"})),n.createElement("g",{mask:"url(#mask0_467_73096)"},n.createElement(U,{animate:t},n.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-374 70L-401 78H-192.5H14H25.5H212L180 70L157 55L144 70L105 11L69.5 70H41L17.8524 76.8586L-8 73L-39 38L-62 71L-85.5 61.5L-100.5 73L-114.5 61.5L-146 41L-168 70L-192.5 78L-235 70L-258 55L-271 70L-310 11L-327.75 40.5L-345.5 70H-374Z",fill:"#8F9EAA"}),n.createElement("path",{d:"M-401 78L-401.142 77.5206L-401 78.5V78ZM-374 70V69.5H-374.073L-374.142 69.5206L-374 70ZM212 78V78.5L212.121 77.5149L212 78ZM180 70L179.727 70.4188L179.797 70.4647L179.879 70.4851L180 70ZM157 55L157.273 54.5812L156.908 54.3429L156.622 54.6725L157 55ZM144 70L143.583 70.2757L143.946 70.8254L144.378 70.3275L144 70ZM105 11L105.417 10.7243L104.98 10.0632L104.572 10.7422L105 11ZM69.5 70V70.5H69.7827L69.9284 70.2578L69.5 70ZM41 70V69.5H40.9275L40.8579 69.5206L41 70ZM17.8524 76.8586L17.7785 77.3531L17.8882 77.3694L17.9944 77.338L17.8524 76.8586ZM-8 73L-8.3743 73.3315L-8.25369 73.4677L-8.07382 73.4945L-8 73ZM-39 38L-38.6257 37.6685L-39.0469 37.1929L-39.4102 37.7141L-39 38ZM-62 71L-62.1874 71.4636L-61.8178 71.613L-61.5898 71.2859L-62 71ZM-85.5 61.5L-85.3126 61.0365L-85.5775 60.9294L-85.8042 61.1032L-85.5 61.5ZM-100.5 73L-100.817 73.3864L-100.511 73.6383L-100.196 73.3968L-100.5 73ZM-114.5 61.5L-114.183 61.1137L-114.204 61.0961L-114.227 61.0809L-114.5 61.5ZM-146 41L-145.727 40.5809L-146.117 40.3272L-146.398 40.6978L-146 41ZM-168 70L-167.845 70.4753L-167.696 70.4268L-167.602 70.3022L-168 70ZM-235 70L-235.273 70.4188L-235.19 70.473L-235.092 70.4914L-235 70ZM-258 55L-257.727 54.5812L-258.092 54.3429L-258.378 54.6725L-258 55ZM-271 70L-271.417 70.2757L-271.054 70.8254L-270.622 70.3275L-271 70ZM-310 11L-309.583 10.7243L-310.02 10.0632L-310.428 10.7422L-310 11ZM-345.5 70V70.5H-345.217L-345.072 70.2578L-345.5 70ZM-400.858 78.4794L-373.858 70.4794L-374.142 69.5206L-401.142 77.5206L-400.858 78.4794ZM-192.5 77.5H-401V78.5H-192.5V77.5ZM14 77.5H-192.5V78.5H14V77.5ZM14 78.5H25.5V77.5H14V78.5ZM25.5 78.5H212V77.5H25.5V78.5ZM212.121 77.5149L180.121 69.5149L179.879 70.4851L211.879 78.4851L212.121 77.5149ZM180.273 69.5812L157.273 54.5812L156.727 55.4188L179.727 70.4188L180.273 69.5812ZM156.622 54.6725L143.622 69.6725L144.378 70.3275L157.378 55.3275L156.622 54.6725ZM144.417 69.7243L105.417 10.7243L104.583 11.2757L143.583 70.2757L144.417 69.7243ZM104.572 10.7422L69.0716 69.7422L69.9284 70.2578L105.428 11.2578L104.572 10.7422ZM69.5 69.5H41V70.5H69.5V69.5ZM40.8579 69.5206L17.7103 76.3792L17.9944 77.338L41.1421 70.4794L40.8579 69.5206ZM-8.07382 73.4945L17.7785 77.3531L17.9262 76.364L-7.92618 72.5055L-8.07382 73.4945ZM-39.3743 38.3315L-8.3743 73.3315L-7.6257 72.6685L-38.6257 37.6685L-39.3743 38.3315ZM-61.5898 71.2859L-38.5898 38.2859L-39.4102 37.7141L-62.4102 70.7141L-61.5898 71.2859ZM-85.6874 61.9636L-62.1874 71.4636L-61.8126 70.5364L-85.3126 61.0365L-85.6874 61.9636ZM-100.196 73.3968L-85.1958 61.8968L-85.8042 61.1032L-100.804 72.6032L-100.196 73.3968ZM-114.817 61.8864L-100.817 73.3864L-100.183 72.6136L-114.183 61.1137L-114.817 61.8864ZM-146.273 41.4191L-114.773 61.9191L-114.227 61.0809L-145.727 40.5809L-146.273 41.4191ZM-167.602 70.3022L-145.602 41.3022L-146.398 40.6978L-168.398 69.6978L-167.602 70.3022ZM-192.345 78.4753L-167.845 70.4753L-168.155 69.5247L-192.655 77.5247L-192.345 78.4753ZM-235.092 70.4914L-192.592 78.4914L-192.408 77.5086L-234.908 69.5086L-235.092 70.4914ZM-258.273 55.4188L-235.273 70.4188L-234.727 69.5812L-257.727 54.5812L-258.273 55.4188ZM-270.622 70.3275L-257.622 55.3275L-258.378 54.6725L-271.378 69.6725L-270.622 70.3275ZM-310.417 11.2757L-271.417 70.2757L-270.583 69.7243L-309.583 10.7243L-310.417 11.2757ZM-327.322 40.7578L-309.572 11.2578L-310.428 10.7422L-328.178 40.2422L-327.322 40.7578ZM-345.072 70.2578L-327.322 40.7578L-328.178 40.2422L-345.928 69.7422L-345.072 70.2578ZM-374 70.5H-345.5V69.5H-374V70.5Z",fill:"#CFD5DA"})),n.createElement("mask",{id:"mask1_467_73096",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"52",y:"0",width:"1140",height:"80"},n.createElement("rect",{x:"52",width:"1140",height:"80",fill:"#C4C4C4"})),n.createElement("g",{mask:"url(#mask1_467_73096)"},n.createElement("rect",{x:"55.5",y:"-1.5",width:"1140",height:"80",fill:"#CFD5DA",fillOpacity:"0.25",stroke:"#8F9EAA",strokeDasharray:"2 5"}),n.createElement("rect",{x:"55",width:"86",height:"3",fill:"#CFD5DA"}))))};a(9391);var K=new(m())({id:"error-state",use:"error-state-usage",viewBox:"0 0 199 79",content:''});u().add(K);const Y=K;var P=a(50876),q=a(63314);const J=()=>n.createElement("svg",{viewBox:Y.viewBox,width:"197"},n.createElement("use",{xlinkHref:"#".concat(Y.id)})),W=(0,G.default)(d.Button).withConfig({displayName:"errorView__RetryButton",componentId:"sc-1n9qb8k-0"})(["white-space:normal !important;align-items:flex-start !important;width:230px !important;font-size:12px !important;font-weight:normal !important;& > *{align-items:start !important;margin:0 !important;padding:0 !important;}"]),X=e=>{let{onRetry:t}=e;const{sendLog:a,isReady:o}=(0,P.A)(),r=(0,n.useCallback)((()=>{a({feature:"AnomalyAdvisor",description:"Retry"}).finally((()=>{"function"==typeof t&&t()}))}),[o]);return n.createElement(q.DL,{feature:"AnomalyAdvisor"},n.createElement(d.Flex,{column:!0,alignItems:"center",width:"100%"},n.createElement(J,null),n.createElement(d.TextSmall,{margin:[1,0,0],color:"textDescription"},"Something went wrong."),n.createElement(W,{margin:[2,0,0],padding:[0],onClick:r,icon:"reload",flavour:"borderless",label:"Retry fetching anomalies for the same timeframe",height:"initial",width:"initial"})))},$=e=>{let{error:t,loading:a,hasData:o}=e;return t?n.createElement(d.TextSmall,null,"No data"===t?"No data for this period. Try highlighting an other area.":t.errorMessage||"Something went wrong"):a?n.createElement(d.TextSmall,null,"Searching for anomalies..."):o?n.createElement(d.TextSmall,{color:"textDescription"},"Anomalous metrics in the selected timeframe sorted from most anomalous to least."):n.createElement(d.TextSmall,null,"You haven't highlighted any timeframe yet.")},Q=(0,n.forwardRef)(((e,t)=>{let{error:a,loading:o,hasData:r,onRetry:l,totalDimensionsCount:i,...s}=e;return n.createElement(d.Flex,(0,w.A)({ref:t,column:!0,gap:2,padding:[4],background:"sideBar"},s),n.createElement(d.Flex,{gap:1,alignItems:"baseline"},n.createElement(d.H4,null,i?"".concat(i," "):"","Anomalous metrics"),n.createElement(R,null)),n.createElement($,{hasData:r,loading:o,error:a}),a?n.createElement(X,{onRetry:l}):n.createElement(j,{animate:o}))})),ee=(0,n.forwardRef)(((e,t)=>{const a=(0,o.w7)({extraKey:"anomalies",merge:!1,scoped:!0}),{loaded:r,loading:l,error:i,totalDimensionsCount:s}=(0,N.G9)({nodeIds:a,flavour:"anomaly"}),{sendLog:d,isReady:c}=(0,P.A)(),m=(0,n.useRef)();return(0,n.useEffect)((()=>{null!==m&&void 0!==m&&m.current||!c||!r||(d({feature:"AnomalyAdvisor",...!i&&r?{isSuccess:!0}:{},...i?{isFailue:!0}:{},...r?{totalDimensionsCount:s}:{}}),m.current=!0)}),[l,r,i,d,c]),n.createElement(Q,(0,w.A)({ref:t,loading:l,error:i,hasData:r,totalDimensionsCount:s},e))})),te={"anomaly_detection.anomaly_rate":{name:"Anomaly Rate",info:"This is the percentage of metrics that are anomalous."},"anomaly_detection.dimensions":{name:"Count of Anomalous Metrics",info:"Variance in the amount of anomalous metrics over time could indicate unexpected behavior that merits investigation."},"anomaly_detection.detector_events":{name:"Anomaly Events Detected ",info:"An anomaly event is a period of time when a node has persistently elevated anomaly rates across all metrics. This may indicate unexpected behavior that merits investigation."}},ae={"Anomaly advisor":{showAR:!1,name:"Anomaly advisor",info:n.createElement(d.Flex,{column:!0,gap:2},n.createElement(d.TextSmall,{color:"sectionDescription"},"Machine Learning powered automated anomaly detection running at the edge."),n.createElement(d.TextSmall,{color:"sectionDescription"},"Use this page as a starting point to explore potential anomalies. Learn more on"," ",n.createElement(g.A,{Component:d.TextSmall,href:"https://learn.netdata.cloud/docs/cloud/insights/anomaly-advisor",target:"_blank",rel:"noopener noreferrer"},"how to")," ","use Anomaly Advisor."),n.createElement(d.Flex,{gap:1,alignItems:"center"},n.createElement(d.Icon,{name:"highlightArea",color:"sectionDescription",size:"small"}),n.createElement(d.TextSmall,{color:"sectionDescription"},"Highlight a time-frame of interest to explore potential anomalies.")))},"Anomalous metrics":{info:n.createElement(ee,null)}},ne=Object.keys(te),oe=function(e,t){let{os:a,extraKey:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o={};const{menuGroups:r,subMenus:l,menuGroupChartIds:i}=((e,t)=>{const a={},n={},o={};return ne.forEach(((e,a)=>{t[e]={chartId:e,id:"Anomaly advisor",subMenuId:e,priority:-(a+1)}})),e.forEach(((e,a)=>{t[e]={chartId:e,id:"Anomalous metrics",subMenuId:e,priority:a+1}})),[...ne,...e].forEach((e=>{const r=t[e],l="".concat(r.id,"|").concat(r.subMenuId);n[l]||(n[l]=[]),a[r.id]||(a[r.id]=new Set),o[r.id]||(o[r.id]=[]),r.chartId&&(n[l].push(r.chartId),o[r.id].push(r.chartId)),l&&a[r.id].add(l)})),{chartMenus:t,menuGroups:a,subMenus:n,menuGroupChartIds:o}})(e,o),s={},d=Object.keys(r).reduce(((e,t)=>{const a=i[t],l=[...r[t]],s=o[a[0]];return e[t]={...s,...ae[t],level:0,id:t,subMenuIds:l,subMenuChartIds:a,link:"".concat((0,z.A)("menu_".concat(t))),size:24,forceVisibility:!0,arFlavour:"anomaly",extraKey:n},e}),{}),c=Object.keys(l).reduce(((e,t)=>{const a=l[t];if(!a.length)return e;const r=o[a[0]],{id:i}=d[r.id],[s,c]=r.chartId.split("::"),m=te[r.chartId];return e[t]={...r,name:c?"".concat(s," > ").concat(c):s,...m,level:1,id:t,menuGroupId:i,chartIds:a,link:"".concat((0,z.A)("menu_".concat(r.id,"_submenu_").concat(r.subMenuId))),size:24,forceVisibility:!0,arFlavour:"anomaly",showAR:!m,extraKey:n},e}),{}),m=Object.keys(r),h={},u=m.reduce(((e,t)=>{const n=d[t];return h[n.id]=!0,[...e,{...n,sticky:!0},...d[t].subMenuIds.reduce(((e,n)=>[...e,{...c[n],sticky:!0},...c[n].chartIds.map((e=>{const r=o[e];if(r)return s[e]=(0,B.Ay)({...r,id:e,context:e},{menuId:t,subMenuId:n,sectionInfo:c[n].info},{os:a}),{...s[e],level:2,size:365,menuKey:d[t].id,forceVisibility:!0}}))]),[])]}),[]);return o=null,{stickyIds:h,allElements:u,menuGroupIds:m,menuGroupById:d,subMenuById:c,menuItemAttributesById:s}};var re=a(79566),le=a(72253),ie=a(56489),se=a(67602),de=a(44741),ce=a(10952),me=a(12412);const he=e=>{let{id:t,...a}=e;return n.createElement(de.k,(0,w.A)({id:t},a),n.createElement(ce._,{id:t}),n.createElement(me.G,{id:t}))},ue=(0,n.memo)(he);var pe=a(31438),Le=a(80925),fe=a(36196),ge=(a(3064),a(72577),a(28973)),ye=a(13752),ve=a(92815),Ee=a(72582),Me=a(540),be=new(m())({id:"dashboard_add_chart",use:"dashboard_add_chart-usage",viewBox:"0 0 24 24",content:''});u().add(be);const Ae=be;var we=a(6504),xe=a(22332),Ce=a(46741);const ke=e=>{const{handleOpenModal:t}=(0,Me.A)("addToDashboardModal"),a=(0,xe.useChart)(),o=()=>{const e=a.getAttribute("id");t("",{chartId:e})},r=(0,Ce.JT)("dashboard:Update");return(0,n.useLayoutEffect)((()=>a.onKeyChange(["Alt","Shift","KeyD"],r?o:()=>{})),[r]),n.createElement(we.Button,(0,w.A)({icon:n.createElement(we.default,{svg:Ae,size:"16px"}),onClick:r?o:()=>{},title:r?"Add to dashboard":"You need to be logged in to create your custom dashboards and use this chart in them","data-testid":"chartHeaderToolbox-addDashboard",disabled:!r},e))},Ie=(0,n.memo)(ke);var Ze=a(83465);const De=(e,t)=>e&&e.getRoot().getChildren().find((e=>e.match({id:"anomalies-".concat(t)}))),_e=e=>t=>"overview-page::".concat(e.getAttribute("id"),"::").concat(t),He=e=>{let{id:t,...a}=e;const o=(0,k.ID)(),{height:r=0,...l}=(0,pe.aA)(t),i=(0,Le.e)(),{sendLog:s,isReady:d}=(0,P.A)(),c=(0,n.useMemo)((()=>{const e=De(i,o),a=Object.keys(te);let n=e.getNode({id:t});if(n)return n;const[s,d]=t.split("::");return n=i.makeChart({attributes:{contextScope:[s],height:(0,Ze.Oq)(e,t,r+260),id:t,roomId:o,selectedDimensions:d?[d]:[],groupBy:a.includes(t)?["node"]:["dimension"],...l},makeTrack:_e}),e.appendChild(n),n}),[i,o,t]);return(0,n.useEffect)((()=>{c&&d&&"function"===typeof s&&c.updateAttribute("logOptions",{sendLog:s,payload:{feature:"AnomalyAdvisor"}})}),[c,s,d]),n.createElement(fe.A,(0,w.A)({margin:[0,0,2],chart:c,"data-chartid":t,"data-track":c.track("container"),height:"300px",width:"100%"},a))},Te=n.memo(He,((e,t)=>e.id===t.id)),ze=e=>{let{id:t,subMenuId:a,...o}=e;return n.createElement(Te,(0,w.A)({id:t,role:"graphics-object","aria-roledescription":"chart","data-submenuid":a},o))},Be=(0,n.memo)(ze);var Ne=a(74258),Se=a(37031),Fe=a(6551);const Ve=e=>{let{id:t}=e;return n.createElement(Ne.t,{gap:0,id:t},n.createElement(Se.t,{id:t,margin:[1,0,0]}),n.createElement(Fe.X,{id:t}))},Re=(0,n.memo)(Ve),Ge=e=>{switch(e.level){case 0:return ue;case 1:return Re;case 2:return Be;default:return null}},Oe=e=>{let{onChartNameChange:t,initialChartName:a,dashboardOptions:o,linkToGo:r,contextToGo:l,...i}=e;const[s,,,d]=(0,se.A)("addToDashboardModal"),{setActiveMenuGroupId:c,setActiveSubMenuId:m}=(0,re.A)({onChartNameChange:t,initialChartName:a,linkToGo:r,contextToGo:l});return n.createElement(D.H,i,n.createElement(le.A,{onActiveMenuGroupId:c,onActiveSubMenuId:m,getComponent:Ge,dashboardOptions:o,initialChartName:a,checkVisibility:()=>!0}),s&&n.createElement(ie.A,{onClose:d}))},Ue=["alerts","info","config"],je=e=>{let{nodeIds:t}=e;const a=(0,Z.vt)(),o=(0,k.ID)(),[r,l,i,,s,d]=(0,_.Ay)(a,o,t),c=!l.length||!!s,m=(0,I.yO)(o,i),[h,{width:u}]=(0,x.A)(),[p,{height:L}]=(0,x.A)(),f=(0,n.useMemo)((()=>Math.ceil((L+32)/4)),[L]);((e,t,a)=>{let{width:o,host:r}=a;if(!r)throw"No host provided";const l=(0,Le.e)();(0,n.useMemo)((()=>{if(!l||!e)return;let a=De(l,e);return a?void 0:(a=l.makeContainer({attributes:{id:"anomalies-".concat(e),roomId:e,host:r,overlays:{proceeded:{type:"proceeded"}},nodesScope:t,containerWidth:o,toolboxElements:[Ee.default,ye.default,ve.default,Ie]}}),l.appendChild(a),(0,ge.unregister)((0,Ze.ml)(l,a)))}),[l,r,e,t]),(0,n.useEffect)((()=>{if(!l||!e)return;let a=De(l,e);a&&a.getNodes().forEach((e=>{e.updateAttribute("nodesScope",t),e.getAttribute("active")&&"chart"===e.type&&e.trigger("fetch")}))}),[l,e,t]),(0,n.useEffect)((()=>()=>{if(!l||!e)return;let t=De(l,e);t&&t.destroy()}),[e])})(o,t,{host:(0,Z.dg)()?"".concat(window.envSettings.agentApiUrl,"/api/v2"):"".concat(window.envSettings.apiUrl,"/api/v3/spaces/").concat(a,"/rooms/").concat(o),width:u});const[g,y]=(0,H.N9)("chartName",{key:o,extraKey:"anomalies",flavour:"val"}),[v,E]=(0,n.useState)(!1);return(0,n.useEffect)((()=>{E(!!l.length)}),[l.length]),n.createElement(D.A,{getObject:m,ids:r,getMenu:oe,extraKey:"anomalies"},n.createElement(C.A,{ref:h,position:"relative",sidebar:n.createElement(T.Ay,{nodeIds:t,title:"Anomalies",initialChartName:g,hiddenTabs:Ue,flavour:"anomalies",loaded:!0,hasSearch:!1})},n.createElement(Oe,(0,w.A)({initialChartName:g,onChartNameChange:y,linkToGo:v&&(0,z.A)("menu_Anomalous metrics")},c&&{padding:[0,0,f,4]})),c&&n.createElement(ee,{ref:p,position:"absolute",bottom:0,right:0,left:0,zIndex:35,onRetry:d})))},Ke=()=>{const e=(0,o.w7)({extraKey:"anomalies",merge:!1,scoped:!0}),t=(0,s.CK)(),a=(0,s.nj)(),{predicting:d}=(e=>{const t=(0,r.BU)(),a=(0,r.Gt)(t);return(0,n.useMemo)((()=>a.reduce(((t,a)=>{const{capabilities:{ml:n}}=a;return null!==n&&void 0!==n&&n.enabled?t.predicting=[...t.predicting,l(a,e)]:t.incapable=[...t.incapable,l(a,e)],t}),{predicting:[],incapable:[]})),[t.length,e])})("id");if(a&&!t.length)return n.createElement(q.Ay,{feature:"Anomalies",mode:"NoNodesView"},n.createElement(i.A,null));const c=d.length>0;return a&&!c?n.createElement(q.Ay,{feature:"Anomalies",mode:"NoConfiguredNodesView"},n.createElement(A,null)):n.createElement(q.Ay,{feature:"Anomalies"},n.createElement(je,{nodeIds:e}))}}}]);