/*! 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([[0],{102:function(e,t,r){"use strict";var n=r(323);r.d(t,"c",(function(){return n.a})),r.d(t,"d",(function(){return n.b})),r.d(t,"e",(function(){return n.c})),r.d(t,"f",(function(){return n.d})),r.d(t,"g",(function(){return n.e})),r.d(t,"h",(function(){return n.f})),r.d(t,"i",(function(){return n.g})),r.d(t,"k",(function(){return n.h})),r.d(t,"l",(function(){return n.i})),r.d(t,"m",(function(){return n.j})),r.d(t,"n",(function(){return n.k}));var o=r(407);r.d(t,"a",(function(){return o.a})),r.d(t,"j",(function(){return o.b})),r.d(t,"o",(function(){return o.c})),r.d(t,"p",(function(){return o.d}));var a=r(31);r.d(t,"b",(function(){return a.a}))},109:function(e,t,r){"use strict";r.d(t,"f",(function(){return n})),r.d(t,"a",(function(){return o})),r.d(t,"d",(function(){return a})),r.d(t,"c",(function(){return s})),r.d(t,"t",(function(){return c})),r.d(t,"v",(function(){return u})),r.d(t,"s",(function(){return l})),r.d(t,"u",(function(){return d})),r.d(t,"i",(function(){return j})),r.d(t,"h",(function(){return O})),r.d(t,"m",(function(){return y})),r.d(t,"l",(function(){return E})),r.d(t,"r",(function(){return v})),r.d(t,"q",(function(){return C})),r.d(t,"n",(function(){return T})),r.d(t,"g",(function(){return I})),r.d(t,"p",(function(){return k})),r.d(t,"o",(function(){return w})),r.d(t,"j",(function(){return x})),r.d(t,"w",(function(){return A})),r.d(t,"x",(function(){return P})),r.d(t,"k",(function(){return U})),r.d(t,"b",(function(){return B})),r.d(t,"e",(function(){return N}));const n=20,o="draggable-keyboard-wrapper",a="is-dragging",s="hover-actions-always-show";var i=r(42);const c=e=>Object(i.has)("message",e)&&Object(i.has)("body.message",e)&&Object(i.has)("body.statusCode",e),u=e=>Object(i.has)("message",e)&&Object(i.has)("body.message",e)&&Object(i.has)("body.status_code",e),l=e=>c(e)||u(e),d=e=>c(e)&&404===e.body.statusCode||u(e)&&404===e.body.status_code,b="draggableId",f="droppableId",g=`${b}.content.`,p=`${b}.timelineProviders.`,m=`${b}.field.`,h=`${f}.content.`,j=`${f}.timelineProviders.`,O=`${f}.timelineColumns.`,y=e=>`${g}${e}`,E=({contextId:e,fieldId:t})=>`${m}${S(e)}.${M(t)}`,v=({groupIndex:e,timelineId:t})=>`${j}${t}.group.${e}`,C=({dataProviderId:e,groupIndex:t,timelineId:r})=>`${p}${r}.group.${t}.${e}`,T=e=>`${h}${e}`,I=e=>e.draggableId.startsWith(m),$=e=>"DROP"===e.reason,k=e=>e.draggableId.substring(e.draggableId.lastIndexOf(".")+1),w=e=>_(e.draggableId.substring(e.draggableId.lastIndexOf(".")+1)),x=e=>e.replace(/\./g,"_"),S=e=>e.replace(/\./g,"_"),M=e=>e.replace(/\./g,"!!!DOT!!!"),_=e=>e.replace(/!!!DOT!!!/g,"."),A=e=>$(e)&&(e=>e.draggableId.startsWith(g))(e)&&(e=>e.source.droppableId.startsWith(h))(e)&&(e=>null!=e.destination&&e.destination.droppableId.startsWith(j))(e),P=e=>$(e)&&(e=>{const t=/^droppableId\.timelineProviders\.(\S+)\./,r=e.source.droppableId.match(t)||[],n=e.destination&&e.destination.droppableId.match(t)||[];return r.length>=2&&n.length>=2&&r[1]===n[1]})(e),U=e=>$(e)&&I(e)&&(e=>null!=e.destination&&e.destination.droppableId.startsWith(O))(e),B="drag-type-field",N="is-timeline-field-dragging"},323:function(e,t,r){"use strict";r.d(t,"e",(function(){return f})),r.d(t,"j",(function(){return g})),r.d(t,"b",(function(){return p})),r.d(t,"k",(function(){return m})),r.d(t,"g",(function(){return h})),r.d(t,"d",(function(){return y})),r.d(t,"f",(function(){return E})),r.d(t,"a",(function(){return v})),r.d(t,"c",(function(){return C}));var n=r(76),o=r.n(n),a=r(2),s=r(5),i=r(8),c=r(82),u=r(24);r.d(t,"h",(function(){return u.h})),r.d(t,"i",(function(){return u.i}));var l=r(4),d=r(531),b=r(407);const f=()=>Object(b.c)(l.D),g=()=>{const e=Object(b.c)(l.E);return"Browser"===e?o.a.tz.guess():e},p=()=>Object(b.b)().services.http.basePath.get(),m=()=>Object(b.b)().services.notifications.toasts,h=()=>Object(b.b)().services.http,j=e=>e.reduce(((e,t)=>Object(i.isArray)(t)?[...e,j(t)]:Object(i.isObject)(t)?[...e,O(t)]:[...e,t]),[]),O=e=>Object.entries(e).reduce(((e,[t,r])=>(Object(i.isArray)(r)?Object(c.set)(e,Object(i.camelCase)(t),j(r)):Object(i.isObject)(r)?Object(c.set)(e,Object(i.camelCase)(t),O(r)):Object(c.set)(e,Object(i.camelCase)(t),r),e)),{}),y=()=>{const e=Object(a.useRef)(!1),[t,r]=Object(a.useState)(null),[,n]=Object(d.f)(),{security:o}=Object(b.b)().services,i=Object(a.useCallback)((()=>{let t=!1;return(async()=>{try{if(null!=o){const n=await o.authc.getCurrentUser();if(!e.current)return;t||r(O(n))}else r({username:s.i18n.translate("xpack.securitySolution.getCurrentUser.unknownUser",{defaultMessage:"Unknown"}),email:"",fullName:"",roles:[],enabled:!1,authenticationRealm:{name:"",type:""},lookupRealm:{name:"",type:""},authenticationProvider:""})}catch(e){t||(Object(d.e)({title:s.i18n.translate("xpack.securitySolution.getCurrentUser.Error",{defaultMessage:"Error getting user"}),error:e.body&&e.body.message?new Error(e.body.message):e,dispatchToaster:n}),r(null))}})(),()=>{t=!0}}),[o]);return Object(a.useEffect)((()=>(e.current=!0,i(),()=>{e.current=!1})),[]),t},E=()=>{const[e,t]=Object(a.useState)({all:!1,create:!1,read:!1,update:!1,delete:!1,push:!1,connectors:!1}),r=Object(b.b)().services.application.capabilities,n=Object(b.b)().services.cases.helpers.getUICapabilities(r[l.q]);return Object(a.useEffect)((()=>{t({all:n.all,create:n.create,read:n.read,update:n.update,delete:n.delete,push:n.push,connectors:n.connectors})}),[n.all,n.create,n.read,n.update,n.delete,n.push,n.connectors]),e},v=u.g,C=e=>{const{capabilities:t}=Object(b.b)().services.application;return e?t[e]:t}},407:function(e,t,r){"use strict";r.d(t,"b",(function(){return o}));var n=r(58);r.d(t,"a",(function(){return n.KibanaContextProvider})),r.d(t,"c",(function(){return n.useUiSetting})),r.d(t,"d",(function(){return n.useUiSetting$}));const o=()=>Object(n.useKibana)()},531:function(e,t,r){"use strict";r.d(t,"d",(function(){return y})),r.d(t,"e",(function(){return E})),r.d(t,"c",(function(){return errors_ToasterError})),r.d(t,"f",(function(){return T})),r.d(t,"b",(function(){return I})),r.d(t,"a",(function(){return k}));var n=r(40),o=r(42),a=r(2),s=r.n(a),i=r(41),c=r.n(i),u=r(5);const l=u.i18n.translate("xpack.securitySolution.modalAllErrors.seeAllErrors.button",{defaultMessage:"See the full error(s)"}),d=u.i18n.translate("xpack.securitySolution.modalAllErrors.title",{defaultMessage:"Your visualization has error(s)"}),b=u.i18n.translate("xpack.securitySolution.modalAllErrors.close.button",{defaultMessage:"Close"}),f=({isShowing:e,toast:t,toggle:r})=>{const o=Object(a.useCallback)((()=>r(t)),[r,t]);return e&&null!=t?s.a.createElement(n.EuiModal,{onClose:o},s.a.createElement(n.EuiModalHeader,null,s.a.createElement(n.EuiModalHeaderTitle,null,d)),s.a.createElement(n.EuiModalBody,null,s.a.createElement(n.EuiCallOut,{title:t.title,color:"danger",size:"s",iconType:"warning"}),s.a.createElement(n.EuiSpacer,{size:"s"}),Array.isArray(t.errors)&&t.errors.map(((e,r)=>s.a.createElement(n.EuiAccordion,{key:`${t.id}-${r}`,id:"accordion1",initialIsOpen:0===r,buttonContent:e.length>100?`${e.substring(0,100)} ...`:e,"data-test-subj":"modal-all-errors-accordion"},s.a.createElement(p,null,e))))),s.a.createElement(n.EuiModalFooter,null,s.a.createElement(n.EuiButton,{onClick:o,fill:!0,"data-test-subj":"modal-all-errors-close"},b))):null},g=s.a.memo(f),p=c()(n.EuiCodeBlock).withConfig({displayName:"MyEuiCodeBlock",componentId:"sc-1ils255-0"})(["margin-top:4px;"]);p.displayName="MyEuiCodeBlock";var m=r(47),h=r(109),j=r(0),O=r.n(j);class errors_ToasterError extends Error{constructor(e){super(e[0]),O()(this,"messages",void 0),this.name="ToasterError",this.messages=e}}const y=(e,t,r=Object(m.v4)())=>{t({type:"addToaster",toast:{id:r,title:e,color:"success",iconType:"check"}})},E=({id:e=Object(m.v4)(),title:t,error:r,color:n="danger",iconType:a="error",dispatchToaster:s})=>{let i;i=(e=>e instanceof errors_ToasterError)(r)?{id:e,title:t,color:n,iconType:a,errors:r.messages}:Object(h.s)(r)?{id:e,title:t,color:n,iconType:a,errors:[r.body.message]}:Object(o.isError)(r)?{id:e,title:t,color:n,iconType:a,errors:[r.message]}:{id:e,title:t,color:n,iconType:a,errors:["Network Error"]},s({type:"addToaster",toast:i})},v={toasts:[]},C=Object(a.createContext)([v,()=>o.noop]),T=()=>Object(a.useContext)(C),I=({children:e})=>s.a.createElement(C.Provider,{value:Object(a.useReducer)(((e,t)=>{switch(t.type){case"addToaster":return{...e,toasts:[...e.toasts,t.toast]};case"deleteToaster":return{...e,toasts:e.toasts.filter((e=>e.id!==t.id))};default:return e}}),v)},e),$=c.a.div.withConfig({displayName:"GlobalToasterListContainer",componentId:"sc-1nee03s-0"})(["position:absolute;right:0;bottom:0;"]),k=({toastLifeTimeMs:e=5e3})=>{const[{toasts:t},r]=T(),[o,i]=Object(a.useState)(!1),[c,u]=Object(a.useState)(null),l=e=>{o?(r({type:"deleteToaster",id:e.id}),u(null)):u(e),i(!o)};return s.a.createElement(s.a.Fragment,null,t.length>0&&!o&&s.a.createElement($,null,s.a.createElement(n.EuiGlobalToastList,{toasts:[w(t[0],l)],dismissToast:({id:e})=>{r({type:"deleteToaster",id:e})},toastLifeTimeMs:e})),null!=c&&s.a.createElement(g,{isShowing:o,toast:c,toggle:l}))},w=(e,t)=>(null!=e&&null!=e.errors&&e.errors.length>0&&(e.text=s.a.createElement(x,null,s.a.createElement(n.EuiButton,{"data-test-subj":"toaster-show-all-error-modal",size:"s",color:"danger",onClick:()=>null!=e&&t(e)},l))),e),x=c.a.div.withConfig({displayName:"ErrorToastContainer",componentId:"sc-1nee03s-1"})(["text-align:right;"]);x.displayName="ErrorToastContainer"}}]);