/*! Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one or more contributor license agreements. * Licensed under the Elastic License 2.0; you may not use this file except in compliance with the Elastic License 2.0. */ (window.securitySolution_bundle_jsonpfunction=window.securitySolution_bundle_jsonpfunction||[]).push([[31],{1635:function(e,t,n){var i=n(549)("partition",n(1636));i.placeholder=n(550),e.exports=i},1636:function(e,t,n){var i=n(1637)((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));e.exports=i},1637:function(e,t,n){var i=n(1638),s=n(1639),o=n(904),l=n(258);e.exports=function(e,t){return function(n,c){var a=l(n)?i:s,u=t?t():{};return a(n,e,o(c,2),u)}}},1638:function(e,t){e.exports=function(e,t,n,i){for(var s=-1,o=null==e?0:e.length;++s{const{euiTheme:n}=Object(o.useEuiTheme)();return Object(m.jsx)(o.EuiBetaBadge,{label:null!=e?e:O,size:"s",css:Object(m.css)("margin-left:",n.size.s,";color:",n.colors.text,";vertical-align:middle;margin-bottom:",n.size.xxs,";",""),className:t})};let x;!function(e){e.PANEL_NAVIGATION="panel_navigation_",e.PANEL_NAVIGATION_TOGGLE="panel_navigation_toggle_",e.NAVIGATION="navigation_"}(x||(x={}));const f=Object(i.createContext)(null),p=({children:e,tracker:t})=>Object(m.jsx)(f.Provider,{value:{tracker:t}},e),g=()=>{const e=Object(i.useContext)(f);if(!e)throw new Error("No TelemetryContext found.");return e};var v=n(180);const h="solutionSideNavPanelAccordion__button",E=s.a.memo((function({onClose:e,onOutsideClick:t,title:n,categories:l,items:c,bottomOffset:a,topOffset:r}){const{euiTheme:j}=Object(o.useEuiTheme)(),b=Object(o.useIsWithinMinBreakpoint)("l"),O=b?a:void 0,d=!O,x=((e,{$bottomOffset:t,$topOffset:n}={})=>Object(v.css)("position:fixed;top:",null!=n?n:"96px",";left:","249px",";bottom:0;width:","270px",";height:inherit;z-index:1000;background-color:",e.colors.body,";",null!=t&&`\n height: inherit;\n bottom: ${t};\n box-shadow:\n // left\n -${e.size.s} 0 ${e.size.s} -${e.size.s} rgb(0 0 0 / 15%),\n // right\n ${e.size.s} 0 ${e.size.s} -${e.size.s} rgb(0 0 0 / 15%),\n // bottom inset to match timeline bar top shadow\n inset 0 -6px ${e.size.xs} -${e.size.xs} rgb(0 0 0 / 15%);\n `," .solutionSideNavPanelLink{&:focus-within{background-color:transparent;a{text-decoration:auto;}}&:hover{background-color:",Object(o.transparentize)(e.colors.primary,.1),";a{text-decoration:underline;}}}",""))(j,{$bottomOffset:O,$topOffset:b?r:void 0}),f=u()("solutionSideNavPanel","eui-yScroll",x),p=u()((e=>Object(v.css)("padding-top:",e.size.s,";",""))(j)),g=Object(i.useCallback)((t=>{t.key===o.keys.ESCAPE&&e()}),[e]);return Object(m.jsx)(s.a.Fragment,null,Object(m.jsx)(o.EuiWindowEvent,{event:"keydown",handler:g}),Object(m.jsx)(o.EuiPortal,null,Object(m.jsx)(o.EuiFocusTrap,{autoFocus:!0},Object(m.jsx)(o.EuiOutsideClickDetector,{onOutsideClick:t},Object(m.jsx)(o.EuiPanel,{className:f,hasShadow:d,borderRadius:"none",paddingSize:"m","data-test-subj":"solutionSideNavPanel"},Object(m.jsx)(o.EuiFlexGroup,{direction:"column",gutterSize:"m",alignItems:"flexStart"},Object(m.jsx)(o.EuiFlexItem,null,Object(m.jsx)(o.EuiTitle,{size:"xs",className:p},Object(m.jsx)("strong",null,n))),Object(m.jsx)(o.EuiFlexItem,{style:{width:"100%"}},l?Object(m.jsx)(I,{categories:l,items:c,onClose:e}):Object(m.jsx)(z,{items:c,onClose:e}))))))))})),I=s.a.memo((function({categories:e,items:t,onClose:n}){return Object(m.jsx)(s.a.Fragment,null,e.map(((e,i)=>Object(b.f)(e)?Object(m.jsx)(k,{key:`${e.label}-${i}`,category:e,items:t,onClose:n}):Object(b.d)(e)?Object(m.jsx)(S,{key:`${e.label}-${i}`,category:e,items:t,onClose:n,index:i}):Object(b.e)(e)?Object(m.jsx)(C,{category:e,items:t,onClose:n,key:i}):null)))})),N=({items:e,linkIds:t})=>Object(i.useMemo)((()=>t.reduce(((t,n)=>{const i=e.find((e=>e.id===n));return i&&t.push(i),t}),[])),[e,t]),k=s.a.memo((function({category:{linkIds:e,label:t},items:n,onClose:i}){const{euiTheme:l}=Object(o.useEuiTheme)(),c=u()((e=>Object(v.css)("text-transform:uppercase;color:",e.colors.darkShade,";padding-left:",e.size.s,";padding-bottom:",e.size.s,";",Object(o.euiFontSize)({euiTheme:e},"xxs")," font-weight:",e.font.weight.medium,";",""))(l)),a=N({items:n,linkIds:e});return null!=a&&a.length?Object(m.jsx)(s.a.Fragment,null,Object(m.jsx)(o.EuiSpacer,{size:"l"}),Object(m.jsx)(o.EuiTitle,{size:"xxxs",className:c},Object(m.jsx)("h2",null,t)),Object(m.jsx)(z,{items:a,onClose:i})):null})),S=s.a.memo((function({category:{label:e,categories:t},items:n,onClose:i,index:l}){const{euiTheme:c}=Object(o.useEuiTheme)(),a=u()((e=>Object(v.css)(".",h,"{font-weight:",e.font.weight.bold,";",Object(o.euiFontSize)({euiTheme:e},"xs"),";}",""))(c));return Object(m.jsx)(s.a.Fragment,null,l>0&&Object(m.jsx)(o.EuiHorizontalRule,{margin:"xs"}),Object(m.jsx)(o.EuiSpacer,{size:"m"}),Object(m.jsx)(o.EuiAccordion,{id:e,buttonContent:e,className:a,buttonClassName:h},t&&Object(m.jsx)(I,{categories:t,items:n,onClose:i})))})),C=s.a.memo((function({category:{linkIds:e},items:t,onClose:n}){const i=N({items:t,linkIds:e});return null!=i&&i.length?Object(m.jsx)(s.a.Fragment,null,Object(m.jsx)(o.EuiSpacer,{size:"m"}),Object(m.jsx)(z,{items:i,onClose:n})):null})),z=s.a.memo((function({items:e,onClose:t}){const{euiTheme:n}=Object(o.useEuiTheme)(),i=u()(Object(v.css)({name:"127vvv2",styles:"padding-left:0;padding-right:0"}));return Object(m.jsx)(o.EuiListGroup,{className:i},e.map((e=>Object(m.jsx)(T,{key:e.id,item:e,onClose:t}))))})),T=s.a.memo((function({item:e,onClose:t}){const{tracker:n}=g(),s=u()("solutionSideNavPanelLink"),{id:l,href:c,onClick:a,iconType:j,openInNewTab:b}=e,O=Object(i.useCallback)((e=>{null==n||n(r.METRIC_TYPE.CLICK,`${x.PANEL_NAVIGATION}${l}`),t(),null==a||a(e)}),[l,a,t,n]);return Object(m.jsx)(o.EuiListGroupItem,{key:l,label:Object(m.jsx)(y,{item:e}),wrapText:!0,className:s,size:"s","data-test-subj":`solutionSideNavPanelLink-${l}`,href:c,iconType:j,onClick:O,target:b?"_blank":void 0})})),y=s.a.memo((function({item:{label:e,openInNewTab:t,isBeta:n,betaOptions:i}}){return Object(m.jsx)(s.a.Fragment,null,e," ",t&&Object(m.jsx)(o.EuiIcon,{type:"popout",size:"s"}),n&&Object(m.jsx)(d,{text:null==i?void 0:i.text}))}));var P=n(1482);const w=j.i18n.translate("securitySolutionPackages.sideNav.togglePanel",{defaultMessage:"Toggle panel nav"}),F=s.a.memo((function({items:e,categories:t,selectedId:n,panelBottomOffset:s,panelTopOffset:l,tracker:a}){const u=Object(o.useIsWithinBreakpoints)(["xs","s"]),[r,j]=Object(i.useState)(null),b=Object(i.useRef)(null),O=e=>{b.current=e,j(e)},d=Object(i.useCallback)((()=>{b.current=null,j(null)}),[]),x=Object(i.useCallback)((()=>{const e=b.current;setTimeout((()=>{b.current===e&&d()}))}),[d]),[f,g]=Object(i.useMemo)((()=>c()((({position:e=P.a.top})=>e===P.a.top),e)),[e]);return Object(m.jsx)(p,{tracker:a},Object(m.jsx)(o.EuiFlexGroup,{gutterSize:"none",direction:"column"},Object(m.jsx)(o.EuiFlexItem,null,Object(m.jsx)(o.EuiFlexGroup,{gutterSize:"none",direction:"column"},Object(m.jsx)(o.EuiFlexItem,{grow:!1},Object(m.jsx)($,{items:f,categories:t,selectedId:n,activePanelNavId:r,isMobileSize:u,onOpenPanelNav:O})),Object(m.jsx)(o.EuiFlexItem,null),Object(m.jsx)(o.EuiFlexItem,{grow:!1},Object(m.jsx)($,{items:g,selectedId:n,activePanelNavId:r,isMobileSize:u,onOpenPanelNav:O}))))),Object(m.jsx)(A,{items:e,activePanelNavId:r,onClose:d,onOutsideClick:x,bottomOffset:s,topOffset:l}))})),$=s.a.memo((function({items:e,categories:t,selectedId:n,activePanelNavId:i,isMobileSize:l,onOpenPanelNav:c}){return null!=t&&t.length?Object(m.jsx)(s.a.Fragment,null,null==t?void 0:t.map(((t,a)=>{const u=t.linkIds.reduce(((t,n)=>{const i=e.find((e=>e.id===n));return i&&t.push(i),t}),[]);return u.length?Object(m.jsx)(s.a.Fragment,{key:a},0!==a&&Object(m.jsx)(o.EuiSpacer,{size:"s"}),u.map((e=>Object(m.jsx)(_,{key:e.id,item:e,isSelected:n===e.id,isActive:i===e.id,isMobileSize:l,onOpenPanelNav:c}))),Object(m.jsx)(o.EuiSpacer,{size:"s"})):null}))):Object(m.jsx)(s.a.Fragment,null,e.map((e=>Object(m.jsx)(_,{key:e.id,item:e,isSelected:n===e.id,isActive:i===e.id,isMobileSize:l,onOpenPanelNav:c}))))})),_=s.a.memo((function({item:e,isSelected:t,isActive:n,isMobileSize:l,onOpenPanelNav:c}){const{euiTheme:a}=Object(o.useEuiTheme)(),{tracker:j}=g(),{id:b,href:O,label:d,items:f,onClick:p,iconType:h,appendSeparator:E}=e,I=(e=>Object(v.css)("*{font-weight:",e.font.weight.regular,";}&.solutionSideNavItem--isSelected{background-color:",Object(o.transparentize)(e.colors.lightShade,.5),";& *{font-weight:",e.font.weight.medium,";}}span.euiListGroupItem__label{width:100%;}",""))(a),N=u()("solutionSideNavItem",{"solutionSideNavItem--isSelected":t},I),k=u()("solutionSideNavItemButton"),S=Object(i.useMemo)((()=>!l&&null!=f&&f.length>0),[f,l]),C=Object(i.useCallback)((e=>{null==j||j(r.METRIC_TYPE.CLICK,`${x.NAVIGATION}${b}`),null==p||p(e)}),[b,p,j]),z=Object(i.useCallback)((()=>{null==j||j(r.METRIC_TYPE.CLICK,`${x.PANEL_NAVIGATION_TOGGLE}${b}`),c(b)}),[b,c,j]),T=Object(i.useMemo)((()=>null==h?d:Object(m.jsx)(o.EuiFlexGroup,{alignItems:"center",gutterSize:"none"},Object(m.jsx)(o.EuiFlexItem,null,d),Object(m.jsx)(o.EuiFlexItem,{grow:0},Object(m.jsx)(o.EuiIcon,{type:h,color:"text"})))),[d,h]);return Object(m.jsx)(s.a.Fragment,null,Object(m.jsx)(o.EuiFlexGroup,{alignItems:"center",gutterSize:"xs"},Object(m.jsx)(o.EuiFlexItem,null,Object(m.jsx)(o.EuiListGroup,{gutterSize:"none"},Object(m.jsx)(o.EuiListGroupItem,{label:T,href:O,wrapText:!0,onClick:C,className:N,color:"text",size:"s","data-test-subj":`solutionSideNavItemLink-${b}`}))),S&&Object(m.jsx)(o.EuiFlexItem,{grow:0},Object(m.jsx)(o.EuiButtonIcon,{className:k,display:n?"base":"empty",size:"s",color:"text",onClick:z,iconType:"spaces",iconSize:"m","aria-label":w,"data-test-subj":`solutionSideNavItemButton-${b}`}))),E?Object(m.jsx)(o.EuiHorizontalRule,{margin:"xs"}):Object(m.jsx)(o.EuiSpacer,{size:"xs"}))})),A=s.a.memo((function({items:e,activePanelNavId:t,onClose:n,onOutsideClick:s,bottomOffset:o,topOffset:l}){var c;const a=Object(i.useMemo)((()=>e.find((({id:e})=>e===t))),[e,t]);return null!=a&&null!==(c=a.items)&&void 0!==c&&c.length?Object(m.jsx)(E,{onClose:n,onOutsideClick:s,items:a.items,title:a.label,categories:a.categories,bottomOffset:o,topOffset:l}):null}));t.default=F}}]);