/*! 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.stackConnectors_bundle_jsonpfunction=window.stackConnectors_bundle_jsonpfunction||[]).push([[30],{116:function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return u}));var s=n(1),a=n.n(s),o=n(0),i=n(2),r=n(25),l=n(18),c=n(9);const u=({actionParams:e,editAction:t,index:n,messageVariables:u,executionMode:d,errors:b})=>{const{subAction:y,subActionParams:p}=e,{body:v,severity:j,eventType:m}=null!=p?p:{},f=Object(s.useMemo)((()=>d===i.ActionConnectorMode.Test),[d]);Object(s.useEffect)((()=>{y||t("subAction",f?l.b.TEST:l.b.RUN,n)}),[t,n,f,y]);const g=Object(s.useCallback)((e=>{t("subActionParams",{...p,...e},n)}),[t,n,p]);return Object(c.jsx)(a.a.Fragment,null,Object(c.jsx)(r.EuiFormRow,{fullWidth:!0,error:b.eventType,isInvalid:!1,label:o.i18n.translate("xpack.stackConnectors.components.d3security.eventTypeFieldLabel",{defaultMessage:"Event Type"})},Object(c.jsx)(r.EuiFieldText,{"data-test-subj":"eventTypeInput",name:"eventType",value:m,onChange:e=>{g({eventType:e.target.value})},isInvalid:!1,fullWidth:!0})),Object(c.jsx)(r.EuiFormRow,{fullWidth:!0,error:b.severity,isInvalid:!1,label:o.i18n.translate("xpack.stackConnectors.components.d3security.severityFieldLabel",{defaultMessage:"Severity"})},Object(c.jsx)(r.EuiFieldText,{"data-test-subj":"severityInput",name:"severity",value:j,onChange:e=>{g({severity:e.target.value})},isInvalid:!1,fullWidth:!0})),Object(c.jsx)(i.JsonEditorWithMessageVariables,{messageVariables:u,paramsProperty:"body",inputTargetValue:v,label:o.i18n.translate("xpack.stackConnectors.components.d3security.bodyFieldLabel",{defaultMessage:"Body"}),"aria-label":o.i18n.translate("xpack.stackConnectors.components.d3security.bodyCodeEditorAriaLabel",{defaultMessage:"Code editor"}),errors:b.body,onDocumentsChange:e=>{g({body:e})},onBlur:()=>{v||g({body:""})}}))}}}]);