/*! 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.triggersActionsUi_bundle_jsonpfunction=window.triggersActionsUi_bundle_jsonpfunction||[]).push([[36,18],{112:function(n,t,e){"use strict";function r(n){return n}function u(n){throw new Error("Called `absurd` function which should be uncallable")}Object.defineProperty(t,"__esModule",{value:!0}),t.bindTo_=t.bind_=t.hole=t.pipe=t.untupled=t.tupled=t.absurd=t.decrement=t.increment=t.tuple=t.flow=t.flip=t.constVoid=t.constUndefined=t.constNull=t.constFalse=t.constTrue=t.constant=t.not=t.unsafeCoerce=t.identity=void 0,t.identity=r,t.unsafeCoerce=r,t.not=function(n){return function(t){return!n(t)}},t.constant=function(n){return function(){return n}},t.constTrue=function(){return!0},t.constFalse=function(){return!1},t.constNull=function(){return null},t.constUndefined=function(){},t.constVoid=function(){},t.flip=function(n){return function(t,e){return n(e,t)}},t.flow=function(n,t,e,r,u,o,i,c,a){switch(arguments.length){case 1:return n;case 2:return function(){return t(n.apply(this,arguments))};case 3:return function(){return e(t(n.apply(this,arguments)))};case 4:return function(){return r(e(t(n.apply(this,arguments))))};case 5:return function(){return u(r(e(t(n.apply(this,arguments)))))};case 6:return function(){return o(u(r(e(t(n.apply(this,arguments))))))};case 7:return function(){return i(o(u(r(e(t(n.apply(this,arguments)))))))};case 8:return function(){return c(i(o(u(r(e(t(n.apply(this,arguments))))))))};case 9:return function(){return a(c(i(o(u(r(e(t(n.apply(this,arguments)))))))))}}},t.tuple=function(){for(var n=[],t=0;t{const[m,g]=Object(r.useState)(t||1),[b,v]=Object(r.useState)(!1),[j,x]=Object(r.useState)("onActionGroupChange");Object(r.useEffect)((()=>{n.notifyWhen?x(n.notifyWhen):x(n.throttle?"onThrottleInterval":"onActiveAlert")}),[n]),Object(r.useEffect)((()=>{v("onThrottleInterval"===j)}),[j]);const I=Object(r.useCallback)((n=>{h("onThrottleInterval"===n?m:null,e),d(n),x(n)}),[]),y=Object(l.jsx)(u.a.Fragment,null,Object(l.jsx)(i.FormattedMessage,{id:"xpack.triggersActionsUI.sections.ruleForm.renotifyFieldLabel",defaultMessage:"Notify"})," ",Object(l.jsx)(c.EuiIconTip,{position:"right",type:"questionInCircle",content:o.i18n.translate("xpack.triggersActionsUI.sections.ruleForm.renotifyWithTooltip",{defaultMessage:"Define how often alerts generate actions."})}));return Object(l.jsx)(u.a.Fragment,null,Object(l.jsx)(c.EuiFormRow,{fullWidth:!0,label:y},Object(l.jsx)(c.EuiFlexGroup,{gutterSize:"s"},Object(l.jsx)(c.EuiFlexItem,null,Object(l.jsx)(c.EuiSuperSelect,{"data-test-subj":"notifyWhenSelect",options:p,valueOfSelected:j,onChange:I}),b&&Object(l.jsx)(u.a.Fragment,null,Object(l.jsx)(c.EuiSpacer,null),Object(l.jsx)(c.EuiFormRow,{fullWidth:!0},Object(l.jsx)(c.EuiFlexGroup,{gutterSize:"s"},Object(l.jsx)(c.EuiFlexItem,null,Object(l.jsx)(c.EuiFieldNumber,{fullWidth:!0,min:1,value:m,name:"throttle","data-test-subj":"throttleInput",prepend:o.i18n.translate("xpack.triggersActionsUI.sections.ruleForm.ruleNotifyWhen.label",{defaultMessage:"Every"}),onChange:n=>{Object(f.pipe)(Object(a.some)(n.target.value.trim()),Object(a.filter)((n=>""!==n)),Object(a.map)((n=>parseInt(n,10))),Object(a.filter)((n=>!isNaN(n))),Object(a.map)((n=>{g(n),h(n,e)})))}})),Object(l.jsx)(c.EuiFlexItem,{grow:!1},Object(l.jsx)(c.EuiSelect,{"data-test-subj":"throttleUnitInput",value:e,options:Object(s.b)(null!=t?t:1),onChange:n=>{h(t,n.target.value)}})))))))))}}}]);