/*! 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. */!function(e){function t(t){for(var n,a,i=t[0],s=t[1],o=0,c=[];oObject(i.jsx)(r.Suspense,{fallback:Object(i.jsx)(a.a,{size:null!=t?t:"m"})},Object(i.jsx)(e,n))}},function(e,t,n){"use strict";n.d(t,"b",(function(){return a.BASE_ALERTING_API_PATH})),n.d(t,"j",(function(){return a.INTERNAL_BASE_ALERTING_API_PATH})),n.d(t,"a",(function(){return i.BASE_ACTION_API_PATH})),n.d(t,"i",(function(){return i.INTERNAL_BASE_ACTION_API_PATH})),n.d(t,"s",(function(){return o})),n.d(t,"r",(function(){return u})),n.d(t,"v",(function(){return c})),n.d(t,"u",(function(){return l})),n.d(t,"t",(function(){return d})),n.d(t,"p",(function(){return p})),n.d(t,"q",(function(){return g})),n.d(t,"w",(function(){return b})),n.d(t,"o",(function(){return s})),n.d(t,"f",(function(){return m})),n.d(t,"e",(function(){return h})),n.d(t,"n",(function(){return j})),n.d(t,"m",(function(){return y})),n.d(t,"k",(function(){return x})),n.d(t,"l",(function(){return v})),n.d(t,"h",(function(){return O})),n.d(t,"d",(function(){return _})),n.d(t,"c",(function(){return A})),n.d(t,"g",(function(){return T}));var r=n(3),a=n(11),i=n(23);let s;!function(e){e.SECOND="s",e.MINUTE="m",e.HOUR="h",e.DAY="d"}(s||(s={}));const o="/",u="/connectors",c="/rules",l="/logs",d="/alerts",p="/alert/:alertId",g=r.i18n.translate("xpack.triggersActionsUI.sections.actionForm.RecoveredMessage",{defaultMessage:"Recovered"}),b=r.i18n.translate("xpack.triggersActionsUI.sections.actionForm.SummaryMessage",{defaultMessage:"The system has detected \\{\\{alerts.new.count\\}\\} new, \\{\\{alerts.ongoing.count\\}\\} ongoing, and \\{\\{alerts.recovered.count\\}\\} recovered alerts."});let f;!function(e){e.ASCENDING="asc",e.DESCENDING="desc"}(f||(f={}));const m=10,h="1m",j=["execution_duration","total_search_duration","es_search_duration","schedule_delay"],y=["num_new_alerts","num_active_alerts","num_recovered_alerts"],x=["rule_name","timestamp","execution_duration","status","message","num_active_alerts","num_errored_actions"],v=[...x.slice(1)],O=["rule_name",...x],_="format:number:defaultPattern",A=["timestamp","status","connector_name","message"],T=[...A]},function(e,t){e.exports=__kbnSharedDeps__.ElasticCharts},function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return s})),n.d(t,"a",(function(){return o})),n.d(t,"g",(function(){return u})),n.d(t,"k",(function(){return c})),n.d(t,"h",(function(){return l})),n.d(t,"e",(function(){return d})),n.d(t,"l",(function(){return p})),n.d(t,"m",(function(){return g})),n.d(t,"f",(function(){return b})),n.d(t,"d",(function(){return f})),n.d(t,"j",(function(){return m})),n.d(t,"i",(function(){return h}));var r=n(1),a=n(4);const i=Object(r.lazy)((()=>n.e(56).then(n.bind(null,106)))),s=Object(r.lazy)((()=>n.e(57).then(n.bind(null,107)))),o=(Object(a.a)(Object(r.lazy)((()=>Promise.all([n.e(1),n.e(3),n.e(15)]).then(n.bind(null,74))))),Object(a.a)(Object(r.lazy)((()=>Promise.all([n.e(1),n.e(3),n.e(16)]).then(n.bind(null,75))))),Object(a.a)(Object(r.lazy)((()=>Promise.all([n.e(8),n.e(17)]).then(n.bind(null,73))))),Object(a.a)(Object(r.lazy)((()=>Promise.all([n.e(9),n.e(18)]).then(n.bind(null,72))))),Object(a.a)(Object(r.lazy)((()=>Promise.all([n.e(0),n.e(4),n.e(6),n.e(13)]).then(n.bind(null,76)))))),u=Object(a.a)(Object(r.lazy)((()=>Promise.all([n.e(2),n.e(59)]).then(n.bind(null,92))))),c=Object(a.a)(Object(r.lazy)((()=>n.e(62).then(n.bind(null,97))))),l=Object(a.a)(Object(r.lazy)((()=>n.e(60).then(n.bind(null,93))))),d=Object(a.a)(Object(r.lazy)((()=>Promise.all([n.e(0),n.e(5),n.e(10),n.e(21)]).then(n.bind(null,102))))),p=Object(a.a)(Object(r.lazy)((()=>Promise.all([n.e(0),n.e(2),n.e(7),n.e(12),n.e(37)]).then(n.bind(null,101))))),g=Object(a.a)(Object(r.lazy)((()=>Promise.all([n.e(2),n.e(38)]).then(n.bind(null,85))))),b=Object(a.a)(Object(r.lazy)((()=>Promise.all([n.e(2),n.e(35)]).then(n.bind(null,109))))),f=Object(a.a)(Object(r.lazy)((()=>n.e(32).then(n.bind(null,103))))),m=Object(a.a)(Object(r.lazy)((()=>n.e(61).then(n.bind(null,95))))),h=Object(a.a)(Object(r.lazy)((()=>Promise.all([n.e(0),n.e(2),n.e(22)]).then(n.bind(null,96)))))},function(e,t,n){"use strict";n.r(t),n.d(t,"GroupByExpression",(function(){return i})),n.d(t,"ForLastExpression",(function(){return s})),n.d(t,"ValueExpression",(function(){return o})),n.d(t,"WhenExpression",(function(){return u})),n.d(t,"OfExpression",(function(){return c})),n.d(t,"ThresholdExpression",(function(){return l})),n.d(t,"COMPARATORS",(function(){return d.COMPARATORS})),n.d(t,"builtInComparators",(function(){return d.builtInComparators})),n.d(t,"builtInAggregationTypes",(function(){return d.builtInAggregationTypes})),n.d(t,"builtInGroupByTypes",(function(){return d.builtInGroupByTypes})),n.d(t,"connectorDeprecatedMessage",(function(){return p.a})),n.d(t,"deprecatedMessage",(function(){return p.b})),n.d(t,"getFields",(function(){return h})),n.d(t,"getIndexOptions",(function(){return m})),n.d(t,"firstFieldOption",(function(){return j})),n.d(t,"getTimeFieldOptions",(function(){return y.c})),n.d(t,"useKibana",(function(){return y.d})),n.d(t,"BUCKET_SELECTOR_FIELD",(function(){return x.b})),n.d(t,"buildAggregation",(function(){return x.d})),n.d(t,"isCountAggregation",(function(){return x.e})),n.d(t,"isGroupAggregation",(function(){return x.f})),n.d(t,"parseAggregationResults",(function(){return x.g})),n.d(t,"NORMALIZED_FIELD_TYPES",(function(){return x.c}));var r=n(1),a=n(4);const i=Object(a.a)(Object(r.lazy)((()=>n.e(44).then(n.bind(null,306))))),s=Object(a.a)(Object(r.lazy)((()=>n.e(43).then(n.bind(null,307))))),o=Object(a.a)(Object(r.lazy)((()=>n.e(46).then(n.bind(null,308))))),u=Object(a.a)(Object(r.lazy)((()=>n.e(47).then(n.bind(null,309))))),c=Object(a.a)(Object(r.lazy)((()=>n.e(29).then(n.bind(null,310))))),l=Object(a.a)(Object(r.lazy)((()=>n.e(45).then(n.bind(null,311)))));var d=n(12),p=n(45),g=n(9),b=n(3),f=n(39);const m=async(e,t)=>{const n=[];if(!t)return n;const[r,a]=await Promise.all([Object(f.b)({pattern:t,http:e}),Object(f.c)(t)]);if(r.length||a.length){const e=Object(g.uniq)([...r,...a]);n.push({label:b.i18n.translate("xpack.triggersActionsUI.components.builtinActionTypes.indexAction.indicesAndIndexPatternsLabel",{defaultMessage:"Based on your data views"}),options:e.map((e=>({label:e,value:e})))})}return n.push({label:b.i18n.translate("xpack.triggersActionsUI.components.builtinActionTypes.indexAction.chooseLabel",{defaultMessage:"Choose…"}),options:[{value:t,label:t}]}),n},h=async(e,t)=>await Object(f.a)({indexes:t,http:e}),j={text:b.i18n.translate("xpack.triggersActionsUI.sections.ruleAdd.indexControls.timeFieldOptionLabel",{defaultMessage:"Select a field"}),value:""};var y=n(44),x=n(26)},function(e,t){e.exports=__kbnSharedDeps__.Lodash},function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return o}));var r=n(1),a=n.n(r),i=n(0);const s=a.a.createContext(void 0),o=({children:e,value:t})=>Object(i.jsx)(s.Provider,{value:t},e);o.displayName="ConnectorProvider"},function(e,t,n){n.r(t);var r=__kbnBundles__.get("plugin/alerting/common");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))},function(e,t,n){"use strict";n.r(t),n.d(t,"COMPARATORS",(function(){return a})),n.d(t,"builtInComparators",(function(){return i})),n.d(t,"AGGREGATION_TYPES",(function(){return s})),n.d(t,"builtInAggregationTypes",(function(){return o})),n.d(t,"loadAllActions",(function(){return u.e})),n.d(t,"loadActionTypes",(function(){return u.d})),n.d(t,"ConnectorAddModal",(function(){return c.b})),n.d(t,"builtInGroupByTypes",(function(){return l})),n.d(t,"DEFAULT_FREQUENCY",(function(){return p})),n.d(t,"VIEW_LICENSE_OPTIONS_LINK",(function(){return h})),n.d(t,"PLUGIN_ID",(function(){return j})),n.d(t,"CONNECTORS_PLUGIN_ID",(function(){return y})),n.d(t,"I18N_WEEKDAY_OPTIONS",(function(){return f})),n.d(t,"I18N_WEEKDAY_OPTIONS_DDD",(function(){return m}));var r=n(3);let a;!function(e){e.GREATER_THAN=">",e.GREATER_THAN_OR_EQUALS=">=",e.BETWEEN="between",e.LESS_THAN="<",e.LESS_THAN_OR_EQUALS="<=",e.NOT_BETWEEN="notBetween"}(a||(a={}));const i={[a.GREATER_THAN]:{text:r.i18n.translate("xpack.triggersActionsUI.common.constants.comparators.isAboveLabel",{defaultMessage:"Is above"}),value:a.GREATER_THAN,requiredValues:1},[a.GREATER_THAN_OR_EQUALS]:{text:r.i18n.translate("xpack.triggersActionsUI.common.constants.comparators.isAboveOrEqualsLabel",{defaultMessage:"Is above or equals"}),value:a.GREATER_THAN_OR_EQUALS,requiredValues:1},[a.LESS_THAN]:{text:r.i18n.translate("xpack.triggersActionsUI.common.constants.comparators.isBelowLabel",{defaultMessage:"Is below"}),value:a.LESS_THAN,requiredValues:1},[a.LESS_THAN_OR_EQUALS]:{text:r.i18n.translate("xpack.triggersActionsUI.common.constants.comparators.isBelowOrEqualsLabel",{defaultMessage:"Is below or equals"}),value:a.LESS_THAN_OR_EQUALS,requiredValues:1},[a.BETWEEN]:{text:r.i18n.translate("xpack.triggersActionsUI.common.constants.comparators.isBetweenLabel",{defaultMessage:"Is between"}),value:a.BETWEEN,requiredValues:2},[a.NOT_BETWEEN]:{text:r.i18n.translate("xpack.triggersActionsUI.common.constants.comparators.isNotBetweenLabel",{defaultMessage:"Not between"}),value:a.NOT_BETWEEN,requiredValues:2}};let s;!function(e){e.COUNT="count",e.AVERAGE="avg",e.SUM="sum",e.MIN="min",e.MAX="max"}(s||(s={}));const o={count:{text:"count()",fieldRequired:!1,value:s.COUNT,validNormalizedTypes:[]},avg:{text:"average()",fieldRequired:!0,validNormalizedTypes:["number"],value:s.AVERAGE},sum:{text:"sum()",fieldRequired:!0,validNormalizedTypes:["number"],value:s.SUM},min:{text:"min()",fieldRequired:!0,validNormalizedTypes:["number","date"],value:s.MIN},max:{text:"max()",fieldRequired:!0,validNormalizedTypes:["number","date"],value:s.MAX}};var u=n(22),c=n(18);const l={all:{text:r.i18n.translate("xpack.triggersActionsUI.common.constants.comparators.groupByTypes.allDocumentsLabel",{defaultMessage:"all documents"}),sizeRequired:!1,value:"all",validNormalizedTypes:[]},top:{text:r.i18n.translate("xpack.triggersActionsUI.common.constants.comparators.groupByTypes.topLabel",{defaultMessage:"top"}),sizeRequired:!0,value:"top",validNormalizedTypes:["number","date","keyword"]}};var d=n(11);const p={notifyWhen:d.RuleNotifyWhen.CHANGE,throttle:null,summary:!1};var g=n(31),b=n.n(g);const f=d.ISO_WEEKDAYS.map((e=>({id:String(e),label:b()().isoWeekday(e).format("dd")}))),m=d.ISO_WEEKDAYS.map((e=>({id:String(e),label:b()().isoWeekday(e).format("ddd")}))),h="https://www.elastic.co/subscriptions",j="triggersActions",y="triggersActionsConnectors"},function(e,t,n){e.exports=n(61)(1466)},function(e,t,n){"use strict";function r(e){return e.useWithTripleBracesInTemplates?`{{{${e.name}}}}`:`{{${e.name}}}`}function a(e){return null!==e.match(/{{.*}}/)}n.d(t,"e",(function(){return r})),n.d(t,"c",(function(){return a})),n.d(t,"a",(function(){return i.a})),n.d(t,"f",(function(){return s.f})),n.d(t,"b",(function(){return s.c})),n.d(t,"d",(function(){return o}));var i=n(64),s=n(22);const o=e=>Boolean(e.isSnoozedUntil&&new Date(e.isSnoozedUntil).getTime()>Date.now()||e.muteAll)},function(e,t,n){n.r(t);var r=__kbnBundles__.get("plugin/esUiShared/static/forms/hook_form_lib");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))},function(e,t,n){e.exports=n(61)(1465)},function(e,t,n){"use strict";n.d(t,"m",(function(){return a})),n.d(t,"b",(function(){return i})),n.d(t,"k",(function(){return s})),n.d(t,"h",(function(){return o})),n.d(t,"i",(function(){return u})),n.d(t,"j",(function(){return c})),n.d(t,"f",(function(){return l})),n.d(t,"g",(function(){return d})),n.d(t,"l",(function(){return p}));var r=n(23);let a,i;n.d(t,"e",(function(){return r.AlertHistoryEsIndexConnectorId})),n.d(t,"d",(function(){return r.AlertHistoryDocumentTemplate})),n.d(t,"c",(function(){return r.AlertHistoryDefaultIndexName})),n.d(t,"a",(function(){return r.ALERT_HISTORY_PREFIX})),function(e){e[e.SAVED=0]="SAVED",e[e.CANCELED=1]="CANCELED"}(a||(a={})),function(e){e.Test="test",e.ActionForm="actionForm"}(i||(i={}));const s=["params"],o=["context"];let u,c,l,d,p;!function(e){e.Configuration="configuration",e.Test="test"}(u||(u={})),function(e){e.P50="P50",e.P95="P95",e.P99="P99"}(c||(c={})),function(e){e.name="kibana.alert.rule.name",e.reason="kibana.alert.reason",e.uuid="kibana.alert.rule.uuid",e.case_ids="kibana.alert.case_ids"}(l||(l={})),function(e){e.add="add",e.delete="delete",e.clear="clear",e.selectCurrentPage="selectCurrentPage",e.selectAll="selectAll",e.rowCountUpdate="rowCountUpdate",e.updateRowLoadingState="updateRowLoadingState",e.updateAllLoadingState="updateAllLoadingState"}(d||(d={})),function(e){e[e.YEARLY=0]="YEARLY",e[e.MONTHLY=1]="MONTHLY",e[e.WEEKLY=2]="WEEKLY",e[e.DAILY=3]="DAILY"}(p||(p={}))},function(e,t,n){"use strict";n.d(t,"c",(function(){return i})),n.d(t,"d",(function(){return s})),n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return u}));var r=n(1),a=n(4);const i=Object(a.a)(Object(r.lazy)((()=>Promise.all([n.e(8),n.e(17)]).then(n.bind(null,73))))),s=Object(a.a)(Object(r.lazy)((()=>Promise.all([n.e(9),n.e(18)]).then(n.bind(null,72))))),o=Object(a.a)(Object(r.lazy)((()=>Promise.all([n.e(0),n.e(4),n.e(6),n.e(13)]).then(n.bind(null,76))))),u=Object(a.a)(Object(r.lazy)((()=>n.e(24).then(n.bind(null,104)))));Object(a.a)(Object(r.lazy)((()=>n.e(33).then(n.bind(null,91)))))},function(e,t){e.exports=__kbnSharedDeps__.ReactQuery},function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return l})),n.d(t,"d",(function(){return d})),n.d(t,"e",(function(){return p})),n.d(t,"i",(function(){return g})),n.d(t,"j",(function(){return b})),n.d(t,"m",(function(){return f})),n.d(t,"k",(function(){return m})),n.d(t,"l",(function(){return h})),n.d(t,"n",(function(){return j})),n.d(t,"q",(function(){return T})),n.d(t,"r",(function(){return S})),n.d(t,"w",(function(){return E})),n.d(t,"A",(function(){return I})),n.d(t,"C",(function(){return w})),n.d(t,"D",(function(){return k})),n.d(t,"F",(function(){return R})),n.d(t,"I",(function(){return C})),n.d(t,"L",(function(){return P})),n.d(t,"O",(function(){return M})),n.d(t,"R",(function(){return y})),n.d(t,"S",(function(){return x})),n.d(t,"bb",(function(){return v})),n.d(t,"cb",(function(){return L})),n.d(t,"db",(function(){return O})),n.d(t,"fb",(function(){return _})),n.d(t,"gb",(function(){return A})),n.d(t,"mb",(function(){return o})),n.d(t,"ob",(function(){return r})),n.d(t,"pb",(function(){return u})),n.d(t,"o",(function(){return V})),n.d(t,"p",(function(){return $})),n.d(t,"s",(function(){return z})),n.d(t,"t",(function(){return B})),n.d(t,"u",(function(){return W})),n.d(t,"v",(function(){return G})),n.d(t,"x",(function(){return H})),n.d(t,"y",(function(){return q})),n.d(t,"z",(function(){return Y})),n.d(t,"B",(function(){return J})),n.d(t,"E",(function(){return K})),n.d(t,"G",(function(){return Q})),n.d(t,"H",(function(){return X})),n.d(t,"J",(function(){return Z})),n.d(t,"K",(function(){return ee})),n.d(t,"M",(function(){return te})),n.d(t,"N",(function(){return ne})),n.d(t,"P",(function(){return re})),n.d(t,"Q",(function(){return ae})),n.d(t,"V",(function(){return de})),n.d(t,"W",(function(){return le})),n.d(t,"X",(function(){return oe})),n.d(t,"Y",(function(){return ce})),n.d(t,"Z",(function(){return ue})),n.d(t,"ab",(function(){return pe})),n.d(t,"eb",(function(){return ge})),n.d(t,"hb",(function(){return be})),n.d(t,"jb",(function(){return U})),n.d(t,"kb",(function(){return F})),n.d(t,"lb",(function(){return N})),n.d(t,"nb",(function(){return D})),n.d(t,"f",(function(){return fe})),n.d(t,"g",(function(){return me})),n.d(t,"c",(function(){return he})),n.d(t,"h",(function(){return je})),n.d(t,"ib",(function(){return ye})),n.d(t,"T",(function(){return xe})),n.d(t,"U",(function(){return ve})),n.d(t,"rb",(function(){return Oe})),n.d(t,"sb",(function(){return _e})),n.d(t,"qb",(function(){return Ae}));const r="@timestamp",a="kibana",i=`${a}.alert`,s=`${i}.rule`,o=`${a}.space_ids`,u=`${a}.version`,c=`${i}.action_group`,l=`${i}.case_ids`,d=`${i}.duration.us`,p=`${i}.end`,g=`${i}.flapping`,b=`${i}.flapping_history`,f=`${i}.maintenance_window_ids`,m=`${i}.instance.id`,h=`${i}.last_detected`,j=`${i}.reason`,y=`${i}.start`,x=`${i}.status`,v=`${i}.time_range`,O=`${i}.uuid`,_=`${i}.workflow_status`,A=`${i}.workflow_tags`,T=`${s}.category`,S=`${s}.consumer`,E=`${s}.execution.uuid`,I=`${s}.name`,w=`${s}.parameters`,k=`${s}.producer`,R=`${s}.revision`,C=`${s}.tags`,P=`${s}.rule_type_id`,L=`${i}.url`,M=`${s}.uuid`,U="ecs.version",F="event.action",N="event.kind",D="tags",V=`${i}.risk_score`,$=`${s}.author`,z=`${s}.created_at`,B=`${s}.created_by`,W=`${s}.description`,G=`${s}.enabled`,H=`${s}.from`,q=`${s}.interval`,Y=`${s}.license`,J=`${s}.note`,K=`${s}.references`,Q=`${s}.rule_id`,X=`${s}.rule_name_override`,Z=`${s}.to`,ee=`${s}.type`,te=`${s}.updated_at`,ne=`${s}.updated_by`,re=`${s}.version`,ae=`${i}.severity`,ie=`${i}.suppression`,se=`${ie}.terms`,oe=`${se}.field`,ue=`${se}.value`,ce=`${ie}.start`,le=`${ie}.end`,de=`${ie}.docs_count`,pe=`${i}.system_status`,ge=`${i}.workflow_reason`,be=`${i}.workflow_user`,fe=`${i}.evaluation.threshold`,me=`${i}.evaluation.value`,he=`${i}.context`,je=`${i}.evaluation.values`,ye={APM:"apm",LOGS:"logs",INFRASTRUCTURE:"infrastructure",OBSERVABILITY:"observability",SLO:"slo",SIEM:"siem",UPTIME:"uptime"},xe=(Object.values(ye).map((e=>e)),"active"),ve="recovered",Oe="/rule/:ruleId",_e="/app/management/insightsAndAlerting/triggersActions",Ae=e=>Oe.replace(":ruleId",e)},function(e,t,n){n.r(t);var r=__kbnBundles__.get("plugin/kibanaReact/public");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))},function(e,t,n){"use strict";n.d(t,"d",(function(){return r.a})),n.d(t,"e",(function(){return o})),n.d(t,"a",(function(){return l})),n.d(t,"b",(function(){return d})),n.d(t,"c",(function(){return g})),n.d(t,"f",(function(){return f}));var r=n(35),a=n(5);const i=e=>e.map((e=>s(e))),s=({connector_type_id:e,is_preconfigured:t,is_deprecated:n,referenced_by_count:r,is_missing_secrets:a,is_system_action:i,...s})=>({actionTypeId:e,isPreconfigured:t,isDeprecated:n,referencedByCount:r,isMissingSecrets:a,isSystemAction:i,...s});async function o({http:e}){const t=await e.get(`${a.a}/connectors`);return i(t)}const u=({actionTypeId:e,...t})=>({...t,connector_type_id:e}),c=({connector_type_id:e,is_preconfigured:t,is_deprecated:n,is_missing_secrets:r,is_system_action:a,...i})=>({...i,actionTypeId:e,isPreconfigured:t,isDeprecated:n,isMissingSecrets:r,isSystemAction:a});async function l({http:e,connector:t}){const n=await e.post(`${a.a}/connector`,{body:JSON.stringify(u(t))});return c(n)}async function d({ids:e,http:t}){const n=[],r=[];return await Promise.all(e.map((e=>t.delete(`${a.a}/connector/${encodeURIComponent(e)}`)))).then((function(e){n.push(...e)}),(function(e){r.push(...e)})),{successes:n,errors:r}}const p=({connector_id:e,service_message:t,...n})=>({...n,actionId:e,serviceMessage:t});async function g({id:e,params:t,http:n,signal:r}){const i=await n.post(`${a.a}/connector/${encodeURIComponent(e)}/_execute`,{body:JSON.stringify({params:t}),signal:r});return p(i)}const b=({connector_type_id:e,is_preconfigured:t,is_deprecated:n,is_missing_secrets:r,is_system_action:a,...i})=>({...i,actionTypeId:e,isPreconfigured:t,isDeprecated:n,isMissingSecrets:r,isSystemAction:a});async function f({http:e,connector:t,id:n}){const r=await e.put(`${a.a}/connector/${encodeURIComponent(n)}`,{body:JSON.stringify({name:t.name,config:t.config,secrets:t.secrets})});return b(r)}},function(e,t,n){n.r(t);var r=__kbnBundles__.get("plugin/actions/common");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))},function(e,t,n){"use strict";n.d(t,"a",(function(){return k})),n.d(t,"g",(function(){return C})),n.d(t,"f",(function(){return P})),n.d(t,"e",(function(){return W})),n.d(t,"b",(function(){return H})),n.d(t,"c",(function(){return q})),n.d(t,"d",(function(){return Y.a}));var r=n(13),a=n.n(r),i=n(1),s=n.n(i),o=n(2),u=n(3),c=n(69),l=(n(36),n(70)),d=n(21),p=n(0);const g={truncatedText:Object(p.css)("text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:",2,";-webkit-box-orient:vertical;overflow:hidden;word-break:break-word;","")},b=({text:e})=>Object(p.jsx)(o.EuiText,{size:"xs",color:"subdued",css:g.truncatedText},e);b.displayName="TruncatedText";const f=s.a.memo(b),m=u.i18n.translate("xpack.triggersActionsUI.components.addMessageVariables.loadingMessage",{defaultMessage:"Loading variables"}),h=u.i18n.translate("xpack.triggersActionsUI.components.addMessageVariables.noVariablesFound",{defaultMessage:"No variables found"}),j=u.i18n.translate("xpack.triggersActionsUI.components.addMessageVariables.noVariablesAvailable",{defaultMessage:"No variables available"}),y=u.i18n.translate("xpack.triggersActionsUI.components.addMessageVariables.deprecatedVariablesAreShown",{defaultMessage:"Deprecated variables are shown"}),x=u.i18n.translate("xpack.triggersActionsUI.components.addMessageVariables.deprecatedVariablesAreHidden",{defaultMessage:"Deprecated variables are hidden"}),v=u.i18n.translate("xpack.triggersActionsUI.components.addMessageVariables.hideDeprecatedVariables",{defaultMessage:"Hide"}),O=u.i18n.translate("xpack.triggersActionsUI.components.addMessageVariables.showAllDeprecatedVariables",{defaultMessage:"Show all"}),_=u.i18n.translate("xpack.triggersActionsUI.components.addMessageVariables.addVariablePopoverButton",{defaultMessage:"Add variable"}),A=u.i18n.translate("xpack.triggersActionsUI.components.addMessageVariables.addRuleVariableTitle",{defaultMessage:"Add variable"}),T=({buttonTitle:e,messageVariables:t,paramsProperty:n,onSelectEventHandler:r,showButtonTitle:a=!1})=>{var u;const[c,l]=Object(i.useState)(!1),[d,g]=Object(i.useState)(!1),{euiTheme:b}=Object(o.useEuiTheme)(),T=Object(i.useMemo)((()=>null==t?void 0:t.reduce(((e,t)=>({...e,[t.name]:t})),{})),[t]),S=Object(i.useMemo)((()=>c?t:null==t?void 0:t.filter((e=>!e.deprecated))),[t,c]),E=Object(i.useMemo)((()=>null==S?void 0:S.map((e=>({label:e.name,...e.deprecated?{disabled:!0}:{},data:{description:e.description},"data-test-subj":`${e.name}-selectableOption`})))),[S]),I=e||A,w=Object(i.useMemo)((()=>a?Object(p.jsx)(o.EuiButtonEmpty,{id:`${n}AddVariableButton`,"data-test-subj":`${n}AddVariableButton-Title`,size:"xs",onClick:()=>g(!0),"aria-label":_},I):Object(p.jsx)(o.EuiButtonIcon,{id:`${n}AddVariableButton`,"data-test-subj":`${n}AddVariableButton`,title:I,onClick:()=>g(!0),iconType:"indexOpen","aria-label":_})),[I,n,a]);if(0===(null!==(u=null==t?void 0:t.length)&&void 0!==u?u:0))return Object(p.jsx)(s.a.Fragment,null);const k=({description:e,label:t})=>Object(p.jsx)(s.a.Fragment,null,Object(p.jsx)(o.EuiText,{size:"s",style:{fontWeight:b.font.weight.bold}},t),Object(p.jsx)(o.EuiSpacer,{size:"s"}),Object(p.jsx)("hr",null),Object(p.jsx)(o.EuiSpacer,{size:"s"}),Object(p.jsx)(o.EuiText,{size:"xs"},e));return Object(p.jsx)(o.EuiPopover,{button:w,isOpen:d,closePopover:()=>g(!1),panelPaddingSize:"s",anchorPosition:"upRight",panelStyle:{minWidth:350}},Object(p.jsx)(o.EuiSelectable,{searchable:!0,height:300,"data-test-subj":"messageVariablesSelectableList",isLoading:!1,options:E,listProps:{rowHeight:70,showIcons:!1,paddingSize:"none",textWrap:"wrap"},loadingMessage:m,noMatchesMessage:h,emptyMessage:j,renderOption:(e,t)=>Object(p.jsx)(o.EuiFlexGroup,{"data-test-subj":`variableMenuButton-${e.label}`},Object(p.jsx)(o.EuiFlexItem,null,Object(p.jsx)(o.EuiText,{size:"s",style:{fontWeight:b.font.weight.bold}},Object(p.jsx)(o.EuiHighlight,{search:t},e.label)),Object(p.jsx)(o.EuiSpacer,{size:"xs"}),e.description&&Object(p.jsx)(s.a.Fragment,null,Object(p.jsx)(o.EuiToolTip,{display:"block",position:"top",content:Object(p.jsx)(k,{description:e.description,label:e.label}),"data-test-subj":`${e.label}-tooltip`},Object(p.jsx)(f,{text:e.description||""}))))),onChange:e=>{e.map((e=>{"on"===e.checked&&T&&r(T[e.label])})),g(!1)},singleSelection:!0,searchProps:{"data-test-subj":"messageVariablesSelectableSearch"}},((e,t)=>Object(p.jsx)(s.a.Fragment,null,t,Object(p.jsx)(o.EuiSpacer,{size:"xs"}),e,Object(p.jsx)(o.EuiPopoverFooter,{style:{paddingTop:0,paddingBottom:0}},Object(p.jsx)(o.EuiFlexGroup,{gutterSize:"s",alignItems:"center",justifyContent:"spaceBetween",responsive:!1,wrap:!0},Object(p.jsx)(o.EuiFlexItem,{grow:!1},Object(p.jsx)(o.EuiText,{color:"grey",size:"xs"},c?y:x)),Object(p.jsx)(o.EuiFlexItem,{grow:!1},Object(p.jsx)(o.EuiButtonEmpty,{"data-test-subj":"showDeprecatedVariablesButton",size:"xs",onClick:()=>l(!c)},c?v:O))))))))};var S=n(14);const E=u.i18n.translate("xpack.triggersActionsUI.components.jsonEditorWithMessageVariable.noEditorErrorTitle",{defaultMessage:"Unable to add message variable"}),I=u.i18n.translate("xpack.triggersActionsUI.components.jsonEditorWithMessageVariable.noEditorErrorMessage",{defaultMessage:"Editor was not found, please refresh page and try again"}),{useXJsonMode:w}=l.XJson,k=({buttonTitle:e,messageVariables:t,paramsProperty:n,inputTargetValue:r,label:u,errors:l,areaLabel:g,onDocumentsChange:b,helpText:f,onBlur:m,showButtonTitle:h,euiCodeEditorProps:j={}})=>{const y=Object(i.useRef)(),x=Object(i.useRef)([]),[v,O]=Object(i.useState)(!1),{convertToJson:_,setXJson:A,xJson:k}=w(null!=r?r:null);Object(i.useEffect)((()=>{!k&&r&&A(r)}),[r]);const R=Object(i.useCallback)((()=>{const e=y.current;e&&x.current.push(e.onDidBlurEditorWidget((()=>{null==m||m()})))}),[m]);return Object(i.useEffect)((()=>(R(),()=>(x.current.forEach((e=>{e.dispose()})),void(x.current=[])))),[R]),Object(p.jsx)(o.EuiFormRow,{"data-test-subj":"actionJsonEditor",fullWidth:!0,error:l,isInvalid:l&&l.length>0&&void 0!==r,label:u,labelAppend:Object(p.jsx)(T,{buttonTitle:e,messageVariables:t,onSelectEventHandler:e=>{const t=y.current;if(!t)return void O(!0);const n=t.getSelection(),r=Object(S.e)(e);let a="";n?(t.executeEdits("json-editor-with-message-variables",[{range:n,text:r}]),a=t.getValue()):a=r,O(!1),A(a),b(_(a))},paramsProperty:n,showButtonTitle:h}),helpText:f},Object(p.jsx)(s.a.Fragment,null,v?Object(p.jsx)(s.a.Fragment,null,Object(p.jsx)(o.EuiSpacer,{size:"s"}),Object(p.jsx)(o.EuiCallOut,{size:"s",color:"danger",iconType:"warning",title:E},Object(p.jsx)("p",null,I)),Object(p.jsx)(o.EuiSpacer,{size:"s"})):null,Object(p.jsx)(d.CodeEditor,a()({languageId:c.XJsonLang.ID,options:{renderValidationDecorations:k?"on":"off",lineNumbers:"on",fontSize:14,minimap:{enabled:!1},scrollBeyondLastLine:!1,folding:!0,wordWrap:"on",wrappingIndent:"indent",automaticLayout:!0},value:k,width:"100%",height:"200px","data-test-subj":`${n}JsonEditor`,"aria-label":g},j,{editorDidMount:e=>{y.current=e,R()},onChange:e=>{A(e),b(_(e))}}))))},R=({children:e,wrapField:t,formRowProps:n,button:r})=>t?Object(p.jsx)(o.EuiFormRow,a()({},n,{labelAppend:r}),e):Object(p.jsx)(s.a.Fragment,null,e),C=({buttonTitle:e,messageVariables:t,paramsProperty:n,index:r,inputTargetValue:a,editAction:s,errors:u,formRowProps:c,defaultValue:l,wrapField:d=!1,showButtonTitle:g})=>{const[b,f]=Object(i.useState)(null),m=Object(i.useCallback)((e=>{var t,i;const o=Object(S.e)(e),u=null!==(t=null==b?void 0:b.selectionStart)&&void 0!==t?t:0,c=null!==(i=null==b?void 0:b.selectionEnd)&&void 0!==i?i:0,l=(null!=a?a:"").substring(0,u)+o+(null!=a?a:"").substring(c,(null!=a?a:"").length);s(n,l,r)}),[b,s,r,a,n]),h=Object(i.useMemo)((()=>Object(p.jsx)(T,{buttonTitle:e,messageVariables:t,onSelectEventHandler:m,paramsProperty:n,showButtonTitle:g})),[e,t,m,n,g]);return Object(p.jsx)(R,{wrapField:d,formRowProps:c,button:h},Object(p.jsx)(o.EuiFieldText,{fullWidth:!0,name:n,id:`${n}Id`,isInvalid:u&&u.length>0&&void 0!==a,"data-test-subj":`${n}Input`,value:a||"",defaultValue:l,onChange:e=>(e=>{s(n,e.target.value,r)})(e),onFocus:e=>{f(e.target)},onBlur:e=>{a||s(n,"",r)},append:d?void 0:h}))},P=({messageVariables:e,paramsProperty:t,index:n,inputTargetValue:r,isDisabled:a=!1,editAction:s,label:u,errors:c,helpText:l})=>{const[d,g]=Object(i.useState)(null);return Object(p.jsx)(o.EuiFormRow,{fullWidth:!0,error:c,isDisabled:a,isInvalid:c&&c.length>0&&void 0!==r,label:u,labelAppend:Object(p.jsx)(T,{messageVariables:e,onSelectEventHandler:e=>{var a,i;const o=Object(S.e)(e),u=null!==(a=null==d?void 0:d.selectionStart)&&void 0!==a?a:0,c=null!==(i=null==d?void 0:d.selectionEnd)&&void 0!==i?i:0,l=(null!=r?r:"").substring(0,u)+o+(null!=r?r:"").substring(c,(null!=r?r:"").length);s(t,l,n)},paramsProperty:t}),helpText:l},Object(p.jsx)(o.EuiTextArea,{disabled:a,fullWidth:!0,isInvalid:c&&c.length>0&&void 0!==r,name:t,value:r||"","data-test-subj":`${t}TextArea`,onChange:e=>(e=>{s(t,e.target.value,n)})(e),onFocus:e=>{g(e.target)},onBlur:()=>{r||s(t,"",n)}}))};var L=n(37),M=n(15),U=n(62);const F=Object(M.getUseField)({component:L.Field}),N=Object(M.getUseField)({component:L.ComboBoxField}),{emptyField:D,urlField:V}=U.fieldValidators,$=({label:e,isRequired:t=!0,isUrlField:n=!1,defaultValue:r,type:a})=>({label:e,validations:[...t?[{validator:D(u.i18n.translate("xpack.triggersActionsUI.sections.actionConnectorForm.error.requireFieldText",{values:{label:e},defaultMessage:"{label} is required."}))}]:[],...n?[{validator:V(u.i18n.translate("xpack.triggersActionsUI.sections.actionConnectorForm.error.invalidURL",{defaultMessage:"Invalid URL"}))}]:[]],defaultValue:r,...a&&M.FIELD_TYPES[a]?{type:M.FIELD_TYPES[a],defaultValue:Array.isArray(r)?r:[]}:{}}),z=({id:e,label:t,readOnly:n,isPasswordField:r,isRequired:a=!0,isUrlField:i,helpText:u,defaultValue:c,euiFieldProps:l={},type:d})=>{const g=`${e}-input`,b=(e=>{let t=F;return e&&M.FIELD_TYPES[e]===M.FIELD_TYPES.COMBO_BOX&&(t=N),t})(d);return Object(p.jsx)(s.a.Fragment,null,Object(p.jsx)(o.EuiFlexGroup,null,Object(p.jsx)(o.EuiFlexItem,null,r?Object(p.jsx)(b,{path:e,config:$({label:t,type:d,isRequired:a}),helpText:u,component:L.PasswordField,componentProps:{euiFieldProps:{...l,"data-test-subj":g,readOnly:n}}}):Object(p.jsx)(b,{path:e,config:$({label:t,isUrlField:i,defaultValue:c,type:d,isRequired:a}),helpText:u,componentProps:{euiFieldProps:{...l,readOnly:n,fullWidth:!0,"data-test-subj":g}}}))))},B=({isEdit:e,readOnly:t,configFormSchema:n,secretsFormSchema:r,configFormSchemaAfterSecrets:i=[]})=>Object(p.jsx)(s.a.Fragment,null,n.map((({id:e,...r},i)=>Object(p.jsx)(s.a.Fragment,{key:`config.${e}`},Object(p.jsx)(z,a()({id:`config.${e}`},r,{readOnly:t})),i!==n.length?Object(p.jsx)(o.EuiSpacer,{size:"m"}):null))),Object(p.jsx)(o.EuiFlexGroup,null,Object(p.jsx)(o.EuiFlexItem,null,Object(p.jsx)(o.EuiTitle,{size:"xxs"},Object(p.jsx)("h4",null,u.i18n.translate("xpack.triggersActionsUI.components.simpleConnectorForm.secrets.authenticationLabel",{defaultMessage:"Authentication"}))))),Object(p.jsx)(o.EuiSpacer,{size:"m"}),r.map((({id:e,...n},i)=>Object(p.jsx)(s.a.Fragment,{key:`secrets.${e}`},Object(p.jsx)(z,a()({id:`secrets.${e}`,key:`secrets.${e}`},n,{readOnly:t})),i!==r.length?Object(p.jsx)(o.EuiSpacer,{size:"m"}):null))),i.map((({id:e,...n},r)=>Object(p.jsx)(s.a.Fragment,{key:`config.${e}`},Object(p.jsx)(z,a()({id:`config.${e}`},n,{readOnly:t})),r!==i.length?Object(p.jsx)(o.EuiSpacer,{size:"m"}):null)))),W=Object(i.memo)(B),G={editor:{name:"1236snz",styles:".euiFormRow__fieldWrapper .kibanaCodeEditor{height:auto;}"}},H=({field:e,...t})=>{const{errorMessage:n}=Object(M.getFieldValidityAndErrorMessage)(e),{label:r,helpText:s,value:o,setValue:c}=e,l=Object(i.useCallback)((e=>{c(e)}),[c]);return Object(p.jsx)("span",{css:G.editor},Object(p.jsx)(k,a()({errors:n?[n]:[],helpText:Object(p.jsx)("p",null,s),inputTargetValue:o,label:null!=r?r:u.i18n.translate("xpack.triggersActionsUI.jsonFieldWrapper.defaultLabel",{defaultMessage:"JSON Editor"}),onDocumentsChange:l},t)))},q=({field:e,euiFieldProps:t,idAria:n,...r})=>{const{isInvalid:s,errorMessage:o}=Object(M.getFieldValidityAndErrorMessage)(e),{value:u,setValue:c}=e,l=Object(i.useCallback)(((e,t)=>{c(t)}),[c]);return Object(p.jsx)(C,a()({errors:o?[o]:[],formRowProps:{describedByIds:n?[n]:void 0,error:o,fullWidth:!0,helpText:"function"==typeof e.helpText?e.helpText():e.helpText,isInvalid:s,label:e.label,...r},index:0,inputTargetValue:u,wrapField:!0},t,{editAction:l}))};var Y=n(52)},function(e,t){e.exports=__kbnSharedDeps__.KbnI18nReact},function(e,t,n){"use strict";n.d(t,"b",(function(){return d})),n.d(t,"e",(function(){return p})),n.d(t,"f",(function(){return g})),n.d(t,"d",(function(){return b})),n.d(t,"g",(function(){return f})),n.d(t,"a",(function(){return x})),n.d(t,"h",(function(){return j})),n.d(t,"c",(function(){return y}));var r=n(11),a=n(3),i=n(9);const s=1e3;function o(e,t){if(e)return function(e,t){const n=Date.parse(e);if(isNaN(n))throw new Error(c("date",t,e));return n.valueOf()}(e,t)}function u(e,t){try{return Object(r.parseDuration)(e)}catch(n){throw new Error(c("duration",t,e))}}function c(e,t,n){return a.i18n.translate("xpack.triggersActionsUI.data.coreQueryParams.formattedFieldErrorMessage",{defaultMessage:'invalid {formatName} format for {fieldName}: "{fieldValue}"',values:{formatName:e,fieldName:t,fieldValue:n}})}const l="compareValue",d=`params.${l}`,p=e=>"count"===e,g=e=>!!e,b=({timeSeries:e,aggType:t,aggField:n,termField:r,termSize:c,condition:d,topHitsSize:b})=>{const f={aggs:{}},m=p(t),h=g(r),j=!!e,y=!!d;let x=null;if(j){const{timeWindowSize:t,timeWindowUnit:n,dateStart:r,dateEnd:c,interval:l}=e;x=function(e){const{dateStart:t,dateEnd:n,interval:r,window:c}=e,l=o(n,"dateEnd")||Date.now(),d=o(t,"dateStart")||l;if(d>l)throw new Error(a.i18n.translate("xpack.triggersActionsUI.data.coreQueryParams.dateStartGTdateEndErrorMessage",{defaultMessage:"[dateStart]: is greater than [dateEnd]"}));const p=((g=r)?u(g,"interval"):void 0)||0;var g;const b=u(c,"window");let f=l;const m=[],h=p?1+Math.round((l-d)/p):1;if(h>s)throw new Error(function(e,t){return a.i18n.translate("xpack.triggersActionsUI.data.coreQueryParams.maxIntervalsErrorMessage",{defaultMessage:"calculated number of intervals {intervals} is greater than maximum {maxIntervals}",values:{intervals:e,maxIntervals:t}})}(h,s));return Object(i.times)(h,(()=>{m.push({from:new Date(f-b).toISOString(),to:new Date(f).toISOString()}),f-=p})),m.reverse(),{dateStart:m[0].from,dateEnd:m[m.length-1].to,dateRanges:m}}({dateStart:r,dateEnd:c,window:`${t}${n}`,interval:l})}let v=c||100;v=y&&d.resultLimit&&v>d.resultLimit?d.resultLimit+1:v;let O=f;const _=()=>j?"sortValueAgg":"metricAgg";if(h){if(O.aggs={groupAgg:{terms:{field:r,size:v}},...y?{groupAggCount:{stats_bucket:{buckets_path:"groupAgg._count"}}}:{}},m)y&&(O.aggs.groupAgg.aggs={conditionSelector:{bucket_selector:{buckets_path:{[l]:"_count"},script:d.conditionScript}}});else{const e="min"===t?"asc":"desc";O.aggs.groupAgg.terms.order={[_()]:e}}O=O.aggs.groupAgg}return j&&(O.aggs={...O.aggs,dateAgg:{date_range:{field:e.timeField,format:"strict_date_time",ranges:x.dateRanges}}}),h&&b&&(O.aggs={...O.aggs,topHitsAgg:{top_hits:{size:b}}}),m||(O.aggs={...O.aggs,[_()]:{[t]:{field:n}}},h&&y&&(O.aggs.conditionSelector={bucket_selector:{buckets_path:{[l]:_()},script:d.conditionScript}})),e&&x&&(O=O.aggs.dateAgg,m||(O.aggs={metricAgg:{[t]:{field:n}}})),f.aggs},f=({isCountAgg:e,isGroupAgg:t,esResult:n,resultLimit:r})=>{var a,i,s;const o=(null==n?void 0:n.aggregations)||{};var u,c,l,d,p;t||(o.groupAgg={buckets:[{key:"all documents",doc_count:(d=n.hits.total,"number"==typeof d?d:null!==(p=null==d?void 0:d.value)&&void 0!==p?p:0),topHitsAgg:{hits:{hits:null!==(u=n.hits.hits)&&void 0!==u?u:[]}},...e?{}:{metricAgg:{value:null!==(c=null===(l=o.metricAgg)||void 0===l?void 0:l.value)&&void 0!==c?c:0}}}]});const g=(null===(a=o.groupAgg)||void 0===a?void 0:a.buckets)||[],b=null!==(i=null===(s=o.groupAggCount)||void 0===s?void 0:s.count)&&void 0!==i?i:0,f={results:[],truncated:!!r&&b>r};for(const t of g){var m,h,j,y;if(r&&f.results.length===r)break;const n={group:`${null==t?void 0:t.key}`,count:null==t?void 0:t.doc_count,hits:null!==(m=null==t||null===(h=t.topHitsAgg)||void 0===h||null===(j=h.hits)||void 0===j?void 0:j.hits)&&void 0!==m?m:[],...e?{}:{value:null==t||null===(y=t.metricAgg)||void 0===y?void 0:y.value}};f.results.push(n)}return f};var m=n(53);const h=new RegExp(`^([\\d\\.]+)\\s*(${n.n(m).a.units.join("|")})$`),j=e=>{if(e){const t=e.match(h);if(t)return{value:Number(t[1]),unit:t[2]}}throw new Error(a.i18n.translate("xpack.triggersActionsUI.parseInterval.errorMessage",{defaultMessage:"{value} is not an interval string",values:{value:e}}))};n(27);const y={long:"number",integer:"number",short:"number",byte:"number",double:"number",float:"number",half_float:"number",scaled_float:"number",unsigned_long:"number"},x="/internal/triggers_actions_ui"},function(e,t,n){"use strict";n.d(t,"c",(function(){return s})),n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return u}));const r=Object.freeze({rulesListDatagrid:!0,internalAlertsTable:!1,ruleTagFilter:!0,ruleStatusFilter:!0,rulesDetailLogs:!0,ruleUseExecutionStatus:!1,ruleKqlBar:!1}),a=class extends Error{},i=Object.keys(r),s=e=>{const t={};for(const n of e){if(!o(n))throw new a(`[${n}] is not valid.`);t[n]=!0}return{...r,...t}},o=e=>i.includes(e),u=()=>[...i]},function(e,t){e.exports=__kbnSharedDeps__.SaferLodashSet},function(e,t,n){"use strict";n.d(t,"a",(function(){return r.KibanaContextProvider})),n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return s}));var r=n(21);const a=()=>Object(r.useKibana)();var i=n(1);const s=()=>{const{spaces:e}=a().services,[t,n]=Object(i.useState)(void 0),r=null==e?void 0:e.ui.useSpaces();return Object(i.useEffect)((()=>{(async()=>{const e=await(null==r?void 0:r.spacesDataPromise);n(e)})()}),[e,r,n]),t}},function(e,t,n){"use strict";n.d(t,"c",(function(){return i})),n.d(t,"a",(function(){return s})),n.d(t,"d",(function(){return o})),n.d(t,"b",(function(){return u})),n.d(t,"e",(function(){return c}));var r=n(11),a=n(41);const i=e=>{switch(e){case"succeeded":return"success";case"failed":return"danger";case"warning":return"warning";default:return"subdued"}},s=e=>{switch(e){case"active":return"success";case"error":return"danger";case"ok":return"primary";case"pending":return"accent";case"warning":return"warning";default:return"subdued"}},o=e=>Object(a.a)("ruleUseExecutionStatus")?s(e.executionStatus.status):e.lastRun&&i(e.lastRun.outcome)||"subdued",u=e=>{var t,n;return(null===(t=e.lastRun)||void 0===t?void 0:t.warning)===r.RuleExecutionStatusErrorReasons.License||(null===(n=e.executionStatus.error)||void 0===n?void 0:n.reason)===r.RuleExecutionStatusErrorReasons.License},c=({rule:e,licenseErrorText:t,lastOutcomeTranslations:n,executionStatusTranslations:r})=>{const i=u(e),s=Object(a.a)("ruleUseExecutionStatus");return i?t:s?r[e.executionStatus.status]:e.lastRun&&n[e.lastRun.outcome]}},function(e,t){e.exports=__kbnSharedDeps__.Moment},function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return s}));const r=({last_execution_date:e,last_duration:t,...n})=>({lastExecutionDate:e,lastDuration:t,...n}),a=({outcome_msg:e,outcome_order:t,alerts_count:n,...r})=>({outcomeMsg:e,outcomeOrder:t,alertsCount:n,...r}),i=({rule_type_id:e,created_by:t,updated_by:n,created_at:i,updated_at:s,api_key_owner:o,api_key_created_by_user:u,notify_when:c,mute_all:l,muted_alert_ids:d,scheduled_task_id:p,execution_status:g,actions:b,snooze_schedule:f,is_snoozed_until:m,active_snoozes:h,last_run:j,next_run:y,...x})=>({ruleTypeId:e,createdBy:t,updatedBy:n,createdAt:i,updatedAt:s,apiKeyOwner:o,notifyWhen:c,muteAll:l,mutedInstanceIds:d,snoozeSchedule:f,executionStatus:g?r(g):void 0,actions:b?b.map((e=>(({uuid:e,group:t,id:n,connector_type_id:r,params:a,frequency:i,alerts_filter:s})=>({group:t,id:n,params:a,actionTypeId:r,...i?{frequency:{summary:i.summary,notifyWhen:i.notify_when,throttle:i.throttle}}:{},...s?{alertsFilter:s}:{},...e&&{uuid:e}}))(e))):[],scheduledTaskId:p,isSnoozedUntil:m,activeSnoozes:h,...j?{lastRun:a(j)}:{},...y?{nextRun:y}:{},...void 0!==u?{apiKeyCreatedByUser:u}:{},...x}),s=({alias_target_id:e,alias_purpose:t,outcome:n,...r})=>({...i(r),alias_target_id:e,alias_purpose:t,outcome:n})},function(e,t){e.exports=__kbnSharedDeps__.ElasticNumeral},function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return s}));var r=n(1),a=n(4);const i=Object(a.a)(Object(r.lazy)((()=>Promise.all([n.e(1),n.e(3),n.e(15)]).then(n.bind(null,74))))),s=Object(a.a)(Object(r.lazy)((()=>Promise.all([n.e(1),n.e(3),n.e(16)]).then(n.bind(null,75)))))},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(5);const a=e=>e.map((e=>i(e))),i=({enabled_in_config:e,enabled_in_license:t,minimum_license_required:n,supported_feature_ids:r,is_system_action_type:a,...i})=>({enabledInConfig:e,enabledInLicense:t,minimumLicenseRequired:n,supportedFeatureIds:r,isSystemActionType:a,...i});async function s({http:e,featureId:t}){const n=t?await e.get(`${r.a}/connector_types`,{query:{feature_id:t}}):await e.get(`${r.a}/connector_types`);return a(n)}},function(e,t,n){switch(window.__kbnThemeTag__){case"v8dark":return n(79);case"v8light":return n(81)}},function(e,t,n){n.r(t);var r=__kbnBundles__.get("plugin/esUiShared/static/forms/components");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(3),a=n(5);function i(e=a.o.SECOND,t="0"){switch(e){case a.o.SECOND:return r.i18n.translate("xpack.triggersActionsUI.timeUnits.secondLabel",{defaultMessage:"{timeValue, plural, one {second} other {seconds}}",values:{timeValue:t}});case a.o.MINUTE:return r.i18n.translate("xpack.triggersActionsUI.timeUnits.minuteLabel",{defaultMessage:"{timeValue, plural, one {minute} other {minutes}}",values:{timeValue:t}});case a.o.HOUR:return r.i18n.translate("xpack.triggersActionsUI.timeUnits.hourLabel",{defaultMessage:"{timeValue, plural, one {hour} other {hours}}",values:{timeValue:t}});case a.o.DAY:return r.i18n.translate("xpack.triggersActionsUI.timeUnits.dayLabel",{defaultMessage:"{timeValue, plural, one {day} other {days}}",values:{timeValue:t}})}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return s})),n.d(t,"d",(function(){return u})),n.d(t,"c",(function(){return c}));const r="/internal/triggers_actions_ui/data",a=e=>{let t=e;return t.startsWith("*")||(t=`*${t}`),t.endsWith("*")||(t=`${t}*`),t};async function i({pattern:e,http:t}){try{const n=a(e),{indices:i}=await t.post(`${r}/_indices`,{body:JSON.stringify({pattern:n})});return i}catch(e){return[]}}async function s({indexes:e,http:t}){const{fields:n}=await t.post(`${r}/_fields`,{body:JSON.stringify({indexPatterns:e})});return n}let o;const u=e=>{o=e},c=async e=>{const t=a(e);try{return(await o.find(t,1e3)).map((e=>e.title))}catch(e){return[]}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return ExperimentalFeaturesService}));var r=n(16),a=n.n(r);class ExperimentalFeaturesService{static init({experimentalFeatures:e}){this.experimentalFeatures=e}static get(){return this.experimentalFeatures||this.throwUninitializedError(),this.experimentalFeatures}static throwUninitializedError(){throw new Error("Experimental features services not initialized - are you trying to import this module from outside of the triggers actions UI app?")}}a()(ExperimentalFeaturesService,"experimentalFeatures",void 0)},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(27),a=n(40);const i=Object(r.a)(),s=e=>{if(!Object(r.b)(e))throw new Error(`Invalid enable value ${e}. Allowed values are: ${i.join(", ")}`);return a.a.get()[e]}},function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return s}));var r=n(38),a=n(5);const i=e=>Object.entries(a.o).map((([t,n])=>({text:Object(r.a)(n,e.toString()),value:n}))),s=e=>{const t=[];return e.forEach((e=>{"date"!==e.type&&"date_nanos"!==e.type||t.push({text:e.name,value:e.name})})),t}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return i}));var r=n(3);const a=r.i18n.translate("xpack.triggersActionsUI.cases.label",{defaultMessage:"Cases"}),i=r.i18n.translate("xpack.triggersActionsUI.maintenanceWindows.label",{defaultMessage:"Maintenance Windows"})},function(e,t,n){"use strict";var r=n(42);n.d(t,"c",(function(){return r.a}));var a=n(30);n.d(t,"b",(function(){return a.c})),n.d(t,"a",(function(){return a.a}));var i=n(29);n.d(t,"d",(function(){return i.b}))},function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return i}));var r=n(3);r.i18n.translate("xpack.triggersActionsUI.sections.actionForm.preconfiguredTitleMessage",{defaultMessage:"(preconfigured)"});const a=r.i18n.translate("xpack.triggersActionsUI.sections.deprecatedTitleMessage",{defaultMessage:"(deprecated)"}),i=r.i18n.translate("xpack.triggersActionsUI.sections.isDeprecatedDescription",{defaultMessage:"This connector is deprecated. Update it, or create a new one."})},function(e,t,n){n.r(t);var r=__kbnBundles__.get("plugin/kibanaUtils/public");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return a}));const r=({rule_execution_status:e,rule_last_run_outcome:t,rule_enabled_status:n,rule_muted_status:r,rule_snoozed_status:a,rule_tags:i,...s})=>({...s,ruleExecutionStatus:e,ruleEnabledStatus:n,ruleMutedStatus:r,ruleSnoozedStatus:a,ruleLastRunOutcome:t,ruleTags:i}),a=({per_page:e,...t})=>({perPage:e,...t})},function(e,t,n){"use strict";var r,a=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),i=[];function s(e){for(var t=-1,n=0;nObject(a.jsx)(r.EuiFlexGroup,{"data-test-subj":"centerJustifiedSpinner",justifyContent:"center"},Object(a.jsx)(r.EuiFlexItem,{grow:!1},Object(a.jsx)(r.EuiLoadingSpinner,{size:e||"xl"})))},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(5);const a=e=>e.map((e=>i(e))),i=({enabled_in_license:e,recovery_action_group:t,action_groups:n,default_action_group_id:r,minimum_license_required:a,action_variables:i,authorized_consumers:s,rule_task_timeout:o,does_set_recovery_context:u,default_schedule_interval:c,has_alerts_mappings:l,has_fields_for_a_a_d:d,...p})=>({enabledInLicense:e,recoveryActionGroup:t,actionGroups:n,defaultActionGroupId:r,minimumLicenseRequired:a,actionVariables:i,authorizedConsumers:s,ruleTaskTimeout:o,doesSetRecoveryContext:u,defaultScheduleInterval:c,hasAlertsMappings:l,hasFieldsForAAD:d,...p});async function s({http:e}){const t=await e.get(`${r.b}/rule_types`);return a(t)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n(1);var r=n(2),a=n(0);const i=({children:e})=>Object(a.jsx)(r.EuiEmptyPrompt,{title:Object(a.jsx)(r.EuiLoadingSpinner,{size:"xl"}),body:Object(a.jsx)(r.EuiText,{color:"subdued"},e),"data-test-subj":"sectionLoading"})},function(e,t){e.exports=__kbnSharedDeps__.KbnDatemath},function(e,t,n){"use strict";n.d(t,"d",(function(){return s})),n.d(t,"b",(function(){return o})),n.d(t,"c",(function(){return u})),n.d(t,"a",(function(){return c}));var r=n(28),a=n(9);const i=n(3).i18n.translate("xpack.triggersActionsUI.sections.actionTypeForm.error.requiredFilterQuery",{defaultMessage:"A custom query is required."}),s=e=>{var t;const n=null===(t=e.alertsFilter)||void 0===t?void 0:t.query;return n&&!n.kql?i:null};function o(e){return t=>{if(null==t)throw new Error(e);return t}}function u(e,t,n){const r="function"==typeof t?t:Object(a.constant)(t);return t=>{const a=new Set(t.map(n));for(const t of e.values())if(!a.has(t))throw new Error(r(t));return t}}function c(e,t,n,i){return Object.keys(t).forEach((n=>{t[n].length>=1&&void 0===Object(a.get)(e.params,n)&&Object(r.set)(e.params,n,null)})),Object.keys(n).forEach((t=>{n[t].length>=1&&void 0===Object(a.get)(e,t)&&Object(r.set)(e,t,null)})),i.forEach(((t,n)=>{const i=e.actions.length>n?e.actions[n]:null;i&&Object.keys(t).forEach((e=>{t[e].length>=1&&void 0===Object(a.get)(i.params,e)&&Object(r.set)(i.params,e,null)}))})),e}},function(e,t,n){"use strict";n.d(t,"c",(function(){return s})),n.d(t,"e",(function(){return o})),n.d(t,"l",(function(){return u})),n.d(t,"f",(function(){return l})),n.d(t,"g",(function(){return d})),n.d(t,"m",(function(){return p})),n.d(t,"j",(function(){return g})),n.d(t,"h",(function(){return b})),n.d(t,"i",(function(){return f})),n.d(t,"k",(function(){return m})),n.d(t,"n",(function(){return h})),n.d(t,"a",(function(){return j})),n.d(t,"b",(function(){return y})),n.d(t,"d",(function(){return x}));var r=n(20),a=n(57),i=n(43);const s=925,o=260,u=e=>null!=e&&null!=e.fields?Object.keys(e.fields).length:0,c=(e,t)=>{const n=[i.a.toLocaleLowerCase(),i.b.toLocaleLowerCase(),"cases","maintenance windows"],a=[r.b,r.m],s=t.toLocaleLowerCase(),o=a.includes(e),u=n.some((e=>e.includes(s)));return o&&u};function l({browserFields:e,substring:t}){const n=t.trim();if(""===n)return e;const r={};for(const[t,a]of Object.entries(e)){if(!a.fields)continue;let i=!1;const s={};for(const[e,t]of Object.entries(a.fields)){const r=t.name;r&&null!==r&&(r.includes(n)||c(r,n))&&(i=!0,s[e]=t)}i&&(r[t]={...e[t],fields:s})}return r}const d=({browserFields:e,columnIds:t})=>{const n=new Set(t),r={};for(const[t,a]of Object.entries(e)){if(!a.fields)continue;let i=!1;const s={};for(const[e,t]of Object.entries(a.fields)){const r=t.name;r&&n.has(r)&&(i=!0,s[e]=t)}i&&(r[t]={...e[t],fields:s})}return r},p=e=>{switch(e){case"string":case"keyword":return"string";case"number":case"long":case"float":return"number";case"date":return"clock";case"ip":case"geo_point":return"globe";default:return"questionInCircle"}},g=()=>"—",b=e=>{var t;const n=null==e?void 0:e.split(".");return 1===(null==n?void 0:n.length)?"base":null!==(t=null==n?void 0:n[0])&&void 0!==t?t:"(unknown)"},f=(e,t)=>{var n,r;return null!==(n=null===(r=t[e])||void 0===r?void 0:r.description)&&void 0!==n?n:""},m=e=>Object(a.isEmpty)(e)?"":`Example: ${e}`,h=e=>"Escape"===e.key,j="category-table",y="close-button",x="reset-fields"},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(5);const a=async({filter:e,ids:t,http:n})=>{try{const a=JSON.stringify({...null!=t&&t.length?{ids:t}:{},...e?{filter:JSON.stringify(e)}:{}});return n.patch(`${r.j}/rules/_bulk_delete`,{body:a})}catch(e){throw new Error(`Unable to parse bulk delete params: ${e}`)}}},function(e,t){e.exports=__kbnSharedDeps__.LodashFp},function(e,t,n){"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,a,i;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(a=r;0!=a--;)if(!e(t[a],n[a]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(i=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(a=r;0!=a--;)if(!Object.prototype.hasOwnProperty.call(n,i[a]))return!1;for(a=r;0!=a--;){var s=i[a];if(!e(t[s],n[s]))return!1}return!0}return t!=t&&n!=n}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(5);const a=({values_with_timestamp:e,...t})=>({valuesWithTimestamp:e,...t}),i=({rule_type_id:e,mute_all:t,status_start_date:n,status_end_date:r,error_messages:i,last_run:s,execution_duration:o,...u})=>({...u,ruleTypeId:e,muteAll:t,statusStartDate:n,statusEndDate:r,errorMessages:i,lastRun:s,executionDuration:o?a(o):void 0});async function s({http:e,ruleId:t,numberOfExecutions:n}){const a=await e.get(`${r.j}/rule/${encodeURIComponent(t)}/_alert_summary`,{query:{number_of_executions:n}});return i(a)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(5),a=n(32);async function i({http:e,ruleId:t}){const n=await e.get(`${r.j}/rule/${encodeURIComponent(t)}`);return Object(a.b)(n)}},function(e,t){e.exports=__kbnSharedDeps_npm__},function(e,t,n){n.r(t);var r=__kbnBundles__.get("plugin/esUiShared/static/forms/helpers");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))},function(e,t,n){"use strict";n.d(t,"b",(function(){return s})),n.d(t,"a",(function(){return o}));var r=n(5);const a=({typesFilter:e,actionTypesFilter:t,ruleExecutionStatusesFilter:n,ruleStatusesFilter:r,tagsFilter:a})=>{const i=[];if(e&&e.length&&i.push(`alert.attributes.alertTypeId:(${e.join(" or ")})`),t&&t.length&&i.push(["(",t.map((e=>`alert.attributes.actions:{ actionTypeId:${e} }`)).join(" OR "),")"].join("")),n&&n.length&&i.push(`alert.attributes.executionStatus.status:(${n.join(" or ")})`),r&&r.length){const e="(alert.attributes.muteAll:true OR alert.attributes.snoozeSchedule: { duration > 0 })",t="alert.attributes.enabled: true",n="alert.attributes.enabled: false",a=[];r.includes("enabled")&&a.push(t),r.includes("disabled")&&a.push(n),r.includes("snoozed")&&a.push(`${e}`),i.push(a.join(" and "))}return a&&a.length&&i.push(`alert.attributes.tags:(${a.join(" or ")})`),i};var i=n(47);async function s({http:e,search:t,perPage:n,page:a}){const s=await e.get(`${r.j}/rules/_tags`,{query:{search:t,per_page:n,page:a}});return Object(i.b)(s)}async function o({http:e,searchText:t,typesFilter:n,actionTypesFilter:s,ruleExecutionStatusesFilter:o,ruleStatusesFilter:u,tagsFilter:c}){const l=a({typesFilter:n,actionTypesFilter:s,ruleExecutionStatusesFilter:o,ruleStatusesFilter:u,tagsFilter:c}),d=await e.post(`${r.j}/rules/_aggregate`,{body:JSON.stringify({search_fields:t?JSON.stringify(["name","tags"]):void 0,search:t,filter:l.length?l.join(" and "):void 0,default_search_operator:"AND"})});return Object(i.a)(d)}},function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return u}));var r=n(3),a=n(9),i=n(17);function s(e,t){if(!e)return[];const n=t?"all"===t?Object(a.pick)(e,i.k):Object(a.pick)(e,[...i.k,...i.h]):e,r=p(n.params,"rule.params."),s=n.context?p(n.context,"context."):[],o=n.state?p(n.state,"state."):[];return s.concat(r,o)}function o(e,t,n,a){if(a){const e=function(){const e=[];return e.push(d[u.kibanaBaseUrl]),e.push(d[u.date]),e.push({name:l.ruleParams,description:r.i18n.translate("xpack.triggersActionsUI.actionVariables.ruleParamsLabel",{defaultMessage:"The params of the rule."})}),e.push(d[u.ruleId]),e.push(d[u.ruleName]),e.push(d[u.ruleType]),e.push(d[u.ruleUrl]),e.push(d[u.ruleTags]),e.push(d[u.ruleSpaceId]),e.push({name:l.newAlertsCount,description:r.i18n.translate("xpack.triggersActionsUI.actionVariables.newAlertsCountLabel",{defaultMessage:"The count of new alerts."})}),e.push({name:l.newAlertsData,description:r.i18n.translate("xpack.triggersActionsUI.actionVariables.newAlertsDataLabel",{defaultMessage:"An array of objects for new alerts."})}),e.push({name:l.ongoingAlertsCount,description:r.i18n.translate("xpack.triggersActionsUI.actionVariables.ongoingAlertsCountLabel",{defaultMessage:"The count of ongoing alerts."})}),e.push({name:l.ongoingAlertsData,description:r.i18n.translate("xpack.triggersActionsUI.actionVariables.ongoingAlertsDataLabel",{defaultMessage:"An array of objects for ongoing alerts."})}),e.push({name:l.recoveredAlertsCount,description:r.i18n.translate("xpack.triggersActionsUI.actionVariables.recoveredAlertsCountLabel",{defaultMessage:"The count of recovered alerts."})}),e.push({name:l.recoveredAlertsData,description:r.i18n.translate("xpack.triggersActionsUI.actionVariables.recoveredAlertsDataLabel",{defaultMessage:"An array of objects for recovered alerts."})}),e.push({name:l.allAlertsCount,description:r.i18n.translate("xpack.triggersActionsUI.actionVariables.allAlertsCountLabel",{defaultMessage:"The count of all alerts."})}),e.push({name:l.allAlertsData,description:r.i18n.translate("xpack.triggersActionsUI.actionVariables.allAlertsDataLabel",{defaultMessage:"An array of objects for all alerts."})}),e}(),a=s(t,n);return e.concat(a)}const i=function(){const e=[];return e.push(d[u.ruleId]),e.push(d[u.ruleName]),e.push(d[u.ruleSpaceId]),e.push(d[u.ruleTags]),e.push(d[u.ruleType]),e.push(d[u.ruleUrl]),e.push(d[u.date]),e.push({name:u.alertId,description:r.i18n.translate("xpack.triggersActionsUI.actionVariables.alertIdLabel",{defaultMessage:"The ID of the alert that scheduled actions for the rule."})}),e.push({name:u.alertActionGroup,description:r.i18n.translate("xpack.triggersActionsUI.actionVariables.alertActionGroupLabel",{defaultMessage:"The action group of the alert that scheduled actions for the rule."})}),e.push({name:u.alertActionSubgroup,description:r.i18n.translate("xpack.triggersActionsUI.actionVariables.alertActionSubgroupLabel",{defaultMessage:"The action subgroup of the alert that scheduled actions for the rule."})}),e.push({name:u.alertActionGroupName,description:r.i18n.translate("xpack.triggersActionsUI.actionVariables.alertActionGroupNameLabel",{defaultMessage:"The human readable name of the action group of the alert that scheduled actions for the rule."})}),e.push({name:u.alertFlapping,description:r.i18n.translate("xpack.triggersActionsUI.actionVariables.alertFlappingLabel",{defaultMessage:"A flag on the alert that indicates whether the alert status is changing repeatedly."})}),e.push(d[u.kibanaBaseUrl]),e.push({name:c.alertId,deprecated:!0,description:r.i18n.translate("xpack.triggersActionsUI.actionVariables.legacyAlertIdLabel",{defaultMessage:"This has been deprecated in favor of {variable}.",values:{variable:u.ruleId}})}),e.push({name:c.alertName,deprecated:!0,description:r.i18n.translate("xpack.triggersActionsUI.actionVariables.legacyAlertNameLabel",{defaultMessage:"This has been deprecated in favor of {variable}.",values:{variable:u.ruleName}})}),e.push({name:c.alertInstanceId,deprecated:!0,description:r.i18n.translate("xpack.triggersActionsUI.actionVariables.legacyAlertInstanceIdLabel",{defaultMessage:"This has been deprecated in favor of {variable}.",values:{variable:u.alertId}})}),e.push({name:c.alertActionGroup,deprecated:!0,description:r.i18n.translate("xpack.triggersActionsUI.actionVariables.legacyAlertActionGroupLabel",{defaultMessage:"This has been deprecated in favor of {variable}.",values:{variable:u.alertActionGroup}})}),e.push({name:c.alertActionGroupName,deprecated:!0,description:r.i18n.translate("xpack.triggersActionsUI.actionVariables.legacyAlertActionGroupNameLabel",{defaultMessage:"This has been deprecated in favor of {variable}.",values:{variable:u.alertActionGroupName}})}),e.push({name:c.alertActionSubgroup,deprecated:!0,description:r.i18n.translate("xpack.triggersActionsUI.actionVariables.legacyAlertActionSubGroupLabel",{defaultMessage:"This has been deprecated in favor of {variable}.",values:{variable:u.alertActionSubgroup}})}),e.push({name:c.spaceId,deprecated:!0,description:r.i18n.translate("xpack.triggersActionsUI.actionVariables.legacySpaceIdLabel",{defaultMessage:"This has been deprecated in favor of {variable}.",values:{variable:u.ruleSpaceId}})}),e.push({name:c.tags,deprecated:!0,description:r.i18n.translate("xpack.triggersActionsUI.actionVariables.legacyTagsLabel",{defaultMessage:"This has been deprecated in favor of {variable}.",values:{variable:u.ruleTags}})}),e.push({name:c.params,deprecated:!0,description:r.i18n.translate("xpack.triggersActionsUI.actionVariables.legacyParamsLabel",{defaultMessage:"This has been deprecated in favor of {variable}.",values:{variable:u.ruleParams}})}),e}(),o=s(e,n);return i.concat(o)}let u,c,l;!function(e){e.ruleId="rule.id",e.ruleName="rule.name",e.ruleSpaceId="rule.spaceId",e.ruleTags="rule.tags",e.ruleType="rule.type",e.ruleUrl="rule.url",e.ruleParams="rule.params",e.date="date",e.alertId="alert.id",e.alertActionGroup="alert.actionGroup",e.alertActionGroupName="alert.actionGroupName",e.alertActionSubgroup="alert.actionSubgroup",e.alertFlapping="alert.flapping",e.kibanaBaseUrl="kibanaBaseUrl"}(u||(u={})),function(e){e.alertId="alertId",e.alertName="alertName",e.alertInstanceId="alertInstanceId",e.alertActionGroup="alertActionGroup",e.alertActionGroupName="alertActionGroupName",e.alertActionSubgroup="alertActionSubgroup",e.tags="tags",e.spaceId="spaceId",e.params="params"}(c||(c={})),function(e){e.ruleParams="rule.params",e.newAlertsCount="alerts.new.count",e.newAlertsData="alerts.new.data",e.ongoingAlertsCount="alerts.ongoing.count",e.ongoingAlertsData="alerts.ongoing.data",e.recoveredAlertsCount="alerts.recovered.count",e.recoveredAlertsData="alerts.recovered.data",e.allAlertsCount="alerts.all.count",e.allAlertsData="alerts.all.data"}(l||(l={}));const d={[u.ruleId]:{name:u.ruleId,description:r.i18n.translate("xpack.triggersActionsUI.actionVariables.ruleIdLabel",{defaultMessage:"The ID of the rule."})},[u.ruleName]:{name:u.ruleName,description:r.i18n.translate("xpack.triggersActionsUI.actionVariables.ruleNameLabel",{defaultMessage:"The name of the rule."})},[u.ruleSpaceId]:{name:u.ruleSpaceId,description:r.i18n.translate("xpack.triggersActionsUI.actionVariables.ruleSpaceIdLabel",{defaultMessage:"The space ID of the rule."})},[u.ruleTags]:{name:u.ruleTags,description:r.i18n.translate("xpack.triggersActionsUI.actionVariables.ruleTagsLabel",{defaultMessage:"The tags of the rule."})},[u.ruleType]:{name:u.ruleType,description:r.i18n.translate("xpack.triggersActionsUI.actionVariables.ruleTypeLabel",{defaultMessage:"The type of rule."})},[u.ruleUrl]:{name:u.ruleUrl,description:r.i18n.translate("xpack.triggersActionsUI.actionVariables.ruleUrlLabel",{defaultMessage:"The URL to the rule that generated the alert. This will be an empty string if the server.publicBaseUrl is not configured."}),usesPublicBaseUrl:!0},[u.date]:{name:u.date,description:r.i18n.translate("xpack.triggersActionsUI.actionVariables.dateLabel",{defaultMessage:"The date the rule scheduled the action."})},[u.kibanaBaseUrl]:{name:u.kibanaBaseUrl,description:r.i18n.translate("xpack.triggersActionsUI.actionVariables.kibanaBaseUrlLabel",{defaultMessage:"The configured server.publicBaseUrl value or empty string if not configured."})}};function p(e,t){return e.map((e=>({...e,name:`${t}${e.name}`})))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(1),a=n(51),i=n(29);function s({filteredRuleTypes:e}){const{http:t}=Object(i.b)().services,n=Object(r.useRef)(!1),[s,o]=Object(r.useState)({isLoading:!0,data:[],error:null}),[u,c]=Object(r.useState)(new Map);return Object(r.useEffect)((()=>(n.current=!0,async function(){try{const r=await Object(a.a)({http:t}),i=new Map;for(const e of r)i.set(e.id,e);if(n.current){c(i);let t=r;e&&e.length>0&&(t=r.filter((t=>e.includes(t.id)))),o({...s,isLoading:!1,data:t})}}catch(e){n.current&&o({...s,isLoading:!1,error:e})}}(),()=>{n.current=!1})),[]),{ruleTypes:s.data,error:s.error,ruleTypeIndex:u,ruleTypesIsLoading:s.isLoading}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(2),a=n(1),i=n(0);const s=Object(a.lazy)((()=>Promise.all([n.e(0),n.e(4),n.e(6),n.e(11),n.e(14),n.e(39)]).then(n.bind(null,111)))),o=({hideLazyLoader:e,...t})=>Object(i.jsx)(a.Suspense,{fallback:e?null:Object(i.jsx)(r.EuiLoadingSpinner,null)},Object(i.jsx)(s,t))},function(e,t,n){"use strict";n.d(t,"a",(function(){return v})),n.d(t,"b",(function(){return O})),n.d(t,"c",(function(){return T})),n.d(t,"d",(function(){return S}));var r=n(1),a=n.n(r),i=n(2),s=n(6),o=n(68),u=n(20),c=n(33),l=n.n(c),d=n(25),p=n(0);const g="0.[00]a",b=Object(i.euiPaletteColorBlind)()[1],f=Object(p.jsx)(d.FormattedMessage,{id:"xpack.triggersActionsUI.sections.alertsSummaryWidget.title",defaultMessage:"Alert activity"}),m=Object(p.jsx)(d.FormattedMessage,{id:"xpack.triggersActionsUI.sections.alertsSummaryWidget.alerts",defaultMessage:"Alerts"}),h=Object(p.jsx)(d.FormattedMessage,{id:"xpack.triggersActionsUI.sections.alertsSummaryWidget.activeNow",defaultMessage:"Active now"}),j=({activeAlertCount:e})=>{const{euiTheme:t}=Object(i.useEuiTheme)();return Object(p.jsx)(a.a.Fragment,null,Object(p.jsx)(i.EuiText,{color:e?t.colors.dangerText:t.colors.successText},Object(p.jsx)("h3",{"data-test-subj":"activeAlertCount"},l()(e).format(g),!!e&&Object(p.jsx)(a.a.Fragment,null," ",Object(p.jsx)(i.EuiIcon,{type:"warning",ascent:10})))),Object(p.jsx)(i.EuiText,{size:"s",color:"subdued"},h))},y=({count:e})=>Object(p.jsx)(a.a.Fragment,null,Object(p.jsx)(i.EuiText,{color:b},Object(p.jsx)("h3",{"data-test-subj":"totalAlertCount"},l()(e).format(g))),Object(p.jsx)(i.EuiText,{size:"s",color:"subdued"},m)),x=({activeAlertCount:e,recoveredAlertCount:t,onActiveClick:n})=>Object(p.jsx)(i.EuiFlexGroup,{gutterSize:"l",responsive:!1},Object(p.jsx)(i.EuiFlexItem,{style:{minWidth:50,wordWrap:"break-word"},grow:!1},Object(p.jsx)(y,{count:e+t})),Object(p.jsx)(i.EuiFlexItem,{style:{minWidth:50,wordWrap:"break-word"},grow:!1},n?Object(p.jsx)(i.EuiLink,{onClick:e=>n(e,u.T),"data-test-subj":"activeAlerts"},Object(p.jsx)(j,{activeAlertCount:e})):Object(p.jsx)(j,{activeAlertCount:e}))),v=({activeAlertCount:e,activeAlerts:t,chartProps:{theme:n,baseTheme:r},recoveredAlertCount:a,timeRangeTitle:u,onClick:c})=>{const l=[n,o.EUI_SPARKLINE_THEME_PARTIAL,{chartMargins:{left:10,right:10,top:10,bottom:10}}],d=(e,t)=>{e.preventDefault(),e.stopPropagation(),c(t)};return Object(p.jsx)(i.EuiPanel,{element:"div","data-test-subj":"alertSummaryWidgetCompact",hasShadow:!1,hasBorder:!0,onClick:d},Object(p.jsx)(i.EuiFlexGroup,{direction:"column"},!!u&&Object(p.jsx)(i.EuiFlexItem,null,Object(p.jsx)(i.EuiTitle,{size:"xxs"},Object(p.jsx)("h5",null,f)),Object(p.jsx)(i.EuiSpacer,{size:"s"}),Object(p.jsx)(i.EuiText,{size:"s",color:"subdued","data-test-subj":"timeRangeTitle"},u)),Object(p.jsx)(i.EuiFlexItem,null,Object(p.jsx)(x,{activeAlertCount:e,recoveredAlertCount:a,onActiveClick:d})),Object(p.jsx)(i.EuiFlexItem,null,Object(p.jsx)(i.EuiFlexGroup,{wrap:!0},Object(p.jsx)(i.EuiFlexItem,{style:{minWidth:"200px"}},Object(p.jsx)(s.Chart,{size:{height:50}},Object(p.jsx)(s.Tooltip,{type:s.TooltipType.None}),Object(p.jsx)(s.Settings,{theme:l,baseTheme:r}),Object(p.jsx)(s.Axis,{hide:!0,id:"activeAlertsAxis",position:s.Position.Left,gridLine:{visible:!1}}),Object(p.jsx)(s.LineSeries,{id:"activeAlertsChart",xScaleType:s.ScaleType.Time,yScaleType:s.ScaleType.Linear,xAccessor:"key",yAccessors:["doc_count"],data:t,lineSeriesStyle:{line:{strokeWidth:2,stroke:b}},curve:s.CurveType.CURVE_MONOTONE_X})))))))},O=()=>Object(p.jsx)(i.EuiEmptyPrompt,{"data-test-subj":"alertSummaryWidgetError",iconType:"warning",color:"danger",title:Object(p.jsx)("h5",null,Object(p.jsx)(d.FormattedMessage,{id:"xpack.triggersActionsUI.sections.alertsSummaryWidget.errorTitle",defaultMessage:"Unable to load the alerts summary"})),body:Object(p.jsx)("p",null,Object(p.jsx)(d.FormattedMessage,{id:"xpack.triggersActionsUI.sections.alertsSummaryWidget.errorBody",defaultMessage:"There was an error loading the alerts summary. Contact your administrator for help."}))});var _=n(31),A=n.n(_);const T=({activeAlertCount:e,activeAlerts:t,chartProps:{theme:n,baseTheme:r,onBrushEnd:a},dateFormat:o,recoveredAlertCount:u,hideChart:c})=>{const l=[n,{chartPaddings:{top:7}}];return Object(p.jsx)(i.EuiPanel,{element:"div","data-test-subj":"alertSummaryWidgetFullSize",hasShadow:!1,paddingSize:"none"},Object(p.jsx)(i.EuiFlexItem,null,Object(p.jsx)(x,{activeAlertCount:e,recoveredAlertCount:u})),!c&&Object(p.jsx)("div",{"data-test-subj":"alertSummaryWidgetFullSizeChartContainer"},Object(p.jsx)(i.EuiSpacer,{size:"l"}),Object(p.jsx)(s.Chart,{size:["100%",170]},Object(p.jsx)(s.Tooltip,{headerFormatter:e=>A()(e.value).format(o||"YYYY-MM-DD HH:mm")}),Object(p.jsx)(s.Settings,{legendPosition:s.Position.Right,theme:l,baseTheme:r,onBrushEnd:a}),Object(p.jsx)(s.Axis,{id:"bottom",position:s.Position.Bottom,timeAxisLayerCount:2,gridLine:{visible:!0},style:{tickLine:{size:1e-4,padding:4},tickLabel:{alignment:{horizontal:s.Position.Left,vertical:s.Position.Bottom}}}}),Object(p.jsx)(s.Axis,{id:"left",position:s.Position.Left,gridLine:{visible:!0},integersOnly:!0,ticks:4}),Object(p.jsx)(s.Axis,{id:"right",position:s.Position.Right,gridLine:{visible:!0},integersOnly:!0,ticks:4}),Object(p.jsx)(s.LineSeries,{id:"Active",xScaleType:s.ScaleType.Time,yScaleType:s.ScaleType.Linear,xAccessor:"key",yAccessors:["doc_count"],color:[b],data:t,lineSeriesStyle:{line:{strokeWidth:2},point:{visible:!1}},curve:s.CurveType.CURVE_MONOTONE_X}))))},S=({fullSize:e,isLoadingWithoutChart:t})=>Object(p.jsx)("div",{style:{minHeight:t?44:e?238:224,display:"flex",alignItems:"center",justifyContent:t?"flex-start":"center"}},t?Object(p.jsx)(i.EuiLoadingSpinner,{size:"m"}):Object(p.jsx)(i.EuiLoadingChart,{size:"l","data-test-subj":"alertSummaryWidgetLoading"}))},function(e,t){e.exports=__kbnSharedDeps__.ElasticEuiChartsTheme},function(e,t){e.exports=__kbnSharedDeps__.KbnMonaco},function(e,t,n){n.r(t);var r=__kbnBundles__.get("plugin/esUiShared/public");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))},function(e,t,n){"use strict";n.r(t),n.d(t,"AlertHistoryDefaultIndexName",(function(){return L.c})),n.d(t,"ALERT_HISTORY_PREFIX",(function(){return L.a})),n.d(t,"AlertHistoryDocumentTemplate",(function(){return L.d})),n.d(t,"AlertHistoryEsIndexConnectorId",(function(){return L.e})),n.d(t,"ActionConnectorMode",(function(){return L.b})),n.d(t,"useConnectorContext",(function(){return M})),n.d(t,"ActionForm",(function(){return d.a})),n.d(t,"CreateConnectorFlyout",(function(){return d.c})),n.d(t,"EditConnectorFlyout",(function(){return d.d})),n.d(t,"getCategory",(function(){return F.h})),n.d(t,"JsonEditorWithMessageVariables",(function(){return N.a})),n.d(t,"JsonFieldWrapper",(function(){return N.b})),n.d(t,"MustacheTextFieldWrapper",(function(){return N.c})),n.d(t,"SimpleConnectorForm",(function(){return N.e})),n.d(t,"TextAreaWithMessageVariables",(function(){return N.f})),n.d(t,"TextFieldWithMessageVariables",(function(){return N.g})),n.d(t,"SectionLoading",(function(){return N.d})),n.d(t,"AlertProvidedActionVariables",(function(){return D.a})),n.d(t,"hasMustacheTokens",(function(){return D.c})),n.d(t,"templateActionVariable",(function(){return D.e})),n.d(t,"updateActionConnector",(function(){return D.f})),n.d(t,"executeAction",(function(){return D.b})),n.d(t,"AlertConditions",(function(){return j.b})),n.d(t,"AlertConditionsGroup",(function(){return j.c})),n.d(t,"plugin",(function(){return re})),n.d(t,"useKibana",(function(){return V.useKibana})),n.d(t,"WhenExpression",(function(){return V.WhenExpression})),n.d(t,"OfExpression",(function(){return V.OfExpression})),n.d(t,"ForLastExpression",(function(){return V.ForLastExpression})),n.d(t,"ThresholdExpression",(function(){return V.ThresholdExpression})),n.d(t,"ValueExpression",(function(){return V.ValueExpression})),n.d(t,"builtInComparators",(function(){return V.builtInComparators})),n.d(t,"builtInGroupByTypes",(function(){return V.builtInGroupByTypes})),n.d(t,"builtInAggregationTypes",(function(){return V.builtInAggregationTypes})),n.d(t,"getFields",(function(){return V.getFields})),n.d(t,"getIndexOptions",(function(){return V.getIndexOptions})),n.d(t,"firstFieldOption",(function(){return V.firstFieldOption})),n.d(t,"getTimeFieldOptions",(function(){return V.getTimeFieldOptions})),n.d(t,"GroupByExpression",(function(){return V.GroupByExpression})),n.d(t,"COMPARATORS",(function(){return V.COMPARATORS})),n.d(t,"connectorDeprecatedMessage",(function(){return V.connectorDeprecatedMessage})),n.d(t,"deprecatedMessage",(function(){return V.deprecatedMessage})),n.d(t,"useLoadRuleTypes",(function(){return q.a})),n.d(t,"useSubAction",(function(){return H})),n.d(t,"Plugin",(function(){return plugin_Plugin})),n.d(t,"loadRuleSummary",(function(){return Y.a})),n.d(t,"bulkDeleteRules",(function(){return J.a})),n.d(t,"loadRuleAggregations",(function(){return K.a})),n.d(t,"loadRule",(function(){return Q.a})),n.d(t,"suspendedComponentWithProps",(function(){return b.a})),n.d(t,"loadActionTypes",(function(){return X.a})),n.d(t,"TIME_UNITS",(function(){return Z.o})),n.d(t,"getTimeUnitLabel",(function(){return ee.a})),n.d(t,"getNotifyWhenOptions",(function(){return ae})),n.d(t,"transformRule",(function(){return te.b})),n.d(t,"validateActionFilterQuery",(function(){return ne.d}));var r=n(16),a=n.n(r),i=n(3),s=n(46),o=n(20);class type_registry_TypeRegistry{constructor(){a()(this,"objectTypes",new Map)}has(e){return this.objectTypes.has(e)}register(e){if(this.has(e.id))throw new Error(i.i18n.translate("xpack.triggersActionsUI.typeRegistry.register.duplicateObjectTypeErrorMessage",{defaultMessage:'Object type "{id}" is already registered.',values:{id:e.id}}));this.objectTypes.set(e.id,e)}get(e){if(!this.has(e))throw new Error(i.i18n.translate("xpack.triggersActionsUI.typeRegistry.get.missingActionTypeErrorMessage",{defaultMessage:'Object type "{id}" is not registered.',values:{id:e}}));return this.objectTypes.get(e)}list(){return Array.from(this.objectTypes).map((([e,t])=>t))}}var u=n(1),c=n.n(u),l=n(10),d=n(18),p=n(0),g=n(34),b=n(4);const f=Object(b.a)(Object(u.lazy)((()=>Promise.all([n.e(4),n.e(11),n.e(14)]).then(n.bind(null,297)))));var m=n(2);const h=Object(u.lazy)((()=>Promise.all([n.e(4),n.e(11)]).then(n.bind(null,298))));var j=n(7),y=n(19);const x=new y.QueryClient,v=new y.QueryClient;var O=n(40),_=n(27),A=n(12);const T=Object(u.lazy)((()=>n.e(52).then(n.bind(null,304)))),S=Object(u.lazy)((()=>n.e(51).then(n.bind(null,305)))),E=()=>({body:S,header:T,footer:null});var I=n(66);const w=Object(u.lazy)((()=>Promise.all([n.e(0),n.e(4),n.e(6),n.e(34)]).then(n.bind(null,189))));var k=n(67);const R=Object(u.lazy)((()=>n.e(40).then(n.bind(null,315)))),C=new y.QueryClient,P=Object(u.lazy)((()=>n.e(48).then(n.bind(null,162))));class plugin_Plugin{constructor(e){a()(this,"actionTypeRegistry",void 0),a()(this,"ruleTypeRegistry",void 0),a()(this,"alertsTableConfigurationRegistry",void 0),a()(this,"config",void 0),a()(this,"connectorServices",void 0),a()(this,"experimentalFeatures",void 0),this.actionTypeRegistry=new type_registry_TypeRegistry,this.ruleTypeRegistry=new type_registry_TypeRegistry,this.alertsTableConfigurationRegistry=new type_registry_TypeRegistry,this.config=e.config.get(),this.experimentalFeatures=Object(_.c)(this.config.enableExperimental||[])}setup(e,t){const r=this.actionTypeRegistry,a=this.ruleTypeRegistry,u=this.alertsTableConfigurationRegistry;this.connectorServices={validateEmailAddresses:t.actions.validateEmailAddresses},O.a.init({experimentalFeatures:this.experimentalFeatures});const l=i.i18n.translate("xpack.triggersActionsUI.managementSection.displayName",{defaultMessage:"Rules"}),d=i.i18n.translate("xpack.triggersActionsUI.managementSection.displayDescription",{defaultMessage:"Detect conditions using rules."}),g=i.i18n.translate("xpack.triggersActionsUI.managementSection.connectors.displayName",{defaultMessage:"Connectors"}),b=i.i18n.translate("xpack.triggersActionsUI.managementSection.connectors.displayDescription",{defaultMessage:"Connect third-party software with your alerting data."});return t.home&&(t.home.featureCatalogue.register({id:A.PLUGIN_ID,title:l,description:d,icon:"watchesApp",path:o.sb,showOnHomePage:!1,category:"admin"}),t.home.featureCatalogue.register({id:A.CONNECTORS_PLUGIN_ID,title:g,description:b,icon:"watchesApp",path:o.sb,showOnHomePage:!1,category:"admin"})),t.management.sections.section.insightsAndAlerting.registerApp({id:A.PLUGIN_ID,title:l,order:0,async mount(i){var o;const[c,l]=await e.getStartServices(),{renderApp:d}=await n.e(27).then(n.bind(null,302));let p;try{p=await l.features.getFeatures()}catch(e){p=[]}return d({...c,actions:t.actions,dashboard:l.dashboard,data:l.data,dataViews:l.dataViews,dataViewEditor:l.dataViewEditor,charts:l.charts,alerting:l.alerting,spaces:l.spaces,unifiedSearch:l.unifiedSearch,isCloud:Boolean(null===(o=t.cloud)||void 0===o?void 0:o.isCloudEnabled),element:i.element,theme$:i.theme$,storage:new s.Storage(window.localStorage),setBreadcrumbs:i.setBreadcrumbs,history:i.history,actionTypeRegistry:r,ruleTypeRegistry:a,alertsTableConfigurationRegistry:u,kibanaFeatures:p,licensing:l.licensing})}}),t.management.sections.section.insightsAndAlerting.registerApp({id:A.CONNECTORS_PLUGIN_ID,title:g,order:2,async mount(i){var o;const[c,l]=await e.getStartServices(),{renderApp:d}=await n.e(28).then(n.bind(null,303));let p;try{p=await l.features.getFeatures()}catch(e){p=[]}return d({...c,actions:t.actions,dashboard:l.dashboard,data:l.data,dataViews:l.dataViews,dataViewEditor:l.dataViewEditor,charts:l.charts,alerting:l.alerting,spaces:l.spaces,unifiedSearch:l.unifiedSearch,isCloud:Boolean(null===(o=t.cloud)||void 0===o?void 0:o.isCloudEnabled),element:i.element,theme$:i.theme$,storage:new s.Storage(window.localStorage),setBreadcrumbs:i.setBreadcrumbs,history:i.history,actionTypeRegistry:r,ruleTypeRegistry:a,alertsTableConfigurationRegistry:u,kibanaFeatures:p})}}),this.experimentalFeatures.internalAlertsTable&&function({alertsTableConfigurationRegistry:e}){e.register({id:A.PLUGIN_ID,columns:[{id:"event.action",displayAsText:"Alert status",initialWidth:150},{id:"@timestamp",displayAsText:"Last updated",initialWidth:250,schema:"datetime"},{id:"kibana.alert.duration.us",displayAsText:"Duration",initialWidth:150,schema:"numeric"},{id:"kibana.alert.reason",displayAsText:"Reason"}],useInternalFlyout:E,getRenderCellValue:()=>e=>{var t,n;const r=e,a=null!==(t=null===(n=r.data.find((e=>e.field===r.columnId)))||void 0===n?void 0:n.value)&&void 0!==t?t:[];return Object(p.jsx)(c.a.Fragment,null,a.length?a.join():"--")},sort:[{"event.action":{order:"asc"}}]})}({alertsTableConfigurationRegistry:this.alertsTableConfigurationRegistry}),{actionTypeRegistry:this.actionTypeRegistry,ruleTypeRegistry:this.ruleTypeRegistry,alertsTableConfigurationRegistry:this.alertsTableConfigurationRegistry}}start(){return{actionTypeRegistry:this.actionTypeRegistry,ruleTypeRegistry:this.ruleTypeRegistry,alertsTableConfigurationRegistry:this.alertsTableConfigurationRegistry,getActionForm:e=>(e=>Object(p.jsx)(l.b,{value:{services:e.connectorServices}},Object(p.jsx)(j.a,e)))({...e,actionTypeRegistry:this.actionTypeRegistry,connectorServices:this.connectorServices}),getAddConnectorFlyout:e=>(e=>Object(p.jsx)(l.b,{value:{services:e.connectorServices}},Object(p.jsx)(d.c,e)))({...e,actionTypeRegistry:this.actionTypeRegistry,connectorServices:this.connectorServices}),getEditConnectorFlyout:e=>(e=>Object(p.jsx)(l.b,{value:{services:e.connectorServices}},Object(p.jsx)(d.d,e)))({...e,actionTypeRegistry:this.actionTypeRegistry,connectorServices:this.connectorServices}),getAddRuleFlyout:e=>(e=>Object(p.jsx)(l.b,{value:{services:e.connectorServices}},Object(p.jsx)(g.a,e)))({...e,actionTypeRegistry:this.actionTypeRegistry,ruleTypeRegistry:this.ruleTypeRegistry,connectorServices:this.connectorServices}),getEditRuleFlyout:e=>(e=>Object(p.jsx)(l.b,{value:{services:e.connectorServices}},Object(p.jsx)(g.b,e)))({...e,actionTypeRegistry:this.actionTypeRegistry,ruleTypeRegistry:this.ruleTypeRegistry,connectorServices:this.connectorServices}),getAlertsStateTable:e=>Object(I.a)(e),getAlertsSearchBar:e=>(e=>Object(p.jsx)(u.Suspense,{fallback:Object(p.jsx)(m.EuiLoadingSpinner,null)},Object(p.jsx)(w,e)))(e),getAlertsTable:e=>(e=>Object(p.jsx)(f,e))(e),getFieldBrowser:e=>(e=>Object(p.jsx)(u.Suspense,{fallback:Object(p.jsx)(m.EuiLoadingSpinner,null)},Object(p.jsx)(h,e)))(e),getRuleStatusDropdown:e=>(e=>Object(p.jsx)(j.g,e))(e),getRuleTagFilter:e=>(e=>Object(p.jsx)(y.QueryClientProvider,{client:x},Object(p.jsx)(j.k,e)))(e),getRuleStatusFilter:e=>(e=>Object(p.jsx)(j.h,e))(e),getRuleTagBadge:e=>(e=>Object(p.jsx)(j.j,e))(e),getRuleEventLogList:e=>(e=>Object(p.jsx)(j.e,e))(e),getRulesListNotifyBadge:e=>(e=>Object(p.jsx)(j.m,e))(e),getRulesList:e=>(e=>Object(p.jsx)(l.b,{value:{services:e.connectorServices}},Object(p.jsx)(y.QueryClientProvider,{client:v},Object(p.jsx)(j.l,e.rulesListProps))))({connectorServices:this.connectorServices,rulesListProps:e}),getRuleDefinition:e=>(e=>Object(p.jsx)(j.d,e))({...e,actionTypeRegistry:this.actionTypeRegistry,ruleTypeRegistry:this.ruleTypeRegistry}),getRuleStatusPanel:e=>(e=>Object(p.jsx)(j.i,e))(e),getAlertSummaryWidget:e=>(e=>Object(p.jsx)(u.Suspense,{fallback:Object(p.jsx)(k.d,{fullSize:e.fullSize,isLoadingWithoutChart:e.hideChart})},Object(p.jsx)(R,e)))(e),getRuleSnoozeModal:e=>(e=>Object(p.jsx)(j.f,e))(e),getRulesSettingsLink:()=>Object(p.jsx)(y.QueryClientProvider,{client:C},Object(p.jsx)(u.Suspense,{fallback:Object(p.jsx)(m.EuiLoadingSpinner,null)},Object(p.jsx)(P,null)))}}stop(){}}var L=n(17);const M=()=>{const e=Object(u.useContext)(l.a);if(!e)throw new Error("useConnectorContext must be used within a ConnectorProvider and have a defined value.");return e};var U,F=n(55),N=n(24),D=n(14),V=n(8),$=n(58),z=n.n($),B=n(29),W=n(22);!function(e){e[e.START=0]="START",e[e.STOP=1]="STOP",e[e.SUCCESS=2]="SUCCESS",e[e.ERROR=3]="ERROR"}(U||(U={}));const G=(e,t)=>{switch(t.type){case U.START:return{...e,isLoading:!0,error:null};case U.STOP:return{...e,isLoading:!1,error:null};case U.SUCCESS:return{...e,response:t.payload,isLoading:!1,error:null};case U.ERROR:return{...e,error:t.payload,isLoading:!1};default:return e}},H=({connectorId:e,subAction:t,subActionParams:n,disabled:r=!1})=>{const{http:a}=Object(B.b)().services,[{isLoading:i,response:s,error:o},c]=Object(u.useReducer)(G,{isLoading:!1,response:void 0,error:null}),l=(e=>{const t=Object(u.useRef)(e);return z()(t.current,e)||(t.current=e),t.current})(n);return Object(u.useEffect)((()=>{if(r||!e||!t)return void c({type:U.STOP});const n=new AbortController;let i=!0;return(async()=>{try{c({type:U.START});const r=await Object(W.c)({id:e,params:{subAction:t,subActionParams:l},http:a,signal:n.signal});return i&&(r.status&&"ok"===r.status?c({type:U.SUCCESS,payload:r.data}):c({type:U.ERROR,payload:new Error(`${r.message}: ${r.serviceMessage}`)})),r.data}catch(e){i&&c({type:U.ERROR,payload:e})}})(),()=>{i=!1,n.abort()}}),[l,r,e,t,a]),{isLoading:i,response:s,error:o}};var q=n(65),Y=n(59),J=n(56),K=n(63),Q=n(60),X=n(35),Z=n(5),ee=n(38),te=n(32),ne=n(54);function re(e){return new plugin_Plugin(e)}const ae=async()=>{const{NOTIFY_WHEN_OPTIONS:e}=await n.e(36).then(n.bind(null,153));return e}},,,,,,function(e,t,n){n(78),__kbnBundles__.define("plugin/triggersActionsUi/public",n,71),__kbnBundles__.define("plugin/triggersActionsUi/public/common",n,8),__kbnBundles__.define("plugin/triggersActionsUi/public/common/constants",n,12)},function(e,t,n){n.p=window.__kbnPublicPath__.triggersActionsUi},function(e,t,n){var r=n(48),a=n(80);"string"==typeof(a=a.__esModule?a.default:a)&&(a=[[e.i,a,""]]);r(a,{insert:"head",singleton:!1}),e.exports=a.locals||{}},function(e,t,n){(t=n(49)(!1)).push([e.i,'.messageVariablesPanel{height:100%;-webkit-mask-image:linear-gradient(180deg,#ff00001a 0,red 7.5px,red calc(100% - 7.5px),#ff00001a);mask-image:linear-gradient(180deg,#ff00001a 0,red 7.5px,red calc(100% - 7.5px),#ff00001a);max-height:320px;max-width:320px;overflow-x:hidden;overflow-y:auto;scrollbar-color:#98a2b380 #0000;scrollbar-width:thin}.messageVariablesPanel::-webkit-scrollbar{height:16px;width:16px}.messageVariablesPanel::-webkit-scrollbar-thumb{background-clip:content-box;background-color:#98a2b380;border:6px solid #0000;border-radius:16px}.messageVariablesPanel::-webkit-scrollbar-corner,.messageVariablesPanel::-webkit-scrollbar-track{background-color:#0000}.messageVariablesPanel:focus{outline:none}.messageVariablesPanel[tabindex="0"]:focus:focus-visible{outline-style:auto}',""]),e.exports=t},function(e,t,n){var r=n(48),a=n(82);"string"==typeof(a=a.__esModule?a.default:a)&&(a=[[e.i,a,""]]);r(a,{insert:"head",singleton:!1}),e.exports=a.locals||{}},function(e,t,n){(t=n(49)(!1)).push([e.i,'.messageVariablesPanel{height:100%;-webkit-mask-image:linear-gradient(180deg,#ff00001a 0,red 7.5px,red calc(100% - 7.5px),#ff00001a);mask-image:linear-gradient(180deg,#ff00001a 0,red 7.5px,red calc(100% - 7.5px),#ff00001a);max-height:320px;max-width:320px;overflow-x:hidden;overflow-y:auto;scrollbar-color:#69707d80 #0000;scrollbar-width:thin}.messageVariablesPanel::-webkit-scrollbar{height:16px;width:16px}.messageVariablesPanel::-webkit-scrollbar-thumb{background-clip:content-box;background-color:#69707d80;border:6px solid #0000;border-radius:16px}.messageVariablesPanel::-webkit-scrollbar-corner,.messageVariablesPanel::-webkit-scrollbar-track{background-color:#0000}.messageVariablesPanel:focus{outline:none}.messageVariablesPanel[tabindex="0"]:focus:focus-visible{outline-style:auto}',""]),e.exports=t},function(e,t){e.exports=__kbnSharedDeps__.ReactRouterDom},function(e,t){e.exports=__kbnSharedDeps__.TsLib},,function(e,t,n){n.r(t);var r=__kbnBundles__.get("plugin/kibanaReact/common");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))},function(e,t){e.exports=__kbnSharedDeps__.IoTs},function(e,t){e.exports=__kbnSharedDeps__.ReactRouterDomV5Compat},function(e,t){e.exports=__kbnSharedDeps__.Rxjs},function(e,t,n){n.r(t);var r=__kbnBundles__.get("plugin/alerting/common/parse_duration");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))},,,,function(e,t){e.exports=__kbnSharedDeps__.KbnEsQuery},,,,function(e,t){e.exports=__kbnSharedDeps__.ReactDom},function(e,t){e.exports=__kbnSharedDeps__.Uuid},function(e,t){e.exports=__kbnSharedDeps__.KbnUiTheme},,,,,function(e,t,n){n.r(t);var r=__kbnBundles__.get("plugin/data/common");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))},,,function(e,t){e.exports=__kbnSharedDeps__.MomentTimezone},,function(e,t){e.exports=__kbnSharedDeps__.ElasticEuiLibServices}]);