/*! 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,s=t[0],o=t[1],i=0,l=[];iObject(r.useKibana)()},function(e,t,n){"use strict";n.d(t,"d",(function(){return r.a})),n.d(t,"h",(function(){return i})),n.d(t,"j",(function(){return c})),n.d(t,"i",(function(){return l})),n.d(t,"g",(function(){return d.c})),n.d(t,"f",(function(){return d.b})),n.d(t,"c",(function(){return u})),n.d(t,"b",(function(){return p.a})),n.d(t,"a",(function(){return _})),n.d(t,"e",(function(){return m}));var r=n(8),a=n(2),s=n(24),o=n(0);const i=()=>{const{services:{application:{getUrlForApp:e,navigateToUrl:t}}}=Object(r.a)(),n=Object(s.useLocation)();return Object(a.useCallback)((async(r,a=!1)=>{if(void 0===r)return;const s=`${r}${!0===a?n.search:""}`,i=s.includes("/app/ml")?s:e(o.f,{path:s});await t(i)}),[n])},c=()=>Object(r.a)().services.uiSettings,l=()=>Object(r.a)().services.notifications;var d=n(33);const u=()=>Object(r.a)().services.mlServices.mlApiServices;var p=n(44),b=n(55);function _(){const{services:{theme:e}}=Object(r.a)();return Object(b.a)(e)}var f=n(29),h=n.n(f);const m=()=>{const{services:{mlServices:{mlLicense:e}}}=Object(r.a)();return h()(e.licenseInfo$,e.getLicenseInfo())}},function(e,t){e.exports=__kbnSharedDeps__.Rxjs},function(e,t){e.exports=__kbnSharedDeps__.RxjsOperators},function(e,t,n){"use strict";n.r(t),n.d(t,"ml",(function(){return O})),n.d(t,"mlApiServicesProvider",(function(){return g}));var r=n(0),a=n(13),s=n(25),o=n(7),i=n(22);function c(e){return{getSchemaDefinition:t=>e.http({path:`${r.c}/json_schema`,method:"GET",query:Object(o.omitBy)(t,(e=>!Object(i.a)(e))),version:"1"})}}n(2),n(9);const l=e=>({getAnnotations$(t){const n=JSON.stringify(t);return e.http$({path:`${r.c}/annotations`,method:"POST",body:n,version:"1"})},getAnnotations(t){const n=JSON.stringify(t);return e.http({path:`${r.c}/annotations`,method:"POST",body:n,version:"1"})},indexAnnotation(t){const n=JSON.stringify(t);return e.http({path:`${r.c}/annotations/index`,method:"PUT",body:n,version:"1"})},deleteAnnotation:t=>e.http({path:`${r.c}/annotations/delete/${t}`,method:"DELETE",version:"1"})}),d=e=>({getDataFrameAnalytics(t,n,a){const s=void 0!==t?`/${t}`:"";return e.http({path:`${r.c}/data_frame/analytics${s}`,method:"GET",...n?{query:{excludeGenerated:n,size:a}}:{},version:"1"})},getDataFrameAnalyticsStats:t=>void 0!==t?e.http({path:`${r.c}/data_frame/analytics/${t}/_stats`,method:"GET",version:"1"}):e.http({path:`${r.c}/data_frame/analytics/_stats`,method:"GET",version:"1"}),createDataFrameAnalytics(t,n){const a=JSON.stringify(n);return e.http({path:`${r.c}/data_frame/analytics/${t}`,method:"PUT",body:a,version:"1"})},updateDataFrameAnalytics(t,n){const a=JSON.stringify(n);return e.http({path:`${r.c}/data_frame/analytics/${t}/_update`,method:"POST",body:a,version:"1"})},getDataFrameAnalyticsMap(t,n,a){const s=void 0!==t?`/${t}`:"";return e.http({path:`${r.c}/data_frame/analytics/map${s}`,method:"GET",query:{treatAsRoot:n,type:a},version:"1"})},jobsExist(t,n=!1){const a=JSON.stringify({analyticsIds:t,allSpaces:n});return e.http({path:`${r.c}/data_frame/analytics/jobs_exist`,method:"POST",body:a,version:"1"})},evaluateDataFrameAnalytics(t){const n=JSON.stringify(t);return e.http({path:`${r.c}/data_frame/_evaluate`,method:"POST",body:n,version:"1"})},explainDataFrameAnalytics(t){const n=JSON.stringify(t);return e.http({path:`${r.c}/data_frame/analytics/_explain`,method:"POST",body:n,version:"1"})},deleteDataFrameAnalytics:t=>e.http({path:`${r.c}/data_frame/analytics/${t}`,method:"DELETE",version:"1"}),deleteDataFrameAnalyticsAndDestIndex:(t,n,a)=>e.http({path:`${r.c}/data_frame/analytics/${t}`,query:{deleteDestIndex:n,deleteDestIndexPattern:a},method:"DELETE",version:"1"}),startDataFrameAnalytics:t=>e.http({path:`${r.c}/data_frame/analytics/${t}/_start`,method:"POST",version:"1"}),stopDataFrameAnalytics:(t,n=!1)=>e.http({path:`${r.c}/data_frame/analytics/${t}/_stop`,method:"POST",query:{force:n},version:"1"}),getAnalyticsAuditMessages:t=>e.http({path:`${r.c}/data_frame/analytics/${t}/messages`,method:"GET",version:"1"}),validateDataFrameAnalytics(t){const n=JSON.stringify(t);return e.http({path:`${r.c}/data_frame/analytics/validate`,method:"POST",body:n,version:"1"})},newJobCapsAnalytics(t,n=!1){const a=!0===n?{rollup:!0}:{};return e.http({path:`${r.c}/data_frame/analytics/new_job_caps/${t}`,method:"GET",query:a,version:"1"})}}),u=e=>({filters(t){const n=t&&t.filterId?`/${t.filterId}`:"";return e.http({path:`${r.c}/filters${n}`,method:"GET",version:"1"})},filtersStats:()=>e.http({path:`${r.c}/filters/_stats`,method:"GET",version:"1"}),addFilter(t,n,a){const s=JSON.stringify({filterId:t,description:n,items:a});return e.http({path:`${r.c}/filters`,method:"PUT",version:"1",body:s})},updateFilter(t,n,a,s){const o=JSON.stringify({...void 0!==n?{description:n}:{},...void 0!==a?{addItems:a}:{},...void 0!==s?{removeItems:s}:{}});return e.http({path:`${r.c}/filters/${t}`,method:"PUT",body:o,version:"1"})},deleteFilter:t=>e.http({path:`${r.c}/filters/${t}`,method:"DELETE",version:"1"})}),p=e=>({getAnomaliesTableData(t,n,a,s,o,i,c,l,d,u,p,b){const _=JSON.stringify({jobIds:t,criteriaFields:n,influencers:a,aggregationInterval:s,threshold:o,earliestMs:i,latestMs:c,dateFormatTz:l,maxRecords:d,maxExamples:u,influencersFilterQuery:p,functionDescription:b});return e.http$({path:`${r.c}/results/anomalies_table_data`,method:"POST",body:_,version:"1"})},getMaxAnomalyScore(t,n,a){const s=JSON.stringify({jobIds:t,earliestMs:n,latestMs:a});return e.http({path:`${r.c}/results/max_anomaly_score`,method:"POST",body:s,version:"1"})},getCategoryDefinition(t,n){const a=JSON.stringify({jobId:t,categoryId:n});return e.http({path:`${r.c}/results/category_definition`,method:"POST",body:a,version:"1"})},getCategoryExamples(t,n,a){const s=JSON.stringify({jobId:t,categoryIds:n,maxExamples:a});return e.http({path:`${r.c}/results/category_examples`,method:"POST",body:s,version:"1"})},fetchPartitionFieldsValues(t,n,a,s,o,i){const c=JSON.stringify({jobId:t,searchTerm:n,criteriaFields:a,earliestMs:s,latestMs:o,fieldsConfig:i});return e.http$({path:`${r.c}/results/partition_fields_values`,method:"POST",body:c,version:"1"})},anomalySearch(t,n){const a=JSON.stringify({query:t,jobIds:n});return e.http({path:`${r.c}/results/anomaly_search`,method:"POST",body:a,version:"1"})},anomalySearch$(t,n){const a=JSON.stringify({query:t,jobIds:n});return e.http$({path:`${r.c}/results/anomaly_search`,method:"POST",body:a,version:"1"})},getCategoryStoppedPartitions(t,n){const a=JSON.stringify({jobIds:t,fieldToBucket:n});return e.http({path:`${r.c}/results/category_stopped_partitions`,method:"POST",body:a,version:"1"})},getDatafeedResultChartData(t,n,a){const s=JSON.stringify({jobId:t,start:n,end:a});return e.http({path:`${r.c}/results/datafeed_results_chart`,method:"POST",body:s,version:"1"})},getAnomalyCharts$(t,n,a,s,o,i,c,l,d){const u=JSON.stringify({jobIds:t,influencers:n,threshold:a,earliestMs:s,latestMs:o,maxResults:c,influencersFilterQuery:d,numberOfPoints:l,timeBounds:i});return e.http$({path:`${r.c}/results/anomaly_charts`,method:"POST",body:u,version:"1"})},getAnomalyRecords$(t,n,a,s,o,i,c){const l=JSON.stringify({jobIds:t,criteriaFields:n,threshold:a,earliestMs:s,latestMs:o,interval:i,functionDescription:c});return e.http$({path:`${r.c}/results/anomaly_records`,method:"POST",body:l,version:"1"})}});var b=n(53);const _=e=>({jobsSpaces:()=>e.http({path:`${r.c}/saved_objects/jobs_spaces`,method:"GET",version:"1"}),updateJobsSpaces(t,n,a,s){const o=JSON.stringify({jobType:t,jobIds:n,spacesToAdd:a,spacesToRemove:s});return e.http({path:`${r.c}/saved_objects/update_jobs_spaces`,method:"POST",body:o,version:"1"})},removeItemFromCurrentSpace(t,n){const a=JSON.stringify({mlSavedObjectType:t,ids:n});return e.http({path:`${r.c}/saved_objects/remove_item_from_current_space`,method:"POST",body:a,version:"1"})},syncSavedObjects:(t=!1)=>e.http({path:`${r.b}/saved_objects/sync`,method:"GET",query:{simulate:t},version:"2023-10-31"}),initSavedObjects:(t=!1)=>e.http({path:`${r.c}/saved_objects/initialize`,method:"GET",query:{simulate:t},version:"1"}),syncCheck(t){const n=JSON.stringify({mlSavedObjectType:t});return e.http({path:`${r.c}/saved_objects/sync_check`,method:"POST",body:n,version:"1"})},canDeleteMLSpaceAwareItems(t,n){const a=JSON.stringify({ids:n});return e.http({path:`${r.c}/saved_objects/can_delete_ml_space_aware_item/${t}`,method:"POST",body:a,version:"1"})},trainedModelsSpaces:()=>e.http({path:`${r.c}/saved_objects/trained_models_spaces`,method:"GET",version:"1"}),updateModelsSpaces(t,n,a){const s=JSON.stringify({modelIds:t,spacesToAdd:n,spacesToRemove:a});return e.http({path:`${r.c}/saved_objects/update_trained_models_spaces`,method:"POST",body:s,version:"1"})}});var f=n(45);function h(e){return{findMessages:t=>e.http({path:`${r.c}/notifications`,method:"GET",query:Object(o.omitBy)(t,(e=>!Object(i.a)(e))),version:"1"}),countMessages$:t=>e.http$({path:`${r.c}/notifications/count`,method:"GET",query:Object(o.omitBy)(t,(e=>!Object(i.a)(e))),version:"1"})}}const m=new Proxy({},{get(e,t){try{return Object(a.f)()[t]}catch(e){if("getLoadingCount$"===t)return()=>{};console.error(e)}}}),O=g(new s.a(m));function g(e){return{getJobs(t){const n=t&&t.jobId?`/${t.jobId}`:"";return e.http({path:`${r.c}/anomaly_detectors${n}`,version:"1"})},getJobs$(t){const n=t&&t.jobId?`/${t.jobId}`:"";return e.http$({path:`${r.c}/anomaly_detectors${n}`,version:"1"})},getJobStats(t){const n=t&&t.jobId?`/${t.jobId}`:"";return e.http({path:`${r.c}/anomaly_detectors${n}/_stats`,version:"1"})},addJob({jobId:t,job:n}){const a=JSON.stringify(n);return e.http({path:`${r.c}/anomaly_detectors/${t}`,method:"PUT",body:a,version:"1"})},openJob:({jobId:t})=>e.http({path:`${r.c}/anomaly_detectors/${t}/_open`,method:"POST",version:"1"}),closeJob:({jobId:t})=>e.http({path:`${r.c}/anomaly_detectors/${t}/_close`,method:"POST",version:"1"}),forceCloseJob:({jobId:t})=>e.http({path:`${r.c}/anomaly_detectors/${t}/_close?force=true`,method:"POST",version:"1"}),deleteJob:({jobId:t})=>e.http({path:`${r.c}/anomaly_detectors/${t}`,method:"DELETE",version:"1"}),forceDeleteJob:({jobId:t})=>e.http({path:`${r.c}/anomaly_detectors/${t}?force=true`,method:"DELETE",version:"1"}),updateJob({jobId:t,job:n}){const a=JSON.stringify(n);return e.http({path:`${r.c}/anomaly_detectors/${t}/_update`,method:"POST",body:a,version:"1"})},estimateBucketSpan(t){const n=JSON.stringify(t);return e.http({path:`${r.c}/validate/estimate_bucket_span`,method:"POST",body:n,version:"1"})},validateJob(t){const n=JSON.stringify(t);return e.http({path:`${r.c}/validate/job`,method:"POST",body:n,version:"1"})},validateDatafeedPreview(t){const n=JSON.stringify(t);return e.http({path:`${r.c}/validate/datafeed_preview`,method:"POST",body:n,version:"1"})},validateCardinality$(t){const n=JSON.stringify(t);return e.http$({path:`${r.c}/validate/cardinality`,method:"POST",body:n,version:"1"})},getDatafeeds(t){const n=t&&t.datafeedId?`/${t.datafeedId}`:"";return e.http({path:`${r.c}/datafeeds${n}`,version:"1"})},getDatafeedStats(t){const n=t&&t.datafeedId?`/${t.datafeedId}`:"";return e.http({path:`${r.c}/datafeeds${n}/_stats`,version:"1"})},addDatafeed({datafeedId:t,datafeedConfig:n}){const a=JSON.stringify(n);return e.http({path:`${r.c}/datafeeds/${t}`,method:"PUT",body:a,version:"1"})},updateDatafeed({datafeedId:t,datafeedConfig:n}){const a=JSON.stringify(n);return e.http({path:`${r.c}/datafeeds/${t}/_update`,method:"POST",body:a,version:"1"})},deleteDatafeed:({datafeedId:t})=>e.http({path:`${r.c}/datafeeds/${t}`,method:"DELETE",version:"1"}),forceDeleteDatafeed:({datafeedId:t})=>e.http({path:`${r.c}/datafeeds/${t}?force=true`,method:"DELETE",version:"1"}),startDatafeed({datafeedId:t,start:n,end:a}){const s=JSON.stringify({...void 0!==n?{start:n}:{},...void 0!==a?{end:a}:{}});return e.http({path:`${r.c}/datafeeds/${t}/_start`,method:"POST",body:s,version:"1"})},stopDatafeed:({datafeedId:t})=>e.http({path:`${r.c}/datafeeds/${t}/_stop`,method:"POST",version:"1"}),forceStopDatafeed:({datafeedId:t})=>e.http({path:`${r.c}/datafeeds/${t}/_stop?force=true`,method:"POST",version:"1"}),datafeedPreview:({datafeedId:t})=>e.http({path:`${r.c}/datafeeds/${t}/_preview`,method:"GET",version:"1"}),validateDetector({detector:t}){const n=JSON.stringify(t);return e.http({path:`${r.c}/anomaly_detectors/_validate/detector`,method:"POST",body:n})},forecast({jobId:t,duration:n}){const a=JSON.stringify({...void 0!==n?{duration:n}:{}});return e.http({path:`${r.c}/anomaly_detectors/${t}/_forecast`,method:"POST",body:a,version:"1"})},overallBuckets({jobId:t,topN:n,bucketSpan:a,start:s,end:o,overallScore:i}){const c=JSON.stringify({topN:n,bucketSpan:a,start:s,end:o,...i?{overall_score:i}:{}});return e.http({path:`${r.c}/anomaly_detectors/${t}/results/overall_buckets`,method:"POST",body:c,version:"1"})},hasPrivileges(t){const n=JSON.stringify(t);return e.http({path:`${r.c}/_has_privileges`,method:"POST",body:n,version:"1"})},checkMlCapabilities:()=>e.http({path:`${r.c}/ml_capabilities`,method:"GET",version:"1"}),checkIndicesExists({indices:t}){const n=JSON.stringify({indices:t});return e.http({path:`${r.c}/index_exists`,method:"POST",body:n,version:"1"})},getFieldCaps({index:t,fields:n}){const a=JSON.stringify({...void 0!==t?{index:t}:{},...void 0!==n?{fields:n}:{}});return e.http({path:`${r.c}/indices/field_caps`,method:"POST",body:a,version:"1"})},recognizeIndex:({indexPatternTitle:t})=>e.http({path:`${r.c}/modules/recognize/${t}`,method:"GET",version:"1"}),listDataRecognizerModules:()=>e.http({path:`${r.c}/modules/get_module`,method:"GET",version:"1"}),getDataRecognizerModule:({moduleId:t})=>e.http({path:`${r.c}/modules/get_module/${t}`,method:"GET",version:"1"}),dataRecognizerModuleJobsExist:({moduleId:t})=>e.http({path:`${r.c}/modules/jobs_exist/${t}`,method:"GET",version:"1"}),setupDataRecognizerConfig({moduleId:t,prefix:n,groups:a,indexPatternName:s,query:o,useDedicatedIndex:i,startDatafeed:c,start:l,end:d,jobOverrides:u,estimateModelMemory:p}){const b=JSON.stringify({prefix:n,groups:a,indexPatternName:s,query:o,useDedicatedIndex:i,startDatafeed:c,start:l,end:d,jobOverrides:u,estimateModelMemory:p});return e.http({path:`${r.c}/modules/setup/${t}`,method:"POST",body:b,version:"1"})},getVisualizerFieldHistograms({indexPattern:t,query:n,fields:a,samplerShardSize:s,runtimeMappings:o}){const i=JSON.stringify({query:n,fields:a,samplerShardSize:s,runtimeMappings:o});return e.http({path:`${r.c}/data_visualizer/get_field_histograms/${t}`,method:"POST",body:i,version:"1"})},calendars(t){const{calendarId:n,calendarIds:a}=t||{};let s="";return n?s=`/${n}`:a&&(s=`/${a.join(",")}`),e.http({path:`${r.c}/calendars${s}`,method:"GET",version:"1"})},addCalendar(t){const n=JSON.stringify(t);return e.http({path:`${r.c}/calendars`,method:"PUT",body:n,version:"1"})},updateCalendar(t){const n=t&&t.calendarId?`/${t.calendarId}`:"",a=JSON.stringify(t);return e.http({path:`${r.c}/calendars${n}`,method:"PUT",body:a,version:"1"})},deleteCalendar:({calendarId:t})=>e.http({path:`${r.c}/calendars/${t}`,method:"DELETE",version:"1"}),mlNodeCount:()=>e.http({path:`${r.c}/ml_node_count`,method:"GET",version:"1"}),mlInfo:()=>e.http({path:`${r.c}/info`,method:"GET",version:"1"}),calculateModelMemoryLimit$({datafeedConfig:t,analysisConfig:n,indexPattern:a,query:s,timeFieldName:o,earliestMs:i,latestMs:c}){const l=JSON.stringify({datafeedConfig:t,analysisConfig:n,indexPattern:a,query:s,timeFieldName:o,earliestMs:i,latestMs:c});return e.http$({path:`${r.c}/validate/calculate_model_memory_limit`,method:"POST",body:l,version:"1"})},getCardinalityOfFields({index:t,fieldNames:n,query:a,timeFieldName:s,earliestMs:o,latestMs:i}){const c=JSON.stringify({index:t,fieldNames:n,query:a,timeFieldName:s,earliestMs:o,latestMs:i});return e.http({path:`${r.c}/fields_service/field_cardinality`,method:"POST",body:c,version:"1"})},getTimeFieldRange({index:t,timeFieldName:n,query:a,runtimeMappings:s,indicesOptions:o,allowFutureTime:i}){const c=JSON.stringify({index:t,timeFieldName:n,query:a,runtimeMappings:s,indicesOptions:o,allowFutureTime:i});return e.http({path:`${r.c}/fields_service/time_field_range`,method:"POST",body:c,version:"1"})},esSearch(t){const n=JSON.stringify(t);return e.http({path:`${r.c}/es_search`,method:"POST",body:n,version:"1"})},esSearch$(t){const n=JSON.stringify(t);return e.http$({path:`${r.c}/es_search`,method:"POST",body:n,version:"1"})},getIndices:()=>e.http({path:"/api/index_management/indices",method:"GET",version:"1"}),getModelSnapshots:(t,n)=>e.http({path:`${r.c}/anomaly_detectors/${t}/model_snapshots${void 0!==n?`/${n}`:""}`,version:"1"}),updateModelSnapshot:(t,n,a)=>e.http({path:`${r.c}/anomaly_detectors/${t}/model_snapshots/${n}/_update`,method:"POST",body:JSON.stringify(a),version:"1"}),deleteModelSnapshot:(t,n)=>e.http({path:`${r.c}/anomaly_detectors/${t}/model_snapshots/${n}`,method:"DELETE",version:"1"}),annotations:l(e),dataFrameAnalytics:d(e),filters:u(e),results:p(e),jobs:Object(b.jobsApiProvider)(e),savedObjects:_(e),trainedModels:Object(f.a)(e),notifications:h(e),jsonSchema:c(e)}}},function(e,t,n){"use strict";n.d(t,"j",(function(){return a})),n.d(t,"d",(function(){return s})),n.d(t,"h",(function(){return o})),n.d(t,"i",(function(){return i})),n.d(t,"g",(function(){return c})),n.d(t,"e",(function(){return l})),n.d(t,"b",(function(){return d})),n.d(t,"f",(function(){return u})),n.d(t,"c",(function(){return p})),n.d(t,"a",(function(){return b}));const r={timefilter:null,config:null,chrome:null,docLinks:null,toastNotifications:null,overlays:null,theme:null,recentlyAccessed:null,fieldFormats:null,autocomplete:null,basePath:null,savedSearch:null,application:null,http:null,security:null,i18n:null,dashboard:null,maps:null,dataVisualizer:null,dataViews:null,share:null,lens:null};function a(e){r.timefilter=e.timefilter||null,r.config=e.config||null,r.chrome=e.chrome||null,r.docLinks=e.docLinks||null,r.toastNotifications=e.toastNotifications||null,r.overlays=e.overlays||null,r.theme=e.theme||null,r.recentlyAccessed=e.recentlyAccessed||null,r.fieldFormats=e.fieldFormats||null,r.autocomplete=e.autocomplete||null,r.basePath=e.basePath||null,r.savedSearch=e.savedSearch||null,r.application=e.application||null,r.http=e.http||null,r.security=e.security||null,r.i18n=e.i18n||null,r.dashboard=e.dashboard||null,r.dataVisualizer=e.dataVisualizer||null,r.dataViews=e.dataViews||null,r.share=e.share||null,r.lens=e.lens||null}function s(){if(null===r.docLinks)throw new Error("docLinks hasn't been initialized");return r.docLinks}function o(){if(null===r.toastNotifications)throw new Error("toast notifications haven't been initialized");return r.toastNotifications}function i(){if(null===r.config)throw new Error("uiSettings hasn't been initialized");return r.config}function c(){if(null===r.recentlyAccessed)throw new Error("recentlyAccessed hasn't been initialized");return r.recentlyAccessed}function l(){if(null===r.fieldFormats)throw new Error("fieldFormats hasn't been initialized");return r.fieldFormats}function d(){if(null===r.application)throw new Error("application hasn't been initialized");return r.application}function u(){if(null===r.http)throw new Error("http hasn't been initialized");return r.http}function p(){if(null===r.dataViews)throw new Error("dataViews hasn't been initialized");return r.dataViews}function b(){Object.keys(r).forEach((e=>{r[e]=null}))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(7),a=n(3);function s(e,t,n){let s=`${e}/${t}`;if(n){const{globalState:e,appState:t,index:o,savedSearchId:i,...c}=n;void 0!==o&&void 0===i&&(s=`${s}?index=${o}`),void 0===o&&void 0!==i&&(s=`${s}?savedSearchId=${i}`),Object(r.isEmpty)(c)||Object.keys(c).forEach((e=>{s=Object(a.setStateToKbnUrl)(e,c[e],{useHash:!1,storeInHashQuery:!1},s)})),e&&(s=Object(a.setStateToKbnUrl)("_g",e,{useHash:!1,storeInHashQuery:!1},s)),t&&(s=Object(a.setStateToKbnUrl)("_a",t,{useHash:!1,storeInHashQuery:!1},s))}return s}},function(e,t){e.exports=__kbnSharedDeps__.KbnI18nReact},function(e,t,n){"use strict";n.d(t,"a",(function(){return r.b})),n.d(t,"b",(function(){return ml_locator_MlLocatorDefinition})),n.d(t,"c",(function(){return p}));var r=n(1),a=n(5),s=n.n(a),o=n(3),i=n(20),c=n(14),l=n(52),d=n(7),u=n(19);class ml_locator_MlLocatorDefinition{constructor(){s()(this,"id",r.a),s()(this,"getLocation",(async e=>{let t="";switch(e.page){case r.b.ANOMALY_DETECTION_JOBS_MANAGE:t=Object(l.c)("",e.pageState);break;case r.b.ANOMALY_EXPLORER:t=Object(l.d)("",e.pageState);break;case r.b.ANOMALY_DETECTION_CREATE_JOB_SELECT_TYPE:t=Object(l.b)("",e.pageState);break;case r.b.ANOMALY_DETECTION_CREATE_JOB_SELECT_INDEX:t=Object(l.a)("",e.pageState);break;case r.b.SINGLE_METRIC_VIEWER:t=Object(l.e)("",e.pageState);break;case r.b.DATA_FRAME_ANALYTICS_JOBS_MANAGE:t=function(e,t){let n=`/${r.b.DATA_FRAME_ANALYTICS_JOBS_MANAGE}`;if(t){const{jobId:e,groupIds:a,globalState:s}=t;if(e||a){const t=[];e&&t.push(Object(u.b)(e)),a&&t.push(Object(u.a)(a));const s={...t.length>0?{queryText:t.join(" ")}:{}},i={[r.b.DATA_FRAME_ANALYTICS_JOBS_MANAGE]:s};n=Object(o.setStateToKbnUrl)("_a",i,{useHash:!1,storeInHashQuery:!1},n)}s&&(n=Object(o.setStateToKbnUrl)("_g",s,{useHash:!1,storeInHashQuery:!1},n))}return n}(0,e.pageState);break;case r.b.DATA_FRAME_ANALYTICS_CREATE_JOB:"",n=e.pageState,t=Object(c.a)("",r.b.DATA_FRAME_ANALYTICS_CREATE_JOB,n);break;case r.b.DATA_FRAME_ANALYTICS_MAP:t=function(e,t){let n=`/${r.b.DATA_FRAME_ANALYTICS_MAP}`;if(t){const{jobId:e,modelId:a,analysisType:s,globalState:i,queryText:c}=t,l={ml:{jobId:e,modelId:a,analysisType:s},...i},u={[r.b.DATA_FRAME_ANALYTICS_MAP]:{...c?{queryText:c}:{}}};Object(d.isEmpty)(u[r.b.DATA_FRAME_ANALYTICS_MAP])||(n=Object(o.setStateToKbnUrl)("_a",u,{useHash:!1,storeInHashQuery:!1},n)),n=Object(o.setStateToKbnUrl)("_g",l,{useHash:!1,storeInHashQuery:!1},n)}return n}(0,e.pageState);break;case r.b.DATA_FRAME_ANALYTICS_EXPLORATION:t=function(e,t){let n=`/${r.b.DATA_FRAME_ANALYTICS_EXPLORATION}`;if(t){const{jobId:e,analysisType:a,queryText:s,globalState:i}=t,c={ml:{jobId:e,analysisType:a},...i},l={[r.b.DATA_FRAME_ANALYTICS_EXPLORATION]:{...s?{queryText:s}:{}}};Object(d.isEmpty)(l[r.b.DATA_FRAME_ANALYTICS_EXPLORATION])||(n=Object(o.setStateToKbnUrl)("_a",l,{useHash:!1,storeInHashQuery:!1},n)),n=Object(o.setStateToKbnUrl)("_g",c,{useHash:!1,storeInHashQuery:!1},n)}return n}(0,e.pageState);break;case r.b.TRAINED_MODELS_MANAGE:t=function(e,t){let n=`/${r.b.TRAINED_MODELS_MANAGE}`;if(t){const{modelId:e}=t;if(e){const t={queryText:`model_id:(${e})`},a={[r.b.TRAINED_MODELS_MANAGE]:t};n=Object(o.setStateToKbnUrl)("_a",a,{useHash:!1,storeInHashQuery:!1},n)}}return n}(0,e.pageState);break;case r.b.MEMORY_USAGE:t=function(e,t){let n=`/${r.b.MEMORY_USAGE}`;if(t){const{nodeId:e}=t;if(e){const t={queryText:`name:(${e})`},a={[r.b.MEMORY_USAGE]:t};n=Object(o.setStateToKbnUrl)("_a",a,{useHash:!1,storeInHashQuery:!1},n)}}return n}(0,e.pageState);break;case r.b.DATA_COMPARISON_INDEX_SELECT:case r.b.DATA_COMPARISON:case r.b.ANOMALY_DETECTION_CREATE_JOB:case r.b.ANOMALY_DETECTION_CREATE_JOB_RECOGNIZER:case r.b.ANOMALY_DETECTION_CREATE_JOB_ADVANCED:case r.b.ANOMALY_DETECTION_CREATE_JOB_FROM_LENS:case r.b.ANOMALY_DETECTION_CREATE_JOB_FROM_MAP:case r.b.DATA_VISUALIZER:case r.b.DATA_VISUALIZER_FILE:case r.b.DATA_VISUALIZER_INDEX_VIEWER:case r.b.DATA_VISUALIZER_INDEX_SELECT:case r.b.AIOPS:case r.b.AIOPS_LOG_RATE_ANALYSIS:case r.b.AIOPS_LOG_RATE_ANALYSIS_INDEX_SELECT:case r.b.AIOPS_LOG_CATEGORIZATION:case r.b.AIOPS_LOG_CATEGORIZATION_INDEX_SELECT:case r.b.AIOPS_CHANGE_POINT_DETECTION:case r.b.AIOPS_CHANGE_POINT_DETECTION_INDEX_SELECT:case r.b.OVERVIEW:case r.b.SETTINGS:case r.b.FILTER_LISTS_MANAGE:case r.b.FILTER_LISTS_NEW:case r.b.CALENDARS_MANAGE:case r.b.CALENDARS_NEW:t=Object(c.a)("",e.page,e.pageState);break;case r.b.FILTER_LISTS_EDIT:t=function(e,t){let n=`/${r.b.FILTER_LISTS_EDIT}`;if(t){const{globalState:e,filterId:r}=t;void 0!==r&&(n=`${n}/${r}`),e&&(n=Object(o.setStateToKbnUrl)("_g",e,{useHash:!1,storeInHashQuery:!1},n))}return n}(0,e.pageState);break;case r.b.CALENDARS_EDIT:t=function(e,t){let n=`/${r.b.CALENDARS_EDIT}`;if(t){const{globalState:e,calendarId:r}=t;void 0!==r&&(n=`${n}/${r}`),e&&(n=Object(o.setStateToKbnUrl)("_g",e,{useHash:!1,storeInHashQuery:!1},n))}return n}(0,e.pageState);break;case r.b.NOTIFICATIONS:t=function(e,t){let n=`/${r.b.NOTIFICATIONS}`;if(t){const e={},r={},{level:a}=t;a&&(e.level=a),Object(i.a)(r)&&(n=Object(o.setStateToKbnUrl)("_g",r,{useHash:!1,storeInHashQuery:!1},n)),Object(i.a)(e)&&(n=Object(o.setStateToKbnUrl)("_a",e,{useHash:!1,storeInHashQuery:!1},n))}return n}(0,e.pageState);break;default:throw new Error("Page type is not provided or unknown")}var n;return{app:"ml",path:t,state:{}}}))}}const p=(e,t,n,r)=>e&&e.locator?e.locator.useUrl(n,void 0,r):void 0!==t?`${t}/app/ml/${n.page}`:""},function(e,t,n){"use strict";n.d(t,"g",(function(){return i})),n.d(t,"c",(function(){return c})),n.d(t,"d",(function(){return l})),n.d(t,"e",(function(){return d})),n.d(t,"f",(function(){return u})),n.d(t,"b",(function(){return p})),n.d(t,"a",(function(){return b}));var r=n(12);let a={anomaly_detectors:{},datafeeds:{}},s={};const o={cloudId:null,isCloud:!1,isCloudTrial:!1,deploymentId:null};async function i(){try{var e;const t=await r.ml.mlInfo();return a=t.defaults,s=t.limits,o.cloudId=null!==(e=t.cloudId)&&void 0!==e?e:null,o.isCloud=void 0!==t.cloudId,o.isCloudTrial=!0===t.isCloudTrial,o.deploymentId=t.cloudId?b(t.cloudId):null,{defaults:a,limits:s,cloudId:o}}catch(e){return{defaults:a,limits:s,cloudId:o}}}function c(){return a}function l(){return s}function d(){return o.isCloud}function u(){return o.isCloudTrial}function p(){return o.deploymentId}function b(e){const t=e.replace(/^(.+)?:/,"");try{const e=atob(t).match(/^.+\$(.+)(?=\$)/);return null!==e&&2===e.length?e[1]:null}catch(e){return null}}},function(e,t,n){"use strict";const r=n(62),a=n(63),s=n(64);function o(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function i(e,t){return t.encode?t.strict?r(e):encodeURIComponent(e):e}function c(e,t){return t.decode?a(e):e}function l(e){return Array.isArray(e)?e.sort():"object"==typeof e?l(Object.keys(e)).sort(((e,t)=>Number(e)-Number(t))).map((t=>e[t])):e}function d(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function u(e){const t=(e=d(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function p(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function b(e,t){o((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);const n=function(e){let t;switch(e.arrayFormat){case"index":return(e,n,r)=>{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===r[e]&&(r[e]={}),r[e][t[1]]=n):r[e]=n};case"bracket":return(e,n,r)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};case"comma":case"separator":return(t,n,r)=>{const a="string"==typeof n&&n.split("").indexOf(e.arrayFormatSeparator)>-1?n.split(e.arrayFormatSeparator).map((t=>c(t,e))):null===n?n:c(n,e);r[t]=a};default:return(e,t,n)=>{void 0!==n[e]?n[e]=[].concat(n[e],t):n[e]=t}}}(t),r=Object.create(null);if("string"!=typeof e)return r;if(!(e=e.trim().replace(/^[?#&]/,"")))return r;for(const a of e.split("&")){let[e,o]=s(t.decode?a.replace(/\+/g," "):a,"=");o=void 0===o?null:["comma","separator"].includes(t.arrayFormat)?o:c(o,t),n(c(e,t),o,r)}for(const e of Object.keys(r)){const n=r[e];if("object"==typeof n&&null!==n)for(const e of Object.keys(n))n[e]=p(n[e],t);else r[e]=p(n,t)}return!1===t.sort?r:(!0===t.sort?Object.keys(r).sort():Object.keys(r).sort(t.sort)).reduce(((e,t)=>{const n=r[t];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?e[t]=l(n):e[t]=n,e}),Object.create(null))}t.extract=u,t.parse=b,t.stringify=(e,t)=>{if(!e)return"";o((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);const n=n=>t.skipNull&&null==e[n]||t.skipEmptyString&&""===e[n],r=function(e){switch(e.arrayFormat){case"index":return t=>(n,r)=>{const a=n.length;return void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[i(t,e),"[",a,"]"].join("")]:[...n,[i(t,e),"[",i(a,e),"]=",i(r,e)].join("")]};case"bracket":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[i(t,e),"[]"].join("")]:[...n,[i(t,e),"[]=",i(r,e)].join("")];case"comma":case"separator":return t=>(n,r)=>null==r||0===r.length?n:0===n.length?[[i(t,e),"=",i(r,e)].join("")]:[[n,i(r,e)].join(e.arrayFormatSeparator)];default:return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,i(t,e)]:[...n,[i(t,e),"=",i(r,e)].join("")]}}(t),a={};for(const t of Object.keys(e))n(t)||(a[t]=e[t]);const s=Object.keys(a);return!1!==t.sort&&s.sort(t.sort),s.map((n=>{const a=e[n];return void 0===a?"":null===a?i(n,t):Array.isArray(a)?a.reduce(r(n),[]).join("&"):i(n,t)+"="+i(a,t)})).filter((e=>e.length>0)).join("&")},t.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);const[n,r]=s(e,"#");return Object.assign({url:n.split("?")[0]||"",query:b(u(e),t)},t&&t.parseFragmentIdentifier&&r?{fragmentIdentifier:c(r,t)}:{})},t.stringifyUrl=(e,n)=>{n=Object.assign({encode:!0,strict:!0},n);const r=d(e.url).split("?")[0]||"",a=t.extract(e.url),s=t.parse(a,{sort:!1}),o=Object.assign(s,e.query);let c=t.stringify(o,n);c&&(c=`?${c}`);let l=function(e){let t="";const n=e.indexOf("#");return-1!==n&&(t=e.slice(n)),t}(e.url);return e.fragmentIdentifier&&(l=`#${i(e.fragmentIdentifier,n)}`),`${r}${c}${l}`}},function(e,t,n){"use strict";function r(e,t){const n=e.match(/{{(.*?)}}/g);return Array.isArray(n)&&void 0!==t&&n.forEach((n=>{e=e.replace(n,t[n.replace(/{{|}}/g,"")])})),e}function a(e){return`groups:(${e.join(" or ")})`}function s(e){return Array.isArray(e)?`id:(${e.join(" OR ")})`:`id:${e}`}n.d(t,"c",(function(){return r})),n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return s}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r=(e,t=[])=>"object"==typeof e&&null!==e&&Object.keys(e).length>0&&(0===t.length||t.every((t=>({}.hasOwnProperty.call(e,t)))))},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";function r(e){return null!=e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"e",(function(){return c})),n.d(t,"a",(function(){return l})),n.d(t,"d",(function(){return d})),n.d(t,"f",(function(){return u})),n.d(t,"c",(function(){return p}));var r=n(12);let a=0,s=0,o=!1;async function i(){try{const e=await r.ml.mlNodeCount();return a=e.count,s=e.lazyNodeCount,o=!0,e}catch(e){return a=0,403===e.statusCode&&(o=!1),{count:0,lazyNodeCount:0}}}function c(){return 0!==a||0!==s}function l(){return 0!==a}function d(){return 0!==s}function u(){return o}function p(){return a}},function(e,t){e.exports=__kbnSharedDeps__.ReactRouterDom},function(e,t,n){"use strict";n.d(t,"a",(function(){return HttpService}));var r=n(5),a=n.n(r),s=n(10);function o(e){return{"Content-Type":"application/json",...e}}function i(e){const{path:t,method:n,headers:r,body:a,query:s,version:i}=e;if(!t)throw new Error("URL path is missing");const c={asSystemRequest:!0,credentials:"same-origin",method:n||"GET",headers:o(null!=r?r:{})};return a&&(c.body=a),s&&(c.query=s),i&&(c.version=i),{path:t,fetchOptions:c}}n(13);class HttpService{constructor(e){a()(this,"getLoadingCount$",void 0),this.httpStart=e,this.getLoadingCount$=e.getLoadingCount$()}fromHttpHandler(e,t){return new s.Observable((n=>{const r=new AbortController,a=r.signal;let s=!0,o=!1;null!=t&&t.signal&&(t.signal.aborted?r.abort():t.signal.addEventListener("abort",(()=>{a.aborted||r.abort()})));const i={...t||{},signal:a};return this.httpStart.fetch(e,i).then((e=>{s=!1,n.next(e),n.complete()})).catch((e=>{s=!1,o||n.error(e)})),()=>{o=!0,s&&r.abort()}}))}async http(e){const{path:t,fetchOptions:n}=i(e);return this.httpStart.fetch(t,n)}http$(e){const{path:t,fetchOptions:n}=i(e);return this.fromHttpHandler(t,n)}}},function(e,t,n){"use strict";n.d(t,"d",(function(){return a})),n.d(t,"a",(function(){return s})),n.d(t,"e",(function(){return o})),n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return c}));var r=n(6);const a={ANOMALY_DETECTION:"xpack.ml.anomaly_detection_alert",AD_JOBS_HEALTH:"xpack.ml.anomaly_detection_jobs_health"},s=5,o=1,i="*",c={datafeed:{name:r.i18n.translate("xpack.ml.alertTypes.jobsHealthAlertingRule.datafeedCheckName",{defaultMessage:"Datafeed is not started"}),description:r.i18n.translate("xpack.ml.alertTypes.jobsHealthAlertingRule.datafeedCheckDescription",{defaultMessage:"Get alerted if the corresponding datafeed of the job is not started"})},mml:{name:r.i18n.translate("xpack.ml.alertTypes.jobsHealthAlertingRule.mmlCheckName",{defaultMessage:"Model memory limit reached"}),description:r.i18n.translate("xpack.ml.alertTypes.jobsHealthAlertingRule.mmlCheckDescription",{defaultMessage:"Get alerted when job reaches soft or hard model memory limit."})},delayedData:{name:r.i18n.translate("xpack.ml.alertTypes.jobsHealthAlertingRule.delayedDataCheckName",{defaultMessage:"Data delay has occurred"}),description:r.i18n.translate("xpack.ml.alertTypes.jobsHealthAlertingRule.delayedDataCheckDescription",{defaultMessage:"Get alerted if a job missed data due to data delay."})},errorMessages:{name:r.i18n.translate("xpack.ml.alertTypes.jobsHealthAlertingRule.errorMessagesCheckName",{defaultMessage:"Errors in job messages"}),description:r.i18n.translate("xpack.ml.alertTypes.jobsHealthAlertingRule.errorMessagesCheckDescription",{defaultMessage:"Get alerted if a job contains errors in the job messages."})},behindRealtime:{name:r.i18n.translate("xpack.ml.alertTypes.jobsHealthAlertingRule.behindRealtimeCheckName",{defaultMessage:"Job is running behind real-time"}),description:r.i18n.translate("xpack.ml.alertTypes.jobsHealthAlertingRule.behindRealtimeCheckDescription",{defaultMessage:"Job is running behind real-time"})}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"c",(function(){return a})),n.d(t,"b",(function(){return s}));const r="ml-job",a="ml-trained-model",s="ml-module"},function(e,t){e.exports=__kbnSharedDeps__.ElasticEui},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(57),a=n(2),s=r.__importDefault(n(65));t.default=function(e,t){var n=a.useState(t),r=n[0],o=n[1];return s.default((function(){var t=e.subscribe(o);return function(){return t.unsubscribe()}}),[e]),r}},function(e,t,n){"use strict";let r,a,s;n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return s})),function(e){e.STARTED="started",e.STARTING="starting",e.STOPPED="stopped",e.STOPPING="stopping",e.DELETED="deleted"}(r||(r={})),function(e){e.FAILED="failed",e.FINISHED="finished",e.SCHEDULED="scheduled",e.STARTED="started"}(a||(a={})),function(e){e.CLOSED="closed",e.CLOSING="closing",e.FAILED="failed",e.OPENED="opened",e.OPENING="opening",e.DELETED="deleted"}(s||(s={}))},function(e,t,n){"use strict";n.d(t,"c",(function(){return s})),n.d(t,"e",(function(){return o})),n.d(t,"a",(function(){return i})),n.d(t,"f",(function(){return c})),n.d(t,"d",(function(){return l})),n.d(t,"g",(function(){return d})),n.d(t,"b",(function(){return u}));var r=n(42),a=n(41);function s(e){return t=>t&&t.length>e?{maxLength:{requiredLength:e,actualLength:t.length}}:null}function o(e){return t=>e.test(t)?null:{pattern:{matchPattern:e.toString()}}}function i(...e){return t=>{const n=e.reduce(((e,n)=>Object.assign(e,n(t)||{})),{});return Object.keys(n).length>0?n:null}}function c(){return e=>""===e||null==e?{required:!0}:null}function l(e=r.a){return t=>"string"!=typeof t||""===t||new RegExp(`\\d+(${e.join("|")})$`,"i").test(t.trim())?null:{invalidUnits:{allowedUnits:e.join(", ")}}}function d(){return e=>""===e?null:null===Object(a.a)(e)?{invalidTimeInterval:!0}:null}function u(e,t=!1){const n=new Set(e);return e=>n.has(e)!==t?{matchDict:e}:null}},function(e,t,n){"use strict";var r=n(23);n.d(t,"a",(function(){return r.b})),n.d(t,"c",(function(){return r.e})),n.d(t,"b",(function(){return r.d})),n.d(t,"d",(function(){return r.f}))},function(e,t,n){"use strict";n.d(t,"c",(function(){return i})),n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return l}));var r=n(2),a=n(40),s=n(8),o=n(1);const i=()=>{const{services:{share:e}}=Object(s.a)();return e.url.locators.get(o.a)},c=(e,t)=>{const[n,a]=Object(r.useState)(e.page),s=i();return Object(r.useEffect)((()=>{let n=!1;return(async e=>{if(s){const r=await s.getUrl(e,t);n||a(r)}})(e),()=>{n=!0}}),[e,t]),n},l=e=>{const t=i(),[n]=Object(a.d)("_g"),{services:{application:{navigateToUrl:o}}}=Object(s.a)(),c=Object(r.useCallback)((async e=>{const r=void 0!==(null==n?void 0:n.refreshInterval)?{globalState:{refreshInterval:n.refreshInterval}}:void 0,a=await t.getUrl({page:e,pageState:r});await o(a)}),[t,o]);return Object(r.useCallback)((()=>c(e)),[c,e])}},function(e,t){e.exports=__kbnSharedDeps__.KbnRison},function(e,t){e.exports=__kbnSharedDeps__.KbnUiTheme},function(e,t,n){"use strict";n.d(t,"b",(function(){return u})),n.d(t,"a",(function(){return m})),n.d(t,"c",(function(){return f}));var r=n(2),a=n.n(r),s=n(32),o=n(17),i=n(28),c=n(15),l=n(4);const d=({size:e,isCloud:t,isCloudTrial:n,deploymentId:r})=>Object(l.jsx)(a.a.Fragment,null,Object(l.jsx)(i.EuiCallOut,{size:e,title:Object(l.jsx)(c.FormattedMessage,{id:"xpack.ml.jobsList.nodeAvailableWarning.noMLNodesAvailableTitle",defaultMessage:"No ML nodes available"}),color:"warning",iconType:"warning"},Object(l.jsx)("div",null,Object(l.jsx)(c.FormattedMessage,{id:"xpack.ml.jobsList.nodeAvailableWarning.noMLNodesAvailableDescription",defaultMessage:"There are no ML nodes available."})),Object(l.jsx)("div",null,Object(l.jsx)(c.FormattedMessage,{id:"xpack.ml.jobsList.nodeAvailableWarning.unavailableCreateOrRunJobsDescription",defaultMessage:"You will not be able to create or run jobs."})),t&&null!==r&&Object(l.jsx)("div",null,Object(l.jsx)(c.FormattedMessage,{id:"xpack.ml.jobsList.nodeAvailableWarning.linkToCloudDescription",defaultMessage:"Please edit your {link}. You may enable a free {maxRamForMLNodes} machine learning node or expand your existing ML configuration.",values:{link:Object(l.jsx)(i.EuiLink,{href:`https://cloud.elastic.co/deployments?q=${r}`},Object(l.jsx)(c.FormattedMessage,{id:"xpack.ml.jobsList.nodeAvailableWarning.linkToCloud.hereLinkText",defaultMessage:"Elastic Cloud deployment"})),maxRamForMLNodes:n?"2GB":"1GB"}}))),Object(l.jsx)(i.EuiSpacer,{size:"m"})),u=()=>!0===Object(s.c)()||!1===Object(s.d)()?null:Object(l.jsx)(d,{isCloud:Object(o.e)(),isCloudTrial:Object(o.f)(),deploymentId:Object(o.b)()});var p=n(21),b=n(25),_=n(12);function f(){const{mlNodesAvailable:e}=function(){const{http:e}=Object(p.useKibana)().services,t=Object(r.useMemo)((()=>Object(_.mlApiServicesProvider)(new b.a(e))),[e]),[n,a]=Object(r.useState)(null),[s,o]=Object(r.useState)(null),[i,c]=Object(r.useState)(null),[l,d]=Object(r.useState)(!0),u=Object(r.useCallback)((async()=>{try{const{count:e,lazyNodeCount:n}=await t.mlNodeCount();a(e),o(n),c(!0),d(0!==e||0!==n)}catch(e){403===e.statusCode&&(c(!1),d(!0))}}),[t]);return Object(r.useEffect)((function(){u()}),[u]),{mlNodeCount:n,lazyMlNodeCount:s,userHasPermissionToViewMlNodeCount:i,mlNodesAvailable:l,refresh:u}}(),{isCloud:t,deploymentId:n,isCloudTrial:a}=function(){const{http:e}=Object(p.useKibana)().services,t=Object(r.useMemo)((()=>Object(_.mlApiServicesProvider)(new b.a(e))),[e]),[n,a]=Object(r.useState)(h),s=Object(r.useCallback)((async()=>{try{var e;const n=await t.mlInfo();a({cloudId:null!==(e=n.cloudId)&&void 0!==e?e:null,isCloud:void 0!==n.cloudId,isCloudTrial:!0===n.isCloudTrial,deploymentId:n.cloudId?Object(o.a)(n.cloudId):null})}catch(e){403===e.statusCode&&a(h)}}),[t]);return Object(r.useEffect)((function(){s()}),[s]),n}();return{mlNodesAvailable:e,isCloud:t,deploymentId:n,isCloudTrial:a}}const h={cloudId:null,isCloud:!1,isCloudTrial:!1,deploymentId:null},m=({nodeAvailableCallback:e,size:t})=>{const{mlNodesAvailable:n,isCloud:a,deploymentId:s,isCloudTrial:o}=f();return Object(r.useEffect)((function(){"function"==typeof e&&e(n)}),[n,e]),n?null:Object(l.jsx)(d,{size:t,isCloud:a,isCloudTrial:o,deploymentId:s})}},function(e,t,n){n.r(t);var r=__kbnBundles__.get("entry/core/public");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))},function(e,t,n){"use strict";n.d(t,"a",(function(){return ml_license_MlLicense})),n.d(t,"b",(function(){return p})),n.d(t,"c",(function(){return f}));var r=n(5),a=n.n(r),s=n(10),o=n(11),i=n(7),c=n(0);const l="basic",d="platinum",u="trial";class ml_license_MlLicense{constructor(){a()(this,"_licenseSubscription",null),a()(this,"_license",null),a()(this,"_isSecurityEnabled",!1),a()(this,"_hasLicenseExpired",!1),a()(this,"_isMlEnabled",!1),a()(this,"_isMinimumLicense",!1),a()(this,"_isFullLicense",!1),a()(this,"_isTrialLicense",!1),a()(this,"_licenseInfo$",new s.BehaviorSubject({license:this._license,isSecurityEnabled:this._isSecurityEnabled,hasLicenseExpired:this._hasLicenseExpired,isMlEnabled:this._isMlEnabled,isMinimumLicense:this._isMinimumLicense,isFullLicense:this._isFullLicense,isTrialLicense:this._isTrialLicense})),a()(this,"licenseInfo$",this._licenseInfo$.pipe(Object(o.distinctUntilChanged)(i.isEqual))),a()(this,"isLicenseReady$",this._licenseInfo$.pipe(Object(o.map)((e=>!!e.license)),Object(o.distinctUntilChanged)()))}setup(e,t){this._licenseSubscription=e.subscribe((e=>{const{isEnabled:n}=e.getFeature("security"),r={license:e,isSecurityEnabled:n,hasLicenseExpired:"expired"===e.status,isMlEnabled:e.getFeature(c.f).isEnabled,isMinimumLicense:_(e),isFullLicense:p(e),isTrialLicense:b(e)};this._licenseInfo$.next(r),this._license=e,this._isSecurityEnabled=r.isSecurityEnabled,this._hasLicenseExpired=r.hasLicenseExpired,this._isMlEnabled=r.isMlEnabled,this._isMinimumLicense=r.isMinimumLicense,this._isFullLicense=r.isFullLicense,this._isTrialLicense=r.isTrialLicense,void 0!==t&&t(this)}))}getLicenseInfo(){return this._licenseInfo$.getValue()}unsubscribe(){null!==this._licenseSubscription&&this._licenseSubscription.unsubscribe()}isSecurityEnabled(){return this._isSecurityEnabled}hasLicenseExpired(){return this._hasLicenseExpired}isMlEnabled(){return this._isMlEnabled}isMinimumLicense(){return this._isMinimumLicense}isFullLicense(){return this._isFullLicense}isTrialLicense(){return this._isTrialLicense}}function p(e){return"valid"===e.check(c.f,d).state}function b(e){return"valid"===e.check(c.f,u).state}function _(e){return"valid"===e.check(c.f,l).state}function f(e){return e.getFeature(c.f).isEnabled}},function(e,t){e.exports=__kbnSharedDeps__.Moment},function(e,t,n){"use strict";n.d(t,"b",(function(){return m})),n.d(t,"c",(function(){return S})),n.d(t,"d",(function(){return E})),n.d(t,"a",(function(){return y}));var r=n(5),a=n.n(r),s=n(18),o=n(2),i=n(24),c=n(7),l=n(54),d=n(34),u=n(10),p=n(11),b=n(20),_=n(4);const f=new Set(["_a","_g"]);function h(e){return f.has(e)}function m(e){const t={},n=Object(s.parse)(e,{sort:!1});try{Object.keys(n).forEach((e=>{h(e)?t[e]=Object(d.decode)(n[e]):t[e]=n[e]}))}catch(e){console.error("Could not read url state",e)}return t}const O=Object(o.createContext)({searchString:"",setUrlState:()=>{}}),{Provider:g}=O,y=({children:e})=>{const t=Object(i.useHistory)(),{search:n}=Object(i.useLocation)(),r=Object(o.useRef)(n);Object(o.useEffect)((()=>{r.current=n}),[n]);const a=Object(o.useCallback)(((e,n,a,o)=>{const i=r.current,u=m(i),p=Object(s.parse)(i,{sort:!1});if(Object.prototype.hasOwnProperty.call(u,e)||(u[e]={}),"string"==typeof n){if(Object(c.isEqual)(Object(l.a)(u,`${e}.${n}`),a))return i;u[e][n]=a}else{const t=n;Object.keys(t).forEach((n=>{u[e][n]=t[n]}))}try{const e=Object(s.stringify)(p,{sort:!1,encode:!1});if(Object.keys(u).forEach((e=>{h(e)?p[e]=Object(d.encode)(u[e]):p[e]=u[e]})),e!==Object(s.stringify)(p,{sort:!1,encode:!1})){const e=Object(s.stringify)(p,{sort:!1});r.current=e,o?t.replace({search:e}):t.push({search:e})}}catch(e){console.error("Could not save url state",e)}}),[]);return Object(_.jsx)(g,{value:{searchString:n,setUrlState:a}},e)},E=e=>{const{searchString:t,setUrlState:n}=Object(o.useContext)(O);return[Object(o.useMemo)((()=>{const n=m(t);if("object"==typeof n)return n[e]}),[t]),Object(o.useCallback)(((t,r,a)=>{n(e,t,r,a)}),[e,n])]};class url_state_PageUrlStateService{constructor(){a()(this,"_pageUrlState$",new u.BehaviorSubject(null)),a()(this,"_pageUrlStateCallback",null)}getPageUrlState$(){return this._pageUrlState$.pipe(Object(p.distinctUntilChanged)(c.isEqual))}getPageUrlState(){return this._pageUrlState$.getValue()}updateUrlState(e,t){if(!this._pageUrlStateCallback)throw new Error("Callback has not been initialized.");this._pageUrlStateCallback(e,t)}setCurrentState(e){this._pageUrlState$.next(e)}setUpdateCallback(e){this._pageUrlStateCallback=e}}const S=(e,t)=>{const[n,r]=E("_a"),a=null==n?void 0:n[e],s=Object(o.useRef)();Object(o.useEffect)((()=>{s.current=r}),[r]);const i=Object(o.useRef)(),l=Object(o.useMemo)((()=>{const e={...null!=t?t:{},...null!=a?a:{}};if(Object(c.isEqual)(e,i.current))return i.current;if(Object(b.a)(i.current))for(const t in e)Object(c.isEqual)(e[t],i.current[t])&&(e[t]=i.current[t]);return i.current=e,e}),[a]),d=Object(o.useCallback)(((t,n)=>{if(null==s||!s.current)throw new Error("Callback for URL state update has not been initialized.");s.current(e,{...l,...t},n)}),[e,l]),u=Object(o.useMemo)((()=>new url_state_PageUrlStateService),[]);return Object(o.useEffect)((function(){u.setCurrentState(l),u.setUpdateCallback(d)}),[u,d,l]),Object(o.useMemo)((()=>[l,d,u]),[l,d,u])}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(39),a=n(46);const s=new RegExp("^([0-9]*)\\s*("+n.n(a).a.units.join("|")+")$"),o=["ms","s","m","h"],i=["ms","s","m","h","d"];function c(e,t=!1){const n=String(e).trim().match(s);if(!Array.isArray(n)||n.length<3)return null;try{const e=parseInt(n[1],10),a=n[2];return isNaN(e)||e<1&&-1===o.indexOf(a)||!0===t&&-1===i.indexOf(a)?null:Object(r.duration)(e,a)}catch(e){return null}}},function(e,t,n){"use strict";let r;n.d(t,"c",(function(){return r})),n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return s})),function(e){e.ERROR="error",e.INFO="info",e.SUCCESS="success",e.WARNING="warning"}(r||(r={}));const a=["B","KB","MB","GB","TB","PB"],s=64},function(e,t,n){n.r(t);var r=__kbnBundles__.get("plugin/fieldFormats/common");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(43),a=n(8);const s={[r.FIELD_FORMAT_IDS.DURATION]:{inputFormat:"milliseconds",outputFormat:"humanizePrecise"}};function o(e){const{services:{fieldFormats:t}}=Object(a.a)(),n=t.deserialize({id:e,params:s[e]});return n.convert.bind(n)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return i}));var r=n(2),a=n(0),s=n(9);function o(e){return{getTrainedModels(t,n){const r=Array.isArray(t)?t.join(","):t;return e.http({path:`${a.c}/trained_models${r?`/${r}`:""}`,method:"GET",...n?{query:n}:{},version:"1"})},getTrainedModelStats(t,n){const r=Array.isArray(t)?t.join(","):t;return e.http({path:`${a.c}/trained_models${r?`/${r}`:""}/_stats`,method:"GET",version:"1"})},getTrainedModelPipelines(t){let n=t;return Array.isArray(t)&&(n=t.join(",")),e.http({path:`${a.c}/trained_models/${n}/pipelines`,method:"GET",version:"1"})},getAllIngestPipelines:()=>e.http({path:`${a.c}/trained_models/ingest_pipelines`,method:"GET",version:"1"}),createInferencePipeline:(t,n)=>e.http({path:`${a.c}/trained_models/create_inference_pipeline`,method:"POST",body:JSON.stringify({pipeline:n,pipelineName:t}),version:"1"}),deleteTrainedModel:(t,n={with_pipelines:!1,force:!1})=>e.http({path:`${a.c}/trained_models/${t}`,method:"DELETE",version:"1",query:n}),getTrainedModelsNodesOverview:()=>e.http({path:`${a.c}/model_management/nodes_overview`,method:"GET",version:"1"}),startModelAllocation:(t,n)=>e.http({path:`${a.c}/trained_models/${t}/deployment/_start`,method:"POST",query:n,version:"1"}),stopModelAllocation(t,n,r={force:!1}){const s=null==r?void 0:r.force;return e.http({path:`${a.c}/trained_models/${t}/${n.join(",")}/deployment/_stop`,method:"POST",query:{force:s},version:"1"})},updateModelDeployment:(t,n,r)=>e.http({path:`${a.c}/trained_models/${t}/${n}/deployment/_update`,method:"POST",body:JSON.stringify(r),version:"1"}),inferTrainedModel(t,n,r,s){const o=JSON.stringify(r);return e.http({path:`${a.c}/trained_models/infer/${t}/${n}`,method:"POST",body:o,...s?{query:{timeout:s}}:{},version:"1"})},trainedModelPipelineSimulate(t,n){const r=JSON.stringify({pipeline:t,docs:n});return e.http({path:`${a.c}/trained_models/pipeline_simulate`,method:"POST",body:r,version:"1"})},memoryUsage:(t,n,r=!1)=>e.http({path:`${a.c}/model_management/memory_usage`,method:"GET",query:{type:t,node:n,showClosedJobs:r},version:"1"}),putTrainedModelConfig:(t,n)=>e.http({path:`${a.c}/trained_models/${t}`,method:"PUT",body:JSON.stringify(n),version:"1"})}}function i(){const{services:{mlServices:{httpService:e}}}=Object(s.d)();return Object(r.useMemo)((()=>o(e)),[e])}},function(e,t){e.exports=__kbnSharedDeps__.KbnDatemath},function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return a}));const r="ml_anomaly_swimlane",a="ml_anomaly_charts"},function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"e",(function(){return i})),n.d(t,"h",(function(){return c})),n.d(t,"a",(function(){return l})),n.d(t,"c",(function(){return d})),n.d(t,"f",(function(){return u})),n.d(t,"g",(function(){return p})),n.d(t,"d",(function(){return b}));var r=n(0),a=n(27),s=n(26);const o={canGetJobs:!1},i={isADEnabled:!0,isDFAEnabled:!0,isNLPEnabled:!0},c={canGetJobs:!1,canGetDatafeeds:!1,canGetCalendars:!1,canFindFileStructure:!1,canGetDataFrameAnalytics:!1,canGetAnnotations:!1,canCreateAnnotation:!1,canDeleteAnnotation:!1,canUseMlAlerts:!1,canGetTrainedModels:!1,canTestTrainedModels:!1,canGetFieldInfo:!1,canGetMlInfo:!1,canUseAiops:!1},l={canCreateJob:!1,canDeleteJob:!1,canOpenJob:!1,canCloseJob:!1,canResetJob:!1,canUpdateJob:!1,canForecastJob:!1,canCreateDatafeed:!1,canDeleteDatafeed:!1,canStartStopDatafeed:!1,canUpdateDatafeed:!1,canPreviewDatafeed:!1,canGetFilters:!1,canCreateCalendar:!1,canDeleteCalendar:!1,canCreateFilter:!1,canDeleteFilter:!1,canCreateDataFrameAnalytics:!1,canDeleteDataFrameAnalytics:!1,canStartStopDataFrameAnalytics:!1,canCreateMlAlerts:!1,canUseMlAlerts:!1,canViewMlNodes:!1,canCreateTrainedModels:!1,canDeleteTrainedModels:!1,canStartStopTrainedModels:!1},d=["canFindFileStructure","canGetFieldInfo","canGetMlInfo"];function u(){return{...i,...c,...l}}function p(){const e=Object.keys(o),t=Object.keys(c),n=Object.keys(i),d=Object.keys(l),u=[...n,...d,...t],p=["index-pattern","dashboard","search","visualization",a.a,a.b,a.c],b={app:[r.f,"kibana"],excludeFromBasePrivileges:!1,management:{insightsAndAlerting:["jobsListLink"]},catalogue:[r.f]};return{admin:{...b,api:["fileUpload:analyzeFile",...u.map((e=>`ml:${e}`))],catalogue:[r.f,`${r.f}_file_data_visualizer`],ui:u,savedObject:{all:p,read:p},alerting:{rule:{all:Object.values(s.d)},alert:{all:Object.values(s.d)}}},user:{...b,api:["fileUpload:analyzeFile",...[...n,...t].map((e=>`ml:${e}`))],catalogue:[r.f],management:{insightsAndAlerting:[]},ui:[...n,...t],savedObject:{all:[],read:p},alerting:{rule:{read:Object.values(s.d)},alert:{read:Object.values(s.d)}}},apmUser:{excludeFromBasePrivileges:!0,app:[],catalogue:[],savedObject:{all:[],read:[a.a]},api:e.map((e=>`ml:${e}`)),ui:e}}}const b={ad:["canGetJobs","canGetDatafeeds","canGetCalendars","canGetAnnotations","canCreateAnnotation","canDeleteAnnotation","canCreateJob","canDeleteJob","canOpenJob","canCloseJob","canResetJob","canUpdateJob","canForecastJob","canCreateDatafeed","canDeleteDatafeed","canStartStopDatafeed","canUpdateDatafeed","canPreviewDatafeed","canGetFilters","canCreateCalendar","canDeleteCalendar","canCreateFilter","canDeleteFilter"],dfa:["canGetDataFrameAnalytics","canCreateDataFrameAnalytics","canDeleteDataFrameAnalytics","canStartStopDataFrameAnalytics"],nlp:["canGetTrainedModels","canTestTrainedModels","canCreateTrainedModels","canDeleteTrainedModels","canStartStopTrainedModels"]}},function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return a}));const r="anomaly-swim-lane",a="anomaly-charts"},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(2),a=n.n(r),s=n(4);const o=a.a.lazy((()=>n.e(29).then(n.bind(null,666)))),i=({jobIds:e})=>Object(s.jsx)(a.a.Suspense,{fallback:Object(s.jsx)("div",null)},Object(s.jsx)(o,{jobIds:e}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(6);function a(e,t,a){return e.sections.section.insightsAndAlerting.registerApp({id:"jobsListLink",title:r.i18n.translate("xpack.ml.management.jobsListTitle",{defaultMessage:"Machine Learning"}),order:4,async mount(e){const{mountApp:r}=await Promise.all([n.e(2),n.e(1),n.e(0),n.e(3),n.e(4),n.e(5),n.e(6),n.e(17)]).then(n.bind(null,97));return r(t,e,a)}})}},function(e,t,n){"use strict";n.d(t,"c",(function(){return c})),n.d(t,"b",(function(){return l})),n.d(t,"a",(function(){return d})),n.d(t,"d",(function(){return u})),n.d(t,"e",(function(){return p}));var r=n(7),a=n(3),s=n(1),o=n(14),i=n(19);function c(e,t){let n=`${e}/${s.b.ANOMALY_DETECTION_JOBS_MANAGE}`;if(!t||Object(r.isEmpty)(t))return n;const{jobId:o,groupIds:c,globalState:l}=t;if(o||c){const e=[];o&&e.push(Object(i.b)(o)),c&&e.push(Object(i.a)(c));const t={...e.length>0?{queryText:e.join(" ")}:{}},r={[s.b.ANOMALY_DETECTION_JOBS_MANAGE]:t};n=Object(a.setStateToKbnUrl)("_a",r,{useHash:!1,storeInHashQuery:!1},n)}return l&&(n=Object(a.setStateToKbnUrl)("_g",l,{useHash:!1,storeInHashQuery:!1},n)),n}function l(e,t){return Object(o.a)(e,s.b.ANOMALY_DETECTION_CREATE_JOB_SELECT_TYPE,t)}function d(e,t){return Object(o.a)(e,s.b.ANOMALY_DETECTION_CREATE_JOB_SELECT_INDEX,t)}function u(e,t){let n=`${e}/${s.b.ANOMALY_EXPLORER}`;if(!t)return n;const{refreshInterval:r,timeRange:o,jobIds:i,query:c,mlExplorerSwimlane:l={},mlExplorerFilter:d={},globalState:u}=t,p={mlExplorerSwimlane:l,mlExplorerFilter:d};let b={};return u&&(b=u),c&&(p.query=c),i&&(b.ml={jobIds:i}),r&&(b.refreshInterval=r),o&&(b.time=o),n=Object(a.setStateToKbnUrl)("_g",b,{useHash:!1,storeInHashQuery:!1},n),n=Object(a.setStateToKbnUrl)("_a",{[s.b.ANOMALY_EXPLORER]:p},{useHash:!1,storeInHashQuery:!1},n),n}function p(e,t){let n=`${e}/${s.b.SINGLE_METRIC_VIEWER}`;if(!t)return n;const{timeRange:r,jobIds:o,refreshInterval:i,query:c,detectorIndex:l,forecastId:d,entities:u,globalState:p,functionDescription:b,zoom:_}=t;let f={};p&&(f=p),o&&(f.ml={jobIds:o}),i&&(f.refreshInterval=i),r&&(f.time=r);const h={},m={};return void 0!==d&&(m.forecastId=d),void 0!==l&&(m.detectorIndex=l),void 0!==u&&(m.entities=u),void 0!==b&&(m.functionDescription=b),void 0!==_&&(m.zoom=_),h.mlTimeSeriesExplorer=m,c&&(h.query={query_string:c}),n=Object(a.setStateToKbnUrl)("_g",f,{useHash:!1,storeInHashQuery:!1},n),n=Object(a.setStateToKbnUrl)("_a",{[s.b.SINGLE_METRIC_VIEWER]:h},{useHash:!1,storeInHashQuery:!1},n),n}},function(e,t,n){"use strict";n.r(t),n.d(t,"jobsApiProvider",(function(){return o})),n.d(t,"useJobsApiService",(function(){return i}));var r=n(2),a=n(9),s=n(0);const o=e=>({jobsSummary(t){const n=JSON.stringify({jobIds:t});return e.http({path:`${s.c}/jobs/jobs_summary`,method:"POST",body:n,version:"1"})},jobIdsWithGeo:()=>e.http({path:`${s.c}/jobs/jobs_with_geo`,method:"GET",version:"1"}),jobsWithTimerange(t){const n=JSON.stringify({dateFormatTz:t});return e.http({path:`${s.c}/jobs/jobs_with_time_range`,method:"POST",body:n,version:"1"})},jobForCloning(t){const n=JSON.stringify({jobId:t});return e.http({path:`${s.c}/jobs/job_for_cloning`,method:"POST",body:n,version:"1"})},jobs(t){const n=JSON.stringify({jobIds:t});return e.http({path:`${s.c}/jobs/jobs`,method:"POST",body:n,version:"1"})},groups:()=>e.http({path:`${s.c}/jobs/groups`,method:"GET",version:"1"}),updateGroups(t){const n=JSON.stringify({jobs:t});return e.http({path:`${s.c}/jobs/update_groups`,method:"POST",body:n,version:"1"})},forceStartDatafeeds(t,n,r){const a=JSON.stringify({datafeedIds:t,start:n,end:r});return e.http({path:`${s.c}/jobs/force_start_datafeeds`,method:"POST",body:a,version:"1"})},stopDatafeeds(t){const n=JSON.stringify({datafeedIds:t});return e.http({path:`${s.c}/jobs/stop_datafeeds`,method:"POST",body:n,version:"1"})},deleteJobs(t,n){const r=JSON.stringify({jobIds:t,deleteUserAnnotations:n});return e.http({path:`${s.c}/jobs/delete_jobs`,method:"POST",body:r,version:"1"})},closeJobs(t){const n=JSON.stringify({jobIds:t});return e.http({path:`${s.c}/jobs/close_jobs`,method:"POST",body:n,version:"1"})},resetJobs(t,n){const r=JSON.stringify({jobIds:t,deleteUserAnnotations:n});return e.http({path:`${s.c}/jobs/reset_jobs`,method:"POST",body:r,version:"1"})},forceStopAndCloseJob(t){const n=JSON.stringify({jobId:t});return e.http({path:`${s.c}/jobs/force_stop_and_close_job`,method:"POST",body:n,version:"1"})},jobAuditMessages({jobId:t,from:n,start:r,end:a}){const o=void 0!==t?`/${t}`:"",i={...void 0!==n?{from:n}:{},...void 0!==r&&void 0!==a?{start:r,end:a}:{}};return e.http({path:`${s.c}/job_audit_messages/messages${o}`,method:"GET",query:i,version:"1"})},clearJobAuditMessages(t,n){const r=JSON.stringify({jobId:t,notificationIndices:n});return e.http({path:`${s.c}/job_audit_messages/clear_messages`,method:"PUT",body:r,version:"1"})},blockingJobTasks:()=>e.http({path:`${s.c}/jobs/blocking_jobs_tasks`,method:"GET",version:"1"}),jobsExist(t,n=!1){const r=JSON.stringify({jobIds:t,allSpaces:n});return e.http({path:`${s.c}/jobs/jobs_exist`,method:"POST",body:r,version:"1"})},jobsExist$(t,n=!1){const r=JSON.stringify({jobIds:t,allSpaces:n});return e.http$({path:`${s.c}/jobs/jobs_exist`,method:"POST",body:r,version:"1"})},newJobCaps(t,n=!1){const r=!0===n?{rollup:!0}:{};return e.http({path:`${s.c}/jobs/new_job_caps/${t}`,method:"GET",query:r,version:"1"})},newJobLineChart(t,n,r,a,o,i,c,l,d,u,p){const b=JSON.stringify({indexPatternTitle:t,timeField:n,start:r,end:a,intervalMs:o,query:i,aggFieldNamePairs:c,splitFieldName:l,splitFieldValue:d,runtimeMappings:u,indicesOptions:p});return e.http({path:`${s.c}/jobs/new_job_line_chart`,method:"POST",body:b,version:"1"})},newJobPopulationsChart(t,n,r,a,o,i,c,l,d,u){const p=JSON.stringify({indexPatternTitle:t,timeField:n,start:r,end:a,intervalMs:o,query:i,aggFieldNamePairs:c,splitFieldName:l,runtimeMappings:d,indicesOptions:u});return e.http({path:`${s.c}/jobs/new_job_population_chart`,method:"POST",body:p,version:"1"})},getAllJobAndGroupIds:()=>e.http({path:`${s.c}/jobs/all_jobs_and_group_ids`,method:"GET",version:"1"}),getLookBackProgress(t,n,r){const a=JSON.stringify({jobId:t,start:n,end:r});return e.http({path:`${s.c}/jobs/look_back_progress`,method:"POST",body:a,version:"1"})},categorizationFieldExamples(t,n,r,a,o,i,c,l,d,u,p){const b=JSON.stringify({indexPatternTitle:t,query:n,size:r,field:a,timeField:o,start:i,end:c,analyzer:l,runtimeMappings:d,indicesOptions:u,includeExamples:p});return e.http({path:`${s.c}/jobs/categorization_field_validation`,method:"POST",body:b,version:"1"})},topCategories(t,n){const r=JSON.stringify({jobId:t,count:n});return e.http({path:`${s.c}/jobs/top_categories`,method:"POST",body:r,version:"1"})},revertModelSnapshot(t,n,r,a,o){const i=JSON.stringify({jobId:t,snapshotId:n,replay:r,end:a,calendarEvents:o});return e.http({path:`${s.c}/jobs/revert_model_snapshot`,method:"POST",body:i,version:"1"})},datafeedPreview(t,n,r){const a=JSON.stringify({datafeedId:t,job:n,datafeed:r});return e.http({path:`${s.c}/jobs/datafeed_preview`,method:"POST",body:a,version:"1"})},bulkCreateJobs(t){const n=JSON.stringify(t);return e.http({path:`${s.c}/jobs/bulk_create`,method:"POST",body:n,version:"1"})}});function i(){const{services:{mlServices:{httpService:e}}}=Object(a.d)();return Object(r.useMemo)((()=>o(e)),[e])}},function(e,t,n){"use strict";function r(e,t,n){const a=t.split(".");let s=e;for(let e=0;e"object"==typeof t?r(t,a.slice(e+1,a.length).join(".")):t));break}}return void 0===s?n:s}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"b",(function(){return l})),n.d(t,"a",(function(){return d}));var r=n(2),a=n(10),s=n(29),o=n.n(s),i=n(35);const c={darkMode:!1};function l(e){const t=Object(r.useMemo)((()=>{var t;return null!==(t=null==e?void 0:e.theme$)&&void 0!==t?t:Object(a.of)(c)}),[e]),{darkMode:n}=o()(t,c);return n}function d(e){const t=l(e);return Object(r.useMemo)((()=>({euiTheme:t?i.euiDarkVars:i.euiLightVars})),[t])}},function(e,t){e.exports=__kbnSharedDeps_npm__},function(e,t){e.exports=__kbnSharedDeps__.TsLib},function(e,t,n){"use strict";n.r(t);var r=n(31);n.d(t,"composeValidators",(function(){return r.a})),n.d(t,"patternValidator",(function(){return r.e}));var a=n(48);n.d(t,"getDefaultMlCapabilities",(function(){return a.f}));var s=n(30);n.d(t,"DATAFEED_STATE",(function(){return s.a})),n.d(t,"JOB_STATE",(function(){return s.c}))},function(e,t,n){"use strict";n.r(t),n.d(t,"plugin",(function(){return O})),n.d(t,"ANOMALY_SWIMLANE_EMBEDDABLE_TYPE",(function(){return _.b})),n.d(t,"CONTROLLED_BY_SWIM_LANE_FILTER",(function(){return f.b})),n.d(t,"useMlHref",(function(){return d.c})),n.d(t,"ML_PAGES",(function(){return d.a})),n.d(t,"MlLocatorDefinition",(function(){return d.b})),n.d(t,"getMlSharedImports",(function(){return g})),n.d(t,"MLJobsAwaitingNodeWarning",(function(){return h.a})),n.d(t,"MlNodeAvailableWarningShared",(function(){return m.a})),n.d(t,"useMlNodeAvailableCheck",(function(){return m.c}));var r=n(5),a=n.n(r),s=n(6),o=n(10),i=n(11),c=n(37),l=n(51),d=n(16),u=n(13),p=n(0),b=n(38);class plugin_MlPlugin{constructor(e){a()(this,"appUpdater$",new o.BehaviorSubject((()=>({})))),a()(this,"locator",void 0),this.initializerContext=e}setup(e,t){return e.application.register({id:p.f,title:s.i18n.translate("xpack.ml.plugin.title",{defaultMessage:"Machine Learning"}),order:5e3,euiIconType:p.e,appRoute:"/app/ml",category:c.DEFAULT_APP_CATEGORIES.kibana,updater$:this.appUpdater$,mount:async r=>{const[a,s]=await e.getStartServices(),o=this.initializerContext.env.packageInfo.version,{renderApp:i}=await Promise.all([n.e(2),n.e(1),n.e(0),n.e(3),n.e(4),n.e(5),n.e(6)]).then(n.bind(null,190));return i(a,{charts:s.charts,data:s.data,unifiedSearch:s.unifiedSearch,dashboard:s.dashboard,share:s.share,security:s.security,licensing:s.licensing,management:t.management,licenseManagement:t.licenseManagement,home:t.home,embeddable:{...t.embeddable,...s.embeddable},maps:s.maps,uiActions:s.uiActions,kibanaVersion:o,triggersActionsUi:s.triggersActionsUi,dataVisualizer:s.dataVisualizer,usageCollection:t.usageCollection,fieldFormats:s.fieldFormats,lens:s.lens,cases:s.cases,savedObjectsManagement:s.savedObjectsManagement,savedSearch:s.savedSearch,contentManagement:s.contentManagement,presentationUtil:s.presentationUtil},r)}}),t.share&&(this.locator=t.share.url.locators.create(new d.b)),t.management&&Object(l.a)(t.management,e,{usageCollection:t.usageCollection}).enable(),t.licensing.license$.pipe(Object(i.take)(1)).subscribe((async r=>{const a=Object(b.c)(r),o=Object(b.b)(r),[i,l]=await e.getStartServices(),{capabilities:d}=i.application;a?t.home&&t.home.featureCatalogue.register({id:p.f,title:s.i18n.translate("xpack.ml.machineLearningTitle",{defaultMessage:"Machine Learning"}),subtitle:s.i18n.translate("xpack.ml.machineLearningSubtitle",{defaultMessage:"Model, predict, and detect."}),description:s.i18n.translate("xpack.ml.machineLearningDescription",{defaultMessage:"Automatically model the normal behavior of your time series data to detect anomalies."}),icon:"machineLearningApp",path:"/app/ml",showOnHomePage:!1,category:"data",solutionId:"kibana",order:500}):this.appUpdater$.next((()=>({status:c.AppStatus.inaccessible})));const{registerEmbeddables:u,registerMlUiActions:_,registerSearchLinks:f,registerMlAlerts:h,registerMapExtension:m,registerCasesAttachments:O}=await Promise.all([n.e(5),n.e(6),n.e(23)]).then(n.bind(null,674));if(t.maps){var g,y;const n=!0===(null===(g=d.ml)||void 0===g?void 0:g.canGetJobs),r=!0===(null===(y=d.ml)||void 0===y?void 0:y.canCreateJob);await m(t.maps,e,{canGetJobs:n,canCreateJobs:r})}if(a&&(f(this.appUpdater$,o,d.ml),o)){var E;u(t.embeddable,e),_(t.uiActions,e),t.cases&&O(t.cases,i,l);const n=null===(E=d.ml)||void 0===E?void 0:E.canUseMlAlerts;t.triggersActionsUi&&n&&h(t.triggersActionsUi,t.alerting)}})),{locator:this.locator}}start(e,t){return Object(u.j)({docLinks:e.docLinks,basePath:e.http.basePath,http:e.http,i18n:e.i18n,lens:t.lens}),{locator:this.locator}}stop(){}}var _=n(47),f=n(49),h=n(50),m=n(36);const O=e=>new plugin_MlPlugin(e),g=async()=>await Promise.all([n.e(2),n.e(5),n.e(34)]).then(n.bind(null,681))},function(e,t,n){n(61),__kbnBundles__.define("plugin/ml/public",n,59),__kbnBundles__.define("plugin/ml/common",n,58)},function(e,t,n){n.p=window.__kbnPublicPath__.ml},function(e,t,n){"use strict";e.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`))},function(e,t,n){"use strict";var r="%[a-f0-9]{2}",a=new RegExp("("+r+")|([^%]+?)","gi"),s=new RegExp("("+r+")+","gi");function o(e,t){try{return[decodeURIComponent(e.join(""))]}catch(e){}if(1===e.length)return e;t=t||1;var n=e.slice(0,t),r=e.slice(t);return Array.prototype.concat.call([],o(n),o(r))}function i(e){try{return decodeURIComponent(e)}catch(r){for(var t=e.match(a)||[],n=1;n{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];const n=e.indexOf(t);return-1===n?[e]:[e.slice(0,n),e.slice(n+t.length)]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),a="undefined"!=typeof window?r.useLayoutEffect:r.useEffect;t.default=a},function(e,t){e.exports=__kbnSharedDeps__.ElasticCharts},function(e,t){e.exports=__kbnSharedDeps__.KbnEsQuery},function(e,t,n){n.r(t);var r=__kbnBundles__.get("plugin/maps/common");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))},function(e,t,n){n.r(t);var r=__kbnBundles__.get("plugin/data/public");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))},function(e,t){e.exports=__kbnSharedDeps__.Classnames},function(e,t){e.exports=__kbnSharedDeps__.ReactDom},function(e,t,n){n.r(t);var r=__kbnBundles__.get("plugin/embeddable/public");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))},function(e,t){e.exports=__kbnSharedDeps__.MomentTimezone},function(e,t,n){n.r(t);var r=__kbnBundles__.get("plugin/esUiShared/public");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))},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__.ElasticNumeral},function(e,t){e.exports=__kbnSharedDeps__.ElasticEuiLibServices},function(e,t,n){n.r(t);var r=__kbnBundles__.get("plugin/dashboard/public");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))},function(e,t){e.exports=__kbnSharedDeps__.EmotionCache},function(e,t,n){n.r(t);var r=__kbnBundles__.get("plugin/savedObjectsFinder/public");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))},function(e,t){e.exports=__kbnSharedDeps__.KbnStd},function(e,t,n){n.r(t);var r=__kbnBundles__.get("plugin/aiops/public");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))},function(e,t,n){n.r(t);var r=__kbnBundles__.get("plugin/maps/public");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))},function(e,t){e.exports=__kbnSharedDeps__.ReactRouterDomV5Compat},function(e,t,n){n.r(t);var r=__kbnBundles__.get("plugin/lens/public");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))},function(e,t,n){n.r(t);var r=__kbnBundles__.get("plugin/unifiedSearch/public");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))},function(e,t,n){n.r(t);var r=__kbnBundles__.get("plugin/aiops/common");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))},function(e,t,n){n.r(t);var r=__kbnBundles__.get("plugin/charts/public");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))},function(e,t){e.exports=__kbnSharedDeps__.Jquery},function(e,t){e.exports=__kbnSharedDeps__.KbnAnalytics},function(e,t){e.exports=__kbnSharedDeps__.KbnMonaco},function(e,t){e.exports=__kbnSharedDeps__.ElasticEuiLibServicesFormat},function(e,t,n){n.r(t);var r=__kbnBundles__.get("plugin/kibanaReact/common");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))},function(e,t,n){n.r(t);var r=__kbnBundles__.get("plugin/cases/common");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))},function(e,t){e.exports=__kbnSharedDeps__.ElasticEuiChartsTheme},function(e,t,n){n.r(t);var r=__kbnBundles__.get("plugin/usageCollection/public");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))}]);