File: //opt/netdata/netdata-web-files/v3/7742.24d7c21785dc6dd84183.chunk.js
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"81e2ee4047c533a9c262178a6611e7b957d46030"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="def292d5-c097-4f97-9508-40f08b11c618",e._sentryDebugIdIdentifier="sentry-dbid-def292d5-c097-4f97-9508-40f08b11c618")}catch(e){}}(),(globalThis.webpackChunkcloud_frontend=globalThis.webpackChunkcloud_frontend||[]).push([[6026,7742],{72060(e,t,n){n.d(t,{A:()=>r});const r=e=>{try{if(!e)return null;const t=document.createElement("a");return t.href=e,/https?/.test(t.protocol)?new URL(t.protocol+"//"+t.host+t.pathname+t.search+t.hash).toString():null}catch(t){return null}}},82507(e,t,n){n.d(t,{A:()=>a});var r=n(882),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;}"]),a=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"})]})]})})}},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"})]})]})}},73090(e,t,n){n.r(t),n.d(t,{SettingsContainer:()=>cd,default:()=>ud});var r=n(96540),o=n(39175),s=n(78152),a=n(7960),i=n(19707),l=n(72060),c=n(55164),d=n(63474),u=n(62718),h=n(37617),x=n(1174),g=n(92318),m=n(99728),p=n(99094),f=(n(74423),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)),j=n(76667),b=n(91539),v=n(24609),y=n(19186),C=n(18739),w=n(58247),I=n(16922),A=n(81685),k=n(22068),S=n(55048),M=n(63872),T=n(44245),F=n(77234),N=n(54264),L=n(4204);const D=()=>{const e=(0,v.vt)(),t=(0,y.ID)(),{refresh:n}=(0,C.JN)(),o=(0,m.JT)("insights:ReadReport"),[s,a]=(0,k.A)(),[i,l]=(0,S.A)(),[c,d]=(0,M.A)(),{pathname:u}=(0,j.zy)(),h=u.includes(F.x.insights)&&!u.includes(p.p9),[,,,x]=(0,A.W5)(),[,g]=(0,T.m0)({tabId:F.x.insights}),[D]=(0,A.ly)(),[B]=(0,A.uN)(),R=(0,f.yF)((0,r.useCallback)((r,o,u)=>{let{data:m}=u;const f=m?.reports||[],j=s(),b=i(),v=f.filter(e=>{let{status:t,isScheduled:n}=e;return!n&&!p.bs.includes(t)}).map(e=>{let{id:t}=e;return t}),y=j.filter(e=>v.includes(e)),C=y.filter(e=>!b.includes(e)),{COMPLETED:w,FAILED:A}=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:[]})}(C,f);if(C.length&&(w.length&&c({header:"New report",text:"A new report has been generated!"}),A.length&&(a(j.filter(e=>!A.includes(e))),d({header:"Error",text:"Failed to generate report."})),l(Array.from(new Set([...b,...C.filter(e=>!A.includes(e))]))),(w.length||A.length)&&(x(),n()),!h&&w.length+A.length>0)){const e=w.length>0?"success":"error";g({color:e})}o((0,I.Tj)({spaceId:e,roomId:t}),e=>({...e,loaded:!0,reports:f.map(e=>({...e,isUnread:y.includes(e.id)}))}))},[e,t,s,a,i,l,x,n,c,d,h,g])),$=(0,f.yF)((0,r.useCallback)((n,r,o)=>{r((0,I.Tj)({spaceId:e,roomId:t}),e=>({...e,loaded:!0,error:o?.response?.data||"Something went wrong"}))},[e,t]));return(0,b.A)(()=>({enabled:B&&!L.ei&&o&&!!e&&!!t,force:!0,polling:B&&!!D.length,fetch:()=>(e=>{let{spaceId:t,roomId:n}=e;const r=(0,w.eF)({spaceId:t,roomId:n}),o=(0,w.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:$,onReceive:R,pollingOptions:{pollingInterval:h?5e3:15e3,checkPauseCondition:N.$}}),[e,t,h,o,B,D.length])};var B=n(10602),R=n(37479),$=n(60908),V=n(85660),O=n(88255),P=n(50271),E=n(24013),H=n(87083),_=n(49435),K=n(42790),z=n(34843),G=n(52035),W=n(18790);const q={filteredNodesIds:[],filteredNodesCount:0,nodesCount:0},U=(0,W.I)(()=>(0,G.eU)(q)),J=()=>{const e=(0,y.ID)();return(0,z.md)(U(e))},Z=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"nodesView";const t=(0,y.ID)();return(0,K.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 a=(0,E.Gt)(e),i=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=a.filter(e=>!n(e));t=r.length;const o=r.map(t=>{let n=0,r=0,o=0;if(i){const{name:e,...s}=t;r=t.name?(0,_.pe)(e,i):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,_.pe)(String(e),i,{scoreFactor:.6,minScore:.6}));n=("Live"===t.nodeStatus?100:"Stale"===t.nodeStatus?50:0)+10*r+o}const s=!!i&&!(r>.3||o>.3);return s||(e+=1),{id:t.id,searchScore:n,included:!s}}).filter(e=>e.included);return[o,t,e]},[i,a,o,n]),u=(()=>{const e=(0,y.ID)();return(0,z.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(83330),re=n(1351),oe=n(38429),se=n(41514),ae=n(68531),ie=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,y.ID)();return(0,K.N9)("tocSearch",{key:t,extraKey:e,defaultValue:"",flavour:"val"})}(t),[s,a]=(0,r.useState)(n||"");return(0,ae.A)(()=>{o(s),(0,se.H)("toc-search","search-automatic-trigger","nodes-view",s)},300,[s]),(0,r.useEffect)(()=>{n!==s&&a(n)},[n]),(0,ie.jsx)(oe.TextInput,{iconLeft:(0,ie.jsx)(oe.Icon,{name:"search",color:s?"textFocus":"textLite",width:"14px",height:"14px"}),iconRight:!!s&&(0,ie.jsx)(oe.IconButton,{icon:"x",iconColor:s?"textFocus":"textLite",width:"14px",height:"14px",onClick:()=>{a(""),(0,se.H)("toc-search","clear-search-button","nodes-view")},padding:[0],neutral:!0,"data-testid":"filterNodesInput-clearButton"}),value:s,onChange:e=>a(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,ie.jsx)(ie.Fragment,{children:(0,ie.jsxs)(oe.TextMicro,{alignSelf:"end",color:"textLite",margin:[1,0,0],"data-testid":"numberOfNodesIndication",children:["Showing"," ",(0,ie.jsx)(oe.TextMicro,{strong:!0,color:"textDescription","data-testid":"numberOfNodesIndication-filteredNodesCount",children:t})," ","of total"," ",(0,ie.jsx)(oe.TextMicro,{strong:!0,color:"textDescription","data-testid":"numberOfNodesIndication-nodesCount",children:n})," ","nodes"]})})},he=()=>{const{filteredNodesCount:e}=J();return e?null:(0,ie.jsxs)(oe.Flex,{width:"100%",gap:1,margin:[4,0,0],padding:[2],alignItems:"center","data-testid":"noResultsWereFound",children:[(0,ie.jsx)(oe.Icon,{name:"information",color:"textDescription"}),(0,ie.jsx)(oe.TextMicro,{strong:!0,color:"textDescription",children:"No results were found"})]})},xe=e=>{let{extraKey:t}=e;return(0,ie.jsxs)(oe.Flex,{column:!0,alignItems:"center",children:[(0,ie.jsx)(le,{extraKey:t}),(0,ie.jsx)(ue,{}),(0,ie.jsx)(he,{})]})};var ge=n(79748);const me=()=>(0,ie.jsxs)(oe.Flex,{padding:[6],round:1,width:"600px",background:"modalInfoBackground",children:[(0,ie.jsx)(oe.Box,{margin:[0,4,0,0],children:(0,ie.jsx)(oe.Box,{as:oe.Icon,width:10,height:10,name:"nodes_update"})}),(0,ie.jsxs)(oe.Flex,{column:!0,gap:2,children:[(0,ie.jsx)(oe.Text,{strong:!0,children:"Couldn't find the node you were looking for? "}),(0,ie.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,ie.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,ie.jsxs)(oe.Flex,{column:!0,justifyContent:"center",alignItems:"center",alignSelf:"center",gap:4,children:[(0,ie.jsxs)(oe.Flex,{column:!0,justifyContent:"center",alignItems:"center",width:"300px",margin:[0,0,6],children:[(0,ie.jsx)(oe.H3,{margin:[0,0,4],children:"No nodes to display"}),(0,ie.jsx)(oe.Text,{color:"textDescription",textAlign:"center",children:"Double-check your search or filters and dates and try again with different conditions."})]}),t,(0,ie.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),Me=n(25291),Te=n(24582);const Fe=e=>{let{link:t,children:n}=e;return(0,ie.jsxs)(oe.Flex,{as:"a",target:"_blank",href:t,gap:1,alignItems:"end",children:[(0,ie.jsx)(oe.TextNano,{textDecoration:"undeline",children:n}),(0,ie.jsx)(oe.Icon,{color:"text",name:"question",width:"16px",height:"16px"})]})},Ne=e=>{let{title:t,help:n,link:r,disclaimer:o,children:s,...a}=e;return(0,ie.jsxs)(oe.Flex,{gap:1,column:!0,...a,children:[(0,ie.jsxs)(oe.Flex,{justifyContent:"between",alignItems:"baseline",children:[(0,ie.jsx)(oe.Text,{as:"label",margin:[0],children:t}),n&&(0,ie.jsx)(Fe,{link:r,children:n})]}),s,o&&(0,ie.jsx)(oe.TextSmall,{children:o})]})};var Le=n(91130),De=n(16866);const Be=e=>{let{dimensions:t}=e;return{dimensions:t.map(e=>{let{name:t}=e;return{value:t,label:t}})}};n(3949);const Re=[{value:"version",label:"Netdata Version"},{value:"nodeStatus",label:"Node Status"},{value:"os.nm",label:"OS Name"},{value:"os.v",label:"OS Version"},{value:"os.kernel.nm",label:"Kernel"},{value:"os.kernel.v",label:"Kernel Version"},{value:"hw.architecture",label:"Architecture"},{value:"hw.cpuFrequency",label:"CPU Frequency"},{value:"hw.cpus",label:"CPU Cores"},{value:"hw.memory",label:"Memory"},{value:"hw.diskSpace",label:"Disk Space"}],$e=Object.fromEntries(Re.map(e=>{let{value:t,label:n}=e;return[t,n]})),Ve=()=>{const e=(0,E.Gt)();return(0,r.useMemo)(()=>{const t=new Set;e.forEach(e=>{e.labels&&Object.keys(e.labels).forEach(e=>t.add(e))});const n=Array.from(t).sort().map(e=>({value:`labels.${e}`,label:e}));return[...Re,...n]},[e])},Oe=e=>{let{isNew:t}=e;return(0,ie.jsxs)(oe.Flex,{as:"span",gap:1,children:["Manage room",(0,ie.jsx)(oe.TextBig,{color:"textLite",children:"/"}),(0,ie.jsxs)(oe.TextBig,{color:"textLite",children:[t?"Add":"Edit"," Column"]})]})},Pe=[{value:"value",label:"Value"},{value:"progressBar",label:"Progress Bar"}],Ee=[{value:"sum",label:"Sum"},{value:"avg",label:"Average"},{value:"min",label:"Minimum"},{value:"max",label:"Maximum"}],He=[{value:"left",label:"Left"},{value:"center",label:"Center"},{value:"right",label:"Right"}],_e=e=>{let{spaceId:t,roomId:n,id:o,onClose:s,tabId:a,...i}=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",category:w="Metrics",accessorKey:I="",fallbackKeys:A=[]}=u;(0,r.useEffect)(()=>{l&&c()},[]);const k=(0,H.w7)({extraKey:"nodesView",merge:!1,scoped:!0}),S=(0,Me.A)(n,k,{spaceId:t});if(S)throw S;const M=(0,Te.OL)(n),T=(0,r.useMemo)(()=>M.map(e=>({value:e,label:e})),[M]),F=(0,Te._0)(n),N=Ve(),L="Labels"===w,D=(0,r.useMemo)(()=>g&&{value:g,label:g},[g]),[{dimensions:B},R]=(0,ke.A)(()=>({enabled:!!g,fetch:()=>((e,t,n)=>Le.A.get(`${De.P8}/spaces/${e}/rooms/${t}/contexts/${encodeURIComponent(n)}`,{transform:Be}))(t,n,g),initialValue:{dimensions:[]}}),[t,n,g]),$=(0,r.useCallback)(e=>{let{value:t}=e;h(e=>({...e,context:t,dimensions:[],title:t}))},[]),V=(0,r.useMemo)(()=>B?0===m.length?[]:m.map(e=>({value:e,label:e})):[],[m,B]),O=(0,r.useMemo)(()=>B?0===p.length?[]:p.map(e=>({value:e,label:e})):[],[p,B]),P=(0,r.useMemo)(()=>Ee.find(e=>e.value===(b||"sum")),[b]),E=(0,r.useMemo)(()=>({value:C,label:He.find(e=>e.value===C)?.label}),[C]),_=(0,r.useMemo)(()=>A.map(e=>N.find(t=>t.value===e)||{value:e,label:e}),[A,N]),K=(0,r.useMemo)(()=>I?N.find(e=>e.value===I)||{value:I,label:I}:null,[I,N]),z=(0,r.useMemo)(()=>N.filter(e=>e.value!==I),[N,I]),G=(0,r.useCallback)(e=>{R||h(t=>({...t,dimensions:e.map(e=>{let{label:t}=e;return t})}))},[R]),W=(0,Se.tQ)(n),q=(0,r.useCallback)(()=>W({...u,id:o,type:a}).then(s),[u,o,a,s,W]),U=(0,r.useCallback)(e=>{let{target:{value:t}}=e;t.length<=30&&h(e=>({...e,title:t,header:t,headerString:t}))},[]),J=(0,r.useCallback)(e=>{R||h(t=>({...t,totalDimensions:e.map(e=>{let{label:t}=e;return t})}))},[R]),Z=(0,r.useCallback)(e=>{let{value:t}=e;h(e=>({...e,columnFlavour:t,calculateTotal:"value"!==t&&e.calculateTotal}))},[]),X=(0,r.useCallback)(e=>{let{value:t}=e;h(e=>({...e,aggregation:t}))},[]),Y=(0,r.useCallback)(e=>{let{value:t}=e;h(e=>({...e,align:t}))},[]),Q=(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}))},[]),ee=(0,r.useCallback)(e=>{let{target:{checked:t}}=e;h(e=>({...e,hideUnits:t}))},[]),te=(0,r.useCallback)(e=>{let{target:{checked:t}}=e;h(e=>({...e,calculateTotal:t,totalDimensions:t?e.totalDimensions:[]}))},[]),ne=(0,r.useCallback)(e=>{const t=e.target.value;h(e=>({...e,category:t,columnFlavour:"Labels"===t?"metadata":"metadata"===e.columnFlavour?"value":e.columnFlavour,align:"Labels"===t?"left":e.align,accessorKey:"Labels"===t?e.accessorKey:"",fallbackKeys:"Labels"===t?e.fallbackKeys:[],context:"Metrics"===t?e.context:"",dimensions:"Metrics"===t?e.dimensions:[]}))},[]),re=(0,r.useCallback)(e=>{let{value:t,label:n}=e;h(e=>({...e,accessorKey:t,title:e.title||n,header:e.title||n,headerString:e.title||n}))},[]),se=(0,r.useCallback)(e=>{h(t=>({...t,fallbackKeys:e.map(e=>{let{value:t}=e;return t})}))},[]),ae=!x||(L?!I:!g);return(0,ie.jsxs)(we.GO,{onClose:s,...i,children:[(0,ie.jsx)(Ie.z,{onClose:s,title:(0,ie.jsx)(Oe,{isNew:l}),children:(0,ie.jsx)(oe.Button,{label:"Save",onClick:q,disabled:ae})}),(0,ie.jsx)(Ae.U,{children:l?"Add a new column":"Edit "+(L?"attribute":"metric")}),(0,ie.jsx)(we.Yv,{children:(0,ie.jsxs)(oe.Flex,{gap:6,column:!0,children:[(0,ie.jsx)(Ne,{title:"Column Type","data-testid":"manageMetrics-category",children:(0,ie.jsxs)(oe.Flex,{gap:4,children:[(0,ie.jsx)(oe.RadioButton,{label:"Metrics",checked:"Metrics"===w,onChange:ne,value:"Metrics","data-testid":"manageMetrics-categoryMetrics"}),(0,ie.jsx)(oe.RadioButton,{label:"Labels",checked:"Labels"===w,onChange:ne,value:"Labels","data-testid":"manageMetrics-categoryLabels"})]})}),L?(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(Ne,{title:"Attribute","data-testid":"manageMetrics-accessorKey",children:(0,ie.jsx)(oe.Select,{options:N,value:K,onChange:re,"data-testid":"manageMetrics-accessorKeySelect"})}),(0,ie.jsx)(Ne,{title:"Column Title","data-testid":"manageMetrics-title",children:(0,ie.jsx)(oe.TextInput,{name:"title",placeholder:"Type name",value:x,onChange:U})}),(0,ie.jsx)(Ne,{title:"Fallback Keys",disclaimer:"Alternative attribute paths to check if the primary attribute is empty.","data-testid":"manageMetrics-fallbackKeys",children:(0,ie.jsx)(oe.Select,{isMulti:!0,options:z,value:_,onChange:se,"data-testid":"manageMetrics-fallbackKeysSelect"})}),(0,ie.jsx)(Ne,{title:"Text Alignment","data-testid":"manageMetrics-align",children:(0,ie.jsx)(oe.Select,{options:He,value:E,onChange:Y,"data-testid":"manageMetrics-alignSelect"})})]}):(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(Ne,{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,ie.jsx)(oe.Select,{options:T,value:D,onChange:$,isLoading:!F,"data-testid":"manageMetrics-contextSelect"})}),(0,ie.jsx)(Ne,{title:"Column Title","data-testid":"manageMetrics-title",children:(0,ie.jsx)(oe.TextInput,{name:"title",placeholder:"Type name",value:x,onChange:U})}),(0,ie.jsx)(Ne,{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,ie.jsx)(oe.Select,{isMulti:!0,options:B,value:V,onChange:G,isLoading:R,isDisabled:!D,"data-testid":"manageMetrics-dimensionSelect"})}),(0,ie.jsx)(Ne,{title:"Display Type","data-testid":"manageMetrics-columnFlavour",children:(0,ie.jsx)(oe.Select,{options:Pe,value:{value:j,label:"value"===j?"Value":"Progress Bar"},onChange:Z,"data-testid":"manageMetrics-columnFlavourSelect"})}),(0,ie.jsx)(oe.Toggle,{labelRight:"Calculate as percentage of total",checked:f,onChange:te,"data-testid":"manageMetrics-calculateTotalToggle",colored:!0}),f&&(0,ie.jsx)(Ne,{title:"Total Dimensions",disclaimer:"Dimensions to use for total calculation. Leave blank to use all available dimensions.","data-testid":"manageMetrics-totalDimensions",children:(0,ie.jsx)(oe.Select,{isMulti:!0,options:B,value:O,onChange:J,isLoading:R,isDisabled:!D,"data-testid":"manageMetrics-totalDimensionSelect"})}),(0,ie.jsx)(Ne,{title:"Aggregation","data-testid":"manageMetrics-aggregation",children:(0,ie.jsx)(oe.Select,{options:Ee,value:P,onChange:X,"data-testid":"manageMetrics-aggregationSelect"})}),(0,ie.jsx)(Ne,{title:"Decimal Places","data-testid":"manageMetrics-fractionDigits",children:(0,ie.jsx)(oe.TextInput,{type:"number",name:"fractionDigits",min:"0",max:"3",value:v,onChange:Q})}),(0,ie.jsx)(Ne,{title:"Hide Units","data-testid":"manageMetrics-hideUnits",children:(0,ie.jsx)(oe.Toggle,{checked:y,onChange:ee,"data-testid":"manageMetrics-hideUnitsToggle"})}),(0,ie.jsx)(Ne,{title:"Text Alignment","data-testid":"manageMetrics-align",children:(0,ie.jsx)(oe.Select,{options:He,value:E,onChange:Y,"data-testid":"manageMetrics-alignSelect"})})]})]})})]})};var Ke=n(49163),ze=n(45087),Ge=n(43375),We=n(43627),qe=n(74979);const Ue=e=>{let{onConfirm:t,children:n}=e;const[o,s]=(0,r.useState)(!1),a=(0,r.useCallback)(()=>{s(!1),t()},[t]),i=(0,r.useCallback)(()=>{s(!1)},[]);return o?(0,ie.jsxs)(oe.Flex,{alignItems:"center",gap:1,children:[(0,ie.jsx)(oe.Text,{color:"textLite",whiteSpace:"nowrap",children:"Delete?"}),(0,ie.jsx)(oe.IconButton,{icon:"checkmark_s",flavour:"borderless",padding:[0],onClick:a,width:"12px",height:"12px",title:"Confirm delete"}),(0,ie.jsx)(oe.IconButton,{icon:"x",flavour:"borderless",padding:[0],onClick:i,width:"12px",height:"12px",title:"Cancel"})]}):n(()=>s(!0))},Je={sum:"sum",avg:"average",min:"minimum",max:"maximum"},Ze=e=>$e[e]?$e[e]:e.startsWith("labels.")?e.slice(7):e,Xe=e=>{if("Labels"===e.category){const t=["Node attribute column."];if(e.accessorKey&&t.push(`Shows the ${Ze(e.accessorKey)} attribute.`),e.fallbackKeys?.length){const n=e.fallbackKeys.map(Ze).join(", ");t.push(`Falls back to ${n} when not available.`)}return t.join(" ")}const t=["Metric column."];if(e.context){const n=e.dimensions?.length?e.dimensions.join(", "):"all available dimensions",r=Je[e.aggregation]||"sum";t.push(`Shows ${r} of ${n} from ${e.context}.`)}return"progressBar"===e.columnFlavour&&t.push("Displayed as a progress bar."),e.calculateTotal&&t.push("Calculated as percentage of total."),t.join(" ")},Ye=e=>{let{metric:t,onToggle:n,onEdit:r,onDelete:o,disabled:s}=e;const{attributes:a,listeners:i,setNodeRef:l,transform:c,transition:d}=(0,We.gl)({id:t.id}),u={transform:qe.Ks.Transform.toString(c),transition:d};return(0,ie.jsx)("div",{ref:l,style:u,...a,children:(0,ie.jsxs)(oe.Flex,{"data-testid":`metricsMenu-metric-${t.title}`,justifyContent:"between",alignItems:"center",padding:[1,0],gap:2,children:[(0,ie.jsxs)(oe.Flex,{alignItems:"center",gap:1,children:[(0,ie.jsxs)(oe.Flex,{alignItems:"center",gap:1,flex:!1,children:[!s&&(0,ie.jsx)(oe.Icon,{name:"nav_dots",color:"textLite",cursor:"grab",size:"small",...i}),(0,ie.jsx)(ze.A,{content:Xe(t),children:(0,ie.jsx)(oe.Icon,{name:"Labels"===t.category?"node_hollow":"room_overview",color:"textLite",size:"small"})})]}),(0,ie.jsx)(oe.Checkbox,{checked:!t.hidden,"data-testid":"metricsMenu-metricCheckbox",label:t.title,onChange:n,labelProps:{wordBreak:"break-word"}})]}),(0,ie.jsxs)(oe.Flex,{alignItems:"center",gap:1,children:[(0,ie.jsx)(oe.IconButton,{"data-testid":"metricsMenu-editMetric",flavour:"borderless",icon:"pencilSolid",padding:[0],onClick:r,width:"10px",height:"10px"}),(0,ie.jsx)(Ue,{onConfirm:o,children:e=>(0,ie.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:a,tabId:i,metricsType:l}=e;const[c,d]=(0,Se.tY)(s),u=l||i,h=(0,r.useMemo)(()=>{const e=c.filter(e=>e.type===i);return e.length>0?e:c.filter(e=>e.type===u)},[i,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,Ge.FR)((0,Ge.MS)(Ge.AN),(0,Ge.MS)(Ge.uN,{coordinateGetter:We.JR})),p=(0,Se._E)(s,i),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,We.be)(x,e,r);g(o),p(o)}},[x,p]),b=(0,Ke._)({roomId:s,params:{type:"roomMetrics",entity:"metrics",path:"/nodes"}})[0],v=(0,Se.Ul)(s,i,l);if(!a.current||!t)return null;const y=e=>{o(e),n()};return(0,ie.jsxs)(oe.Drop,{align:{top:"bottom",right:"right"},animation:!0,background:"dropdown",column:!0,margin:[.5,0,0],overflow:"hidden",padding:[2],round:!0,width:80,close:n,"data-testid":"metricsMenu",onClickOutside:n,onEsc:n,target:a.current,gap:1,children:[(0,ie.jsx)(Ge.Mp,{sensors:m,collisionDetection:Ge.fp,onDragEnd:j,children:(0,ie.jsx)(We.gB,{items:x,strategy:We._G,children:(0,ie.jsx)(oe.Flex,{column:!0,width:"100%",children:x.map(e=>{const t=h.find(t=>t.id===e);return t?(0,ie.jsx)(Ye,{metric:t,onToggle:()=>d(t.id,e=>({...e,hidden:!e.hidden,type:i})),onEdit:()=>y(t.id),onDelete:()=>{return e=t.id,void f(e);var e},disabled:!1},t.id):null})})})}),(0,ie.jsx)(oe.Button,{"data-testid":"metricsMenu-addMetricButton",label:"Add new column",icon:"plus",onClick:()=>y("new"),small:!0,alignSelf:"end"}),b&&(0,ie.jsx)(ze.A,{content:"All columns will be reset to defaults",children:(0,ie.jsx)(oe.Button,{padding:[0],"data-testid":"metricsMenu-resetButton",label:"Reset to default columns",flavour:"borderless",onClick:v,small:!0,danger:!0,alignSelf:"end"})})]})},et=e=>{let{spaceId:t,roomId:n,tabId:o,metricsType:s}=e;const[a,,i,l]=(0,be.A)(),[c,d]=(0,r.useState)(null),u=(0,r.useRef)();return(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.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:i,ref:u,label:"Columns",small:!0}),(0,ie.jsx)(Qe,{isOpen:a,onClose:l,onEdit:d,roomId:n,tabId:o,metricsType:s,targetRef:u}),c&&(0,ie.jsx)(_e,{"data-testid":"metricsManagement",spaceId:t,roomId:n,tabId:o,metricsType:s,id:c,onClose:()=>d(null)})]})};var tt=n(94404);const nt=()=>(0,se.H)("grouping","click-grouping","hm-nodes"),rt=(0,tt.A)(ve.A),ot=[{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"}],st=()=>{const e=(0,v.vt)(),t=(0,y.ID)(),[n,,o,s]=(0,be.A)(),[a,i]=(0,P.TS)(t,"groupMode"),l=(0,r.useMemo)(()=>ot.find(e=>e.value===a)||ot[0],[a]),c=(0,r.useCallback)(e=>{let{value:t}=e;return i(t)},[i]);return(0,ie.jsxs)(oe.Flex,{alignItems:"center","data-testid":"agentsHead-actions",flexWrap:!1,gap:3,children:[(0,ie.jsx)(oe.Select,{label:"Group by",onChange:c,onMenuOpen:nt,options:ot,value:l}),(0,ie.jsx)(et,{roomId:t,spaceId:e}),n&&(0,ie.jsx)(ye.A,{onClose:s}),(0,ie.jsx)(rt,{"data-ga":"add-nodes::click-add-nodes::hm-nodes","data-testid":"agentsHead-addNode",icon:"nodes_hollow",label:"Add Nodes",onClick:o,small:!0})]})},at=()=>(0,ie.jsx)(oe.Flex,{width:"100%",justifyContent:"end",background:"mainBackground",padding:[2],children:(0,ie.jsx)(st,{})});var it=n(85163),lt=n(84535);const ct="clear",dt="warning",ut="critical",ht="unreachable";var xt=n(58243),gt=n(49181);const mt={alertStatus:{[ut]:1,[dt]:2,[ct]:3,[ht]:4},nodeStatus:{Live:1,Stale:2,Offline:3}},pt={nodeStatus:e=>(0,gt.GM)(e.state),alertStatus:e=>(0,gt.vt)(e),vendor:e=>e.labels?.vendor||"Unknown",type:e=>e.labels?.type||"Unknown",location:e=>e.labels?.sysLocation||e.labels?.location||"Unknown","":()=>"Nodes"},ft=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n=(0,y.ID)(),o=(0,P.Cq)(n,e),s=pt[o];return(0,r.useCallback)(e=>{if("customGroups"===o){const n=((e,t)=>{for(const n of t)if((0,xt.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:mt[o]?.[n],icon:"nodeStatus"===o?`connectivityStatus${n}`:null}},[o,s,t])};var jt=n(56876),bt=n(30863),vt=n(69001),yt=n(95836),Ct=n(27496);const wt=e=>{let{id:t,...n}=e;return(0,ie.jsxs)(vt.h,{id:t,...n,children:[(0,ie.jsx)(yt.$,{id:t}),(0,ie.jsx)(Ct.n,{id:t})]})},It=(0,r.memo)(wt);var At=n(16373),kt=n(90901),St=n(82103),Mt=n(55759),Tt=n(77186),Ft=n(59400);const Nt=e=>{let{connectivity:t,id:n,name:r,...o}=e;const s=(0,m.JT)("node:Delete"),a=!(0,y.XA)().untouchable,[i,,l,c]=(0,be.A)(),[d,,u,h]=(0,be.A)();return(0,ie.jsxs)(Ft.SS,{alignSelf:"end",gap:1,"data-testid":"node-actions",...o,children:[a&&(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(St.A,{badge:"actionRemove","data-testid":"remove-node-action",children:(0,ie.jsx)(Ft.d0,{"data-ga":"nodes-table-row::click-remove-node::nodes-view",onClick:u})}),d&&(0,ie.jsx)(Tt.Ay,{ids:[n],name:r,onClose:h})]}),s&&"Offline"===t&&(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(St.A,{badge:"actionObsolete","data-testid":"obsolete-node-action",children:(0,ie.jsx)(Ft.AS,{"data-ga":"nodes-table-row::click-obsolete-node::nodes-view",onClick:l})}),i&&(0,ie.jsx)(Mt.Ay,{ids:[n],name:r,onClose:c})]})]})};var Lt=n(97336);const Dt=e=>{let{instanceType:t,name:n,providerType:r,...o}=e;return(0,ie.jsx)(St.A,{badge:"cloudInfo","data-testid":"node-cloud-info",nodeName:n,...o,children:(0,ie.jsxs)(oe.Flex,{alignItems:"center",gap:1,children:[(0,ie.jsx)(oe.Icon,{color:"textDescription","data-testid":"node-cloud-info-icon",name:"ipNetworking",width:"18px",height:"18px"}),(0,ie.jsxs)(oe.TextSmall,{color:"textDescription","data-testid":"node-cloud-info-text",children:[(0,gt.ws)(r)," \u2022 ",(0,gt.ws)(t)]})]})})},Bt=e=>{let{connectivity:t,name:n,...r}=e;return(0,ie.jsx)(St.A,{badge:"connectivity",connectivityState:t,"data-testid":"node-connectivity",nodeName:n,...r,children:(0,ie.jsx)(oe.Icon,{name:`connectivityStatus${t}`,width:"18px",height:"18px"})})},Rt=e=>{let{onClick:t,...n}=e;return(0,ie.jsx)(St.A,{badge:"info","data-testid":"node-info-cta",...n,children:(0,ie.jsx)(oe.Icon,{color:"textDescription",cursor:"pointer",height:"18px",width:"18px",name:"information",onClick:t})})},$t=e=>{let{name:t,...n}=e;return(0,ie.jsx)(St.A,{badge:"k8s","data-testid":"node-kubernetes",nodeName:t,...n,children:(0,ie.jsxs)(oe.Flex,{alignItems:"center",gap:1,children:[(0,ie.jsx)(oe.Icon,{color:"textDescription","data-testid":"node-kubernetes-icon",name:"serviceKubernetes",width:"18px",height:"18px"}),(0,ie.jsx)(oe.TextSmall,{color:"textDescription","data-testid":"node-kubernetes-text",children:"k8s"})]})})},Vt=e=>{let{kernelName:t,kernelVersion:n,name:r,...o}=e;return(0,ie.jsx)(St.A,{badge:"kernel","data-testid":"node-kernel",nodeName:r,...o,children:(0,ie.jsx)(oe.TextSmall,{color:"textDescription",children:(0,gt.Ud)(t,n)})})};var Ot=n(52253),Pt=n(41708),Et=n(92834);const Ht=e=>{let{architecture:t,cpuFrequency:n,cpus:r,diskSpace:o,memory:s,name:a,os:i,osName:l,timezone:c,...d}=e;return(0,ie.jsx)(St.A,{badge:"systemInfo","data-testid":"node-system-info",nodeName:a,...d,children:(0,ie.jsxs)(oe.Flex,{alignItems:"center",gap:1,children:[(0,ie.jsx)(oe.Icon,{color:"textDescription","data-testid":"node-system-info-icon",name:lt.u[l]?.iconName||lt.U[i]?.iconName||"os",width:"16px",height:"16px"}),(0,ie.jsxs)(oe.TextSmall,{color:"textDescription","data-testid":"node-system-info-text",children:[(0,gt.ws)(l)," \u2022 ",(0,gt.O)(n)," \u2022"," ",(0,gt.ws)(r,1===r?"Core":"Cores")," \u2022"," ",(0,gt.ws)(t)," \u2022"," ",(0,gt.ws)((0,gt.RI)(s),"RAM")," \u2022"," ",(0,gt.ws)((0,gt.RI)(o),"HD"),!!c&&(0,ie.jsxs)(ie.Fragment,{children:[" ","\u2022 ",(0,ie.jsx)(Et.A,{timezone:c})]})]})]})})},_t=e=>{let{container:t,name:n,virtualization:r,...o}=e;const s=(0,gt.Pg)(t,r);return(0,ie.jsx)(St.A,{badge:"type","data-testid":"node-type",nodeName:n,nodeType:s.label,...o,children:(0,ie.jsxs)(oe.Flex,{alignItems:"center",gap:1,children:[(0,ie.jsx)(oe.Icon,{color:"textDescription","data-testid":"node-type-icon",name:s.icon,height:s.iconSize,width:s.iconSize}),(0,ie.jsx)(oe.TextSmall,{color:"textDescription","data-testid":"node-type-text",children:s.label})]})})};var Kt=n(71236);const zt=e=>{let{health:t={}}=e;const{silencingState:n}=t.alerts||{},{state:r}=n||{};return"NONE"!=r?(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(Ft.K,{"data-testid":"nodeRow-separator"}),(0,ie.jsx)(oe.Flex,{children:(0,ie.jsx)(Kt.A,{flavour:"node",silencing:n})})]}):null};n(33110);var Gt=n(74891);const Wt=(0,Gt.A)((0,tt.A)(oe.Button)),qt=e=>{let{id:t}=e;const n=(0,j.Zp)(),o=(0,v.bq)(),s=(0,r.useCallback)(()=>{const e={nodeId:t};n(`/spaces/${o}/settings/notifications#notificationsActiveTab=1&silencingRulePrefill=${JSON.stringify(e)}`)},[]);return(0,ie.jsx)(Wt,{feature:"SilencingNode",payload:{nodeId:""},tooltip:"Create a new silencing rule for this node",flavour:"hollow",icon:"alarm_off",iconWidth:"12px",onClick:s})};var Ut=n(36504),Jt=n(92942),Zt=n(87398),Xt=n(63928);const Yt=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,Ke._)({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]),a=(0,Xt.xS)(),i=(0,r.useCallback)(async e=>{const t=e.map((e,t)=>{const n=s[e];if(n)return a({...n,value:{...n.value,sortOrder:t}})});await Promise.all(t.filter(Boolean))},[s,a]);return{favoriteNodeIds:o,settingsByNodeId:s,handleOrderChange:i}},Qt=(e,t)=>e&&e.getRoot().getChildren().find(e=>e.match({id:`nodes-${t}`})),en=(e,t)=>`table-metrics-${e}-${t}`,tn=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"sum";const o=Qt(e,t);if(!o)return null;const s=en(n,r);return o.getNode({id:s})};var nn=n(28657);const rn=e=>{let{id:t,roomId:n,nodeId:o,context:s,dimensions:a}=e;const i=(0,Zt.eg)(),l=(0,r.useMemo)(()=>{const e=Qt(i,n),r=[t,o,s].join("-");if(!e)return null;let l=e.getNode({id:r});return l?(l.updateAttribute("selectedDimensions",a),l):(l=i.makeChart({attributes:{id:r,nodesScope:[o],contextScope:[s],pixelsPerPoint:20,selectedDimensions:a}}),e.appendChild(l),l)},[s,t,o,n,i]);return l?(0,ie.jsx)(nn.A,{chart:l,hasHeader:!1,hasFooter:!1,hasFilters:!1,height:100}):null},on=(0,r.memo)(rn);var sn=n(74518);const an=e=>{let{id:t,context:n,nodeId:r,isLive:o,hidden:s,title:a,dimensions:i}=e;const l=(0,y.ID)();return s||!o?null:(0,ie.jsxs)(oe.Flex,{column:!0,"data-testid":`metrics-chart-${n}`,flex:"grow",basis:"174px",children:[(0,ie.jsx)(sn.A,{text:a||n,TextComponent:oe.TextSmall,color:"textDescription",margin:[1,0,1,2],as:"div"}),(0,ie.jsx)(on,{id:t,context:n,nodeId:r,roomId:l,dimensions:i})]})};var ln=n(91421),cn=n(3319);const dn=e=>{let{node:t,...n}=e;const[,o]=(0,ln.PJ)(),{sendButtonClickedLog:s}=(0,cn.A)(),a=t.capabilities?.dyncfg?.enabled,i=t.isLive&&a,l=i?"Configure this node":t.isLive?"Node cannot be configured":"Cannot configure a non live node",c=(0,r.useCallback)(()=>{i&&(o(!0,{nodeId:t.id}),s({feature:"DyncfgNode",description:"Configure node",nodeId:t?.id,nodeName:t?.name}))},[i,t,o,s]),d=(0,r.useMemo)(()=>({name:"gear",size:"small",color:i?"text":"disabled",cursor:i?"pointer":"auto",onClick:c}),[i,c]);return(0,ie.jsx)(St.A,{content:l,children:(0,ie.jsx)(oe.Flex,{...n,children:(0,ie.jsx)(oe.Icon,{...d})})})};var un=n(51262);const hn=(xn=dn,e=>(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(Ft.K,{"data-testid":"nodeRow-separator"}),(0,ie.jsx)(xn,{...e})]}));var xn;const gn=e=>{let{id:t,name:n,hw:o,os:s,ni:a,capabilities:i,container:l,updateSeverity:c,bugs:d,labels:u,isLive:h,state:x,version:g,extraKey:m,health:p,menuId:f,eligibility:j}=e;const b=(0,v.dg)(),C=(0,y.ID)(),w=i.funcs?.enabled,I=i.ml?.enabled,A=(0,gt.GM)(x),{isNodeRestricted:k}=(0,un.A)(),{restricted:S}=k(t),{_cloud_instance_type:M,_cloud_provider_type:T,_timezone:F}=u||{},N="true"===u?._is_k8s_node,L=!(0,gt.Po)(M)||!(0,gt.Po)(T),D=(0,K.Fw)("sidebarTab",{flavour:"val",extraKey:m}),B=(0,K.Fw)("sidebarOpen",{flavour:"bool"}),R=(0,K.Fw)("sidebarNodeId",{flavour:"val",extraKey:m}),$=(0,r.useCallback)(e=>{B(!0),D(e),R(t)},[t,R,B,D]),V=(0,r.useCallback)(()=>$("alerts"),[$]),O=(0,r.useCallback)(()=>$("info"),[$]),P=(0,At.Id)(),E=(0,kt.I)(),H=(0,Se.Vw)(C);return(0,ie.jsxs)(oe.Flex,{"data-testid":`nodeRow-${n}`,"data-menuid":f||t,padding:[1],column:!0,gap:1,round:!0,children:[(0,ie.jsxs)(oe.Flex,{alignItems:"center","data-testid":"nodeRow-basic-info",gap:2,height:{min:6},children:[(0,ie.jsx)(Bt,{connectivity:A,"data-testid":`nodeRow-connectivity-${A.toLowerCase()}`,name:n}),(0,ie.jsx)(Ft.K,{"data-testid":"nodeRow-separator"}),(0,ie.jsx)(Pt.A,{"data-testid":"nodeRow-name",id:t,name:n,isLive:h,state:x,eligibility:j}),(0,ie.jsx)(Ft.K,{"data-testid":"nodeRow-separator"}),(0,ie.jsx)(Rt,{onClick:O,"data-testid":"nodeRow-more-info-cta"}),(0,ie.jsx)(Ft.K,{"data-testid":"nodeRow-separator"}),(0,ie.jsx)(Lt.A,{id:t,isLive:h,"data-testid":"nodeRow-alerts",name:n,onClick:V}),(0,ie.jsx)(Ft.K,{"data-testid":"nodeRow-separator"}),(0,ie.jsx)(Ot.A,{badge:"ml","data-testid":"nodeRow-machine-learning-status",enabled:I,name:n,onClick:()=>E(t),children:(0,ie.jsx)(oe.Icon,{name:"anomaliesLens",size:"small",color:"text"})}),(0,ie.jsx)(Ft.K,{"data-testid":"nodeRow-separator"}),(0,ie.jsx)(Ot.A,{badge:"fn","data-testid":"nodeRow-fn-status",enabled:w,name:n,onClick:()=>P(t),children:(0,ie.jsx)(oe.Icon,{name:"functions",size:"small",color:"text"})}),c&&(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(Ft.K,{"data-testid":"nodeRow-separator"}),(0,ie.jsx)(Ut.A,{name:n,os:s.id,container:l,warningLevel:c,labels:u,version:g,text:c,"data-testid":"nodeRow-needs-update"})]}),!!(d||[]).length&&(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(Ft.K,{"data-testid":"nodeRow-separator"}),(0,ie.jsx)(Jt.A,{bugs:d,"data-testid":"nodeRow-bugs"})]}),(0,ie.jsx)(hn,{node:{id:t,name:n,isLive:h,ni:a,capabilities:i}}),(0,ie.jsx)(Nt,{"data-testid":"nodeRow-node-actions",id:t,name:n,connectivity:A}),b?null:(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(zt,{health:p}),(0,ie.jsx)(qt,{id:t})]})]}),(0,ie.jsxs)(oe.Flex,{alignItems:"center","data-testid":"nodeRow-detailed-info",gap:2,children:[(0,ie.jsx)(Ht,{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:F}),(0,ie.jsx)(Ft.K,{"data-testid":"nodeRow-separator"}),!!s?.kernel&&(0,ie.jsx)(Vt,{"data-testid":"nodeRow-kernel",kernelName:s.kernel.nm,kernelVersion:s.kernel.v,name:n}),(0,ie.jsx)(Ft.K,{"data-testid":"nodeRow-separator"}),N&&(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)($t,{"data-testid":"nodeRow-kubernetes",name:n}),(0,ie.jsx)(Ft.K,{"data-testid":"nodeRow-separator"})]}),(0,ie.jsx)(_t,{container:o.container,"data-testid":"nodeRow-type",name:n,virtualization:o.virtualization}),L&&(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(Ft.K,{"data-testid":"nodeRow-separator"}),(0,ie.jsx)(Dt,{"data-testid":"nodeRow-cloud-info",instanceType:M,name:n,providerType:T})]})]}),!S&&!!H?.length&&(0,ie.jsx)(oe.Flex,{"data-testid":"nodeRow-charts",gap:1,children:H.map(e=>(0,ie.jsx)(an,{...e,nodeId:t,isLive:h},e.id))})]})},mn=e=>{switch(e.level){case 0:return It;case 1:return gn;default:return null}},pn=e=>{let{onChartNameChange:t,initialChartName:n,dashboardOptions:r,linkToGo:o,contextToGo:s,...a}=e;const{setActiveMenuId:i}=(0,jt.A)({onChartNameChange:t,initialChartName:n,linkToGo:o,contextToGo:s});return(0,ie.jsx)(ne.H,{...a,children:(0,ie.jsx)(bt.A,{flavour:"nodes",onActiveMenuId:i,getComponent:mn,dashboardOptions:r,initialChartName:n,checkVisibility:()=>!0})})};var fn=n(69457),jn=n(20871),bn=n(48106),vn=n(882),yn=n(24155);const Cn=(0,vn.default)(oe.Box).attrs(e=>({...e})).withConfig({displayName:"loader__Grid",componentId:"sc-yd9b7n-0"})(["display:grid;grid-template-columns:1fr 6fr 1fr;gap:8px;"]),wn=()=>(0,ie.jsxs)(oe.Flex,{column:!0,gap:2,children:[(0,ie.jsx)(yn.A,{height:"38px"}),(0,ie.jsx)(Cn,{children:Array.from(Array(15).keys()).map(e=>(0,ie.jsxs)(r.Fragment,{children:[(0,ie.jsx)(yn.A,{height:"32px"}),(0,ie.jsx)(yn.A,{height:"32px"}),(0,ie.jsx)(yn.A,{height:"32px"})]},e))})]});var In=n(9962),An=n(19075),kn=n(2626),Sn=(n(30670),n(36310)),Mn=n(39483);const Tn=e=>{let{children:t,contextName:n,dimensions:r,aggregationMethod:o="sum",fractionDigits:s,totalDimensions:a,calculateTotal:i}=e;const{chart:l,state:c}=(0,Sn.useHeadlessChart)(),{contextGroups:d}=(0,Mn.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(i){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=a&&a.length>0?a.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),i=n.reduce((e,t)=>e+(l.getDimensionValue(t,h)||0),0),d=i>0?o/i*100:0,x=e[0];return t({data:{value:o,convertedValue:l.getConvertedValue(o,{fractionDigits:s,dimensionId:x}),total:l.getConvertedValue(i,{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})},Fn=e=>{let{nodeId:t,contextName:n,dimensions:o,aggregationMethod:s="sum",fractionDigits:a,totalDimensions:i,calculateTotal:l,children:c}=e;const d=(0,Zt.eg)(),u=(0,y.ID)(),[h,x]=(0,r.useState)(()=>tn(d,u,t,s));return(0,r.useEffect)(()=>{if(h)return;const e=(e,n)=>{n.getId()!==en(t,s)&&n.getId()!==h?.getId()&&x(n)},n=()=>x(tn(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,ie.jsx)(Sn.default,{chart:h,children:(0,ie.jsx)(Tn,{contextName:n,dimensions:o,aggregationMethod:s,fractionDigits:a,totalDimensions:i,calculateTotal:l,children:c})}):c({data:null,loading:!0,error:"Chart not found"})},Nn=()=>(0,ie.jsx)(yn.A,{width:"80%",height:"8px"}),Ln={value:e=>({id:e.columnId,header:(0,ie.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,ie.jsx)(Fn,{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,ie.jsx)(oe.Flex,{alignItems:"end",justifyContent:"end",width:"100%",children:(0,ie.jsx)(Nn,{})});if(!n)return(0,ie.jsx)(oe.Flex,{alignItems:"end",justifyContent:"end",width:"100%",children:(0,ie.jsx)(oe.Text,{children:"-"})});const o=n.convertedValue&&n.total;return(0,ie.jsxs)(oe.Flex,{alignItems:"end",justifyContent:"end",width:"100%",gap:.5,children:[(0,ie.jsx)(oe.Text,{textAlign:"right",children:o?(0,ie.jsxs)(ie.Fragment,{children:[n.convertedValue,"/",n.total]}):n.convertedValue}),!e.hideUnits&&n.units&&(0,ie.jsx)(oe.TextMicro,{color:"textLite",strong:!0,textAlign:"right",children:n.units})]})}})},renderString:t=>{const n=t.original[e.columnId];return(0,gt.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,ie.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,ie.jsx)(Fn,{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,ie.jsx)(oe.Flex,{alignItems:"end",justifyContent:"end",width:"100%",children:(0,ie.jsx)(Nn,{})});if(!n)return(0,ie.jsx)(oe.Flex,{alignItems:"end",justifyContent:"end",width:"100%",children:(0,ie.jsx)(oe.Text,{children:"-"})});const o="undefined"!==typeof n.convertedValue&&"undefined"!==typeof n.total,s=o?n.percentage:parseFloat(n.convertedValue)||0,a=Math.min(s,100);return(0,ie.jsxs)(oe.Flex,{column:!0,width:"100%",alignItems:o?"center":"end",gap:2,children:[(0,ie.jsxs)(oe.Flex,{alignItems:"end",justifyContent:o?"between":"end",width:"100%",children:[o&&(0,ie.jsxs)(oe.Flex,{alignItems:"end",gap:.5,children:[(0,ie.jsxs)(oe.Text,{children:[n.convertedValue,"/",n.total]}),!e.hideUnits&&n.units&&(0,ie.jsx)(oe.TextMicro,{color:"textLite",strong:!0,textAlign:"right",children:n.units})]}),(0,ie.jsxs)(oe.Flex,{alignItems:"end",children:[(0,ie.jsx)(oe.Text,{children:Math.round(s)}),(0,ie.jsx)(oe.TextMicro,{color:"textLite",strong:!0,children:"%"})]})]}),(0,ie.jsx)(oe.ProgressBar,{background:"panelBg",color:"textLite",height:.5,width:`${a}%`,containerWidth:"100%",border:"none",overflow:"hidden"})]})}})},renderString:t=>{const n=t.original[e.columnId];return(0,gt.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,ie.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 a of e.fallbackKeys){if(!(0,gt.Po)(s))break;const e=a.split(".");let t=r;for(const n of e)if(t=t?.[n],void 0===t)break;s=t}return(0,gt.Po)(s)?(0,ie.jsx)(oe.Flex,{alignItems:"end",width:"100%",children:(0,ie.jsx)(oe.Text,{children:"-"})}):(0,ie.jsx)(oe.Flex,{alignItems:"center",width:"100%",children:(0,ie.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,gt.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,gt.Po)(o)?"-":o},sortingFn:"basic"})};var Dn=n(71341);const Bn=e=>{let{osEntry:t}=e;if(!t)return(0,ie.jsx)(oe.Icon,{name:"os",width:"18px",height:"18px",color:"textDescription"});if(t.iconName)return(0,ie.jsx)(oe.Icon,{name:t.iconName,width:"18px",height:"18px",color:"textDescription",viewBox:"0 0 100 100"});if(t.logoFilename){const e=`${g.A.assetsBaseURL}/img/logos/os/${t.logoFilename}`;return(0,ie.jsx)("img",{src:e,width:"18px",height:"18px",alt:t.title})}return(0,ie.jsx)(oe.Icon,{name:"os",width:"18px",height:"18px",color:"textDescription"})},Rn=e=>{let{headerText:t="Server"}=e;return{id:"server",header:(0,ie.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,gt.GM)(n.state),o=n.os?.nm||n.labels?.os_name,s=n.os?.id,a=n.labels?.vendor,i=lt.u[o]||lt.U[s]||lt.u[a],l="Live"===r?Dn.P.live.indicatorWrapperColor:"Stale"===r?Dn.P.stale.indicatorWrapperColor:Dn.P.offline.indicatorWrapperColor;return(0,ie.jsxs)(oe.Flex,{alignItems:"center",gap:2,width:"100%",children:[(0,ie.jsx)(oe.Flex,{width:2,height:2,round:"50%",background:l,flex:!1}),(0,ie.jsx)(oe.Flex,{width:5,height:5,flex:!1,alignItems:"center",justifyContent:"center",children:(0,ie.jsx)(Bn,{osEntry:i})}),(0,ie.jsx)(Pt.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"}},$n=e=>({id:"alerts",header:(0,ie.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,s=(0,kn.Xt)(o.id),{critical:a,warning:i}=(0,An.AO)(s),l=i+a>0,c=(0,K.Fw)("sidebarTab",{flavour:"val",extraKey:e}),d=(0,K.Fw)("sidebarOpen",{flavour:"bool"}),u=(0,K.Fw)("sidebarNodeId",{flavour:"val",extraKey:e}),h=(0,r.useCallback)(e=>{e.stopPropagation(),d(!0),c("alerts"),u(o.id)},[o.id,u,d,c]),x=(0,In.I)({flavour:a>0?"error":"disabledError",value:a||" "}),g=(0,In.I)({flavour:i>0?"warning":"disabledWarning",value:i||" "});return(0,ie.jsx)(oe.Flex,{alignItems:"center",justifyContent:"center",opacity:l?1:.3,children:(0,ie.jsx)(oe.MasterCard,{"data-testid":"alertsMastercard",onClick:l?h:null,pillLeft:x,pillRight:g,size:"small",height:"20px"})})},renderString:e=>{const{warning:t=0,critical:n=0}=e.original.health?.alerts||{};return t+n},sortingFn:"basic"}),Vn=(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=Ln[e.columnFlavour];return t?t(e):(console.warn(`Unknown column flavour: ${e.columnFlavour}`),Ln.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:[Rn({headerText:t}),$n(n)],notFlex:!0},...Object.entries(s).map(e=>{let[t,n]=e;return{id:t,header:"",columns:n,notFlex:!0}})]},[e,n,o])};var On=n(1444),Pn=n(95565);const En={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,ie.jsxs)(oe.Flex,{column:!0,gap:1,children:[(0,ie.jsx)(oe.Text,{children:"Favourites can be saved only on a paid plan."}),(0,ie.jsx)(Pn.A,{children:(0,ie.jsx)(oe.Text,{color:"primary",children:"Upgrade for no limitations!"})})]}),default:null},Hn=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)(),a=(0,Xt.yK)({onResolve:s}),i=(0,Xt.z2)(null,{onResolve:s}),{disabled:l,reason:c}=(0,On.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 i(r.id):await a({type:"favourites",entity:n,path:`/${c}/${s}`,value:{nodeId:n,sortOrder:Date.now()}}))},[l,a,i,o,e,t]);return{isLoading:n,disabled:l,reason:En[c]||En.default,toggleFavorite:d}};var _n=n(85720),Kn=n(78804);const zn=(0,vn.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"})([""]),Gn=(0,r.memo)(e=>{let{data:t,onCreateGroupWithNode:n,icon:o,name:s,...a}=e;const i=(0,r.useRef)(),[l,c,,d]=(0,be.A)(!1),u=(0,y.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,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(oe.IconButton,{...a,ref:i,icon:o,name:s,onClick:c}),l&&i.current&&(0,ie.jsxs)(zn,{target:i.current,onEsc:d,onClickOutside:d,children:[h.map(e=>(0,ie.jsx)(_n.A,{onClick:()=>g(e.id),testid:`addToGroup-${e.id}`,children:e.name},e.id)),h.length>0&&(0,ie.jsx)(Kn.c,{}),(0,ie.jsx)(_n.A,{icon:"plus",onClick:m,testid:"addToGroup-createNew",children:"Create new group"})]})]})}),Wn=Gn,qn={[ut]:"error",[dt]:"warning",[ct]:"success",[ht]:"textLite"},Un={Live:"live",Stale:"stale",Offline:"offline",critical:"live",warning:"live",clear:"live"},Jn={nodeStatus:!0,critical:!0,warning:!0,clear:!0},Zn=e=>{let{rows:t,name:n,groupMode:r}=e;const o=Jn[r]||Jn[n],s=t.map(e=>e.original.id),a=(0,E.BU)(s).length,i=(0,E.Ig)(s).length,l=(0,E.GE)(s).length;return(0,ie.jsx)(ze.A,{content:(0,ie.jsxs)(oe.Flex,{alignItems:"center",gap:4,background:"dropdown",round:!0,padding:[2,3],children:[(!o||Un[n]===Un.Live)&&(0,ie.jsxs)(oe.Flex,{alignItems:"center",gap:2,children:[(0,ie.jsx)(oe.Flex,{width:2,height:2,round:"50%",background:Dn.P.live.indicatorWrapperColor}),(0,ie.jsxs)(oe.Text,{children:["Live: ",a]})]}),(!o||Un[n]===Un.Stale)&&(0,ie.jsxs)(oe.Flex,{alignItems:"center",gap:2,children:[(0,ie.jsx)(oe.Flex,{width:2,height:2,round:"50%",background:Dn.P.stale.indicatorWrapperColor}),(0,ie.jsxs)(oe.Text,{children:["Stale: ",i]})]}),(!o||Un[n]===Un.Offline)&&(0,ie.jsxs)(oe.Flex,{alignItems:"center",gap:2,children:[(0,ie.jsx)(oe.Flex,{width:2,height:2,round:"50%",background:Dn.P.offline.indicatorWrapperColor}),(0,ie.jsxs)(oe.Text,{children:["Offline: ",l]})]})]}),align:"right",children:(0,ie.jsxs)(oe.Text,{color:"textLite",children:["(",(!o||Un[n]===Un.Live)&&(0,ie.jsx)(oe.Text,{color:Dn.P.live.statusTextColor,children:a}),!o&&"/",(!o||Un[n]===Un.Stale)&&(0,ie.jsx)(oe.Text,{color:Dn.P.stale.statusTextColor,children:i}),!o&&"/",(!o||Un[n]===Un.Offline)&&(0,ie.jsx)(oe.Text,{color:Dn.P.offline.statusTextColor,children:l}),")"]})})},Xn=e=>{let{row:t,name:n,groupMode:r,...o}=e;const s=t.getIsExpanded(),a="Other"===(i=n)?"textLite":Dn.P[i?.toLowerCase?.()]?.statusTextColor||qn[i]||"text";var i;return(0,ie.jsx)(oe.Flex,{height:"44px",alignItems:"center",flex:!0,width:"100%",background:"tableRowBg2",_hover:{background:"tableRowBg2Hover"},...o,children:(0,ie.jsxs)(oe.Flex,{position:"sticky",left:"0px",width:"auto",padding:[2,3],gap:2,children:[(0,ie.jsx)(oe.Icon,{name:"chevron_left",size:"small",color:"textLite",rotate:s?1:3}),(0,ie.jsx)(oe.Text,{color:a,strong:!0,children:n}),(0,ie.jsx)(Zn,{rows:t.subRows,groupMode:r,name:n})]})})},Yn=e=>{let{tabId:t,flavour:n,onClickRow:r,columnPinning:o,columnVisibility:s,columnSizing:a,onColumnSizingChange:i,sortBy:l,onSortingChange:c,rowActions:d,columns:u}=e;const{favoriteNodeIds:h}=Yt(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,ie.jsx)(ie.Fragment,{children:(0,ie.jsxs)("div",{children:[(0,ie.jsx)(Xn,{row:p,name:"Favourites",onClick:g}),(0,ie.jsx)(oe.Collapsible,{open:x,children:(0,ie.jsx)(oe.Table,{data:m,dataColumns:u,rowActions:d,onClickRow:r,enableSorting:!0,sortBy:l,onSortingChange:c,enableColumnPinning:!0,enableResizing:!0,columnVisibility:s,columnSizing:a,onColumnSizingChange:i,background:"tableRowBg2",columnPinning:o})})]})}):null};var Qn=n(37356),er=n(71581);const tr={right:["actions"],left:["server"]},nr={nodeStatus:{Live:!0},default:!0},rr=e=>{let{id:t}=e;return t},or=(e=>t=>{let{nodeIdsLoaded:n,...r}=t;return(0,y.XA)("fullyLoaded")&&!!n?(0,ie.jsx)(e,{...r}):(0,ie.jsx)(wn,{})})(e=>{let{nodeIds:t,tabNodeIds:n,onChartNameChange:o,initialChartName:a,tabId:i="servers",flavour:l="nodesView",onCreateGroup:c,onCreateGroupWithNode:d,matchingGroups:u}=e;const h=(0,fn.qR)(),x=(0,y.ID)(),g=(0,v.vt)(),p=(0,m.JT)("space:UpdateSettings",g),f=(0,P.Cq)(x,i),j=(0,P.A3)(x,i),b=(0,er.rK)(i,x),C=(0,Se.vh)(x,i,b),[w,I]=(0,K.r$)("expanded",{extraKey:`${l}-${i}-${f||"ungrouped"}`,flavour:"obj",defaultValue:nr[f]||nr.default}),[A,k]=(0,r.useState)(null),[S,M]=(0,r.useState)(null),T=(0,r.useCallback)((e,t)=>{k({ids:[e],name:t})},[]),F=(0,r.useCallback)((e,t)=>{M({ids:[e],name:t})},[]),N=Vn(C,{extraKey:l,tabId:i}),L=(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)&&u?.length>0?{...e,customGroups:{name:"Groups",columns:[]}}:e},[i,u?.length]),D=(0,r.useMemo)(()=>C.reduce((e,t)=>(t.hidden&&(e[t.columnId]=!1),e),{}),[C]),[B,R]=(0,K.r$)("columnVisibility",{extraKey:`${l}-${i}`,flavour:"obj",defaultValue:D}),[$,V]=(0,K.r$)("columnSizing",{extraKey:`${l}-${i}`,flavour:"obj",defaultValue:{}}),[O,E]=(0,K.r$)("sortBy",{extraKey:`${l}-${i}`,flavour:"arrobj",defaultValue:[]}),H=(0,K.Fw)("sidebarTab",{flavour:"val",extraKey:l}),_=(0,K.Fw)("sidebarOpen",{flavour:"bool"}),z=(0,K.Fw)("sidebarNodeId",{flavour:"val",extraKey:l}),G=(0,r.useCallback)((e,t)=>{_(!0),H(e),z(t)},[z,_,H]),W=(0,r.useCallback)(e=>{let{data:t}=e;t.isGroup||G("info",t.id)},[G]),q=((e,t)=>{let{flavour:n,onRemoveNode:o,onObsoleteNode:a,onClickNode:i,onCreateGroupWithNode:l}=t;const c=(0,m.JT)("node:Delete"),d=(0,v.vt)(),u=(0,m.JT)("space:UpdateSettings",d),h=(0,y.XA)(),x=(0,v.dg)(),g=!h.untouchable,{isLoading:p,toggleFavorite:f,disabled:j,reason:b}=Hn(n,e),{settingsByNodeId:C}=Yt(n,e),w=(0,r.useRef)(null);return w.current=t=>{const r=C[t];f(t,r,{flavour:n,tabId:e})},(0,r.useMemo)(()=>({...!x&&g&&{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}},...!x&&!g&&{obsolete:{icon:"delete",tooltipText:"Delete node permanently",handleAction:e=>a(e.id,e.name),confirmation:!0,confirmationText:e=>`Delete ${e.name} permanently?`,isDisabled:e=>{const t=(0,gt.GM)(e.state);return c&&"Offline"!==t}}},info:{handleAction:e=>i({data:e})},favorite:{icon:e=>C[e.id]?"heart_broken":"heart",tooltipText:e=>C[e.id]?"Remove from favorites":"Add to favorites",handleAction:e=>w.current(e.id),confirmation:!1,isVisible:()=>!0,isDisabled:p||j,iconColor:"textNoFocus",disabledTooltipText:b||"Saving..."},...s.xH&&u&&l&&{addToGroup:{CustomComponent:Wn,icon:"groupCreate",tooltipText:"Add to group",onCreateGroupWithNode:l,confirmation:!1}}}),[c,u,x,g,o,a,p,j,C,i,l])})(i,{flavour:l,onRemoveNode:T,onObsoleteNode:F,onClickNode:W,onCreateGroupWithNode:d}),U=(0,r.useMemo)(()=>{if(s.xH&&p&&c)return{createGroup:{handleAction:c,icon:"groupCreate",tooltipText:"Create group",alwaysEnabled:!0,confirmation:!1}}},[p,c]),{setActiveMenuId:J}=(0,jt.A)({onChartNameChange:o,initialChartName:a}),Z=(0,r.useRef)(),X=(0,r.useRef)(),Y=(0,r.useMemo)(()=>(Z.current&&Z.current.cancel(),Z.current=(0,jn.A)({elementQueryParam:"[data-id]",dataMenuId:"data-id"}),()=>Z.current(X.current?.scrollElement,J)),[h.length,J]);(0,r.useLayoutEffect)(()=>{h.length&&Y()},[h.length,a]);const Q=(0,r.useRef)(),ee=(0,r.useMemo)(()=>({overscan:30,virtualRef:X,onScroll:Y}),[Y]),te=(0,r.useMemo)(()=>h.filter(Boolean),[h]);(0,bn.A)(X.current,te);const ne=(0,r.useMemo)(()=>e=>(0,ie.jsx)(Xn,{groupMode:f,...e}),[f]);return(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(Yn,{tabId:i,flavour:l,onRemoveNode:T,onObsoleteNode:F,onClickRow:W,columnPinning:tr,columnVisibility:B,columnSizing:$,onColumnSizingChange:V,sortBy:O,onSortingChange:E,rowActions:q,columns:N}),t.length?(0,ie.jsx)(oe.Table,{title:(0,ie.jsx)(Qn.A,{extraKey:`${l}-${i}`,nodeIds:n,tabId:i}),data:te,dataColumns:N,rowActions:q,bulkActions:U,onClickRow:W,enableSorting:!0,sortBy:O,onSortingChange:E,enableColumnVisibility:!0,enableColumnPinning:!0,enableResizing:!0,columnPinning:tr,columnVisibility:B,onColumnVisibilityChange:R,columnSizing:$,onColumnSizingChange:V,groupByColumns:L,grouping:f||"",onGroupByChange:j,getSubRows:e=>e.children,enableExpanding:!0,getRowId:rr,expanded:w,onExpandedChange:I,GroupRow:ne,virtualizeOptions:ee,tableRef:Q,background:"tableRowBg2"}):(0,ie.jsx)(pe,{children:(0,ie.jsx)(oe.Flex,{gap:1,alignItems:"center",children:(0,ie.jsx)(Qn.A,{extraKey:`${l}-${i}`,nodeIds:n,tabId:i})})}),A&&(0,ie.jsx)(Tt.Ay,{ids:A.ids,name:A.name,onClose:()=>k(null)}),S&&(0,ie.jsx)(Mt.Ay,{ids:S.ids,name:S.name,onClose:()=>M(null)})]})});n(37550);const sr=e=>{let{tab:t,onToggle:n,onEdit:r,onDelete:o}=e;const{attributes:s,listeners:a,setNodeRef:i,transform:l,transition:c}=(0,We.gl)({id:t.id}),d={transform:qe.Ks.Transform.toString(l),transition:c},u=t.isDefault,h=t.label||t.name;return(0,ie.jsx)("div",{ref:i,style:d,...s,children:(0,ie.jsxs)(oe.Flex,{"data-testid":`groupsMenu-tab-${t.id}`,justifyContent:"between",alignItems:"center",padding:[1,0],children:[(0,ie.jsxs)(oe.Flex,{alignItems:"center",gap:1,children:[(0,ie.jsx)(oe.Icon,{name:"nav_dots",color:"textLite",cursor:"grab",size:"small",...a}),(0,ie.jsx)(oe.Checkbox,{checked:!t.isHidden,"data-testid":`groupsMenu-tabCheckbox-${t.id}`,label:h,onChange:n})]}),!u&&(0,ie.jsxs)(oe.Flex,{alignItems:"center",gap:1,children:[(0,ie.jsx)(oe.IconButton,{"data-testid":`groupsMenu-editTab-${t.id}`,flavour:"borderless",icon:"pencilSolid",padding:[0],onClick:r,width:"10px",height:"10px"}),(0,ie.jsx)(Ue,{onConfirm:o,children:e=>(0,ie.jsx)(oe.IconButton,{"data-testid":`groupsMenu-deleteTab-${t.id}`,flavour:"borderless",icon:"trashcan",padding:[0],onClick:e,width:"10px",height:"10px"})})]})]})})},ar=e=>{let{isOpen:t,onClose:n,onEdit:o,onCreate:s,allNodes:a,targetRef:i,activeTabId:l,onTabChange:c}=e;const d=(0,y.ID)(),u=(0,fe.kf)(d,a),h=(0,r.useMemo)(()=>a.some(je.ZH),[a]),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,Ge.FR)((0,Ge.MS)(Ge.AN),(0,Ge.MS)(Ge.uN,{coordinateGetter:We.JR})),v=(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,We.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 i.current&&t?(0,ie.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:i.current,gap:1,children:[(0,ie.jsx)(Ge.Mp,{sensors:b,collisionDetection:Ge.fp,onDragEnd:v,children:(0,ie.jsx)(We.gB,{items:f,strategy:We._G,children:(0,ie.jsx)(oe.Flex,{column:!0,children:f.map(e=>{const t=k[e];return t?(0,ie.jsx)(sr,{tab:t,onToggle:()=>C(t.id),onEdit:()=>w(t.id),onDelete:()=>I(t.id)},t.id):null})})})}),(0,ie.jsx)(oe.Button,{"data-testid":"groupsMenu-createGroup",label:"Create group",icon:"plus",onClick:A,small:!0,alignSelf:"end"})]}):null},ir=e=>{let{allNodes:t,onCreateGroup:n,onEditGroup:o,activeTabId:s,onTabChange:a}=e;const[i,,l,c]=(0,be.A)(),d=(0,r.useRef)();return(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.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,ie.jsx)(ar,{isOpen:i,onClose:c,onEdit:o,onCreate:n,allNodes:t,targetRef:d,activeTabId:s,onTabChange:a})]})},lr=(0,tt.A)(ve.A),cr=e=>{let{children:t,tabId:n,allNodes:r,onCreateGroup:o,onEditGroup:a,onTabChange:i,...l}=e;const[c,,d,u]=(0,be.A)(),h=(0,v.vt)(),x=(0,y.ID)(),g=(0,er.rK)(n,x),p=(0,m.JT)("space:UpdateSettings",h);return(0,ie.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"},...l,children:[t,(0,ie.jsxs)(oe.Flex,{justifyContent:"between",alignItems:"end",flex:!0,children:[s.xH&&p?(0,ie.jsx)(oe.IconButton,{icon:"plus",onClick:o,"data-testid":"nodes-create-group-button",tooltip:"Create group",padding:[1],width:"16px",height:"16px"}):(0,ie.jsx)("div",{}),(0,ie.jsxs)(oe.Flex,{alignItems:"center",padding:[0,0,1,2],gap:2,children:[c&&(0,ie.jsx)(ye.A,{onClose:u}),s.xH&&(0,ie.jsx)(ir,{allNodes:r,onCreateGroup:o,onEditGroup:a,activeTabId:n,onTabChange:i}),(0,ie.jsx)(et,{spaceId:h,roomId:x,tabId:n,metricsType:g}),(0,ie.jsx)(lr,{"data-ga":"add-nodes::click-add-nodes::hm-nodes-table","data-testid":"nodesTable-addNode",icon:"nodes_hollow",label:"Add Nodes",onClick:d,small:!0,flavour:"hollow"})]})]})]})},dr=e=>{let{allNodes:t,activeTabId:n,onTabChange:o,onCreateGroup:s,onEditGroup:a,children:i}=e;const l=(0,y.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:a,onTabChange:o}),[n,t,s,a,o]);return(0,ie.jsx)(oe.Tabs,{selected:d,onChange:u,height:"100%",padding:[4,4,2],TabsHeader:cr,tabHeaderProps:h,gap:4,noDefaultBorder:!0,children:c.map((e,t)=>(0,ie.jsx)(oe.Tab,{label:(0,ie.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:i},e.id))})},ur=e=>{let{tabId:t,filteredIds:n,totalCount:r}=e;const o=(0,je.K3)(t),s=o?.label||"Nodes",a=(0,E.BU)(n).length,i=(0,E.Ig)(n).length,l=(0,E.GE)(n).length;return(0,ie.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,ie.jsxs)(oe.Text,{strong:!0,children:["Total ",s,": ",r]}),(0,ie.jsxs)(oe.Flex,{alignItems:"center",gap:4,children:[(0,ie.jsxs)(oe.Flex,{alignItems:"center",gap:2,children:[(0,ie.jsx)(oe.Flex,{width:2,height:2,round:"50%",background:Dn.P.live.indicatorWrapperColor}),(0,ie.jsxs)(oe.Text,{children:["Live: ",a]})]}),(0,ie.jsxs)(oe.Flex,{alignItems:"center",gap:2,children:[(0,ie.jsx)(oe.Flex,{width:2,height:2,round:"50%",background:Dn.P.stale.indicatorWrapperColor}),(0,ie.jsxs)(oe.Text,{children:["Stale: ",i]})]}),(0,ie.jsxs)(oe.Flex,{alignItems:"center",gap:2,children:[(0,ie.jsx)(oe.Flex,{width:2,height:2,round:"50%",background:Dn.P.offline.indicatorWrapperColor}),(0,ie.jsxs)(oe.Text,{children:["Offline: ",l]})]})]})]})};var hr=n(32215);const xr=e=>{let{title:t,disclaimer:n,disclaimerColor:r="textLite",children:o,...s}=e;return(0,ie.jsxs)(oe.Flex,{gap:1,column:!0,...s,children:[(0,ie.jsx)(oe.Text,{as:"label",margin:[0],children:t}),o,n&&(0,ie.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 gr=n(26848);const mr={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"}},pr=(0,r.memo)(e=>{let{filters:t,onFiltersChange:n,nodes:o,selectedNodeIds:s,onSelectedNodeIdsChange:a}=e;const[i,l]=(0,r.useState)(""),c=(0,r.useMemo)(()=>{const e=Object.entries(mr).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=i.toLowerCase().trim();t&&(e.searchAction={query:i,text:`Search for "${i}"`});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,a=o.count;if(t){n.toLowerCase().includes(t)&&(s=!0,a=100,n.toLowerCase().startsWith(t)&&(a+=50))}s&&r.push({value:n,label:n,count:o.count,score:a})})}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,a=o.count;if(t){n.toLowerCase().includes(t)&&(s=!0,a=100,n.toLowerCase().startsWith(t)&&(a+=50))}s&&r.push({value:n,label:n,count:o.count,score:a})})}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,a=n;if(t){e.toLowerCase().includes(t)&&(s=!0,a=100,e.toLowerCase().startsWith(t)&&(a+=50))}s&&r.push({value:e,label:e,count:n,score:a})})}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,a=o.count;if(t){n.toLowerCase().includes(t)&&(s=!0,a=100,n.toLowerCase().startsWith(t)&&(a+=50))}s&&r.push({value:n,label:n,count:o.count,score:a})})}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,a=!t,i=s.count;if(t){o.toLowerCase().includes(t)&&(a=!0,i=100,o.toLowerCase().startsWith(t)&&(i+=50))}a&&r.push({value:`${n}|${o}`,label:o,count:s.count,score:i})})}else"selectedNodeIds"===e.id&&o.forEach(e=>{let n=!t,o=1;const a=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:a?1:0,score:o+(a?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},[i,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];a(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,a]),g=(0,r.useCallback)(()=>{},[]);return(0,ie.jsx)(gr.A,{searchValue:i,setSearchValue:l,setSearchQuery:g,searchResults:u,onAddFilter:h,onAddFilterWithValue:x,placeholder:"Search filters..."})}),fr=pr;var jr=n(24798);const br=e=>{const t=(0,y.ID)(),n=`nodesView-${e}`,o=(0,K.l6)("addedFilters",{extraKey:n,flavour:"arr",defaultValue:[]});return(0,f.yF)((0,r.useCallback)(e=>{const r={},s=[...jr.RT,...o];[...new Set(s)].forEach(o=>{const s=e((0,K.GA)({key:t,extraKey:n,param:o,flavour:"arr"}));s?.length&&(r[o]=s)});const a=e((0,K.GA)({key:t,extraKey:n,param:"selectedNodeIds",flavour:"arr"}));return a?.length&&(r.selectedNodeIds=a),r},[t,n,o]))};var vr=n(90071),yr=n(5402),Cr=n(68529),wr=n(21511);const Ir=(0,r.memo)(e=>{let{id:t,label:n,value:o,onChange:s,onRemove:a,nodes:i,columnInfo:l}=e;const c=(0,r.useRef)(),d=(0,r.useRef)(),[u,h]=(0,r.useState)(o||[]),x="select"!==l?.type;(0,r.useEffect)(()=>{h(o||[])},[o]);const g=(0,r.useMemo)(()=>i?.map(e=>e.id)||[],[i]),m=(0,wr.A)({param:t,paramKey:l?.paramKey,extraKey:"groupForm",isLabel:l?.isLabel,labelKey:l?.labelKey,nodeIds:g,nodes:i}),{isOpen:p,handleToggle:f,handleClose:j,handleCancel:b}=(0,Cr.A)({pendingChangesRef:d}),v=u.length,y=(0,r.useMemo)(()=>{if(0===v)return"No selection";if(1===v){const e=m.find(e=>e.id===u[0]);return e?e.name:u[0]}return`${v} selected`},[v,u,m]),C=m.length,w=m.filter(e=>e.count>0).length,I=(0,r.useMemo)(()=>0===C?"":"Labels"===l?.category?`Label: ${l.labelKey} \u2022 ${w} values`:w===C?`${w} values`:`${w} out of ${C} values used`,[C,w,l]),A=(0,r.useCallback)(e=>{h(e),s(e)},[s]),k=(0,r.useCallback)(e=>{e.stopPropagation(),h([]),s([])},[s]);return(0,ie.jsx)(yr.A,{id:t,label:n,triggerRef:c,onToggle:f,isOpen:p,isEnabled:!0,stale:!1,subtitleText:y,isRequired:!1,onRemove:a,onCancel:b,onClose:j,onToggleEnabled:null,isDisabled:!1,selectedCount:v,description:I,onReset:k,resetDisabled:!u?.length,canHideZeros:!1,sortAction:null,filteredOptions:m,showActions:!1,children:(0,ie.jsx)(vr.Ay,{ref:d,param:t,baseKey:"groupForm",collection:m,getValue:e=>e.id,getLabel:e=>e.name||e.id,hasSearch:!0,multi:x,placeholder:`Search ${n.toLowerCase()}...`,searchInputProps:{autoFocus:!0},noResultsMessage:`No ${n.toLowerCase()} found`,itemProps:{multi:x,actualCountLabel:"nodes",stale:!1},extraKey:"groupForm",height:{max:"100%"},resizeable:!1,debounceDelay:0,batchMode:"event",value:u,onBatchApply:A})})}),Ar=Ir;var kr=n(25764),Sr=n(36893),Mr=n(64082),Tr=n(75687),Fr=n(32660);const Nr=(0,r.memo)(e=>{let{id:t,label:n,values:r,handleReset:o,min:s,max:a,draftRange:i,currentMin:l,currentMax:c,handleRangeChange:d,step:u,containerWidth:h,unit:x}=e;return(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(Fr.A,{id:t,label:n,isEnabled:!0,handleToggleEnabled:null,isDisabled:!1,description:`Range: ${s}${x} - ${a}${x}`,onReset:o,resetDisabled:!r||0===r.length,resetTooltip:"Reset to full range"}),(0,ie.jsx)(oe.MultiRangeInput,{min:s,max:a,onChange:d,initMin:i?i[0]:l,initMax:i?i[1]:c,step:u,disabled:!1,padding:[4]},`${t}-${h}`)]})}),Lr={"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}},Dr=(0,r.memo)(e=>{let{id:t,label:n,value:o,onChange:s,onRemove:a,nodes:i}=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=Lr[t];if(!e||!i||0===i.length)return{min:0,max:100,step:1,decimalPoints:0,unit:""};let n=1/0,r=-1/0;if(i.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}},[i,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,Cr.A)({pendingChangesRef:c,onOpen:()=>h(y.length>0?[...y]:null)}),M=(0,r.useCallback)(e=>{let{min:t,max:n}=e;h([t,n])},[]),T=(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]),F=(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,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsxs)(kr.A,{children:[(0,ie.jsx)(Sr.A,{triggerRef:l,onClick:A,testId:`dropdown-filter-${t}`,isOpen:I,isEnabled:!0,stale:!1,label:n,subtitle:T}),(0,ie.jsx)("div",{className:"remove-button-wrapper",children:(0,ie.jsx)(Tr.A,{onRemove:a,tooltip:`Remove ${n} filter`})})]}),(0,ie.jsx)(Mr.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,ie.jsx)(Nr,{id:t,label:n,values:y,handleReset:F,min:p,max:f,draftRange:u,currentMin:C,currentMax:w,handleRangeChange:M,step:j,containerWidth:x,unit:v})})]})}),Br=Dr,Rr=(0,r.memo)(e=>{let{nodes:t,value:n=[],onChange:o,onRemove:s}=e;const a=(0,r.useRef)(),i=(0,r.useRef)(),{isOpen:l,handleToggle:c,handleClose:d,handleCancel:u}=(0,Cr.A)({pendingChangesRef:i}),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,ie.jsx)(yr.A,{id:"selectedNodeIds",label:"Selected Nodes",triggerRef:a,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,ie.jsx)(vr.Ay,{ref:i,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}),$r=Rr,Vr=e=>{let{isNew:t}=e;return(0,ie.jsxs)(oe.Flex,{as:"span",gap:1,children:["Manage room",(0,ie.jsx)(oe.TextBig,{color:"textLite",children:"/"}),(0,ie.jsxs)(oe.TextBig,{color:"textLite",children:[t?"Create":"Edit"," Group"]})]})},Or=[{value:"servers",label:"Servers"},{value:"snmp",label:"Network Devices"}],Pr=e=>{let{id:t,onClose:n,allNodes:o,tabId:s,preselectedNodeId:a,...i}=e;const l=(0,y.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=br(s),m=(0,r.useMemo)(()=>o.some(je.ZH),[o]),[p,f]=(0,r.useState)(()=>{if(c){const e=(0,er.AK)(s,u),t=g(),{selectedNodeIds:n,...r}=t;let o=n||[];return a&&!o.includes(a)&&(o=[a,...o]),{...hr.$e,filters:r,selectedNodeIds:o,metricsType:e}}return{...hr.$e,...d}});(0,r.useEffect)(()=>{!c&&d?.id&&f({...hr.$e,...d})},[c,d]);const{name:j,metricsType:b,filters:v,selectedNodeIds:C}=p,w=m||!c&&"snmp"===b,I=(0,r.useMemo)(()=>(0,xt.KN)(v)||(0,xt.OS)(C)?o.filter(e=>(0,xt.BW)(e,v,C)).length:0,[o,v,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}})},[]),M=(0,r.useCallback)((e,t)=>{f(n=>({...n,filters:{...n.filters,[e]:t}}))},[]),T=(0,r.useCallback)(e=>{f(t=>({...t,filters:"function"===typeof e?e(t.filters):e}))},[]),F=(0,r.useCallback)(e=>{f(t=>({...t,selectedNodeIds:e||[]}))},[]),N=(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]),D=j.trim().length>0&&((0,xt.KN)(v)||(0,xt.OS)(C)),B=(0,r.useMemo)(()=>Or.find(e=>e.value===b)||Or[0],[b]),R=(0,r.useMemo)(()=>Object.entries(v||{}),[v]);return(0,ie.jsxs)(we.GO,{onClose:n,...i,children:[(0,ie.jsx)(Ie.z,{onClose:n,title:(0,ie.jsx)(Vr,{isNew:c}),children:(0,ie.jsx)(oe.Button,{label:"Save",onClick:L,disabled:!D,"data-testid":"groupForm-save"})}),(0,ie.jsx)(Ae.U,{children:c?"Create a new node group":"Edit node group"}),(0,ie.jsx)(we.Yv,{children:(0,ie.jsxs)(oe.Flex,{gap:6,column:!0,children:[(0,ie.jsx)(xr,{title:"Group Name","data-testid":"groupForm-name",children:(0,ie.jsx)(oe.TextInput,{name:"name",placeholder:"Enter group name",value:j,onChange:A})}),w&&(0,ie.jsx)(xr,{title:"Column Configuration",disclaimer:"Choose which column set to display for nodes in this group","data-testid":"groupForm-metricsType",children:(0,ie.jsx)(oe.Select,{options:Or,value:B,onChange:k,"data-testid":"groupForm-metricsTypeSelect"})}),(0,ie.jsx)(xr,{title:"Filters",disclaimer:(0,xt.KN)(v)||(0,xt.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,ie.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 mr[e]||{name:e,type:"dropdown"}})(t);return"range"===r.type?(0,ie.jsx)(Br,{id:t,label:r.name,value:n,onChange:e=>M(t,e),onRemove:()=>S(t),nodes:o},t):(0,ie.jsx)(Ar,{id:t,label:r.name,value:n,onChange:e=>M(t,e),onRemove:()=>S(t),nodes:o,columnInfo:r},t)}),(0,ie.jsx)($r,{nodes:o,value:C,onChange:F,onRemove:N}),(0,ie.jsx)(fr,{filters:v,onFiltersChange:T,nodes:o,selectedNodeIds:C,onSelectedNodeIdsChange:F})]})})]})})]})},Er=["config"],Hr=()=>{const e=(0,v.vt)(),t=(0,y.ID)(),n=(0,B.nj)(),o=(0,ee.Hn)(),a=(0,E.dG)(),i=(0,fe.Jk)(t),l=(0,er.rK)(a,t),c=(0,r.useMemo)(()=>(0,je.b5)(a)?i.filter(e=>e.metricsType===l):[],[i,l,a]),d=ft(a,c),u=(0,P.Cq)(t,a),h=(0,E.TL)(),x=(0,H.w7)({extraKey:`nodesView-${a}`,merge:!1,scoped:!0}),m=(0,E.Gt)(),p=(0,er.On)(a,t),f=(0,r.useMemo)(()=>m.reduce((e,t)=>(p(t)||e.push(t.id),e),[]),[p,m]),j=(0,E.Y7)(),[b,{width:C}]=(0,V.A)(),w=(0,te.K)({spaceId:e,roomId:t}),[I,A,k]=Q(x,t,{shouldHide:s.f9?p:void 0,cacheKey:a,extraKey:`nodesView-${a}`});!function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],{host:n,width:o,tabId:a="servers",flavour:i="nodesView"}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const l=(0,Zt.eg)(),c=(0,r.useMemo)(()=>{if(!l)return;let r=Qt(l,e);if(r)return r;o&&(r=l.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}}),l.appendChild(r))},[e,a,o]),{favoriteNodeIds:d}=Yt(i,a),u=(0,Se.vh)(e,a);(0,r.useMemo)(()=>{if(!s.f9)return;if(!c||!t?.length&&!d?.length)return;const e=u.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,...d].forEach(t=>{Object.entries(e).forEach(e=>{let[n,r]=e;const o=`table-metrics-${t}-${n}`;let s=c.getNode({id:o});if(s&&(a=new Set(s.getAttribute("contextScope")),i=r,a.size===i.size&&[...a].every(e=>i.has(e))))return;var a,i;s?.destroy();const d=Array.from(r);0!==d.length&&(s=l.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}}),c.appendChild(s))})}),l.trigger("nodesContainerUpdated")},[c,t,d,n,l,a,o,u])}(t,I,{host:w,width:C,tabId:a,flavour:"nodesView"});const[S,M]=(0,K.N9)("nodeIdToGo",{key:t,extraKey:"nodesView",flavour:"val"}),T=(0,r.useCallback)(e=>{h(e)},[h]),[F,N]=(0,r.useState)(null),[L,D]=(0,r.useState)(null),R=(0,r.useCallback)(()=>{D(null),N("new")},[]),$=(0,r.useCallback)(e=>{D(e),N("new")},[]),_=(0,r.useCallback)(e=>{D(null),N(e)},[]),z=(0,r.useCallback)(()=>{N(null),D(null)},[]),G=(0,r.useCallback)(function(e,t){return function(e,t){let{getGrouping:n,extraKey:r,searchScores:o,groupMode:a}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i={},l={};((e,t)=>{let{getNode:n,getGrouping:r,nodeMenus:o,menusById:s,searchScores:a}=t;e.forEach(e=>{const t=n(e);if(!t)return;const{name:s,priority:a,icon:i}=r(t);o[e]={...t,groupId:s,subMenuId:e,priority:a,groupIcon:i}}),[...e].sort((e,t)=>{const n=a?.[e]||0,r=a?.[t]||0;if(r!==n)return r-n;const s=(o[e]?.priority||0)-(o[t]?.priority||0);if(0!==s)return s;const i=(o[e]?.groupId||"").localeCompare(o[t]?.groupId||"",void 0,{sensitivity:"accent",ignorePunctuation:!0});return 0!==i?i:(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:l,searchScores:o});const c=Object.keys(l).reduce((e,t)=>{const{nodeIds:n}=l[t],o=i[n[0]];return e[t]={level:0,name:o.groupId,id:t,childrenIds:n,link:`${(0,it.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=lt.u[o.os?.nm||o.labels?.os_name]||lt.U[o.os?.id]||lt.u[o.labels?.vendor];e[n]={...o,level:1,id:n,menuId:t,link:`${(0,it.A)(`menu_${t}_submenu_${n}`)}`,size:24,forceVisibility:!0,icon:s?.iconName||s?.logoFilename&&`${g.A.assetsBaseURL}/img/logos/os/${s.logoFilename}`||"os",extraKey:r}}),e},{}),d=Object.keys(l);let u=-1;const h=d.reduce((e,t)=>{if(u+=1,!s.f9){const n={...c[t],sticky:!0};return[...e,n,...c[t].childrenIds.reduce((e,t)=>(u+=1,[...e,c[t]]),[])]}return a?[...e,{...c[t],isGroup:!0,children:c[t].childrenIds.reduce((e,t)=>(u+=1,[...e,c[t]]),[])}]:[...e,...c[t].childrenIds.reduce((e,t)=>(u+=1,[...e,c[t]]),[])]},[]);return i=null,l=null,{stickyIds:{},allElements:h,menuIds:d,menuById:c}}(e,t,{...arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},searchScores:A})},[A]);return(0,ie.jsx)(ne.A,{getObject:j,ids:I,getMenu:G,getGrouping:d,groupMode:u,deps:[d,A,a,u,c],extraKey:"nodesView",children:(0,ie.jsx)(O.A,{ref:b,position:"relative",sidebar:(0,ie.jsx)(re.Ay,{hiddenTabs:Er,nodeIds:f,title:"Nodes",initialChartName:S,viewFlavour:"nodesView",flavour:`nodesView-${a}`,loaded:!0,FilterInputContainer:xe,extraKey:`nodesView-${a}`}),children:!!C&&(0,ie.jsxs)(ie.Fragment,{children:[!s.f9&&(0,ie.jsx)(at,{}),!s.f9&&n&&!I.length&&x.length?(0,ie.jsx)(pe,{}):s.f9&&o?(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsxs)(dr,{allNodes:m,activeTabId:a,onTabChange:T,nodesCount:k,onCreateGroup:R,onEditGroup:_,children:[(0,ie.jsx)(ur,{tabId:a,filteredIds:I,totalCount:k}),(0,ie.jsx)(or,{nodeIdsLoaded:n,nodeIds:I,tabNodeIds:f,initialChartName:S,onChartNameChange:M,tabId:a,flavour:"nodesView",onCreateGroup:R,onCreateGroupWithNode:$,matchingGroups:c})]}),s.xH&&F&&(0,ie.jsx)(Pr,{id:F,onClose:z,allNodes:m,tabId:a,preselectedNodeId:L})]}):(0,ie.jsx)(pn,{initialChartName:S,onChartNameChange:M})]})})})},_r=()=>{const e=(0,y.ID)(),t=(0,B.CK)();return(0,B.gr)(e,"loaded")&&!t.length?(0,ie.jsx)($.Ay,{feature:"NodesView",mode:"NoNodesView",children:(0,ie.jsx)(R.A,{})}):(0,ie.jsx)($.Ay,{feature:"NodesView",children:(0,ie.jsx)(Hr,{})})},Kr=()=>{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 zr=n(85354),Gr=n(98545),Wr=n(23933),qr=n(17219),Ur=n(6387),Jr=n(65380);const Zr=e=>t=>`histogram::${e.getAttribute("id")}::${t}`,Xr=e=>{let{container:t,...n}=e;const o=(0,Zt.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:Zr}),t.appendChild(e),e)},[t]);return(0,r.useEffect)(()=>()=>s&&s.destroy(),[s]),(0,ie.jsx)(oe.Flex,{flex:!1,width:"100%",height:5,position:"sticky",bottom:"0",left:"0",right:"0",children:(0,ie.jsx)(nn.A,{"data-chartid":"dummy-chart",chart:s,overflow:"hidden",hasHeader:!1,hasFooter:!1,hasFilters:!1,tile:!1,...n,round:0})})};var Yr=n(55093),Qr=n(77148),eo=n(38773);const to=()=>(0,ie.jsxs)(oe.Flex,{padding:[6],round:1,width:"600px",background:"modalInfoBackground",children:[(0,ie.jsx)(oe.Box,{margin:[0,4,0,0],children:(0,ie.jsx)(oe.Box,{as:oe.Icon,width:10,height:10,name:"nodes_update"})}),(0,ie.jsxs)(oe.Flex,{column:!0,gap:2,children:[(0,ie.jsx)(oe.Text,{strong:!0,children:"Couldn't find the chart you were looking for? "}),(0,ie.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,ie.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."]})]})]}),no=()=>(0,ie.jsxs)(oe.Flex,{width:"100%",column:!0,gap:6,margin:[8,0,0,0],children:[(0,ie.jsx)(Qr.A,{}),(0,ie.jsxs)(oe.Flex,{gap:1,alignItems:"center",justifyContent:"center",padding:[2],background:"successSemi",children:[(0,ie.jsx)(Pn.A,{children:(0,ie.jsx)(oe.Text,{color:"primary",children:"Upgrade to Business for unlimited access"})}),(0,ie.jsx)(oe.Text,{children:"or"}),(0,ie.jsx)(eo.A,{children:(0,ie.jsx)(oe.Text,{color:"primary",children:"review your Space active Nodes"})})]})]}),ro=e=>{let{noPreferredNodesError:t,children:n}=e;return(0,ie.jsxs)(oe.Flex,{column:!0,flex:!0,justifyContent:"center",alignItems:"center",alignSelf:"center",children:[(0,ie.jsxs)(oe.Flex,{column:!0,justifyContent:"center",alignItems:"center",width:"300px",margin:[0,0,6],children:[(0,ie.jsx)(oe.H3,{margin:[0,0,4],children:"No charts to display"}),(0,ie.jsx)(oe.Text,{color:"textDescription",textAlign:"center",children:"Double-check your search or filters and dates and try again with different conditions."})]}),(0,ie.jsx)(to,{}),t&&(0,ie.jsx)(no,{}),n]})};var oo=n(93997),so=n(258);const ao=()=>{const[e,t]=(0,oo.sK)(),n=(0,y.ID)(),o=(0,v.vt)(),s=(0,H.w7)(),a=(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,so.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]),[i,l,,,{resetValue:c}]=(0,oe.useInputValue)({value:e,onChange:a}),d=(0,r.useCallback)(()=>{t(""),c(),(0,se.H)("toc-search","clear-search-button","charts-view")},[]);return(0,ie.jsx)(oe.TextInput,{value:i,onChange:l,size:"small",iconRight:i&&(0,ie.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 io=n(61841);const lo=(0,ce.s)(300,(e,t)=>(0,se.H)("toc-search","search-results","charts-view",e,`${t} -- charts`)),co=()=>{const e=(0,j.Zp)(),[t]=(0,io.Ay)(),n=(0,oo.Um)(),{filteredChartsCount:o,chartsCount:s}=(0,oo.Ad)();(0,r.useEffect)(()=>{n&&lo(n,o)},[n,o]);const a=(0,r.useCallback)(n=>{n.preventDefault(),e(`/spaces/${t}/settings/configurations`,{replace:!0})},[t,e]);return(0,ie.jsxs)(oe.Flex,{alignItems:"center",justifyContent:"between",width:"100%",children:[(0,ie.jsxs)(oe.TextMicro,{color:"textLite",margin:[1,0,0],"data-testid":"numberOfChartsIndication",children:["Showing"," ",(0,ie.jsx)(oe.TextMicro,{strong:!0,color:"textDescription","data-testid":"numberOfChartsIndication-filteredChartsCount",children:o})," ","of total"," ",(0,ie.jsx)(oe.TextMicro,{strong:!0,color:"textDescription","data-testid":"numberOfChartsIndication-chartsCount",children:s})," ","charts"]}),(0,ie.jsx)(ge.A,{Component:oe.TextMicro,margin:[1,0,0],"data-ga":`toc-search::click-link-collectors::${name}`,onClick:a,target:"_blank",rel:"noopener noreferrer",children:"Add more charts"})]})},uo=()=>{const{filteredChartsCount:e}=(0,oo.Ad)();return e||null===e?null:(0,ie.jsxs)(oe.Flex,{width:"100%",gap:1,margin:[4,0,0],padding:[2],alignItems:"center","data-testid":"noResultsWereFound",children:[(0,ie.jsx)(oe.Icon,{name:"information",color:"textDescription"}),(0,ie.jsx)(oe.TextMicro,{strong:!0,color:"textDescription",children:"No results were found"})]})};var ho=n(14512);const xo=()=>(0,ie.jsxs)(oe.Flex,{column:!0,alignItems:"center",children:[(0,ie.jsx)(ao,{}),(0,ie.jsx)(co,{}),(0,ie.jsx)(ho.A,{}),(0,ie.jsx)(uo,{})]}),go=e=>{let{width:t=443,height:n=249,videoId:r,...o}=e;return(0,ie.jsx)(oe.Flex,{...o,children:(0,ie.jsx)(oe.Box,{className:"video-responsive",children:(0,ie.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 mo=n(58218),po=n(14815);const fo=()=>{const e=(0,y.ID)(),t=(0,m.JT)("node:Create");return(0,ie.jsxs)(O.A,{column:!1,"data-testid":"noNodesViewPage",gap:12,padding:[6],children:[(0,ie.jsxs)(oe.Flex,{column:!0,gap:5,flex:{shrink:0,grow:0},"data-testid":"noKubernetesView-videoSection",children:[(0,ie.jsx)(go,{"data-testid":"noNodesView-onboardingVideo",height:350,width:850,videoId:De.BX[0]}),(0,ie.jsx)(go,{"data-testid":"noNodesView-onboardingVideo",height:350,width:850,videoId:De.BX[1]})]}),(0,ie.jsxs)(oe.Flex,{column:!0,gap:4,children:[(0,ie.jsxs)(oe.Box,{border:{side:"bottom",color:"borderSecondary"},children:[(0,ie.jsx)(oe.Box,{margin:[0,0,2,0],children:(0,ie.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,ie.jsx)(oe.TextBig,{color:"primary",children:"Kubernetes monitoring with Netdata: Overview and visualizations"})})}),(0,ie.jsx)(oe.Box,{margin:[0,0,2,0],children:(0,ie.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,ie.jsx)(oe.TextBig,{color:"primary",children:"Kubernetes visualizations"})})})]}),(0,ie.jsx)(oe.Flex,{column:!0,gap:4,children:t?(0,ie.jsx)(mo.A,{integrationId:po.v2,rooms:[e]}):(0,ie.jsx)(R.S,{})})]})]})};var jo=n(67012),bo=n(77611);const vo=vn.default.div.withConfig({displayName:"selections__Separator",componentId:"sc-1cc7y18-0"})(["width:1px;height:",";background:",";"],(0,oe.getSizeBy)(2.5),(0,oe.getColor)("borderSecondary")),yo=[{label:"Volume",value:"volume"},{label:"KS2",value:"ks2"}],Co=[{label:"Average",value:"average"},{label:"Median",value:"median"},{label:"Min",value:"min"},{label:"Max",value:"max"},{label:"Stddev",value:"stddev"}],wo=[{label:"Metrics",value:""},{label:"Anomaly Rate",value:"anomaly-bit"}],Io=()=>(0,ie.jsxs)(oe.Flex,{column:!0,gap:1,alignItems:"center",width:"220px",children:[(0,ie.jsx)(oe.TextMicro,{children:"Choose the algorithm you want to be used to identify correlations across metrics:"}),(0,ie.jsxs)(oe.TextMicro,{children:[(0,ie.jsx)(oe.TextMicro,{strong:!0,children:"KS2:"})," A statistical test comparing the distribution of the highlighted window to the baseline."]}),(0,ie.jsxs)(oe.TextMicro,{children:[(0,ie.jsx)(oe.TextMicro,{strong:!0,children:"Volume:"})," Percentage change in averages between highlighted window and baseline."]})]}),Ao=()=>(0,ie.jsx)(oe.Flex,{column:!0,gap:1,alignItems:"center",width:"220px",children:(0,ie.jsx)(oe.TextMicro,{children:"What aggregation function do you want to apply when aggregating multiple datapoints for metric correlations."})}),ko=()=>(0,ie.jsx)(oe.Flex,{column:!0,gap:1,alignItems:"center",width:"220px",children:(0,ie.jsx)(oe.TextMicro,{children:"Do you want to find correlations over the metric values or the anomaly rates of each metric."})}),So=e=>{let{runGetWeights:t,nodeIds:n,flavour:o}=e;const{method:s,options:a,group:i}=(0,bo.G9)({nodeIds:n,flavour:o}),l=a?.includes(wo[1].value)?wo[1].value:"",c=(0,r.useCallback)(e=>n=>{let{value:r}=n;r="options"!==e?r:r?[r]:[];t({method:s,options:[a],group:i,[e]:r})},[s,a,i]),d=(0,r.useMemo)(()=>({method:yo.find(e=>e.value===s),group:Co.find(e=>e.value===i),option:wo.find(e=>e.value===l)}),[s,i,l]);return i?(0,ie.jsxs)(oe.Flex,{gap:2,children:[(0,ie.jsxs)(oe.Flex,{gap:1,alignItems:"center",children:[(0,ie.jsx)(oe.TextSmall,{color:"textLite",children:"Method:"}),(0,ie.jsx)(oe.Select,{options:yo,value:d.method,onChange:c("method")}),(0,ie.jsx)(ze.A,{isBasic:!0,plain:!0,content:Io,align:"bottom",children:(0,ie.jsx)(oe.Icon,{name:"information",color:"textDescription",size:"small"})})]}),(0,ie.jsx)(vo,{}),(0,ie.jsxs)(oe.Flex,{gap:1,alignItems:"center",children:[(0,ie.jsx)(oe.TextSmall,{color:"textLite",children:"Aggregation:"}),(0,ie.jsx)(oe.Select,{options:Co,value:d.group,onChange:c("group")}),(0,ie.jsx)(ze.A,{isBasic:!0,plain:!0,content:Ao,align:"bottom",children:(0,ie.jsx)(oe.Icon,{name:"information",color:"textDescription",size:"small"})})]}),(0,ie.jsx)(vo,{}),(0,ie.jsxs)(oe.Flex,{gap:1,alignItems:"center",children:[(0,ie.jsx)(oe.TextSmall,{color:"textLite",children:"Data:"}),(0,ie.jsx)(oe.Select,{options:wo,value:d.option,onChange:c("options")}),(0,ie.jsx)(ze.A,{isBasic:!0,plain:!0,content:ko,align:"bottom",children:(0,ie.jsx)(oe.Icon,{name:"information",color:"textDescription",size:"small"})})]}),(0,ie.jsx)(vo,{})]}):null};var Mo=n(64587);const To=e=>{let{highlightAfter:t,highlightBefore:n,baseline:r}=e;const{localeDateString:o,localeTimeString:s}=(0,Mo.$j)(),a=new Date(t),i=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,K.rI)("highlight");return(0,ie.jsxs)(oe.Flex,{gap:4,alignItems:"center",children:[(0,ie.jsxs)(oe.Flex,{gap:2,children:[(0,ie.jsxs)(oe.Flex,{column:!0,gap:1,children:[(0,ie.jsx)(oe.TextSmall,{color:"textLite",children:"Selected area:"}),(0,ie.jsx)(oe.TextSmall,{color:"textLite",children:"Reference baseline:"})]}),(0,ie.jsxs)(oe.Flex,{column:!0,gap:1,children:[(0,ie.jsxs)(oe.TextSmall,{"data-testid":"metricCorrelation-selectedArea",children:[o(a,{long:!1}),","," ",s(a),"\xa0->\xa0",o(i,{long:!1}),","," ",s(i)]}),(0,ie.jsxs)(oe.TextSmall,{"data-testid":"metricCorrelation-referenceBaseline",children:[o(l,{long:!1}),","," ",s(l),"\xa0->\xa0",o(c,{long:!1}),","," ",s(c)]})]}),(0,ie.jsxs)(oe.Flex,{column:!0,gap:1,children:[(0,ie.jsx)(oe.TextSmall,{color:"textLite",children:"Duration:"}),(0,ie.jsx)(oe.TextSmall,{color:"textLite",children:"Duration:"})]}),(0,ie.jsxs)(oe.Flex,{column:!0,gap:1,children:[(0,ie.jsxs)(oe.TextSmall,{"data-testid":"metricCorrelation-selecteArea-duration",children:[d,"\xa0secs"]}),(0,ie.jsxs)(oe.TextSmall,{"data-testid":"metricCorrelation-referenceBaseline-duration",children:[u,"\xa0secs"]})]})]}),(0,ie.jsx)(ze.A,{content:"Clear selection",align:"bottom",isBasic:!0,children:(0,ie.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"})})]})},Fo=(0,tt.A)(oe.Button),No=(0,vn.default)(oe.Button).withConfig({displayName:"correlation__LogoButton",componentId:"sc-15d72m3-0"})(["&&{pointer-events:none;}"]),Lo=(0,vn.default)(oe.Button).withConfig({displayName:"correlation__CloseButton",componentId:"sc-15d72m3-1"})(["position:absolute !important;top:-3px;right:-3px;"]),Do=(0,tt.A)(Lo),Bo=(0,vn.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;}"]),Ro=e=>{let{flavour:t}=e;const n=(0,v.vt)(),o=(0,y.ID)(),s=(0,E.nl)(),a=(0,r.useMemo)(()=>s?[s]:[],[s]),i=(0,H.w7)({extraKey:"nodesView",merge:!1,scoped:!0}),l="singleNode"===t?a:i,[c,d]=(0,r.useState)(!1),[u,h]=(0,r.useState)(),{threshold:x,totalDimensionsCount:g,dimensionsCount:m,loaded:p,loading:f,getWeights:j,resetWeights:b}=(0,bo.Yy)({nodeIds:l,flavour:t},n,o),{method:C,options:w,group:I}=(0,bo.G9)({nodeIds:l,flavour:t}),{after:A,before:k}=(0,K.rW)("highlight"),S=A-4*(k-A),M=!!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,jo.A)(()=>{A&&d(!0)},[A]);const T=(0,K.rI)("correlation"),F=(0,K.rI)("threshold"),N=(0,K.rI)("highlight"),L=(0,r.useCallback)(()=>{T(!1),N({after:null,before:null}),F(bo.UG),b(),(0,se.H)("metrics-correlation","click-close","charts-view",""+(p?"finish":"start"))},[T,N,F,b,p]),D=(0,r.useCallback)(()=>{F(bo.UG),b(),(0,se.H)("metrics-correlation","click-delete","charts-view",""+(p?"finish":"start"))},[F,b,p]),B=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(()=>F(bo.UG))},R=!M||f;return(0,jo.A)(()=>{p&&c&&M&&B()},[p,M,c]),(0,r.useEffect)(()=>()=>b(),[]),(0,ie.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:[M?p?(0,ie.jsx)($._0,{feature:"MetricCorrelations",totalDimensionsCount:g,dimensionsCount:m,children:(0,ie.jsxs)(oe.Flex,{"data-testid":"metricCorrelation-resultsContainer",column:!0,width:"100%",children:[(0,ie.jsxs)(oe.Flex,{justifyContent:"between",alignItems:"center",gap:1,children:[(0,ie.jsxs)(oe.Flex,{alignItems:"center",gap:1,children:[(0,ie.jsx)(oe.Icon,{name:"correlation",color:"primary",width:"16px",height:"16px"}),(0,ie.jsxs)(oe.TextSmall,{children:["Analysed"," ",(0,ie.jsx)(oe.TextSmall,{color:"primary","data-testid":"metricCorrelation-resultsAnalyzed",children:g})," ","and found"," ",(0,ie.jsx)(oe.TextSmall,{color:"primary","data-testid":"metricCorrelation-resultsFound",children:m})," ","correlated metrics."]}),(0,ie.jsx)(ze.A,{content:"Clear results",children:(0,ie.jsx)(Bo,{flavour:"borderless",neutral:!0,disabled:f||!p&&!M,onClick:D,"data-testid":"metricCorrelation-clear",small:!0,icon:"reload"})})]}),(0,ie.jsx)(So,{runGetWeights:B,nodeIds:l,flavour:t})]}),(0,ie.jsxs)(oe.Flex,{width:"100%",children:[(0,ie.jsxs)(oe.Flex,{alignItems:"center",gap:3,margin:[0,2,0,5],width:"100%",children:[(0,ie.jsx)(oe.TextNano,{whiteSpace:"nowrap",color:"textDescription",children:"Show less"}),(0,ie.jsx)(oe.InputRange,{"data-testid":"metricCorrelation-resultsSlider",min:0,max:1,onChange:e=>F(e.target.value.toString()),onClick:()=>(0,se.H)("metric-correlation","click-slider","charts-view"),step:.01,value:x}),(0,ie.jsx)(oe.TextNano,{whiteSpace:"nowrap",color:"textDescription",children:"Show more"})]}),(0,ie.jsx)(ie.Fragment,{children:(0,ie.jsx)(ze.A,{content:"Give us your feedback! Was it useful?",align:"bottom",enterDelay:200,showArrow:!0,activateOn:"hover",children:(0,ie.jsxs)(oe.Flex,{children:[(0,ie.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,ie.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,ie.jsxs)(oe.Flex,{alignItems:"center","data-testid":"correlationView-timePeriod-container",gap:4,children:[(0,ie.jsx)(No,{icon:"logo_s",isLoading:f}),f?(0,ie.jsx)(oe.H5,{"data-testid":"metricCorrelation-loadingCalculation",children:"Calculating metric correlations..."}):(0,ie.jsx)(To,{highlightAfter:A,highlightBefore:k,baseline:S})]}):(0,ie.jsxs)(oe.Flex,{alignItems:"center",gap:1,children:[(0,ie.jsx)(oe.Icon,{name:"correlation",color:"primary"}),(0,ie.jsx)(oe.Text,{children:"Select a timeframe on any chart and find correlated metrics. Visit documentation"}),(0,ie.jsx)("a",{href:"https://learn.netdata.cloud/docs/cloud/insights/metric-correlations",target:"_blank",rel:"noreferrer",children:(0,ie.jsx)(oe.Icon,{name:"nav_arrow_goto",color:"primary",width:"12px",height:"12px"})})]}),(0,ie.jsxs)(oe.Flex,{alignItems:"center",children:[(!p||f)&&(0,ie.jsx)(ze.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,ie.jsx)(Fo,{label:f?"Loading...":"Find correlations",isLoading:!1,onClick:B,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,ie.jsx)(ze.A,{content:"Close",align:"bottom",children:(0,ie.jsx)(Do,{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,ie.jsxs)(oe.Flex,{"data-testid":"selected-nodes-container",gap:1,alignItems:"center",width:"100%",children:[(0,ie.jsx)(oe.Flex,{alignItems:"center",children:(0,ie.jsx)(oe.TextSmall,{whiteSpace:"nowrap","data-testid":"selected-nodes-container-message",color:"primary",children:"Selected filters:"})}),(0,ie.jsx)(oe.Flex,{height:{max:50},overflow:{vertical:"auto"},padding:[1],gap:1,alignItems:"center",flexWrap:!0,children:t})]})},Vo=(0,r.memo)($o),Oo=e=>{let{onRemove:t}=e;return(0,ie.jsx)(oe.Box,{"data-testid":"remove-button",as:oe.Icon,name:"close_circle",onClick:t,cursor:"pointer",width:3,height:3,color:"textLite"})},Po=e=>{let{removeFilter:t,group:n,id:r,value:o,isAnchorDisabled:s,onClick:a,ref:i}=e;const[l,c]=o.split("|"),d=c?`${l} > ${c}`:l;return(0,ie.jsx)(oe.Flex,{ref:i,"data-testid":`selected-node-item-${r}`,children:(0,ie.jsx)(oe.Pill,{flavour:"neutral",hollow:!0,children:(0,ie.jsxs)(oe.Flex,{position:"relative",gap:2,alignItems:"center",children:[a?(0,ie.jsx)(ge.A,{Component:oe.TextSmall,disabled:s,onClick:a,cursor:"pointer",color:"text",hoverColor:"primary",visitedColor:"accent",disabledColor:"textLite",children:d}):(0,ie.jsx)(oe.TextSmall,{children:d}),(0,ie.jsx)(Oo,{onRemove:()=>t({param:n,removedValue:r}),id:r})]})})})},Eo=(0,r.memo)(Po),Ho={selectedNodeIds:"Node",nodeStatuses:"Status",nodeLabels:"Host label",nodeCapabilities:"Capability",nodeVersions:"Version"},_o=e=>{let{group:t,subGroup:n,groupLabel:o,values:s,filtersByLabel:a={},hasUnion:i,union:l="AND",removeFilter:c,Component:d=Eo}=e;const u=o||Ho[t];if(!Array.isArray(s)||!s.length)return null;const h="nodeLabels"!==t||n?{}:a,x=Object.entries(h);return x.length?x.map((e,n)=>{let[r,o]=e;return(0,ie.jsx)(_o,{group:t,subGroup:r,groupLabel:`${Ho[t]} ${r}`,values:o,hasUnion:n>0,removeFilter:c},n)}):(0,ie.jsxs)(r.Fragment,{children:[i&&(0,ie.jsx)(oe.TextSmall,{strong:!0,children:l}),(0,ie.jsxs)(oe.Pill,{flavour:"neutral",hollow:!0,gap:1,TextComponent:oe.Flex,textProps:{alignItems:"center",gap:1},flexWrap:!0,children:[(0,ie.jsxs)(oe.TextNano,{strong:!0,children:[u,":"]}),s.map((e,o)=>(0,ie.jsxs)(r.Fragment,{children:[o>0&&(0,ie.jsx)(oe.TextSmall,{strong:!0,children:"OR"}),(0,ie.jsx)(d,{removeFilter:c,id:n?`${n}|${e}`:e,value:e,group:t})]},e))]})]},"filter")},Ko=e=>{let{removeFilter:t,value:n,ref:r}=e;const o=(0,E.xY)(n,"name"),s=(0,E.xY)(n,"isOffline"),a=(0,E.d3)(n);return(0,ie.jsx)(Eo,{ref:r,removeFilter:t,group:"selectedNodeIds",id:n,value:o,isAnchorDisabled:s,onClick:a})},zo=(0,r.memo)(e=>{let{flavour:t}=e;const[[n,r=[]],o]=(0,H._e)({extraKey:t,merge:!1});if(!n.length&&!r.length)return(0,ie.jsx)("div",{});const s=(0,H.Pt)(n);return(0,ie.jsx)(oe.Flex,{width:"100%",overflow:"hidden",padding:[2,0],children:(0,ie.jsxs)(Vo,{children:[n.map((e,t)=>{let[n,r]=e;return(0,ie.jsx)(_o,{group:n,values:r,filtersByLabel:s,hasUnion:t>0,removeFilter:o},n)}),(0,ie.jsx)(_o,{group:"selectedNodeIds",values:r,hasUnion:!!n.length&&!!r.length,union:"OR",removeFilter:o,Component:Ko})]})})});var Go=n(88434);const Wo={overview:zo,default:null},qo=(0,r.memo)(e=>{let{flavour:t,...n}=e;const{showCorrelation:r}=(0,Go.A)(),o=Wo[t]||Wo.default;return(0,ie.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,ie.jsx)(Ro,{flavour:t}):!!o&&(0,ie.jsx)(o,{...n,flavour:t})})}),Uo=qo;var Jo=n(27024),Zo=n(98591),Xo=n(47213);const Yo=e=>{let{id:t,contexts:n,menuId:r,parentIds:o,...s}=e;const a=(0,Te.bD)();return(0,Xo.q)(a)(n,r||t,o)?(0,ie.jsx)(vt.h,{id:t,...s,children:(0,ie.jsx)(yt.$,{id:t,hasTooltip:!0,flavour:s.extraKey,enableFavourites:!0,level:s.level,descendantIds:s.descendantIds,selfChartIds:s.selfChartIds})}):null},Qo=(0,r.memo)(Yo);var es=n(5020),ts=n(80744),ns=n(64156),rs=n(28973),os=n(1817),ss=n(2404),as=n.n(ss),is=n(52795);const ls=(0,G.eU)(null),cs=()=>{const e=(0,Zt.eg)(),t=(0,z.md)(ls);return e&&e.getRoot().getChildren().find(e=>e.match({id:t}))},ds=e=>t=>`overview-page::${e.getAttribute("id")}::${t}`;var us=n(54251),hs=n(77679);const xs={},gs=(e,t,n)=>{const o=(0,y.ID)(),[s,a]=(0,hs.w)(),i=s?a:o,l=(0,K.rW)("contextSearchFilters",{key:i,extraKey:"chartFilters",flavour:"obj",defaultValue:xs});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])},ms=[],ps=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{selectedDimensions:e.dimensions?Object.keys(e.dimensions):ms,selectedInstances:e.instances?Object.keys(e.instances):ms,selectedNodes:e.nodes?Object.keys(e.nodes):ms,weight:e.weight}},fs=e=>{let{style:t,handleProps:n,attributes:o,listeners:s,dragging:a,dragOverlay:i,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,y.ID)(),v=cs(),{contextScope:C,...w}=(0,fn.aA)(l),I=(0,Zt.eg)(),{sendLog:A,isReady:k}=(0,cn.A)(),S=(0,ee.CS)({type:"chart",entity:C?C.join(","):l,path:"/"}),M=gs(C,m||g,p),T=(0,r.useMemo)(()=>{if(!v)return null;let e=v.getNode({id:i?`dragOverlay-${l}`:l});const t=(0,is.A)(S,!0);if(e)return j.current=(0,is.A)({...e.getAttributes(),...e.getAttribute("pristine"),pristine:{}}),M&&!as()(e.getAttribute("prevMatches"),M)&&e.setAttributes({selectedDimensions:Array.from(new Set([...t.selectedDimensions||[],...M.dimensions||[]])),selectedInstances:Array.from(new Set([...t.selectedInstances||[],...M.instances||[]])),selectedLabels:Array.from(new Set([...t.selectedLabels||[],...M.labels||[]])),prevMatches:M}),e;e=I.makeChart({attributes:{id:i?`dragOverlay-${l}`:l,roomId:b,expandable:!0,...w,contextScope:C,expanded:h,toolboxProps:{drag:{...n,...s,...o}}},makeTrack:ds}),v.appendChild(e),j.current=(0,is.A)(e.getAttributes());const r=e.getAttribute("chartLibrary");return e.setAttributes({...j.current,...t,...M&&!as()(e.getAttribute("prevMatches"),M)&&{selectedDimensions:Array.from(new Set([...t.selectedDimensions||[],...M.dimensions||[]])),selectedInstances:Array.from(new Set([...t.selectedInstances||[],...M.instances||[]])),selectedLabels:Array.from(new Set([...t.selectedLabels||[],...M.labels||[]])),prevMatches:M}}),(0,us.A)(e,r,e.getAttribute("chartLibrary")),e},[v,b,l,i]);(0,r.useLayoutEffect)(()=>{T&&k&&"function"===typeof A&&T.updateAttribute("logOptions",{sendLog:A,payload:{feature:"Overview"}})},[T,A,k]);const{weight:F,selectedDimensions:N,selectedInstances:L,selectedNodes:D}=(0,fn.uy)(C.join("|"),ps),B=(0,os.A)(S),R=(0,os.A)(M,!0),$=(0,os.A)(N.length),V=(0,os.A)(L.length),O=(0,os.A)(D.length);return(0,jo.A)(()=>{if(!T)return;const e=T.getAttribute("chartLibrary"),t={};if(!F||$===N.length&&V===L.length&&O===D.length?S&&!as()(B,S)&&Object.assign(t,{...j.current,...(0,is.A)(S,!0)}):Object.assign(t,{selectedDimensions:N,selectedInstances:L,selectedNodes:D}),M&&!as()(R,M)){const e=T.getAttributes();Object.assign(t,{selectedDimensions:Array.from(new Set([...e.selectedDimensions||[],...t.selectedDimensions||[],...M.dimensions||[]])),selectedInstances:Array.from(new Set([...e.selectedInstances||[],...t.selectedInstances||[],...M.instances||[]])),selectedLabels:Array.from(new Set([...e.selectedLabels||[],...t.selectedLabels||[],...M.labels||[]])),prevMatches:M})}Object.keys(t).length>0&&(T.updateAttributes(t),(0,us.A)(T,e,T.getAttribute("chartLibrary")),T.trigger("fetch"))},[T,b,l,S,M,F,N.length,L.length,D.length]),(0,r.useLayoutEffect)(()=>{T&&t&&(T.updateAttributes({height:t.height,width:t.width}),T.trigger("resize"))},[T,t.height,t.width]),(0,r.useLayoutEffect)(()=>{if(T)return(0,rs.unregister)(T.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}=T.getAttributes();d(l,(e?1:-1)*t)}))},[T]),(0,jo.A)(()=>{T&&T.updateAttributes({toolboxProps:{drag:{...n,...s,...o,dragging:a}}})},[T,a]),T?(0,ie.jsxs)(oe.Box,{ref:x,style:t,children:[(0,ie.jsx)(nn.A,{chart:T,"data-chartid":i?`dragOverlay-${l}`:l,"data-track":T.track("container"),height:t.height,width:"100%"}),c]},v&&v.getId()):null},js=(0,r.memo)(fs,(e,t)=>e.id===t.id&&e.style===t.style),bs=function(){let{id:e,layout:t={},contextScope:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,es.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})},vs=e=>{let{id:t,menuId:n,subMenuId:o,parentIds:s,containerWidth:a,...i}=e;const l=(0,fn.aA)(t,bs),c=(0,Te.bD)(),d=(0,Xo.q)(c),[u,h]=(0,r.useState)(()=>[l]),x=(e,t)=>{(0,es.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/ts.NA,expanded:t>0},x([...u],u[n]),g.current+=1)},p=(0,ns.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,ie.jsx)(js,{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,ie.jsx)(ts.Ay,{cacheId:g.current,rootId:t,containerId:t,onDragEnd:x,items:f,containerWidth:a-(p?16:26),"data-menuid":o||n,...i,Item:j,rearrangeable:!0})},ys=(0,r.memo)(vs);var Cs=n(54025),ws=n(63996);const Is=e=>{let{id:t,contexts:n,menuId:r,parentIds:o,extraKey:s,descendantIds:a,level:i,selfChartIds:l}=e;const c=(0,Te.bD)();return(0,Xo.q)(c)(n,r||t,o)?(0,ie.jsx)(Cs.t,{gap:0,id:t,testId:"chart-sub-menu-container-overview",children:(0,ie.jsx)(ws.t,{id:t,margin:[1,0,0],hasTooltip:!0,flavour:s,enableFavourites:!0,level:i,descendantIds:a,selfChartIds:l})}):null},As=(0,r.memo)(Is);var ks=n(4719);const Ss=e=>{let{id:t}=e;const n=(0,y.ID)(),o=(0,Zt.eg)(),s=(0,fn.Vt)(),{chartIds:a}=(0,ks.b)(t),i=cs(),l=(0,r.useMemo)(()=>{const[e]=a;let r=i.getChildren().find(e=>e.match({id:t}));if(r)return r;const l=a.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:ds}),i.appendChild(r),r},[t,i]);return(0,ie.jsx)(nn.A,{margin:[0,0,2],chart:l,"data-chartid":t,"data-track":l.track("container")},i.getId())},Ms=e=>{let{id:t,...n}=e;return(0,ie.jsxs)(vt.h,{id:t,padding:[6,0,0],children:[(0,ie.jsx)(yt.$,{id:t}),(0,ie.jsx)(Ct.n,{id:t,padding:[2,0,0]}),(0,ie.jsx)(Ss,{id:t,...n})]})},Ts=(0,r.memo)(Ms),Fs=[],Ns=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{selectedDimensions:e.dimensions?Object.keys(e.dimensions):Fs,selectedInstances:e.instances?Object.keys(e.instances):Fs,selectedNodes:e.nodes?Object.keys(e.nodes):Fs,weight:e.weight}},Ls=(0,fn.BK)(e=>{let{style:t,id:n,menuChartAttributes:o,resizeHandle:s,handleProps:a,listeners:i,dragging:l,dragOverlay:c,onChangeHeight:d,expanded:u,ref:h,menuId:x,subMenuId:g,parentIds:m}=e;const p=(0,r.useRef)({}),f=(0,y.ID)(),j=(0,Zt.eg)(),b=cs(),v=(0,ee.CS)({type:"chart",entity:n,path:"/"}),C=gs(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,is.A)(v,!0);if(e)p.current=(0,is.A)({...e.getAttributes(),...e.getAttribute("pristine")}),C&&!as()(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:ds,toolboxProps:{drag:{...a,...i}}}),p.current=(0,is.A)(e.getAttributes());const r=e.getAttribute("chartLibrary");e.setAttributes({...p.current,...t,...C&&as()(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,us.A)(e,r,e.getAttribute("chartLibrary")),b.appendChild(e)}return e},[f,n,b]),{weight:I,selectedDimensions:A,selectedInstances:k,selectedNodes:S}=(0,fn.uy)(o.contextScope?.join("|"),Ns),M=(0,os.A)(v),T=(0,os.A)(C,!0,as()),F=(0,os.A)(A.length),N=(0,os.A)(k.length),L=(0,os.A)(S.length);(0,jo.A)(()=>{if(!w)return;const e={},t=w.getAttribute("chartLibrary");if(!I||F===A.length&&N===k.length&&L===S.length?v&&!as()(M,v)&&Object.assign(e,{...p.current,...(0,is.A)(v,!0)}):Object.assign(e,{selectedDimensions:A,selectedInstances:k,selectedNodes:S}),C&&!as()(T,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,us.A)(w,t,w.getAttribute("chartLibrary")),w.trigger("fetch"))},[w,f,n,v,C,I,A.length,k.length,S.length]),(0,r.useLayoutEffect)(()=>{w.updateAttributes({toolboxProps:{drag:{...a,...i,dragging:l}}})},[w,l]),(0,r.useLayoutEffect)(()=>{if(w)return(0,rs.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,jo.A)(()=>{if(!w)return;const e=parseFloat(t.height);e&&!isNaN(e)&&(w.updateAttribute("height",e),w.trigger("resize"))},[t.height]);return(0,Te.Bu)(o.contextScope)?(0,ie.jsxs)("div",{ref:h,style:t,children:[(0,ie.jsx)(nn.A,{chart:w,"data-track":w.track("container"),"data-chartid":c?`dragOverlay-${n}`:n,height:t.height,width:"100%"}),s]},b.getId()):null}),Ds=(e,t,n)=>(e.layout||console.warn(t,"has no layout set, default values will be used."),(0,es.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})),Bs=(0,r.memo)(e=>{let{itemIds:t,containerWidth:n,id:o,subMenuId:s,menuId:a,parentIds:i}=e;const l=(0,fn.dd)(t,Ds),{filteredChartsCount:c}=(0,oo.Ad)(),d=(0,ns.A)("(max-width: 767px)"),u=(0,Te.bD)(),h=(0,Xo.q)(u),[x,g]=(0,r.useState)(()=>l),m=(e,t)=>{(0,es.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,a,i)))),[t,x,c,h,a,i]);return y.length?(0,ie.jsxs)(oe.Flex,{position:"relative",width:"100%",onMouseEnter:()=>j(!0),onMouseLeave:()=>j(!1),children:[f&&b&&(0,ie.jsx)(oe.Flex,{position:"absolute",top:2,right:2,zIndex:10,background:"dropdown",round:1,padding:[1],border:!0,children:(0,ie.jsx)(ze.A,{content:"Reset all charts to default layout",align:"left",children:(0,ie.jsx)(oe.IconButton,{icon:"refresh",onClick:v,flavour:"borderless",padding:[1],"data-testid":"grid-reset-layout-button"})})}),(0,ie.jsx)(ts.Ay,{cacheId:p.current,rootId:o,containerId:o,"data-chartid":o,"data-menuid":s||a,onDragEnd:m,items:y,containerWidth:n-(d?16:26),gridTracks:d?1:12,Item:Ls,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/ts.NA,expanded:t>0},m([...x],x[n]),p.current+=1)},menuId:a,subMenuId:s,parentIds:i},compactType:"vertical"})]}):null},(e,t)=>e.itemIds===t.itemIds&&e.containerWidth===t.containerWidth),Rs={k8s:Ts,root:Qo,submenu:As,chart:ys,grid:Bs},$s=e=>{if(Rs[e.flavour])return Rs[e.flavour];switch(e.level){case 0:return Qo;case 1:return As;case 2:return ys;default:return null}},Vs=e=>{let{flavour:t,onChartNameChange:n,initialChartName:r,dashboardOptions:o,linkToGo:s,contextToGo:a,containerWidth:i}=e;const[l,,,c]=(0,Zo.A)("addToDashboardModal"),{setActiveMenuId:d}=(0,jt.A)({onChartNameChange:n,initialChartName:r,linkToGo:s,contextToGo:a}),u=(0,Te.bD)(),h=(0,Xo.q)(u);return(0,ie.jsxs)(ne.H,{children:[(0,ie.jsx)(bt.A,{flavour:t,onActiveMenuId:d,getComponent:$s,dashboardOptions:o,initialChartName:r,containerWidth:i,checkVisibility:h}),l&&(0,ie.jsx)(Jo.A,{onClose:c})]})},Os=(0,r.memo)(()=>{const{localeDateString:e,localeTimeString:t}=(0,Mo.$j)(),[n,o]=(0,An.KB)(),s=(0,Zt.eg)(),a=!!n&&!!s&&s.getNode({id:n.context}),i=()=>{if(o(null),!n?.context||!a)return;const e={...a.getAttribute("overlays")};delete e.alert,a.updateAttribute("overlays",e),history.replaceState({},"")};(0,r.useEffect)(()=>i,[]);const l=(0,y.ID)(),c=(0,Te.R7)(n?.context&&l,n?.context);if(!n||!c?.loaded)return null;const{firstEntry:d}=c;return(0,ie.jsx)(oe.Layer,{backdrop:!1,position:"top",margin:[26,0,0],padding:[26,0,0],children:(0,ie.jsxs)(oe.Flex,{background:"tooltip",padding:[1,2],gap:2,children:[(0,ie.jsxs)(oe.TextSmall,{children:["Showing alert in ",(0,ie.jsx)(oe.TextSmall,{strong:!0,children:n.instance})," on"," ",(0,ie.jsxs)(oe.TextSmall,{strong:!0,children:[e(new Date(1e3*n.lastStatusChange))," ",t(new Date(1e3*n.lastStatusChange))]}),!d&&" doesn't exist on the node anymore",!!d&&d>n.lastStatusChange&&" exceeds agent data retention settings"]}),(0,ie.jsx)(oe.Flex,{flex:!1,children:(0,ie.jsx)(oe.Icon,{name:"x",color:"tooltipText",onClick:i,size:"small"})})]})})}),Ps=Os;var Es=n(14070);const Hs={NoChartsView:ro,NoNodesView:R.A,sidebar:{title:"Filters",hiddenTabs:["info"],Component:re.Ay,props:{}},dashboardOptions:{},loadingMessage:"Loading charts...",Header:Uo},_s={overview:{...Hs,sidebar:{...Hs.sidebar,title:"Metrics"},feature:"Overview"},k8s:{...Hs,NoChartsView:fo,NoNodesView:fo,sidebar:{...Hs.sidebar,title:"Kubernetes"},loadingMessage:"Loading k8s charts...",feature:"Kubernetes"},singleNode:{...Hs,sidebar:{...Hs.sidebar,title:"Single Node",hiddenTabs:["filters"],props:{showCollapsed:!0}},feature:"SingleNode"}},Ks=()=>((0,Jr.A)(),null),zs=(0,r.memo)(e=>{let{flavour:t="overview",invalidationKey:n,nodeIds:r,loaded:o,getChart:s,chartIds:a,areChartsIdsEmpty:i,showNoChartsView:l,showNoNodesView:c,initializing:u,chartName:h,setChartName:x,chartsLoaded:g,widthRef:m,containerWidth:p,nodesKey:f,blurred:b,blurProps:v={},BlurredContent:y,noPreferredNodesError:C}=e;const{dashboardOptions:w,NoChartsView:I,NoNodesView:A,sidebar:k,Header:S,feature:M="Overview"}=_s[t],{state:T}=(0,j.zy)(),[F,,,N]=(0,Es.A)(),L=cs();return c?(0,ie.jsx)($.Ay,{feature:M,mode:"NoNodesView",children:(0,ie.jsx)(A,{})}):u?(0,ie.jsx)(Yr.A,{title:"Please wait while charts are being initialized.",body:"Thank you for your patience!"}):o?(0,ie.jsx)($.Ay,{feature:M,children:(0,ie.jsxs)(ne.A,{getObject:s,ids:a,linkToGo:T?.chartName,extraKey:t,deps:[f],children:[(0,ie.jsx)(Ks,{}),(0,ie.jsx)(Ps,{}),(0,ie.jsxs)(O.A,{ref:m,sidebar:(0,ie.jsx)(k.Component,{nodeIds:r,title:k.title,initialChartName:h,hiddenTabs:k.hiddenTabs,flavour:t,loaded:g,FilterInputContainer:xo,...k.props}),blurred:b,blurProps:v,BlurredContent:y,children:[(0,ie.jsx)(S,{flavour:t}),g||C?l||i?(0,ie.jsx)(I,{noPreferredNodesError:C}):(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(Vs,{flavour:t,dashboardOptions:w,initialChartName:h,onChartNameChange:x,linkToGo:T?.chartName,contextToGo:T?.contextToGo,containerWidth:p}),F&&N]}):(0,ie.jsx)(d.O2,{}),(0,ie.jsx)(Xr,{container:L})]})]},n)}):(0,ie.jsx)(d.O2,{})}),Gs=zs,Ws=e=>t=>{const n=(0,E.nl)(),o=(0,r.useMemo)(()=>[n],[n]);return(0,ie.jsx)(e,{flavour:"singleNode",nodeIds:o,nodeId:n,...t},n)};var qs=n(64867),Us=n(12407),Js=n(17829);var Zs=n(13752),Xs=n(92815),Ys=n(72582),Qs=n(82650),ea=n(78072),ta=n(95980),na=n(91832),ra=n(6504),oa=n(22332),sa=n(12897),aa=n.n(sa),ia=n(55042),la=n.n(ia),ca=new(aa())({id:"alarm_bell",use:"alarm_bell-usage",viewBox:"0 0 12 14",content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 14" id="alarm_bell"><path d="M11.45 8.11A2.61 2.61 0 0 1 10 5.77V5c0-1.97-1.44-3.6-3.31-3.93 0-.02.01-.04.01-.07 0-.39-.31-.7-.7-.7s-.7.31-.7.7c0 .02.01.05.01.07C3.44 1.4 2 3.03 2 5v.76c0 1-.55 1.9-1.45 2.34L0 8.38v2.82c0 .99.81 1.8 1.8 1.8H5c0 .55.45 1 1 1s1-.45 1-1h3.2c.99 0 1.8-.81 1.8-1.8V8.38zM11 11.2c0 .44-.36.8-.8.8H1.8c-.44 0-.8-.36-.8-.8V10h5.5c.55 0 1-.45 1-1H1c1.23-.61 2-1.87 2-3.24V5c0-1.66 1.34-3 3-3s3 1.34 3 3v.76c0 1.37.77 2.62 2 3.24z" /></symbol>'});la().add(ca);const da=ca,ua=(0,vn.default)(oe.Icon).withConfig({displayName:"styled__StyledAlertDot",componentId:"sc-12w0ym-0"})(["position:absolute;top:0;right:-1px;width:6px;height:6px;"]);var ha=n(96026);const xa=(0,Gt.A)(e=>{let{alertName:t,close:n,tooltip:o,...s}=e;const[,a]=(0,Es.A)(),{sendLog:i}=(0,cn.A)(),l=(0,r.useCallback)(e=>{e.stopPropagation(),a({alertName:t}),i({feature:"MetricsChartManageAlerts",description:"Show alert",alertName:t}),n()},[t,a,n,i]);return(0,ie.jsx)(oe.IconButton,{icon:"goToNode",iconColor:"textLite",onClick:l,neutral:!0,padding:[0],width:"16px",height:"16px",...s})}),ga=(0,Gt.A)(e=>{let{alertName:t,nodes:n,close:o,tooltip:s,...a}=e;const{goToEdit:i}=(0,ha.q)({alertName:t,nodeIds:n}),{sendLog:l}=(0,cn.A)(),c=(0,r.useCallback)(e=>{e.stopPropagation(),l({feature:"MetricsChartManageAlerts",description:"Edit alert",alertName:t}),i(),o()},[n,o,i,l]);return(0,ie.jsx)(oe.IconButton,{icon:"pencilOutline",iconColor:"textLite",onClick:c,neutral:!0,padding:[0],width:"12px",height:"12px",...a})}),ma=e=>{let{item:{value:t,label:n,alerts:r={},nodes:o,onClick:s,...a},index:i,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,ie.jsxs)(oe.MenuItemContainer,{"data-index":i,onClick:e=>{s&&s(e)},...a,...u,style:l,alignItems:"center",justifyContent:"between",gap:2,padding:[1,2],overflow:"hidden",cursor:"default",children:[(0,ie.jsx)(oe.Flex,{width:{max:"180px"},alignItems:"center",children:(0,ie.jsx)(sn.A,{text:n,TextComponent:oe.Text})}),(0,ie.jsxs)(oe.Flex,{alignItems:"center",gap:1,children:[(0,ie.jsx)(oe.MasterCard,{pillLeft:m,pillRight:p,pillEnd:f}),(0,ie.jsx)(xa,{alertName:t,close:c,tooltip:"Show alert instances",tooltipProps:{align:"bottom"}}),(0,ie.jsx)(ga,{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 pa=n(39423),fa=n(57869);const ja=(0,tt.A)((0,Gt.A)(oe.Button)),ba=e=>{let{loaded:t,contexts:n=[],close:o,onAddAlertClick:s}=e;const a=(0,oa.useChart)().getId(),i=n?.[0],{setSelectedTab:l}=(0,pa.A)(),[c,d]=(0,io.Ay)(),{goToAlerts:u}=(0,fa.A)({flavour:"alerts"}),h=(0,r.useMemo)(()=>i?`View the active alerts for ${i} context`:"View the active alerts for this context",[i]),x=(0,r.useCallback)(()=>{i&&(l(0),o(),u({context:i}))},[i,u,l,c,d,o]),g=(0,r.useCallback)(()=>{s(),o()},[s,o]);return(0,ie.jsxs)(oe.Flex,{gap:2,padding:[2],border:{side:"top"},justifyContent:"center",children:[(0,ie.jsx)(ja,{feature:"MetricsChartManageAlerts",label:"Go to alerts",small:!0,flavour:"hollow",icon:"goToNode",onClick:x,tooltip:h,tooltipProps:{align:"bottom"},payload:{chartId:a},disabled:!i||!t}),(0,ie.jsx)(ja,{feature:"MetricsChartManageAlerts",label:"Add alert",small:!0,icon:"plus",onClick:g,tooltip:`Start adding a new alert on ${i} context`,tooltipProps:{align:"bottom"},payload:{chartId:a},disabled:!i||!t})]})};var va=n(12781);const ya=e=>{let{disabled:t}=e;const n=(0,oa.useChart)(),o=(0,E.ss)(),{loaded:s,items:a,status:i}=(e=>{const[t,n]=(0,r.useState)(),[o,s]=(0,r.useState)([]),[a,i]=(0,r.useState)([]),[l,c]=(0,r.useState)(),d=(0,An.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),i(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,i,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,a]),status:l}})(n),l=n.getAttribute("contextScope"),[,c]=(0,va.A)(),d=(0,r.useCallback)(()=>{const{selectedNodes:e,selectedInstances:t,labels:r,selectedLabels:o,contextScope:s}=n.getAttributes(),a=n.getUnitSign(),i=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:a,...(t||[]).length?{instances:t}:{},...(e||[]).length?{nodes:e}:{},...i?{labels:i}:{}})},[n,o,c]);return n?(0,ie.jsx)(oe.Menu,{dropProps:{align:{top:"bottom",right:"right"},"data-toolbox":n.getId()},dropdownProps:{width:"360px"},Item:ma,items:a,Footer:e=>{let{close:t}=e;return(0,ie.jsx)(ba,{loaded:s,contexts:l,close:t,onAddAlertClick:d})},children:(0,ie.jsxs)(oe.Flex,{alignItems:"center",position:"relative",children:[i?(0,ie.jsx)(ua,{name:"dot",color:i}):null,(0,ie.jsx)(ra.Button,{icon:(0,ie.jsx)(ra.default,{svg:da,size:"16px"}),title:"Manage alerts",disabled:t,"data-testid":"chartHeaderToolbox-manageAlerts"})]})}):null};var Ca=n(77879),wa=n(25147);const Ia=e=>{let{contexts:t=[]}=e;const n=(0,Ca.A)();return(0,r.useCallback)(async()=>{if(!t.length)return null;n({type:wa.tD.chart,data:{contexts:t}})},[t,n])};var Aa=n(40573);const ka=(0,vn.default)(oe.Flex).withConfig({displayName:"addToConversation__StyledContainer",componentId:"sc-1nawnhs-0"})(["&& svg{fill:",";}"],(0,oe.getColor)("primaryAI")),Sa=()=>{const e=(0,oa.useChart)(),t=(0,m.JT)("insights:CreateReport"),{isDemo:n}=(0,Aa.A)(),r=e.getAttribute("contextScope"),o=Ia({contexts:r});return L.ei||n||!t?null:(0,ie.jsx)(ka,{children:(0,ie.jsx)(ra.Button,{icon:(0,ie.jsx)(oe.Icon,{name:"conversationSubject",height:"16px"}),title:"Add to conversation",onClick:o,"data-testid":"chartHeaderToolbox-addToConversation"})})},Ma=(e,t,n)=>{let{width:o,host:s}=n;if(!s)throw"No host provided";const a=(0,Zt.eg)(),i=(0,r.useRef)(),l=(0,Te.aZ)(e,"error"),[{correlation:c},d]=(0,K.N9)(),{state:u,pathname:h}=(0,j.zy)(),x=(0,z.Xr)(ls),g=(0,Te.jI)(e),m=(0,Te.DQ)(e);(0,r.useLayoutEffect)(()=>{if(!e||!a||l)return;let n=a.getRoot().getChildren().find(e=>e.match({id:h}));if(!n)return n=a.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:[Sa,ya,ea.default,Ys.default,Zs.default,Xs.default,Qs.default,na.A,ta.A]}}),a.appendChild(n),x(h),i.current=n,(0,rs.unregister)(a.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)(()=>{i.current&&(i.current.setAttribute("containerWidth",o),i.current.getNodes().forEach(e=>e.updateAttribute("containerWidth",o)))},[i.current,o]),(0,jo.A)(()=>{i.current&&i.current.setAttribute("host",s)},[i.current,s]),(0,jo.A)(()=>{i.current&&i.current.getNodes().forEach(e=>{e.updateAttribute("nodesScope",t);e.getAttribute("active")&&"chart"===e.type&&e.fetch()})},[i.current,t]),(0,r.useEffect)(()=>{i.current&&i.current.getApplicableNodes({syncHighlight:!0}).forEach(e=>{e.updateAttribute("navigation",c?"highlight":"pan")})},[i.current,c]),(0,r.useEffect)(()=>()=>i.current&&i.current.destroy(),[]),(0,r.useEffect)(()=>{if(!i.current)return;if(!u||!u.context)return;const{context:e,chartId:t,nodeId:n}=u,r=i.current.getNode({id:e});r&&r.updateAttributes({selectedInstances:[`${t}@${n}`],selectedNodes:[n]});const o=t&&n&&i.current.on("chartLoaded",r=>{const s=r.getAttribute("id");e===s&&(r.updateAttributes({selectedInstances:[`${t}@${n}`],selectedNodes:[n]}),o())});return()=>u&&(0,rs.unregister)(o)},[i.current,u])};var Ta=n(43116);const Fa={default:{shouldHide:()=>!1},k8s:{shouldHide:e=>{let{context:t}=e;return!t.includes("k8s")}}},Na=[],La="ErrNoPreferredNodeRequested",Da=e=>(0,r.memo)(t=>{let{flavour:n="overview",nodeIds:o=Na,nodeId:s,...a}=t;const i=(0,v.vt)(),l=(0,y.ID)(),c=(0,y.XA)("nodeId");s=s||c;let d=(0,H.w7)({extraKey:n,merge:!1,scoped:!0});d=o.length?o:d;const{isNodeRestricted:u,loaded:h}=(0,un.A)();d=(0,r.useMemo)(()=>d.filter(e=>!u(e).restricted),[d,h]);const x=(0,B.nj)(),g=(0,Te._0)(l),{state:m}=(0,j.zy)(),p=(0,Te.R7)(l),f=(0,E.TG)(d),b=(0,Me.A)(l,d,{spaceId:i}),{contexts:C,metadata:w,loaded:I,dimensionsCount:A}=(0,bo.Yy)({nodeIds:d,flavour:n},i,l),[,k]=(()=>{const{state:e={}}=(0,j.zy)(),{alertId:t=null}=e||{},[n,o]=(0,An.KB)(),s=t||n?.id,a=(0,An.JL)(s);(0,An.yk)(a.id),(0,r.useEffect)(()=>{(a.fullyLoaded||a.id)&&o({...a,formattedLastStatusChangeValue:(0,Js.m3)(a.lastStatusChangeValue,a.units),linkToGo:(0,it.A)(a.context)})},[a.id,a.fullyLoaded]);const i=n?.id?(0,it.A)(n.context):null;return[a.id,i]})(),S=o?o.join():n,M=(0,te.K)({spaceId:i,roomId:l}),[T,{width:F}]=(0,V.A)();Ma(l,d,{host:M,width:F});const N=(0,Te.OL)(l),L=(0,Te.rx)(l),D=I?w:p,R=Fa[n]||Fa.default,$=(0,Te.bo)(l),O=(0,os.A)($),P=(0,oo.rq)(N,p,l,{...R,shouldHide:I?e=>{let{context:t}=e;return!C.includes(t)}:R.shouldHide,force:I||$!==O,cacheKey:`${n}-${A}-${S}`}),_=(0,Te.yO)(l,w),z=(0,os.A)(b,!0),G=P<1,[W,q]=(0,K.N9)("chartName",{key:l,extraKey:S,flavour:"val"});(0,r.useEffect)(()=>{l&&q(k||m?.chartName||W)},[l,k]);const U=cs(),J=Object.keys(D).length<1&&g||d.length&&!f.length,Z=(0,B.CK)(),X=L?.errorMsgKey==La;if(!J&&!1!==z&&b&&"No data for this period"!==b&&b!==La&&!Object.keys(D).length)return(0,ie.jsx)(Ta.A,{error:b});const Y=!!l&&x&&(!!U||X),{restricted:Q}=u(s);return(0,ie.jsx)(e,{nodeIds:f,loaded:Y,getChart:_,areChartsIdsEmpty:G,showNoNodesView:x&&!Z.length,showNoChartsView:J,initializing:b&&(0,qs.O)(b),chartName:W,setChartName:q,chartsLoaded:g&&!!F,invalidationKey:l,flavour:n,chartIds:I?C:N,widthRef:T,containerWidth:F,nodesKey:S,noPreferredNodesError:X,blurred:Q,blurProps:{value:"12px"},BlurredContent:()=>(0,ie.jsx)(Us.A,{flavour:c?"room":"node"}),...a})});var Ba=n(21785),Ra=n(72144),$a=n(75669),Va=n(39870),Oa=n(7761);const Pa=()=>{const e=(0,v.vt)(),t=(0,y.ID)(),n=(0,H.w7)({extraKey:"home",merge:!1,scoped:!0}),r=(0,Oa.kf)();(0,b.A)(()=>({enabled:!(!e||!t),force:!0,fetch:()=>(0,so.TM)(e,t,n),onReceive:e=>{let{data:t}=e;return r({...Va.ul,loaded:!0,...t})},onFail:e=>r({...Va.ul,loaded:!0,error:e}),pollingOptions:{pollingInterval:588e3}}),[e,t])},Ea=()=>{const e=(0,v.vt)(),t=(0,y.ID)(),n=(0,H.w7)({extraKey:"home",merge:!1,scoped:!0}),r=(0,Oa.xs)();(0,b.A)(()=>({enabled:!(!e||!t),force:!0,fetch:()=>(0,so.jt)(e,t,n),onReceive:e=>{let{data:t}=e;return r({...Va.ve,loaded:!0,...t})},onFail:e=>r({...Va.ve,loaded:!0,error:e}),pollingOptions:{pollingInterval:588e3}}),[e,t,n])};var Ha=n(74290),_a=n(56473),Ka=n(56523),za=n(24285),Ga=n(76571),Wa=n(97926),qa=n(17115),Ua=n(31246);const Ja=()=>{const{milestones:e,settingsLoaded:t}=(0,Ka.A)(),{completed:n}=e,o=(0,Wa.A)(),s=(0,qa.Ay)(),a=(0,m.Sk)(),i=(0,qa.Ex)(),l=(0,za.xd)("isLoaded"),c=(0,za.xd)("onboardingFormData"),d=(0,v.vt)(),u=(0,v.ap)("loaded"),h=(0,Ga.t5)(d,"channels"),x=(0,Ga.t5)(d,"loaded"),g=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=>(Ua.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&&!a[t.permission])&&(!(t.requiresLargeTeam&&!i)&&!(void 0!==t.maxChannels&&g>t.maxChannels))):t.isFeatureAnnouncement)}).slice(0,3).map(e=>e.channelAwareContent&&g>0?{...e,title:e.channelAwareContent.title,description:e.channelAwareContent.description}:e)},[n,o,s,a,i,g,t,x,u,l,c])};var Za=n(81187),Xa=n(4703);const Ya=e=>{let{description:t}=e;return`${(0,_a.PP)({extraKey:"runningAlerts"}).length} ${t}`},Qa=e=>{let{onDismiss:t}=e;const{dismissOnboarding:n,resetOnboarding:o,markTaskCompleted:s}=(0,Ka.A)(),a=Ja(),i=(0,Za.A)(),l=(0,r.useCallback)(e=>s(e.milestoneId,e.id),[s]),c=(0,r.useCallback)(()=>{n(),t?.()},[n,t]);return a.length?(0,ie.jsx)(oe.Flex,{column:!0,gap:4,children:(0,ie.jsxs)(oe.Flex,{column:!0,gap:4,background:"panelBg",border:!0,round:2,padding:[6],position:"relative",children:[(0,ie.jsx)(oe.IconButton,{icon:"x",neutral:!0,onClick:c,position:"absolute",top:"8px",right:"8px"}),(0,ie.jsxs)(oe.Flex,{column:!0,gap:1,children:[(0,ie.jsxs)(oe.Flex,{gap:2,alignItems:"center",children:[(0,ie.jsx)(oe.Icon,{name:"checkmark_partial_s",color:"success"}),(0,ie.jsx)(oe.Text,{strong:!0,children:"Continue your journey"})]}),(0,ie.jsx)(oe.TextSmall,{color:"textLite",children:"Here's what you can explore next"})]}),(0,ie.jsx)(oe.Flex,{column:!0,gap:2,children:a.map(e=>(0,ie.jsx)(Xa.A,{task:e,onClick:()=>i(e),onSkip:()=>l(e),children:e.dynamicDescription?(0,ie.jsx)(r.Suspense,{fallback:e.description,children:(0,ie.jsx)(Ya,{description:e.description})}):e.description},`${e.milestoneId}-${e.id}`))}),!1]})}):null};var ei=n(56171);const ti=[{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"}],ni=e=>{let{item:t,onNavigate:n}=e;return(0,ie.jsxs)(oe.Flex,{alignItems:"center",gap:2,width:"100%",children:[(0,ie.jsx)(oe.Icon,{name:t.icon,color:"main"}),(0,ie.jsxs)(oe.Text,{color:"main",children:[t.text," ",(0,ie.jsx)(ge.A,{color:"main",onClick:n,style:{textDecoration:"underline"},children:t.linkText})]})]})},ri=()=>{const e=(0,j.Zp)(),t=(0,v.bq)(),n=(0,y.QW)(),{dismissedBanners:o,dismissBanner:s}=(0,Ka.A)(),a=(0,r.useMemo)(()=>ti.find(e=>!o[e.id]),[o]),i=(0,r.useCallback)(()=>{a&&s(a.id)},[a,s]),l=(0,r.useCallback)(()=>{a?.route&&e(`/spaces/${t}/rooms/${n}/${a.route}`)},[e,t,n,a]);return a?(0,ie.jsx)(ei.A,{background:a.background,onClose:i,children:(0,ie.jsx)(ni,{item:a,onNavigate:l})}):null};var oi=n(58618),si=n(42964),ai=n(82507);const ii={Live:"live",Stale:"stale",Offline:"offline",Unseen:"unseen"},li=(0,vn.default)(oe.Flex).withConfig({displayName:"nodeHero__Container",componentId:"sc-t1z79b-0"})(["position:relative;width:320px;height:320px;"]),ci=(0,vn.default)(oe.Flex).withConfig({displayName:"nodeHero__ContentContainer",componentId:"sc-t1z79b-1"})(["position:absolute;inset:0;z-index:2;"]),di=e=>{let{nodeId:t}=e;const n=(0,j.Zp)(),r=(0,E.xY)(t),{loaded:o,metricsCollected:s=0}=(0,Oa.P9)(),a=(0,v.bq)(),i=(0,y.QW)(),l=(0,gt.GM)(r.state),c=ii[l]||"offline";return(0,ie.jsxs)(li,{children:[(0,ie.jsx)(si.A,{withOuties:!1}),(0,ie.jsx)(ai.A,{withOuties:!1}),(0,ie.jsxs)(ci,{column:!0,justifyContent:"center",alignItems:"center",gap:3,children:[(0,ie.jsx)(oe.TextBig,{color:"primary",children:r.nm}),(0,ie.jsxs)(oe.Flex,{gap:1,alignItems:"center",children:[(0,ie.jsx)(oe.Box,{width:"8px",height:"8px",round:"50%",background:c}),(0,ie.jsx)(oe.TextBig,{color:c,children:l})]})]}),(0,ie.jsxs)(oe.Flex,{column:!0,alignItems:"center",gap:2,position:"absolute",width:"100%",style:{bottom:"-60px"},children:[(0,ie.jsxs)(oe.TextBig,{children:[o?(0,oi.$t)(s):"..."," metrics collected"]}),(0,ie.jsx)(oe.Button,{label:"View your metrics",icon:(0,ie.jsx)(oe.Icon,{name:"arrow_right"}),iconSide:"right",onClick:()=>{n(`/spaces/${a}/rooms/${i}/overview`)}})]})]})},ui=(0,Gt.A)(oe.Icon),hi=e=>{let{title:t,icon:n,iconColor:r,...o}=e;return(0,ie.jsxs)(oe.Flex,{alignItems:"center",gap:2,...o,children:[n&&(0,ie.jsx)(oe.Icon,{name:n,...r?{color:r}:{}}),(0,ie.jsx)(oe.TextBig,{children:t})]})},xi={ErrNoEligibleNodeRequested:"There are no eligible nodes.",default:"Something went wrong."},gi=e=>{let{titleProps:t,loading:n,error:r,children:o,...s}=e;const a={padding:[4],gap:4,background:"panelBg",...t?{column:!0}:{}},i=r?xi[r.errorMsgKey]||xi.default:null;return(0,ie.jsxs)(oe.Flex,{...a,...s,children:[t?(0,ie.jsx)(hi,{...t}):null,n?(0,ie.jsx)(oe.Text,{textAlign:"center",children:"Loading..."}):r?null:(0,ie.jsx)(ie.Fragment,{children:o}),i?(0,ie.jsx)(oe.Flex,{width:"100%",justifyContent:"center",children:(0,ie.jsx)(ui,{name:"warning_triangle",size:"large",color:"text",tooltip:i})}):null]})},mi=e=>{let{title:t,value:n,loading:r}=e;return(0,ie.jsxs)(gi,{column:!0,alignItems:"center",justifyContent:"center",gap:2,padding:[4],width:"180px",children:[(0,ie.jsx)(oe.TextSmall,{color:"textLite",children:t}),(0,ie.jsx)(oe.TextHuge,{strong:!0,children:r?"...":(0,oi.$t)(n)})]})},pi=()=>{const e=(0,y.ID)(),t=(0,Te._0)(e),n=(0,Te.R7)(e),r=Object.keys(n||{}).length;return(0,ie.jsx)(mi,{title:"Charts Visualised",value:r,loading:!t})},fi=()=>(0,ie.jsx)(oe.Flex,{column:!0,gap:4,children:(0,ie.jsx)(pi,{})}),ji=()=>{const e=(0,_a.PP)({extraKey:"runningAlerts"});return(0,ie.jsx)(mi,{title:"Running Alerts",value:e.length,loading:!1})},bi=()=>(0,ie.jsx)(oe.Flex,{column:!0,gap:4,children:(0,ie.jsx)(r.Suspense,{fallback:(0,ie.jsx)(mi,{title:"Running Alerts",value:"...",loading:!0}),children:(0,ie.jsx)(ji,{})})}),vi=e=>{let{position:t}=e;return"left"===t?(0,ie.jsx)(fi,{}):(0,ie.jsx)(bi,{})},yi=()=>((0,Ba.A)(),(0,Ra.A)(),(0,$a.A)(),Pa(),Ea(),(0,Ha.A)(),null),Ci=e=>{let{nodeId:t}=e;return(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(yi,{}),(0,ie.jsx)(ri,{}),(0,ie.jsxs)(O.A,{gap:4,padding:[4],overflow:"auto",children:[(0,ie.jsxs)(oe.Flex,{gap:4,justifyContent:"center",alignItems:"center",children:[(0,ie.jsx)(vi,{position:"left"}),(0,ie.jsx)(di,{nodeId:t}),(0,ie.jsx)(vi,{position:"right"})]}),s.OH&&(0,ie.jsx)(Qa,{})]})]})};var wi=n(78953),Ii=n(29243);const Ai=(0,Ii.A)(e=>{let{nodesLoaded:t,total:n,count:o,live:s,offline:a,stale:i,unseen:l,...c}=e;const d=(0,r.useMemo)(()=>[...[{label:"Live",value:s,color:"success"},{label:"Offline",value:a,color:"offline"},{label:"Stale",value:i,color:"stale"}],...l?[{label:"Unseen",value:l,color:"unseen"}]:[]],[s,a,i,l]);return(0,ie.jsxs)(oe.Flex,{width:"100%",column:!0,alignItems:"center",gap:4,children:[(0,ie.jsxs)(oe.Flex,{gap:2,alignItems:"baseline",children:[t?(0,ie.jsx)(oe.TextHuge,{strong:!0,...c,children:o}):(0,ie.jsx)(oe.Text,{children:"Loading..."}),t&&n!==o&&(0,ie.jsxs)(oe.Text,{children:["of ",n]})]}),(0,ie.jsx)(wi.A,{data:d,numberIndicatorProps:{TitleComponent:oe.TextBig,NumberComponent:oe.TextBigger}})]})}),ki=e=>{const t=(0,B.nj)(),n=(0,B.CK)(),o=n.length,s=(0,H.eO)({keepAll:!1}),a=(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]),i=(0,r.useMemo)(()=>{const e=s?.length||"-";return{nodesLoaded:t,total:o,count:e,title:t&&s&&o!==e?"Selected nodes":"Total nodes",...a}},[t,n,s,o,a]);return(0,ie.jsx)(Ai,{...i,...e})};var Si=n(50916),Mi=n.n(Si);function Ti(e){return e*Math.PI/180}function Fi(e,t,n){return e>n?n:e<t?t:e}function Ni(e,t){return t/100*e}function Li(e,t){return e+t/2}function Di(e,t){const n=Ti(e);return{dx:t*Math.cos(n),dy:t*Math.sin(n)}}function Bi(e){return"number"===typeof e}function Ri(e,t){return"function"===typeof e?e(t):e}function $i({renderLabel:e,labelProps:t}){const n=e(t);if("string"===typeof n||"number"===typeof n){const{dataEntry:e,dataIndex:o,...s}=t;return r.createElement("text",{dominantBaseline:"central",...s},n)}return r.isValidElement(n)?n:null}function Vi({labelPosition:e,lineWidth:t,labelHorizontalShift:n}){const r=function(e){const t=1e14;return Math.round((e+Number.EPSILON)*t)/t}(n);if(0===r)return"middle";if(e>100)return r>0?"start":"end";return e<100-t?r>0?"end":"start":"middle"}function Oi(e,t){const{label:n}=t;if(n)return function(e,t){return e.map((e,n)=>{const r=Ri(t.segmentsShift,n)??0,o=Ni(t.radius,t.labelPosition)+r,{dx:s,dy:a}=Di(Li(e.startAngle,e.degrees),o);return{x:t.center[0],y:t.center[1],dx:s,dy:a,textAnchor:Vi({labelPosition:t.labelPosition,lineWidth:t.lineWidth,labelHorizontalShift:s}),dataEntry:e,dataIndex:n,style:Ri(t.labelStyle,n)}})}(e,t).map((e,t)=>r.createElement($i,{key:`label-${e.dataEntry.key||t}`,renderLabel:n,labelProps:e}))}function Pi({cx:e,cy:t,lengthAngle:n,lineWidth:o,radius:s,shift:a=0,reveal:i,rounded:l,startAngle:c,title:d,...u}){const h=s-o/2,{dx:x,dy:g}=Di(Li(c,n),a),m=function(e,t,n,r,o){const s=Fi(r,-359.999,359.999);return Mi()(e,t,o,Ti(n),Ti(n+s)).map(e=>e.join(" ")).join(" ")}(e+x,t+g,c,n,h);let p,f;if(Bi(i)){const e=Ti(h)*n;p=Math.abs(e),f=p-Ni(p,i)}return r.createElement("path",{d:m,fill:"none",strokeWidth:o,strokeDasharray:p,strokeDashoffset:f,strokeLinecap:l?"round":void 0,...u},d&&r.createElement("title",null,d))}function Ei(e,t,n){let r=`stroke-dashoffset ${e}ms ${t}`;return n&&n.transition&&(r=`${r},${n.transition}`),{transition:r}}function Hi(e,t){return e&&(n=>{e(n,t)})}function _i(e,t,n){const o=n??function({reveal:e,animate:t}){return t&&!Bi(e)?100:e}(t),{radius:s,center:[a,i]}=t,l=Ni(s,t.lineWidth),c=e.map((e,n)=>{const c=Ri(t.segmentsStyle,n);return r.createElement(Pi,{cx:a,cy:i,key:e.key||n,lengthAngle:e.degrees,lineWidth:l,radius:s,rounded:t.rounded,reveal:o,shift:Ri(t.segmentsShift,n),startAngle:e.startAngle,title:e.title,style:Object.assign({},c,t.animate&&Ei(t.animationDuration,t.animationEasing,c)),stroke:e.color,tabIndex:t.segmentsTabIndex,onBlur:Hi(t.onBlur,n),onClick:Hi(t.onClick,n),onFocus:Hi(t.onFocus,n),onKeyDown:Hi(t.onKeyDown,n),onMouseOver:Hi(t.onMouseOver,n),onMouseOut:Hi(t.onMouseOut,n)})});return t.background&&c.unshift(r.createElement(Pi,{cx:a,cy:i,key:"bg",lengthAngle:t.lengthAngle,lineWidth:l,radius:s,rounded:t.rounded,startAngle:t.startAngle,stroke:t.background})),c}const Ki={animationDuration:500,animationEasing:"ease-out",center:[50,50],data:[],labelPosition:50,lengthAngle:360,lineWidth:100,paddingAngle:0,radius:50,startAngle:0,viewBoxSize:[100,100]};function zi(e){const t=function(e){const t=Object.assign({},Ki,e);let n;for(n in Ki)void 0===e[n]&&(t[n]=Ki[n]);return t}(e),[n,o]=(0,r.useState)(t.animate?0:null);(0,r.useEffect)(()=>{t.animate&&o(null)},[]);const s=function({data:e,lengthAngle:t,totalValue:n,paddingAngle:r,startAngle:o}){const s=n||function(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n].value;return t}(e),a=Fi(t,-360,360),i=360===Math.abs(a)?e.length:e.length-1,l=Math.abs(r)*Math.sign(t),c=a-l*i;let d=0;const u=[];for(let h=0;h<e.length;h++){const t=e[h],n=0===s?0:t.value/s*100,r=Ni(c,n),a=d+o;d=d+r+l,u.push(Object.assign({percentage:n,startAngle:a,degrees:r},t))}return u}(t);return r.createElement("svg",{viewBox:`0 0 ${t.viewBoxSize[0]} ${t.viewBoxSize[1]}`,width:"100%",height:"100%",className:t.className,style:t.style},_i(s,t,n),Oi(s,t),t.children)}const Gi=(0,vn.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"}),Wi=(0,r.memo)(e=>{let{title:t,value:n,color:r,onClick:o=null}=e;return(0,ie.jsxs)(oe.Flex,{alignItems:"center",justifyContent:"between",width:"100%",gap:4,flex:{grow:1,shrink:0},children:[(0,ie.jsxs)(oe.Flex,{gap:1,children:[(0,ie.jsx)(oe.Flex,{width:"4px",height:"16px",background:r}),(0,ie.jsxs)(Gi,{whiteSpace:"nowrap",onClick:o,children:[t,o&&(0,ie.jsx)(oe.Icon,{color:"textLite",margin:[0,0,0,1],name:"nav_arrow_goto",height:"10px",width:"10px"})]})]}),(0,ie.jsx)(oe.Text,{strong:!0,children:n??"-"})]})}),qi=e=>{let{data:t}=e;return(0,ie.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,ie.jsx)(Wi,{title:n,value:r,color:o,onClick:s},`${n}-${r}-${t}`)})})},Ui=e=>{let{data:t,theme:n}=e;return t.map(e=>({...e,color:(0,oe.getColor)(e.color)({theme:n})}))},Ji=e=>{let{chartData:t=[],lineWidth:n=15,animate:o=!0,label:s,hasData:a}=e;const i=(0,r.useContext)(vn.ThemeContext);return(0,ie.jsxs)(oe.Flex,{gap:4,margin:[0,4],height:{min:"70px",max:"130px"},alignItems:"center",children:[(0,ie.jsx)(oe.Flex,{height:"70px",flex:{grow:1,shrink:1},children:a?(0,ie.jsx)(zi,{label:()=>s,labelStyle:{fontSize:"34px",fontWeight:700,lineHeight:"38px",fill:(0,oe.getColor)("textDescription")({theme:i})},labelPosition:0,data:Ui({data:t,theme:i}),lineWidth:n,animate:o}):(0,ie.jsx)(oe.Icon,{color:"border",name:"pie_chart_skeleton",width:"70px",height:"70px",alignSelf:"center"})}),(0,ie.jsx)(qi,{data:t})]})},Zi=(0,Ii.A)(e=>(0,ie.jsx)(oe.Flex,{gap:2,justifyContent:"between",padding:[2,0,0,0],children:(0,ie.jsx)(Ji,{...e})})),Xi=e=>{const t=(0,_a.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,Js.x7)(),a=(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,ie.jsx)(Zi,{title:"Active alerts",...a,...e})},Yi=()=>(0,ie.jsxs)(oe.Flex,{"data-testid":"home-nodes-overview-left-section",column:!0,gap:4,basis:"205px",children:[(0,ie.jsx)(ki,{}),(0,ie.jsx)(Qr.A,{}),(0,ie.jsx)(Xi,{})]});var Qi=n(63950),el=n.n(Qi),tl=n(31522),nl=n(41395);const rl=e=>{let{label:t,color:n}=e;return(0,ie.jsxs)(oe.Flex,{height:"24px",gap:1,alignItems:"center",children:[(0,ie.jsx)(oe.Flex,{width:"12px",height:"12px",background:n}),(0,ie.jsx)(oe.Text,{children:(0,nl.Zr)(t)})]})},ol=e=>{let{colorBy:t}=e;const n=Object.entries(tl.Cc[t?.value]||{}),r=tl.Ug[t?.value]||{};return n.length?(0,ie.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,ie.jsx)(rl,{label:r[t]||t,color:n},t)})}):null};var sl=n(64483);const al=(0,Gt.A)(oe.Icon),il=e=>{let{nodes:t=[],groupBy:n,setGroupBy:o=el(),colorBy:s,setColorBy:a=el(),onAddNode:i}=e;const l=(0,r.useMemo)(()=>(0,sl.zm)(t),[t]),c=(0,r.useMemo)(()=>(0,sl.Sd)(l).sort((e,t)=>e.value.localeCompare(t.value,void 0,{sensitivity:"accent",ignorePunctuation:!0})),[l]),d=(0,r.useMemo)(()=>[...tl.XJ,...c],[c]);return(0,ie.jsxs)(oe.Flex,{"data-testid":"home-nodes-overview-main-section-header",alignItems:"end",justifyContent:"between",children:[(0,ie.jsxs)(oe.Flex,{gap:3,alignItems:"end",children:[(0,ie.jsxs)(oe.Flex,{column:!0,gap:1,children:[(0,ie.jsxs)(oe.Flex,{alignItems:"center",gap:1,children:[(0,ie.jsx)(oe.Text,{color:"menuItem",children:"Group by"}),(0,ie.jsx)(al,{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,ie.jsx)(oe.Select,{isMulti:!0,options:d,value:n,onChange:o,...c?.length>0?{styles:{minWidth:"250px"}}:{}})]}),(0,ie.jsxs)(oe.Flex,{column:!0,gap:1,children:[(0,ie.jsx)(oe.Text,{color:"menuItem",children:"Color by"}),(0,ie.jsx)(oe.Select,{options:tl.Hn,value:s,onChange:a})]}),(0,ie.jsx)(ol,{colorBy:s})]}),(0,ie.jsx)(ve.A,{flavour:"borderless",icon:"add_node",iconColor:"text",onClick:i})]})};var ll=n(21421);const cl=()=>(0,ie.jsxs)(oe.Flex,{width:"100%",column:!0,gap:2,padding:[2,0],children:[(0,ie.jsxs)(oe.Flex,{gap:2,children:[(0,ie.jsx)(yn.A,{width:"22px",height:"22px",round:2}),(0,ie.jsx)(yn.A,{width:"22px",height:"22px",round:2}),(0,ie.jsx)(yn.A,{width:"22px",height:"22px",round:2}),(0,ie.jsx)(yn.A,{width:"22px",height:"22px",round:2}),(0,ie.jsx)(yn.A,{width:"22px",height:"22px",round:2}),(0,ie.jsx)(yn.A,{width:"22px",height:"22px",round:2})]}),(0,ie.jsxs)(oe.Flex,{gap:2,children:[(0,ie.jsx)(yn.A,{width:"22px",height:"22px",round:2}),(0,ie.jsx)(yn.A,{width:"22px",height:"22px",round:2}),(0,ie.jsx)(yn.A,{width:"22px",height:"22px",round:2}),(0,ie.jsx)(yn.A,{width:"22px",height:"22px",round:2}),(0,ie.jsx)(yn.A,{width:"22px",height:"22px",round:2}),(0,ie.jsx)(yn.A,{width:"22px",height:"22px",round:2})]})]}),dl=()=>{const[e,t]=(0,r.useState)([]),[n,o]=(0,r.useState)(tl.jZ),[s,a]=(0,r.useState)(),i=(0,y.ID)(),l=(0,B.gr)(i,"loaded"),c=(0,H.eO)({keepAll:!1}),d=(0,r.useCallback)(e=>{a(e)},[a]),u=(0,r.useCallback)(()=>a(),[a]);return(0,ie.jsxs)(oe.Flex,{"data-testid":"home-nodes-overview-main-section",column:!0,gap:4,basis:"calc(100% - 410px)",children:[(0,ie.jsx)(il,{nodes:c,groupBy:e,setGroupBy:t,colorBy:n,setColorBy:o,onAddNode:d}),(0,ie.jsx)(oe.Flex,{height:{max:150},overflow:{vertical:"auto"},children:l?(0,ie.jsx)(ll.A,{nodes:c,groupBy:e,colorBy:n,onAddNode:d}):(0,ie.jsx)(cl,{})}),s&&(0,ie.jsx)(ye.A,{nodeType:s?.type,onClose:u})]})},ul=()=>(0,ie.jsxs)(oe.Flex,{width:"100%",column:!0,gap:2,padding:[2,0],children:[(0,ie.jsxs)(oe.Flex,{justifyContent:"between",children:[(0,ie.jsx)(yn.A,{width:"30%"}),(0,ie.jsx)(yn.A,{width:"30%"}),(0,ie.jsx)(yn.A,{width:"30%"})]}),(0,ie.jsxs)(oe.Flex,{justifyContent:"between",children:[(0,ie.jsx)(yn.A,{width:"30%"}),(0,ie.jsx)(yn.A,{width:"30%"}),(0,ie.jsx)(yn.A,{width:"30%"})]}),(0,ie.jsx)(yn.A,{})]}),hl=()=>{const{loaded:e,totalChildren:t,totalParents:n,totalStandalone:o}=(0,Oa.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,ie.jsx)(wi.A,{numberIndicatorProps:{TitleComponent:oe.Text},data:s}):(0,ie.jsx)(ul,{height:"58px"})},xl=()=>(0,ie.jsxs)(oe.Flex,{width:"100%",column:!0,gap:2,padding:[2,0],children:[(0,ie.jsxs)(oe.Flex,{justifyContent:"between",children:[(0,ie.jsx)(yn.A,{width:"30%"}),(0,ie.jsx)(yn.A,{width:"30%"}),(0,ie.jsx)(yn.A,{width:"30%"})]}),(0,ie.jsxs)(oe.Flex,{justifyContent:"between",children:[(0,ie.jsx)(yn.A,{width:"30%"}),(0,ie.jsx)(yn.A,{width:"30%"}),(0,ie.jsx)(yn.A,{width:"30%"})]}),(0,ie.jsx)(yn.A,{})]}),gl=()=>(0,ie.jsxs)(oe.Flex,{column:!0,gap:1,alignItems:"center",width:"220px","data-testid":"nodesByDataReplication-information-text",overflow:"hidden",children:[(0,ie.jsxs)(oe.TextMicro,{children:[(0,ie.jsx)(oe.TextMicro,{strong:!0,children:"None:"})," The node's data are only on the node itself. Lose the node, lose the data!"]}),(0,ie.jsxs)(oe.TextMicro,{children:[(0,ie.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,ie.jsxs)(oe.TextMicro,{children:[(0,ie.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,ie.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."})]}),ml=()=>(0,ie.jsx)(ze.A,{isBasic:!0,plain:!0,content:gl,align:"bottom",children:(0,ie.jsx)(oe.Icon,{name:"information",color:"textDescription",size:"small"})}),pl=(0,Ii.A)(()=>{const e=(0,Oa.c8)(),{loaded:t,replicationFactor:n}=e||{},o=(0,r.useMemo)(()=>[{label:"None",value:n?.r_1||0,color:tl.q5.r_1},{label:"Single",value:n?.r_2||0,color:tl.q5.r_2},{label:"Multi",value:n?.["r_*"]||0,color:tl.q5["r_*"]}],[n]);return t?(0,ie.jsx)(wi.A,{data:o}):(0,ie.jsx)(xl,{})}),fl=()=>(0,ie.jsx)(pl,{title:"Data Replication",headerInfo:(0,ie.jsx)(ml,{})}),jl=()=>(0,ie.jsxs)(oe.Flex,{"data-testid":"home-nodes-overview-right-section",column:!0,gap:4,basis:"205px",children:[(0,ie.jsx)(hl,{}),(0,ie.jsx)(Qr.A,{}),(0,ie.jsx)(fl,{})]}),bl=()=>(0,ie.jsxs)(gi,{children:[(0,ie.jsx)(Yi,{}),(0,ie.jsx)(Qr.A,{vertical:!0}),(0,ie.jsx)(dl,{}),(0,ie.jsx)(Qr.A,{vertical:!0}),(0,ie.jsx)(jl,{})]});var vl=n(45614),yl=n(29474),Cl=n(54248);const wl={title:"Nodes with the most alerts in the last 24h"},Il=e=>{const t=(0,Oa.jg)();return t.loaded?(0,ie.jsxs)(gi,{"data-testid":"home-alert-nodes",titleProps:wl,...e,children:[(0,ie.jsx)(vl.A,{alertsStats:t}),(0,ie.jsx)(yl.A,{alertsStats:t}),(0,ie.jsxs)(oe.Flex,{column:!0,gap:4,children:[(0,ie.jsx)(oe.TextBig,{children:"Top alerts in the last 24 h"}),(0,ie.jsx)(Cl.A,{data:t?.alerts})]})]}):(0,ie.jsx)(u.nl,{})},Al={title:"Metrics available",justifyContent:"center"},kl=e=>{const{loaded:t,metricsCollected:n=0,error:r}=(0,Oa.P9)();return t?(0,ie.jsx)(gi,{"data-testid":"home-metrics",titleProps:Al,error:r?.response?.data,...e,children:(0,ie.jsx)(oe.Flex,{width:"100%",justifyContent:"center",children:(0,ie.jsx)(oe.TextHuge,{strong:!0,children:(0,oi.$t)(n)})})}):(0,ie.jsx)(u.Tr,{title:"Metrics available",...e})},Sl={title:"Charts visualized",justifyContent:"center"},Ml=e=>{const t=(0,y.ID)(),n=(0,Te._0)(t),r=(0,Te.rx)(t),o=(0,Te.R7)(t),s=Object.keys(o||{}).length;return n||r?(0,ie.jsx)(gi,{"data-testid":"home-charts-data",titleProps:Sl,error:r,...e,children:(0,ie.jsx)(oe.Flex,{width:"100%",justifyContent:"center",children:(0,ie.jsx)(oe.TextHuge,{strong:!0,children:(0,oi.$t)(s)})})}):(0,ie.jsx)(u.Tr,{...e})},Tl={title:"Alerts configured",justifyContent:"center"},Fl=e=>{const{loaded:t,value:n}=(0,An.oU)();return t?(0,ie.jsx)(gi,{"data-testid":"home-alerts-data",titleProps:Tl,...e,children:(0,ie.jsx)(oe.Flex,{width:"100%",justifyContent:"center",children:(0,ie.jsx)(oe.TextHuge,{strong:!0,children:(0,oi.$t)(n?.length||0)})})}):(0,ie.jsx)(u.Tr,{...e})};var Nl=n(46025);const Ll={title:"Data retention per Nodes"},Dl=e=>{const{dataRetention:t}=(0,Oa.P9)();return(0,ie.jsx)(gi,{"data-testid":"home-data-retention",titleProps:Ll,...e,children:(0,ie.jsx)(Nl.A,{dataRetention:t})})},Bl=()=>((0,Ba.A)(),(0,Ra.A)(),(0,$a.A)(),Pa(),Ea(),(0,Ha.A)(),null),Rl=new Date("2025-12-01").getTime(),$l=()=>{const e=(0,B.CK)(),t=(0,B.nj)(),n=(0,v.ap)("createdAt");if(!t)return(0,ie.jsx)(u.WV,{});if(!e.length)return(0,ie.jsx)($.Ay,{feature:"Home",mode:"NoNodesView",children:(0,ie.jsx)(R.A,{})});const r=new Date(n).getTime()>Rl;return s.OH&&1===e.length&&r?(0,ie.jsx)($.Ay,{feature:"Home",mode:"SingleNodeHome",children:(0,ie.jsx)(Ci,{nodeId:e[0]})}):(0,ie.jsxs)($.Ay,{feature:"Home",children:[(0,ie.jsx)(Bl,{}),(0,ie.jsxs)(O.A,{gap:4,padding:[4],overflow:"auto",children:[s.OH&&(0,ie.jsx)(Qa,{}),(0,ie.jsx)(bl,{}),(0,ie.jsxs)(oe.Flex,{gap:4,children:[(0,ie.jsx)(Il,{width:"60%"}),(0,ie.jsxs)(oe.Flex,{column:!0,gap:4,height:"100%",width:"calc(40% - 16px)",children:[(0,ie.jsxs)(oe.Flex,{gap:4,children:[(0,ie.jsx)(kl,{flex:{grow:"1",shrink:"0"}}),(0,ie.jsx)(Ml,{flex:{grow:"1",shrink:"0"}}),(0,ie.jsx)(Fl,{flex:{grow:"1",shrink:"0"}})]}),(0,ie.jsx)(Dl,{flex:"grow"})]})]})]})]})};var Vl=n(7234),Ol=n(89711);var Pl=n(84060),El=n(31035),Hl=n(1705),_l=n(2863),Kl=n(49916);var zl=n(14457),Gl=n(93933),Wl=n(15524);const ql=vn.default.div.withConfig({displayName:"styled__Separator",componentId:"sc-1fhfk7c-0"})(["background:",";height:20px;width:1px;"],(0,oe.getColor)("border")),Ul=e=>{let{flavour:t,...n}=e;const o=(0,E.nl)(),s=(0,kn.Xt)(o),{critical:a,warning:i}=(0,An.AO)(s),l=(0,K.Fw)("sidebarTab",{flavour:"val",extraKey:t}),c=(0,K.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,gt.t3)({count:a,type:"critical",...I}),k=(0,gt.t3)({count:i,type:"warning",...I}),S=(0,gt.GM)(f),M=(0,gt.Pg)(h.container,h.virtualization),T=(0,ns.A)("(min-width: 1760px)"),F=(0,E.TC)();return(0,ie.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,ie.jsx)(oe.TextSmall,{"data-testid":`singleNode-${m}`,strong:!0,children:m}),(0,ie.jsx)(St.A,{badge:"info","data-testid":"singleNode-nodeInfo-cta",children:(0,ie.jsx)(oe.IconButton,{flavour:"borderless",cursor:"pointer",onClick:()=>{F(u),d("info")},icon:"information",iconColor:"nodeBadgeColor",width:"18px",height:"18px"})}),(0,ie.jsx)(ql,{"data-testid":"singleNode-separator"}),(0,ie.jsx)(St.A,{badge:"alerts",nodeName:m,children:(0,ie.jsx)(oe.AlertMasterCard,{onClick:A.text||k.text?()=>F(u,{},"/alerts"):null,pillLeft:A,pillRight:k})}),(0,ie.jsx)(ql,{"data-testid":"singleNode-separator"}),(0,ie.jsx)(dn,{node:{id:u,name:m,isLive:g,capabilities:C},padding:[0,1]}),j&&(0,ie.jsx)(Ut.A,{"data-testid":"singleNode-update-cta",name:m,os:p.id,container:h.container,warningLevel:j,labels:b,version:v,text:j}),(0,ie.jsx)(ql,{"data-testid":"singleNode-separator"}),(0,ie.jsx)(St.A,{badge:"connectivity",connectivityState:S,"data-testid":"singleNode-connectivityStateInfo",nodeName:m,children:(0,ie.jsx)(oe.Pill,{flavour:"neutral",hollow:!0,children:S})}),(0,ie.jsx)(St.A,{badge:"type","data-testid":"singleNode-nodeTypeInfo",nodeName:m,nodeType:M.label,children:(0,ie.jsx)(oe.Pill,{flavour:"neutral",hollow:!0,icon:M.icon,children:M.label})}),T&&(0,ie.jsx)(St.A,{badge:"systemInfo","data-testid":"singleNode-systemInfo",nodeName:m,children:(0,ie.jsxs)(oe.Pill,{flavour:"neutral",hollow:!0,icon:lt.u[p.nm]?.iconName||lt.U[p.id]?.iconName||"os",children:[(0,gt.O)(h.cpuFrequency)," (",x," ",1===h.cpus?"Core":"Cores",") -"," ",(0,gt.RI)(h.memory)," RAM - ",(0,gt.RI)(h.diskSpace)]})}),(0,ie.jsx)(Kt.A,{flavour:"node",silencing:w})]})},Jl=()=>{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:"Live",icon:"live",path:`${e}/top`,dataGa:"view-picker::click-view-fn::global-overview",testId:"viewPicker-singleNode-fn",tooltip:{title:"Node Live View",description:"Live, on-demand insights including processes, network connections, database queries, topology maps & more"}},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 Zl=n(10444);const Xl=(0,vn.default)(oe.Box).attrs(e=>({width:"6px",height:"6px",round:"50%",...e})).withConfig({displayName:"withNotification__NotificationDot",componentId:"sc-ka7a4g-0"})([""]),Yl=e=>t=>{let{notificationBg:n,...r}=t;return n?(0,ie.jsxs)(oe.Flex,{position:"relative",gap:1,padding:[0,0,0,1.5],children:[(0,ie.jsx)(Xl,{background:n,position:"absolute",top:-2,left:0}),(0,ie.jsx)(e,{...r})]}):(0,ie.jsx)(e,{...r})};var Ql=n(9509);const ec=(0,Gt.A)(oe.NavigationTab),tc=(0,vn.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);}"]),nc=(0,vn.default)(oe.Icon).attrs({name:"long_arrow_up",color:"successText"}).withConfig({displayName:"tabLink__DropHereIcon",componentId:"sc-1h4dha1-0"})(["animation:"," 1s ease-in infinite;"],tc),rc=e=>{let{active:t,highlight:n,iconColor:r}=e;return r||(n||t?"primary":"textDescription")},oc=Yl(oe.Icon),sc=e=>{let{id:t,to:n,params:o,exact:s,icon:a,iconColor:i,title:l,fixed:c,dataGa:d,testId:u,children:h,type:x,tooltip:g,showBorderLeft:m,droppable:p,droppableProps:f={},ref:b,isDynamic:v,highlight:y,...C}=e;const{sendLog:w}=(0,cn.A)(),{onTabChange:I}=(0,Ql.D)(),{setNodeRef:A,active:k}=(0,Ge.zM)({id:`droppable-tab-${t}`,disabled:!p,data:f}),S=(0,j.RQ)(s?n:`${n}/*`),M=(0,j.Zp)(),F=(0,Zl.J)(),N=!!S,L="nodes"!==x||N,D=(0,r.useCallback)(()=>{if(N)return;const e=`${n}${o?`/${o}`:""}`;M(e),I(t),w({feature:"Navigation",description:"Single page navigation using static tabs",tab:t,path:e})},[t,n,N,o,I,w]),B=p&&k&&k.data.current?.dashboardable,R=(0,r.useRef)(),[$]=(0,T.m0)({tabId:t}),V=(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,ie.jsxs)(ec,{ref:(0,oe.mergeRefs)(A,b,R),fixed:c,active:N,showBorderLeft:m,icon:(0,ie.jsx)(oc,{name:a,size:"small",color:rc({active:N,highlight:y,iconColor:i}),notificationBg:$?.color}),onActivate:D,"data-ga":d,"data-testid":u,"aria-selected":N,...B&&{rootProps:{background:"successSemi",cursor:"alias"}},onMouseUp:V,tooltip:g||l,tooltipProps:{align:g?"bottom":"top",isBasic:"string"===typeof(g||l),...y?{color:"primary"}:{}},...C,children:[!F&&!!l&&(0,ie.jsx)(oe.Text,{alignSelf:"center",strong:y,color:rc({active:N,highlight:y,iconColor:i}),whiteSpace:"nowrap",children:l}),R.current&&B&&(0,ie.jsx)(oe.Drop,{target:R.current,align:{top:"bottom"},stretch:!1,hideShadow:!0,zIndex:1,children:(0,ie.jsx)(nc,{})}),L&&h]})},ac={singleNode:"singleNode",logs:"logs",top:"fn",feed:"feed",anomalies:"anomalies",default:"singleNode",alerts:"alerts"},ic=(0,r.memo)(()=>{const e=Jl(),t=(0,j.RQ)("/spaces/:spaceSlug/rooms/:roomSlug/nodes/:nodeId/:path"),n=t&&ac[t.params.path]||ac.default;return(0,ie.jsxs)(oe.Flex,{justifyContent:"start",alignSelf:"start",alignItems:"end",width:"100%",height:"100%",overflow:"auto",background:"mainBackground",children:[(0,ie.jsx)(Ul,{flavour:n,background:"mainBackground",border:void 0}),(0,ie.jsx)(oe.TabSeparator,{}),e.map((e,t)=>{let{id:n,icon:r,title:o,path:s,...a}=e;return(0,ie.jsx)(sc,{exact:!0,fixed:!0,to:s,icon:r,title:o,id:n,rootProps:{background:"mainBackground"},showBorderLeft:0===t,...a},`${n}-${t}`)})]})}),lc=ic;var cc=n(47413),dc=n(17178),uc=n(5722);const hc=()=>{const{active:e}=(0,Ge.fF)(),t=(0,m.JT)("dashboard:Create"),n=(0,v.dg)();return t&&e&&!n?(0,ie.jsx)(sc,{to:"",id:"plus",icon:"plus",fixed:!0,droppable:!0,droppableProps:{dropArea:!0,dashboardId:"new"},testid:"roomDropdownMenu-roomOptions",disabled:!t||n}):null},xc=e=>{let{title:t,path:n,children:o,index:s,ref:a,tooltip:i,type:l,id:c,...d}=e;const u=(0,An.JL)("alerts"===l?c:null,"name"),h=(0,An.JL)("alerts"===l?c:null,"instanceName"),x=(0,An.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"}:i},[l,i,t,u,h,g,m]);return(0,ie.jsx)(sc,{ref:a,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})},gc=e=>{let{staticPaths:t,...n}=e;const[r,o,s]=(0,cc.A)(t),a=(0,Wl.A)("horizontal");return(0,ie.jsx)(oe.BaseDraggableTabs,{onDragEnd:o,onTabClose:s,items:r,Item:xc,...n,ref:a})},mc=()=>(0,ie.jsx)(j.BV,{children:(0,ie.jsx)(j.qh,{path:"/spaces/:spaceSlug/rooms/:roomSlug/nodes/:nodeId/*",element:(0,ie.jsx)(lc,{})})}),pc=(0,r.memo)(()=>{const[e,t]=(0,dc.A)();return(0,uc.A)()?(0,ie.jsxs)(oe.NavigationTabs,{subTabs:(0,ie.jsx)(mc,{}),children:[e.map((e,t)=>{let{id:n,icon:r,title:o,path:s,...a}=e;return(0,ie.jsx)(sc,{fixed:!0,to:s,icon:r,title:o,id:n,...a},`${n}-${t}`)}),(0,ie.jsx)(oe.TabSeparator,{}),(0,ie.jsx)(gc,{staticPaths:t}),(0,ie.jsx)(hc,{})]}):null}),fc=pc,jc=()=>{const e=(0,Zt.eg)(),t=`/spaces/${(0,v.bq)()}/rooms/${(0,y.QW)()}/overview`,n=(0,j.Zp)();(0,r.useEffect)(()=>{if(e)return(0,rs.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])},bc=()=>(jc(),null);var vc=n(73937),yc=n(21885),Cc=n(65637),wc=n(88772),Ic=n(73980),Ac=n(45026);const kc=`dyncfg-edit-alet-warning-dismiss-${window.envSettings?.visitor}`,Sc={lineHeight:1.6},Mc=e=>{let{alertName:t,nodeIds:n=[]}=e;const s="true"===localStorage.getItem(kc),[a,,,i]=(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(kc,!0),i()},[l,i]);return a?(0,ie.jsx)(oe.Modal,{backdropContainerProps:{zIndex:"60"},backdropProps:{backdropBlur:!0},children:(0,ie.jsxs)(oe.ModalContent,{children:[(0,ie.jsx)(oe.ModalHeader,{children:(0,ie.jsx)(oe.H4,{children:"Editing Alerts"})}),(0,ie.jsx)(oe.ModalBody,{children:(0,ie.jsxs)(oe.Flex,{column:!0,gap:2,width:{max:120},children:[(0,ie.jsxs)(oe.TextBig,{...Sc,children:["You are about to edit the alert ",(0,ie.jsx)(oe.TextBig,{color:"primary",children:t}),d?(0,ie.jsxs)(ie.Fragment,{children:[" ","on node ",(0,ie.jsx)(oe.TextBig,{color:"primary",children:d}),h]}):null,"."]}),(0,ie.jsx)(oe.TextBig,{...Sc,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,ie.jsx)(oe.TextBig,{...Sc,children:'To apply an alert on all your currently connected nodes, edit it and select "Submit to Multiple Nodes".'}):(0,ie.jsx)(oe.TextBig,{...Sc,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,ie.jsxs)(oe.ModalFooter,{justifyContent:"between",children:[(0,ie.jsxs)(oe.Flex,{gap:2,alignItems:"center",children:[(0,ie.jsx)(oe.Checkbox,{checked:l,onChange:x}),(0,ie.jsx)(oe.TextBig,{children:"Don't show this again"})]}),(0,ie.jsx)(oe.Button,{type:"button",flavour:"hollow",label:"OK",textTransform:"uppercase",onClick:g})]})]})}):null},Tc=(0,r.memo)(()=>{const{node:e}=(0,vc.Z)(),{alertName:t,nodeIds:n,title:o}=(0,Ac.A)(),{loaded:s,tree:a}=(0,Cc.A)(n?{value:n?.[0]}:e),i=(0,r.useMemo)(()=>a?.[yc.$7]?.[o]||{},[a,o]),l=(0,r.useMemo)(()=>!!Object.keys(i||{}).length,[i]);return s&&t?(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(Ic.A,{flavour:"entity",title:o,entityProps:i,isOpen:l,isEditFromState:!0,renderChildren:e=>(0,ie.jsx)(wc.A,{id:o,...i,...e})},JSON.stringify({loaded:s,alertName:t,alertItemExists:l})),i?(0,ie.jsx)(Mc,{alertName:t,nodeIds:n}):null]}):null}),Fc=Tc,Nc=(0,r.memo)(()=>{const{node:e}=(0,vc.Z)(),{path:t}=(0,Cc.A)(e),n=(0,ln.sh)({node:e,path:t}),{entityProps:r,...o}=n||{};return n?(0,ie.jsx)(Ic.A,{id:n.template,flavour:"entity",title:`${n.template}:placeholder`,entityProps:{...r,...o},isNewItem:!0,formData:n.formData,renderChildren:e=>(0,ie.jsx)(wc.A,{...r,...e,id:n.template,isNewItem:!0})}):null}),Lc=Nc,Dc=(0,a.A)(()=>Promise.all([n.e(5638),n.e(2448)]).then(n.bind(n,52448)),"ManageSpaceRoute"),Bc=(0,a.A)(()=>n.e(2201).then(n.bind(n,52201)),"Trial"),Rc=(0,a.A)(()=>n.e(5302).then(n.bind(n,5302)),"PreferredNodesModal"),$c=(0,a.A)(()=>Promise.resolve().then(n.bind(n,61314)),"JoinSpace"),Vc=(0,a.A)(()=>n.e(7530).then(n.bind(n,17530)),"NoSpaceAccess"),Oc=(0,a.A)(()=>n.e(6333).then(n.bind(n,96333)),"EmptyRoom"),Pc=(0,a.A)(()=>n.e(1910).then(n.bind(n,11910)),"AlertView"),Ec=(0,a.A)(()=>n.e(7316).then(n.bind(n,74935)),"Anomalies"),Hc=(0,a.A)(()=>Promise.resolve().then(n.bind(n,52047)),"AlertsSmartboard"),_c=(0,a.A)(()=>n.e(2711).then(n.bind(n,82711)),"DashboardsOverview"),Kc=(0,a.A)(()=>Promise.all([n.e(4317),n.e(5877),n.e(6874),n.e(3873),n.e(4306)]).then(n.bind(n,95297)),"DashboardView"),zc=(0,a.A)(()=>Promise.all([n.e(2492),n.e(2882),n.e(4550),n.e(4795),n.e(5638),n.e(5647),n.e(4317),n.e(6874),n.e(5219),n.e(82),n.e(7986),n.e(7852)]).then(n.bind(n,27852)),"FunctionsView"),Gc=(0,a.A)(()=>Promise.all([n.e(4090),n.e(7817)]).then(n.bind(n,37817)),"Insights"),Wc=(0,a.A)(()=>Promise.all([n.e(4090),n.e(3808)]).then(n.bind(n,43808)),"InsightsReport"),qc=(0,a.A)(()=>n.e(2792).then(n.bind(n,32792)),"Onboarding"),Uc=(0,a.A)(()=>Promise.all([n.e(8791),n.e(9462)]).then(n.bind(n,89462)),"Integrations"),Jc=(0,a.A)(()=>Promise.all([n.e(4317),n.e(5877),n.e(1592)]).then(n.bind(n,92003)),"DropInDashboard"),Zc=(0,a.A)(()=>n.e(3185).then(n.bind(n,73185)),"Marketplace"),Xc=(0,a.A)(()=>n.e(677).then(n.bind(n,90677)),"AlertConfigAiModal"),Yc=(0,a.A)(()=>n.e(5325).then(n.bind(n,65325)),"GeoMapTab"),{demoSlug:Qc,demoDefaultRoomViews:ed,defaultRoomView:td,onboardingView:nd,integrationsView:rd}=g.A,od=Ws(Da(Gs)),sd=Da(Gs),ad=(0,r.memo)(()=>{const[e,t]=(0,io.Ay)(),n=Qc===e?ed[t]||ed.default:o.Ay&&t===o.Iy?o.kG:td;return(0,ie.jsxs)(r.Suspense,{fallback:(0,ie.jsx)(u.zj,{}),children:[(0,ie.jsx)(r.Suspense,{fallback:"",children:(0,ie.jsx)(Jc,{})}),(0,ie.jsx)(j.BV,{children:(0,ie.jsx)(j.qh,{path:"nodes/:nodeId/*",element:(0,ie.jsx)(Kr,{})})}),(0,ie.jsxs)(j.BV,{children:[(0,ie.jsx)(j.qh,{path:nd,element:(0,ie.jsx)(r.Suspense,{fallback:(0,ie.jsx)(u.NP,{}),children:(0,ie.jsx)(qc,{})})}),(0,ie.jsx)(j.qh,{path:rd,element:(0,ie.jsx)(r.Suspense,{fallback:(0,ie.jsx)(u.H$,{}),children:(0,ie.jsx)(Uc,{flavour:"settingsPage"})})}),(0,ie.jsx)(j.qh,{path:"nodes/:nodeId",element:(0,ie.jsx)(od,{})}),(0,ie.jsx)(j.qh,{path:"nodes/:nodeId/alerts",element:(0,ie.jsx)(Hc,{})}),(0,ie.jsx)(j.qh,{path:"nodes/:nodeId/anomalies",element:(0,ie.jsx)(r.Suspense,{fallback:(0,ie.jsx)(u.Bm,{}),children:(0,ie.jsx)(Ec,{})})}),(0,ie.jsx)(j.qh,{path:"nodes/:nodeId/top",element:(0,ie.jsx)(zc,{flavour:"fn"},"fn")}),(0,ie.jsx)(j.qh,{path:"nodes/:nodeId/logs",element:(0,ie.jsx)(zc,{flavour:"logs"},"logs")}),(0,ie.jsx)(j.qh,{path:"nodes/:nodeId/events",element:(0,ie.jsx)(zc,{flavour:"feed"},"feed")}),(0,ie.jsx)(j.qh,{path:"nodes",element:(0,ie.jsx)(_r,{})}),(0,ie.jsx)(j.qh,{path:"home",element:(0,ie.jsx)($l,{})}),(0,ie.jsx)(j.qh,{path:"overview",element:(0,ie.jsx)(sd,{})}),(0,ie.jsx)(j.qh,{path:"alerts/:alertId",element:(0,ie.jsx)(r.Suspense,{fallback:(0,ie.jsx)(u.xh,{}),children:(0,ie.jsx)(Pc,{})})}),(0,ie.jsx)(j.qh,{path:"alerts",element:(0,ie.jsx)(Hc,{})}),(0,ie.jsx)(j.qh,{path:"alarms/:alertId",element:(0,ie.jsx)(Pc,{})}),(0,ie.jsx)(j.qh,{path:"alarms",element:(0,ie.jsx)(j.C5,{replace:!0,to:`/spaces/${e}/rooms/${t}/alerts`})}),(0,ie.jsx)(j.qh,{path:"functions",element:(0,ie.jsx)(j.C5,{replace:!0,to:`/spaces/${e}/rooms/${t}/top`})}),(0,ie.jsx)(j.qh,{path:"dashboard",element:(0,ie.jsx)(Kc,{customDashboardId:o.LA})}),(0,ie.jsx)(j.qh,{path:"dashboards/:dashboardSlug",element:(0,ie.jsx)(r.Suspense,{fallback:(0,ie.jsx)(d.O2,{}),children:(0,ie.jsx)(Kc,{})})}),(0,ie.jsx)(j.qh,{path:"dashboards",element:(0,ie.jsx)(_c,{})}),(0,ie.jsx)(j.qh,{path:"kubernetes",element:(0,ie.jsx)(sd,{flavour:"k8s"})}),(0,ie.jsx)(j.qh,{path:"anomalies",element:(0,ie.jsx)(r.Suspense,{fallback:(0,ie.jsx)(u.Bm,{}),children:(0,ie.jsx)(Ec,{})})}),(0,ie.jsx)(j.qh,{path:"top",element:(0,ie.jsx)(zc,{flavour:"fn"},"fn")}),(0,ie.jsx)(j.qh,{path:"logs",element:(0,ie.jsx)(zc,{flavour:"logs"},"logs")}),(0,ie.jsx)(j.qh,{path:"events",element:(0,ie.jsx)(zc,{flavour:"feed"},"feed")}),s.ul&&(0,ie.jsx)(j.qh,{path:"geomap/*",element:(0,ie.jsx)(Yc,{})}),(0,ie.jsx)(j.qh,{path:`${p.p9}/:reportId`,element:(0,ie.jsx)(Wc,{})}),(0,ie.jsx)(j.qh,{path:"insights/*",element:(0,ie.jsx)(r.Suspense,{fallback:(0,ie.jsx)(u.BJ,{}),children:(0,ie.jsx)(Gc,{})})}),(0,ie.jsx)(j.qh,{path:"/",element:(0,ie.jsx)(j.C5,{replace:!0,to:`/spaces/${e}/rooms/${t}/${n}`})})]})]})}),id=()=>{const{isOnboardingPath:e,path:t}=(0,h.A)(),{isIntegrationsPath:n}=(0,zl.Q)(),[s,a]=(0,zl.A)(),l=(0,v.vt)(),c=(0,y.ID)(),d=(0,i.I)(),x=(0,B.gr)(c,"ids"),g=(0,B.gr)(c,"loaded"),m=(0,v.bE)(l,"isEmpty"),p=(0,r.useMemo)(()=>!0===g&&!x.length,[g,x]),b=(0,o.Az)(l);return(0,zr.A)(l,c),(0,Gr.A)({spaceId:l,id:c,pollingInterval:63e3}),(0,Wr.A)(l,c),(0,qr.A)(l,c),(0,Ur.A)(l,c),function(e,t){let{types:n,entities:o,paths:s,names:a}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=(0,f.yF)((r,i)=>{(0,Ol.Uc)(e,t,{types:n,entities:o,paths:s,names:a}).then(n=>{let{data:r}=n;i((0,ee.Mg)({spaceId:e,roomId:t}),r),i((0,Se.n_)({spaceId:e,roomId:t})),i((0,fe.n_)({spaceId:e,roomId:t})),i((0,Vl.w7)({spaceId:e,roomId:t}),!0)})});(0,r.useEffect)(()=>{e&&t&&i()},[e,t,n,o,s,a])}(l,c),D(),(0,r.useEffect)(()=>{b||a||d||m(s)},[b,s,d,a,m]),d?(0,ie.jsx)(r.Suspense,{fallback:"",children:(0,ie.jsx)(Zc,{subCallback:d})}):a?(0,ie.jsx)(u.Qk,{}):b||!s||!t||e||n?!p||e||n?(0,ie.jsx)(ad,{}):(0,ie.jsx)(Oc,{}):(0,ie.jsx)(j.C5,{to:t,replace:!0})},ld=(0,c.Xc)((0,r.memo)(()=>{const e=(0,m.JT)("space:Read"),t=(0,m.JT)("room:Read");return e?(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(fc,{}),(0,ie.jsx)(r.Suspense,{fallback:(0,ie.jsx)(u.Qk,{}),children:(0,ie.jsxs)(j.BV,{children:[(0,ie.jsx)(j.qh,{path:"spaces/:spaceSlug/join-space",element:(0,ie.jsx)($c,{})}),(0,ie.jsx)(j.qh,{path:"spaces/:spaceSlug/no-rooms",element:(0,ie.jsx)(Vc,{reason:"noRooms"})}),(0,ie.jsx)(j.qh,{path:"spaces/:spaceSlug/settings/*",element:(0,ie.jsx)(cd,{})}),(0,ie.jsx)(j.qh,{path:"spaces/:spaceSlug/rooms/:roomSlug/*",element:t?(0,ie.jsx)(id,{}):(0,ie.jsx)(Vc,{reason:"noRoomPermission"})})]})})]}):(0,ie.jsx)(Vc,{reason:"noSpacePermission"})})),cd=()=>((0,io.KI)(),(0,ie.jsx)(Dc,{})),dd=()=>{const e=(0,v.vt)();return(0,Pl.A)(e),(0,El.A)(e),(e=>{const t=(0,f.yF)((0,r.useCallback)(function(t,n){let{data:{results:r}}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n((0,_l.S)({id:e}),r)},[e])),n=(0,f.yF)((0,r.useCallback)((t,n,r)=>{n((0,_l.S)({id:e,key:"error"}),r)},[e])),o=(0,Kl.sC)(e,"loaded"),s=(0,m.JT)("alert:ReadAll");(0,b.A)(()=>({enabled:s&&!!e&&o,fetch:()=>(0,Hl.C2)(e),onFail:n,onReceive:t}),[e,!!o,s])})(e),null},ud=(0,c.Xc)(()=>{const e=(0,v.vt)();return(0,Gl.Ay)(),(0,r.useEffect)(()=>{const e=(0,l.A)(new URL(window.location.href).searchParams.get("join_callback"));e&&(window.location.href=e)},[]),e?(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(dd,{}),(0,ie.jsx)(x.A,{permission:"space:Read",children:t=>t?(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(j.BV,{children:(0,ie.jsx)(j.qh,{path:"/*",element:(0,ie.jsx)(bc,{})})}),(0,ie.jsx)(r.Suspense,{fallback:(0,ie.jsx)(u.Qk,{}),children:(0,ie.jsx)(ld,{})})]}):(0,ie.jsx)(Vc,{reason:"noSpacePermission"},e)}),(0,ie.jsx)(r.Suspense,{fallback:"",children:(0,ie.jsx)(Bc,{})}),(0,ie.jsxs)(r.Suspense,{fallback:"",children:[(0,ie.jsx)(Rc,{}),(0,ie.jsx)(Lc,{}),(0,ie.jsx)(Fc,{}),(0,ie.jsx)(Xc,{})]})]}):(0,ie.jsx)(u.Qk,{})})},90901(e,t,n){n.d(t,{I:()=>c,q:()=>l});n(98992),n(8872);var r=n(96540),o=n(76667),s=n(24013),a=n(19186);const i=(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,i(n,e)]:t.incapable=[...t.incapable,i(n,e)],t},{predicting:[],incapable:[]}),[t.length,e])},c=e=>{const t=(0,o.Zp)(),n=(()=>{const e=(0,a.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])}},27496(e,t,n){n.d(t,{n:()=>a});var r=n(14963),o=n(4719),s=n(74848);const a=(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}})},95836(e,t,n){n.d(t,{$:()=>u});var r=n(38429),o=n(45087),s=n(4719),a=n(80914),i=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,a.A)(e=>{let{hasTooltip:t,hasInfo:n,...r}=e;return t&&n?(0,l.jsx)(o.A,{content:(0,l.jsx)(i.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}})},69001(e,t,n){n.d(t,{h:()=>s});var r=n(38429),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})}},75144(e,t,n){n.d(t,{X:()=>a});var r=n(4719),o=n(14963),s=n(74848);const a=(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}})},63996(e,t,n){n.d(t,{t:()=>h});var r=n(96540),o=n(38429),s=n(45087),a=n(4719),i=n(80914),l=n(75144),c=n(74848);const d=e=>{let{name:t,level:n,descendantIds:s,enableFavourites:a,ref:i,...l}=e;const d=(0,r.useMemo)(()=>Array.from(Array(n)).fill("-").join(""),[n]),u=(0,r.useMemo)(()=>a?`${d} ${t}`:t,[a,d,t]),h=(0,r.useMemo)(()=>({...!a||s?.length&&!l?.selfChartIds?.length?{}:{color:"primary"},...l}),[s,l]);return"string"===typeof t?(0,c.jsx)(o.Text,{strong:!0,ref:i,...h,children:u}):t||null},u=(0,i.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,a.aV)(u,e=>{let{name:t,info:n,...r}=e;return{name:t,hasInfo:!!n,...r}})},54025(e,t,n){n.d(t,{t:()=>s});var r=n(38429),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})}},14963(e,t,n){n.d(t,{A:()=>i});var r=n(96540),o=n(38429),s=n(50239),a=n(74848);const i=e=>{let{children:t,onClick:n,...i}=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,a.jsx)(o.TextSmall,{color:"textDescription",dangerouslySetInnerHTML:{__html:t},onClick:c,...i}):t||null}},30863(e,t,n){n.d(t,{A:()=>B});n(98992),n(54520),n(81454);var r=n(96540),o=n(38429),s=n(73700),a=n(69457),i=n(51220),l=n(24582),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);n(74423);var g=n(882),m=n(85088),p=n(33962),f=n(4719),j=n(56876),b=n(80914),v=n(74848);const y=(0,r.memo)(e=>{let{id:t,name:n,icon:s,isLast:a}=e;const{onMenuClick:i}=(0,j.A)(),l=(0,r.useCallback)(()=>{i({id:t})},[t,i]),c=(0,r.useMemo)(()=>({alignItems:"center",gap:1,...a?{}:{cursor:"pointer",onClick:l}}),[a,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})]}),a?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:a,icon:i,parentMenus:l}=t||{},c=(0,r.useMemo)(()=>[...l||[],{id:n,name:s||a,icon:i}],[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 a=(0,p.W2)(),i=(0,f.b)(a),l=(0,r.useContext)(g.ThemeContext);return!I.includes(t)&&i?(0,v.jsxs)(w,{background:(0,o.getRgbColor)("mainBackground",.8)({theme:l}),children:[(0,v.jsx)(C,{menu:i}),(0,v.jsx)(b.G,{menuId:a,menuName:i.shortName||i.name,hasFilters:s,flavour:t,parentIds:i.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",M="1px 2px",T={root:M,submenu:M,default:S},F=[{flavour:"root",id:"System-0"}],N=(0,r.memo)(e=>{let{getComponent:t,element:n,index:o,...s}=e;const a=(0,r.useMemo)(()=>n&&t(n),[n?.id,o]),i=(0,r.useMemo)(()=>!!F.find(e=>{let{id:t,flavour:r}=e;return t===n.id&&r===n.flavour}),[n]);return!a||i?null:(0,v.jsx)(a,{...n,index:o,...s,isVisible:!0},n.id)}),L=(0,r.memo)(e=>{let{flavour:t,elements:n,onScroll:a,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 a=e.findIndex(e=>e.id===n.current.id);if(-1===a)return;const i=r.getMeasurements()?.[a];if(!i)return;const{start:l}=i;return r.scrollToOffset(l+o.current),clearTimeout(u),void(u=setTimeout(()=>s.current=5,200))}t.current=e.length;const a=r.scrollOffset;let i=0;const l=r.getMeasurements().find(e=>(i+=e.size,i>a));l&&(n.current=e[l.index],o.current=a-l.start)},[e])})(n),I=(0,r.useRef)(),[A,M]=(0,r.useState)(0),F=((e,t,n)=>{let{stickyRef:o,nextStickyRef:s,tmpStickyRef:a}=n;const i=(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 i.current;if(!t)return i.current=(0,h.vp)(e),i.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!==a.current&&(n=[...n,a.current]),isNaN(o.current)?i.current=[...new Set(n)].sort((e,t)=>e-t):i.current=[...new Set([o.current,...n])].sort((e,t)=>e-t),i.current},[e,t])})(n,f,{stickyRef:m,nextStickyRef:p,tmpStickyRef:j}),L=(0,i.Te)({count:n.length,getScrollElement:()=>C.current,overscan:2,enableSmoothScroll:!1,estimateSize:e=>n[e].size,onChange:w,rangeExtractor:F,scrollPaddingStart:0});I.current=L,(0,c.A)(L,n);const D=(0,r.useCallback)((0,s.n)(100,function(){a(...arguments),C.current&&M(C.current.scrollTop)}),[a]);return(0,v.jsxs)("div",{ref:C,style:{minHeight:"100%",width:"100%",overflow:"auto"},onScroll:D,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)(N,{...l,element:n[m.current],index:m.current,getComponent:d})},m.current),L.getVirtualItems().map(e=>{const t=T[n[e.index].flavour]||T.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)(N,{...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),D=e=>{let{flavour:t,onActiveMenuId:n,getComponent:o,dashboardOptions:s,initialChartName:i,checkVisibility:c,...u}=e;const h=(0,l.bD)(),x=(0,a.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,a.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)(),i=(0,r.useRef)(),l=(0,r.useCallback)(e=>!!o[e],[o]),c=(0,r.useCallback)(e=>s.current===e,[]);return[{stickyRef:s,nextStickyRef:i,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,i]),(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})},B=(0,r.memo)(D)},48106(e,t,n){n.d(t,{A:()=>d});n(74423),n(98992),n(72577);var r=n(96540),o=n(69457),s=n(4719),a=n(50239),i=n(66814);const l=e=>{const t=(0,r.useRef)();return(0,i.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)(),i=l(s.tu),d=l(o.i8),u=(0,a.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:function(e){let{leaf:t=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=Object.values(i.current).find(t=>t.link&&t.link===e);if(n)return h.goToElement(n.id,{leaf:t});if(d.current){const n=Object.values(d.current).find(t=>t.link&&t.link.includes(e));if(n)return h.goToElement(n.id,{leaf:t})}}}),[n,t]);return(0,r.useLayoutEffect)(()=>{u(h)},[h]),h}},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(76667),s=n(42790),a=n(61841),i=n(24609),l=n(24013),c=n(19075),d=n(91421);const u=e=>{let{alertId:t,alertName:n,nodeIds:s=[]}=e;const i=(0,o.Zp)(),{setState:u}=(0,d.$h)(),[h]=(0,a.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,i]),error:b?.errorMessage||b}},h=()=>{const e=(0,o.Zp)(),{slug:t}=(0,i.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])}},27024(e,t,n){n.d(t,{A:()=>M});var r=n(96540),o=n(38429),s=n(31141),a=n(32788),i=n(29263),l=n(47410),c=n(16866),d=n(24609),u=n(87398),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:a,name:i}=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 ${i}`),h()}}),b=l&&g,k=(0,d.ns)(n,"slug"),S=(0,x.wz)(s,"slug"),M=(0,m.nM)(t),T=(0,C.A)(l&&t,{spaceId:n,spaceSlug:k,roomId:s,roomSlug:S}),F=(0,u.eg)();(0,r.useEffect)(()=>{if(T||!b)return;const e=F.getNode({id:a}),t=(0,I.h)(e.getAttributes());M(t.contextScope,t,()=>setTimeout(j,100))},[b,T]);const N=l&&(f||T);return(0,A.jsx)(o.Button,{icon:"plus",onClick:c,isLoading:N,disabled:N,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})}}]},M=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),[M,T]=(0,r.useState)(""),[F,N]=(0,r.useState)(!1),L=M.length>0,D=(0,m.W6)(y,n,{onSuccess:t}),B=(0,u.eg)().getNode({id:w}),R=(0,r.useMemo)(()=>S({spaceId:y,roomId:n,chartId:w}),[y,n,w]),$=()=>{if(!B)return;const{aggregationMethod:e,selectedDimensions:t,groupBy:n,groupByLabel:r,groupingMethod:o,chartType:s,selectedLabels:a,nodesScope:i,selectedInstances:l,selectedNodes:c,contextScope:d}=B.getAttributes(),[u]=d;D(M,d,{...(0,j.L)(u),aggregationMethod:e,selectedDimensions:t,groupBy:n,groupByLabel:r,groupingMethod:o,chartType:s,selectedLabels:a,nodesScope:i,selectedInstances:l,selectedNodes:c})},V=(0,g.RQ)();return(0,A.jsxs)(a.GO,{onClose:t,children:[(0,A.jsx)(i.z,{onClose:t,title:"Add to Dashboard"}),(0,A.jsx)(l.U,{children:"Select Dashboard"}),(0,A.jsxs)(a.Yv,{gap:3,overflow:"hidden",height:"100%",children:[(0,A.jsxs)(o.H6,{children:["Add chart to one or more dashboards from the ",v]}),V?(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:M,label:"Name",onChange:e=>T(e.target.value),isValid:F,setIsValid:N,isDirty:L,instantFeedback:"all",onKeyDown:e=>e.keyCode===c.I7&&F&&$}),(0,A.jsx)(o.Button,{label:"Create & add",onClick:$,disabled:!B||!M})]})]})]})}},55048(e,t,n){n.d(t,{A:()=>c});n(98992),n(54520);var r=n(96540),o=n(46587),s=n(24609),a=n(19186),i=n(81685),l=n(79022);const c=()=>{const e=(0,o.NJ)(),t=(0,s.vt)(),n=(0,a.ID)(),[,c]=(0,i.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]}},42318(e,t,n){n.d(t,{A:()=>i});var r=n(96540),o=n(61661),s=n(6988),a=n(32465);const i=()=>{const e=(0,o.AR)(),t=(0,a.A)(),[n,i]=(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:i}}},51318(e,t,n){n.d(t,{A:()=>a});var r=n(96540),o=n(61661),s=n(89942);const a=()=>{const e=(0,s.PP)(),[t,n]=(0,o.XL)(),{reset:a}=(0,o.b8)(),i=(0,r.useCallback)(()=>{a(),(0,s.Z8)({...e,integrationsModalOpen:"true"}),n("true")},[a,n,e]);return{isIntegrationsVisible:t,hideIntegrations:(0,r.useCallback)(()=>{(0,s.Z8)({...e,integrationsModalOpen:""}),n("")},[e,n]),onIntegrationsClick:i}}},4703(e,t,n){n.d(t,{A:()=>u});var r=n(882),o=n(38429),s=n(74891),a=n(74848);const i=(0,s.A)(o.IconButton),l=(0,r.default)(i).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:i}=e;return(0,a.jsxs)(c,{completed:n,onClick:r,children:[(0,a.jsx)(d,{completed:n,children:n&&(0,a.jsx)(o.Icon,{name:"check",color:"primary",width:"32px",height:"32px"})}),(0,a.jsxs)(o.Flex,{column:!0,gap:1,flex:!0,children:[(0,a.jsx)(o.Text,{strong:!0,color:n?"textLite":void 0,children:t.title}),(0,a.jsx)(o.TextSmall,{color:n?"textNoFocus":"textLite",children:i||t.description})]}),!n&&s&&(0,a.jsx)(l,{onClick:e=>{e.stopPropagation(),s?.()}})]})}},97926(e,t,n){n.d(t,{A:()=>u});var r=n(96540),o=n(41716),s=n(10602),a=n(67294),i=n(24609),l=n(86706),c=n(41258),d=n(31246);const u=()=>{const e=(0,s.nj)(),t=(0,s.CK)(),n=(0,o.s)("ids")||[],u=(0,o.s)("loaded"),h=(0,i.vt)();(0,c.A)(h);const x=(0,l.Gi)(),g=(0,l.gk)(),m=(0,a.q)(),p=(0,a.RQ)();return(0,r.useMemo)(()=>e&&u&&g&&p?{[d.aL.welcome]:!0,[d.aL.firstNodeConnected]:t.length>=1,[d.aL.firstAlertTriggered]:n.length>=1,[d.aL.secondNodeConnected]:t.length>=2,[d.aL.threeOrMoreNodes]:t.length>=3,[d.aL.firstTeamMemberInvited]:Array.isArray(x)&&x.length>1,[d.aL.firstDashboardCreated]:Array.isArray(m)&&m.length>=1}:null,[e,t.length,u,n.length,g,x,p,m])}},74290(e,t,n){n.d(t,{A:()=>h});n(74423),n(98992),n(23215),n(54520),n(81454),n(8872);var r=n(96540),o=n(24285),s=n(99728),a=n(24609),i=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,a.vt)(),v=(0,a.ap)("loaded"),y=(0,i.t5)(b,"channels"),C=(0,i.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:a}=t;return(u.a7[e]||[]).filter(e=>a?!!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 a=o.tasks||{};return s.every(e=>a[e.id])&&e.push(r),e},[]);r.length&&n(r)},[w,C,I,p,n,m,e.completed,g,h,v,f])}},81187(e,t,n){n.d(t,{A:()=>j});var r=n(96540),o=n(76667),s=n(34843),a=n(24609),i=n(41716),l=n(19186),c=n(67294),d=n(92726),u=n(14070),h=n(59378),x=n(51318),g=n(42318),m=n(78069),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,a.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,i.s)("ids"),[,S]=(0,u.A)(),M=(0,c.q)(),T=(0,d.fz)(M?.[0],"slug"),F=(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(F(t)&&v(t.milestoneId,t.id));if(t.openAiPanel)return w(),void(F(t)&&v(t.milestoneId,t.id));if(t.openProfileModal)return I(t.openProfileModal),t.spotlight?void A({...t.spotlight,taskId:t.id,milestoneId:t.milestoneId,targetPath:location.pathname}):void(F(t)&&v(t.milestoneId,t.id));if(t.openFirstDashboard&&T)return r=`/spaces/${j}/rooms/${b}/dashboards/${T}`,n(r),t.spotlight?void A({...t.spotlight,taskId:t.id,milestoneId:t.milestoneId,targetPath:r}):void(F(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}):F(t)&&v(t.milestoneId,t.id)},[e,n,j,b,v,y,C,w,I,A,k,S,T,F])}},17115(e,t,n){n.d(t,{Ay:()=>c,Ex:()=>l});var r=n(96540),o=n(24285),s=n(19186),a=n(31246);const i=()=>{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?a.JF.homelabber:"Work"===r?t>2||n>=50?a.JF.largeOrg:a.JF.smallOrg:a.JF.homelabber},[e?.usageType,t,n])},l=()=>{const e=i(),t=(0,s.XA)("memberCount")||0;return e===a.JF.largeOrg&&t>10},c=i},80914(e,t,n){n.d(t,{G:()=>$,A:()=>V});var r=n(882),o=n(38429),s=n(78152),a=(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)),i=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(96175),m=n(14088),p=n(72491),f=n(45087),j=n(74848);const b=(0,r.default)(o.Flex).attrs({background:"modalBackground",backgroundOpacity:.6}).withConfig({displayName:"contextSearch__ModalContainer",componentId:"sc-93w1u0-0"})(["backdrop-filter:blur(8px);"]),v=(0,a.memo)(e=>{let{parentIds:t,allFilters:n,onGoToParent:r}=e;const s=(0,a.useMemo)(()=>t?.find(e=>n[e]&&Object.keys(n[e]).length>0)||null,[t,n]),i=(0,h.b)(s);if(!s||!i)return null;const l=i.shortName||i.name||"parent section";return(0,j.jsx)(f.A,{content:`Go to ${l}`,align:"bottom",children:(0,j.jsx)(o.IconButton,{icon:"arrowUp",flavour:"borderless",onClick:()=>r(s),padding:[0],small:!0})})}),y=(0,a.memo)(e=>{let{menuId:t,parentIds:n,activeMenuId:r,onMenuChange:s}=e;const i=((e,t)=>{const n=(0,h.b)(e),r=(0,h.yy)(),o=(t||[]).map(e=>r[e]).filter(Boolean);return(0,a.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,j.jsx)(o.Menu,{value:r,items:i,onChange:s,dropProps:{align:{top:"bottom",left:"left"}},dropdownProps:{width:"200px"},caret:!0,padding:[0],small:!0})}),C=(0,a.memo)(e=>{let{menuId:t,onClose:n,flavour:r,parentIds:s,onGoToParent:i}=e;const[l,d]=(0,a.useState)(t),u=(0,h.b)(l),C=(0,x.X)(),{filters:w,addFilter:I,removeFilter:A,clearFilters:k}=(0,x.w)(u?.contexts,l),{searchValue:S,setSearchValue:M,debouncedSearchValue:T,searchResults:F,isLoading:N,onSelectResult:L}=(0,m.A)(u,I,r),D=(e,t)=>w.some(n=>n.matchType===e&&n.value===t),B=(e,t)=>{if(D(e,t.value)){const n=w.find(n=>n.matchType===e&&n.value===t.value);A(n)}else L(e,t)};return(0,j.jsx)(o.Layer,{onClickOutside:n,onEsc:n,children:(0,j.jsxs)(b,{column:!0,border:!0,round:1,width:{base:"600px",max:"100%"},overflow:"hidden","data-testid":"context-search-modal",children:[(0,j.jsxs)(o.Flex,{padding:[2,4],border:{side:"bottom"},alignItems:"center",justifyContent:"between",children:[(0,j.jsxs)(o.Flex,{alignItems:"center",gap:2,children:[(0,j.jsx)(o.Text,{color:"textLite",children:"Filter chart in"}),s?.length>0?(0,j.jsx)(y,{menuId:t,parentIds:s,activeMenuId:l,onMenuChange:d}):(0,j.jsx)(o.TextSmall,{children:u?.name||"this section"})]}),(0,j.jsx)(o.Flex,{alignItems:"center",gap:2,children:i&&(0,j.jsx)(v,{parentIds:s,allFilters:C,onGoToParent:i})})]}),(0,j.jsx)(o.Flex,{padding:[3],column:!0,border:{side:"bottom"},children:(0,j.jsx)(o.TextInput,{value:S,onChange:e=>M(e.target.value),placeholder:"Search dimensions, labels...","data-testid":"context-search-input",autoFocus:!0,iconLeft:(0,j.jsx)(o.Icon,{name:N?"loading":"search",color:"textLite",size:"small"}),width:"100%"})}),(0,j.jsxs)(o.Flex,{column:!0,overflow:"auto",style:{opacity:N?.5:1,filter:N?"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===F?"152px":F&&Object.keys(F).length>0?"400px":"199px",children:[null===F&&(0,j.jsx)(o.Flex,{column:!0,gap:3,padding:[3],flex:!0,children:(0,j.jsxs)(o.Flex,{column:!0,gap:2,children:[(0,j.jsxs)(o.Flex,{alignItems:"center",gap:2,children:[(0,j.jsx)(o.Icon,{name:"search",size:"small",color:"textLite"}),(0,j.jsx)(o.TextSmall,{color:"textLite",children:"Search charts based on dimensions, instances and labels"})]}),(0,j.jsxs)(o.Flex,{alignItems:"center",gap:2,children:[(0,j.jsx)(o.Icon,{name:"filter",size:"small",color:"textLite"}),(0,j.jsxs)(o.TextSmall,{color:"textLite",children:["Results are scoped to ",u?.name||"this section"," charts"]})]})]})}),F&&Object.keys(F).length>0&&(0,j.jsx)(o.Flex,{column:!0,padding:[0,0,8],flex:!0,children:m.v.map(e=>{const t=F[e];return t&&0!==t.length?(0,j.jsxs)(o.Flex,{column:!0,children:[(0,j.jsx)(o.Flex,{padding:[2,4],alignItems:"center",position:"sticky",top:0,zIndex:2,children:(0,j.jsx)(o.TextSmall,{strong:!0,color:"textLite",children:e.charAt(0).toUpperCase()+e.slice(1)})}),"labels"===e?(0,j.jsx)(o.Flex,{column:!0,children:t.map((t,n)=>(0,j.jsxs)(o.Flex,{column:!0,border:{side:"bottom"},children:[t.labelKey&&(0,j.jsx)(o.Flex,{padding:[1,6],alignItems:"center",position:"sticky",top:"30px",zIndex:1,children:(0,j.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,j.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:()=>B(e,t),opacity:t.isTruncationNotice?.7:1,children:(0,j.jsxs)(o.Flex,{gap:1,alignItems:"center",overflow:"hidden",flex:!0,children:[(0,j.jsxs)(o.Flex,{gap:.5,column:!0,overflow:"hidden",flex:!0,children:[(0,j.jsx)(o.TextSmall,{truncate:!0,children:t.label}),t.sublabel&&(0,j.jsx)(j.Fragment,{children:t.allContextTitles&&t.allContextTitles.length>2?(0,j.jsx)(f.A,{content:(0,j.jsxs)(c.A,{column:!0,gap:1,children:[(0,j.jsxs)(o.TextSmall,{strong:!0,children:["Found in ",t.allContextTitles.length," ","contexts:"]}),(0,j.jsx)(o.Flex,{flexWrap:!0,children:t.allContextTitles.map((e,n)=>(0,j.jsxs)(o.TextSmall,{children:[e,n<t.allContextTitles.length-1?", ":""]},n))})]}),plain:!0,children:(0,j.jsx)(o.TextMicro,{color:"textLite",children:t.sublabel})}):(0,j.jsx)(o.TextMicro,{color:"textLite",children:t.sublabel})})]}),r&&(0,j.jsx)(o.Icon,{name:"check",size:"small",color:"primary"})]})},`${e}-${t.value}-${n}`)})]},n))}):(0,j.jsx)(o.Flex,{column:!0,children:t.map((t,n)=>{const r=!t.isTruncationNotice&&D(e,t.value);return(0,j.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:()=>B(e,t),opacity:t.isTruncationNotice?.7:1,children:(0,j.jsxs)(o.Flex,{gap:1,alignItems:"center",overflow:"hidden",flex:!0,children:[(0,j.jsxs)(o.Flex,{gap:.5,column:!0,overflow:"hidden",flex:!0,children:[(0,j.jsx)(o.TextSmall,{truncate:!0,children:t.label}),t.sublabel&&(0,j.jsx)(j.Fragment,{children:t.allContextTitles&&t.allContextTitles.length>2?(0,j.jsx)(f.A,{content:(0,j.jsxs)(c.A,{column:!0,gap:1,children:[(0,j.jsxs)(o.TextSmall,{strong:!0,children:["Found in ",t.allContextTitles.length," contexts:"]}),(0,j.jsx)(o.Flex,{flexWrap:!0,children:t.allContextTitles.map((e,n)=>(0,j.jsxs)(o.TextSmall,{children:[e,n<t.allContextTitles.length-1?", ":""]},n))})]}),plain:!0,children:(0,j.jsx)(o.TextMicro,{color:"textLite",truncate:!0,children:t.sublabel})}):(0,j.jsx)(o.TextMicro,{color:"textLite",truncate:!0,children:t.sublabel})})]}),r&&(0,j.jsx)(o.Icon,{name:"check",size:"small",color:"primary"})]})},`${e}-${t.value}-${n}`)})})]},e):null})}),!N&&""!==T.trim()&&null!==F&&0===Object.keys(F).length&&(0,j.jsxs)(o.Flex,{padding:[6,3],justifyContent:"center",alignItems:"center",column:!0,gap:2,flex:!0,children:[(0,j.jsx)(o.Icon,{name:"search",size:"medium",color:"textLite"}),(0,j.jsx)(o.TextSmall,{color:"textLite",children:"No results found"}),(0,j.jsx)(o.TextMicro,{color:"textLite",children:"Try different search terms"})]}),w.length>0&&(0,j.jsxs)(o.Flex,{column:!0,gap:2,padding:[3,3,0],border:{side:"top"},position:"sticky",bottom:0,zIndex:99,children:[(0,j.jsxs)(o.Flex,{justifyContent:"between",alignItems:"center",children:[(0,j.jsxs)(o.TextMicro,{strong:!0,children:["Active Filters (",w.length,")"]}),w.length>0&&(0,j.jsx)(o.Button,{label:"Clear All",flavour:"borderless",onClick:k,"data-testid":"context-search-clear-all",padding:[0],small:!0})]}),(0,j.jsx)(p.A,{gap:2,padding:[0,0,3],children:w.map((e,t)=>(0,j.jsx)(g.A,{matchType:e.matchType,value:e.label,sublabel:e.sublabel,onRemove:()=>A(e)},`${e.matchType}-${e.value}-${t}`))})]})]})]})})});var w=n(33962),I=n(49163),A=n(63928),k=n(95565),S=n(1444);const M=(0,d.A)((0,l.A)(o.Flex)),T=(0,u.A)((0,l.A)(o.IconButton)),F=(0,a.memo)(e=>{let{menuId:t,menuName:n,contexts:r}=e;const{filters:s}=(0,x.w)(r,t);return s&&0!==s.length?(0,j.jsxs)(o.Flex,{column:!0,children:[(0,j.jsxs)(o.TextMicro,{color:"textLite",children:["Filters in ",n," (",s.length,")"]}),(0,j.jsx)(o.Flex,{column:!0,children:s.map(e=>(0,j.jsxs)(o.TextSmall,{children:[e.matchType,": ",(0,j.jsx)(o.Text,{strong:!0,children:e.label})]},`${e.matchType}-${e.label}`))})]}):null}),N=(0,a.memo)(e=>{let{parentIds:t}=e;return t&&0!==t.length?(0,j.jsx)(o.Flex,{column:!0,gap:1,children:t.map(e=>{const t=(0,h.b)(e);return t?(0,j.jsx)(F,{menuId:e,menuName:t.shortName||t.name||e,contexts:t.contexts},e):null})}):null}),L=(0,a.memo)(e=>{let{menuId:t,menuName:n,flavour:r,parentIds:s}=e;const l=(0,h.b)(t),d=(0,x.X)(),u=(0,w.Ud)(),[g,,m,p]=(0,i.A)(),f=new Set;d[t]&&Object.values(d[t]).forEach(e=>{Array.isArray(e)&&e.forEach(e=>{f.add(`${e.matchType}-${e.value}`)})});const b=f.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,I=b>0,A=y>0,k=I||A,S=k?{side:"all",color:I?"primary":"border",width:"1px"}:void 0,T=(0,a.useCallback)(e=>{u(e),p()},[u,p]),L=(0,a.useMemo)(()=>I||A?(0,j.jsxs)(c.A,{column:!0,gap:2,children:[(0,j.jsx)(F,{menuId:t,menuName:n,contexts:l?.contexts}),(0,j.jsx)(N,{parentIds:s})]}):`Search in ${n}`,[I,A,t,n,l?.contexts,s]);return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(M,{position:"relative",tooltip:L,payload:{menuId:t},children:(0,j.jsx)(o.Flex,{alignItems:"center",gap:.5,children:k?(0,j.jsxs)(o.Flex,{onClick:m,cursor:"pointer",border:S,round:!0,alignItems:"center",padding:[0,.5],children:[(0,j.jsx)(o.IconButton,{icon:"filterList",flavour:"borderless",padding:[0],"data-testid":"context-search-button","data-active":I,"data-indeterminate":A,height:"16px",width:"16px"}),y>0&&(0,j.jsx)(o.TextMicro,{color:"textLite",strong:!0,padding:[0,1],children:y}),b>0&&(0,j.jsx)(o.TextMicro,{color:"primary",strong:!0,padding:[0,1],children:b})]}):(0,j.jsx)(o.Flex,{opacity:0,_hover:{opacity:1},transition:"opacity 0.2s ease",children:(0,j.jsx)(o.IconButton,{icon:"filterList",onClick:m,flavour:"borderless",padding:[0],"data-testid":"context-search-button","data-active":I,"data-indeterminate":A,height:"16px",width:"16px"})})})}),g&&(0,j.jsx)(C,{menuId:t,onClose:p,flavour:r,parentIds:s,onGoToParent:T})]})}),D={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,j.jsxs)(o.Flex,{column:!0,gap:1,children:[(0,j.jsx)(o.Text,{children:"Favourites can be saved only on a paid plan."}),(0,j.jsx)(k.A,{children:(0,j.jsx)(o.Text,{color:"primary",children:"Upgrade for no limitations!"})})]}),default:null},B=(0,a.memo)(e=>{let{menuId:t,menuName:n,flavour:r}=e;const[o,,s,l]=(0,i.A)(),c=(0,I._)({params:{type:["favourites"],path:[`/${r}`],entity:t}}),d=c.find(e=>{let{entity:n}=e;return n===t})?.id,u=!!d,h=(0,A.yK)({onResolve:l}),x=(0,A.z2)(d,{onResolve:l}),{disabled:g,reason:m}=(0,S.A)(),p=(0,a.useCallback)(()=>{g||(s(),u?x():h({type:"favourites",entity:t,path:`/${r}`,value:{menuId:t,sortOrder:Date.now()}}))},[g,u,x,h,t,r,s]),f=(0,a.useMemo)(()=>({tooltip:g&&m?D[m]||D.default:u?`Remove ${n} from your favourites`:`Add ${n} to your favourites`,disabled:o||g,..."FreePlan"===m?{tooltipProps:{align:"bottom",activateOn:"hover",isBasic:!0,allowHoverOnTooltip:!0}}:{}}),[u,o,n,g,m]);return(0,j.jsx)(T,{icon:u?"heart":"heart_hollow",onClick:p,disabled:o||g,flavour:"borderless",padding:[0],"data-testid":"toggle-favourite-button","data-active":u,payload:{menuId:t},height:"12px",width:"12px",...f})}),R=(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")),$=e=>{let{children:t,menuId:n,menuName:r,flavour:a,parentIds:i,hasCharts:l,hasFilters:c=s.af}=e;return(0,j.jsxs)(R,{alignItems:"center",justifyContent:"between",hasCharts:l,gap:1,children:[t,(0,j.jsxs)(o.Flex,{alignItems:"center",gap:1,children:[c&&(0,j.jsx)(L,{menuId:n,menuName:r,flavour:a,parentIds:i}),(0,j.jsx)(B,{menuId:n,menuName:r,flavour:a})]})]})},V=e=>t=>t.enableFavourites&&t.contexts?.length?(0,j.jsx)($,{menuId:t._id,menuName:t.name,flavour:t.flavour,parentIds:t.parentIds,hasCharts:!!t.selfChartIds?.length,children:(0,j.jsx)(e,{...t})}):(0,j.jsx)(e,{...t})},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),a=n(91539),i=n(24609),l=n(19186),c=n(258),d=n(67294);const u=()=>{const e=(0,i.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,a.A)(()=>({polling:!1,enabled:!!e&&!!t,fetch:()=>(0,c.SJ)(e,t),onReceive:n}),[e,t]),u}},31035(e,t,n){n.d(t,{$:()=>h,A:()=>x});var r=n(96540),o=n(30569),s=n(97940),a=n(24609),i=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,a.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,i.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])}},50916(e){e.exports=(e,t,n,r,o)=>{const s=o-r;if(0===s)return[];const a=n*Math.cos(r)+e,i=n*Math.sin(r)+t,l=n*Math.cos(o)+e,c=n*Math.sin(o)+t;return[["M",a,i],["A",n,n,0,Math.abs(s)<=Math.PI?"0":"1",s<0?"0":"1",l,c]]}},27891(e,t,n){n.d(t,{A:()=>l});var r=n(12897),o=n.n(r),s=n(55042),a=n.n(s),i=new(o())({id:"save",use:"save-usage",viewBox:"0 0 12 12",content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" id="save"><path d="M10 0H2v.01C.89.04 0 .94 0 2.06v7.9c0 1.13.92 2.05 2.05 2.05h7.9c1.13 0 2.05-.92 2.05-2.05V2zM3.5 1.5h5v3h-5zm4 9h-3v-2h3zm3-.55c0 .3-.25.55-.55.55H9V7H3v3.5h-.95c-.3 0-.55-.25-.55-.55v-7.9c0-.29.22-.51.5-.54V6h8V2.12l.5.5z" /></symbol>'});a().add(i);const l=i},48646(e,t,n){var r=n(69565),o=n(28551),s=n(1767),a=n(50851);e.exports=function(e,t){t&&"string"===typeof e||o(e);var n=a(e);return s(o(void 0!==n?r(n,e):e))}},30531(e,t,n){var r=n(46518),o=n(69565),s=n(79306),a=n(28551),i=n(1767),l=n(48646),c=n(19462),d=n(9539),u=n(96395),h=n(30684),x=n(84549);var g=!u&&!h("flatMap",function(){}),m=!u&&!g&&x("flatMap",TypeError),p=u||g||m||function(){try{var e=Iterator.prototype.flatMap.call(new Map([[4,5]]).entries(),function(e){return e});e.next(),e.return()}catch(t){return!0}}(),f=c(function(){for(var e,t,n=this.iterator,r=this.mapper;;){if(t=this.inner)try{if(!(e=a(o(t.next,t.iterator))).done)return e.value;this.inner=null}catch(s){d(n,"throw",s)}if(e=a(o(this.next,n)),this.done=!!e.done)return;try{this.inner=l(r(e.value,this.counter++),!1)}catch(s){d(n,"throw",s)}}});r({target:"Iterator",proto:!0,real:!0,forced:p},{flatMap:function(e){a(this);try{s(e)}catch(t){d(this,"throw",t)}return m?o(m,this,e):new f(i(this),{mapper:e,inner:null})}})},30670(e,t,n){n(30531)}}]);