File: //opt/netdata/usr/local/local/share/netdata/web/v3/9462.15252e4a91b0f9f3ff6a.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:"474ae19aea6da01aba145beb8cd1bcef7a1abd55"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="45736e9c-b054-4bb7-8d51-5cb77a41816e",e._sentryDebugIdIdentifier="sentry-dbid-45736e9c-b054-4bb7-8d51-5cb77a41816e")}catch(e){}}(),(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[9462],{89462(e,t,r){r.r(t),r.d(t,{default:()=>Ze});r(62953);var n=r(42358),o=(r(98992),r(54520),r(3949),r(64467)),i=r(80045),l=r(96540),s=(r(27495),r(42318)),c=r(61661),a=r(14815),d=r(74848);function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function g(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){(0,o.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const p=e=>{let{flavour:t}=e;const[r,o]=(0,c.x9)(),{history:i,setHistory:u}=(0,c.b8)(),p=(0,c.GT)(),{setSearchTerm:h}=(0,s.A)(),b=(0,l.useCallback)((e=>{h(e),e?(r||o(i.filter((e=>{let{type:t}=e;return"integration"!==t}))),u([])):r&&u(r)}),[i,r,h,u]),j=(0,l.useMemo)((()=>{var e;return null===(e=a.jI[t])||void 0===e?void 0:e.search}),[t]),x=(null===j||void 0===j?void 0:j.wrapperProps)||{},f=(null===j||void 0===j?void 0:j.inputProps)||{};return(0,d.jsx)(n.Flex,g(g({},x),{},{children:(0,d.jsx)(n.SearchInput,g({value:p,onChange:b,placeholder:"Search through 800+ integrations",dataGa:"integrations::searchTerm::".concat(t)},f))}))},h=["flavour"];function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function j(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){(0,o.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const x=e=>{let{flavour:t}=e,r=(0,i.A)(e,h);const o=(0,l.useMemo)((()=>{var e;return null===(e=a.vD[t])||void 0===e?void 0:e.headerContent}),[t]),s=(0,l.useMemo)((()=>{var e;return null===(e=a.jI[t])||void 0===e?void 0:e.header}),[t]),c=(null===s||void 0===s?void 0:s.wrapperProps)||{};return(0,d.jsxs)(n.Flex,j(j({"data-testid":"integrations-header-container",position:"relative",column:!0,alignItems:"center",justifyContent:"center",gap:2,width:{min:"500px"}},c),{},{children:[o&&(0,d.jsx)(o,j({},r)),(0,d.jsx)(p,{flavour:t})]}))};var f=r(37846),m=(r(81454),r(63950)),y=r.n(m),v=r(85660),O=r(73700),w=r(87239),P=r(6304);const C=e=>{let{categories:t=[],level:r=0,flavour:n}=e;return(0,d.jsx)(d.Fragment,{children:t.map((e=>(0,d.jsx)(D,{category:e,level:r+1,flavour:n},e.id)))})},I=e=>{let{subcategories:t=[],popular:r=[],noPopular:o=[],limitResults:i=0,level:s,flavour:c}=e;const[a,u]=(0,P.A)(i),g=i&&!a?o.slice(0,i):o,p=(0,l.useMemo)((()=>A(2)+4),[]);return(0,d.jsxs)(n.Flex,{column:!0,children:[(0,d.jsx)(C,{categories:r,level:s,flavour:c}),(0,d.jsx)(C,{categories:g,level:s,flavour:c}),!!i&&i<t.length&&(0,d.jsx)(n.Flex,{padding:[0,0,0,p],children:(0,d.jsx)(n.Button,{flavour:"borderless",label:a?"Show less":"Show more",onClick:u,small:!0,"data-ga":"integrations::click-category-".concat(name,"-").concat(a?"showLess":"showMore","::").concat(c)})})]})};var k=r(45087),S=r(41514);const A=function(){return 4*(arguments.length>0&&void 0!==arguments[0]?arguments[0]:1)},D=e=>{let{isSidebarCollapsed:t,category:r={},level:o=1,flavour:i,maxItemsPerCategory:s={}}=e;const u=(0,c.j6)(),{selectedCategory:g,pushCategory:p}=(0,c.b8)(),{id:h,name:b}=r,j=a.aw[h],{categories:x,popular:m,rest:y}=(0,l.useMemo)((()=>(0,w.YK)((0,w.PQ)({category:r,categories:u}))),[r,u]),v=(0,l.useMemo)((()=>{var e;const t=null===(e=s[h])||void 0===e?void 0:e.limit,r=m.length+1;return t>1?t-r:0}),[s,m]),O=h===(null===g||void 0===g?void 0:g.id),C=(0,l.useMemo)((()=>A(o)),[o]),[D,F]=(0,P.A)(),E=(0,c.q2)(),T=()=>{E(),p(r),(0,S.H)("integrations","select-category","sidebar","category-id:".concat(r.id)),x.length&&F()};return t?(0,d.jsx)(n.Flex,{alignItems:"center",justifyContent:"center",padding:[2],children:(0,d.jsx)(k.A,{content:b,align:"right",children:j&&(0,d.jsx)(n.Icon,{name:j,color:O?"primary":"text",cursor:"pointer",onClick:T})})}):(0,d.jsxs)(n.Flex,{column:!0,children:[(0,d.jsxs)(f.Av,{className:1===o?"top-level":"",gap:o>1?1:2,padding:[2,2,2,C],onClick:T,dataGa:"integrations::click-category-".concat(b,"::").concat(i),background:o>1&&O?"integrationMenuItemHover":null,alignItems:"center",children:[j&&(0,d.jsx)(n.Icon,{name:j,size:"small",color:O?"primary":"text"}),o>1&&(0,d.jsx)(f.oO,{name:"chevron_right",rotate:D?1:0,size:"small",color:"textLite",cursor:"pointer",disabled:!x.length}),(0,d.jsx)(n.TextBig,{children:b})]}),!!x.length&&(D||1===o)&&(0,d.jsx)(I,{subcategories:x,popular:m,noPopular:y,limitResults:v,level:o,flavour:i})]})};function F(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}const E=e=>(0,d.jsx)(n.Box,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?F(Object(r),!0).forEach((function(t){(0,o.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):F(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({as:"hr",height:"1px",width:"100%",sx:{borderWidth:"1px 0px 0px 0px",borderColor:"borderSecondary",borderStyle:"solid"}},e));function T(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function B(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?T(Object(r),!0).forEach((function(t){(0,o.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):T(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const _={collapsed:{alignItems:"center",justifyContent:"center",padding:[2]},expanded:{justifyContent:"end",padding:[0,2,0,0],position:"sticky",top:"0"}},H={collapsed:{icon:"chevron_right",iconSize:"large",flavour:"borderless"},expanded:{icon:"chevron_left",iconSize:"small",flavour:"hollow"}},M=e=>{let{isSidebarCollapsed:t,onClick:r=y()}=e;const o=(0,l.useMemo)((()=>t?"collapsed":"expanded"),[t]);return(0,d.jsx)(n.Flex,B(B({width:"100%"},_[o]),{},{children:(0,d.jsx)(n.Button,B({neutral:!0,onClick:r},H[o]))}))},R=(0,O.s)(300,w.vF),N=e=>{let{flavour:t,isSidebarCollapsed:r,toggleSidebar:o=y()}=e;const[i,{height:s}]=(0,v.A)(),a=(0,c.Ss)(),u=(0,c.j6)(),[g,p]=(0,l.useState)({});return(0,l.useEffect)((()=>{R({height:s,topLevelCategories:a,categories:u,setState:p})}),[s,a,u]),(0,d.jsxs)(n.Flex,{ref:i,column:!0,gap:2,overflow:{vertical:"auto"},children:[(0,d.jsx)(M,{isSidebarCollapsed:r,onClick:o}),a.map(((e,o)=>(0,d.jsxs)(n.Flex,{column:!0,gap:2,children:[(0,d.jsx)(D,{isSidebarCollapsed:r,category:e,maxItemsPerCategory:g,flavour:t}),!r&&o<a.length-1&&(0,d.jsx)(E,{})]},e.id)))]})},L=(0,l.memo)(N),z=()=>{const{pop:e}=(0,c.b8)(),t=(0,l.useCallback)((()=>{e(),(0,S.H)("integrations","navigate-back","breadcrumb")}),[e]);return(0,d.jsx)(n.Button,{label:"Back",icon:"arrow_left",iconColor:"primary",iconSize:"small",flavour:"borderless",onClick:t})};r(25440);var G=r(51510);const W=["iconProps"];function q(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?q(Object(r),!0).forEach((function(t){(0,o.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):q(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const K=e=>{let{iconProps:t}=e,r=(0,i.A)(e,W);return(0,d.jsx)(n.Flex,Y(Y({width:"74px",height:"74px",alignItems:"center",justifyContent:"center",background:"primary",round:"100%"},r),{},{children:(0,d.jsx)(n.Icon,Y({name:"integrations",color:"white",size:"large"},t))}))},V=(0,G.default)(K).withConfig({displayName:"fallbackIcon__PlaceholderIcon",componentId:"sc-182ui8v-0"})(["filter:blur(3px);background:",";opacity:0.7;"],(0,n.getColor)("mainBackground")),J=()=>(0,d.jsx)(V,{iconProps:{color:"textLite"}}),Q=K;var Z=r(79748);function $(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function U(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?$(Object(r),!0).forEach((function(t){(0,o.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const X=e=>{let{name:t,icon:r}=e;const[o,i]=(0,l.useState)(),s=(0,l.useCallback)((()=>i(!0)),[]);return(0,d.jsxs)(n.Flex,{alignItems:"center",gap:1,children:[r&&(o?(0,d.jsx)(Q,{width:"18px",height:"18px",iconProps:{size:void 0,with:"12px",height:"12px"}}):(0,d.jsx)("img",{src:r,alt:"".concat(t,"-logo"),height:"18px",onError:s})),(0,d.jsx)(n.Text,{children:t})]})},ee=e=>{let{category:t={},index:r=0}=e;const{history:o,selectedIntegration:i,pushCategory:l}=(0,c.b8)();return!i&&r===o.length-1?(0,d.jsx)(n.Text,{children:t.name}):(0,d.jsx)(Z.A,{onClick:()=>{l(t),(0,S.H)("integrations","select-category","breadcrumb","category-id:".concat(t.id))},children:t.name})},te=e=>{let{flavour:t}=e;const{history:r}=(0,c.b8)(),o=r.map((e=>{let{name:t}=e;return t})).join("-").replace(" ","");return(0,d.jsx)(n.Flex,{gap:2,dataGa:"integrations::view-integration-".concat(o,"::").concat(t),children:r.map(((e,t)=>(0,d.jsxs)(n.Flex,{gap:2,children:["category"===e.type?(0,d.jsx)(ee,{category:e,index:t}):(0,d.jsx)(X,U({},e)),t<r.length-1&&(0,d.jsx)(n.Text,{children:"/"})]},e.id)))})},re=e=>{let{url:t=""}=e;return t?(0,d.jsx)(Z.A,{href:t,rel:"noopener noreferrer",target:"_blank",children:(0,d.jsx)(k.A,{content:"Do you see something wrong? Edit the contents of this resource here.",children:(0,d.jsxs)(n.Flex,{alignItems:"center",gap:1,children:[(0,d.jsx)(n.Icon,{color:"primary",name:"pencilOutline",width:"12px",height:"12px"}),(0,d.jsx)(n.Text,{color:"primary",children:"Edit"})]})})}):null};var ne=r(29147);r(89463);const oe=()=>{const{integrations:e}=(0,s.A)(),t=(0,c.q2)(),r=(0,c.hh)(),{setHistory:o}=(0,c.b8)(),i=(0,l.useCallback)((()=>{t(),r&&o(r)}),[]);return(0,d.jsx)(n.Flex,{alignItems:"center",justifyContent:"between",children:(0,d.jsxs)(n.Flex,{alignItems:"center",gap:4,children:[(0,d.jsxs)(n.TextBig,{children:["Found ",e.length," results"]}),(0,d.jsx)(n.Button,{label:"Clear",icon:"x",iconColor:"primary",iconSize:"small",flavour:"borderless",onClick:i})]})})};var ie=r(51220),le=r(32465);const se=["src","Placeholder","onError"];function ce(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}const ae=G.default.img.withConfig({displayName:"progressiveImage__StyledImage",componentId:"sc-16k6xv6-0"})(["max-width:80%;max-height:74px;"]),de=e=>{let{src:t,Placeholder:r,onError:n=y()}=e,s=(0,i.A)(e,se);const[c,a]=(0,P.A)(!0);return(0,l.useEffect)((()=>{const e=new Image;e.src=t,e.onload=()=>a(),e.onerror=e=>n(e)}),[]),c&&r?(0,d.jsx)(r,{}):(0,d.jsx)(ae,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ce(Object(r),!0).forEach((function(t){(0,o.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ce(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({src:t},s))},ue=["isCommunity"],ge=["integration"];function pe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function he(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?pe(Object(r),!0).forEach((function(t){(0,o.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const be=e=>{let{isCommunity:t}=e,r=(0,i.A)(e,ue);return(0,d.jsxs)(n.Flex,he(he({alignItems:"center",gap:1,position:"absolute",top:"-20px",right:"0",padding:[0,2]},r),{},{children:[(0,d.jsx)(k.A,{content:t?"This integration is maintaned by the community":"This integration is maintained by Netdata",children:(0,d.jsx)(n.TextMicro,{strong:!0,color:"textDescription",children:t?"by Community":"by Netdata"})}),!t&&(0,d.jsx)(n.Icon,{name:"favorites",color:"primary",width:"14px",height:"14px"})]}))},je=e=>{let{integration:t={}}=e,r=(0,i.A)(e,ge);const{selectedCategory:o,pushIntegration:s}=(0,c.b8)(),a=(0,c.j6)(),[u,g]=(0,P.A)(),{flattenedCategory:p,community:h}=t,b=(0,le.A)(),{tree:j,topLevelCategory:x}=(0,w.fk)({category:p,getCategoryById:b}),m=(0,l.useMemo)((()=>j.slice(0,2).filter(Boolean).map((e=>{let{name:t}=e;return t})).join(" / ")),[j,x]),y=(0,w.q1)((null===o||void 0===o?void 0:o.id)||(null===p||void 0===p?void 0:p.id),a),[v,O]=(0,l.useState)(),C=(0,l.useCallback)((()=>O(!0)),[]);return(0,d.jsxs)(f.Zp,he(he({alignItems:"center",justifyContent:"center",height:"100%",position:"relative",overflow:"hidden",cursor:"pointer",padding:[2],onMouseEnter:g,onMouseLeave:g,onClick:()=>{s(t),(0,S.H)("integrations","select-integration","integration-tile","integration-id:".concat(t.id))},round:"2px"},r),{},{children:[(0,d.jsx)(f.AG,{name:y,className:u?"hover":"",width:"190px",height:"190px",color:"textLite"}),(0,d.jsxs)(n.Flex,{width:"100%",alignItems:"center",justifyContent:"center",column:!0,gap:2,zIndex:10,children:[(0,d.jsxs)(n.Flex,{justifyContent:"center",column:!0,gap:1,children:[(0,d.jsx)(n.H3,{textAlign:"center",strong:!1,children:t.name}),m&&(0,d.jsx)(n.TextSmall,{textAlign:"center",children:m})]}),t.icon&&!v&&(0,d.jsx)(de,{Placeholder:J,src:t.icon,alt:"".concat(t.name,"-logo"),onError:C}),v&&(0,d.jsx)(Q,{}),t.description?(0,d.jsxs)(f.BT,{className:u?"hover":"",alignItems:"center",justifyContent:"center",width:"100%",padding:[3],background:"mainBackground",children:[(0,d.jsx)(be,{isCommunity:h}),(0,d.jsx)(n.Text,{textAlign:"center",children:t.description})]}):(0,d.jsx)(be,{isCommunity:h,bottom:"4px",top:"unset"})]})]}))},xe=(0,l.memo)(je),fe=e=>{let{integrations:t=[],itemsPerRow:r=4,rowHeight:n=200}=e;const o=(0,l.useRef)(),i=(0,l.useMemo)((()=>(e=>{let{integrations:t=[],itemsPerRow:r}=e;const n=[];let o=[];for(let i=0;i<t.length;i++)o.push(t[i]),(i+1)%r===0&&(n.push(o),o=[]);return o.length>0&&n.push(o),n})({integrations:t,itemsPerRow:r})),[t,r]),s=(0,l.useCallback)((()=>n),[n]),c=(0,ie.Te)({count:i.length,getScrollElement:()=>o.current,enableSmoothScroll:!1,estimateSize:s});return(0,d.jsx)("div",{ref:o,style:{height:"100%",overflow:"auto",paddingRight:"16px"},children:(0,d.jsx)("div",{style:{minHeight:"".concat(c.getTotalSize(),"px"),width:"100%",position:"relative"},children:c.getVirtualItems().map((e=>(0,d.jsx)("div",{style:{position:"absolute",top:0,left:0,width:"100%",transform:"translateY(".concat(e.start,"px)"),overflow:"hidden"},ref:c.measureElement,"data-index":e.index,children:(0,d.jsx)(f.$c,{itemsPerRow:r,rowHeight:n,children:(i[e.index]||[]).map((e=>(0,d.jsx)(xe,{width:"100%",height:"100%",integration:e},e.flattenedKey||e.id)))})},e.key)))})})},me=()=>(0,d.jsx)(n.Flex,{width:"100%",column:!0,alignItems:"center",margin:[8,0,0,0],children:(0,d.jsxs)(n.Flex,{column:!0,justifyContent:"center",alignItems:"center",margin:[0,0,6],children:[(0,d.jsx)(n.H3,{margin:[0,0,4],children:"No integrations to display"}),(0,d.jsxs)(n.Text,{color:"textDescription",textAlign:"center",children:["There are currently no integrations under this category.",(0,d.jsx)("br",{}),"Try another category or use the search bar to find what you're looking for."]})]})});var ye=r(64156);const ve="(min-width: 1600px)",Oe="(max-width: 1599px)",we="(max-width: 1299px)",Pe={large:{itemsPerRow:4,rowHeight:200},medium:{itemsPerRow:3,rowHeight:200},small:{itemsPerRow:2,rowHeight:190}};var Ce=r(60908);function Ie(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ke(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ie(Object(r),!0).forEach((function(t){(0,o.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ie(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Se=(0,l.memo)((e=>{let{selectedCategory:t,searchTerm:r,integrations:o}=e;const{itemsPerRow:i,rowHeight:l}=(()=>{const e=(0,ye.A)(ve),t=(0,ye.A)(Oe),r=(0,ye.A)(we);return Pe[e?"large":t&&!r?"medium":"small"]||{}})();return(0,d.jsxs)(n.Flex,{column:!0,gap:4,width:"100%",height:"100%",overflow:{vertical:"auto"},children:[(0,d.jsx)(n.Flex,{width:"100%",position:"sticky",top:"0",background:"mainBackground",zIndex:15,children:r?(0,d.jsx)(oe,{}):(0,d.jsxs)(n.Flex,{column:!0,gap:2,children:[(0,d.jsx)(n.H1,{strong:!1,children:null===t||void 0===t?void 0:t.name}),(0,d.jsx)(n.Text,{children:null===t||void 0===t?void 0:t.description})]})}),o.length?(0,d.jsx)(Ce.Ay,ke(ke({mode:"IntegrationsList"},r?{searchTerm:r}:{}),{},{children:(0,d.jsx)(fe,{integrations:o,itemsPerRow:i,rowHeight:l})})):(0,d.jsx)(Ce.Ay,ke(ke({mode:"NoIntegrations"},r?{searchTerm:r}:{}),{},{children:(0,d.jsx)(me,{})}))]})})),Ae=e=>{let{flavour:t}=e;const{selectedCategory:r}=(0,c.b8)(),n=(0,c.GT)(),{integrations:o}=(0,s.A)();return(0,d.jsx)(Se,{flavour:t,selectedCategory:r,searchTerm:n,integrations:o})};var De=r(22794),Fe=r(96026),Ee=r(74891),Te=r(94404);const Be=["itemId"];function _e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}const He=(0,Te.A)((0,Ee.A)(n.Button)),Me=e=>{let{itemId:t}=e,r=(0,i.A)(e,Be);const n=(0,Fe.l)();return t?(0,d.jsx)(He,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_e(Object(r),!0).forEach((function(t){(0,o.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_e(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({small:!0,icon:"gear",onClick:()=>n(t),label:"Configure",tooltip:"Add a new data collection job or edit existing jobs for this collector",payload:{dyncfgId:t}},r)):null};var Re=r(42790),Ne=r(89942);const Le=()=>{var e,t;const[r,o]=(0,l.useState)("calc(100% - 133px)"),{selectedIntegrationTab:i}=(0,Ne.PP)(),s=(0,Re.rI)("selectedIntegrationTab"),[a,u]=(0,l.useState)(i||0),{selectedIntegration:g={}}=(0,c.b8)(),{overview:p,metrics:h,alerts:b,setup:j,troubleshooting:x,relatedResources:f,dyncfgId:m}=g,[y,{height:O}]=(0,v.A)(),w=(0,l.useMemo)((()=>[p?{id:"overview",label:"Overview",content:p}:null,h?{id:"metrics",label:"Metrics",content:h}:null,b?{id:"alerts",label:"Alerts",content:b}:null,j?{id:"setup",label:"Setup",content:j}:null,x?{id:"troubleshooting",label:"Troubleshooting",content:x}:null].filter(Boolean)),[p,h,b,j,x,f]);(0,l.useLayoutEffect)((()=>{O&&o("".concat(O-70,"px"))}),[O]);return(0,d.jsx)(Ce.Ay,{tab:null===(e=w[a])||void 0===e?void 0:e.label,delay:0,children:(0,d.jsxs)(n.Flex,{ref:y,column:!0,gap:2,width:"100%",height:"100%",margin:[4,0,0,0],children:[(0,d.jsxs)(n.Flex,{border:{side:"bottom",size:"1px",color:"borderSecondary"},padding:[0,4],justifyContent:"between",children:[(0,d.jsx)(n.Tabs,{selected:parseInt(a),onChange:e=>{var t;s(e),u(e),(0,S.H)("integrations","select-integration-tab","integration-view","selected-tab:".concat(null===(t=w[e])||void 0===t?void 0:t.label))},children:w.map((e=>{let{label:t}=e;return(0,d.jsx)(n.Tab,{label:(0,d.jsx)(n.Text,{children:t}),minWidth:"auto",maxWidth:"auto",padding:[1,4],background:"mainBackground",small:!0},t)}))}),(0,d.jsx)(Me,{itemId:m})]}),(0,d.jsx)(n.Flex,{width:"100%",height:r,overflow:{vertical:"auto"},padding:[2,0],children:(0,d.jsx)(De.A,{children:null===(t=w[a])||void 0===t?void 0:t.content})})]})})},ze=e=>{let{integration:t={}}=e;return(0,d.jsxs)(d.Fragment,{children:[t.description&&(0,d.jsx)(n.Flex,{margin:[4,0,0,0],children:(0,d.jsx)(n.Text,{children:t.description})}),(0,d.jsx)(Le,{})]})},Ge=e=>{let{integration:t={},topLevelCategory:r={},isNightly:n}=e;const o=(0,l.useMemo)((()=>(e=>a.rP[null===e||void 0===e?void 0:e.id]||ze)(r)),[r]);return(0,d.jsx)(Ce.Ay,{mode:"IntegrationView",integrationId:null===t||void 0===t?void 0:t.id,children:(0,d.jsx)(o,{integration:t,isNightly:n})})},We=()=>{const{selectedCategory:e,selectedIntegration:t}=(0,c.b8)(),r=(0,Re.rI)("selectedIntegrationCategory"),n=(0,Re.rI)("selectedIntegration");(0,l.useEffect)((()=>{null!==e&&void 0!==e&&e.id&&r(e.id)}),[null===e||void 0===e?void 0:e.id,r]),(0,l.useEffect)((()=>{null!==t&&void 0!==t&&t.id&&n(t.id)}),[null===t||void 0===t?void 0:t.id,n])},qe=e=>{let{flavour:t}=e;const r=(0,le.A)(),{level:o,selectedCategory:i,selectedIntegration:l}=(0,c.b8)(),{flattenedCategory:s}=l||{},a=s||i,{topLevelCategory:u}=(0,w.fk)({category:a,getCategoryById:r}),g="deploy"===(null===u||void 0===u?void 0:u.id),p=l||o>2;return We(),(0,d.jsxs)(n.Flex,{column:!0,gap:2,width:"100%",overflow:l&&!g?{}:{vertical:"auto"},children:[(0,d.jsxs)(n.Flex,{column:!0,alignItems:"start",gap:2,padding:[0,2,0,0],children:[p&&(0,d.jsx)(z,{}),(0,d.jsxs)(n.Flex,{width:"100%",alignItems:"end",justifyContent:"between",children:[(0,d.jsxs)(n.Flex,{alignItems:"center",gap:4,children:[(0,d.jsx)(te,{flavour:t}),(null===l||void 0===l?void 0:l.editLink)&&(0,d.jsx)(re,{url:l.editLink})]}),l&&g&&(0,d.jsx)(ne.A,{})]})]}),l?(0,d.jsx)(Ge,{integration:l,topLevelCategory:u,flavour:t}):(0,d.jsx)(Ae,{flavour:t})]})};var Ye=r(48791);const Ke=(0,G.default)(n.Flex).withConfig({displayName:"cncfReference__Wrapper",componentId:"sc-1ntasha-0"})(["position:absolute;bottom:0;"]),Ve=()=>(0,d.jsxs)(Ke,{width:"100%",alignItems:"start",justifyContent:"end",background:"mainBackground",gap:2,padding:[6],children:[(0,d.jsx)(n.Flex,{width:"500px",children:(0,d.jsxs)(n.TextSmall,{textAlign:"right",children:["Netdata is a member of the Cloud Native Computing Foundation (CNCF), and it is one of the most starred projects in the"," ",(0,d.jsx)(Z.A,{alignSelf:"start",Component:n.TextSmall,href:"https://landscape.cncf.io/?item=observability-and-analysis--observability--netdata",rel:"noopener noreferer",target:"_blank",children:"CNCF landscape"}),"."]})}),(0,d.jsx)(Ye.g,{})]});var Je=r(83864),Qe=r(41344);const Ze=e=>{let{flavour:t=a.Jr}=e;const[r,,o,i]=(0,P.A)();(()=>{const e=(0,l.useRef)(!0),{pathname:t}=(0,Qe.zy)(),r=(0,c.yv)();(0,l.useEffect)((()=>{e.current||(e.current=!1,r())}),[t])})();const[s,u]=(0,P.A)();return(0,d.jsxs)(Ce.Ay,{feature:"Integrations",children:[(0,d.jsxs)(n.Flex,{position:"relative",height:"100%",column:!0,background:"mainBackground",children:[(0,d.jsx)(x,{flavour:t,onInvite:o}),(0,d.jsxs)(f.D6,{flavour:t,isSidebarCollapsed:s,children:[(0,d.jsx)(L,{flavour:t,isSidebarCollapsed:s,toggleSidebar:u}),(0,d.jsx)(qe,{flavour:t})]}),t===a.D_.homePage&&(0,d.jsx)(Ve,{})]}),r&&(0,d.jsx)(Je.d,{onClose:i})]})}}}]);