/*! Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one or more contributor license agreements. * Licensed under the Elastic License 2.0; you may not use this file except in compliance with the Elastic License 2.0. */ (window.upgradeAssistant_bundle_jsonpfunction=window.upgradeAssistant_bundle_jsonpfunction||[]).push([[1],Array(37).concat([function(e,t,s){"use strict";var a,i=function(){var e={};return function(t){if(void 0===e[t]){var s=document.querySelector(t);if(window.HTMLIFrameElement&&s instanceof window.HTMLIFrameElement)try{s=s.contentDocument.head}catch(e){s=null}e[t]=s}return e[t]}}(),n=[];function r(e){for(var t=-1,s=0;s.upgLoadingItem{margin:6px}",""]),e.exports=t},function(e,t,s){var a=s(37),i=s(62);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.i,i,""]]);a(i,{insert:"head",singleton:!1}),e.exports=i.locals||{}},function(e,t,s){(t=s(38)(!1)).push([e.i,".upgToggleLoading>.upgLoadingItem{margin:6px}",""]),e.exports=t},function(e,t,s){switch(window.__kbnThemeTag__){case"v8dark":return s(64);case"v8light":return s(66)}},function(e,t,s){var a=s(37),i=s(65);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.i,i,""]]);a(i,{insert:"head",singleton:!1}),e.exports=i.locals||{}},function(e,t,s){(t=s(38)(!1)).push([e.i,".upgDeprecationIssuesPanel .euiCard__content,.upgDeprecationIssuesPanel__stat{display:flex;flex-direction:column;justify-content:space-between}.upgDeprecationIssuesPanel__stat{flex-grow:1;height:60px}",""]),e.exports=t},function(e,t,s){var a=s(37),i=s(67);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.i,i,""]]);a(i,{insert:"head",singleton:!1}),e.exports=i.locals||{}},function(e,t,s){(t=s(38)(!1)).push([e.i,".upgDeprecationIssuesPanel .euiCard__content,.upgDeprecationIssuesPanel__stat{display:flex;flex-direction:column;justify-content:space-between}.upgDeprecationIssuesPanel__stat{flex-grow:1;height:60px}",""]),e.exports=t},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=s(22);t.default=function(e,t){var s=a.useRef((function(){}));a.useEffect((function(){s.current=e})),a.useEffect((function(){if(null!==t){var e=setInterval((function(){return s.current()}),t||0);return function(){return clearInterval(e)}}}),[t])}},function(e,t,s){"use strict";s.r(t),s.d(t,"mountManagementSection",(function(){return Ss}));var a=s(22),i=s.n(a),n=s(32),r=s(27),o=s(39),l=s.n(o);const u={services:{}},c=Object(a.createContext)(u);var d=s(41),p=s.n(d),g=s(23);const j=({children:e,component:t,render:s,...n})=>{const o=Object(a.useMemo)((()=>{if(t)return e=>Object(g.jsx)(i.a.Fragment,null,Object(g.jsx)(x,null),Object(g.jsx)(t,e))}),[t]);if(o)return Object(g.jsx)(r.Route,l()({},n,{component:o}));if(s||"function"==typeof e){const t="function"==typeof e?e:s;return Object(g.jsx)(r.Route,l()({},n,{render:e=>Object(g.jsx)(i.a.Fragment,null,Object(g.jsx)(x,null),t(e))}))}return Object(g.jsx)(r.Route,n,Object(g.jsx)(x,null),e)},x=()=>{const{executionContext:e}=Object(a.useContext)(c).services,t=Object(r.useRouteMatch)();return function(e,t){p()((()=>(null==e||e.set(t),()=>{null==e||e.clear()})),[t])}(e,{type:"application",page:t.path,id:Object.keys(t.params).length>0?JSON.stringify(t.params):void 0}),null};var b=s(31);const f=({children:e,...t})=>Object(g.jsx)(r.Router,t,Object(g.jsx)(b.CompatRouter,null,e));var m=s(28);const O=({legacySwitch:e=!0,children:t})=>{const s=Object(r.useRouteMatch)();return e?Object(g.jsx)(r.Switch,null,t):Object(g.jsx)(b.Routes,null,a.Children.map(t,(e=>{if(i.a.isValidElement(e)&&e.type===j){var a;const n=Object(m.replace)(null==e?void 0:e.props.path,s.url+"/",""),r="function"==typeof(null==e?void 0:e.props.children)?null==e?void 0:e.props.children:null==e?void 0:e.props.render;return Object(g.jsx)(b.Route,{path:n,element:Object(g.jsx)(i.a.Fragment,null,Object(g.jsx)(x,null),(null==e||null===(a=e.props)||void 0===a?void 0:a.component)&&Object(g.jsx)(e.props.component,null)||r&&r()||t)})}return e})))};var h=s(25),v=s(24),E=s(0),y=s(5);const k=Object(a.createContext)(void 0),C=({children:e,value:t})=>Object(g.jsx)(k.Provider,{value:t},e),S=()=>{const e=Object(a.useContext)(k);if(!e)throw new Error("useAppContext must be called from inside AppContext");return e};var T=s(33),M=s(3),L=s(26),I=s(6);const F=e=>M.i18n.translate("xpack.upgradeAssistant.noDeprecationsPrompt.description",{defaultMessage:"Your {deprecationType} configuration is up to date",values:{deprecationType:e}}),w=e=>Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.noDeprecationsPrompt.nextStepsDescription",defaultMessage:"Check the {overviewButton} for other Stack deprecations.",values:{overviewButton:Object(g.jsx)(v.EuiLink,{onClick:e},M.i18n.translate("xpack.upgradeAssistant.noDeprecationsPrompt.overviewLinkText",{defaultMessage:"Overview page"}))}}),D=({deprecationType:e,navigateToOverviewPage:t})=>Object(g.jsx)(v.EuiEmptyPrompt,{iconType:"check","data-test-subj":"noDeprecationsPrompt",title:Object(g.jsx)("h2",null,F(e)),body:Object(g.jsx)(i.a.Fragment,null,Object(g.jsx)("p",{"data-test-subj":"upgradeAssistantIssueSummary"},w(t)))}),A={critical:M.i18n.translate("xpack.upgradeAssistant.levelInfoTip.criticalLabel",{defaultMessage:"Critical issues must be resolved before you upgrade"}),warning:M.i18n.translate("xpack.upgradeAssistant.levelInfoTip.warningLabel",{defaultMessage:"Warning issues can be ignored at your discretion"})},R=({level:e})=>Object(g.jsx)(v.EuiIconTip,{content:A[e],position:"top",type:"iInCircle"}),B=({totalCriticalDeprecations:e,totalWarningDeprecations:t})=>{return Object(g.jsx)(v.EuiFlexGroup,null,Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiFlexGroup,{gutterSize:"xs",alignItems:"center"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiHealth,{color:"danger","data-test-subj":"criticalDeprecationsCount"},(s=e,M.i18n.translate("xpack.upgradeAssistant.deprecationCount.criticalStatusLabel",{defaultMessage:"Critical: {count}",values:{count:s}})))),Object(g.jsx)(v.EuiFlexItem,null,Object(g.jsx)(R,{level:"critical"})))),Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiFlexGroup,{gutterSize:"xs",alignItems:"center"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiHealth,{color:"subdued","data-test-subj":"warningDeprecationsCount"},(e=>M.i18n.translate("xpack.upgradeAssistant.deprecationCount.warningStatusLabel",{defaultMessage:"Warning: {count}",values:{count:e}}))(t))),Object(g.jsx)(v.EuiFlexItem,null,Object(g.jsx)(R,{level:"warning"})))));var s},_={criticalBadgeLabel:M.i18n.translate("xpack.upgradeAssistant.deprecationBadge.criticalBadgeLabel",{defaultMessage:"Critical"}),resolvedBadgeLabel:M.i18n.translate("xpack.upgradeAssistant.deprecationBadge.resolvedBadgeLabel",{defaultMessage:"Resolved"}),warningBadgeLabel:M.i18n.translate("xpack.upgradeAssistant.deprecationBadge.warningBadgeLabel",{defaultMessage:"Warning"})},P=({isCritical:e,isResolved:t})=>t?Object(g.jsx)(v.EuiBadge,{color:"success","data-test-subj":"resolvedDeprecationBadge"},_.resolvedBadgeLabel):e?Object(g.jsx)(v.EuiBadge,{color:"danger","data-test-subj":"criticalDeprecationBadge"},_.criticalBadgeLabel):Object(g.jsx)(v.EuiBadge,{color:"default","data-test-subj":"warningDeprecationBadge"},_.warningBadgeLabel),N=({deprecationSource:e,message:t})=>Object(g.jsx)(v.EuiPageContent_Deprecated,{verticalPosition:"center",horizontalPosition:"center",color:"danger","data-test-subj":"deprecationsPageLoadingError"},Object(g.jsx)(v.EuiEmptyPrompt,{iconType:"warning",title:Object(g.jsx)("h2",null,M.i18n.translate("xpack.upgradeAssistant.deprecationsPageLoadingError.title",{defaultMessage:"Could not retrieve {deprecationSource} deprecation issues",values:{deprecationSource:e}})),body:t})),z=({documentationUrl:e})=>Object(g.jsx)(v.EuiLink,{target:"_blank","data-test-subj":"documentationLink",href:e},M.i18n.translate("xpack.upgradeAssistant.deprecationFlyout.learnMoreLinkLabel",{defaultMessage:"Learn more"})),U={cluster_settings:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.clusterDeprecationTypeLabel",{defaultMessage:"Cluster"}),index_settings:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.indexDeprecationTypeLabel",{defaultMessage:"Index"}),node_settings:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.nodeDeprecationTypeLabel",{defaultMessage:"Node"}),ml_settings:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.mlDeprecationTypeLabel",{defaultMessage:"Machine Learning"}),health_indicator:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.healthIndicatorTypeLabel",{defaultMessage:"Health Indicator"})},W={initialPageSize:50,pageSizeOptions:[50,100,200]},q={manualCellLabel:M.i18n.translate("xpack.upgradeAssistant.kibanaDeprecations.table.manualCellLabel",{defaultMessage:"Manual"}),manualCellTooltipLabel:M.i18n.translate("xpack.upgradeAssistant.kibanaDeprecations.table.manualCellTooltipLabel",{defaultMessage:"This issue needs to be resolved manually."}),automatedCellLabel:M.i18n.translate("xpack.upgradeAssistant.kibanaDeprecations.table.automatedCellLabel",{defaultMessage:"Automated"}),automationInProgressCellLabel:M.i18n.translate("xpack.upgradeAssistant.kibanaDeprecations.table.automationInProgressCellLabel",{defaultMessage:"Resolution in progress…"}),automationCompleteCellLabel:M.i18n.translate("xpack.upgradeAssistant.kibanaDeprecations.table.automationCompleteCellLabel",{defaultMessage:"Resolved"}),automationFailedCellLabel:M.i18n.translate("xpack.upgradeAssistant.kibanaDeprecations.table.automationFailedCellLabel",{defaultMessage:"Resolution failed"}),automatedCellTooltipLabel:M.i18n.translate("xpack.upgradeAssistant.kibanaDeprecations.table.automatedCellTooltipLabel",{defaultMessage:"This issue can be resolved automatically."})},G=({deprecationId:e,isAutomated:t,deprecationResolutionState:s})=>{if(t){if((null==s?void 0:s.id)===e){const{resolveDeprecationStatus:e}=s;switch(e){case"in_progress":return Object(g.jsx)(v.EuiFlexGroup,{gutterSize:"s",alignItems:"center","data-test-subj":"resolutionStatusCell"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiLoadingSpinner,{size:"m"})),Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiText,{size:"s"},q.automationInProgressCellLabel)));case"fail":return Object(g.jsx)(v.EuiFlexGroup,{gutterSize:"s",alignItems:"center","data-test-subj":"resolutionStatusCell"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiIcon,{type:"warning",color:"danger"})),Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiText,{size:"s"},q.automationFailedCellLabel)));default:return Object(g.jsx)(v.EuiFlexGroup,{gutterSize:"s",alignItems:"center","data-test-subj":"resolutionStatusCell"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiIcon,{type:"check",color:"success"})),Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiText,{size:"s"},q.automationCompleteCellLabel)))}}return Object(g.jsx)(v.EuiToolTip,{position:"top",content:q.automatedCellTooltipLabel},Object(g.jsx)(v.EuiFlexGroup,{gutterSize:"s",alignItems:"center","data-test-subj":"resolutionStatusCell"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiIcon,{type:"indexSettings"})),Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiText,{size:"s"},q.automatedCellLabel))))}return Object(g.jsx)(v.EuiToolTip,{position:"top",content:q.manualCellTooltipLabel,"data-test-subj":"resolutionStatusCell"},Object(g.jsx)(v.EuiText,{size:"s",color:"subdued"},q.manualCellLabel))},$={refreshButtonLabel:M.i18n.translate("xpack.upgradeAssistant.kibanaDeprecations.table.refreshButtonLabel",{defaultMessage:"Refresh"}),statusColumnTitle:M.i18n.translate("xpack.upgradeAssistant.kibanaDeprecations.table.statusColumnTitle",{defaultMessage:"Status"}),issueColumnTitle:M.i18n.translate("xpack.upgradeAssistant.kibanaDeprecations.table.issueColumnTitle",{defaultMessage:"Issue"}),typeColumnTitle:M.i18n.translate("xpack.upgradeAssistant.kibanaDeprecations.table.typeColumnTitle",{defaultMessage:"Type"}),resolutionColumnTitle:M.i18n.translate("xpack.upgradeAssistant.kibanaDeprecations.table.resolutionColumnTitle",{defaultMessage:"Resolution"}),configDeprecationTypeCellLabel:M.i18n.translate("xpack.upgradeAssistant.kibanaDeprecations.table.configDeprecationTypeCellLabel",{defaultMessage:"Config"}),featureDeprecationTypeCellLabel:M.i18n.translate("xpack.upgradeAssistant.kibanaDeprecations.table.featureDeprecationTypeCellLabel",{defaultMessage:"Feature"}),unknownDeprecationTypeCellLabel:M.i18n.translate("xpack.upgradeAssistant.kibanaDeprecations.table.unknownDeprecationTypeCellLabel",{defaultMessage:"Uncategorized"}),typeFilterLabel:M.i18n.translate("xpack.upgradeAssistant.kibanaDeprecations.table.typeFilterLabel",{defaultMessage:"Type"}),criticalFilterLabel:M.i18n.translate("xpack.upgradeAssistant.kibanaDeprecations.table.criticalFilterLabel",{defaultMessage:"Critical"}),searchPlaceholderLabel:M.i18n.translate("xpack.upgradeAssistant.kibanaDeprecations.table.searchPlaceholderLabel",{defaultMessage:"Filter"})},H=({deprecations:e,reload:t,toggleFlyout:s,deprecationResolutionState:a})=>{const i=[{field:"level",name:$.statusColumnTitle,width:"5%",truncateText:!0,sortable:!0,render:e=>Object(g.jsx)(P,{isCritical:"critical"===e})},{field:"title",width:"40%",name:$.issueColumnTitle,truncateText:!0,sortable:!0,render:(e,t)=>Object(g.jsx)(v.EuiLink,{onClick:()=>s(t),"data-test-subj":"deprecationDetailsLink"},e)},{field:"filterType",name:$.typeColumnTitle,width:"20%",truncateText:!0,sortable:!0,render:e=>{switch(e){case"config":return $.configDeprecationTypeCellLabel;case"feature":return $.featureDeprecationTypeCellLabel;default:return $.unknownDeprecationTypeCellLabel}}},{field:"correctiveActions",name:$.resolutionColumnTitle,width:"30%",truncateText:!0,sortable:!0,render:(e,t)=>Object(g.jsx)(G,{deprecationId:t.id,isAutomated:Boolean(null==e?void 0:e.api),deprecationResolutionState:a})}],n={filters:[{type:"field_value_toggle",name:$.criticalFilterLabel,field:"level",value:"critical"},{type:"field_value_selection",field:"filterType",name:$.typeFilterLabel,multiSelect:!1,options:[{value:"config",name:$.configDeprecationTypeCellLabel},{value:"feature",name:$.featureDeprecationTypeCellLabel},{value:"uncategorized",name:$.unknownDeprecationTypeCellLabel}]}],box:{incremental:!0,placeholder:$.searchPlaceholderLabel},toolsRight:[Object(g.jsx)(v.EuiButton,{iconType:"refresh",onClick:t,"data-test-subj":"refreshButton",key:"refreshButton"},$.refreshButtonLabel)]};return Object(g.jsx)(v.EuiInMemoryTable,{items:e||[],itemId:"name",columns:i,search:n,sorting:{sort:{field:"level",direction:"asc"}},pagination:W,rowProps:()=>({"data-test-subj":"row"}),cellProps:(e,t)=>({"data-test-subj":`${((null==t?void 0:t.name)||"table").toLowerCase()}Cell`}),"data-test-subj":"kibanaDeprecationsTable",tableLayout:"auto"})};s(45);const K={closeButtonLabel:M.i18n.translate("xpack.upgradeAssistant.kibanaDeprecations.flyout.closeButtonLabel",{defaultMessage:"Close"}),quickResolveButtonLabel:M.i18n.translate("xpack.upgradeAssistant.kibanaDeprecations.flyout.quickResolveButtonLabel",{defaultMessage:"Quick resolve"}),retryQuickResolveButtonLabel:M.i18n.translate("xpack.upgradeAssistant.kibanaDeprecations.flyout.retryQuickResolveButtonLabel",{defaultMessage:"Try again"}),resolvedButtonLabel:M.i18n.translate("xpack.upgradeAssistant.kibanaDeprecations.flyout.resolvedButtonLabel",{defaultMessage:"Resolved"}),quickResolveInProgressButtonLabel:M.i18n.translate("xpack.upgradeAssistant.kibanaDeprecations.flyout.quickResolveInProgressButtonLabel",{defaultMessage:"Resolution in progress…"}),quickResolveCalloutTitle:Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.kibanaDeprecations.flyout.quickResolveCalloutTitle",defaultMessage:"Click {quickResolve} to fix this issue automatically.",values:{quickResolve:Object(g.jsx)("strong",null,M.i18n.translate("xpack.upgradeAssistant.kibanaDeprecations.flyout.quickResolveText",{defaultMessage:"Quick resolve"}))}}),quickResolveErrorTitle:M.i18n.translate("xpack.upgradeAssistant.kibanaDeprecations.flyout.quickResolveErrorTitle",{defaultMessage:"Error resolving issue"}),manualFixTitle:M.i18n.translate("xpack.upgradeAssistant.kibanaDeprecations.flyout.manualFixTitle",{defaultMessage:"How to fix"})},Y=({deprecation:e,closeFlyout:t,resolveDeprecation:s,deprecationResolutionState:n})=>{const{documentationUrl:r,message:o,correctiveActions:l,title:u}=e,c=(null==n?void 0:n.id)===e.id&&"ok"===(null==n?void 0:n.resolveDeprecationStatus),d=Object(a.useCallback)((()=>{I.s.trackUiMetric(L.METRIC_TYPE.CLICK,I.i),s(e)}),[e,s]);return Object(g.jsx)(i.a.Fragment,null,Object(g.jsx)(v.EuiFlyoutHeader,{hasBorder:!0},Object(g.jsx)(P,{isCritical:"critical"===e.level,isResolved:c}),Object(g.jsx)(v.EuiSpacer,{size:"s"}),Object(g.jsx)(v.EuiTitle,{size:"s","data-test-subj":"flyoutTitle"},Object(g.jsx)("h2",{id:"kibanaDeprecationDetailsFlyoutTitle",className:"eui-textBreakWord"},u))),Object(g.jsx)(v.EuiFlyoutBody,null,"fail"===(null==n?void 0:n.resolveDeprecationStatus)&&Object(g.jsx)(i.a.Fragment,null,Object(g.jsx)(v.EuiCallOut,{title:K.quickResolveErrorTitle,color:"danger",iconType:"warning","data-test-subj":"quickResolveError"},n.resolveDeprecationError),Object(g.jsx)(v.EuiSpacer,null)),Object(g.jsx)(v.EuiText,null,Object(g.jsx)("p",{className:"eui-textBreakWord"},o),r&&Object(g.jsx)("p",null,Object(g.jsx)(z,{documentationUrl:r}))),Object(g.jsx)(v.EuiSpacer,null),!c&&Object(g.jsx)("div",{"data-test-subj":"resolveSection"},l.api&&Object(g.jsx)(i.a.Fragment,null,Object(g.jsx)(v.EuiCallOut,{title:K.quickResolveCalloutTitle,color:"primary",iconType:"iInCircle","data-test-subj":"quickResolveCallout"}),Object(g.jsx)(v.EuiSpacer,null)),l.manualSteps.length>0&&Object(g.jsx)(i.a.Fragment,null,Object(g.jsx)(v.EuiTitle,{size:"s","data-test-subj":"manualStepsTitle"},Object(g.jsx)("h3",null,K.manualFixTitle)),Object(g.jsx)(v.EuiSpacer,{size:"s"}),Object(g.jsx)(v.EuiText,null,1===l.manualSteps.length?Object(g.jsx)("p",{"data-test-subj":"manualStep",className:"eui-textBreakWord"},l.manualSteps[0]):Object(g.jsx)("ol",{"data-test-subj":"manualStepsList"},l.manualSteps.map(((e,t)=>Object(g.jsx)("li",{"data-test-subj":"manualStepsListItem",key:`step-${t}`,className:"upgResolveStep eui-textBreakWord"},e)))))))),Object(g.jsx)(v.EuiFlyoutFooter,null,Object(g.jsx)(v.EuiFlexGroup,{justifyContent:"spaceBetween"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiButtonEmpty,{onClick:t,flush:"left"},K.closeButtonLabel)),l.api&&!c&&Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiButton,{fill:!0,"data-test-subj":"resolveButton",onClick:d,isLoading:Boolean("in_progress"===(null==n?void 0:n.resolveDeprecationStatus))},(e=>"in_progress"===(null==e?void 0:e.resolveDeprecationStatus)?K.quickResolveInProgressButtonLabel:"ok"===(null==e?void 0:e.resolveDeprecationStatus)?K.resolvedButtonLabel:null!=e&&e.resolveDeprecationError?K.retryQuickResolveButtonLabel:K.quickResolveButtonLabel)(n))))))},{useGlobalFlyout:V}=y.c,J={pageTitle:M.i18n.translate("xpack.upgradeAssistant.kibanaDeprecations.pageTitle",{defaultMessage:"Kibana deprecation issues"}),pageDescription:M.i18n.translate("xpack.upgradeAssistant.kibanaDeprecations.pageDescription",{defaultMessage:"Resolve all critical issues before upgrading."}),docLinkText:M.i18n.translate("xpack.upgradeAssistant.kibanaDeprecations.docLinkText",{defaultMessage:"Documentation"}),deprecationLabel:M.i18n.translate("xpack.upgradeAssistant.kibanaDeprecations.deprecationLabel",{defaultMessage:"Kibana"}),isLoading:M.i18n.translate("xpack.upgradeAssistant.kibanaDeprecations.loadingText",{defaultMessage:"Loading deprecation issues…"}),kibanaDeprecationErrorTitle:M.i18n.translate("xpack.upgradeAssistant.kibanaDeprecations.kibanaDeprecationErrorTitle",{defaultMessage:"List of deprecation issues might be incomplete"}),getKibanaDeprecationErrorDescription:e=>M.i18n.translate("xpack.upgradeAssistant.kibanaDeprecations.kibanaDeprecationErrorDescription",{defaultMessage:"Failed to get deprecation issues for {pluginCount, plural, one {this plugin} other {these plugins}}: {pluginIds}. Check the Kibana server logs for more information.",values:{pluginCount:e.length,pluginIds:e.join(", ")}})},Q=Object(r.withRouter)((({history:e})=>{const[t,s]=Object(a.useState)(void 0),[n,r]=Object(a.useState)([]),[o,l]=Object(a.useState)(!1),[u,c]=Object(a.useState)(void 0),[d,p]=Object(a.useState)(void 0),[j,x]=Object(a.useState)(void 0),{services:{core:{deprecations:b},breadcrumbs:f}}=S(),{addContent:m,removeContent:O}=V(),h=Object(a.useCallback)((async()=>{l(!0);try{const e=await b.getAllDeprecations(),t=[],a=[];e.forEach((e=>{var s;"fetch_error"!==e.level?t.push({...e,id:Object(T.v4)(),filterType:null!==(s=e.deprecationType)&&void 0!==s?s:"uncategorized"}):!1===a.includes(e.domainId)&&a.push(e.domainId)})),s(t),r(a)}catch(e){c(e)}l(!1)}),[b]),E=Object(a.useMemo)((()=>(e=>{const t=[],s=[];return e.forEach((e=>{"critical"!==e.level?s.push(e):t.push(e)})),{criticalDeprecations:t.length,warningDeprecations:s.length}})(t||[])),[t]),k=e=>{p(e)},C=Object(a.useCallback)((()=>{k(),O("deprecationDetails")}),[O]),M=Object(a.useCallback)((async e=>{x({id:e.id,resolveDeprecationStatus:"in_progress"});const t=await b.resolveDeprecation(e);x({id:e.id,resolveDeprecationStatus:t.status,resolveDeprecationError:"fail"===t.status?t.reason:void 0}),C()}),[C,b]);return Object(a.useEffect)((()=>{d&&m({id:"deprecationDetails",Component:Y,props:{deprecation:d,closeFlyout:C,resolveDeprecation:M,deprecationResolutionState:j&&d.id===j.id?j:void 0},flyoutProps:{onClose:C,"data-test-subj":"kibanaDeprecationDetails","aria-labelledby":"kibanaDeprecationDetailsFlyoutTitle"}})}),[m,C,j,d,M]),Object(a.useEffect)((()=>{I.s.trackUiMetric(L.METRIC_TYPE.LOADED,I.h)}),[]),Object(a.useEffect)((()=>{f.setBreadcrumbs("kibanaDeprecations")}),[f]),Object(a.useEffect)((()=>{h()}),[b,h]),u?Object(g.jsx)(N,{deprecationSource:"Kibana"}):o?Object(g.jsx)(v.EuiPageContent_Deprecated,{verticalPosition:"center",horizontalPosition:"center",color:"subdued"},Object(g.jsx)(y.g,null,J.isLoading)):0===(null==t?void 0:t.length)?Object(g.jsx)(v.EuiPageContent_Deprecated,{verticalPosition:"center",horizontalPosition:"center",color:"subdued"},Object(g.jsx)(D,{deprecationType:J.deprecationLabel,navigateToOverviewPage:()=>e.push("/overview")})):Object(g.jsx)("div",{"data-test-subj":"kibanaDeprecations"},Object(g.jsx)(v.EuiPageHeader,{bottomBorder:!0,pageTitle:J.pageTitle,description:J.pageDescription},Object(g.jsx)(B,{totalCriticalDeprecations:E.criticalDeprecations,totalWarningDeprecations:E.warningDeprecations})),Object(g.jsx)(v.EuiSpacer,{size:"l"}),n.length>0&&Object(g.jsx)(i.a.Fragment,null,Object(g.jsx)(v.EuiCallOut,{title:J.kibanaDeprecationErrorTitle,color:"warning",iconType:"warning","data-test-subj":"kibanaDeprecationErrors"},Object(g.jsx)("p",null,J.getKibanaDeprecationErrorDescription(n))),Object(g.jsx)(v.EuiSpacer,null)),Object(g.jsx)(H,{deprecations:t,reload:h,toggleFlyout:k,deprecationResolutionState:j}))})),Z={permissionsError:M.i18n.translate("xpack.upgradeAssistant.esDeprecationErrors.permissionsErrorMessage",{defaultMessage:"You are not authorized to view Elasticsearch deprecation issues."}),partiallyUpgradedWarning:M.i18n.translate("xpack.upgradeAssistant.esDeprecationErrors.partiallyUpgradedWarningMessage",{defaultMessage:"Upgrade Kibana to the same version as your Elasticsearch cluster. One or more nodes in the cluster is running a different version than Kibana."}),upgradedMessage:M.i18n.translate("xpack.upgradeAssistant.esDeprecationErrors.upgradedWarningMessage",{defaultMessage:"All Elasticsearch nodes have been upgraded."}),loadingError:M.i18n.translate("xpack.upgradeAssistant.esDeprecationErrors.loadingErrorMessage",{defaultMessage:"Could not retrieve Elasticsearch deprecation issues."})},X=e=>{var t,s;return 403===e.statusCode?{code:"unauthorized_error",message:Z.permissionsError}:426===(null==e?void 0:e.statusCode)&&!1===(null===(t=e.attributes)||void 0===t?void 0:t.allNodesUpgraded)?{code:"partially_upgraded_error",message:Z.partiallyUpgradedWarning}:426===(null==e?void 0:e.statusCode)&&!0===(null===(s=e.attributes)||void 0===s?void 0:s.allNodesUpgraded)?{code:"upgraded_error",message:Z.upgradedMessage}:{code:"request_error",message:Z.loadingError}},ee={manualCellLabel:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.defaultDeprecation.manualCellLabel",{defaultMessage:"Manual"}),manualCellTooltipLabel:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.reindex.manualCellTooltipLabel",{defaultMessage:"This issue needs to be resolved manually."})},te=({resolutionTableCell:e,fieldName:t,deprecation:s,openFlyout:a})=>{var n,r,o;return"isCritical"===t?Object(g.jsx)(P,{isCritical:s.isCritical}):"message"===t?Object(g.jsx)(v.EuiLink,{"data-test-subj":`deprecation-${null!==(r=null===(o=s.correctiveAction)||void 0===o?void 0:o.type)&&void 0!==r?r:"default"}`,onClick:a},s.message):"type"===t?Object(g.jsx)(i.a.Fragment,null,U[s.type]):"correctiveAction"===t?e?Object(g.jsx)(i.a.Fragment,null,e):Object(g.jsx)(v.EuiToolTip,{position:"top",content:ee.manualCellTooltipLabel},Object(g.jsx)(v.EuiText,{size:"s",color:"subdued"},ee.manualCellLabel)):Object(g.jsx)(i.a.Fragment,null,null!==(n=s[t])&&void 0!==n?n:"")},se=Object(a.createContext)(void 0),ae=()=>{const e=Object(a.useContext)(se);if(void 0===e)throw new Error("useMlSnapshotContext must be used within a ");return e},ie=({api:e,snapshotId:t,jobId:s,mlUpgradeModeEnabled:i,children:n})=>{const{updateSnapshotStatus:r,snapshotState:o,upgradeSnapshot:l,deleteSnapshot:u}=(({jobId:e,snapshotId:t,api:s})=>{const[i,n]=Object(a.useState)(void 0),[r,o]=Object(a.useState)({status:"idle",jobId:e,snapshotId:t}),l=Object(a.useRef)(null),u=Object(a.useRef)(!1),c=Object(a.useCallback)((()=>{l.current&&(clearTimeout(l.current),l.current=null)}),[]),d=Object(a.useCallback)((async()=>{c();const{data:a,error:i}=await s.getMlSnapshotUpgradeStatus({jobId:e,snapshotId:t});if(i)return o({snapshotId:t,jobId:e,action:"upgrade",status:"error"}),void n(i);o({...a,action:"upgrade"}),"in_progress"===(null==a?void 0:a.status)&&(l.current=setTimeout(d,1e3))}),[s,c,e,t]),p=Object(a.useCallback)((async()=>{o({snapshotId:t,jobId:e,action:"upgrade",status:"in_progress"});const{data:a,error:i}=await s.upgradeMlSnapshot({jobId:e,snapshotId:t});if(i)return n(i),void o({snapshotId:t,jobId:e,action:"upgrade",status:"error"});o({...a,action:"upgrade"}),d()}),[s,e,t,d]),g=Object(a.useCallback)((async()=>{o({snapshotId:t,jobId:e,action:"delete",status:"in_progress"});const{error:a}=await s.deleteMlSnapshot({snapshotId:t,jobId:e});if(a)return n(a),void o({snapshotId:t,jobId:e,action:"delete",status:"error"});o({snapshotId:t,jobId:e,action:"delete",status:"complete"})}),[s,e,t]);return Object(a.useEffect)((()=>(u.current=!0,()=>{u.current=!1,c()})),[c]),{snapshotState:{...r,error:i},upgradeSnapshot:p,updateSnapshotStatus:d,deleteSnapshot:g}})({jobId:s,snapshotId:t,api:e});return Object(a.useEffect)((()=>{r()}),[r]),Object(g.jsx)(se.Provider,{value:{snapshotState:o,upgradeSnapshot:l,deleteSnapshot:u,mlUpgradeModeEnabled:i}},n)},ne={upgradeInProgressText:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.mlSnapshots.upgradeInProgressText",{defaultMessage:"Upgrade in progress…"}),deleteInProgressText:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.mlSnapshots.deletingButtonLabel",{defaultMessage:"Deletion in progress…"}),upgradeCompleteText:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.mlSnapshots.upgradeCompleteText",{defaultMessage:"Upgrade complete"}),deleteCompleteText:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.mlSnapshots.deleteCompleteText",{defaultMessage:"Deletion complete"}),upgradeFailedText:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.mlSnapshots.upgradeFailedText",{defaultMessage:"Upgrade failed"}),deleteFailedText:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.mlSnapshots.deleteFailedText",{defaultMessage:"Deletion failed"}),resolutionText:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.mlSnapshots.resolutionText",{defaultMessage:"Upgrade or delete snapshots"}),resolutionTooltipLabel:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.mlSnapshots.resolutionTooltipLabel",{defaultMessage:"Resolve this issue by upgrading or deleting a job model snapshot. This issue can be resolved automatically."})},re=()=>{const{snapshotState:e}=ae();return"in_progress"===e.status?Object(g.jsx)(v.EuiFlexGroup,{gutterSize:"s",alignItems:"center","data-test-subj":"mlActionResolutionCell"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiLoadingSpinner,{size:"m"})),Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiText,{size:"s"},"delete"===e.action?ne.deleteInProgressText:ne.upgradeInProgressText))):"complete"===e.status?Object(g.jsx)(v.EuiFlexGroup,{gutterSize:"s",alignItems:"center","data-test-subj":"mlActionResolutionCell"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiIcon,{type:"check",color:"success"})),Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiText,{size:"s"},"delete"===e.action?ne.deleteCompleteText:ne.upgradeCompleteText))):"error"===e.status?Object(g.jsx)(v.EuiFlexGroup,{gutterSize:"s",alignItems:"center","data-test-subj":"mlActionResolutionCell"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiIcon,{type:"warning",color:"danger"})),Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiText,{size:"s"},"delete"===e.action?ne.deleteFailedText:ne.upgradeFailedText))):Object(g.jsx)(v.EuiToolTip,{position:"top",content:ne.resolutionTooltipLabel},Object(g.jsx)(v.EuiFlexGroup,{gutterSize:"s",alignItems:"center","data-test-subj":"mlActionResolutionCell"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiIcon,{type:"indexSettings"})),Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiText,{size:"s"},ne.resolutionText))))},oe={upgradeButtonLabel:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.mlSnapshots.flyout.upgradeButtonLabel",{defaultMessage:"Upgrade"}),upgradingButtonLabel:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.mlSnapshots.flyout.upgradingButtonLabel",{defaultMessage:"Upgrading…"}),retryUpgradeButtonLabel:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.mlSnapshots.flyout.retryUpgradeButtonLabel",{defaultMessage:"Retry upgrade"}),closeButtonLabel:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.mlSnapshots.flyout.closeButtonLabel",{defaultMessage:"Close"}),deleteButtonLabel:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.mlSnapshots.flyout.deleteButtonLabel",{defaultMessage:"Delete"}),deletingButtonLabel:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.mlSnapshots.flyout.deletingButtonLabel",{defaultMessage:"Deleting…"}),retryDeleteButtonLabel:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.mlSnapshots.flyout.retryDeleteButtonLabel",{defaultMessage:"Retry delete"}),flyoutTitle:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.mlSnapshots.flyout.title",{defaultMessage:"Upgrade or delete model snapshot"}),deleteSnapshotErrorTitle:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.mlSnapshots.flyout.deleteSnapshotErrorTitle",{defaultMessage:"Error deleting snapshot"}),upgradeSnapshotErrorTitle:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.mlSnapshots.flyout.upgradeSnapshotErrorTitle",{defaultMessage:"Error upgrading snapshot"}),upgradeModeEnabledErrorTitle:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.mlSnapshots.upgradeModeEnabledErrorTitle",{defaultMessage:"Machine Learning upgrade mode is enabled"}),upgradeModeEnabledErrorDescription:e=>Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.esDeprecations.mlSnapshots.upgradeModeEnabledErrorDescription",defaultMessage:"No actions can be taken on Machine Learning snapshots while upgrade mode is enabled. {docsLink}.",values:{docsLink:Object(g.jsx)(v.EuiLink,{href:e,target:"_blank","data-test-subj":"setUpgradeModeDocsLink"},Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.esDeprecations.mlSnapshots.upgradeModeEnabledDocsLink",defaultMessage:"Learn more"}))}})},le=({deprecation:e,closeFlyout:t,snapshotState:s,upgradeSnapshot:a,deleteSnapshot:n,mlUpgradeModeEnabled:r})=>{const{services:{core:{docLinks:o}}}=S(),l="complete"===s.status;return Object(g.jsx)(i.a.Fragment,null,Object(g.jsx)(v.EuiFlyoutHeader,{hasBorder:!0},Object(g.jsx)(P,{isCritical:e.isCritical,isResolved:l}),Object(g.jsx)(v.EuiSpacer,{size:"s"}),Object(g.jsx)(v.EuiTitle,{size:"s","data-test-subj":"flyoutTitle"},Object(g.jsx)("h2",{id:"mlSnapshotDetailsFlyoutTitle"},oe.flyoutTitle))),Object(g.jsx)(v.EuiFlyoutBody,null,s.error&&!l&&Object(g.jsx)(i.a.Fragment,null,Object(g.jsx)(v.EuiCallOut,{title:"delete"===s.action?oe.deleteSnapshotErrorTitle:oe.upgradeSnapshotErrorTitle,color:"danger",iconType:"warning","data-test-subj":"resolveSnapshotError"},s.error.message),Object(g.jsx)(v.EuiSpacer,null)),r&&Object(g.jsx)(i.a.Fragment,null,Object(g.jsx)(v.EuiCallOut,{title:oe.upgradeModeEnabledErrorTitle,color:"warning",iconType:"warning","data-test-subj":"mlUpgradeModeEnabledError"},Object(g.jsx)("p",null,oe.upgradeModeEnabledErrorDescription(o.links.ml.setUpgradeMode))),Object(g.jsx)(v.EuiSpacer,null)),Object(g.jsx)(v.EuiText,null,Object(g.jsx)("p",null,e.details),Object(g.jsx)("p",null,Object(g.jsx)(z,{documentationUrl:e.url})))),Object(g.jsx)(v.EuiFlyoutFooter,null,Object(g.jsx)(v.EuiFlexGroup,{justifyContent:"spaceBetween"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiButtonEmpty,{onClick:t,flush:"left"},oe.closeButtonLabel)),!l&&!r&&Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiFlexGroup,null,Object(g.jsx)(v.EuiFlexItem,null,Object(g.jsx)(v.EuiButtonEmpty,{"data-test-subj":"deleteSnapshotButton",color:"danger",onClick:()=>{I.s.trackUiMetric(L.METRIC_TYPE.CLICK,I.j),n(),t()},isLoading:"delete"===s.action&&"in_progress"===s.status,isDisabled:"in_progress"===s.status},(e=>"delete"===e.action?e.error?oe.retryDeleteButtonLabel:"in_progress"===e.status?oe.deletingButtonLabel:oe.deleteButtonLabel:oe.deleteButtonLabel)(s))),Object(g.jsx)(v.EuiFlexItem,null,Object(g.jsx)(v.EuiButton,{fill:!0,onClick:()=>{I.s.trackUiMetric(L.METRIC_TYPE.CLICK,I.k),a(),t()},isLoading:"upgrade"===s.action&&"in_progress"===s.status,isDisabled:"in_progress"===s.status,"data-test-subj":"upgradeSnapshotButton"},(e=>"upgrade"===e.action?e.error?oe.retryUpgradeButtonLabel:"in_progress"===e.status?oe.upgradingButtonLabel:oe.upgradeButtonLabel:oe.upgradeButtonLabel)(s))))))))},{useGlobalFlyout:ue}=y.c,ce=({rowFieldNames:e,deprecation:t})=>{const[s,n]=Object(a.useState)(!1),r=ae(),{addContent:o,removeContent:l}=ue(),u=Object(a.useCallback)((()=>{n(!1),l("mlFlyout")}),[l]);return Object(a.useEffect)((()=>{s&&o({id:"mlFlyout",Component:le,props:{deprecation:t,closeFlyout:u,...r},flyoutProps:{onClose:u,className:"eui-textBreakWord","data-test-subj":"mlSnapshotDetails","aria-labelledby":"mlSnapshotDetailsFlyoutTitle"}})}),[r,o,s,t,u]),Object(g.jsx)(i.a.Fragment,null,e.map((e=>Object(g.jsx)(v.EuiTableRowCell,{key:e,truncateText:!1,"data-test-subj":`mlTableCell-${e}`},Object(g.jsx)(te,{fieldName:e,openFlyout:()=>n(!0),deprecation:t,resolutionTableCell:Object(g.jsx)(re,null)})))))},de=e=>{const{services:{api:t}}=S();return Object(g.jsx)(ie,{snapshotId:e.deprecation.correctiveAction.snapshotId,jobId:e.deprecation.correctiveAction.jobId,mlUpgradeModeEnabled:e.mlUpgradeModeEnabled,api:t},Object(g.jsx)(ce,e))},pe={deleteInProgressText:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.indexSettings.deletingButtonLabel",{defaultMessage:"Settings removal in progress…"}),deleteCompleteText:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.indexSettings.deleteCompleteText",{defaultMessage:"Deprecated settings removed"}),deleteFailedText:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.indexSettings.deleteFailedText",{defaultMessage:"Settings removal failed"}),resolutionText:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.indexSettings.resolutionText",{defaultMessage:"Remove settings"}),resolutionTooltipLabel:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.indexSettings.resolutionTooltipLabel",{defaultMessage:"Resolve this issue by removing settings from this index. This issue can be resolved automatically."})},ge=({status:e})=>{const{statusType:t}=e;return"in_progress"===t?Object(g.jsx)(v.EuiFlexGroup,{gutterSize:"s",alignItems:"center","data-test-subj":"indexSettingsResolutionStatusCell"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiLoadingSpinner,{size:"m"})),Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiText,{size:"s"},pe.deleteInProgressText))):"complete"===t?Object(g.jsx)(v.EuiFlexGroup,{gutterSize:"s",alignItems:"center","data-test-subj":"indexSettingsResolutionStatusCell"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiIcon,{type:"check",color:"success"})),Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiText,{size:"s"},pe.deleteCompleteText))):"error"===t?Object(g.jsx)(v.EuiFlexGroup,{gutterSize:"s",alignItems:"center","data-test-subj":"indexSettingsResolutionStatusCell"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiIcon,{type:"warning",color:"danger"})),Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiText,{size:"s"},pe.deleteFailedText))):Object(g.jsx)(v.EuiToolTip,{position:"top",content:pe.resolutionTooltipLabel},Object(g.jsx)(v.EuiFlexGroup,{gutterSize:"s",alignItems:"center","data-test-subj":"indexSettingsResolutionStatusCell"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiIcon,{type:"indexSettings"})),Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiText,{size:"s"},pe.resolutionText))))},je={getFlyoutDescription:e=>M.i18n.translate("xpack.upgradeAssistant.esDeprecations.removeSettingsFlyout.secondaryDescription",{defaultMessage:"Index: {indexName}",values:{indexName:e}}),removeButtonLabel:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.removeSettingsFlyout.removeButtonLabel",{defaultMessage:"Remove deprecated settings"}),retryRemoveButtonLabel:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.removeSettingsFlyout.retryRemoveButtonLabel",{defaultMessage:"Retry removing deprecated settings"}),resolvedButtonLabel:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.removeSettingsFlyout.resolvedButtonLabel",{defaultMessage:"Resolved"}),closeButtonLabel:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.removeSettingsFlyout.closeButtonLabel",{defaultMessage:"Close"}),getConfirmationText:e=>M.i18n.translate("xpack.upgradeAssistant.esDeprecations.removeSettingsFlyout.description",{defaultMessage:"Remove the following deprecated index {indexSettingsCount, plural, one {setting} other {settings}}?",values:{indexSettingsCount:e}}),errorTitle:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.removeSettingsFlyout.deleteErrorTitle",{defaultMessage:"Error deleting index settings"})},xe=({deprecation:e,closeFlyout:t,removeIndexSettings:s,status:n})=>{const{index:r,message:o,details:l,url:u,correctiveAction:c}=e,{statusType:d,details:p}=n,j=["idle","error"].includes(d),x=Object(a.useCallback)((()=>{I.s.trackUiMetric(L.METRIC_TYPE.CLICK,I.g),s(r,c.deprecatedSettings)}),[c,r,s]);return Object(g.jsx)(i.a.Fragment,null,Object(g.jsx)(v.EuiFlyoutHeader,{hasBorder:!0},Object(g.jsx)(P,{isCritical:e.isCritical,isResolved:"complete"===d}),Object(g.jsx)(v.EuiSpacer,{size:"s"}),Object(g.jsx)(v.EuiTitle,{size:"s","data-test-subj":"flyoutTitle"},Object(g.jsx)("h2",{id:"indexSettingsDetailsFlyoutTitle"},o)),Object(g.jsx)(v.EuiText,null,Object(g.jsx)("p",null,Object(g.jsx)(v.EuiTextColor,{color:"subdued"},je.getFlyoutDescription(r))))),Object(g.jsx)(v.EuiFlyoutBody,null,"error"===d&&Object(g.jsx)(i.a.Fragment,null,Object(g.jsx)(v.EuiCallOut,{title:je.errorTitle,color:"danger",iconType:"warning","data-test-subj":"deleteSettingsError"},p.message),Object(g.jsx)(v.EuiSpacer,null)),Object(g.jsx)(v.EuiText,null,Object(g.jsx)("p",null,l),Object(g.jsx)("p",null,Object(g.jsx)(z,{documentationUrl:u}))),j&&Object(g.jsx)("div",{"data-test-subj":"removeSettingsPrompt"},Object(g.jsx)(v.EuiSpacer,null),Object(g.jsx)(v.EuiTitle,{size:"xs"},Object(g.jsx)("h3",null,je.getConfirmationText(c.deprecatedSettings.length))),Object(g.jsx)(v.EuiSpacer,null),Object(g.jsx)(v.EuiText,null,Object(g.jsx)("ul",null,c.deprecatedSettings.map(((e,t)=>Object(g.jsx)("li",{key:`${e}-${t}`},Object(g.jsx)(v.EuiCode,null,e)))))))),Object(g.jsx)(v.EuiFlyoutFooter,null,Object(g.jsx)(v.EuiFlexGroup,{justifyContent:"spaceBetween"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiButtonEmpty,{onClick:t,flush:"left"},je.closeButtonLabel)),j&&Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiButton,{fill:!0,"data-test-subj":"deleteSettingsButton",color:"danger",onClick:x},"error"===d?je.retryRemoveButtonLabel:je.removeButtonLabel)))))},{useGlobalFlyout:be}=y.c,fe=({rowFieldNames:e,deprecation:t})=>{const[s,n]=Object(a.useState)(!1),[r,o]=Object(a.useState)({statusType:"idle"}),{services:{api:l}}=S(),{addContent:u,removeContent:c}=be(),d=Object(a.useCallback)((()=>{n(!1),c("indexSettingsFlyout")}),[c]),p=Object(a.useCallback)((async(e,t)=>{o({statusType:"in_progress"});const{error:s}=await l.updateIndexSettings(e,t);o({statusType:s?"error":"complete",details:null!=s?s:void 0}),d()}),[l,d]);return Object(a.useEffect)((()=>{s&&u({id:"indexSettingsFlyout",Component:xe,props:{closeFlyout:d,deprecation:t,removeIndexSettings:p,status:r},flyoutProps:{onClose:d,className:"eui-textBreakWord","data-test-subj":"indexSettingsDetails","aria-labelledby":"indexSettingsDetailsFlyoutTitle"}})}),[u,t,p,s,d,r]),Object(g.jsx)(i.a.Fragment,null,e.map((e=>Object(g.jsx)(v.EuiTableRowCell,{key:e,truncateText:!1,"data-test-subj":`indexSettingsTableCell-${e}`},Object(g.jsx)(te,{fieldName:e,openFlyout:()=>n(!0),deprecation:t,resolutionTableCell:Object(g.jsx)(ge,{status:r})})))))},me={getFlyoutDescription:e=>M.i18n.translate("xpack.upgradeAssistant.esDeprecations.deprecationDetailsFlyout.secondaryDescription",{defaultMessage:"Index: {indexName}",values:{indexName:e}}),closeButtonLabel:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.deprecationDetailsFlyout.closeButtonLabel",{defaultMessage:"Close"})},Oe=({deprecation:e,closeFlyout:t})=>{const{message:s,url:a,details:n,index:r}=e;return Object(g.jsx)(i.a.Fragment,null,Object(g.jsx)(v.EuiFlyoutHeader,{hasBorder:!0},Object(g.jsx)(P,{isCritical:e.isCritical,isResolved:!1}),Object(g.jsx)(v.EuiSpacer,{size:"s"}),Object(g.jsx)(v.EuiTitle,{size:"s","data-test-subj":"flyoutTitle"},Object(g.jsx)("h2",{id:"defaultDeprecationDetailsFlyoutTitle"},s)),r&&Object(g.jsx)(v.EuiText,{"data-test-subj":"flyoutDescription"},Object(g.jsx)("p",null,Object(g.jsx)(v.EuiTextColor,{color:"subdued"},me.getFlyoutDescription(r))))),Object(g.jsx)(v.EuiFlyoutBody,null,Object(g.jsx)(v.EuiText,null,Object(g.jsx)("p",{className:"eui-textBreakWord"},n),Object(g.jsx)("p",null,Object(g.jsx)(z,{documentationUrl:a})))),Object(g.jsx)(v.EuiFlyoutFooter,null,Object(g.jsx)(v.EuiFlexGroup,{justifyContent:"spaceBetween"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiButtonEmpty,{onClick:t,flush:"left"},me.closeButtonLabel)))))},{useGlobalFlyout:he}=y.c,ve=({rowFieldNames:e,deprecation:t})=>{const[s,n]=Object(a.useState)(!1),{addContent:r,removeContent:o}=he(),l=Object(a.useCallback)((()=>{n(!1),o("deprecationDetails")}),[o]);return Object(a.useEffect)((()=>{s&&r({id:"deprecationDetails",Component:Oe,props:{deprecation:t,closeFlyout:l},flyoutProps:{onClose:l,className:"eui-textBreakWord","data-test-subj":"defaultDeprecationDetails","aria-labelledby":"defaultDeprecationDetailsFlyoutTitle"}})}),[r,l,t,s]),Object(g.jsx)(i.a.Fragment,null,e.map((e=>Object(g.jsx)(v.EuiTableRowCell,{key:e,truncateText:!1,"data-test-subj":`defaultTableCell-${e}`},Object(g.jsx)(te,{fieldName:e,deprecation:t,openFlyout:()=>n(!0)})))))};let Ee,ye;!function(e){e[e.created=0]="created",e[e.readonly=20]="readonly",e[e.newIndexCreated=30]="newIndexCreated",e[e.reindexStarted=40]="reindexStarted",e[e.reindexCompleted=50]="reindexCompleted",e[e.aliasCreated=60]="aliasCreated",e[e.originalIndexDeleted=70]="originalIndexDeleted",e[e.existingAliasesUpdated=80]="existingAliasesUpdated"}(Ee||(Ee={})),function(e){e[e.inProgress=0]="inProgress",e[e.completed=1]="completed",e[e.failed=2]="failed",e[e.paused=3]="paused",e[e.cancelled=4]="cancelled",e[e.fetchFailed=5]="fetchFailed"}(ye||(ye={})),s(50),s(51);const ke=e=>e>E.k?`${E.k}+`:e.toString(),Ce=(e,t,s=!1)=>{let a=0;switch(t){case Ee.created:a=0;break;case Ee.readonly:a=5;break;case Ee.newIndexCreated:a=10;break;case Ee.reindexStarted:a=null!==e?10+Math.round(e*(s?75:80)):10;break;case Ee.reindexCompleted:a=s?85:90;break;case Ee.aliasCreated:a=s?90:95;break;case Ee.originalIndexDeleted:a=s?95:100;break;case Ee.existingAliasesUpdated:a=100}return`${a}%`};let Se,Te;!function(e){e[e.Loading=0]="Loading",e[e.Success=1]="Success",e[e.Error=2]="Error"}(Se||(Se={})),function(e){e[e.Requested=0]="Requested",e[e.Loading=1]="Loading",e[e.Success=2]="Success",e[e.Error=3]="Error"}(Te||(Te={}));const Me=(e,{reindexOp:t,warnings:s,hasRequiredPrivileges:a,meta:i})=>{const n={...null!=i?i:e.meta},r=e.meta.aliases.length>0?e.meta.aliases:i.aliases,o={...e,meta:{...n,aliases:r},loadingState:Se.Success};if(s&&(o.reindexWarnings=s),void 0!==a&&(o.hasRequiredPrivileges=a),t){let s=!0;t.lastCompletedStep===Ee.aliasCreated&&t.status!==ye.completed&&(s=!1),s&&(o.lastCompletedStep=t.lastCompletedStep),o.status=t.status,o.reindexTaskPercComplete=t.reindexTaskPercComplete,o.errorMessage=t.errorMessage,e.cancelLoadingState!==Te.Requested&&e.cancelLoadingState!==Te.Loading||t.status!==ye.cancelled?e.cancelLoadingState===Te.Requested&&t.status===ye.inProgress?o.cancelLoadingState=Te.Loading:o.status===ye.completed&&(o.status=ye.inProgress):o.cancelLoadingState=Te.Success}return o},Le=Object(a.createContext)(void 0),Ie=()=>{const e=Object(a.useContext)(Le);if(void 0===e)throw new Error("useReindexContext must be used within a ");return e},Fe=({api:e,indexName:t,children:s})=>{const{reindexState:i,startReindex:n,cancelReindex:r}=(({indexName:e,api:t})=>{const[s,i]=Object(a.useState)({loadingState:Se.Loading,errorMessage:null,reindexTaskPercComplete:null,meta:{indexName:e,reindexName:"",aliases:[]}}),n=Object(a.useRef)(null),r=Object(a.useRef)(!1),o=Object(a.useCallback)((()=>{n.current&&(clearTimeout(n.current),n.current=null)}),[]),l=Object(a.useCallback)((()=>{const e=s.meta.aliases.length>0,t=()=>{r.current&&i((e=>({...e,status:ye.completed,lastCompletedStep:Ee.existingAliasesUpdated})))};setTimeout((()=>{r.current&&(i((t=>({...t,status:e?ye.inProgress:ye.completed,lastCompletedStep:Ee.originalIndexDeleted}))),e&&setTimeout(t,1e3))}),1e3)}),[s.meta.aliases.length]),u=Object(a.useCallback)((async()=>{o();const{data:s,error:a}=await t.getReindexStatus(e);a?i((e=>({...e,loadingState:Se.Error,errorMessage:a.message.toString(),status:ye.fetchFailed}))):null!==s&&(i((e=>Me(e,s))),s.reindexOp&&s.reindexOp.status===ye.inProgress?n.current=setTimeout(u,1e3):s.reindexOp&&s.reindexOp.status===ye.completed&&l())}),[o,t,e,l]),c=Object(a.useCallback)((async()=>{i((e=>({...e,lastCompletedStep:e.status===ye.paused?e.lastCompletedStep:void 0,status:ye.inProgress,reindexTaskPercComplete:null,errorMessage:null,cancelLoadingState:void 0})));const{data:s,error:a}=await t.startReindexTask(e);a?i((e=>({...e,loadingState:Se.Error,errorMessage:a.message.toString(),status:ye.failed}))):(i((e=>Me(e,{reindexOp:s,meta:e.meta}))),u())}),[t,e,u]),d=Object(a.useCallback)((async()=>{i((e=>({...e,cancelLoadingState:Te.Requested})));const{error:s}=await t.cancelReindexTask(e);s&&i((e=>({...e,cancelLoadingState:Te.Error})))}),[t,e]);return Object(a.useEffect)((()=>{u()}),[u]),Object(a.useEffect)((()=>(r.current=!0,()=>{r.current=!1,o()})),[o]),{reindexState:s,startReindex:c,cancelReindex:d,updateStatus:u}})({indexName:t,api:e});return Object(g.jsx)(Le.Provider,{value:{reindexState:i,startReindex:n,cancelReindex:r}},s)},we={reindexLoadingStatusText:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.reindex.reindexLoadingStatusText",{defaultMessage:"Loading status…"}),reindexInProgressText:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.reindex.reindexInProgressText",{defaultMessage:"Reindexing in progress…"}),reindexCompleteText:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.reindex.reindexCompleteText",{defaultMessage:"Reindex complete"}),reindexFailedText:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.reindex.reindexFailedText",{defaultMessage:"Reindex failed"}),reindexFetchFailedText:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.reindex.reindexFetchFailedText",{defaultMessage:"Reindex status not available"}),reindexCanceledText:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.reindex.reindexCanceledText",{defaultMessage:"Reindex cancelled"}),reindexPausedText:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.reindex.reindexPausedText",{defaultMessage:"Reindex paused"}),resolutionText:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.reindex.resolutionLabel",{defaultMessage:"Reindex"}),resolutionTooltipLabel:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.reindex.resolutionTooltipLabel",{defaultMessage:"Resolve this issue by reindexing this index. This issue can be resolved automatically."})},De=()=>{const{reindexState:e}=Ie(),t=e.meta.aliases.length>0;if(e.loadingState===Se.Loading)return Object(g.jsx)(v.EuiFlexGroup,{gutterSize:"s",alignItems:"center"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiLoadingSpinner,{size:"m"})),Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiText,{size:"s"},we.reindexLoadingStatusText)));switch(e.status){case ye.inProgress:return Object(g.jsx)(v.EuiFlexGroup,{gutterSize:"s",alignItems:"center"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiLoadingSpinner,{size:"m"})),Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiText,{size:"s"},we.reindexInProgressText," ",Ce(e.reindexTaskPercComplete,e.lastCompletedStep,t))));case ye.completed:return Object(g.jsx)(v.EuiFlexGroup,{gutterSize:"s",alignItems:"center"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiIcon,{type:"check",color:"success"})),Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiText,{size:"s"},we.reindexCompleteText)));case ye.failed:return Object(g.jsx)(v.EuiFlexGroup,{gutterSize:"s",alignItems:"center"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiIcon,{type:"warning",color:"danger"})),Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiText,{size:"s"},we.reindexFailedText)));case ye.fetchFailed:return Object(g.jsx)(v.EuiFlexGroup,{gutterSize:"s",alignItems:"center"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiIcon,{type:"warning",color:"danger"})),Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiText,{size:"s"},we.reindexFetchFailedText)));case ye.paused:return Object(g.jsx)(v.EuiFlexGroup,{gutterSize:"s",alignItems:"center"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiIcon,{type:"warning",color:"danger"})),Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiText,{size:"s"},we.reindexPausedText)))}return Object(g.jsx)(v.EuiToolTip,{position:"top",content:we.resolutionTooltipLabel},Object(g.jsx)(v.EuiFlexGroup,{gutterSize:"s",alignItems:"center"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiIcon,{type:"indexSettings"})),Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiText,{size:"s"},we.resolutionText))))};var Ae=s(34),Re=s.n(Ae);s(53);const Be=({status:e,idx:t})=>{if("incomplete"===e)return Object(g.jsx)("span",{className:"upgStepProgress__status"},t+1,".");if("inProgress"===e)return Object(g.jsx)(v.EuiLoadingSpinner,{size:"m",className:"upgStepProgress__status"});if("complete"===e)return Object(g.jsx)("span",{className:"upgStepProgress__status upgStepProgress__status--circle upgStepProgress__status--circle-complete"},Object(g.jsx)(v.EuiIcon,{type:"check",size:"s"}));if("paused"===e)return Object(g.jsx)("span",{className:"upgStepProgress__status upgStepProgress__status--circle upgStepProgress__status--circle-paused"},Object(g.jsx)(v.EuiIcon,{type:"pause",size:"s"}));if("cancelled"===e)return Object(g.jsx)("span",{className:"upgStepProgress__status upgStepProgress__status--circle upgStepProgress__status--circle-cancelled"},Object(g.jsx)(v.EuiIcon,{type:"cross",size:"s"}));if("failed"===e)return Object(g.jsx)("span",{className:"upgStepProgress__status upgStepProgress__status--circle upgStepProgress__status--circle-failed"},Object(g.jsx)(v.EuiIcon,{type:"cross",size:"s"}));throw new Error(`Unsupported status: ${e}`)},_e=({title:e,status:t,children:s,idx:i})=>{const n=Re()("upgStepProgress__title",{"upgStepProgress__title--currentStep":"inProgress"===t});return Object(g.jsx)(a.Fragment,null,Object(g.jsx)("div",{className:"upgStepProgress__step"},Object(g.jsx)(Be,{status:t,idx:i}),Object(g.jsx)("div",{className:n},e)),s&&Object(g.jsx)("div",{className:"upgStepProgress__content"},s))},Pe=({steps:e})=>Object(g.jsx)("div",{className:"upgStepProgress__container"},e.map(((e,t)=>Object(g.jsx)(_e,l()({key:t},e,{idx:t}))))),Ne=({errorMessage:e})=>Object(g.jsx)(v.EuiCallOut,{color:"danger",title:"There was an error"},Object(g.jsx)(v.EuiText,null,Object(g.jsx)("p",null,e))),ze=()=>Object(g.jsx)(v.EuiCallOut,{color:"warning",title:"This step was paused due to a Kibana restart. Click 'Resume' below to continue."}),Ue=({reindexState:{lastCompletedStep:e,status:t,cancelLoadingState:s},cancelReindex:a})=>{if(t===ye.cancelled)return Object(g.jsx)(i.a.Fragment,null,Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.checkupTab.reindexing.flyout.checklistStep.reindexingChecklist.cancelledTitle",defaultMessage:"Reindexing cancelled."}));const n=t===ye.inProgress&&(e===Ee.newIndexCreated||e===Ee.reindexStarted),r=t===ye.inProgress&&e===Ee.reindexStarted;let o;switch(s){case Te.Requested:case Te.Loading:o=Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.checkupTab.reindexing.flyout.checklistStep.reindexingChecklist.cancelButton.cancellingLabel",defaultMessage:"Cancelling…"});break;case Te.Success:o=Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.checkupTab.reindexing.flyout.checklistStep.reindexingChecklist.cancelButton.cancelledLabel",defaultMessage:"Cancelled"});break;case Te.Error:o=Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.checkupTab.reindexing.flyout.checklistStep.reindexingChecklist.cancelButton.errorLabel",defaultMessage:"Could not cancel"});break;default:o=Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.checkupTab.reindexing.flyout.checklistStep.reindexingChecklist.cancelButton.cancelLabel",defaultMessage:"Cancel"})}return Object(g.jsx)(v.EuiFlexGroup,{component:"span"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},n?Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.checkupTab.reindexing.flyout.checklistStep.reindexingChecklist.inProgress.reindexingDocumentsStepTitle",defaultMessage:"Reindexing documents."}):Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.checkupTab.reindexing.flyout.checklistStep.reindexingChecklist.reindexingDocumentsStepTitle",defaultMessage:"Reindex documents."})),r&&Object(g.jsx)(v.EuiFlexItem,null,Object(g.jsx)(v.EuiLink,{"data-test-subj":"cancelReindexingDocumentsButton",onClick:a,disabled:void 0!==s},o)))},We=Object.values(Ee).sort(),qe=(e,t,s)=>e===Ee.readonly?s?Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.checkupTab.reindexing.flyout.checklistStep.reindexingChecklist.inProgress.readonlyStepTitle",defaultMessage:"Setting {indexName} index to read-only.",values:{indexName:Object(g.jsx)(v.EuiCode,null,t.indexName)}}):Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.checkupTab.reindexing.flyout.checklistStep.reindexingChecklist.readonlyStepTitle",defaultMessage:"Set {indexName} index to read-only.",values:{indexName:Object(g.jsx)(v.EuiCode,null,t.indexName)}}):e===Ee.newIndexCreated?s?Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.checkupTab.reindexing.flyout.checklistStep.reindexingChecklist.inProgress.createIndexStepTitle",defaultMessage:"Creating {reindexName} index.",values:{reindexName:Object(g.jsx)(v.EuiCode,null,t.reindexName)}}):Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.checkupTab.reindexing.flyout.checklistStep.reindexingChecklist.createIndexStepTitle",defaultMessage:"Create {reindexName} index.",values:{reindexName:Object(g.jsx)(v.EuiCode,null,t.reindexName)}}):e===Ee.aliasCreated?s?Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.checkupTab.reindexing.flyout.checklistStep.reindexingChecklist.inProgress.aliasCreatedStepTitle",defaultMessage:"Creating {indexName} alias for {reindexName} index.",values:{indexName:Object(g.jsx)(v.EuiCode,null,t.indexName),reindexName:Object(g.jsx)(v.EuiCode,null,t.reindexName)}}):Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.checkupTab.reindexing.flyout.checklistStep.reindexingChecklist.aliasCreatedStepTitle",defaultMessage:"Create {indexName} alias for {reindexName} index.",values:{indexName:Object(g.jsx)(v.EuiCode,null,t.indexName),reindexName:Object(g.jsx)(v.EuiCode,null,t.reindexName)}}):e===Ee.originalIndexDeleted?s?Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.checkupTab.reindexing.flyout.checklistStep.reindexingChecklist.inProgress.originalIndexDeletedStepTitle",defaultMessage:"Deleting original {indexName} index.",values:{indexName:Object(g.jsx)(v.EuiCode,null,t.indexName)}}):Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.checkupTab.reindexing.flyout.checklistStep.reindexingChecklist.originalIndexDeletedStepTitle",defaultMessage:"Delete original {indexName} index.",values:{indexName:Object(g.jsx)(v.EuiCode,null,t.indexName)}}):e===Ee.existingAliasesUpdated?s?Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.checkupTab.reindexing.flyout.checklistStep.reindexingChecklist.inProgress.aliasesUpdatedStepTitle",defaultMessage:"Updating {existingAliases} aliases to point to {reindexName} index.",values:{existingAliases:Object(g.jsx)(v.EuiCode,null,`[${t.aliases.join(",")}]`),reindexName:Object(g.jsx)(v.EuiCode,null,t.reindexName)}}):Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.checkupTab.reindexing.flyout.checklistStep.reindexingChecklist.aliasesUpdatedStepTitle",defaultMessage:"Update {existingAliases} aliases to point to {reindexName} index.",values:{existingAliases:Object(g.jsx)(v.EuiCode,null,`[${t.aliases.join(",")}]`),reindexName:Object(g.jsx)(v.EuiCode,null,t.reindexName)}}):void 0,Ge=e=>{const{errorMessage:t,lastCompletedStep:s=-1,status:a,reindexTaskPercComplete:n,meta:r}=e.reindexState,o=e=>{const i=We[We.indexOf(e)-1];return a===ye.failed&&s===i?{title:qe(e,r),status:"failed",children:Object(g.jsx)(Ne,{errorMessage:t})}:a===ye.paused&&s===i?{title:qe(e,r),status:"paused",children:Object(g.jsx)(ze,null)}:a===ye.cancelled&&s===i?{title:qe(e,r),status:"cancelled"}:void 0===a||s0;return c&&u.push(o(Ee.existingAliasesUpdated)),Object(g.jsx)(i.a.Fragment,null,Object(g.jsx)(v.EuiTitle,{size:"xs","data-test-subj":"reindexChecklistTitle"},Object(g.jsx)("h3",null,a===ye.inProgress?Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.checkupTab.reindexing.flyout.checklistStep.reindexingInProgressTitle",defaultMessage:"Reindexing in progress… {percents}",values:{percents:Ce(n,s,c)}}):Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.checkupTab.reindexing.flyout.checklistStep.reindexingChecklistTitle",defaultMessage:"Reindexing process"}))),Object(g.jsx)(Pe,{steps:u}))},$e=({closeFlyout:e,reindexState:t,startReindex:s,cancelReindex:n})=>{const{services:{api:r,core:{docLinks:o}}}=S(),{loadingState:l,status:u,hasRequiredPrivileges:c}=t,d=l===Se.Loading||u===ye.inProgress,p=u===ye.completed,j=u===ye.fetchFailed,x=u===ye.failed,{data:b}=r.useLoadNodeDiskSpace();return Object(g.jsx)(a.Fragment,null,Object(g.jsx)(v.EuiFlyoutBody,null,!1===c&&Object(g.jsx)(a.Fragment,null,Object(g.jsx)(v.EuiSpacer,null),Object(g.jsx)(v.EuiCallOut,{title:Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.checkupTab.reindexing.flyout.checklistStep.insufficientPrivilegeCallout.calloutTitle",defaultMessage:"You do not have sufficient privileges to reindex this index"}),color:"danger",iconType:"warning"})),b&&b.length>0&&Object(g.jsx)(i.a.Fragment,null,Object(g.jsx)(v.EuiCallOut,{color:"warning",iconType:"warning","data-test-subj":"lowDiskSpaceCallout",title:Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.checkupTab.reindexing.flyout.checklistStep.lowDiskSpaceCalloutTitle",defaultMessage:"Nodes with low disk space"})},Object(g.jsx)(i.a.Fragment,null,Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.checkupTab.reindexing.flyout.checklistStep.lowDiskSpaceCalloutDescription",defaultMessage:"Disk usage has exceeded the low watermark, which may prevent reindexing. The following nodes are impacted:"}),Object(g.jsx)(v.EuiSpacer,{size:"s"}),Object(g.jsx)("ul",null,b.map((({nodeName:e,available:t,nodeId:s})=>Object(g.jsx)("li",{key:s,"data-test-subj":"impactedNodeListItem"},Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.checkupTab.reindexing.flyout.checklistStep.lowDiskSpaceUsedText",defaultMessage:"{nodeName} ({available} available)",values:{nodeName:e,available:t}}))))))),Object(g.jsx)(v.EuiSpacer,null)),(j||x)&&Object(g.jsx)(i.a.Fragment,null,Object(g.jsx)(v.EuiCallOut,{color:"danger",iconType:"warning","data-test-subj":j?"fetchFailedCallout":"reindexingFailedCallout",title:j?Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.checkupTab.reindexing.flyout.checklistStep.fetchFailedCalloutTitle",defaultMessage:"Reindex status not available"}):Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.checkupTab.reindexing.flyout.checklistStep.reindexingFailedCalloutTitle",defaultMessage:"Reindexing error"})},t.errorMessage),Object(g.jsx)(v.EuiSpacer,null)),Object(g.jsx)(v.EuiText,null,Object(g.jsx)("p",null,Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.checkupTab.reindexing.flyout.checklistStep.reindexDescription",defaultMessage:"The index will be read-only during reindexing. You won't be able to add, update, or delete documents until reindexing is complete. If you need to reindex to a new cluster, use the reindex API. {docsLink}",values:{docsLink:Object(g.jsx)(v.EuiLink,{target:"_blank",href:o.links.upgradeAssistant.remoteReindex},M.i18n.translate("xpack.upgradeAssistant.checkupTab.reindexing.flyout.learnMoreLinkLabel",{defaultMessage:"Learn more"}))}})),Object(g.jsx)("p",null,Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.checkupTab.reindexing.flyout.checklistStep.readonlyCallout.backgroundResumeDetail",defaultMessage:"Reindexing is performed in the background. You can return to the Upgrade Assistant to view progress or resume reindexing after a Kibana restart."}))),Object(g.jsx)(v.EuiSpacer,null),Object(g.jsx)(Ge,{reindexState:t,cancelReindex:n})),Object(g.jsx)(v.EuiFlyoutFooter,null,Object(g.jsx)(v.EuiFlexGroup,{justifyContent:"spaceBetween"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiButtonEmpty,{iconType:"cross",onClick:e,flush:"left"},Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.checkupTab.reindexing.flyout.checklistStep.closeButtonLabel",defaultMessage:"Close"}))),!j&&!p&&c&&Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiButton,{fill:!0,color:u===ye.paused?"warning":"primary",iconType:u===ye.paused?"play":void 0,onClick:s,isLoading:d,disabled:d||!c,"data-test-subj":"startReindexingButton"},(e=>{switch(e){case ye.failed:return Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.checkupTab.reindexing.flyout.checklistStep.reindexButton.tryAgainLabel",defaultMessage:"Try again"});case ye.inProgress:return Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.checkupTab.reindexing.flyout.checklistStep.reindexButton.reindexingLabel",defaultMessage:"Reindexing…"});case ye.paused:return Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.checkupTab.reindexing.flyout.checklistStep.reindexButton.resumeLabel",defaultMessage:"Resume reindexing"});case ye.cancelled:return Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.checkupTab.reindexing.flyout.checklistStep.reindexButton.restartLabel",defaultMessage:"Restart reindexing"});default:return Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.checkupTab.reindexing.flyout.checklistStep.reindexButton.runReindexLabel",defaultMessage:"Start reindexing"})}})(u))))))},He=({isChecked:e,warningId:t,label:s,onChange:a,description:n,documentationUrl:r})=>Object(g.jsx)(i.a.Fragment,null,Object(g.jsx)(v.EuiText,null,Object(g.jsx)(v.EuiFlexGroup,{justifyContent:"spaceBetween"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiCheckbox,{id:t,label:Object(g.jsx)("strong",null,s),checked:e,onChange:a})),void 0!==r&&Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiLink,{href:r,target:"_blank",external:!1},Object(g.jsx)(v.EuiIconTip,{content:Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.documentationLinkLabel",defaultMessage:"Documentation"}),position:"right",type:"help"})))),Object(g.jsx)(v.EuiSpacer,{size:"xs"}),n),Object(g.jsx)(v.EuiSpacer,null)),Ke={customTypeName:({isChecked:e,onChange:t,docLinks:s,id:a,meta:i})=>Object(g.jsx)(He,{isChecked:e,onChange:t,warningId:a,label:Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.customTypeNameWarningTitle",defaultMessage:"Replace mapping type {mappingType} with {defaultType}",values:{mappingType:Object(g.jsx)(v.EuiCode,null,i.typeName),defaultType:Object(g.jsx)(v.EuiCode,null,"_doc")}}),description:Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.customTypeNameWarningDetail",defaultMessage:"Mapping types are no longer supported in Elastic 8.x. Ensure no application code or scripts rely on {mappingType}.",values:{mappingType:Object(g.jsx)(v.EuiCode,null,i.typeName)}}),documentationUrl:s.elasticsearch.typesRemoval}),indexSetting:({isChecked:e,onChange:t,docLinks:s,id:a,meta:n})=>Object(g.jsx)(He,{isChecked:e,onChange:t,warningId:a,label:Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.deprecatedIndexSettingsWarningTitle",defaultMessage:"Remove deprecated index settings"}),description:Object(g.jsx)(i.a.Fragment,null,Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.deprecatedIndexSettingsWarningDetail",defaultMessage:"The following deprecated index settings were detected:"}),Object(g.jsx)(v.EuiSpacer,{size:"xs"}),Object(g.jsx)("ul",null,n.deprecatedSettings.map(((e,t)=>Object(g.jsx)("li",{key:`${e}-${t}`},Object(g.jsx)(v.EuiCode,null,e)))))),documentationUrl:s.elasticsearch.indexModules}),replaceIndexWithAlias:({isChecked:e,onChange:t,docLinks:s,id:a,meta:i})=>Object(g.jsx)(He,{isChecked:e,onChange:t,warningId:a,label:Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.replaceIndexWithAliasWarningTitle",defaultMessage:"Replace {indexName} index with {reindexName} index and create {indexName} index alias",values:{indexName:Object(g.jsx)(v.EuiCode,null,null==i?void 0:i.indexName),reindexName:Object(g.jsx)(v.EuiCode,null,null==i?void 0:i.reindexName)}}),description:Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.replaceIndexWithAliasWarningDetail",defaultMessage:"You can search {indexName} as before. To delete the data you'll have to delete {reindexName}",values:{indexName:Object(g.jsx)(v.EuiCode,null,null==i?void 0:i.indexName),reindexName:Object(g.jsx)(v.EuiCode,null,null==i?void 0:i.reindexName)}})})},Ye=e=>`reindexWarning-${e}`,Ve=({warnings:e,hideWarningsStep:t,continueReindex:s,meta:n})=>{const{services:{core:{docLinks:r}}}=S(),{links:o}=r,[l,u]=Object(a.useState)(e.reduce(((e,t,s)=>(e[Ye(s)]=!1,e)),{})),c=Object.values(l).filter((e=>e)).length{const t=e.target.id;u((e=>({...e,[t]:!l[t]})))};return Object(g.jsx)(i.a.Fragment,null,Object(g.jsx)(v.EuiFlyoutBody,null,e.length>0&&Object(g.jsx)(i.a.Fragment,null,Object(g.jsx)(v.EuiCallOut,{title:Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.destructiveCallout.calloutTitle",defaultMessage:"This index requires destructive changes that cannot be reversed"}),color:"warning",iconType:"warning"},Object(g.jsx)("p",null,Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.destructiveCallout.calloutDetail",defaultMessage:"Back up the index before continuing. To proceed with the reindex, accept each change."}))),Object(g.jsx)(v.EuiSpacer,null),Object(g.jsx)(v.EuiTitle,{size:"s"},Object(g.jsx)("h3",null,Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.acceptChangesTitle",defaultMessage:"Accept changes"}))),Object(g.jsx)(v.EuiSpacer,null),e.map(((e,t)=>{const s=Ke[e.warningType];return Object(g.jsx)(s,{key:Ye(t),isChecked:l[Ye(t)],onChange:d,docLinks:o,id:Ye(t),meta:{...n,...e.meta}})})))),Object(g.jsx)(v.EuiFlyoutFooter,null,Object(g.jsx)(v.EuiFlexGroup,{justifyContent:"spaceBetween"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiButtonEmpty,{iconType:"arrowLeft",onClick:t,flush:"left"},Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.checkupTab.reindexing.flyout.checklistStep.cancelButtonLabel",defaultMessage:"Back"}))),Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiButton,{fill:!0,color:"primary",onClick:s,disabled:c},Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.checkupTab.reindexing.flyout.checklistStep.continueButtonLabel",defaultMessage:"Continue reindexing"}))))))},Je=({reindexState:e,startReindex:t,cancelReindex:s,closeFlyout:n,deprecation:r})=>{var o;const{status:l,reindexWarnings:u}=e,{index:c}=r,[d,p]=Object(a.useState)(!1),j=Object(a.useCallback)((()=>{I.s.trackUiMetric(L.METRIC_TYPE.CLICK,I.p),t()}),[t]),x=Object(a.useCallback)((()=>{I.s.trackUiMetric(L.METRIC_TYPE.CLICK,I.q),s()}),[s]),b=d?Object(g.jsx)(Ve,{warnings:null!==(o=e.reindexWarnings)&&void 0!==o?o:[],meta:e.meta,hideWarningsStep:()=>p(!1),continueReindex:()=>{p(!1),j()}}):Object(g.jsx)($e,{closeFlyout:n,startReindex:()=>{u&&u.length>0&&l!==ye.inProgress&&l!==ye.completed?p(!0):j()},reindexState:e,cancelReindex:x});return Object(g.jsx)(i.a.Fragment,null,Object(g.jsx)(v.EuiFlyoutHeader,{hasBorder:!0},Object(g.jsx)(P,{isCritical:r.isCritical,isResolved:l===ye.completed}),Object(g.jsx)(v.EuiSpacer,{size:"s"}),Object(g.jsx)(v.EuiTitle,{size:"s","data-test-subj":"flyoutTitle"},Object(g.jsx)("h2",{id:"reindexDetailsFlyoutTitle"},Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.checkupTab.reindexing.flyout.flyoutHeader",defaultMessage:"Reindex {index}",values:{index:c}})))),b)},{useGlobalFlyout:Qe}=y.c,Ze=({rowFieldNames:e,deprecation:t})=>{const[s,n]=Object(a.useState)(!1),r=Ie(),{addContent:o,removeContent:l}=Qe(),u=Object(a.useCallback)((async()=>{l("reindexFlyout"),n(!1),I.s.trackUiMetric(L.METRIC_TYPE.CLICK,I.n)}),[l]);return Object(a.useEffect)((()=>{s&&o({id:"reindexFlyout",Component:Je,props:{deprecation:t,closeFlyout:u,...r},flyoutProps:{onClose:u,className:"eui-textBreakWord","data-test-subj":"reindexDetails","aria-labelledby":"reindexDetailsFlyoutTitle"}})}),[o,t,s,r,u]),Object(a.useEffect)((()=>{s&&I.s.trackUiMetric(L.METRIC_TYPE.CLICK,I.o)}),[s]),Object(g.jsx)(i.a.Fragment,null,e.map((e=>Object(g.jsx)(v.EuiTableRowCell,{key:e,truncateText:!1,"data-test-subj":`reindexTableCell-${e}`},Object(g.jsx)(te,{fieldName:e,openFlyout:()=>n(!0),deprecation:t,resolutionTableCell:Object(g.jsx)(De,null)})))))},Xe=e=>{const{services:{api:t}}=S();return Object(g.jsx)(Fe,{indexName:e.deprecation.index,api:t},Object(g.jsx)(Ze,e))},et={deleteInProgressText:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.clusterSettings.deletingButtonLabel",{defaultMessage:"Settings removal in progress…"}),deleteCompleteText:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.clusterSettings.deleteCompleteText",{defaultMessage:"Deprecated settings removed"}),deleteFailedText:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.clusterSettings.deleteFailedText",{defaultMessage:"Settings removal failed"}),resolutionText:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.clusterSettings.resolutionText",{defaultMessage:"Remove settings"}),resolutionTooltipLabel:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.clusterSettings.resolutionTooltipLabel",{defaultMessage:"Resolve this issue by removing settings from this cluster. This issue can be resolved automatically."})},tt=({status:e})=>{const{statusType:t}=e;return"in_progress"===t?Object(g.jsx)(v.EuiFlexGroup,{gutterSize:"s",alignItems:"center","data-test-subj":"clusterSettingsResolutionStatusCell"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiLoadingSpinner,{size:"m"})),Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiText,{size:"s"},et.deleteInProgressText))):"complete"===t?Object(g.jsx)(v.EuiFlexGroup,{gutterSize:"s",alignItems:"center","data-test-subj":"clusterSettingsResolutionStatusCell"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiIcon,{type:"check",color:"success"})),Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiText,{size:"s"},et.deleteCompleteText))):"error"===t?Object(g.jsx)(v.EuiFlexGroup,{gutterSize:"s",alignItems:"center","data-test-subj":"clusterSettingsResolutionStatusCell"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiIcon,{type:"warning",color:"danger"})),Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiText,{size:"s"},et.deleteFailedText))):Object(g.jsx)(v.EuiToolTip,{position:"top",content:et.resolutionTooltipLabel},Object(g.jsx)(v.EuiFlexGroup,{gutterSize:"s",alignItems:"center","data-test-subj":"clusterSettingsResolutionStatusCell"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiIcon,{type:"indexSettings"})),Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiText,{size:"s"},et.resolutionText))))},st={removeButtonLabel:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.removeClusterSettingsFlyout.removeButtonLabel",{defaultMessage:"Remove deprecated settings"}),retryRemoveButtonLabel:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.removeClusterSettingsFlyout.retryRemoveButtonLabel",{defaultMessage:"Retry removing deprecated settings"}),resolvedButtonLabel:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.removeClusterSettingsFlyout.resolvedButtonLabel",{defaultMessage:"Resolved"}),closeButtonLabel:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.removeClusterSettingsFlyout.closeButtonLabel",{defaultMessage:"Close"}),getConfirmationText:e=>M.i18n.translate("xpack.upgradeAssistant.esDeprecations.removeClusterSettingsFlyout.description",{defaultMessage:"Remove the following deprecated cluster {clusterSettingsCount, plural, one {setting} other {settings}}?",values:{clusterSettingsCount:e}}),errorTitle:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.removeClusterSettingsFlyout.deleteErrorTitle",{defaultMessage:"Error deleting cluster settings"})},at=({deprecation:e,closeFlyout:t,removeClusterSettings:s,status:n})=>{const{message:r,details:o,url:l,correctiveAction:u}=e,{statusType:c,details:d}=n,p=["idle","error"].includes(c),j=Object(a.useCallback)((()=>{I.s.trackUiMetric(L.METRIC_TYPE.CLICK,I.c),s(u.deprecatedSettings)}),[u,s]);return Object(g.jsx)(i.a.Fragment,null,Object(g.jsx)(v.EuiFlyoutHeader,{hasBorder:!0},Object(g.jsx)(P,{isCritical:e.isCritical,isResolved:"complete"===c}),Object(g.jsx)(v.EuiSpacer,{size:"s"}),Object(g.jsx)(v.EuiTitle,{size:"s","data-test-subj":"flyoutTitle"},Object(g.jsx)("h2",{id:"removeClusterSettingsDetailsFlyoutTitle"},r))),Object(g.jsx)(v.EuiFlyoutBody,null,"error"===c&&Object(g.jsx)(i.a.Fragment,null,Object(g.jsx)(v.EuiCallOut,{title:st.errorTitle,color:"danger",iconType:"warning","data-test-subj":"deleteClusterSettingsError"},d.message),Object(g.jsx)(v.EuiSpacer,null)),Object(g.jsx)(v.EuiText,null,Object(g.jsx)("p",null,o),Object(g.jsx)("p",null,Object(g.jsx)(z,{documentationUrl:l}))),p&&Object(g.jsx)("div",{"data-test-subj":"removeClusterSettingsPrompt"},Object(g.jsx)(v.EuiSpacer,null),Object(g.jsx)(v.EuiTitle,{size:"xs"},Object(g.jsx)("h3",null,st.getConfirmationText(u.deprecatedSettings.length))),Object(g.jsx)(v.EuiSpacer,null),Object(g.jsx)(v.EuiText,null,Object(g.jsx)("ul",null,u.deprecatedSettings.map((e=>Object(g.jsx)("li",{key:e},Object(g.jsx)(v.EuiCode,null,e)))))))),Object(g.jsx)(v.EuiFlyoutFooter,null,Object(g.jsx)(v.EuiFlexGroup,{justifyContent:"spaceBetween"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiButtonEmpty,{onClick:t,flush:"left"},st.closeButtonLabel)),p&&Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiButton,{fill:!0,"data-test-subj":"deleteClusterSettingsButton",color:"danger",onClick:j},"error"===c?st.retryRemoveButtonLabel:st.removeButtonLabel)))))},{useGlobalFlyout:it}=y.c,nt=({rowFieldNames:e,deprecation:t})=>{const[s,n]=Object(a.useState)(!1),[r,o]=Object(a.useState)({statusType:"idle"}),{services:{api:l}}=S(),{addContent:u,removeContent:c}=it(),d=Object(a.useCallback)((()=>{n(!1),c("clusterSettingsFlyout")}),[c]),p=Object(a.useCallback)((async e=>{o({statusType:"in_progress"});const{error:t}=await l.updateClusterSettings(e);o({statusType:t?"error":"complete",details:null!=t?t:void 0}),d()}),[l,d]);return Object(a.useEffect)((()=>{s&&u({id:"clusterSettingsFlyout",Component:at,props:{closeFlyout:d,deprecation:t,removeClusterSettings:p,status:r},flyoutProps:{onClose:d,className:"eui-textBreakWord","data-test-subj":"clusterSettingsDetails","aria-labelledby":"removeClusterSettingsDetailsFlyoutTitle"}})}),[u,t,p,s,d,r]),Object(g.jsx)(i.a.Fragment,null,e.map((e=>Object(g.jsx)(v.EuiTableRowCell,{key:e,truncateText:!1,"data-test-subj":`clusterSettingsTableCell-${e}`},Object(g.jsx)(te,{fieldName:e,openFlyout:()=>n(!0),deprecation:t,resolutionTableCell:Object(g.jsx)(tt,{status:r})})))))},rt={closeButtonLabel:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.healthIndicatorFlyout.closeButtonLabel",{defaultMessage:"Close"}),healthIndicatorCauseHeader:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.healthIndicatorFlyout.healthIndicatorCauseHeader",{defaultMessage:"Cause"}),healthIndicatorActionHeader:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.healthIndicatorFlyout.healthIndicatorActionHeader",{defaultMessage:"Action"}),healthIndicatorImpactHeader:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.healthIndicatorFlyout.healthIndicatorImpactHeader",{defaultMessage:"Impact"})},ot=({deprecation:e,closeFlyout:t})=>{const{message:s,url:a,details:n,correctiveAction:r}=e,{action:o,cause:l,impacts:u}=r,c=Boolean(o&&""!==o),d=Boolean(a&&""!==a);return Object(g.jsx)(i.a.Fragment,null,Object(g.jsx)(v.EuiFlyoutHeader,{hasBorder:!0},Object(g.jsx)(P,{isCritical:e.isCritical,isResolved:!1}),Object(g.jsx)(v.EuiSpacer,{size:"s"}),Object(g.jsx)(v.EuiTitle,{size:"s","data-test-subj":"flyoutTitle"},Object(g.jsx)("h2",{id:"defaultDeprecationDetailsFlyoutTitle"},s))),Object(g.jsx)(v.EuiFlyoutBody,null,Object(g.jsx)(v.EuiText,null,Object(g.jsx)("p",{className:"eui-textBreakWord"},n)),Object(g.jsx)(v.EuiSpacer,{size:"s"}),Object(g.jsx)(v.EuiText,null,Object(g.jsx)(v.EuiTitle,{size:"s","data-test-subj":"flyoutTitle"},Object(g.jsx)("h3",null,rt.healthIndicatorCauseHeader)),Object(g.jsx)("p",{className:"eui-textBreakWord"},l)),Object(g.jsx)(v.EuiSpacer,{size:"s"}),c&&Object(g.jsx)(i.a.Fragment,null,Object(g.jsx)(v.EuiText,null,Object(g.jsx)(v.EuiTitle,{size:"s","data-test-subj":"flyoutTitle"},Object(g.jsx)("h3",null,rt.healthIndicatorActionHeader)),Object(g.jsx)("p",{className:"eui-textBreakWord"},o)),Object(g.jsx)(v.EuiSpacer,{size:"s"})),Object(g.jsx)(v.EuiText,null,Object(g.jsx)(v.EuiTitle,{size:"s","data-test-subj":"flyoutTitle"},Object(g.jsx)("h3",null,rt.healthIndicatorImpactHeader)),Object(g.jsx)(v.EuiCodeBlock,{language:"json",isCopyable:!0},JSON.stringify(u,null,2))),Object(g.jsx)(v.EuiSpacer,{size:"s"}),d&&Object(g.jsx)(v.EuiText,null,Object(g.jsx)("p",null,Object(g.jsx)(z,{documentationUrl:a})))),Object(g.jsx)(v.EuiFlyoutFooter,null,Object(g.jsx)(v.EuiFlexGroup,{justifyContent:"spaceBetween"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiButtonEmpty,{onClick:t,flush:"left"},rt.closeButtonLabel)))))},{useGlobalFlyout:lt}=y.c,ut=({rowFieldNames:e,deprecation:t})=>{const[s,n]=Object(a.useState)(!1),{addContent:r,removeContent:o}=lt(),l=Object(a.useCallback)((()=>{n(!1),o("deprecationDetails")}),[o]);return Object(a.useEffect)((()=>{s&&r({id:"deprecationDetails",Component:ot,props:{deprecation:t,closeFlyout:l},flyoutProps:{onClose:l,className:"eui-textBreakWord","data-test-subj":"healthIndicatorDetails","aria-labelledby":"healthIndicatorDetailsFlyoutTitle"}})}),[r,l,t,s]),Object(g.jsx)(i.a.Fragment,null,e.map((e=>Object(g.jsx)(v.EuiTableRowCell,{key:e,truncateText:!1,"data-test-subj":`healthIndicatorTableCell-${e}`},Object(g.jsx)(te,{fieldName:e,deprecation:t,openFlyout:()=>n(!0)})))))},ct={refreshButtonLabel:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.table.refreshButtonLabel",{defaultMessage:"Refresh"}),noDeprecationsMessage:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.table.noDeprecationsMessage",{defaultMessage:"No Elasticsearch deprecation issues found"}),typeFilterLabel:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.table.typeFilterLabel",{defaultMessage:"Type"}),criticalFilterLabel:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.table.criticalFilterLabel",{defaultMessage:"Critical"}),searchPlaceholderLabel:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.table.searchPlaceholderLabel",{defaultMessage:"Filter"})},dt={isCritical:{label:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.table.statusColumnTitle",{defaultMessage:"Status"}),width:"8px"},message:{label:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.table.issueColumnTitle",{defaultMessage:"Issue"}),width:"36px"},type:{label:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.table.typeColumnTitle",{defaultMessage:"Type"}),width:"10px"},index:{label:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.table.nameColumnTitle",{defaultMessage:"Name"}),width:"24px"},correctiveAction:{label:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.table.resolutionColumnTitle",{defaultMessage:"Resolution"}),width:"24px"}},pt=Object.keys(dt),gt=W.pageSizeOptions,jt=(e,t)=>{const{isSortAscending:s,sortField:a}=t,i=Object(m.sortBy)(e,[e=>"isCritical"===a?!0!==e.isCritical:e[a]]);return s?i:i.reverse()},xt=({deprecations:e=[],reload:t})=>{const{services:{api:s}}=S(),{data:n}=s.useLoadMlUpgradeMode(),r=!(null==n||!n.mlUpgradeModeEnabled),[o,l]=Object(a.useState)({isSortAscending:!0,sortField:"isCritical"}),[u,c]=Object(a.useState)(W.initialPageSize),[d,p]=Object(a.useState)(0),[j,x]=Object(a.useState)(v.EuiSearchBar.Query.MATCH_ALL),[b,f]=Object(a.useState)(void 0),[m,O]=Object(a.useState)(jt(e,o)),h=Object(a.useMemo)((()=>new v.Pager(e.length,u,d)),[d,e,u]),E=Object(a.useMemo)((()=>m.slice(h.firstItemIndex,h.lastItemIndex+1)),[m,h]),y=Object(a.useCallback)((e=>{const t={isSortAscending:o.sortField!==e||!o.isSortAscending,sortField:e};l(t)}),[o]),k=Object(a.useCallback)((({query:e,error:t})=>{t?f(t):(f(void 0),x(e))}),[]);return Object(a.useEffect)((()=>{const{setTotalItems:t,goToPageIndex:s}=h,a=v.EuiSearchBar.Query.execute(j,e),i=jt(a,o);t(i.length),O(i),i.length!==m.length&&s(0)}),[e,o,h,j,m.length]),Object(g.jsx)(i.a.Fragment,null,Object(g.jsx)(v.EuiFlexGroup,{gutterSize:"m"},Object(g.jsx)(v.EuiFlexItem,{"data-test-subj":"searchBarContainer"},Object(g.jsx)(v.EuiSearchBar,{box:{placeholder:ct.searchPlaceholderLabel,incremental:!0},filters:[{type:"is",field:"isCritical",name:ct.criticalFilterLabel},{type:"field_value_selection",field:"type",name:ct.typeFilterLabel,multiSelect:!1,options:Object.keys(U).map((e=>({value:e,name:U[e]})))}],onChange:k})),Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiButton,{iconType:"refresh",onClick:t,"data-test-subj":"refreshButton",key:"refreshButton"},ct.refreshButtonLabel))),b&&Object(g.jsx)("div",{"data-test-subj":"invalidSearchQueryMessage"},Object(g.jsx)(v.EuiSpacer,{size:"l"}),Object(g.jsx)(v.EuiCallOut,{iconType:"warning",color:"danger",title:`Invalid search: ${b.message}`})),Object(g.jsx)(v.EuiSpacer,{size:"m"}),Object(g.jsx)(v.EuiTable,{"data-test-subj":"esDeprecationsTable"},Object(g.jsx)(v.EuiTableHeader,null,Object.entries(dt).map((([e,t])=>Object(g.jsx)(v.EuiTableHeaderCell,{width:t.width,key:t.label,onSort:()=>y(e),isSorted:o.sortField===e,isSortAscending:o.isSortAscending},t.label)))),0===m.length?Object(g.jsx)(v.EuiTableBody,null,Object(g.jsx)(v.EuiTableRow,{"data-test-subj":"noDeprecationsRow"},Object(g.jsx)(v.EuiTableRowCell,{align:"center",colSpan:pt.length,mobileOptions:{width:"100%"}},ct.noDeprecationsMessage))):Object(g.jsx)(v.EuiTableBody,null,E.map(((e,t)=>Object(g.jsx)(v.EuiTableRow,{"data-test-subj":"deprecationTableRow",key:`deprecation-row-${t}`},((e,t)=>{var s;switch(null===(s=e.correctiveAction)||void 0===s?void 0:s.type){case"mlSnapshot":return Object(g.jsx)(de,{deprecation:e,rowFieldNames:pt,mlUpgradeModeEnabled:t});case"indexSetting":return Object(g.jsx)(fe,{deprecation:e,rowFieldNames:pt});case"clusterSetting":return Object(g.jsx)(nt,{deprecation:e,rowFieldNames:pt});case"reindex":return Object(g.jsx)(Xe,{deprecation:e,rowFieldNames:pt});case"healthIndicator":return Object(g.jsx)(ut,{deprecation:e,rowFieldNames:pt});default:return Object(g.jsx)(ve,{deprecation:e,rowFieldNames:pt})}})(e,r)))))),Object(g.jsx)(v.EuiSpacer,{size:"m"}),Object(g.jsx)(v.EuiTablePagination,{"data-test-subj":"esDeprecationsPagination",activePage:h.getCurrentPageIndex(),itemsPerPage:h.itemsPerPage,itemsPerPageOptions:gt,pageCount:h.getTotalPages(),onChangeItemsPerPage:c,onChangePage:p}))},bt={pageTitle:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.pageTitle",{defaultMessage:"Elasticsearch deprecation issues"}),pageDescription:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.pageDescription",{defaultMessage:"Resolve all critical issues before upgrading. Before making changes, ensure you have a current snapshot of your cluster."}),isLoading:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.loadingText",{defaultMessage:"Loading deprecation issues…"}),remoteClustersDetectedTitle:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.remoteClustersDetectedTitle",{defaultMessage:"Remote cluster compatibility"}),getRemoteClustersDetectedDescription:e=>M.i18n.translate("xpack.upgradeAssistant.esDeprecations.remoteClustersDetectedDescription",{defaultMessage:"You have {remoteClustersCount} {remoteClustersCount, plural, one {remote cluster} other {remote clusters}} configured. If you use cross-cluster search, note that 8.x can only search remote clusters running the previous minor version or later. If you use cross-cluster replication, a cluster that contains follower indices must run the same or newer version as the remote cluster.",values:{remoteClustersCount:e}}),remoteClustersLinkText:M.i18n.translate("xpack.upgradeAssistant.esDeprecations.remoteClustersLinkText",{defaultMessage:"View remote clusters."})},ft=e=>Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.esDeprecations.batchReindexingDocsDescription",defaultMessage:"To start multiple reindexing tasks in a single request, use the Kibana {docsLink}.",values:{docsLink:Object(g.jsx)(v.EuiLink,{href:e.links.upgradeAssistant.batchReindex,target:"_blank",external:!0},M.i18n.translate("xpack.upgradeAssistant.esDeprecations.batchReindexingDocsLink",{defaultMessage:"batch reindexing API"}))}}),mt=()=>{var e;const{plugins:{share:t}}=S(),s=null===(e=t.url.locators.get("REMOTE_CLUSTERS_LOCATOR"))||void 0===e?void 0:e.useUrl({page:"remoteClusters"});return Object(g.jsx)(v.EuiLink,{href:s,"data-test-subj":"remoteClustersLink"},bt.remoteClustersLinkText)},Ot=Object(r.withRouter)((({history:e})=>{var t;const{services:{api:s,breadcrumbs:n,core:{docLinks:r}}}=S(),{data:o,isLoading:l,error:u,resendRequest:c}=s.useLoadEsDeprecations(),{data:d}=s.useLoadRemoteClusters(),p=Object(a.useMemo)((()=>(e=>{const t=[],s=[];return e.forEach((e=>{e.isCritical?t.push(e):s.push(e)})),{criticalDeprecations:t.length,warningDeprecations:s.length}})((null==o?void 0:o.deprecations)||[])),[null==o?void 0:o.deprecations]);return Object(a.useEffect)((()=>{n.setBreadcrumbs("esDeprecations")}),[n]),Object(a.useEffect)((()=>{I.s.trackUiMetric(L.METRIC_TYPE.LOADED,I.e)}),[]),u?Object(g.jsx)(N,{deprecationSource:"Elasticsearch",message:X(u).message}):l?Object(g.jsx)(v.EuiPageContent_Deprecated,{verticalPosition:"center",horizontalPosition:"center",color:"subdued"},Object(g.jsx)(y.g,null,bt.isLoading)):0===(null==o||null===(t=o.deprecations)||void 0===t?void 0:t.length)?Object(g.jsx)(v.EuiPageContent_Deprecated,{verticalPosition:"center",horizontalPosition:"center",color:"subdued"},Object(g.jsx)(D,{deprecationType:"Elasticsearch",navigateToOverviewPage:()=>e.push("/overview")})):Object(g.jsx)("div",{"data-test-subj":"esDeprecationsContent"},Object(g.jsx)(v.EuiPageHeader,{pageTitle:bt.pageTitle,description:Object(g.jsx)(i.a.Fragment,null,bt.pageDescription," ",ft(r))},Object(g.jsx)(i.a.Fragment,null,d&&d.length>0&&Object(g.jsx)(i.a.Fragment,null,Object(g.jsx)(v.EuiCallOut,{title:bt.remoteClustersDetectedTitle,color:"warning",iconType:"help","data-test-subj":"remoteClustersWarningCallout"},Object(g.jsx)("p",null,bt.getRemoteClustersDetectedDescription(d.length)," ",Object(g.jsx)(mt,null))),Object(g.jsx)(v.EuiSpacer,null)),Object(g.jsx)(B,{totalCriticalDeprecations:p.criticalDeprecations,totalWarningDeprecations:p.warningDeprecations}))),Object(g.jsx)(v.EuiSpacer,{size:"l"}),Object(g.jsx)(xt,{deprecations:null==o?void 0:o.deprecations,reload:c}))}));var ht=s(35),vt=s(36);const Et=({checkpoint:e})=>{const{services:{data:t},plugins:{share:s}}=S(),[i,n]=Object(a.useState)();return Object(a.useEffect)((()=>{(async()=>{const a=s.url.locators.get("DISCOVER_APP_LOCATOR");if(!a)return;const i=await(async e=>{const t=(await e.dataViews.find(E.h)).find((e=>e.title===E.h));if(t)return t;{const t=!1,s=!0;return await e.dataViews.createAndSave({title:E.h,allowNoIndex:!0},t,s)}})(t),r=i.getFieldByName(E.i);let o=[];if(void 0!==r){const e=Object(vt.buildPhrasesFilter)(r,[...E.b],i);e.meta.negate=!0,o=[e]}const l=await(null==a?void 0:a.getUrl({indexPatternId:i.id,query:{language:"kuery",query:`@timestamp > "${e}"`},filters:o}));n(l)})()}),[t,e,s.url.locators]),void 0===i?null:Object(g.jsx)(v.EuiLink,{href:i,onClick:()=>{I.s.trackUiMetric(L.METRIC_TYPE.CLICK,I.d)},"data-test-subj":"viewDiscoverLogs"},Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.overview.viewDiscoverResultsAction",defaultMessage:"Analyze logs in Discover"}))},yt=({checkpoint:e})=>{var t;const{services:{core:{http:s}}}=S(),a=`sourceId=${E.j}&logPosition=(end:now,start:${Object(ht.encode)(e)})&logFilter=${encodeURI(`(language:kuery,query:'not ${E.i} : (${E.b.join(" or ")})')`)}`,i=null==s||null===(t=s.basePath)||void 0===t?void 0:t.prepend(`/app/logs/stream?${a}`);return Object(g.jsx)(v.EuiLink,{href:i,onClick:()=>{I.s.trackUiMetric(L.METRIC_TYPE.CLICK,I.l)},"data-test-subj":"viewObserveLogs"},Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.overview.viewObservabilityResultsAction",defaultMessage:"View deprecation logs in Observability"}))},kt=({checkpoint:e})=>{const{infra:t}=S().plugins;return Object(g.jsx)(v.EuiFlexGroup,null,t&&Object(g.jsx)(v.EuiFlexItem,null,Object(g.jsx)(v.EuiPanel,null,Object(g.jsx)(v.EuiText,{size:"s"},Object(g.jsx)("p",null,Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.overview.observe.observabilityDescription",defaultMessage:"Get insight into which deprecated APIs are being used and what applications you need to update."}))),Object(g.jsx)(v.EuiSpacer,{size:"m"}),Object(g.jsx)(yt,{checkpoint:e}))),Object(g.jsx)(v.EuiFlexItem,null,Object(g.jsx)(v.EuiPanel,null,Object(g.jsx)(v.EuiText,{size:"s"},Object(g.jsx)("p",null,Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.overview.observe.discoveryDescription",defaultMessage:"Search and filter the deprecation logs to understand the types of changes you need to make."}))),Object(g.jsx)(v.EuiSpacer,{size:"m"}),Object(g.jsx)(Et,{checkpoint:e}))))};var Ct=s(29),St=s.n(Ct);const Tt={calloutTitle:(e,t)=>Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.overview.verifyChanges.calloutTitle",defaultMessage:"{warningsCount, plural, =0 {No} other {{warningsCount}}} deprecation {warningsCount, plural, one {issue} other {issues}} since {previousCheck}",values:{warningsCount:e,previousCheck:Object(g.jsx)(i.a.Fragment,null,Object(g.jsx)(h.FormattedDate,{value:t,year:"numeric",month:"long",day:"2-digit"})," ",Object(g.jsx)(h.FormattedTime,{value:t,timeZoneName:"short",hour12:!1}))}}),calloutBody:M.i18n.translate("xpack.upgradeAssistant.overview.verifyChanges.calloutBody",{defaultMessage:"After making changes, reset the counter and continue monitoring to verify you're no longer using deprecated features."}),loadingError:M.i18n.translate("xpack.upgradeAssistant.overview.verifyChanges.loadingError",{defaultMessage:"An error occurred while retrieving the count of deprecation logs"}),retryButton:M.i18n.translate("xpack.upgradeAssistant.overview.verifyChanges.retryButton",{defaultMessage:"Try again"}),resetCounterButton:M.i18n.translate("xpack.upgradeAssistant.overview.verifyChanges.resetCounterButton",{defaultMessage:"Reset counter"}),errorToastTitle:M.i18n.translate("xpack.upgradeAssistant.overview.verifyChanges.errorToastTitle",{defaultMessage:"Could not delete deprecation logs cache"})},Mt=({checkpoint:e,setCheckpoint:t})=>{const[s,i]=Object(a.useState)(!1),{services:{api:n,core:{notifications:r}}}=S(),{data:o,error:l,isLoading:u,resendRequest:c,isInitialRequest:d}=n.getDeprecationLogsCount(e),p=(null==o?void 0:o.count)||0,j=p>0,x=j?"warning":"success",b=j?"warning":"check",f=j?"hasWarningsCallout":"noWarningsCallout";return d&&u?Object(g.jsx)(v.EuiSkeletonText,{lines:6}):l?Object(g.jsx)(v.EuiCallOut,{title:Tt.loadingError,color:"danger",iconType:"warning","data-test-subj":"errorCallout"},Object(g.jsx)("p",null,l.statusCode," - ",l.message),Object(g.jsx)(v.EuiButton,{color:"danger",onClick:c,"data-test-subj":"retryButton"},Tt.retryButton)):Object(g.jsx)(v.EuiCallOut,{title:Tt.calloutTitle(p,e),color:x,iconType:b,"data-test-subj":f},Object(g.jsx)("p",null,Tt.calloutBody),Object(g.jsx)(v.EuiButton,{color:x,onClick:async()=>{i(!0);const{error:e}=await n.deleteDeprecationLogsCache();if(i(!1),e)return void r.toasts.addDanger({title:Tt.errorToastTitle,text:e.message.toString()});const s=St()().toISOString();I.s.trackUiMetric(L.METRIC_TYPE.CLICK,I.r),t(s)},isLoading:s||u,"data-test-subj":"resetLastStoredDate"},Tt.resetCounterButton))},Lt={enabledMessage:M.i18n.translate("xpack.upgradeAssistant.overview.deprecationLogs.enabledToastMessage",{defaultMessage:"Deprecated API requests will be logged and indexed."}),disabledMessage:M.i18n.translate("xpack.upgradeAssistant.overview.deprecationLogs.disabledToastMessage",{defaultMessage:"Deprecated API requests will not be logged."})},It=()=>{const{services:{api:e,core:{notifications:t}}}=S(),{data:s,error:i,isLoading:n,resendRequest:r}=e.useLoadDeprecationLogging(),[o,l]=Object(a.useState)(!1),[u,c]=Object(a.useState)(!1),[d,p]=Object(a.useState)(!1),[g,j]=Object(a.useState)();return Object(a.useEffect)((()=>{if(!n&&s){const{isDeprecationLogIndexingEnabled:e,isDeprecationLoggingEnabled:t}=s;l(e),!e&&t&&p(!0)}}),[s,n]),{isDeprecationLogIndexingEnabled:o,isLoading:n,isUpdating:u,toggleLogging:async()=>{c(!0);const{data:s,error:a}=await e.updateDeprecationLogging({isEnabled:!o});c(!1),p(!1),a?j(a):s&&(l(s.isDeprecationLogIndexingEnabled),t.toasts.addSuccess(s.isDeprecationLogIndexingEnabled?Lt.enabledMessage:Lt.disabledMessage))},fetchError:i,updateError:g,resendRequest:r,onlyDeprecationLogWritingEnabled:d}};s(58);const Ft={fetchErrorMessage:M.i18n.translate("xpack.upgradeAssistant.overview.deprecationLogs.fetchErrorMessage",{defaultMessage:"Could not retrieve logging information."}),reloadButtonLabel:M.i18n.translate("xpack.upgradeAssistant.overview.deprecationLogs.reloadButtonLabel",{defaultMessage:"Try again"}),updateErrorMessage:M.i18n.translate("xpack.upgradeAssistant.overview.deprecationLogs.updateErrorMessage",{defaultMessage:"Could not update logging state."}),errorLabel:M.i18n.translate("xpack.upgradeAssistant.overview.deprecationLogs.errorLabel",{defaultMessage:"Error"}),buttonLabel:M.i18n.translate("xpack.upgradeAssistant.overview.deprecationLogs.buttonLabel",{defaultMessage:"Enable deprecation log collection"}),loadingLogsLabel:M.i18n.translate("xpack.upgradeAssistant.overview.loadingLogsLabel",{defaultMessage:"Loading deprecation log collection state…"})},wt=({error:e})=>{const[t,s]=Object(a.useState)(!1);if(!e.statusCode||!e.message)return null;const i=Object(g.jsx)(v.EuiLink,{color:"danger",onClick:()=>s(!t)},Ft.errorLabel," ",e.statusCode);return Object(g.jsx)(v.EuiPopover,{button:i,isOpen:t,closePopover:()=>s(!1)},Object(g.jsx)(v.EuiText,{style:{width:300}},Object(g.jsx)("p",null,e.message)))},Dt=({isDeprecationLogIndexingEnabled:e,isLoading:t,isUpdating:s,fetchError:a,updateError:i,resendRequest:n,toggleLogging:r})=>t?Object(g.jsx)(v.EuiFlexGroup,{gutterSize:"s",alignItems:"center",className:"upgToggleLoading"},Object(g.jsx)(v.EuiFlexItem,{grow:!1,className:"upgLoadingItem"},Object(g.jsx)(v.EuiLoadingSpinner,{size:"m"})),Object(g.jsx)(v.EuiFlexItem,{grow:!1},Ft.loadingLogsLabel)):a?Object(g.jsx)(v.EuiFlexGroup,{gutterSize:"none",alignItems:"center"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiFlexGroup,{gutterSize:"xs",alignItems:"flexEnd","data-test-subj":"fetchLoggingError"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiTextColor,{color:"danger"},Ft.fetchErrorMessage)),Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(wt,{error:a})))),Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiButtonEmpty,{iconType:"refresh",onClick:n},Ft.reloadButtonLabel))):Object(g.jsx)(v.EuiFlexGroup,{gutterSize:"m",alignItems:"center"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiSwitch,{"data-test-subj":"deprecationLoggingToggle",label:Ft.buttonLabel,checked:!!e,onChange:r,disabled:Boolean(a)||s})),i&&Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiFlexGroup,{gutterSize:"xs",alignItems:"flexEnd","data-test-subj":"updateLoggingError"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiTextColor,{color:"danger"},Ft.updateErrorMessage)),Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(wt,{error:i})))),s&&Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiLoadingSpinner,{size:"m"}))),At="kibana.upgradeAssistant.lastCheckpoint",Rt=new y.h(window.localStorage),Bt=()=>{const e=St()(Rt.get(At));if(e.isValid())return e.toISOString();const t=St()().toISOString();return Rt.set(At,t),t},_t={analyzeTitle:M.i18n.translate("xpack.upgradeAssistant.overview.analyzeTitle",{defaultMessage:"Analyze deprecation logs"}),deprecationsCountCheckpointTitle:M.i18n.translate("xpack.upgradeAssistant.overview.deprecationsCountCheckpointTitle",{defaultMessage:"Resolve deprecation issues and verify your changes"}),apiCompatibilityNoteTitle:M.i18n.translate("xpack.upgradeAssistant.overview.apiCompatibilityNoteTitle",{defaultMessage:"Apply API compatibility headers (optional)"}),apiCompatibilityNoteBody:e=>Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.overview.apiCompatibilityNoteBody",defaultMessage:"We recommend you resolve all deprecation issues before upgrading. If needed, you can apply API compatibility headers to requests that use deprecated features. {learnMoreLink}.",values:{learnMoreLink:Object(g.jsx)(v.EuiLink,{href:e,target:"_blank"},Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.overview.apiCompatibilityNoteLink",defaultMessage:"Learn more"}))}}),onlyLogWritingEnabledTitle:M.i18n.translate("xpack.upgradeAssistant.overview.deprecationLogs.deprecationWarningTitle",{defaultMessage:"Your logs are being written to the logs directory"}),onlyLogWritingEnabledBody:M.i18n.translate("xpack.upgradeAssistant.overview.deprecationLogs.deprecationWarningBody",{defaultMessage:"Go to your logs directory to view the deprecation logs or enable deprecation log collection to see them in Kibana."}),deniedPrivilegeTitle:M.i18n.translate("xpack.upgradeAssistant.overview.deprecationLogs.deniedPrivilegeTitle",{defaultMessage:"You require index privileges to analyze the deprecation logs"}),deniedPrivilegeDescription:e=>{var t,s;return Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.overview.deprecationLogs.deniedPrivilegeDescription",defaultMessage:"The deprecation logs will continue to be indexed, but you won't be able to analyze them until you have the read index {privilegesCount, plural, one {privilege} other {privileges}} for: {missingPrivileges}",values:{missingPrivileges:Object(g.jsx)(v.EuiCode,{transparentBackground:!0},null==e||null===(t=e.index)||void 0===t?void 0:t.join(", ")),privilegesCount:null==e||null===(s=e.index)||void 0===s?void 0:s.length}})}},Pt=({hasPrivileges:e,privilegesMissing:t})=>{const{services:{core:{docLinks:s}}}=S(),{isDeprecationLogIndexingEnabled:n,onlyDeprecationLogWritingEnabled:r,isLoading:o,isUpdating:l,fetchError:u,updateError:c,resendRequest:d,toggleLogging:p}=It(),[j,x]=Object(a.useState)(Bt());return Object(a.useEffect)((()=>{var e;e=j,Rt.set(At,e)}),[j]),Object(g.jsx)(i.a.Fragment,null,Object(g.jsx)(Dt,{isDeprecationLogIndexingEnabled:n,isLoading:o,isUpdating:l,fetchError:u,updateError:c,resendRequest:d,toggleLogging:p}),r&&Object(g.jsx)(i.a.Fragment,null,Object(g.jsx)(v.EuiSpacer,{size:"m"}),Object(g.jsx)(v.EuiCallOut,{title:_t.onlyLogWritingEnabledTitle,color:"warning",iconType:"help","data-test-subj":"deprecationWarningCallout"},Object(g.jsx)("p",null,_t.onlyLogWritingEnabledBody))),!e&&n&&Object(g.jsx)(i.a.Fragment,null,Object(g.jsx)(v.EuiSpacer,{size:"m"}),Object(g.jsx)(v.EuiCallOut,{iconType:"help",color:"warning",title:_t.deniedPrivilegeTitle,"data-test-subj":"noIndexPermissionsCallout"},Object(g.jsx)("p",null,_t.deniedPrivilegeDescription(t)))),e&&n&&Object(g.jsx)(i.a.Fragment,null,Object(g.jsx)(v.EuiSpacer,{size:"xl"}),Object(g.jsx)(v.EuiText,{"data-test-subj":"externalLinksTitle"},Object(g.jsx)("h4",null,_t.analyzeTitle)),Object(g.jsx)(v.EuiSpacer,{size:"m"}),Object(g.jsx)(kt,{checkpoint:j}),Object(g.jsx)(v.EuiSpacer,{size:"xl"}),Object(g.jsx)(v.EuiText,{"data-test-subj":"deprecationsCountTitle"},Object(g.jsx)("h4",null,_t.deprecationsCountCheckpointTitle)),Object(g.jsx)(v.EuiSpacer,{size:"m"}),Object(g.jsx)(Mt,{checkpoint:j,setCheckpoint:x}),Object(g.jsx)(v.EuiSpacer,{size:"xl"}),Object(g.jsx)(v.EuiText,{"data-test-subj":"apiCompatibilityNoteTitle"},Object(g.jsx)("h4",null,_t.apiCompatibilityNoteTitle)),Object(g.jsx)(v.EuiSpacer,{size:"m"}),Object(g.jsx)(v.EuiText,null,Object(g.jsx)("p",null,_t.apiCompatibilityNoteBody(s.links.elasticsearch.apiCompatibilityHeader)))))},Nt=()=>Object(g.jsx)(y.i,{privileges:`index.${E.g}`},(({hasPrivileges:e,privilegesMissing:t,isLoading:s})=>Object(g.jsx)(Pt,{hasPrivileges:!s&&e,privilegesMissing:t}))),zt=()=>{const{services:{breadcrumbs:e,core:{docLinks:t}}}=S();return Object(a.useEffect)((()=>{I.s.trackUiMetric(L.METRIC_TYPE.LOADED,I.f)}),[]),Object(a.useEffect)((()=>{e.setBreadcrumbs("esDeprecationLogs")}),[e]),Object(g.jsx)(v.EuiPageBody,{restrictWidth:!0,"data-test-subj":"esDeprecationLogs"},Object(g.jsx)(v.EuiPageContentBody_Deprecated,{color:"transparent",paddingSize:"none"},Object(g.jsx)(v.EuiPageHeader,{bottomBorder:!0,pageTitle:M.i18n.translate("xpack.upgradeAssistant.esDeprecationLogs.pageTitle",{defaultMessage:"Elasticsearch deprecation logs"}),description:M.i18n.translate("xpack.upgradeAssistant.esDeprecationLogs.pageDescription",{defaultMessage:"Review the deprecation logs to determine if your applications are using any deprecated APIs. Update your applications to prevent errors or changes in behavior after you upgrade."}),rightSideItems:[Object(g.jsx)(v.EuiButtonEmpty,{href:t.links.elasticsearch.migrationApiDeprecation,target:"_blank",iconType:"help","data-test-subj":"documentationLink"},Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.esDeprecationLogs.documentationLinkText",defaultMessage:"Documentation"}))]}),Object(g.jsx)(v.EuiSpacer,{size:"l"}),Object(g.jsx)(Nt,null)))},Ut=()=>{var e;const{plugins:{share:t}}=S(),s=null===(e=t.url.locators.get("SNAPSHOT_RESTORE_LOCATOR"))||void 0===e?void 0:e.useUrl({page:"snapshots"});return Object(g.jsx)(v.EuiButton,{href:s,onClick:()=>{I.s.trackUiMetric(L.METRIC_TYPE.CLICK,I.b)},"data-test-subj":"snapshotRestoreLink"},Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.overview.snapshotRestoreLink",defaultMessage:"Create snapshot"}))},Wt=()=>Object(g.jsx)(i.a.Fragment,null,Object(g.jsx)(v.EuiText,null,Object(g.jsx)("p",null,M.i18n.translate("xpack.upgradeAssistant.overview.backupStepDescription",{defaultMessage:"Make sure you have a current snapshot before making any changes."}))),Object(g.jsx)(v.EuiSpacer,{size:"s"}),Object(g.jsx)(Ut,null)),qt=({cloudSnapshotsUrl:e,setIsComplete:t,setForceOnPremStep:s})=>{const{services:{api:n}}=S(),{isInitialRequest:r,isLoading:o,error:l,data:u,resendRequest:c}=n.useLoadCloudBackupStatus();if(Object(a.useEffect)((()=>{var e;o||(t(null!==(e=!l&&(null==u?void 0:u.isBackedUp))&&void 0!==e&&e),l&&(e=>404===e.statusCode&&e.message.toString().includes(E.d))(l)&&s(!0))}),[l,o,u,s]),r&&o)return Object(g.jsx)(v.EuiSkeletonText,{"data-test-subj":"cloudBackupLoading",lines:3});if(l)return Object(g.jsx)(v.EuiCallOut,{title:M.i18n.translate("xpack.upgradeAssistant.overview.cloudBackup.loadingError",{defaultMessage:"An error occurred while retrieving the latest snapshot status"}),color:"danger",iconType:"warning","data-test-subj":"cloudBackupErrorCallout"},Object(g.jsx)("p",null,l.statusCode," - ",l.message),Object(g.jsx)(v.EuiButton,{color:"danger",onClick:c,"data-test-subj":"cloudBackupRetryButton"},M.i18n.translate("xpack.upgradeAssistant.overview.cloudBackup.retryButton",{defaultMessage:"Try again"})));const d=St()(u.lastBackupTime).toISOString(),p=u.isBackedUp?Object(g.jsx)(v.EuiFlexGroup,{alignItems:"center",gutterSize:"s","data-test-subj":"dataBackedUpStatus"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiIcon,{type:"check",color:"success"})),Object(g.jsx)(v.EuiFlexItem,null,Object(g.jsx)(v.EuiText,null,Object(g.jsx)("p",null,Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.overview.cloudBackup.hasSnapshotMessage",defaultMessage:"Last snapshot created on {lastBackupTime}.",values:{lastBackupTime:Object(g.jsx)(i.a.Fragment,null,Object(g.jsx)(h.FormattedDate,{value:d,year:"numeric",month:"long",day:"2-digit"})," ",Object(g.jsx)(h.FormattedTime,{value:d,timeZoneName:"short",hour12:!1}))}}))))):Object(g.jsx)(v.EuiFlexGroup,{alignItems:"center",gutterSize:"s","data-test-subj":"dataNotBackedUpStatus"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiIcon,{type:"warning",color:"danger"})),Object(g.jsx)(v.EuiFlexItem,null,Object(g.jsx)(v.EuiText,null,Object(g.jsx)("p",null,M.i18n.translate("xpack.upgradeAssistant.overview.cloudBackup.noSnapshotMessage",{defaultMessage:"Your data isn't backed up."})))));return Object(g.jsx)(i.a.Fragment,null,p,Object(g.jsx)(v.EuiSpacer,{size:"s"}),Object(g.jsx)(v.EuiButton,{href:e,onClick:()=>{I.s.trackUiMetric(L.METRIC_TYPE.CLICK,I.a)},"data-test-subj":"cloudSnapshotsLink",target:"_blank",iconType:"popout",iconSide:"right"},Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.overview.cloudBackup.snapshotsLink",defaultMessage:"Create snapshot"})))},Gt=M.i18n.translate("xpack.upgradeAssistant.overview.backupStepTitle",{defaultMessage:"Back up your data"}),$t=({cloud:e,setIsComplete:t})=>{const[s,i]=Object(a.useState)(!1);return null!=e&&e.isCloudEnabled&&!s?Object(g.jsx)(qt,{setIsComplete:t,cloudSnapshotsUrl:e.snapshotsUrl,setForceOnPremStep:i}):Object(g.jsx)(Wt,null)},Ht=({cloud:e,isComplete:t,setIsComplete:s})=>{const a=null!=e&&e.isCloudEnabled&&t?"complete":"incomplete";return{title:Gt,status:a,"data-test-subj":`backupStep-${a}`,children:Object(g.jsx)($t,{cloud:e,setIsComplete:s})}},Kt=({children:e})=>Object(g.jsx)(v.EuiText,{color:"subdued","data-test-subj":"loadingIssuesError"},Object(g.jsx)(v.EuiFlexGroup,{gutterSize:"s",alignItems:"center"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiIcon,{type:"warning",color:"danger"})),Object(g.jsx)(v.EuiFlexItem,{grow:!1},e))),Yt={noPartialDeprecationIssuesText:M.i18n.translate("xpack.upgradeAssistant.noPartialDeprecationsMessage",{defaultMessage:"None"}),noDeprecationIssuesText:M.i18n.translate("xpack.upgradeAssistant.noDeprecationsMessage",{defaultMessage:"No issues"})},Vt=e=>{const{isPartial:t=!1}=e;return Object(g.jsx)(v.EuiText,{color:"success"},Object(g.jsx)(v.EuiFlexGroup,{gutterSize:"s",alignItems:"center"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiIcon,{type:"check"})),Object(g.jsx)(v.EuiFlexItem,{grow:!1,"data-test-subj":e["data-test-subj"]},t?Yt.noPartialDeprecationIssuesText:Yt.noDeprecationIssuesText)))};s(63);const Jt={warningDeprecationsTitle:M.i18n.translate("xpack.upgradeAssistant.deprecationStats.warningDeprecationsTitle",{defaultMessage:"Warning"}),criticalDeprecationsTitle:M.i18n.translate("xpack.upgradeAssistant.deprecationStats.criticalDeprecationsTitle",{defaultMessage:"Critical"})},Qt=e=>{const{deprecationSource:t,linkUrl:s,criticalDeprecationsCount:i,warningDeprecationsCount:n,isLoading:o,errorMessage:u,setIsFixed:c}=e,d=Object(r.useHistory)(),p=!!u,j=i>0,x=n>0,b=!(o||p||x||j);return Object(a.useEffect)((()=>{o||u||c(0===i)}),[c,i,o,u]),Object(g.jsx)(v.EuiCard,l()({"data-test-subj":e["data-test-subj"],className:"upgDeprecationIssuesPanel",layout:"horizontal",title:t,titleSize:"xs"},!b&&Object(y.j)(d,s)),Object(g.jsx)(v.EuiSpacer,{size:"s"}),p?Object(g.jsx)(Kt,null,u):b?Object(g.jsx)(Vt,{"data-test-subj":"noDeprecationIssues"}):Object(g.jsx)(v.EuiFlexGroup,null,Object(g.jsx)(v.EuiFlexItem,null,Object(g.jsx)(v.EuiStat,{"data-test-subj":"criticalDeprecations",className:"upgDeprecationIssuesPanel__stat",title:p?"--":j?ke(i):Object(g.jsx)(Vt,{isPartial:!0,"data-test-subj":"noCriticalDeprecationIssues"}),titleElement:"span",description:Jt.criticalDeprecationsTitle,titleColor:"danger",isLoading:o})),Object(g.jsx)(v.EuiFlexItem,null,Object(g.jsx)(v.EuiStat,{"data-test-subj":"warningDeprecations",className:"upgDeprecationIssuesPanel__stat",title:p?"--":x?ke(n):Object(g.jsx)(Vt,{isPartial:!0,"data-test-subj":"noWarningDeprecationIssues"}),titleElement:"span",description:Jt.warningDeprecationsTitle,isLoading:o}))))},Zt=({setIsFixed:e})=>{var t,s,a,i,n,r;const{services:{api:o}}=S(),{data:l,isLoading:u,error:c}=o.useLoadEsDeprecations(),d=null!==(t=null==l||null===(s=l.deprecations)||void 0===s||null===(a=s.filter((e=>e.isCritical)))||void 0===a?void 0:a.length)&&void 0!==t?t:0,p=null!==(i=null==l||null===(n=l.deprecations)||void 0===n||null===(r=n.filter((e=>!1===e.isCritical)))||void 0===r?void 0:r.length)&&void 0!==i?i:0,j=c&&X(c).message;return Object(g.jsx)(Qt,{"data-test-subj":"esStatsPanel",deprecationSource:"Elasticsearch",linkUrl:"/es_deprecations",criticalDeprecationsCount:d,warningDeprecationsCount:p,isLoading:u,errorMessage:j,setIsFixed:e})},Xt=({setIsFixed:e})=>{var t,s,i,n;const{services:{core:{deprecations:r}}}=S(),[o,l]=Object(a.useState)(void 0),[u,c]=Object(a.useState)(!1),[d,p]=Object(a.useState)(void 0);Object(a.useEffect)((()=>{!async function(){c(!0);try{const e=await r.getAllDeprecations();l(e)}catch(e){p(e)}c(!1)}()}),[r]);const j=null!==(t=null==o||null===(s=o.filter((e=>"critical"===e.level)))||void 0===s?void 0:s.length)&&void 0!==t?t:0,x=null!==(i=null==o||null===(n=o.filter((e=>"warning"===e.level)))||void 0===n?void 0:n.length)&&void 0!==i?i:0,b=d&&M.i18n.translate("xpack.upgradeAssistant.deprecationStats.loadingErrorMessage",{defaultMessage:"Could not retrieve Kibana deprecation issues."});return Object(g.jsx)(Qt,{"data-test-subj":"kibanaStatsPanel",deprecationSource:"Kibana",linkUrl:"/kibana_deprecations",criticalDeprecationsCount:j,warningDeprecationsCount:x,isLoading:u,errorMessage:b,setIsFixed:e})},es={reviewStepTitle:M.i18n.translate("xpack.upgradeAssistant.overview.fixIssuesStepTitle",{defaultMessage:"Review deprecated settings and resolve issues"})},ts=({setIsComplete:e})=>{const[t,s]=Object(a.useState)(!1),[i,n]=Object(a.useState)(!1);return Object(a.useEffect)((()=>{e(t&&i)}),[t,i]),Object(g.jsx)(v.EuiFlexGroup,null,Object(g.jsx)(v.EuiFlexItem,null,Object(g.jsx)(Zt,{setIsFixed:s})),Object(g.jsx)(v.EuiFlexItem,null,Object(g.jsx)(Xt,{setIsFixed:n})))},ss=({isComplete:e,setIsComplete:t})=>{const s=e?"complete":"incomplete";return{title:es.reviewStepTitle,status:s,"data-test-subj":`fixIssuesStep-${s}`,children:Object(g.jsx)(i.a.Fragment,null,Object(g.jsx)(v.EuiText,null,Object(g.jsx)("p",null,Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.overview.fixIssuesStepDescription",defaultMessage:"You must resolve any critical Elasticsearch and Kibana configuration issues before upgrading to the next version of the Elastic Stack. Ignoring warnings might result in differences in behavior after you upgrade."}))),Object(g.jsx)(v.EuiSpacer,{size:"m"}),Object(g.jsx)(ts,{setIsComplete:t}))}},as={upgradeStepTitle:M.i18n.translate("xpack.upgradeAssistant.overview.upgradeStepTitle",{defaultMessage:"Upgrade the Elastic Stack"}),upgradeStepDescription:M.i18n.translate("xpack.upgradeAssistant.overview.upgradeStepDescription",{defaultMessage:"Once you’ve resolved all critical issues and verified that your applications are ready, you can upgrade to the next version of the Elastic Stack. Be sure to back up your data again before upgrading."}),upgradeStepDescriptionForCloud:M.i18n.translate("xpack.upgradeAssistant.overview.upgradeStepDescriptionForCloud",{defaultMessage:"Once you've resolved all critical issues and verified that your applications are ready, you can upgrade to the next version of the Elastic Stack. Be sure to back up your data again before upgrading. Upgrade your deployment on Elastic Cloud."}),upgradeStepCloudLink:M.i18n.translate("xpack.upgradeAssistant.overview.upgradeStepCloudLink",{defaultMessage:"Upgrade on Cloud"}),loadingUpgradeStatus:M.i18n.translate("xpack.upgradeAssistant.overview.loadingUpgradeStatus",{defaultMessage:"Loading upgrade status"}),upgradeGuideLink:M.i18n.translate("xpack.upgradeAssistant.overview.upgradeGuideLink",{defaultMessage:"View upgrade guide"})},is=()=>{const{plugins:{cloud:e},services:{api:t,core:{docLinks:s}}}=S(),a=Boolean(null==e?void 0:e.isCloudEnabled),{data:n,isLoading:r,error:o,resendRequest:l}=t.useLoadUpgradeStatus();let u;if(a)if(o)u=Object(g.jsx)(v.EuiCallOut,{title:M.i18n.translate("xpack.upgradeAssistant.overview.errorLoadingUpgradeStatus",{defaultMessage:"An error occurred while retrieving the upgrade status"}),color:"danger",iconType:"warning","data-test-subj":"upgradeStatusErrorCallout"},Object(g.jsx)("p",null,o.statusCode," - ",o.message),Object(g.jsx)(v.EuiButton,{color:"danger",onClick:l,"data-test-subj":"upgradeStatusRetryButton",isLoading:r},M.i18n.translate("xpack.upgradeAssistant.overview.upgradeStatus.retryButton",{defaultMessage:"Try again"})));else{const t=null==n?void 0:n.readyForUpgrade,a=e.deploymentUrl+"?show_upgrade=true";u=Object(g.jsx)(v.EuiFlexGroup,{alignItems:"center",gutterSize:"s"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiButton,{href:a,target:"_blank","data-test-subj":"upgradeSetupCloudLink",iconSide:"right",iconType:"popout",isLoading:r,isDisabled:!t},r?as.loadingUpgradeStatus:as.upgradeStepCloudLink)),Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiButtonEmpty,{href:s.links.upgrade.upgradingStackOnCloud,target:"_blank","data-test-subj":"upgradeSetupDocsLink",iconSide:"right",iconType:"popout"},as.upgradeGuideLink)))}else u=Object(g.jsx)(v.EuiButton,{href:s.links.upgrade.upgradingStackOnPrem,target:"_blank","data-test-subj":"upgradeSetupDocsLink",iconSide:"right",iconType:"popout"},as.upgradeGuideLink);return Object(g.jsx)(i.a.Fragment,null,Object(g.jsx)(v.EuiText,null,Object(g.jsx)("p",null,a?as.upgradeStepDescriptionForCloud:as.upgradeStepDescription)),Object(g.jsx)(v.EuiSpacer,{size:"m"}),u)};var ns=s(68),rs=s.n(ns);const os={closeButtonLabel:M.i18n.translate("xpack.upgradeAssistant.overview.systemIndices.flyoutCloseButtonLabel",{defaultMessage:"Close"}),flyoutTitle:M.i18n.translate("xpack.upgradeAssistant.overview.systemIndices.flyoutTitle",{defaultMessage:"Migrate system indices"}),flyoutDescription:M.i18n.translate("xpack.upgradeAssistant.overview.systemIndices.flyoutDescription",{defaultMessage:"Migrate the indices that store information for the following features before you upgrade."}),migrationCompleteLabel:M.i18n.translate("xpack.upgradeAssistant.overview.systemIndices.migrationCompleteLabel",{defaultMessage:"Migration complete"}),needsMigrationLabel:M.i18n.translate("xpack.upgradeAssistant.overview.systemIndices.needsMigrationLabel",{defaultMessage:"Migration required"}),migratingLabel:M.i18n.translate("xpack.upgradeAssistant.overview.systemIndices.migratingLabel",{defaultMessage:"Migration in progress"}),errorLabel:M.i18n.translate("xpack.upgradeAssistant.overview.systemIndices.errorLabel",{defaultMessage:"Migration failed"}),featureNameTableColumn:M.i18n.translate("xpack.upgradeAssistant.overview.systemIndices.featureNameTableColumn",{defaultMessage:"Feature"}),statusTableColumn:M.i18n.translate("xpack.upgradeAssistant.overview.systemIndices.statusTableColumn",{defaultMessage:"Status"})},ls=[{field:"feature_name",name:os.featureNameTableColumn,sortable:!0,truncateText:!0,render:e=>Object(m.startCase)(e)},{field:"migration_status",name:os.statusTableColumn,sortable:!0,render:e=>"NO_MIGRATION_NEEDED"===e?Object(g.jsx)(v.EuiFlexGroup,{alignItems:"center",gutterSize:"s"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiIcon,{type:"checkInCircleFilled",color:"success"})),Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiText,{color:"green",size:"s","data-test-subj":"featureNoUpgradeNeeded"},Object(g.jsx)("p",null,os.migrationCompleteLabel)))):"MIGRATION_NEEDED"===e?Object(g.jsx)(v.EuiText,{size:"s","data-test-subj":"featureUpgradeNeeded"},Object(g.jsx)("p",null,os.needsMigrationLabel)):"IN_PROGRESS"===e?Object(g.jsx)(v.EuiFlexGroup,{alignItems:"center",gutterSize:"s"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiLoadingSpinner,{size:"m"})),Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiText,{color:"subdued",size:"s","data-test-subj":"featureInProgress"},Object(g.jsx)("p",null,os.migratingLabel)))):"ERROR"===e?Object(g.jsx)(v.EuiFlexGroup,{alignItems:"center",gutterSize:"s"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiIcon,{type:"warning",color:"danger"})),Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiText,{color:"danger",size:"s","data-test-subj":"featureError"},Object(g.jsx)("p",null,os.errorLabel)))):""}],us=({closeFlyout:e,data:t})=>Object(g.jsx)(i.a.Fragment,null,Object(g.jsx)(v.EuiFlyoutHeader,{hasBorder:!0},Object(g.jsx)(v.EuiTitle,{size:"s","data-test-subj":"flyoutTitle"},Object(g.jsx)("h2",null,os.flyoutTitle))),Object(g.jsx)(v.EuiFlyoutBody,{"data-test-subj":"flyoutDetails"},Object(g.jsx)(v.EuiText,null,Object(g.jsx)("p",null,os.flyoutDescription)),Object(g.jsx)(v.EuiSpacer,{size:"l"}),Object(g.jsx)(v.EuiInMemoryTable,{"data-test-subj":"featuresTable",itemId:"feature_name",items:t.features,columns:ls,pagination:!0,sorting:!0})),Object(g.jsx)(v.EuiFlyoutFooter,null,Object(g.jsx)(v.EuiFlexGroup,{justifyContent:"spaceBetween"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiButtonEmpty,{onClick:e,flush:"left"},os.closeButtonLabel))))),cs="migrateSystemIndicesFlyout",{useGlobalFlyout:ds}=y.c,ps={title:M.i18n.translate("xpack.upgradeAssistant.overview.systemIndices.title",{defaultMessage:"Migrate system indices"}),bodyDescription:e=>Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.overview.systemIndices.body",defaultMessage:"Prepare the system indices that store internal information for the upgrade. This is only required during major version upgrades. Any {hiddenIndicesLink} that need to be reindexed are shown in the next step.",values:{hiddenIndicesLink:Object(g.jsx)(v.EuiLink,{external:!0,target:"_blank",href:e},Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.overview.systemIndices.body.hiddenIndicesLink",defaultMessage:"hidden indices"}))}}),startButtonLabel:M.i18n.translate("xpack.upgradeAssistant.overview.systemIndices.startButtonLabel",{defaultMessage:"Migrate indices"}),inProgressButtonLabel:M.i18n.translate("xpack.upgradeAssistant.overview.systemIndices.inProgressButtonLabel",{defaultMessage:"Migration in progress"}),noMigrationNeeded:M.i18n.translate("xpack.upgradeAssistant.overview.systemIndices.noMigrationNeeded",{defaultMessage:"System indices migration not needed."}),viewSystemIndicesStatus:M.i18n.translate("xpack.upgradeAssistant.overview.systemIndices.viewSystemIndicesStatus",{defaultMessage:"View migration details"}),retryButtonLabel:M.i18n.translate("xpack.upgradeAssistant.overview.systemIndices.retryButtonLabel",{defaultMessage:"Retry migration"}),loadingError:M.i18n.translate("xpack.upgradeAssistant.overview.systemIndices.loadingError",{defaultMessage:"Could not retrieve the system indices status"}),migrationFailedTitle:M.i18n.translate("xpack.upgradeAssistant.overview.systemIndices.migrationFailedTitle",{defaultMessage:"System indices migration failed"}),migrationFailedBody:e=>{const{feature:t,failureCause:s}=(e=>{const t=e.find((e=>"ERROR"===e.migration_status));if(t){var s;const e=t.indices.find((e=>e.failure_cause));return{feature:null==t?void 0:t.feature_name,failureCause:null==e||null===(s=e.failure_cause)||void 0===s?void 0:s.error.type}}return{}})(e);return Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.overview.systemIndices.migrationFailedBody",defaultMessage:"An error ocurred while migrating system indices for {feature}: {failureCause}",values:{feature:t,failureCause:Object(g.jsx)(v.EuiCode,null,s)}})}},gs=({setIsComplete:e})=>{var t,s,n,r,o;const{beginSystemIndicesMigration:l,startMigrationStatus:u,migrationStatus:c,setShowFlyout:d}=(()=>{const{services:{api:e}}=S(),[t,s]=Object(a.useState)(!1),[i,n]=Object(a.useState)({statusType:"idle"}),{data:r,error:o,isLoading:l,resendRequest:u,isInitialRequest:c}=e.useLoadSystemIndicesMigrationStatus(),d="IN_PROGRESS"===(null==r?void 0:r.migration_status);rs()(u,d?E.l:null);const{addContent:p,removeContent:g}=ds(),j=Object(a.useCallback)((()=>{s(!1),g(cs)}),[g]);Object(a.useEffect)((()=>{t&&p({id:cs,Component:us,props:{data:r,closeFlyout:j},flyoutProps:{onClose:j}})}),[p,r,t,j]);const x=Object(a.useCallback)((async()=>{const{error:t}=await e.migrateSystemIndices();n({statusType:t?"error":"started",error:null!=t?t:void 0}),t||u()}),[e,u]);return{setShowFlyout:s,startMigrationStatus:i,beginSystemIndicesMigration:x,migrationStatus:{data:r,error:o,isLoading:l,resendRequest:u,isInitialRequest:c}}})();if(Object(a.useEffect)((()=>{var t;e("NO_MIGRATION_NEEDED"===(null===(t=c.data)||void 0===t?void 0:t.migration_status))}),[null===(t=c.data)||void 0===t?void 0:t.migration_status]),c.error)return Object(g.jsx)(v.EuiCallOut,{title:ps.loadingError,color:"danger",iconType:"warning","data-test-subj":"systemIndicesStatusErrorCallout"},Object(g.jsx)("p",null,c.error.statusCode," - ",c.error.message),Object(g.jsx)(v.EuiButton,{color:"danger",isLoading:c.isLoading,onClick:c.resendRequest,"data-test-subj":"systemIndicesStatusRetryButton"},ps.retryButtonLabel));if("NO_MIGRATION_NEEDED"===(null===(s=c.data)||void 0===s?void 0:s.migration_status))return Object(g.jsx)(v.EuiFlexGroup,{alignItems:"center",gutterSize:"s","data-test-subj":"noMigrationNeededSection"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiIcon,{type:"check",color:"success"})),Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiText,{color:"success"},Object(g.jsx)("p",null,ps.noMigrationNeeded))));const p=c.isInitialRequest&&c.isLoading,j="IN_PROGRESS"===(null===(n=c.data)||void 0===n?void 0:n.migration_status);return Object(g.jsx)(i.a.Fragment,null,"error"===u.statusType&&Object(g.jsx)(i.a.Fragment,null,Object(g.jsx)(v.EuiCallOut,{size:"s",color:"danger",iconType:"warning",title:`${u.error.statusCode} - ${u.error.message}`,"data-test-subj":"startSystemIndicesMigrationCalloutError"}),Object(g.jsx)(v.EuiSpacer,{size:"m"})),"ERROR"===(null===(r=c.data)||void 0===r?void 0:r.migration_status)&&Object(g.jsx)(i.a.Fragment,null,Object(g.jsx)(v.EuiCallOut,{size:"s",color:"danger",iconType:"warning",title:ps.migrationFailedTitle,"data-test-subj":"migrationFailedCallout"},Object(g.jsx)("p",null,ps.migrationFailedBody(null===(o=c.data)||void 0===o?void 0:o.features))),Object(g.jsx)(v.EuiSpacer,{size:"m"})),Object(g.jsx)(v.EuiFlexGroup,{alignItems:"center",gutterSize:"s"},Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiButton,{isLoading:j,isDisabled:p,onClick:l,"data-test-subj":"startSystemIndicesMigrationButton"},j?ps.inProgressButtonLabel:ps.startButtonLabel)),Object(g.jsx)(v.EuiFlexItem,{grow:!1},Object(g.jsx)(v.EuiButtonEmpty,{onClick:()=>d(!0),isDisabled:p,"data-test-subj":"viewSystemIndicesStateButton"},ps.viewSystemIndicesStatus))))},js=({isComplete:e,setIsComplete:t,docLinks:s})=>{const a=e?"complete":"incomplete";return{title:ps.title,status:a,"data-test-subj":`migrateSystemIndicesStep-${a}`,children:Object(g.jsx)(i.a.Fragment,null,Object(g.jsx)(v.EuiText,null,Object(g.jsx)("p",null,ps.bodyDescription(s.links.elasticsearch.hiddenIndices))),Object(g.jsx)(v.EuiSpacer,{size:"m"}),Object(g.jsx)(gs,{setIsComplete:t}))}},xs={logsStepTitle:M.i18n.translate("xpack.upgradeAssistant.overview.logsStep.title",{defaultMessage:"Address API deprecations"}),logsStepDescription:M.i18n.translate("xpack.upgradeAssistant.overview.logsStep.description",{defaultMessage:"Review the Elasticsearch deprecation logs to ensure you're not using deprecated APIs."}),viewLogsButtonLabel:M.i18n.translate("xpack.upgradeAssistant.overview.logsStep.viewLogsButtonLabel",{defaultMessage:"View logs"}),enableLogsButtonLabel:M.i18n.translate("xpack.upgradeAssistant.overview.logsStep.enableLogsButtonLabel",{defaultMessage:"Enable logging"}),logsCountDescription:(e,t)=>Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.overview.logsStep.countDescription",defaultMessage:"You have {deprecationCount, plural, =0 {no} other {{deprecationCount}}} deprecation {deprecationCount, plural, one {issue} other {issues}} since {checkpoint}.",values:{deprecationCount:e,checkpoint:Object(g.jsx)(i.a.Fragment,null,Object(g.jsx)(h.FormattedDate,{value:t,year:"numeric",month:"long",day:"2-digit"})," ",Object(g.jsx)(h.FormattedTime,{value:t,timeZoneName:"short",hour12:!1}))}}),missingPrivilegesTitle:M.i18n.translate("xpack.upgradeAssistant.overview.logsStep.missingPrivilegesTitle",{defaultMessage:"You require index privileges to analyze the deprecation logs"}),missingPrivilegesDescription:e=>{var t,s;return Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.overview.logsStep.missingPrivilegesDescription",defaultMessage:"The deprecation logs will continue to be indexed, but you won't be able to analyze them until you have the read index {privilegesCount, plural, one {privilege} other {privileges}} for: {missingPrivileges}",values:{missingPrivileges:Object(g.jsx)(v.EuiCode,{transparentBackground:!0},null==e||null===(t=e.index)||void 0===t?void 0:t.join(", ")),privilegesCount:null==e||null===(s=e.index)||void 0===s?void 0:s.length}})},loadingError:M.i18n.translate("xpack.upgradeAssistant.overview.logsStep.loadingError",{defaultMessage:"An error occurred while retrieving the deprecation log count"}),retryButton:M.i18n.translate("xpack.upgradeAssistant.overview.logsStep.retryButton",{defaultMessage:"Try again"})},bs=()=>Object(g.jsx)(v.EuiText,null,Object(g.jsx)("p",null,xs.logsStepDescription)),fs=({setIsComplete:e,hasPrivileges:t,privilegesMissing:s,navigateToEsDeprecationLogs:n})=>{const{services:{api:r}}=S(),{isDeprecationLogIndexingEnabled:o}=It(),l=Bt(),{data:u,error:c,isLoading:d,resendRequest:p,isInitialRequest:j}=r.getDeprecationLogsCount(l);return Object(a.useEffect)((()=>{o||e(!1),e(0===(null==u?void 0:u.count))}),[o,u]),!1===t&&o?Object(g.jsx)(i.a.Fragment,null,Object(g.jsx)(bs,null),Object(g.jsx)(v.EuiSpacer,null),Object(g.jsx)(v.EuiCallOut,{iconType:"help",color:"warning",title:xs.missingPrivilegesTitle,"data-test-subj":"missingPrivilegesCallout"},Object(g.jsx)("p",null,xs.missingPrivilegesDescription(s)))):d&&j?Object(g.jsx)(v.EuiSkeletonText,{lines:3}):t&&c?Object(g.jsx)(v.EuiCallOut,{title:xs.loadingError,color:"danger",iconType:"warning","data-test-subj":"deprecationLogsErrorCallout"},Object(g.jsx)("p",null,c.statusCode," - ",c.message),Object(g.jsx)(v.EuiButton,{color:"danger",onClick:p,"data-test-subj":"deprecationLogsRetryButton"},xs.retryButton)):Object(g.jsx)(i.a.Fragment,null,Object(g.jsx)(bs,null),o&&u?Object(g.jsx)(i.a.Fragment,null,Object(g.jsx)(v.EuiSpacer,null),Object(g.jsx)(v.EuiText,null,Object(g.jsx)("p",{"data-test-subj":"logsCountDescription"},xs.logsCountDescription(u.count,l))),Object(g.jsx)(v.EuiSpacer,null),Object(g.jsx)(v.EuiButton,{onClick:n,"data-test-subj":"viewLogsLink"},xs.viewLogsButtonLabel)):Object(g.jsx)(i.a.Fragment,null,Object(g.jsx)(v.EuiSpacer,null),Object(g.jsx)(v.EuiButton,{onClick:n,"data-test-subj":"enableLogsLink"},xs.enableLogsButtonLabel)),Object(g.jsx)(v.EuiSpacer,{size:"m"}))},ms=({isComplete:e,setIsComplete:t,navigateToEsDeprecationLogs:s})=>{const a=e?"complete":"incomplete";return{status:a,title:xs.logsStepTitle,"data-test-subj":`logsStep-${a}`,children:Object(g.jsx)(y.i,{privileges:`index.${E.g}`},(({hasPrivileges:e,isLoading:a,privilegesMissing:i})=>Object(g.jsx)(fs,{setIsComplete:t,hasPrivileges:!a&&e,navigateToEsDeprecationLogs:s,privilegesMissing:i})))}},Os=Object(r.withRouter)((({history:e})=>{const{featureSet:{migrateSystemIndices:t},services:{breadcrumbs:s,core:{docLinks:i}},plugins:{cloud:n}}=S();Object(a.useEffect)((()=>{I.s.trackUiMetric(L.METRIC_TYPE.LOADED,I.m)}),[]),Object(a.useEffect)((()=>{s.setBreadcrumbs("overview")}),[s]);const[r,o]=Object(a.useState)({backup:!1,migrate_system_indices:!1,fix_issues:!1,logs:!1}),l=e=>r[e],u=(e,t)=>{o({...r,[e]:t})};return Object(g.jsx)(v.EuiPageBody,{restrictWidth:!0,"data-test-subj":"overview"},Object(g.jsx)(v.EuiPageContentBody_Deprecated,{color:"transparent",paddingSize:"none"},Object(g.jsx)(v.EuiPageHeader,{bottomBorder:!0,pageTitle:M.i18n.translate("xpack.upgradeAssistant.overview.pageTitle",{defaultMessage:"Upgrade Assistant"}),description:M.i18n.translate("xpack.upgradeAssistant.overview.pageDescription",{defaultMessage:"Get ready for the next version of the Elastic Stack!"}),rightSideItems:[Object(g.jsx)(v.EuiButtonEmpty,{href:i.links.upgradeAssistant.overview,target:"_blank",iconType:"help","data-test-subj":"documentationLink"},Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.overview.documentationLinkText",defaultMessage:"Documentation"}))]},Object(g.jsx)(v.EuiText,null,Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.overview.checkUpcomingVersion",defaultMessage:"If you are not on the latest version of the Elastic Stack, use the Upgrade Assistant to prepare for the next upgrade."})),Object(g.jsx)(v.EuiText,{"data-test-subj":"whatsNewLink"},Object(g.jsx)(v.EuiLink,{href:i.links.elasticsearch.latestReleaseHighlights,target:"_blank"},Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.overview.whatsNewLink",defaultMessage:"Check the latest release highlights"})))),Object(g.jsx)(v.EuiSpacer,{size:"l"}),Object(g.jsx)(v.EuiSteps,{steps:[Ht({cloud:n,isComplete:l("backup"),setIsComplete:u.bind(null,"backup")}),t&&js({docLinks:i,isComplete:l("migrate_system_indices"),setIsComplete:u.bind(null,"migrate_system_indices")}),ss({isComplete:l("fix_issues"),setIsComplete:u.bind(null,"fix_issues")}),ms({isComplete:l("logs"),setIsComplete:u.bind(null,"logs"),navigateToEsDeprecationLogs:()=>e.push("/es_deprecation_logs")}),{title:as.upgradeStepTitle,status:"incomplete","data-test-subj":"upgradeStep",children:Object(g.jsx)(is,null)}].filter(Boolean)})))})),{GlobalFlyoutProvider:hs}=y.c,vs=()=>{const{services:{api:e,core:t}}=S(),s=!0!==t.application.capabilities.spaces.manage,[i,n]=Object(a.useState)("isPreparingForUpgrade");return Object(a.useEffect)((()=>{e.onClusterUpgradeStateChange((e=>{n(e)}))}),[e]),s?Object(g.jsx)(v.EuiPageContent_Deprecated,{verticalPosition:"center",horizontalPosition:"center",color:"subdued","data-test-subj":"missingKibanaPrivilegesMessage"},Object(g.jsx)(y.e,{title:Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.app.deniedPrivilegeTitle",defaultMessage:"Kibana admin role required"}),message:Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.app.deniedPrivilegeDescription",defaultMessage:"To use Upgrade Assistant and resolve deprecation issues, you must have access to manage all Kibana spaces."})})):"isUpgrading"===i?Object(g.jsx)(v.EuiPageContent_Deprecated,{hasShadow:!1,paddingSize:"none",verticalPosition:"center",horizontalPosition:"center","data-test-subj":"isUpgradingMessage"},Object(g.jsx)(v.EuiEmptyPrompt,{iconType:"logoElasticsearch",title:Object(g.jsx)("h1",null,Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.upgradingTitle",defaultMessage:"Your cluster is upgrading"})),body:Object(g.jsx)("p",null,Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.upgradingDescription",defaultMessage:"One or more Elasticsearch nodes have a newer version of Elasticsearch than Kibana. Once all your nodes are upgraded, upgrade Kibana."})),"data-test-subj":"emptyPrompt"})):"isUpgradeComplete"===i?Object(g.jsx)(v.EuiPageContent_Deprecated,{hasShadow:!1,paddingSize:"none",verticalPosition:"center",horizontalPosition:"center","data-test-subj":"isUpgradeCompleteMessage"},Object(g.jsx)(v.EuiEmptyPrompt,{iconType:"logoElasticsearch",title:Object(g.jsx)("h1",null,Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.upgradedTitle",defaultMessage:"Your cluster has been upgraded"})),body:Object(g.jsx)("p",null,Object(g.jsx)(h.FormattedMessage,{id:"xpack.upgradeAssistant.upgradedDescription",defaultMessage:"All Elasticsearch nodes have been upgraded. You may now upgrade Kibana."})),"data-test-subj":"emptyPrompt"})):Object(g.jsx)(O,null,Object(g.jsx)(j,{exact:!0,path:"/overview",component:Os}),Object(g.jsx)(j,{exact:!0,path:"/es_deprecations",component:Ot}),Object(g.jsx)(j,{exact:!0,path:"/es_deprecation_logs",component:zt}),Object(g.jsx)(j,{exact:!0,path:"/kibana_deprecations",component:Q}),Object(g.jsx)(r.Redirect,{from:"/",to:"/overview"}))},Es=({history:e})=>{const{services:{api:t}}=S(),{isLoading:s,isInitialRequest:a}=t.useLoadClusterUpgradeStatus();return s&&a?Object(g.jsx)(v.EuiPageContent_Deprecated,{hasShadow:!1,paddingSize:"none",verticalPosition:"center",horizontalPosition:"center"},Object(g.jsx)(v.EuiEmptyPrompt,{body:Object(g.jsx)(v.EuiLoadingSpinner,{size:"l"})})):Object(g.jsx)(f,{history:e},Object(g.jsx)(vs,null))},ys=e=>{const{history:t,core:{i18n:s,application:a,http:i,executionContext:n}}=e.services;return n.set({type:"application",page:"upgradeAssistant"}),Object(g.jsx)(y.f,{application:a,className:y.a},Object(g.jsx)(y.b,{httpClient:i,privilegesEndpoint:`${E.a}/privileges`},Object(g.jsx)(s.Context,null,Object(g.jsx)(y.d,{theme$:e.theme$},Object(g.jsx)(C,{value:e},Object(g.jsx)(hs,null,Object(g.jsx)(Es,{history:t})))))))};var ks=s(10),Cs=s(13);function Ss(e,t){const{element:s,setBreadcrumbs:a}=e;return ks.a.setup(t.services.core.http),Cs.a.setup(a),Object(n.render)(Object(g.jsx)(ys,t),s),()=>{Object(n.unmountComponentAtNode)(s)}}}])]);