/*! 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.crossClusterReplication_bundle_jsonpfunction=window.crossClusterReplication_bundle_jsonpfunction||[]).push([[1],Array(29).concat([function(e,t,o){e.exports=o(18)(1465)},function(e,t,o){"use strict";t.__esModule=!0;var s={batch:!0},r=o(47);Object.keys(r).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(s,e)||e in t&&t[e]===r[e]||(t[e]=r[e]))}));var a=o(62);t.batch=a.unstable_batchedUpdates,(0,o(38).setBatch)(a.unstable_batchedUpdates)},function(e,t,o){e.exports=o(18)(1466)},function(e,t,o){e.exports=o(18)(2964)},function(e,t,o){"use strict";var s=o(32).default;t.__esModule=!0,t.default=t.ReactReduxContext=void 0;var r=s(o(14)).default.createContext(null);t.ReactReduxContext=r;var a=r;t.default=a},function(e,t,o){"use strict";t.__esModule=!0,t.createSubscription=function(e,t){var o,a=r;function n(){i.onStateChange&&i.onStateChange()}function l(){var r,l,i;o||(o=t?t.addNestedSub(n):e.subscribe(n),r=(0,s.getBatch)(),l=null,i=null,a={clear:function(){l=null,i=null},notify:function(){r((function(){for(var e=l;e;)e.callback(),e=e.next}))},get:function(){for(var e=[],t=l;t;)e.push(t),t=t.next;return e},subscribe:function(e){var t=!0,o=i={callback:e,next:null,prev:i};return o.prev?o.prev.next=o:l=o,function(){t&&null!==l&&(t=!1,o.next?o.next.prev=o.prev:i=o.prev,o.prev?o.prev.next=o.next:l=o.next)}}})}var i={addNestedSub:function(e){return l(),a.subscribe(e)},notifyNestedSubs:function(){a.notify()},handleChangeWrapper:n,isSubscribed:function(){return Boolean(o)},trySubscribe:l,tryUnsubscribe:function(){o&&(o(),o=void 0,a.clear(),a=r)},getListeners:function(){return a}};return i};var s=o(38),r={notify:function(){},get:function(){return[]}}},function(e,t,o){"use strict";t.__esModule=!0,t.useIsomorphicLayoutEffect=void 0;var s=o(14),r="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?s.useLayoutEffect:s.useEffect;t.useIsomorphicLayoutEffect=r},function(e,t,o){e.exports=o(18)(1467)},function(e,t,o){e.exports=o(18)(2965)},function(e,t,o){"use strict";t.__esModule=!0,t.setBatch=t.getBatch=void 0;var s=function(e){e()};t.setBatch=function(e){return s=e},t.getBatch=function(){return s}},function(e,t,o){"use strict";var s=o(32).default,r=o(37).default;t.__esModule=!0,t.default=function(e,t){void 0===t&&(t={});var o=t,s=o.getDisplayName,r=void 0===s?function(e){return"ConnectAdvanced("+e+")"}:s,d=o.methodName,F=void 0===d?"connectAdvanced":d,C=o.renderCountProp,E=void 0===C?void 0:C,M=o.shouldHandleStateChanges,I=void 0===M||M,P=o.storeKey,v=void 0===P?"store":P,R=(o.withRef,o.forwardRef),y=void 0!==R&&R,_=o.context,S=void 0===_?p.ReactReduxContext:_,T=(0,n.default)(o,x),L=S;return function(t){var o=t.displayName||t.name||"Component",s=r(o),d=(0,a.default)({},T,{getDisplayName:r,methodName:F,renderCountProp:E,shouldHandleStateChanges:I,storeKey:v,displayName:s,wrappedComponentName:o,WrappedComponent:t}),p=T.pure,x=p?i.useMemo:function(e){return e()};function C(o){var s=(0,i.useMemo)((function(){var e=o.reactReduxForwardedRef,t=(0,n.default)(o,f);return[o.context,e,t]}),[o]),r=s[0],l=s[1],p=s[2],F=(0,i.useMemo)((function(){return r&&r.Consumer&&(0,c.isContextConsumer)(i.default.createElement(r.Consumer,null))?r:L}),[r,L]),C=(0,i.useContext)(F),E=Boolean(o.store)&&Boolean(o.store.getState)&&Boolean(o.store.dispatch);Boolean(C)&&Boolean(C.store);var M=E?o.store:C.store,P=(0,i.useMemo)((function(){return function(t){return e(t.dispatch,d)}(M)}),[M]),v=(0,i.useMemo)((function(){if(!I)return j;var e=(0,u.createSubscription)(M,E?null:C.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]}),[M,E,C]),R=v[0],y=v[1],_=(0,i.useMemo)((function(){return E?C:(0,a.default)({},C,{subscription:R})}),[E,C,R]),S=(0,i.useReducer)(b,m,O),T=S[0][0],k=S[1];if(T&&T.error)throw T.error;var A=(0,i.useRef)(),D=(0,i.useRef)(p),N=(0,i.useRef)(),B=(0,i.useRef)(!1),q=x((function(){return N.current&&p===D.current?N.current:P(M.getState(),p)}),[M,T,p]);g(h,[D,A,B,p,q,N,y]),g(w,[I,M,R,P,D,A,B,N,y,k],[M,R,P]);var z=(0,i.useMemo)((function(){return i.default.createElement(t,(0,a.default)({},q,{ref:l}))}),[l,t,q]);return(0,i.useMemo)((function(){return I?i.default.createElement(F.Provider,{value:_},z):z}),[F,z,_])}var M=p?i.default.memo(C):C;if(M.WrappedComponent=t,M.displayName=C.displayName=s,y){var P=i.default.forwardRef((function(e,t){return i.default.createElement(M,(0,a.default)({},e,{reactReduxForwardedRef:t}))}));return P.displayName=s,P.WrappedComponent=t,(0,l.default)(P,t)}return(0,l.default)(M,t)}};var a=s(o(31)),n=s(o(36)),l=s(o(50)),i=r(o(14)),c=o(51),u=o(34),d=o(35),p=o(33),x=["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"],f=["reactReduxForwardedRef"],m=[],j=[null,null];function b(e,t){var o=e[1];return[t.payload,o+1]}function g(e,t,o){(0,d.useIsomorphicLayoutEffect)((function(){return e.apply(void 0,t)}),o)}function h(e,t,o,s,r,a,n){e.current=s,t.current=r,o.current=!1,a.current&&(a.current=null,n())}function w(e,t,o,s,r,a,n,l,i,c){if(e){var u=!1,d=null,p=function(){if(!u){var e,o,p=t.getState();try{e=s(p,r.current)}catch(e){o=e,d=e}o||(d=null),e===a.current?n.current||i():(a.current=e,l.current=e,n.current=!0,c({type:"STORE_UPDATED",payload:{error:o}}))}};return o.onStateChange=p,o.trySubscribe(),p(),function(){if(u=!0,o.tryUnsubscribe(),o.onStateChange=null,d)throw d}}}var O=function(){return[null,0]}},function(e,t,o){"use strict";function s(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}t.__esModule=!0,t.default=function(e,t){if(s(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var o=Object.keys(e),r=Object.keys(t);if(o.length!==r.length)return!1;for(var a=0;a=0;s--){var r=t[s](e);if(r)return r}return function(t,s){throw new Error("Invalid value of type "+typeof e+" for "+o+" argument when connecting component "+s.wrappedComponentName+".")}}function f(e,t){return e===t}function m(e){var t=void 0===e?{}:e,o=t.connectHOC,s=void 0===o?n.default:o,m=t.mapStateToPropsFactories,j=void 0===m?c.default:m,b=t.mapDispatchToPropsFactories,g=void 0===b?i.default:b,h=t.mergePropsFactories,w=void 0===h?u.default:h,O=t.selectorFactory,F=void 0===O?d.default:O;return function(e,t,o,n){void 0===n&&(n={});var i=n,c=i.pure,u=void 0===c||c,d=i.areStatesEqual,m=void 0===d?f:d,b=i.areOwnPropsEqual,h=void 0===b?l.default:b,O=i.areStatePropsEqual,C=void 0===O?l.default:O,E=i.areMergedPropsEqual,M=void 0===E?l.default:E,I=(0,a.default)(i,p),P=x(e,j,"mapStateToProps"),v=x(t,g,"mapDispatchToProps"),R=x(o,w,"mergeProps");return s(F,(0,r.default)({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:P,initMapDispatchToProps:v,initMergeProps:R,pure:u,areStatesEqual:m,areOwnPropsEqual:h,areStatePropsEqual:C,areMergedPropsEqual:M},I))}}var j=m();t.default=j},function(e,t,o){"use strict";var s=o(32).default;t.__esModule=!0,t.default=void 0,t.whenMapDispatchToPropsIsFunction=n,t.whenMapDispatchToPropsIsMissing=l,t.whenMapDispatchToPropsIsObject=i;var r=s(o(54)),a=o(41);function n(e){return"function"==typeof e?(0,a.wrapMapToPropsFunc)(e,"mapDispatchToProps"):void 0}function l(e){return e?void 0:(0,a.wrapMapToPropsConstant)((function(e){return{dispatch:e}}))}function i(e){return e&&"object"==typeof e?(0,a.wrapMapToPropsConstant)((function(t){return(0,r.default)(e,t)})):void 0}var c=[n,l,i];t.default=c},function(e,t,o){"use strict";t.__esModule=!0,t.default=function(e,t){var o={},s=function(s){var r=e[s];"function"==typeof r&&(o[s]=function(){return t(r.apply(void 0,arguments))})};for(var r in e)s(r);return o}},function(e,t,o){"use strict";t.__esModule=!0,t.default=function(e){if("object"!=typeof e||null===e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;for(var o=t;null!==Object.getPrototypeOf(o);)o=Object.getPrototypeOf(o);return t===o}},function(e,t,o){"use strict";t.__esModule=!0,t.default=void 0,t.whenMapStateToPropsIsFunction=r,t.whenMapStateToPropsIsMissing=a;var s=o(41);function r(e){return"function"==typeof e?(0,s.wrapMapToPropsFunc)(e,"mapStateToProps"):void 0}function a(e){return e?void 0:(0,s.wrapMapToPropsConstant)((function(){return{}}))}var n=[r,a];t.default=n},function(e,t,o){"use strict";var s=o(32).default;t.__esModule=!0,t.default=void 0,t.defaultMergeProps=a,t.whenMergePropsIsFunction=l,t.whenMergePropsIsOmitted=i,t.wrapMergePropsFunc=n;var r=s(o(31));function a(e,t,o){return(0,r.default)({},o,e,t)}function n(e){return function(t,o){o.displayName;var s,r=o.pure,a=o.areMergedPropsEqual,n=!1;return function(t,o,l){var i=e(t,o,l);return n?r&&a(i,s)||(s=i):(n=!0,s=i),s}}}function l(e){return"function"==typeof e?n(e):void 0}function i(e){return e?void 0:function(){return a}}s(o(42));var c=[l,i];t.default=c},function(e,t,o){"use strict";var s=o(32).default;t.__esModule=!0,t.default=function(e,t){var o=t.initMapStateToProps,s=t.initMapDispatchToProps,i=t.initMergeProps,c=(0,r.default)(t,a),u=o(e,c),d=s(e,c),p=i(e,c);return(c.pure?l:n)(u,d,p,e,c)},t.impureFinalPropsSelectorFactory=n,t.pureFinalPropsSelectorFactory=l;var r=s(o(36)),a=(s(o(59)),["initMapStateToProps","initMapDispatchToProps","initMergeProps"]);function n(e,t,o,s){return function(r,a){return o(e(r,a),t(s,a),a)}}function l(e,t,o,s,r){var a,n,l,i,c,u=r.areStatesEqual,d=r.areOwnPropsEqual,p=r.areStatePropsEqual,x=!1;return function(r,f){return x?function(r,x){var f,m,j=!d(x,n),b=!u(r,a);return a=r,n=x,j&&b?(l=e(a,n),t.dependsOnOwnProps&&(i=t(s,n)),c=o(l,i,n)):j?(e.dependsOnOwnProps&&(l=e(a,n)),t.dependsOnOwnProps&&(i=t(s,n)),c=o(l,i,n)):b?(f=e(a,n),m=!p(f,l),l=f,m&&(c=o(l,i,n)),c):c}(r,f):(l=e(a=r,n=f),i=t(s,n),c=o(l,i,n),x=!0,c)}}},function(e,t,o){"use strict";var s=o(32).default;t.__esModule=!0,t.default=function(e,t,o,s){a(e,"mapStateToProps",s),a(t,"mapDispatchToProps",s),a(o,"mergeProps",s)};var r=s(o(43));function a(e,t,o){if(!e)throw new Error("Unexpected value for "+t+" in "+o+".");"mapStateToProps"!==t&&"mapDispatchToProps"!==t||Object.prototype.hasOwnProperty.call(e,"dependsOnOwnProps")||(0,r.default)("The selector for "+t+" of "+o+" did not specify a value for dependsOnOwnProps.")}},function(e,t,o){"use strict";t.__esModule=!0,t.createDispatchHook=a,t.useDispatch=void 0;var s=o(33),r=o(44);function a(e){void 0===e&&(e=s.ReactReduxContext);var t=e===s.ReactReduxContext?r.useStore:(0,r.createStoreHook)(e);return function(){return t().dispatch}}var n=a();t.useDispatch=n},function(e,t,o){"use strict";t.__esModule=!0,t.createSelectorHook=c,t.useSelector=void 0;var s=o(14),r=o(45),a=o(34),n=o(35),l=o(33),i=function(e,t){return e===t};function c(e){void 0===e&&(e=l.ReactReduxContext);var t=e===l.ReactReduxContext?r.useReduxContext:function(){return(0,s.useContext)(e)};return function(e,o){void 0===o&&(o=i);var r=t(),l=function(e,t,o,r){var l,i=(0,s.useReducer)((function(e){return e+1}),0)[1],c=(0,s.useMemo)((function(){return(0,a.createSubscription)(o,r)}),[o,r]),u=(0,s.useRef)(),d=(0,s.useRef)(),p=(0,s.useRef)(),x=(0,s.useRef)(),f=o.getState();try{if(e!==d.current||f!==p.current||u.current){var m=e(f);l=void 0!==x.current&&t(m,x.current)?x.current:m}else l=x.current}catch(e){throw u.current&&(e.message+="\nThe error may be correlated with this previous error:\n"+u.current.stack+"\n\n"),e}return(0,n.useIsomorphicLayoutEffect)((function(){d.current=e,p.current=f,x.current=l,u.current=void 0})),(0,n.useIsomorphicLayoutEffect)((function(){function e(){try{var e=o.getState();if(e===p.current)return;var s=d.current(e);if(t(s,x.current))return;x.current=s,p.current=e}catch(e){u.current=e}i()}return c.onStateChange=e,c.trySubscribe(),e(),function(){return c.tryUnsubscribe()}}),[o,c]),l}(e,o,r.store,r.subscription);return(0,s.useDebugValue)(l),l}}var u=c();t.useSelector=u},function(e,t,o){"use strict";t.__esModule=!0,t.unstable_batchedUpdates=void 0;var s=o(22);t.unstable_batchedUpdates=s.unstable_batchedUpdates},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=o(24),r=o(64),a=s.__importDefault(o(66));t.default=function(e,t){a.default(e,t,r.isDeepEqual)}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isDeepEqual=t.off=t.on=t.isClient=void 0;var s=o(24).__importDefault(o(65));t.isClient="object"==typeof window,t.on=function(e){for(var t=[],o=1;oNumber(e)-Number(t))).map((t=>e[t])):e}function u(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function d(e){const t=(e=u(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function p(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function x(e,t){n((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);const o=function(e){let t;switch(e.arrayFormat){case"index":return(e,o,s)=>{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===s[e]&&(s[e]={}),s[e][t[1]]=o):s[e]=o};case"bracket":return(e,o,s)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==s[e]?s[e]=[].concat(s[e],o):s[e]=[o]:s[e]=o};case"comma":case"separator":return(t,o,s)=>{const r="string"==typeof o&&o.split("").indexOf(e.arrayFormatSeparator)>-1?o.split(e.arrayFormatSeparator).map((t=>i(t,e))):null===o?o:i(o,e);s[t]=r};default:return(e,t,o)=>{void 0!==o[e]?o[e]=[].concat(o[e],t):o[e]=t}}}(t),s=Object.create(null);if("string"!=typeof e)return s;if(!(e=e.trim().replace(/^[?#&]/,"")))return s;for(const r of e.split("&")){let[e,n]=a(t.decode?r.replace(/\+/g," "):r,"=");n=void 0===n?null:["comma","separator"].includes(t.arrayFormat)?n:i(n,t),o(i(e,t),n,s)}for(const e of Object.keys(s)){const o=s[e];if("object"==typeof o&&null!==o)for(const e of Object.keys(o))o[e]=p(o[e],t);else s[e]=p(o,t)}return!1===t.sort?s:(!0===t.sort?Object.keys(s).sort():Object.keys(s).sort(t.sort)).reduce(((e,t)=>{const o=s[t];return Boolean(o)&&"object"==typeof o&&!Array.isArray(o)?e[t]=c(o):e[t]=o,e}),Object.create(null))}t.extract=d,t.parse=x,t.stringify=(e,t)=>{if(!e)return"";n((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);const o=o=>t.skipNull&&null==e[o]||t.skipEmptyString&&""===e[o],s=function(e){switch(e.arrayFormat){case"index":return t=>(o,s)=>{const r=o.length;return void 0===s||e.skipNull&&null===s||e.skipEmptyString&&""===s?o:null===s?[...o,[l(t,e),"[",r,"]"].join("")]:[...o,[l(t,e),"[",l(r,e),"]=",l(s,e)].join("")]};case"bracket":return t=>(o,s)=>void 0===s||e.skipNull&&null===s||e.skipEmptyString&&""===s?o:null===s?[...o,[l(t,e),"[]"].join("")]:[...o,[l(t,e),"[]=",l(s,e)].join("")];case"comma":case"separator":return t=>(o,s)=>null==s||0===s.length?o:0===o.length?[[l(t,e),"=",l(s,e)].join("")]:[[o,l(s,e)].join(e.arrayFormatSeparator)];default:return t=>(o,s)=>void 0===s||e.skipNull&&null===s||e.skipEmptyString&&""===s?o:null===s?[...o,l(t,e)]:[...o,[l(t,e),"=",l(s,e)].join("")]}}(t),r={};for(const t of Object.keys(e))o(t)||(r[t]=e[t]);const a=Object.keys(r);return!1!==t.sort&&a.sort(t.sort),a.map((o=>{const r=e[o];return void 0===r?"":null===r?l(o,t):Array.isArray(r)?r.reduce(s(o),[]).join("&"):l(o,t)+"="+l(r,t)})).filter((e=>e.length>0)).join("&")},t.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);const[o,s]=a(e,"#");return Object.assign({url:o.split("?")[0]||"",query:x(d(e),t)},t&&t.parseFragmentIdentifier&&s?{fragmentIdentifier:i(s,t)}:{})},t.stringifyUrl=(e,o)=>{o=Object.assign({encode:!0,strict:!0},o);const s=u(e.url).split("?")[0]||"",r=t.extract(e.url),a=t.parse(r,{sort:!1}),n=Object.assign(a,e.query);let i=t.stringify(n,o);i&&(i=`?${i}`);let c=function(e){let t="";const o=e.indexOf("#");return-1!==o&&(t=e.slice(o)),t}(e.url);return e.fragmentIdentifier&&(c=`#${l(e.fragmentIdentifier,o)}`),`${s}${i}${c}`}},function(e,t,o){"use strict";e.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`))},function(e,t,o){"use strict";var s="%[a-f0-9]{2}",r=new RegExp("("+s+")|([^%]+?)","gi"),a=new RegExp("("+s+")+","gi");function n(e,t){try{return[decodeURIComponent(e.join(""))]}catch(e){}if(1===e.length)return e;t=t||1;var o=e.slice(0,t),s=e.slice(t);return Array.prototype.concat.call([],n(o),n(s))}function l(e){try{return decodeURIComponent(e)}catch(s){for(var t=e.match(r)||[],o=1;o{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];const o=e.indexOf(t);return-1===o?[e]:[e.slice(0,o),e.slice(o+t.length)]}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSelector=void 0,t.createSelectorCreator=r,t.createStructuredSelector=void 0,Object.defineProperty(t,"defaultEqualityCheck",{enumerable:!0,get:function(){return s.defaultEqualityCheck}}),Object.defineProperty(t,"defaultMemoize",{enumerable:!0,get:function(){return s.defaultMemoize}});var s=o(72);function r(e){for(var t=arguments.length,o=new Array(t>1?t-1:0),s=1;s-1){var a=o[r];return r>0&&(o.splice(r,1),o.unshift(a)),a.value}return s}return{get:r,put:function(t,a){r(t)===s&&(o.unshift({key:t,value:a}),o.length>e&&o.pop())},getEntries:function(){return o},clear:function(){o=[]}}}(d,x);function m(){var t=f.get(arguments);if(t===s){if(t=e.apply(null,arguments),p){var o=f.getEntries().find((function(e){return p(e.value,t)}));o&&(t=o.value)}f.put(arguments,t)}return t}return m.clearCache=function(){return f.clear()},m};var s="NOT_FOUND",r=function(e,t){return e===t};function a(e){return function(t,o){if(null===t||null===o||t.length!==o.length)return!1;for(var s=t.length,r=0;r{u=e},p=e=>({text:c.i18n.translate("xpack.crossClusterReplication.homeBreadcrumbTitle",{defaultMessage:"Cross-Cluster Replication"}),href:e||"/"}),x={text:c.i18n.translate("xpack.crossClusterReplication.addBreadcrumbTitle",{defaultMessage:"Add"})},f={text:c.i18n.translate("xpack.crossClusterReplication.editBreadcrumbTitle",{defaultMessage:"Edit"})};let m;const j=e=>{m=e.links};var b=o(21),g=o(31),h=o.n(g);const w={services:{}},O=Object(s.createContext)(w);var F=o(63),C=o.n(F),E=o(15);const M=({children:e,component:t,render:o,...a})=>{const n=Object(s.useMemo)((()=>{if(t)return e=>Object(E.jsx)(r.a.Fragment,null,Object(E.jsx)(I,null),Object(E.jsx)(t,e))}),[t]);if(n)return Object(E.jsx)(b.Route,h()({},a,{component:n}));if(o||"function"==typeof e){const t="function"==typeof e?e:o;return Object(E.jsx)(b.Route,h()({},a,{render:e=>Object(E.jsx)(r.a.Fragment,null,Object(E.jsx)(I,null),t(e))}))}return Object(E.jsx)(b.Route,a,Object(E.jsx)(I,null),e)},I=()=>{const{executionContext:e}=Object(s.useContext)(O).services,t=Object(b.useRouteMatch)();return function(e,t){C()((()=>(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 P=o(25);const v=({children:e,...t})=>Object(E.jsx)(b.Router,t,Object(E.jsx)(P.CompatRouter,null,e));var R=o(9);const y=({legacySwitch:e=!0,children:t})=>{const o=Object(b.useRouteMatch)();return e?Object(E.jsx)(b.Switch,null,t):Object(E.jsx)(P.Routes,null,s.Children.map(t,(e=>{if(r.a.isValidElement(e)&&e.type===M){var s;const a=Object(R.replace)(null==e?void 0:e.props.path,o.url+"/",""),n="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(E.jsx)(P.Route,{path:a,element:Object(E.jsx)(r.a.Fragment,null,Object(E.jsx)(I,null),(null==e||null===(s=e.props)||void 0===s?void 0:s.component)&&Object(E.jsx)(e.props.component,null)||n&&n()||t)})}return e})))};var _=o(17),S=o(16),T=o(8),L=o(29),k=o.n(L),A=o(67),D=o(0);const N=(e,t=!1)=>{if(e)return`?${Object(A.stringify)(e,{sort:!1,encode:t})}`},B=new class routing_Routing{constructor(){k()(this,"_reactRouter",null),k()(this,"getAutoFollowPatternPath",((e,t="/edit")=>encodeURI(`/auto_follow_patterns${t}/${encodeURIComponent(e)}`))),k()(this,"getFollowerIndexPath",((e,t="/edit")=>encodeURI(`/follower_indices${t}/${encodeURIComponent(e)}`)))}getHrefToRemoteClusters(e="/",t,o=!1){const s=N(t,o)||"";return this._reactRouter.getUrlForApp("management",{path:`${D.d}${e}${s}`})}navigate(e="/home",t,o=!1){const s=N(t,o);this._reactRouter.history.push({pathname:encodeURI(e),search:s})}get reactRouter(){return this._reactRouter}set reactRouter(e){this._reactRouter=e}};var q=o(7),z=o(1),U=o(71);const W=e=>Object.keys(e).map((t=>({...e[t],__id__:t}))),V=(e,t="id")=>e.reduce(((e,o)=>(e[o[t]]=o,e)),{}),$=e=>e.api,G=e=>Object(U.createSelector)($,(t=>t.status[e]||z.a.IDLE)),H=e=>Object(U.createSelector)($,(t=>t.error[e])),Y=e=>Object(U.createSelector)(H(e),(e=>!e||403!==e.status)),X=Object(U.createSelector)((e=>e.stats),(e=>e.autoFollow)),K=e=>e.autoFollowPattern,Q=Object(U.createSelector)(K,(e=>e.byId)),J=(e="detail")=>Object(U.createSelector)(K,(t=>"detail"===e?t.selectedDetailId:t.selectedEditId)),Z=(e="detail")=>Object(U.createSelector)(K,X,((t,o)=>{const s="detail"===e?"selectedDetailId":"selectedEditId";if(!t[s])return null;const r=t[s],a=t.byId[r],n=o&&o.recentAutoFollowErrors[r]||[];return a?{...a,errors:n}:null})),ee=Object(U.createSelector)(Q,(e=>W(e))),te=e=>e.followerIndex,oe=Object(U.createSelector)(te,(e=>e.byId)),se=(e="detail")=>Object(U.createSelector)(te,(t=>"detail"===e?t.selectedDetailId:t.selectedEditId)),re=(e="detail")=>Object(U.createSelector)(te,(t=>{const o="detail"===e?"selectedDetailId":"selectedEditId";return t[o]?t.byId[t[o]]:null})),ae=Object(U.createSelector)(oe,(e=>W(e))),ne="API_REQUEST_START",le="API_REQUEST_END",ie="API_ERROR_SET",ce="AUTO_FOLLOW_PATTERN_SELECT_DETAIL",ue="AUTO_FOLLOW_PATTERN_SELECT_EDIT",de="AUTO_FOLLOW_PATTERN_LOAD",pe="AUTO_FOLLOW_PATTERN_GET",xe="AUTO_FOLLOW_PATTERN_DELETE",fe="AUTO_FOLLOW_PATTERN_PAUSE",me="AUTO_FOLLOW_PATTERN_RESUME",je="FOLLOWER_INDEX_SELECT_DETAIL",be="FOLLOWER_INDEX_SELECT_EDIT",ge="FOLLOWER_INDEX_LOAD",he="FOLLOWER_INDEX_GET",we="FOLLOWER_INDEX_UNFOLLOW",Oe="AUTO_FOLLOW_STATS_LOAD",Fe=({label:e,scope:t})=>({type:le,payload:{label:e,scope:t}}),Ce=e=>({type:ie,payload:{error:null,scope:e}}),Ee=({label:e,scope:t,status:o,handler:s,onSuccess:r=(()=>{}),onError:a=(()=>{})})=>async(n,l)=>{n(Ce(t)),n((({label:e,scope:t,status:o=z.a.LOADING})=>({type:ne,payload:{label:e,scope:t,status:o}}))({label:e,scope:t,status:o}));try{const o=await s(n);n(Fe({label:e,scope:t})),n({type:`${e}_SUCCESS`,payload:o}),r(o,n,l)}catch(o){n(Fe({label:e,scope:t})),n((({error:e,scope:t})=>({type:ie,payload:{error:e,scope:t}}))({error:o,scope:t})),n({type:`${e}_FAILURE`,payload:o}),a(o,n,l)}},{AUTO_FOLLOW_PATTERN:Me}=z.b,Ie=e=>({type:ce,payload:e}),Pe=(e,t,o=!1)=>Ee({label:o?"AUTO_FOLLOW_PATTERN_UPDATE":"AUTO_FOLLOW_PATTERN_CREATE",status:z.a.SAVING,scope:`${Me}-save`,handler:async()=>o?await Object(q.r)(e,t):await Object(q.a)({id:e,...t}),onSuccess(){const t=o?c.i18n.translate("xpack.crossClusterReplication.autoFollowPattern.updateAction.successNotificationTitle",{defaultMessage:"Auto-follow pattern '{name}' updated successfully",values:{name:e}}):c.i18n.translate("xpack.crossClusterReplication.autoFollowPattern.addAction.successNotificationTitle",{defaultMessage:"Added auto-follow pattern '{name}'",values:{name:e}});Object(T.b)().addSuccess(t),B.navigate("/auto_follow_patterns",{pattern:encodeURIComponent(e)})}}),ve=e=>Ee({label:fe,scope:`${Me}-pause`,status:z.a.UPDATING,handler:()=>Object(q.l)(e),onSuccess:e=>{if(e.errors.length){const t=e.errors.length>1?c.i18n.translate("xpack.crossClusterReplication.autoFollowPattern.pauseAction.errorMultipleNotificationTitle",{defaultMessage:"Error pausing {count} auto-follow patterns",values:{count:e.errors.length}}):c.i18n.translate("xpack.crossClusterReplication.autoFollowPattern.pauseAction.errorSingleNotificationTitle",{defaultMessage:"Error pausing the '{name}' auto-follow pattern",values:{name:e.errors[0].id}});Object(T.b)().addDanger(t)}if(e.itemsPaused.length){const t=e.itemsPaused.length>1?c.i18n.translate("xpack.crossClusterReplication.autoFollowPattern.pauseAction.successMultipleNotificationTitle",{defaultMessage:"{count} auto-follow patterns were paused",values:{count:e.itemsPaused.length}}):c.i18n.translate("xpack.crossClusterReplication.autoFollowPattern.pauseAction.successSingleNotificationTitle",{defaultMessage:"Auto-follow pattern '{name}' was paused",values:{name:e.itemsPaused[0]}});Object(T.b)().addSuccess(t)}}}),Re=e=>Ee({label:me,scope:`${Me}-resume`,status:z.a.UPDATING,handler:()=>Object(q.n)(e),onSuccess:e=>{if(e.errors.length){const t=e.errors.length>1?c.i18n.translate("xpack.crossClusterReplication.autoFollowPattern.resumeAction.errorMultipleNotificationTitle",{defaultMessage:"Error resuming {count} auto-follow patterns",values:{count:e.errors.length}}):c.i18n.translate("xpack.crossClusterReplication.autoFollowPattern.resumeAction.errorSingleNotificationTitle",{defaultMessage:"Error resuming the '{name}' auto-follow pattern",values:{name:e.errors[0].id}});Object(T.b)().addDanger(t)}if(e.itemsResumed.length){const t=e.itemsResumed.length>1?c.i18n.translate("xpack.crossClusterReplication.autoFollowPattern.resumeAction.successMultipleNotificationTitle",{defaultMessage:"{count} auto-follow patterns were resumed",values:{count:e.itemsResumed.length}}):c.i18n.translate("xpack.crossClusterReplication.autoFollowPattern.resumeAction.successSingleNotificationTitle",{defaultMessage:"Auto-follow pattern '{name}' was resumed",values:{name:e.itemsResumed[0]}});Object(T.b)().addSuccess(t)}}}),{FOLLOWER_INDEX:ye}=z.b,_e=e=>({type:je,payload:e}),Se=(e=!1)=>Ee({label:ge,scope:ye,status:e?z.a.UPDATING:z.a.LOADING,handler:async()=>await Object(q.h)(e)}),Te=(e,t,o=!1)=>Ee({label:"FOLLOWER_INDEX_CREATE",status:z.a.SAVING,scope:`${ye}-save`,handler:async()=>o?await Object(q.s)(e,t):await Object(q.b)({name:e,...t}),onSuccess(){const t=o?c.i18n.translate("xpack.crossClusterReplication.followerIndex.updateAction.successNotificationTitle",{defaultMessage:"Follower index '{name}' updated successfully",values:{name:e}}):c.i18n.translate("xpack.crossClusterReplication.followerIndex.addAction.successNotificationTitle",{defaultMessage:"Added follower index '{name}'",values:{name:e}});Object(T.b)().addSuccess(t),B.navigate("/follower_indices",{name:encodeURIComponent(e)})}}),{CCR_STATS:Le}=z.b;var ke=o(2);function Ae(e){var t;const{title:o,error:r,...a}=e,n=r.body?r.body:r,{error:l,attributes:i,message:c}=n;return Object(E.jsx)(S.EuiCallOut,h()({title:o,color:"danger",iconType:"warning"},a),Object(E.jsx)("div",null,c||l),(null==i||null===(t=i.error)||void 0===t?void 0:t.root_cause)&&Object(E.jsx)(s.Fragment,null,Object(E.jsx)(S.EuiSpacer,{size:"m"}),Object(E.jsx)("ul",null,i.error.root_cause.map((({type:e,reason:t},o)=>Object(E.jsx)("li",{key:o},e,": ",t))))))}class remote_clusters_provider_RemoteClustersProvider extends s.PureComponent{constructor(...e){super(...e),k()(this,"state",{isLoading:!0,error:null,remoteClusters:[]})}componentDidMount(){this.loadRemoteClusters()}loadRemoteClusters(){Object(q.k)().then((e=>e.sort(((e,t)=>e.namet.name?1:0)))).then((e=>{this.setState({isLoading:!1,remoteClusters:e})})).catch((e=>{this.setState({isLoading:!1,error:e})}))}render(){const{children:e}=this.props,{isLoading:t,error:o,remoteClusters:s}=this.state;return e({isLoading:t,error:o,remoteClusters:s})}}var De=o(26);const Ne=(e,t)=>t&&e.some((e=>e.name===t))?t:(e=>{for(let t=0;t{const{indicesPreview:s}=(({prefix:e,suffix:t,leaderIndexPatterns:o,limit:s=5,wildcardPlaceHolders:r=[qe()().format("YYYY-MM-DD"),qe()().add(1,"days").format("YYYY-MM-DD"),qe()().add(2,"days").format("YYYY-MM-DD")]})=>{const a=[];let n,l;return o.forEach((o=>{r.forEach((s=>{l=o.replace(/\*/g,s),n=((e="",t="",o="{{leader_index}}")=>({followPattern:{prefix:e,suffix:t,template:o},toString:e+o+t}))(e,t,l),a.some((e=>n.toString===e.toString))||a.push(n)}))})),{indicesPreview:a.slice(0,s),hasMore:a.length>s}})({prefix:e,suffix:t,leaderIndexPatterns:o}),r=c.i18n.translate("xpack.crossClusterReplication.autoFollowPatternForm.indicesPreviewTitle",{defaultMessage:"Index name examples"});return Object(E.jsx)(S.EuiCallOut,{title:r,iconType:"indexMapping","data-test-subj":"autoFollowPatternIndicesPreview"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternForm.indicesPreviewDescription",defaultMessage:"The above settings will generate index names that look like this:"}),Object(E.jsx)("ul",null,s.map((({followPattern:{prefix:e,suffix:t,template:o}},s)=>Object(E.jsx)("li",{key:s,"data-test-subj":"indexPreview"},e,Object(E.jsx)("strong",null,o),t)))))},Ue={noClusterFound:()=>Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.remoteClustersFormField.emptyRemoteClustersCallOutDescription",defaultMessage:"You need at least one remote cluster to create a follower index."}),remoteClusterNotConnectedEditable:e=>({title:Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.remoteClustersFormField.currentRemoteClusterNotConnectedCallOutTitle",defaultMessage:"Remote cluster '{name}' is not connected",values:{name:e}}),description:Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.remoteClustersFormField.currentRemoteClusterNotConnectedCallOutDescription",defaultMessage:"Edit the remote cluster or select a cluster that is connected."})})};class remote_clusters_form_field_RemoteClustersFormField extends s.PureComponent{constructor(...e){super(...e),k()(this,"errorMessages",{...Ue,...this.props.errorMessages}),k()(this,"onRemoteClusterChange",(e=>{const{onChange:t,onError:o}=this.props,{error:s}=this.validateRemoteCluster(e);t(e),o(s)})),k()(this,"renderNotEditable",(()=>{const{areErrorsVisible:e}=this.props,t=this.renderErrorMessage();return Object(E.jsx)(s.Fragment,null,Object(E.jsx)(S.EuiFieldText,{value:this.props.selected,fullWidth:!0,disabled:!0,isInvalid:e&&Boolean(t),"data-test-subj":"remoteClusterInput"}),e&&Boolean(t)?this.renderValidRemoteClusterRequired():null,t)})),k()(this,"renderValidRemoteClusterRequired",(()=>Object(E.jsx)(S.EuiFormErrorText,null,Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.remoteClustersFormField.validRemoteClusterRequired",defaultMessage:"A connected remote cluster is required."})))),k()(this,"renderDropdown",(()=>{const{remoteClusters:e,selected:t,currentUrl:o,areErrorsVisible:r}=this.props,a=Boolean(e.length),n=a?e.map((({name:e,isConnected:t})=>({value:e,text:t?e:c.i18n.translate("xpack.crossClusterReplication.remoteClustersFormField.remoteClusterDropdownNotConnected",{defaultMessage:"{name} (not connected)",values:{name:e}}),"data-test-subj":`option-${e}`}))):[],l=this.renderErrorMessage();return Object(E.jsx)(s.Fragment,null,Object(E.jsx)(S.EuiSelect,{fullWidth:!0,options:n,value:a?t:"",onChange:e=>{this.onRemoteClusterChange(e.target.value)},hasNoInitialSelection:!a,isInvalid:r&&Boolean(l),"data-test-subj":"remoteClusterSelect"}),r&&Boolean(l)?this.renderValidRemoteClusterRequired():null,l,Object(E.jsx)(S.EuiSpacer,{size:"s"}),Object(E.jsx)("div",null," ",Object(E.jsx)(S.EuiButtonEmpty,{href:B.getHrefToRemoteClusters("/add",{redirect:`/data/cross_cluster_replication${o}`},!0),size:"s",iconType:"plusInCircle",flush:"left","data-test-subj":"addButton"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.remoteClustersFormField.addRemoteClusterButtonLabel",defaultMessage:"Add remote cluster"}))))})),k()(this,"renderNoClusterFound",(()=>{const{currentUrl:e}=this.props,t=c.i18n.translate("xpack.crossClusterReplication.remoteClustersFormField.emptyRemoteClustersCallOutTitle",{defaultMessage:"You don't have any remote clusters"});return Object(E.jsx)(s.Fragment,null,Object(E.jsx)(S.EuiCallOut,{title:t,color:"danger",iconType:"cross","data-test-subj":"noClusterFoundError"},Object(E.jsx)("p",null,this.errorMessages.noClusterFound()),Object(E.jsx)(S.EuiButton,{href:B.getHrefToRemoteClusters("/add",{redirect:`/data/cross_cluster_replication${e}`},!0),iconType:"plusInCircle",color:"danger","data-test-subj":"addButton"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.remoteClustersFormField.addRemoteClusterButtonLabel",defaultMessage:"Add remote cluster"}))))})),k()(this,"renderCurrentRemoteClusterNotConnected",((e,t)=>{const{isEditable:o,currentUrl:s}=this.props,{remoteClusterNotConnectedEditable:r,remoteClusterNotConnectedNotEditable:a}=this.errorMessages,{title:n,description:l}=o?r(e):a(e);return Object(E.jsx)(S.EuiCallOut,{title:n,color:t?"danger":"warning",iconType:"cross","data-test-subj":"notConnectedError"},Object(E.jsx)("p",null,l),Object(E.jsx)(S.EuiButton,{href:B.getHrefToRemoteClusters(`/edit/${e}`,{redirect:`/data/cross_cluster_replication${s}`},!0),color:t?"danger":"warning","data-test-subj":"editButton"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.remoteClustersFormField.viewRemoteClusterButtonLabel",defaultMessage:"Edit remote cluster"})))})),k()(this,"renderRemoteClusterDoesNotExist",(e=>{const{currentUrl:t}=this.props,o=c.i18n.translate("xpack.crossClusterReplication.remoteClustersFormField.remoteClusterNotFoundTitle",{defaultMessage:"Couldn't find remote cluster '{name}'",values:{name:e}});return Object(E.jsx)(S.EuiCallOut,{title:o,color:"danger",iconType:"cross"},Object(E.jsx)("p",null,this.errorMessages.remoteClusterDoesNotExist(e)),Object(E.jsx)(S.EuiButton,{href:B.getHrefToRemoteClusters("/add",{redirect:`/data/cross_cluster_replication${t}`},!0),iconType:"plusInCircle",color:"danger","data-test-subj":"addButton"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.remoteClustersFormField.addRemoteClusterButtonLabel",defaultMessage:"Add remote cluster"})))})),k()(this,"renderErrorMessage",(()=>{const{selected:e,remoteClusters:t,isEditable:o}=this.props,r=t.find((t=>t.name===e)),a=r&&r.isConnected;let n;if(o){const o=Boolean(t.length);o&&!a?n=this.renderCurrentRemoteClusterNotConnected(e):o||(n=this.renderNoClusterFound())}else r?a||(n=this.renderCurrentRemoteClusterNotConnected(e,!0)):n=this.renderRemoteClusterDoesNotExist(e);return n?Object(E.jsx)(s.Fragment,null,Object(E.jsx)(S.EuiSpacer,{size:"s"}),n):null}))}componentDidMount(){const{selected:e,onError:t}=this.props,{error:o}=this.validateRemoteCluster(e);t(o)}validateRemoteCluster(e){const{remoteClusters:t}=this.props,o=t.find((t=>t.name===e));return o&&o.isConnected?{error:null}:{error:{message:Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.remoteClustersFormField.invalidRemoteClusterError",defaultMessage:"Invalid remote cluster"})}}}render(){const{remoteClusters:e,selected:t,isEditable:o,areErrorsVisible:s}=this.props,r=e.find((e=>e.name===t)),a=Boolean(e.length),n=r&&r.isConnected,l=s&&(!a||!n);let i;return i=o?a?this.renderDropdown():this.renderErrorMessage():this.renderNotEditable(),Object(E.jsx)(S.EuiFormRow,{label:Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.remoteClustersFormField.fieldClusterLabel",defaultMessage:"Remote cluster"}),isInvalid:l,fullWidth:!0,"data-test-subj":"remoteClusterFormField"},i)}}const{indexNameBeginsWithPeriod:We,findIllegalCharactersInIndexName:Ve,indexNameContainsSpaces:$e}=l.indices,Ge=(e={})=>{const t={};let o,s=null;return Object.keys(e).forEach((r=>{switch(o=e[r],s=null,r){case"name":s=((e="")=>{let t=null;return e&&e.trim()?(e.includes(" ")&&(t=c.i18n.translate("xpack.crossClusterReplication.autoFollowPattern.nameValidation.errorSpace",{defaultMessage:"Spaces are not allowed in the name."})),"_"===e[0]&&(t=c.i18n.translate("xpack.crossClusterReplication.autoFollowPattern.nameValidation.errorUnderscore",{defaultMessage:"Name can't begin with an underscore."})),e.includes(",")&&(t=c.i18n.translate("xpack.crossClusterReplication.autoFollowPattern.nameValidation.errorComma",{defaultMessage:"Commas are not allowed in the name."}))):t=c.i18n.translate("xpack.crossClusterReplication.autoFollowPattern.nameValidation.errorEmptyName",{defaultMessage:"Name is required."}),t})(o);break;case"leaderIndexPatterns":s=o.length?null:{message:c.i18n.translate("xpack.crossClusterReplication.autoFollowPattern.leaderIndexPatternValidation.isEmpty",{defaultMessage:"At least one leader index pattern is required."})};break;case"followIndexPatternPrefix":s=(e=>{if(!e||!e.trim())return null;if(We(e))return Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPattern.prefixValidation.beginsWithPeriod",defaultMessage:"The prefix can't begin with a period."});const t=Ve(e);return t.length?Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPattern.prefixValidation.illegalCharacters",defaultMessage:"Remove the {characterListLength, plural, one {character} other {characters}} {characterList} from the prefix.",values:{characterList:Object(E.jsx)("strong",null,t.join(" ")),characterListLength:t.length}}):$e(e)?Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPattern.prefixValidation.noEmptySpace",defaultMessage:"Spaces are not allowed in the prefix."}):null})(o);break;case"followIndexPatternSuffix":s=(e=>{if(!e||!e.trim())return null;const t=Ve(e);return t.length?Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPattern.suffixValidation.illegalCharacters",defaultMessage:"Remove the {characterListLength, plural, one {character} other {characters}} {characterList} from the suffix.",values:{characterList:Object(E.jsx)("strong",null,t.join(" ")),characterListLength:t.length}}):$e(e)?Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPattern.suffixValidation.noEmptySpace",defaultMessage:"Spaces are not allowed in the suffix."}):null})(o)}t[r]=s})),t};class auto_follow_pattern_request_flyout_AutoFollowPatternRequestFlyout extends s.PureComponent{render(){const{name:e,autoFollowPattern:t,close:o,isNew:s}=this.props,r=`PUT /_ccr/auto_follow/${e||""}\n${JSON.stringify((({remoteCluster:e,leaderIndexPatterns:t,followIndexPattern:o})=>({remote_cluster:e,leader_index_patterns:t,follow_index_pattern:o}))(t),null,2)}`;return Object(E.jsx)(S.EuiFlyout,{maxWidth:480,onClose:o},Object(E.jsx)(S.EuiFlyoutHeader,null,Object(E.jsx)(S.EuiTitle,null,Object(E.jsx)("h2",null,e?Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternForm.requestFlyout.namedTitle",defaultMessage:"Request for '{name}'",values:{name:e}}):Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternForm.requestFlyout.unnamedTitle",defaultMessage:"Request"})))),Object(E.jsx)(S.EuiFlyoutBody,null,Object(E.jsx)(S.EuiText,null,Object(E.jsx)("p",null,s?Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternForm.requestFlyout.createDescriptionText",defaultMessage:"This Elasticsearch request will create this auto-follow pattern."}):Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternForm.requestFlyout.editDescriptionText",defaultMessage:"This Elasticsearch request will update this auto-follow pattern."}))),Object(E.jsx)(S.EuiSpacer,null),Object(E.jsx)(S.EuiCodeBlock,{language:"json",isCopyable:!0},r)),Object(E.jsx)(S.EuiFlyoutFooter,null,Object(E.jsx)(S.EuiButtonEmpty,{iconType:"cross",onClick:o,flush:"left"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternForm.requestFlyout.closeButtonLabel",defaultMessage:"Close"}))))}}const He=De.indexPatterns.ILLEGAL_CHARACTERS_VISIBLE.join(" "),Ye=l.indices.INDEX_ILLEGAL_CHARACTERS_VISIBLE.join(" "),Xe=(e,t)=>({fieldsErrors:{...t,...e}});class auto_follow_pattern_form_AutoFollowPatternForm extends s.PureComponent{constructor(e){super(e),k()(this,"toggleRequest",(()=>{this.setState((({isRequestVisible:e})=>({isRequestVisible:!e})))})),k()(this,"onFieldsChange",(e=>{this.setState((({autoFollowPattern:t})=>({autoFollowPattern:{...t,...e}})));const t=Ge(e);this.onFieldsErrorChange(t)})),k()(this,"onFieldsErrorChange",(e=>this.setState((({fieldsErrors:t})=>Xe(e,t))))),k()(this,"onClusterChange",(e=>{this.onFieldsChange({remoteCluster:e})})),k()(this,"onCreateLeaderIndexPattern",(e=>{const t=(e=>{if(e){const t=De.indexPatterns.validate(e);if(t[De.indexPatterns.ILLEGAL_CHARACTERS_KEY])return{message:Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPattern.leaderIndexPatternValidation.illegalCharacters",defaultMessage:"Remove the {characterListLength, plural, one {character} other {characters}} {characterList} from the index pattern.",values:{characterList:Object(E.jsx)("strong",null,t[De.indexPatterns.ILLEGAL_CHARACTERS_KEY].join(" ")),characterListLength:t[De.indexPatterns.ILLEGAL_CHARACTERS_KEY].length}})};if(t[De.indexPatterns.CONTAINS_SPACES_KEY])return{message:Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPattern.leaderIndexPatternValidation.noEmptySpace",defaultMessage:"Spaces are not allowed in the index pattern."})}}return e&&e.trim()?null:{message:c.i18n.translate("xpack.crossClusterReplication.autoFollowPattern.leaderIndexPatternValidation.isEmpty",{defaultMessage:"At least one leader index pattern is required."})}})(e);if(t){const e={leaderIndexPatterns:{...t,alwaysVisible:!0}};return this.setState((({fieldsErrors:t})=>Xe(e,t))),!1}const{autoFollowPattern:{leaderIndexPatterns:o}}=this.state,s=[...o,e];this.onFieldsChange({leaderIndexPatterns:s})})),k()(this,"onLeaderIndexPatternChange",(e=>{this.onFieldsChange({leaderIndexPatterns:e.map((({label:e})=>e))})})),k()(this,"onLeaderIndexPatternInputChange",(e=>{const t=!e||!e.trim(),{autoFollowPattern:{leaderIndexPatterns:o}}=this.state;if(!t&&o.includes(e)){const e={leaderIndexPatterns:{message:c.i18n.translate("xpack.crossClusterReplication.autoFollowPatternForm.leaderIndexPatternError.duplicateMessage",{defaultMessage:"Duplicate leader index pattern aren't allowed."}),alwaysVisible:!0}};this.setState((({fieldsErrors:t})=>Xe(e,t)))}else this.setState((({fieldsErrors:t,autoFollowPattern:{leaderIndexPatterns:o}})=>{const s=Boolean(o.length)?Ge({leaderIndexPatterns:o}):Ge({leaderIndexPatterns:[e]});return Xe(s,t)}))})),k()(this,"getFields",(()=>{const{autoFollowPattern:e}=this.state,{followIndexPatternPrefix:t,followIndexPatternSuffix:o,...s}=e;return{...s,followIndexPattern:`${t}{{leader_index}}${o}`}})),k()(this,"sendForm",(()=>{if(!this.isFormValid())return void this.setState({areErrorsVisible:!0});this.setState({areErrorsVisible:!1});const{name:e,...t}=this.getFields();this.props.saveAutoFollowPattern(e,t)})),k()(this,"cancelForm",(()=>{B.navigate("/auto_follow_patterns")})),k()(this,"renderForm",(()=>{const{autoFollowPattern:{name:e,remoteCluster:t,leaderIndexPatterns:o,followIndexPatternPrefix:r,followIndexPatternSuffix:a},isNew:n,areErrorsVisible:l,fieldsErrors:i}=this.state;return Object(E.jsx)(s.Fragment,null,Object(E.jsx)(S.EuiForm,{"data-test-subj":"autoFollowPatternForm"},(()=>{const t=l&&!!i.name;return Object(E.jsx)(S.EuiDescribedFormGroup,{title:Object(E.jsx)(S.EuiTitle,{size:"s"},Object(E.jsx)("h4",null,Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternForm.sectionAutoFollowPatternNameTitle",defaultMessage:"Name"}))),description:Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternForm.sectionAutoFollowPatternNameDescription",defaultMessage:"A unique name for the auto-follow pattern."}),fullWidth:!0},Object(E.jsx)(S.EuiFormRow,{label:Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternForm.autoFollowPatternName.fieldNameLabel",defaultMessage:"Name"}),error:i.name,isInvalid:t,fullWidth:!0},Object(E.jsx)(S.EuiFieldText,{isInvalid:t,value:e,onChange:e=>this.onFieldsChange({name:e.target.value}),fullWidth:!0,disabled:!n,"data-test-subj":"nameInput"})))})(),(()=>{const{remoteClusters:e,currentUrl:o}=this.props,s={noClusterFound:()=>Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternForm.emptyRemoteClustersCallOutDescription",defaultMessage:"Auto-follow patterns capture indices on remote clusters."}),remoteClusterNotConnectedNotEditable:e=>({title:Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternForm.currentRemoteClusterNotConnectedCallOutTitle",defaultMessage:"Can't edit auto-follow pattern because remote cluster '{name}' is not connected",values:{name:e}}),description:Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternForm.currentRemoteClusterNotConnectedCallOutDescription",defaultMessage:"You can address this by editing the remote cluster."})}),remoteClusterDoesNotExist:e=>Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternForm.currentRemoteClusterNotFoundCallOutDescription",defaultMessage:"To edit this auto-follow pattern, you must add a remote cluster named '{name}'.",values:{name:e}})};return Object(E.jsx)(S.EuiDescribedFormGroup,{title:Object(E.jsx)(S.EuiTitle,{size:"s"},Object(E.jsx)("h4",null,Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternForm.sectionRemoteClusterTitle",defaultMessage:"Remote cluster"}))),description:Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternForm.sectionRemoteClusterDescription",defaultMessage:"The remote cluster to replicate leader indices from."}),fullWidth:!0},Object(E.jsx)(remote_clusters_form_field_RemoteClustersFormField,{selected:t||null,remoteClusters:e,currentUrl:o,isEditable:n,areErrorsVisible:l,onChange:this.onClusterChange,onError:e=>this.onFieldsErrorChange({remoteCluster:e}),errorMessages:s}))})(),(()=>{const e=!(!i.leaderIndexPatterns||!i.leaderIndexPatterns.message)&&(i.leaderIndexPatterns.alwaysVisible||l),t=o.map((e=>({label:e})));return Object(E.jsx)(S.EuiDescribedFormGroup,{title:Object(E.jsx)(S.EuiTitle,{size:"s"},Object(E.jsx)("h4",null,Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternForm.sectionLeaderIndexPatternsTitle",defaultMessage:"Leader indices"}))),description:Object(E.jsx)(s.Fragment,null,Object(E.jsx)("p",null,Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternForm.sectionLeaderIndexPatternsDescription1",defaultMessage:"One or more index patterns that identify the indices you want to replicate from the remote cluster. As new indices matching these patterns are created, they are replicated to follower indices on the local cluster."})),Object(E.jsx)("p",null,Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternForm.sectionLeaderIndexPatternsDescription2",defaultMessage:"{note} Indices that already exist are not replicated.",values:{note:Object(E.jsx)("strong",null,Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternForm.sectionLeaderIndexPatternsDescription2.noteLabel",defaultMessage:"Note:"}))}}))),fullWidth:!0},Object(E.jsx)(S.EuiFormRow,{label:Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternForm.fieldLeaderIndexPatternsLabel",defaultMessage:"Index patterns"}),helpText:Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternForm.fieldLeaderIndexPatternsHelpLabel",defaultMessage:"Spaces and the characters {characterList} are not allowed.",values:{characterList:Object(E.jsx)("strong",null,He)}}),isInvalid:e,error:i.leaderIndexPatterns&&i.leaderIndexPatterns.message,fullWidth:!0},Object(E.jsx)(S.EuiComboBox,{noSuggestions:!0,placeholder:c.i18n.translate("xpack.crossClusterReplication.autoFollowPatternForm.fieldLeaderIndexPatternsPlaceholder",{defaultMessage:"Type and then hit ENTER"}),selectedOptions:t,onCreateOption:this.onCreateLeaderIndexPattern,onChange:this.onLeaderIndexPatternChange,onSearchChange:this.onLeaderIndexPatternInputChange,fullWidth:!0,"data-test-subj":"indexPatternInput"})))})(),(()=>{const e=l&&!!i.followIndexPatternPrefix,t=l&&!!i.followIndexPatternSuffix;return Object(E.jsx)(S.EuiDescribedFormGroup,{title:Object(E.jsx)(S.EuiTitle,{size:"s"},Object(E.jsx)("h4",null,Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternForm.sectionAutoFollowPatternTitle",defaultMessage:"Follower indices (optional)"}))),description:Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternForm.sectionAutoFollowPatternDescription",defaultMessage:"A custom prefix or suffix to apply to the names of the follower indices so you can more easily identify replicated indices. By default, a follower index has the same name as the leader index."}),fullWidth:!0},Object(E.jsx)(S.EuiFlexGroup,{gutterSize:"s"},Object(E.jsx)(S.EuiFlexItem,null,Object(E.jsx)(S.EuiFormRow,{label:Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternForm.autoFollowPattern.fieldPrefixLabel",defaultMessage:"Prefix"}),error:i.followIndexPatternPrefix,isInvalid:e,fullWidth:!0},Object(E.jsx)(S.EuiFieldText,{isInvalid:e,value:r,onChange:e=>this.onFieldsChange({followIndexPatternPrefix:e.target.value}),fullWidth:!0,"data-test-subj":"prefixInput"}))),Object(E.jsx)(S.EuiFlexItem,null,Object(E.jsx)(S.EuiFormRow,{label:Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternForm.autoFollowPattern.fieldSuffixLabel",defaultMessage:"Suffix"}),error:i.followIndexPatternSuffix,isInvalid:t,fullWidth:!0},Object(E.jsx)(S.EuiFieldText,{isInvalid:t,value:a,onChange:e=>this.onFieldsChange({followIndexPatternSuffix:e.target.value}),fullWidth:!0,"data-test-subj":"suffixInput"})))),Object(E.jsx)(S.EuiFormHelpText,null,Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternForm.fieldFollowerIndicesHelpLabel",defaultMessage:"Spaces and the characters {characterList} are not allowed.",values:{characterList:Object(E.jsx)("strong",null,Ye)}})),!!o.length&&Object(E.jsx)(s.Fragment,null,Object(E.jsx)(S.EuiSpacer,{size:"m"}),Object(E.jsx)(ze,{prefix:r,suffix:a,leaderIndexPatterns:o})))})()),Object(E.jsx)(S.EuiSpacer,null),(()=>{const{areErrorsVisible:e}=this.state,t=this.isFormValid();return!e||t?null:Object(E.jsx)(s.Fragment,null,Object(E.jsx)(S.EuiCallOut,{title:Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternForm.validationErrorTitle",defaultMessage:"Fix errors before continuing."}),color:"danger",iconType:"cross","data-test-subj":"formError"}),Object(E.jsx)(S.EuiSpacer,{size:"l"}))})(),this.renderApiErrors(),(()=>{const{apiStatus:e,saveButtonLabel:t}=this.props,{areErrorsVisible:o,isRequestVisible:s}=this.state;if(e===z.a.SAVING)return Object(E.jsx)(S.EuiFlexGroup,{justifyContent:"flexStart",gutterSize:"m"},Object(E.jsx)(S.EuiFlexItem,{grow:!1},Object(E.jsx)(S.EuiLoadingSpinner,{size:"l"})),Object(E.jsx)(S.EuiFlexItem,{grow:!1},Object(E.jsx)(S.EuiText,null,Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternForm.actions.savingText",defaultMessage:"Saving"}))));const r=o&&!this.isFormValid();return Object(E.jsx)(S.EuiFlexGroup,{justifyContent:"spaceBetween",alignItems:"center"},Object(E.jsx)(S.EuiFlexGroup,{gutterSize:"m",alignItems:"center"},Object(E.jsx)(S.EuiFlexItem,{grow:!1},Object(E.jsx)(S.EuiButton,{color:"success",iconType:"check",onClick:this.sendForm,fill:!0,disabled:r,"data-test-subj":"submitButton"},t)),Object(E.jsx)(S.EuiFlexItem,{grow:!1},Object(E.jsx)(S.EuiButtonEmpty,{color:"primary",onClick:this.cancelForm},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternForm.cancelButtonLabel",defaultMessage:"Cancel","data-test-subj":"cancelButton"})))),Object(E.jsx)(S.EuiFlexItem,{grow:!1},Object(E.jsx)(S.EuiButtonEmpty,{onClick:this.toggleRequest},s?Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternForm.hideRequestButtonLabel",defaultMessage:"Hide request"}):Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternFormm.showRequestButtonLabel",defaultMessage:"Show request"}))))})())})),k()(this,"renderLoading",(()=>{const{apiStatus:e}=this.props;return e===z.a.SAVING?Object(E.jsx)(S.EuiOverlayMask,null,Object(E.jsx)(S.EuiLoadingLogo,{logo:"logoKibana",size:"xl"})):null}));const t=void 0===this.props.autoFollowPattern,{route:{location:{search:o}}}=B.reactRouter,r=Object(l.extractQueryParams)(o),a=Ne(this.props.remoteClusters,r.cluster),n=t?((e="")=>({name:"",remoteCluster:e,leaderIndexPatterns:[],followIndexPatternPrefix:"",followIndexPatternSuffix:""}))(a):{...this.props.autoFollowPattern};this.state={autoFollowPattern:n,fieldsErrors:Ge(n),areErrorsVisible:!1,isNew:t,isRequestVisible:!1}}isFormValid(){return Object.values(this.state.fieldsErrors).every((e=>null==e))}renderApiErrors(){const{apiError:e}=this.props;if(e){const t=c.i18n.translate("xpack.crossClusterReplication.autoFollowPatternForm.savingErrorTitle",{defaultMessage:"Can't create auto-follow pattern"});return Object(E.jsx)(s.Fragment,null,Object(E.jsx)(Ae,{title:t,error:e,"data-test-subj":"apiError"}),Object(E.jsx)(S.EuiSpacer,{size:"l"}))}return null}render(){const{autoFollowPattern:e,isRequestVisible:t,isNew:o}=this.state;return Object(E.jsx)(s.Fragment,null,this.renderForm(),this.renderLoading(),t?Object(E.jsx)(auto_follow_pattern_request_flyout_AutoFollowPatternRequestFlyout,{name:e.name,autoFollowPattern:this.getFields(),isNew:o,close:()=>this.setState({isRequestVisible:!1})}):null)}}var Ke=o(3);class auto_follow_pattern_delete_provider_AutoFollowPatternDeleteProviderUi extends s.PureComponent{constructor(...e){super(...e),k()(this,"state",{isModalOpen:!1,ids:null}),k()(this,"onMouseOverModal",(e=>{e.stopPropagation()})),k()(this,"deleteAutoFollowPattern",(e=>{this.setState({isModalOpen:!0,ids:Object(Ke.a)(e)})})),k()(this,"onConfirm",(()=>{this.props.deleteAutoFollowPattern(this.state.ids),this.setState({isModalOpen:!1,ids:null})})),k()(this,"closeConfirmModal",(()=>{this.setState({isModalOpen:!1})})),k()(this,"renderModal",(()=>{const{ids:e}=this.state,t=1===e.length,o=t?c.i18n.translate("xpack.crossClusterReplication.deleteAutoFollowPattern.confirmModal.deleteSingleTitle",{defaultMessage:"Remove auto-follow pattern '{name}'?",values:{name:e[0]}}):c.i18n.translate("xpack.crossClusterReplication.deleteAutoFollowPattern.confirmModal.deleteMultipleTitle",{defaultMessage:"Remove {count} auto-follow patterns?",values:{count:e.length}});return Object(E.jsx)(S.EuiConfirmModal,{title:o,onCancel:this.closeConfirmModal,onConfirm:this.onConfirm,cancelButtonText:c.i18n.translate("xpack.crossClusterReplication.deleteAutoFollowPattern.confirmModal.cancelButtonText",{defaultMessage:"Cancel"}),buttonColor:"danger",confirmButtonText:c.i18n.translate("xpack.crossClusterReplication.deleteAutoFollowPattern.confirmModal.confirmButtonText",{defaultMessage:"Remove"}),onMouseOver:this.onMouseOverModal,"data-test-subj":"deleteAutoFollowPatternConfirmation"},!t&&Object(E.jsx)(s.Fragment,null,Object(E.jsx)("p",null,Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.deleteAutoFollowPattern.confirmModal.multipleDeletionDescription",defaultMessage:"You are about to remove these auto-follow patterns:"})),Object(E.jsx)("ul",null,e.map((e=>Object(E.jsx)("li",{key:e},e))))))}))}render(){const{children:e}=this.props,{isModalOpen:t}=this.state;return Object(E.jsx)(s.Fragment,null,e(this.deleteAutoFollowPattern),t&&this.renderModal())}}const Qe=Object(n.connect)(void 0,(e=>({deleteAutoFollowPattern:t=>e((e=>Ee({label:xe,scope:`${Me}-delete`,status:z.a.DELETING,handler:async()=>Object(q.c)(e),onSuccess(e,t,o){if(e.errors.length){const t=e.errors.length>1?c.i18n.translate("xpack.crossClusterReplication.autoFollowPattern.removeAction.errorMultipleNotificationTitle",{defaultMessage:"Error removing {count} auto-follow patterns",values:{count:e.errors.length}}):c.i18n.translate("xpack.crossClusterReplication.autoFollowPattern.removeAction.errorSingleNotificationTitle",{defaultMessage:"Error removing the '{name}' auto-follow pattern",values:{name:e.errors[0].id}});Object(T.b)().addDanger(t)}if(e.itemsDeleted.length){const s=e.itemsDeleted.length>1?c.i18n.translate("xpack.crossClusterReplication.autoFollowPattern.removeAction.successMultipleNotificationTitle",{defaultMessage:"{count} auto-follow patterns were removed",values:{count:e.itemsDeleted.length}}):c.i18n.translate("xpack.crossClusterReplication.autoFollowPattern.removeAction.successSingleNotificationTitle",{defaultMessage:"Auto-follow pattern '{name}' was removed",values:{name:e.itemsDeleted[0]}});Object(T.b)().addSuccess(s);const r=J("detail")(o());e.itemsDeleted.includes(r)&&t(Ie(null))}}}))(t))})))(auto_follow_pattern_delete_provider_AutoFollowPatternDeleteProviderUi),Je=({title:e})=>Object(E.jsx)(r.a.Fragment,null,Object(E.jsx)(S.EuiPageHeader,{bottomBorder:!0,pageTitle:Object(E.jsx)("span",{"data-test-subj":"pageTitle"},e),rightSideItems:[Object(E.jsx)(S.EuiButtonEmpty,{size:"s",flush:"right",href:m.apis.createAutoFollowPattern,target:"_blank",iconType:"help","data-test-subj":"docsButton"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.readDocsAutoFollowPatternButtonLabel",defaultMessage:"Auto-follow pattern docs"}))]}),Object(E.jsx)(S.EuiSpacer,{size:"l"}));var Ze=o(5);class follower_index_pause_provider_FollowerIndexPauseProviderUi extends s.PureComponent{constructor(...e){super(...e),k()(this,"state",{isModalOpen:!1,indices:[]}),k()(this,"onMouseOverModal",(e=>{e.stopPropagation()})),k()(this,"pauseFollowerIndex",(e=>{this.setState({isModalOpen:!0,indices:Object(Ke.a)(e)})})),k()(this,"onConfirm",(()=>{this.props.pauseFollowerIndex(this.state.indices.map((e=>e.name))),this.setState({isModalOpen:!1,indices:[]}),this.props.onConfirm&&this.props.onConfirm()})),k()(this,"closeConfirmModal",(()=>{this.setState({isModalOpen:!1})})),k()(this,"renderModal",(()=>{const{indices:e}=this.state,t=1===e.length,o=t?c.i18n.translate("xpack.crossClusterReplication.pauseFollowerIndex.confirmModal.pauseSingleTitle",{defaultMessage:"Pause replication to follower index '{name}'?",values:{name:e[0].name}}):c.i18n.translate("xpack.crossClusterReplication.pauseFollowerIndex.confirmModal.pauseMultipleTitle",{defaultMessage:"Pause replication to {count} follower indices?",values:{count:e.length}}),r=e.some((e=>!Object(Ze.a)(e)));return Object(E.jsx)(S.EuiConfirmModal,{title:o,onCancel:this.closeConfirmModal,onConfirm:this.onConfirm,cancelButtonText:c.i18n.translate("xpack.crossClusterReplication.pauseFollowerIndex.confirmModal.cancelButtonText",{defaultMessage:"Cancel"}),buttonColor:r?"danger":"primary",confirmButtonText:c.i18n.translate("xpack.crossClusterReplication.pauseFollowerIndex.confirmModal.confirmButtonText",{defaultMessage:"Pause replication"}),onMouseOver:this.onMouseOverModal,"data-test-subj":"pauseReplicationConfirmation"},r&&Object(E.jsx)("p",null,t?Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.pauseFollowerIndex.confirmModal.singlePauseDescriptionWithSettingWarning",defaultMessage:"Pausing replication to this follower index clears its custom advanced settings."}):Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.pauseFollowerIndex.confirmModal.multiplePauseDescriptionWithSettingWarning",defaultMessage:"Pausing replication to a follower index clears its custom advanced settings."})),!t&&Object(E.jsx)(s.Fragment,null,Object(E.jsx)("p",null,Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.pauseFollowerIndex.confirmModal.multiplePauseDescription",defaultMessage:"Replication will pause on these follower indices:"})),Object(E.jsx)("ul",null,e.map((e=>Object(E.jsx)("li",{key:e.name},e.name))))))}))}render(){const{children:e}=this.props,{isModalOpen:t}=this.state;return Object(E.jsx)(s.Fragment,null,e(this.pauseFollowerIndex),t&&this.renderModal())}}const et=Object(n.connect)(void 0,(e=>({pauseFollowerIndex:t=>e((e=>Ee({label:"FOLLOWER_INDEX_PAUSE",status:z.a.SAVING,scope:ye,handler:async()=>Object(q.m)(e),onSuccess(e,t){if(e.errors.length){const t=e.errors.length>1?c.i18n.translate("xpack.crossClusterReplication.followerIndex.pauseAction.errorMultipleNotificationTitle",{defaultMessage:"Error pausing {count} follower indices",values:{count:e.errors.length}}):c.i18n.translate("xpack.crossClusterReplication.followerIndex.pauseAction.errorSingleNotificationTitle",{defaultMessage:"Error pausing follower index '{name}'",values:{name:e.errors[0].id}});Object(T.b)().addDanger(t)}if(e.itemsPaused.length){const o=e.itemsPaused.length>1?c.i18n.translate("xpack.crossClusterReplication.followerIndex.pauseAction.successMultipleNotificationTitle",{defaultMessage:"{count} follower indices were paused",values:{count:e.itemsPaused.length}}):c.i18n.translate("xpack.crossClusterReplication.followerIndex.pauseAction.successSingleNotificationTitle",{defaultMessage:"Follower index '{name}' was paused",values:{name:e.itemsPaused[0]}});Object(T.b)().addSuccess(o),t(Se(!0))}}}))(t))})))(follower_index_pause_provider_FollowerIndexPauseProviderUi);class follower_index_resume_provider_FollowerIndexResumeProviderUi extends s.PureComponent{constructor(...e){super(...e),k()(this,"state",{isModalOpen:!1,ids:null}),k()(this,"onMouseOverModal",(e=>{e.stopPropagation()})),k()(this,"resumeFollowerIndex",(e=>{this.setState({isModalOpen:!0,ids:Object(Ke.a)(e)})})),k()(this,"onConfirm",(()=>{this.props.resumeFollowerIndex(this.state.ids),this.setState({isModalOpen:!1,ids:null}),this.props.onConfirm&&this.props.onConfirm()})),k()(this,"closeConfirmModal",(()=>{this.setState({isModalOpen:!1})})),k()(this,"renderModal",(()=>{const{ids:e}=this.state,t=1===e.length,o=t?c.i18n.translate("xpack.crossClusterReplication.resumeFollowerIndex.confirmModal.resumeSingleTitle",{defaultMessage:"Resume replication to follower index '{name}'?",values:{name:e[0]}}):c.i18n.translate("xpack.crossClusterReplication.resumeFollowerIndex.confirmModal.resumeMultipleTitle",{defaultMessage:"Resume replication to {count} follower indices?",values:{count:e.length}});return Object(E.jsx)(S.EuiConfirmModal,{title:o,onCancel:this.closeConfirmModal,onConfirm:this.onConfirm,cancelButtonText:c.i18n.translate("xpack.crossClusterReplication.resumeFollowerIndex.confirmModal.cancelButtonText",{defaultMessage:"Cancel"}),buttonColor:"primary",confirmButtonText:c.i18n.translate("xpack.crossClusterReplication.resumeFollowerIndex.confirmModal.confirmButtonText",{defaultMessage:"Resume replication"}),onMouseOver:this.onMouseOverModal,"data-test-subj":"resumeReplicationConfirmation"},t?Object(E.jsx)("p",null,Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.resumeFollowerIndex.confirmModal.singleResumeDescription",defaultMessage:"Replication resumes using the default advanced settings. To use custom advanced settings, {editLink}.",values:{editLink:Object(E.jsx)(S.EuiLink,h()({},Object(i.reactRouterNavigate)(B._reactRouter.history,B.getFollowerIndexPath(e[0])),{"data-test-subj":"editLink"}),Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.resumeFollowerIndex.confirmModal.singleResumeEditLink",defaultMessage:"edit the follower index"}))}})):Object(E.jsx)(s.Fragment,null,Object(E.jsx)("p",null,Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.resumeFollowerIndex.confirmModal.multipleResumeDescriptionWithSettingWarning",defaultMessage:"Replication resumes using the default advanced settings."})),Object(E.jsx)("p",null,Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.resumeFollowerIndex.confirmModal.multipleResumeDescription",defaultMessage:"Replication will resume on these follower indices:"})),Object(E.jsx)("ul",null,e.map((e=>Object(E.jsx)("li",{key:e},e))))))}))}render(){const{children:e}=this.props,{isModalOpen:t}=this.state;return Object(E.jsx)(s.Fragment,null,e(this.resumeFollowerIndex),t&&this.renderModal())}}const tt=Object(n.connect)(void 0,(e=>({resumeFollowerIndex:t=>e((e=>Ee({label:"FOLLOWER_INDEX_RESUME",status:z.a.SAVING,scope:ye,handler:async()=>Object(q.o)(e),onSuccess(e,t){if(e.errors.length){const t=e.errors.length>1?c.i18n.translate("xpack.crossClusterReplication.followerIndex.resumeAction.errorMultipleNotificationTitle",{defaultMessage:"Error resuming {count} follower indices",values:{count:e.errors.length}}):c.i18n.translate("xpack.crossClusterReplication.followerIndex.resumeAction.errorSingleNotificationTitle",{defaultMessage:"Error resuming follower index '{name}'",values:{name:e.errors[0].id}});Object(T.b)().addDanger(t)}if(e.itemsResumed.length){const t=e.itemsResumed.length>1?c.i18n.translate("xpack.crossClusterReplication.followerIndex.resumeAction.successMultipleNotificationTitle",{defaultMessage:"{count} follower indices were resumed",values:{count:e.itemsResumed.length}}):c.i18n.translate("xpack.crossClusterReplication.followerIndex.resumeAction.successSingleNotificationTitle",{defaultMessage:"Follower index '{name}' was resumed",values:{name:e.itemsResumed[0]}});Object(T.b)().addSuccess(t)}t(Se(!0))}}))(t))})))(follower_index_resume_provider_FollowerIndexResumeProviderUi);class follower_index_unfollow_provider_FollowerIndexUnfollowProviderUi extends s.PureComponent{constructor(...e){super(...e),k()(this,"state",{isModalOpen:!1,ids:null}),k()(this,"onMouseOverModal",(e=>{e.stopPropagation()})),k()(this,"unfollowLeaderIndex",(e=>{this.setState({isModalOpen:!0,ids:Object(Ke.a)(e)})})),k()(this,"onConfirm",(()=>{this.props.unfollowLeaderIndex(this.state.ids),this.setState({isModalOpen:!1,ids:null}),this.props.onConfirm&&this.props.onConfirm()})),k()(this,"closeConfirmModal",(()=>{this.setState({isModalOpen:!1})})),k()(this,"renderModal",(()=>{const{ids:e}=this.state,t=1===e.length,o=t?c.i18n.translate("xpack.crossClusterReplication.unfollowLeaderIndex.confirmModal.unfollowSingleTitle",{defaultMessage:"Unfollow leader index of '{name}'?",values:{name:e[0]}}):c.i18n.translate("xpack.crossClusterReplication.unfollowLeaderIndex.confirmModal.unfollowMultipleTitle",{defaultMessage:"Unfollow {count} leader indices?",values:{count:e.length}});return Object(E.jsx)(S.EuiConfirmModal,{title:o,onCancel:this.closeConfirmModal,onConfirm:this.onConfirm,cancelButtonText:c.i18n.translate("xpack.crossClusterReplication.unfollowLeaderIndex.confirmModal.cancelButtonText",{defaultMessage:"Cancel"}),buttonColor:"danger",confirmButtonText:c.i18n.translate("xpack.crossClusterReplication.unfollowLeaderIndex.confirmModal.confirmButtonText",{defaultMessage:"Unfollow leader"}),onMouseOver:this.onMouseOverModal,"data-test-subj":"unfollowLeaderConfirmation"},t?Object(E.jsx)(s.Fragment,null,Object(E.jsx)("p",null,Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.unfollowLeaderIndex.confirmModal.singleUnfollowDescription",defaultMessage:"The follower index will be converted to a standard index. It will no longer appear in Cross-Cluster Replication, but you can manage it in Index Management. You can't undo this operation."}))):Object(E.jsx)(s.Fragment,null,Object(E.jsx)("p",null,Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.unfollowLeaderIndex.confirmModal.multipleUnfollowDescription",defaultMessage:"The follower indices will be converted to standard indices. They will no longer appear in Cross-Cluster Replication, but you can manage them in Index Management. You can't undo this operation."})),Object(E.jsx)("ul",null,e.map((e=>Object(E.jsx)("li",{key:e},e))))))}))}render(){const{children:e}=this.props,{isModalOpen:t}=this.state;return Object(E.jsx)(s.Fragment,null,e(this.unfollowLeaderIndex),t&&this.renderModal())}}const ot=Object(n.connect)(void 0,(e=>({unfollowLeaderIndex:t=>e((e=>Ee({label:we,status:z.a.DELETING,scope:`${ye}-delete`,handler:async()=>Object(q.q)(e),onSuccess(e,t,o){if(e.errors.length){const t=e.errors.length>1?c.i18n.translate("xpack.crossClusterReplication.followerIndex.unfollowAction.errorMultipleNotificationTitle",{defaultMessage:"Error unfollowing leader index of {count} follower indices",values:{count:e.errors.length}}):c.i18n.translate("xpack.crossClusterReplication.followerIndex.unfollowAction.errorSingleNotificationTitle",{defaultMessage:"Error unfollowing leader index of follower index '{name}'",values:{name:e.errors[0].id}});Object(T.b)().addDanger(t)}if(e.itemsUnfollowed.length){const t=e.itemsUnfollowed.length>1?c.i18n.translate("xpack.crossClusterReplication.followerIndex.unfollowAction.successMultipleNotificationTitle",{defaultMessage:"Leader indices of {count} follower indices were unfollowed",values:{count:e.itemsUnfollowed.length}}):c.i18n.translate("xpack.crossClusterReplication.followerIndex.unfollowAction.successSingleNotificationTitle",{defaultMessage:"Leader index of follower index '{name}' was unfollowed",values:{name:e.itemsUnfollowed[0]}});Object(T.b)().addSuccess(t)}if(e.itemsNotOpen.length){const t=e.itemsNotOpen.length>1?c.i18n.translate("xpack.crossClusterReplication.followerIndex.unfollowAction.notOpenWarningMultipleNotificationTitle",{defaultMessage:"{count} indices could not be re-opened",values:{count:e.itemsNotOpen.length}}):c.i18n.translate("xpack.crossClusterReplication.followerIndex.unfollowAction.notOpenWarningSingleNotificationTitle",{defaultMessage:"Index '{name}' could not be re-opened",values:{name:e.itemsNotOpen[0]}});Object(T.b)().addWarning(t)}const s=se("detail")(o());e.itemsUnfollowed.includes(s)&&t(_e(null))}}))(t))})))(follower_index_unfollow_provider_FollowerIndexUnfollowProviderUi),st=e=>Object(E.jsx)(et,null,(t=>Object(E.jsx)(tt,null,(o=>Object(E.jsx)(ot,null,(s=>{const{children:r}=e;return r((()=>({pauseFollowerIndex:t,resumeFollowerIndex:o,unfollowLeaderIndex:s})))})))))),rt=e=>!e||!e.trim().length,at=e=>"string"==typeof e&&e.includes(" "),nt=e=>l.indices.INDEX_ILLEGAL_CHARACTERS_VISIBLE.reduce(((t,o)=>(e.includes(o)&&t.push(o),t)),[]),lt=e=>{if(rt(e))return[Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexForm.errors.nameMissingMessage",defaultMessage:"Name is required."})];if((e=>"."===e[0])(e))return[Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexForm.errors.nameBeginsWithPeriodMessage",defaultMessage:"Name can't begin with a period."})];const t=nt(e);return t.length?[Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexForm.errors.nameIllegalCharactersMessage",defaultMessage:"Remove the characters {characterList} from your name.",values:{characterList:Object(E.jsx)("strong",null,t.join(" "))}})]:at(e)?[Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndex.indexNameValidation.noEmptySpace",defaultMessage:"Spaces are not allowed in the name."})]:void 0},it=e=>{if(rt(e))return[Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexForm.errors.leaderIndexMissingMessage",defaultMessage:"Leader index is required."})];const t=nt(e);return t.length?[Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexForm.errors.leaderIndexIllegalCharactersMessage",defaultMessage:"Remove the characters {characterList} from your leader index.",values:{characterList:Object(E.jsx)("strong",null,t.join(" "))}})]:at(e)?[Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndex.leaderIndexValidation.noEmptySpace",defaultMessage:"Spaces are not allowed in the leader index."})]:void 0};class form_entry_row_FormEntryRow extends s.PureComponent{constructor(...e){super(...e),k()(this,"onFieldChange",(e=>{const{field:t,onValueUpdate:o,type:s}=this.props;let r=e;"number"===s&&(r=e?Math.max(0,parseInt(e,10)):e),o({[t]:r})})),k()(this,"renderField",(e=>{const{value:t,type:o,disabled:s,isLoading:r,testSubj:a}=this.props;return"number"===o?Object(E.jsx)(S.EuiFieldNumber,{isInvalid:e,value:t,onChange:e=>this.onFieldChange(e.target.value),disabled:!0===s,isLoading:r,fullWidth:!0,"data-test-subj":a}):Object(E.jsx)(S.EuiFieldText,{isInvalid:e,value:t,onChange:e=>this.onFieldChange(e.target.value),disabled:!0===s,isLoading:r,fullWidth:!0,"data-test-subj":a})}))}render(){const{field:e,error:t,title:o,label:r,description:a,helpText:n,areErrorsVisible:l,value:i,defaultValue:c}=this.props,u=!!t&&(t.alwaysVisible||l),d=void 0!==c,p=i!==c,x=Object(E.jsx)(s.Fragment,null,n,d&&p&&Object(E.jsx)("p",null,Object(E.jsx)(S.EuiLink,{onClick:()=>this.onFieldChange(c)},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexForm.resetFieldButtonLabel",defaultMessage:"Reset to default"}))));return Object(E.jsx)(S.EuiDescribedFormGroup,{title:o,description:a,fullWidth:!0,key:e},Object(E.jsx)(S.EuiFormRow,{label:r,helpText:x,error:t&&t.message?t.message:t,isInvalid:u,fullWidth:!0},this.renderField(u)))}}const ct=e=>{const t=Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexForm.advancedSettings.byteUnitsHelpText",defaultMessage:"Example values: 10b, 1024kb, 1mb, 5gb, 2tb, 1pb. {link}",values:{link:Object(E.jsx)(S.EuiLink,{href:e.apis.byteSizeUnits,target:"_blank"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexForm.advancedSettings.byteUnitsHelpTextLinkMessage",defaultMessage:"Learn more"}))}}),o=Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexForm.advancedSettings.timeUnitsHelpText",defaultMessage:"Example values: 2d, 24h, 20m, 30s, 500ms, 10000micros, 80000nanos. {link}",values:{link:Object(E.jsx)(S.EuiLink,{href:e.apis.timeUnits,target:"_blank"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexForm.advancedSettings.timeUnitsHelpTextLinkMessage",defaultMessage:"Learn more"}))}});return[{field:"maxReadRequestOperationCount",testSubject:"maxReadRequestOperationCountInput",title:c.i18n.translate("xpack.crossClusterReplication.followerIndexForm.advancedSettings.maxReadRequestOperationCountTitle",{defaultMessage:"Max read request operation count"}),description:c.i18n.translate("xpack.crossClusterReplication.followerIndexForm.advancedSettings.maxReadRequestOperationCountDescription",{defaultMessage:"The maximum number of operations to pull per read from the remote cluster."}),label:c.i18n.translate("xpack.crossClusterReplication.followerIndexForm.advancedSettings.maxReadRequestOperationCountLabel",{defaultMessage:"Max read request operation count"}),defaultValue:Object(Ze.b)("maxReadRequestOperationCount"),type:"number"},{field:"maxOutstandingReadRequests",testSubject:"maxOutstandingReadRequestsInput",title:c.i18n.translate("xpack.crossClusterReplication.followerIndexForm.advancedSettings.maxOutstandingReadRequestsTitle",{defaultMessage:"Max outstanding read requests"}),description:c.i18n.translate("xpack.crossClusterReplication.followerIndexForm.advancedSettings.maxOutstandingReadRequestsDescription",{defaultMessage:"The maximum number of outstanding read requests from the remote cluster."}),label:c.i18n.translate("xpack.crossClusterReplication.followerIndexForm.advancedSettings.maxOutstandingReadRequestsLabel",{defaultMessage:"Max outstanding read requests"}),defaultValue:Object(Ze.b)("maxOutstandingReadRequests"),type:"number"},{field:"maxReadRequestSize",testSubject:"maxReadRequestSizeInput",title:c.i18n.translate("xpack.crossClusterReplication.followerIndexForm.advancedSettings.maxReadRequestSizeTitle",{defaultMessage:"Max read request size"}),description:c.i18n.translate("xpack.crossClusterReplication.followerIndexForm.advancedSettings.maxReadRequestSizeDescription",{defaultMessage:"The maximum size in bytes of per read of a batch of operations pulled from the remote cluster."}),label:c.i18n.translate("xpack.crossClusterReplication.followerIndexForm.advancedSettings.maxReadRequestSizeLabel",{defaultMessage:"Max read request size"}),defaultValue:Object(Ze.b)("maxReadRequestSize"),helpText:t},{field:"maxWriteRequestOperationCount",testSubject:"maxWriteRequestOperationCountInput",title:c.i18n.translate("xpack.crossClusterReplication.followerIndexForm.advancedSettings.maxWriteRequestOperationCountTitle",{defaultMessage:"Max write request operation count"}),description:c.i18n.translate("xpack.crossClusterReplication.followerIndexForm.advancedSettings.maxWriteRequestOperationCountDescription",{defaultMessage:"The maximum number of operations per bulk write request executed on the follower."}),label:c.i18n.translate("xpack.crossClusterReplication.followerIndexForm.advancedSettings.maxWriteRequestOperationCountLabel",{defaultMessage:"Max write request operation count"}),defaultValue:Object(Ze.b)("maxWriteRequestOperationCount"),type:"number"},{field:"maxWriteRequestSize",testSubject:"maxWriteRequestSizeInput",title:c.i18n.translate("xpack.crossClusterReplication.followerIndexForm.advancedSettings.maxWriteRequestSizeTitle",{defaultMessage:"Max write request size"}),description:c.i18n.translate("xpack.crossClusterReplication.followerIndexForm.advancedSettings.maxWriteRequestSizeDescription",{defaultMessage:"The maximum total bytes of operations per bulk write request executed on the follower."}),label:c.i18n.translate("xpack.crossClusterReplication.followerIndexForm.advancedSettings.maxWriteRequestSizeLabel",{defaultMessage:"Max write request size"}),defaultValue:Object(Ze.b)("maxWriteRequestSize"),helpText:t},{field:"maxOutstandingWriteRequests",testSubject:"maxOutstandingWriteRequestsInput",title:c.i18n.translate("xpack.crossClusterReplication.followerIndexForm.advancedSettings.maxOutstandingWriteRequestsTitle",{defaultMessage:"Max outstanding write requests"}),description:c.i18n.translate("xpack.crossClusterReplication.followerIndexForm.advancedSettings.maxOutstandingWriteRequestsDescription",{defaultMessage:"The maximum number of outstanding write requests on the follower."}),label:c.i18n.translate("xpack.crossClusterReplication.followerIndexForm.advancedSettings.maxOutstandingWriteRequestsLabel",{defaultMessage:"Max outstanding write requests"}),defaultValue:Object(Ze.b)("maxOutstandingWriteRequests"),type:"number"},{field:"maxWriteBufferCount",testSubject:"maxWriteBufferCountInput",title:c.i18n.translate("xpack.crossClusterReplication.followerIndexForm.advancedSettings.maxWriteBufferCountTitle",{defaultMessage:"Max write buffer count"}),description:c.i18n.translate("xpack.crossClusterReplication.followerIndexForm.advancedSettings.maxWriteBufferCountDescription",{defaultMessage:"The maximum number of operations that can be queued for writing; when this limit is reached, reads from the remote cluster will be deferred until the number of queued operations goes below the limit."}),label:c.i18n.translate("xpack.crossClusterReplication.followerIndexForm.advancedSettings.maxWriteBufferCountLabel",{defaultMessage:"Max write buffer count"}),defaultValue:Object(Ze.b)("maxWriteBufferCount"),type:"number"},{field:"maxWriteBufferSize",testSubject:"maxWriteBufferSizeInput",title:c.i18n.translate("xpack.crossClusterReplication.followerIndexForm.advancedSettings.maxWriteBufferSizeTitle",{defaultMessage:"Max write buffer size"}),description:c.i18n.translate("xpack.crossClusterReplication.followerIndexForm.advancedSettings.maxWriteBufferSizeDescription",{defaultMessage:"The maximum total bytes of operations that can be queued for writing; when this limit is reached, reads from the remote cluster will be deferred until the total bytes of queued operations goes below the limit."}),label:c.i18n.translate("xpack.crossClusterReplication.followerIndexForm.advancedSettings.maxWriteBufferSizeLabel",{defaultMessage:"Max write buffer size"}),defaultValue:Object(Ze.b)("maxWriteBufferSize"),helpText:t},{field:"maxRetryDelay",testSubject:"maxRetryDelayInput",title:c.i18n.translate("xpack.crossClusterReplication.followerIndexForm.advancedSettings.maxRetryDelayTitle",{defaultMessage:"Max retry delay"}),description:c.i18n.translate("xpack.crossClusterReplication.followerIndexForm.advancedSettings.maxRetryDelayDescription",{defaultMessage:"The maximum time to wait before retrying an operation that failed exceptionally; an exponential backoff strategy is employed when retrying."}),label:c.i18n.translate("xpack.crossClusterReplication.followerIndexForm.advancedSettings.maxRetryDelayLabel",{defaultMessage:"Max retry delay"}),defaultValue:Object(Ze.b)("maxRetryDelay"),helpText:o},{field:"readPollTimeout",testSubject:"readPollTimeoutInput",title:c.i18n.translate("xpack.crossClusterReplication.followerIndexForm.advancedSettings.readPollTimeoutTitle",{defaultMessage:"Read poll timeout"}),description:c.i18n.translate("xpack.crossClusterReplication.followerIndexForm.advancedSettings.readPollTimeoutDescription",{defaultMessage:"The maximum time to wait for new operations on the remote cluster when the follower index is synchronized with the leader index; when the timeout has elapsed, the poll for operations will return to the follower so that it can update some statistics, and then the follower will immediately attempt to read from the leader again."}),label:c.i18n.translate("xpack.crossClusterReplication.followerIndexForm.advancedSettings.readPollTimeoutLabel",{defaultMessage:"Read poll timeout"}),defaultValue:Object(Ze.b)("readPollTimeout"),helpText:o}]},ut=e=>ct(e).reduce(((e,t)=>{const{field:o,defaultValue:s}=t;return{...e,[o]:s}}),{}),dt=({maxReadRequestOperationCount:e,maxOutstandingReadRequests:t,maxReadRequestSize:o,maxWriteRequestOperationCount:s,maxWriteRequestSize:r,maxOutstandingWriteRequests:a,maxWriteBufferCount:n,maxWriteBufferSize:l,maxRetryDelay:i,readPollTimeout:c})=>({max_read_request_operation_count:e,max_outstanding_read_requests:t,max_read_request_size:o,max_write_request_operation_count:s,max_write_request_size:r,max_outstanding_write_requests:a,max_write_buffer_count:n,max_write_buffer_size:l,max_retry_delay:i,read_poll_timeout:c});class follower_index_request_flyout_FollowerIndexRequestFlyout extends s.PureComponent{render(){const{name:e,followerIndex:t,close:o}=this.props,s=`PUT /${e||""}/_ccr/follow`,r=JSON.stringify((e=>({remote_cluster:e.remoteCluster,leader_index:e.leaderIndex,...dt(e)}))(t),null,2),a=`${s}\n${r}`;return Object(E.jsx)(S.EuiFlyout,{maxWidth:480,onClose:o},Object(E.jsx)(S.EuiFlyoutHeader,null,Object(E.jsx)(S.EuiTitle,null,Object(E.jsx)("h2",null,Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexForm.requestFlyout.title",defaultMessage:"Request"})))),Object(E.jsx)(S.EuiFlyoutBody,null,Object(E.jsx)(S.EuiText,null,Object(E.jsx)("p",null,Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexForm.requestFlyout.descriptionText",defaultMessage:"This Elasticsearch request will create this follower index."}))),Object(E.jsx)(S.EuiSpacer,null),Object(E.jsx)(S.EuiCodeBlock,{language:"json",isCopyable:!0},a)),Object(E.jsx)(S.EuiFlyoutFooter,null,Object(E.jsx)(S.EuiButtonEmpty,{iconType:"cross",onClick:o,flush:"left"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexForm.requestFlyout.closeButtonLabel",defaultMessage:"Close"}))))}}const pt=l.indices.INDEX_ILLEGAL_CHARACTERS_VISIBLE.join(" "),xt=(e="")=>({name:"",remoteCluster:e,leaderIndex:"",...ut(m)}),ft=e=>({fieldsErrors:t})=>({fieldsErrors:{...t,...e}});class follower_index_form_FollowerIndexForm extends s.PureComponent{constructor(e){super(e),k()(this,"toggleRequest",(()=>{this.setState((({isRequestVisible:e})=>({isRequestVisible:!e})))})),k()(this,"onFieldsChange",(e=>{this.setState((e=>({followerIndex:t})=>({followerIndex:{...t,...e}}))(e));const t={...this.state.fields,...e};this.setState(ft(this.getFieldsErrors(t))),this.props.apiError&&this.props.clearApiError()})),k()(this,"getFieldsErrors",(e=>Object.keys(e).reduce(((t,o)=>{const s=(r=ct(m),r.reduce(((e,t)=>{const{field:o,validator:s}=t;return e[o]=s,e}),{name:lt,leaderIndex:it}))[o];var r;const a=e[o];if(s){const e=s(a);t[o]=e}return t}),{}))),k()(this,"onIndexNameChange",(({name:e})=>{this.onFieldsChange({name:e}),lt(e)||(e&&e.trim()?(this.setState({isValidatingIndexName:!0}),this.validateIndexName(e)):this.setState({isValidatingIndexName:!1}))})),k()(this,"validateIndexName",(async e=>{try{if((await Object(q.i)()).some((t=>t.name===e))){const e={message:Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexForm.indexAlreadyExistError",defaultMessage:"An index with the same name already exists."}),alwaysVisible:!0};this.setState(ft({name:e}))}this.setState({isValidatingIndexName:!1})}catch(e){if(e){if("AbortError"===e.name)return;if(e.body)return this.setState({isValidatingIndexName:!1})}Object(T.a)().add(e,c.i18n.translate("xpack.crossClusterReplication.followerIndexForm.indexNameValidationFatalErrorTitle",{defaultMessage:"Follower Index Form index name validation"}))}})),k()(this,"onClusterChange",(e=>{this.onFieldsChange({remoteCluster:e})})),k()(this,"getFields",(()=>this.state.followerIndex)),k()(this,"toggleAdvancedSettings",(e=>{if(e.target.checked)return this.onFieldsChange(this.cachedAdvancedSettings),this.cachedAdvancedSettings={},this.setState({areAdvancedSettingsVisible:!0});this.onFieldsChange(ut(m));const t=this.getFields();this.cachedAdvancedSettings=ct(m).reduce(((e,{field:o})=>{const s=t[o];return""!==s&&(e[o]=s),e}),{}),this.setState({areAdvancedSettingsVisible:!1})})),k()(this,"sendForm",(()=>{const e=this.isFormValid();if(this.setState({areErrorsVisible:!e}),!e)return;const{name:t,...o}=this.getFields();this.props.saveFollowerIndex(t,o)})),k()(this,"cancelForm",(()=>{B.navigate("/follower_indices")})),k()(this,"renderForm",(()=>{const{followerIndex:e,isNew:t,areErrorsVisible:o,areAdvancedSettingsVisible:r,fieldsErrors:a,isValidatingIndexName:n}=this.state,l=Object(E.jsx)(s.Fragment,null,n&&Object(E.jsx)("p",null,Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexForm.indexNameValidatingLabel",defaultMessage:"Checking availability…"})),Object(E.jsx)("p",null,Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexForm.indexNameHelpLabel",defaultMessage:"Spaces and the characters {characterList} are not allowed.",values:{characterList:Object(E.jsx)("strong",null,pt)}}))),i=c.i18n.translate("xpack.crossClusterReplication.followerIndexForm.sectionFollowerIndexNameTitle",{defaultMessage:"Follower index"}),u=c.i18n.translate("xpack.crossClusterReplication.followerIndexForm.sectionLeaderIndexTitle",{defaultMessage:"Leader index"});return Object(E.jsx)(s.Fragment,null,Object(E.jsx)(S.EuiForm,{"data-test-subj":"followerIndexForm"},(()=>{const{remoteClusters:s,currentUrl:r}=this.props,a={noClusterFound:()=>Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexForm.emptyRemoteClustersCallOutDescription",defaultMessage:"Replication requires a leader index on a remote cluster."}),remoteClusterNotConnectedNotEditable:e=>({title:Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexForm.currentRemoteClusterNotConnectedCallOutTitle",defaultMessage:"Can't edit follower index because remote cluster '{name}' is not connected",values:{name:e}}),description:Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexForm.currentRemoteClusterNotConnectedCallOutDescription",defaultMessage:"You can address this by editing the remote cluster."})}),remoteClusterDoesNotExist:e=>Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexForm.currentRemoteClusterNotFoundCallOutDescription",defaultMessage:"To edit this follower index, you must add a remote cluster named '{name}'.",values:{name:e}})};return Object(E.jsx)(S.EuiDescribedFormGroup,{title:Object(E.jsx)(S.EuiTitle,{size:"s"},Object(E.jsx)("h2",null,Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexForm.sectionRemoteClusterTitle",defaultMessage:"Remote cluster"}))),description:Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexForm.sectionRemoteClusterDescription",defaultMessage:"The cluster that contains the index to replicate."}),fullWidth:!0},Object(E.jsx)(remote_clusters_form_field_RemoteClustersFormField,{selected:e.remoteCluster?e.remoteCluster:null,remoteClusters:s||[],currentUrl:r,isEditable:t,areErrorsVisible:o,onChange:this.onClusterChange,onError:e=>{this.setState(ft({remoteCluster:e}))},errorMessages:a}))})(),(()=>Object(E.jsx)(form_entry_row_FormEntryRow,{field:"leaderIndex",value:e.leaderIndex,error:a.leaderIndex,title:Object(E.jsx)(S.EuiTitle,{size:"s"},Object(E.jsx)("h2",null,u)),label:u,description:Object(E.jsx)(s.Fragment,null,Object(E.jsx)("p",null,Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexForm.sectionLeaderIndexDescription",defaultMessage:"The index on the remote cluster to replicate to the follower index."})),Object(E.jsx)("p",null,Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexForm.sectionLeaderIndexDescription2",defaultMessage:"{note} The leader index must already exist.",values:{note:Object(E.jsx)("strong",null,Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexForm.sectionLeaderIndexDescription2.noteLabel",defaultMessage:"Note:"}))}}))),helpText:Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexForm.indexNameHelpLabel",defaultMessage:"Spaces and the characters {characterList} are not allowed.",values:{characterList:Object(E.jsx)("strong",null,pt)}}),disabled:!t,areErrorsVisible:o,onValueUpdate:this.onFieldsChange,testSubj:"leaderIndexInput"}))(),(()=>Object(E.jsx)(form_entry_row_FormEntryRow,{field:"name",value:e.name,error:a.name,title:Object(E.jsx)(S.EuiTitle,{size:"s"},Object(E.jsx)("h2",null,i)),label:i,description:c.i18n.translate("xpack.crossClusterReplication.followerIndexForm.sectionFollowerIndexNameDescription",{defaultMessage:"A unique name for your index."}),helpText:l,isLoading:n,disabled:!t,areErrorsVisible:o,onValueUpdate:this.onIndexNameChange,testSubj:"followerIndexInput"}))(),Object(E.jsx)(S.EuiSpacer,{size:"s"}),(()=>Object(E.jsx)(s.Fragment,null,Object(E.jsx)(S.EuiHorizontalRule,null),Object(E.jsx)(S.EuiDescribedFormGroup,{title:Object(E.jsx)(S.EuiTitle,{size:"s"},Object(E.jsx)("h2",null,Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexForm.advancedSettingsTitle",defaultMessage:"Advanced settings (optional)"}))),description:Object(E.jsx)(s.Fragment,null,Object(E.jsx)("p",null,Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexForm.advancedSettingsDescription",defaultMessage:"Advanced settings control the rate of replication. You can customize these settings or use the default values."})),Object(E.jsx)(S.EuiSwitch,{label:Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndex.advancedSettingsForm.showSwitchLabel",defaultMessage:"Customize advanced settings"}),checked:r,onChange:this.toggleAdvancedSettings,"data-test-subj":"advancedSettingsToggle"})),fullWidth:!0},Object(E.jsx)(s.Fragment,null)," "),r&&Object(E.jsx)(s.Fragment,null,Object(E.jsx)(S.EuiSpacer,{size:"s"}),ct(m).map((t=>{const{field:s,testSubject:r,title:n,description:l,label:i,helpText:c,defaultValue:u,type:d}=t;return Object(E.jsx)(form_entry_row_FormEntryRow,{key:s,field:s,value:e[s],defaultValue:u,error:a[s],title:Object(E.jsx)(S.EuiTitle,{size:"xs"},Object(E.jsx)("h3",null,n)),description:l,label:i,helpText:c,type:d,areErrorsVisible:o,onValueUpdate:this.onFieldsChange,testSubj:r})}))),Object(E.jsx)(S.EuiHorizontalRule,null)))()),(()=>{const{areErrorsVisible:e}=this.state,t=this.isFormValid();return!e||t?null:Object(E.jsx)(s.Fragment,null,Object(E.jsx)(S.EuiCallOut,{title:Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexForm.validationErrorTitle",defaultMessage:"Fix errors before continuing."}),color:"danger",iconType:"cross","data-test-subj":"formError"}),Object(E.jsx)(S.EuiSpacer,{size:"l"}))})(),this.renderApiErrors(),(()=>{const{apiStatus:e,saveButtonLabel:t}=this.props,{areErrorsVisible:o,isRequestVisible:s}=this.state;if(e===z.a.SAVING)return Object(E.jsx)(S.EuiFlexGroup,{justifyContent:"flexStart",gutterSize:"m"},Object(E.jsx)(S.EuiFlexItem,{grow:!1},Object(E.jsx)(S.EuiLoadingSpinner,{size:"l"})),Object(E.jsx)(S.EuiFlexItem,{grow:!1},Object(E.jsx)(S.EuiText,null,Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexForm.actions.savingText",defaultMessage:"Saving"}))));const r=o&&!this.isFormValid();return Object(E.jsx)(S.EuiFlexGroup,{justifyContent:"spaceBetween",alignItems:"center"},Object(E.jsx)(S.EuiFlexGroup,{gutterSize:"m",alignItems:"center"},Object(E.jsx)(S.EuiFlexItem,{grow:!1},Object(E.jsx)(S.EuiButton,{color:"success",iconType:"check",onClick:this.sendForm,fill:!0,disabled:r,"data-test-subj":"submitButton"},t)),Object(E.jsx)(S.EuiFlexItem,{grow:!1},Object(E.jsx)(S.EuiButtonEmpty,{color:"primary",onClick:this.cancelForm,"data-test-subj":"cancelButton"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexForm.cancelButtonLabel",defaultMessage:"Cancel"})))),Object(E.jsx)(S.EuiFlexItem,{grow:!1},Object(E.jsx)(S.EuiButtonEmpty,{onClick:this.toggleRequest},s?Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexForm.hideRequestButtonLabel",defaultMessage:"Hide request"}):Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexForm.showRequestButtonLabel",defaultMessage:"Show request"}))))})())})),k()(this,"renderLoading",(()=>{const{apiStatus:e}=this.props;return e===z.a.SAVING?Object(E.jsx)(S.EuiOverlayMask,null,Object(E.jsx)(S.EuiLoadingLogo,{logo:"logoKibana",size:"xl"})):null}));const{route:{location:{search:t}}}=B.reactRouter,o=Object(l.extractQueryParams)(t),r=void 0===this.props.followerIndex,a=Ne(this.props.remoteClusters,o.cluster),n=r?xt(a):{...xt(),...this.props.followerIndex},i=!r&&(u=n,!!ct(d=m).some((e=>{const{field:t}=e;return u[t]!==ut(d)[t]})));var u,d;const p=this.getFieldsErrors(n);this.state={isNew:r,followerIndex:n,fieldsErrors:p,areErrorsVisible:!1,areAdvancedSettingsVisible:i,isValidatingIndexName:!1,isRequestVisible:!1},this.cachedAdvancedSettings={},this.validateIndexName=Object(R.debounce)(this.validateIndexName,500,{trailing:!0})}isFormValid(){return Object.values(this.state.fieldsErrors).every((e=>null==e))}renderApiErrors(){const{apiError:e}=this.props;if(e){const t=c.i18n.translate("xpack.crossClusterReplication.followerIndexForm.savingErrorTitle",{defaultMessage:"Can't create follower index"}),{leaderIndex:o}=this.state.followerIndex,r=404===e.status?{data:{message:c.i18n.translate("xpack.crossClusterReplication.followerIndexForm.leaderIndexNotFoundError",{defaultMessage:"The leader index '{leaderIndex}' does not exist.",values:{leaderIndex:o}})}}:e;return Object(E.jsx)(s.Fragment,null,Object(E.jsx)(Ae,{title:t,error:r}),Object(E.jsx)(S.EuiSpacer,{size:"l"}))}return null}render(){const{followerIndex:e,isRequestVisible:t}=this.state;return Object(E.jsx)(s.Fragment,null,this.renderForm(),this.renderLoading(),t?Object(E.jsx)(follower_index_request_flyout_FollowerIndexRequestFlyout,{name:e.name,followerIndex:this.getFields(),close:()=>this.setState({isRequestVisible:!1})}):null)}}const mt=({title:e})=>Object(E.jsx)(r.a.Fragment,null,Object(E.jsx)(S.EuiPageHeader,{bottomBorder:!0,pageTitle:Object(E.jsx)("span",{"data-test-subj":"pageTitle"},e),rightSideItems:[Object(E.jsx)(S.EuiButtonEmpty,{size:"s",flush:"right",href:m.apis.createFollower,target:"_blank",iconType:"help","data-test-subj":"docsButton"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.readDocsFollowerIndexButtonLabel",defaultMessage:"Follower index docs"}))]}),Object(E.jsx)(S.EuiSpacer,{size:"l"})),jt=c.i18n.translate("xpack.crossClusterReplication.autoFollowActionMenu.autoFollowPatternActionMenuButtonAriaLabel",{defaultMessage:"Auto-follow pattern options"}),bt=({patterns:e,deleteAutoFollowPattern:t,pauseAutoFollowPattern:o,resumeAutoFollowPattern:r,arrowDirection:a,edit:n})=>{const[l,i]=Object(s.useState)(!1),u=(e=>{if(!e.length)return!1;const[t,...o]=e;for(const e of o)if(t!==e)return!1;return!0})(e.filter(Boolean).map((({active:e})=>e))),d=()=>{i(!1)},p=[u?e[0].active?{name:c.i18n.translate("xpack.crossClusterReplication.pauseAutoFollowPatternsLabel",{defaultMessage:"Pause {total, plural, one {replication} other {replications}}",values:{total:e.length}}),icon:Object(E.jsx)(S.EuiIcon,{type:"pause"}),onClick:()=>{o(e.map((({name:e})=>e))),d()}}:{name:c.i18n.translate("xpack.crossClusterReplication.resumeAutoFollowPatternsLabel",{defaultMessage:"Resume {total, plural, one {replication} other {replications}}",values:{total:e.length}}),icon:Object(E.jsx)(S.EuiIcon,{type:"play"}),onClick:()=>{r(e.map((({name:e})=>e))),d()}}:null,n&&1===e.length?{name:c.i18n.translate("xpack.crossClusterReplication.editAutoFollowPatternButtonLabel",{defaultMessage:"Edit pattern"}),icon:Object(E.jsx)(S.EuiIcon,{type:"pencil"}),onClick:()=>{B.navigate(B.getAutoFollowPatternPath(e[0].name))}}:null,{name:c.i18n.translate("xpack.crossClusterReplication.deleteAutoFollowPatternButtonLabel",{defaultMessage:"Delete {total, plural, one {pattern} other {patterns}}",values:{total:e.length}}),icon:Object(E.jsx)(S.EuiIcon,{type:"trash"}),onClick:()=>{t(e.map((({name:e})=>e))),d()}}].filter(Boolean),x=Object(E.jsx)(S.EuiButton,{"data-test-subj":"autoFollowPatternActionMenuButton","aria-label":jt,onClick:()=>i(!l),iconType:"up"===a?"arrowUp":"arrowDown",iconSide:"right",fill:!0},c.i18n.translate("xpack.crossClusterReplication.autoFollowPatternActionMenu.buttonLabel",{defaultMessage:"Manage {patterns, plural, one {pattern} other {patterns}}",values:{patterns:e.length}}));return Object(E.jsx)(S.EuiPopover,{isOpen:l,closePopover:()=>i(!1),button:x,panelPaddingSize:"none",repositionOnScroll:!0},Object(E.jsx)(S.EuiContextMenu,{initialPanelId:0,"data-test-subj":"autoFollowPatternActionContextMenu",panels:[{id:0,title:c.i18n.translate("xpack.crossClusterReplication.autoFollowPatternActionMenu.panelTitle",{defaultMessage:"Pattern options"}),items:p}]}))},gt=Object(n.connect)(null,(e=>({pauseAutoFollowPattern:t=>{e(ve(t))},resumeAutoFollowPattern:t=>{e(Re(t))}})))((e=>Object(E.jsx)(Qe,null,(t=>Object(E.jsx)(bt,h()({},e,{deleteAutoFollowPattern:t})))))),ht={pause:c.i18n.translate("xpack.crossClusterReplication.autoFollowPatternList.table.actionPauseDescription",{defaultMessage:"Pause replication"}),resume:c.i18n.translate("xpack.crossClusterReplication.autoFollowPatternList.table.actionResumeDescription",{defaultMessage:"Resume replication"}),edit:c.i18n.translate("xpack.crossClusterReplication.autoFollowPatternList.table.actionEditDescription",{defaultMessage:"Edit auto-follow pattern"}),delete:c.i18n.translate("xpack.crossClusterReplication.autoFollowPatternList.table.actionDeleteDescription",{defaultMessage:"Delete auto-follow pattern"})},wt=(e,t)=>{if(t){const o=t.toLowerCase();return e.filter((e=>{const{name:t="",remoteCluster:s="",followIndexPatternPrefix:r="",followIndexPatternSuffix:a=""}=e,n=t.toLowerCase().includes(o),l=s.toLowerCase().includes(o),i=r.toLowerCase().includes(o),c=a.toLowerCase().includes(o);return n||l||i||c}))}return e};class auto_follow_pattern_table_AutoFollowPatternTable extends s.PureComponent{static getDerivedStateFromProps(e,t){const{autoFollowPatterns:o}=e,{prevAutoFollowPatterns:s,queryText:r}=t;return s!==o?{prevAutoFollowPatterns:o,filteredAutoFollowPatterns:wt(o,r)}:null}constructor(e){super(e),k()(this,"onSearch",(({query:e})=>{const{autoFollowPatterns:t}=this.props,{text:o}=e;this.setState({queryText:o,filteredAutoFollowPatterns:wt(t,o)})})),k()(this,"renderLoading",(()=>{const{apiStatusDelete:e}=this.props;return e===z.a.DELETING?Object(E.jsx)(S.EuiOverlayMask,null,Object(E.jsx)(S.EuiLoadingLogo,{logo:"logoKibana",size:"xl"})):null})),this.state={prevAutoFollowPatterns:e.autoFollowPatterns,selectedItems:[],filteredAutoFollowPatterns:e.autoFollowPatterns,queryText:""}}getTableColumns(e){const{selectAutoFollowPattern:t}=this.props;return[{field:"name",name:c.i18n.translate("xpack.crossClusterReplication.autoFollowPatternList.table.nameColumnTitle",{defaultMessage:"Name"}),sortable:!0,truncateText:!1,render:e=>Object(E.jsx)(S.EuiLink,{onClick:()=>{Object(ke.c)("click",z.l),t(e)},"data-test-subj":"autoFollowPatternLink"},e)},{field:"active",dataType:"boolean",name:c.i18n.translate("xpack.crossClusterReplication.autoFollowPatternList.table.statusTitle",{defaultMessage:"Status"}),render:e=>{const t=e?c.i18n.translate("xpack.crossClusterReplication.autoFollowPatternList.table.statusTextActive",{defaultMessage:"Active"}):c.i18n.translate("xpack.crossClusterReplication.autoFollowPatternList.table.statusTextPaused",{defaultMessage:"Paused"});return Object(E.jsx)(r.a.Fragment,null,Object(E.jsx)(S.EuiHealth,{color:e?"success":"subdued"})," ",t)},sortable:!0},{field:"remoteCluster",name:c.i18n.translate("xpack.crossClusterReplication.autoFollowPatternList.table.clusterColumnTitle",{defaultMessage:"Remote cluster"}),truncateText:!0,sortable:!0},{field:"leaderIndexPatterns",name:c.i18n.translate("xpack.crossClusterReplication.autoFollowPatternList.table.leaderPatternsColumnTitle",{defaultMessage:"Leader patterns"}),render:e=>e.join(", ")},{field:"followIndexPatternPrefix",name:c.i18n.translate("xpack.crossClusterReplication.autoFollowPatternList.table.prefixColumnTitle",{defaultMessage:"Follower index prefix"}),sortable:!0},{field:"followIndexPatternSuffix",name:c.i18n.translate("xpack.crossClusterReplication.autoFollowPatternList.table.suffixColumnTitle",{defaultMessage:"Follower index suffix"}),sortable:!0},{name:c.i18n.translate("xpack.crossClusterReplication.autoFollowPatternList.table.actionsColumnTitle",{defaultMessage:"Actions"}),actions:[{name:ht.pause,description:ht.pause,icon:"pause",onClick:e=>this.props.pauseAutoFollowPattern(e.name),available:e=>e.active,"data-test-subj":"contextMenuPauseButton"},{name:ht.resume,description:ht.resume,icon:"play",onClick:e=>this.props.resumeAutoFollowPattern(e.name),available:e=>!e.active,"data-test-subj":"contextMenuResumeButton"},{name:ht.edit,description:ht.edit,icon:"pencil",onClick:e=>B.navigate(B.getAutoFollowPatternPath(e.name)),"data-test-subj":"contextMenuEditButton"},{name:ht.delete,description:ht.delete,icon:"trash",onClick:t=>e(t.name),"data-test-subj":"contextMenuDeleteButton"}],width:"100px"}]}render(){const{selectedItems:e,filteredAutoFollowPatterns:t}=this.state,o={sort:{field:"name",direction:"asc"}},s={initialPageSize:20,pageSizeOptions:[10,20,50]},a={onSelectionChange:e=>this.setState({selectedItems:e.map((({name:e})=>e))})},n={toolsLeft:e.length?Object(E.jsx)(gt,{arrowDirection:"down",patterns:this.state.selectedItems.map((e=>t.find((t=>t.name===e))))}):void 0,toolsRight:Object(E.jsx)(S.EuiButton,h()({},Object(i.reactRouterNavigate)(B._reactRouter.history,"/auto_follow_patterns/add"),{fill:!0,iconType:"plusInCircle","data-test-subj":"createAutoFollowPatternButton"}),Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternList.addAutoFollowPatternButtonLabel",defaultMessage:"Create an auto-follow pattern"})),onChange:this.onSearch,box:{incremental:!0,"data-test-subj":"autoFollowPatternSearch"}};return Object(E.jsx)(Qe,null,(e=>Object(E.jsx)(r.a.Fragment,null,Object(E.jsx)(S.EuiInMemoryTable,{items:t,itemId:"name",columns:this.getTableColumns(e),search:n,pagination:s,sorting:o,selection:a,isSelectable:!0,rowProps:()=>({"data-test-subj":"row"}),cellProps:(e,t)=>({"data-test-subj":`cell_${t.field}`}),"data-test-subj":"autoFollowPatternListTable"}),this.renderLoading())))}}const Ot=z.b.AUTO_FOLLOW_PATTERN,Ft=Object(n.connect)((e=>({apiStatusDelete:G(`${Ot}-delete`)(e)})),(e=>({selectAutoFollowPattern:t=>e(Ie(t)),pauseAutoFollowPattern:t=>e(ve(t)),resumeAutoFollowPattern:t=>e(Re(t))})))(auto_follow_pattern_table_AutoFollowPatternTable);var Ct=o(28);class detail_panel_DetailPanel extends s.Component{renderAutoFollowPattern({followIndexPatternPrefix:e,followIndexPatternSuffix:t,remoteCluster:o,leaderIndexPatterns:s,active:a}){return Object(E.jsx)(r.a.Fragment,null,Object(E.jsx)("section",null,Object(E.jsx)(S.EuiDescriptionList,null,Object(E.jsx)(S.EuiDescriptionListTitle,null,Object(E.jsx)(S.EuiTitle,{size:"xs"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternDetailPanel.statusLabel",defaultMessage:"Status"}))),Object(E.jsx)(S.EuiDescriptionListDescription,{"data-test-subj":"status"},a?Object(E.jsx)(S.EuiHealth,{color:"success"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternDetailPanel.activeStatus",defaultMessage:"Active"})):Object(E.jsx)(S.EuiHealth,{color:"subdued"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternDetailPanel.pausedStatus",defaultMessage:"Paused"}))))),Object(E.jsx)(S.EuiSpacer,{size:"s"}),Object(E.jsx)("section",{"aria-labelledby":"ccrAutoFollowPatternDetailSettingsTitle","data-test-subj":"settingsSection"},Object(E.jsx)(S.EuiTitle,{size:"s"},Object(E.jsx)("h3",{id:"ccrAutoFollowPatternDetailSettingsTitle"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternDetailPanel.statusTitle",defaultMessage:"Settings"}))),Object(E.jsx)(S.EuiSpacer,{size:"s"}),Object(E.jsx)(S.EuiFlexGroup,null,Object(E.jsx)(S.EuiFlexItem,null,Object(E.jsx)(S.EuiDescriptionList,{"data-test-subj":"settingsValues"},Object(E.jsx)(S.EuiDescriptionListTitle,null,Object(E.jsx)(S.EuiTitle,{size:"xs"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternDetailPanel.remoteClusterLabel",defaultMessage:"Remote cluster"}))),Object(E.jsx)(S.EuiDescriptionListDescription,{"data-test-subj":"remoteCluster"},o))),Object(E.jsx)(S.EuiFlexItem,null,Object(E.jsx)(S.EuiDescriptionList,{"data-test-subj":"settingsValues"},Object(E.jsx)(S.EuiDescriptionListTitle,null,Object(E.jsx)(S.EuiTitle,{size:"xs"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternDetailPanel.leaderPatternsLabel",defaultMessage:"Leader patterns"}))),Object(E.jsx)(S.EuiDescriptionListDescription,{"data-test-subj":"leaderIndexPatterns"},s.join(", "))))),Object(E.jsx)(S.EuiSpacer,{size:"s"}),Object(E.jsx)(S.EuiFlexGroup,null,Object(E.jsx)(S.EuiFlexItem,null,Object(E.jsx)(S.EuiDescriptionList,{"data-test-subj":"settingsValues"},Object(E.jsx)(S.EuiDescriptionListTitle,null,Object(E.jsx)(S.EuiTitle,{size:"xs"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternDetailPanel.prefixLabel",defaultMessage:"Prefix"}))),Object(E.jsx)(S.EuiDescriptionListDescription,{"data-test-subj":"patternPrefix"},e||Object(E.jsx)("em",null,Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternDetailPanel.prefixEmptyValue",defaultMessage:"No prefix"}))))),Object(E.jsx)(S.EuiFlexItem,null,Object(E.jsx)(S.EuiDescriptionList,{"data-test-subj":"settingsValues"},Object(E.jsx)(S.EuiDescriptionListTitle,null,Object(E.jsx)(S.EuiTitle,{size:"xs"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternDetailPanel.suffixLabel",defaultMessage:"Suffix"}))),Object(E.jsx)(S.EuiDescriptionListDescription,{"data-test-subj":"patternSuffix"},t||Object(E.jsx)("em",null,Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternDetailPanel.suffixEmptyValue",defaultMessage:"No suffix"}))))))))}renderIndicesPreview(e,t,o){return Object(E.jsx)("section",{"data-test-subj":"indicesPreviewSection"},Object(E.jsx)(ze,{prefix:e,suffix:t,leaderIndexPatterns:o}))}renderAutoFollowPatternNotFound(){return Object(E.jsx)(S.EuiFlyoutBody,null,Object(E.jsx)(S.EuiFlexGroup,{justifyContent:"flexStart",alignItems:"center",gutterSize:"s"},Object(E.jsx)(S.EuiFlexItem,{grow:!1},Object(E.jsx)(S.EuiIcon,{size:"m",type:"warning",color:"danger"})),Object(E.jsx)(S.EuiFlexItem,{grow:!1},Object(E.jsx)(S.EuiText,null,Object(E.jsx)(S.EuiTextColor,{color:"subdued"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternDetailPanel.notFoundLabel",defaultMessage:"Auto-follow pattern not found"}))))))}renderAutoFollowPatternErrors(e){return e.errors.length?Object(E.jsx)("section",{"data-test-subj":"errors"},Object(E.jsx)(S.EuiFlexGroup,{justifyContent:"flexStart",alignItems:"center",gutterSize:"s"},Object(E.jsx)(S.EuiFlexItem,{grow:!1},Object(E.jsx)(S.EuiIcon,{type:"warning",color:"danger"})),Object(E.jsx)(S.EuiFlexItem,{grow:!1},Object(E.jsx)(S.EuiTitle,{size:"s","data-test-subj":"titleErrors"},Object(E.jsx)("h3",null,Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternDetailPanel.recentErrorsTitle",defaultMessage:"Recent errors"}))))),Object(E.jsx)(S.EuiSpacer,{size:"s"}),Object(E.jsx)(S.EuiText,null,Object(E.jsx)("ul",null,e.errors.map(((e,t)=>Object(E.jsx)("li",{key:t,"data-test-subj":"recentError"},Object(E.jsx)("strong",null,qe()(e.timestamp).format("MMMM Do, YYYY h:mm:ss A")),":"," ",e.autoFollowException.reason)))))):null}renderFlyoutBody(){const{autoFollowPattern:e}=this.props;if(!e)return this.renderAutoFollowPatternNotFound();const{followIndexPatternPrefix:t,followIndexPatternSuffix:o,leaderIndexPatterns:s}=e;let r;t?r=`name:${t}`:o&&(r=`name:${o}`);const a=Object(Ct.getIndexListUri)(r);return Object(E.jsx)(S.EuiFlyoutBody,null,this.renderAutoFollowPattern(e),Object(E.jsx)(S.EuiSpacer,{size:"m"}),this.renderIndicesPreview(t,o,s),Object(E.jsx)(S.EuiSpacer,{size:"l"}),Object(E.jsx)(S.EuiLink,{href:B._reactRouter.getUrlForApp("management",{path:`data/index_management${a}`}),"data-test-subj":"viewIndexManagementLink"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternDetailPanel.viewIndicesLink",defaultMessage:"View your follower indices in Index Management"})),Object(E.jsx)(S.EuiSpacer,{size:"l"}),this.renderAutoFollowPatternErrors(e))}renderFlyoutFooter(){const{autoFollowPattern:e,closeDetailPanel:t}=this.props;return Object(E.jsx)(S.EuiFlyoutFooter,null,Object(E.jsx)(S.EuiFlexGroup,{justifyContent:"spaceBetween",alignItems:"center"},Object(E.jsx)(S.EuiFlexItem,{grow:!1},Object(E.jsx)(S.EuiButtonEmpty,{iconType:"cross",flush:"left",onClick:t,"data-test-subj":"closeFlyoutButton"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternDetailPanel.closeButtonLabel",defaultMessage:"Close"}))),e&&Object(E.jsx)(S.EuiFlexItem,{grow:!1},Object(E.jsx)(S.EuiFlexGroup,{alignItems:"center"},Object(E.jsx)(S.EuiFlexItem,{grow:!1},Object(E.jsx)(gt,{edit:!0,arrowDirection:"up",patterns:[e]}))))))}render(){const{autoFollowPatternId:e,closeDetailPanel:t}=this.props;return Object(E.jsx)(S.EuiFlyout,{"data-test-subj":"autoFollowPatternDetail",onClose:t,"aria-labelledby":"autoFollowPatternDetailsFlyoutTitle",size:"m",maxWidth:400},Object(E.jsx)(S.EuiFlyoutHeader,null,Object(E.jsx)(S.EuiTitle,{size:"m",id:"autoFollowPatternDetailsFlyoutTitle","data-test-subj":"title"},Object(E.jsx)("h2",null,e))),this.renderFlyoutBody(),this.renderFlyoutFooter())}}const Et=z.b.AUTO_FOLLOW_PATTERN,Mt=Object(n.connect)((e=>({autoFollowPatternId:J("detail")(e),autoFollowPattern:Z("detail")(e),apiStatus:G(Et)(e)})))(detail_panel_DetailPanel);class auto_follow_pattern_list_AutoFollowPatternList extends s.PureComponent{constructor(...e){super(...e),k()(this,"state",{lastAutoFollowPatternId:null,isDetailPanelOpen:!1})}static getDerivedStateFromProps({autoFollowPatternId:e},{lastAutoFollowPatternId:t}){return e!==t?{lastAutoFollowPatternId:e,isDetailPanelOpen:!!e}:null}componentDidMount(){const{loadAutoFollowPatterns:e,loadAutoFollowStats:t,selectAutoFollowPattern:o,history:s}=this.props;Object(ke.c)(ke.a.LOADED,z.g),e(),t(),o((({location:{search:e}})=>{const{pattern:t}=Object(l.extractQueryParams)(e);return t?decodeURIComponent(t):null})(s)),this.interval=setInterval((()=>e(!0)),3e4)}componentDidUpdate(e,t){const{history:o,loadAutoFollowStats:s}=this.props,{lastAutoFollowPatternId:r}=this.state;r!==t.lastAutoFollowPatternId&&(r?(o.replace({search:`?pattern=${encodeURIComponent(r)}`}),s()):o.replace({search:""}))}componentWillUnmount(){clearInterval(this.interval)}renderEmpty(){return Object(E.jsx)(S.EuiPageContent_Deprecated,{hasShadow:!1,paddingSize:"none",verticalPosition:"center",horizontalPosition:"center"},Object(E.jsx)(S.EuiEmptyPrompt,{iconType:"managementApp","data-test-subj":"emptyPrompt",title:Object(E.jsx)("h1",null,Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternList.emptyPromptTitle",defaultMessage:"Create your first auto-follow pattern"})),body:Object(E.jsx)("p",null,Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternList.emptyPromptDescription",defaultMessage:"Use an auto-follow pattern to automatically replicate indices from a remote cluster."})),actions:Object(E.jsx)(S.EuiButton,h()({},Object(i.reactRouterNavigate)(this.props.history,"/auto_follow_patterns/add"),{fill:!0,iconType:"plusInCircle","data-test-subj":"createAutoFollowPatternButton"}),Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.addAutoFollowPatternButtonLabel",defaultMessage:"Create auto-follow pattern"}))}))}renderList(){const{selectAutoFollowPattern:e,autoFollowPatterns:t}=this.props,{isDetailPanelOpen:o}=this.state;return Object(E.jsx)(r.a.Fragment,null,Object(E.jsx)(S.EuiText,null,Object(E.jsx)("p",null,Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternList.autoFollowPatternsDescription",defaultMessage:"An auto-follow pattern replicates leader indices from a remote cluster and copies them to follower indices on the local cluster."}))),Object(E.jsx)(S.EuiSpacer,{size:"l"}),Object(E.jsx)(Ft,{autoFollowPatterns:t}),o&&Object(E.jsx)(Mt,{closeDetailPanel:()=>e(null)}))}render(){const{autoFollowPatterns:e,apiError:t,apiStatus:o,isAuthorized:s}=this.props,r=o===z.a.IDLE&&!e.length;if(!s)return Object(E.jsx)(l.PageError,{title:Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternList.permissionErrorTitle",defaultMessage:"Permission error"}),error:{error:Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternList.noPermissionText",defaultMessage:"You do not have permission to view or add auto-follow patterns."})}});if(t){const e=c.i18n.translate("xpack.crossClusterReplication.autoFollowPatternList.loadingErrorTitle",{defaultMessage:"Error loading auto-follow patterns"});return Object(E.jsx)(l.PageError,{title:e,error:t.body})}return r?this.renderEmpty():o===z.a.LOADING?Object(E.jsx)(l.PageLoading,null,Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternList.loadingTitle",defaultMessage:"Loading auto-follow patterns..."})):this.renderList()}}const It=z.b.AUTO_FOLLOW_PATTERN,Pt=Object(n.connect)((e=>({autoFollowPatterns:ee(e),autoFollowPatternId:J("detail")(e),apiStatus:G(It)(e),apiError:H(It)(e),isAuthorized:Y(It)(e)})),(e=>({loadAutoFollowPatterns:t=>e(((e=!1)=>Ee({label:de,scope:Me,status:e?z.a.UPDATING:z.a.LOADING,handler:async()=>await Object(q.f)(e)}))(t)),selectAutoFollowPattern:t=>e(Ie(t)),loadAutoFollowStats:()=>e(Ee({label:Oe,scope:Le,handler:async()=>await Object(q.g)()}))})))(auto_follow_pattern_list_AutoFollowPatternList);class context_menu_ContextMenu extends s.PureComponent{constructor(...e){super(...e),k()(this,"state",{isPopoverOpen:!1}),k()(this,"onButtonClick",(()=>{this.setState((e=>({isPopoverOpen:!e.isPopoverOpen})))})),k()(this,"closePopover",(()=>{this.setState({isPopoverOpen:!1})})),k()(this,"editFollowerIndex",(e=>{const t=B.getFollowerIndexPath(e);B.navigate(t)}))}render(){const{followerIndices:e}=this.props,t=e.length,o=e.map((e=>e.name)),{iconSide:r="right",iconType:a="arrowDown",anchorPosition:n="rightUp",label:l=Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndex.contextMenu.buttonLabel",defaultMessage:"Manage follower {followerIndicesLength, plural, one {index} other {indices}}",values:{followerIndicesLength:t}}),testSubj:i}=this.props,c=Object(E.jsx)(S.EuiButton,{"data-test-subj":i,iconSide:r,onClick:this.onButtonClick,iconType:a,fill:!0},l),u=e.filter((({isPaused:e})=>e)).map((e=>e.name)),d=e.filter((({isPaused:e})=>!e));return Object(E.jsx)(S.EuiPopover,{button:c,isOpen:this.state.isPopoverOpen,closePopover:this.closePopover,panelPaddingSize:"none",anchorPosition:n,repositionOnScroll:!0},Object(E.jsx)(S.EuiPopoverTitle,{paddingSize:"s"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndex.contextMenu.title",defaultMessage:"Follower {followerIndicesLength, plural, one {index} other {indices}} options",values:{followerIndicesLength:t}})),Object(E.jsx)(S.EuiContextMenuPanel,{"data-test-subj":"contextMenu"},d.length?Object(E.jsx)(et,{onConfirm:this.closePopover},(e=>Object(E.jsx)(S.EuiContextMenuItem,{icon:"pause",onClick:()=>e(d),"data-test-subj":"pauseButton"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndex.contextMenu.pauseLabel",defaultMessage:"Pause replication"})))):null,u.length?Object(E.jsx)(tt,{onConfirm:this.closePopover},(e=>Object(E.jsx)(S.EuiContextMenuItem,{icon:"play",onClick:()=>e(u),"data-test-subj":"resumeButton"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndex.contextMenu.resumeLabel",defaultMessage:"Resume replication"})))):null,1===o.length&&Object(E.jsx)(s.Fragment,null,Object(E.jsx)(S.EuiContextMenuItem,{icon:"pencil",onClick:()=>this.editFollowerIndex(o[0]),"data-test-subj":"editButton"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndex.contextMenu.editLabel","data-test-subj":"editButton",defaultMessage:"Edit follower index"}))),Object(E.jsx)(ot,{onConfirm:this.closePopover},(e=>Object(E.jsx)(S.EuiContextMenuItem,{icon:"indexFlush",onClick:()=>e(o),"data-test-subj":"unfollowButton"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndex.contextMenu.unfollowLabel",defaultMessage:"Unfollow leader {followerIndicesLength, plural, one {index} other {indices}}",values:{followerIndicesLength:t}}))))))}}const vt={pause:c.i18n.translate("xpack.crossClusterReplication.followerIndexList.table.actionPauseDescription",{defaultMessage:"Pause replication"}),resume:c.i18n.translate("xpack.crossClusterReplication.followerIndexList.table.actionResumeDescription",{defaultMessage:"Resume replication"}),edit:c.i18n.translate("xpack.crossClusterReplication.followerIndexList.table.actionEditDescription",{defaultMessage:"Edit follower index"}),unfollow:c.i18n.translate("xpack.crossClusterReplication.followerIndexList.table.actionUnfollowDescription",{defaultMessage:"Unfollow leader index"})},Rt=(e,t)=>{if(t){const o=t.toLowerCase();return e.filter((e=>{const{name:t="",remoteCluster:s="",leaderIndex:r=""}=e;return!!t.toLowerCase().includes(o)||!!r.toLowerCase().includes(o)||!!s.toLowerCase().includes(o)}))}return e};class follower_indices_table_FollowerIndicesTable extends s.PureComponent{static getDerivedStateFromProps(e,t){const{followerIndices:o}=e,{prevFollowerIndices:s,queryText:r}=t;return s!==o?{prevFollowerIndices:o,filteredIndices:Rt(o,r)}:null}constructor(e){super(e),k()(this,"onSearch",(({query:e})=>{const{followerIndices:t}=this.props,{text:o}=e;this.setState({queryText:o,filteredIndices:Rt(t,o)})})),k()(this,"editFollowerIndex",(e=>{const t=B.getFollowerIndexPath(e);B.navigate(t)})),k()(this,"renderLoading",(()=>{const{apiStatusDelete:e}=this.props;return e===z.a.DELETING?Object(E.jsx)(S.EuiOverlayMask,null,Object(E.jsx)(S.EuiLoadingLogo,{logo:"logoKibana",size:"xl"})):null})),this.state={prevFollowerIndices:e.followerIndices,selectedItems:[],filteredIndices:e.followerIndices,queryText:""}}getTableColumns(e){const{selectFollowerIndex:t}=this.props,o=[{name:vt.pause,description:vt.pause,icon:"pause",onClick:t=>e.pauseFollowerIndex(t),available:e=>!e.isPaused,"data-test-subj":"pauseButton"},{name:vt.resume,description:vt.resume,icon:"play",onClick:t=>e.resumeFollowerIndex(t.name),available:e=>e.isPaused,"data-test-subj":"resumeButton"},{name:vt.edit,description:vt.edit,onClick:e=>this.editFollowerIndex(e.name),icon:"pencil","data-test-subj":"editButton"},{name:vt.unfollow,description:vt.unfollow,onClick:t=>e.unfollowLeaderIndex(t.name),icon:"indexFlush","data-test-subj":"unfollowButton"}];return[{field:"name",name:c.i18n.translate("xpack.crossClusterReplication.followerIndexList.table.nameColumnTitle",{defaultMessage:"Name"}),sortable:!0,truncateText:!1,render:e=>Object(E.jsx)(S.EuiLink,{onClick:()=>{Object(ke.c)("click",z.t),t(e)},"data-test-subj":"followerIndexLink"},e)},{field:"isPaused",name:c.i18n.translate("xpack.crossClusterReplication.followerIndexList.table.statusColumnTitle",{defaultMessage:"Status"}),truncateText:!0,sortable:!0,render:e=>e?Object(E.jsx)(S.EuiHealth,{color:"subdued"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexList.table.statusColumn.pausedLabel",defaultMessage:"Paused"})):Object(E.jsx)(S.EuiHealth,{color:"success"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexList.table.statusColumn.activeLabel",defaultMessage:"Active"}))},{field:"remoteCluster",name:c.i18n.translate("xpack.crossClusterReplication.followerIndexList.table.clusterColumnTitle",{defaultMessage:"Remote cluster"}),truncateText:!0,sortable:!0},{field:"leaderIndex",name:c.i18n.translate("xpack.crossClusterReplication.followerIndexList.table.leaderIndexColumnTitle",{defaultMessage:"Leader index"}),truncateText:!0,sortable:!0},{name:c.i18n.translate("xpack.crossClusterReplication.followerIndexList.table.actionsColumnTitle",{defaultMessage:"Actions"}),actions:o,width:"100px"}]}render(){const{selectedItems:e,filteredIndices:t}=this.state,o={sort:{field:"name",direction:"asc"}},s={initialPageSize:20,pageSizeOptions:[10,20,50]},a={onSelectionChange:e=>this.setState({selectedItems:e})},n={toolsLeft:e.length?Object(E.jsx)(context_menu_ContextMenu,{followerIndices:e,testSubj:"contextMenuButton"}):void 0,toolsRight:Object(E.jsx)(S.EuiButton,h()({},Object(i.reactRouterNavigate)(B._reactRouter.history,"/follower_indices/add"),{fill:!0,iconType:"plusInCircle","data-test-subj":"createFollowerIndexButton"}),Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexList.addFollowerButtonLabel",defaultMessage:"Create a follower index"})),onChange:this.onSearch,box:{incremental:!0,"data-test-subj":"followerIndexSearch"}};return Object(E.jsx)(st,null,(e=>{const l=e();return Object(E.jsx)(r.a.Fragment,null,Object(E.jsx)(S.EuiInMemoryTable,{items:t,itemId:"name",columns:this.getTableColumns(l),search:n,pagination:s,sorting:o,selection:a,isSelectable:!0,rowProps:()=>({"data-test-subj":"row"}),cellProps:(e,t)=>({"data-test-subj":`cell-${t.field}`}),"data-test-subj":"followerIndexListTable"}),this.renderLoading())}))}}const yt=z.b.FOLLOWER_INDEX,_t=Object(n.connect)((e=>({apiStatusDelete:G(`${yt}-delete`)(e)})),(e=>({selectFollowerIndex:t=>e(_e(t))})))(follower_indices_table_FollowerIndicesTable);o(73),o(74);class detail_panel_detail_panel_DetailPanel extends s.Component{renderFollowerIndex(){const{followerIndex:{remoteCluster:e,leaderIndex:t,isPaused:o,shards:a,maxReadRequestOperationCount:n,maxOutstandingReadRequests:l,maxReadRequestSize:i,maxWriteRequestOperationCount:c,maxWriteRequestSize:u,maxOutstandingWriteRequests:d,maxWriteBufferCount:p,maxWriteBufferSize:x,maxRetryDelay:f,readPollTimeout:m}}=this.props;return Object(E.jsx)(s.Fragment,null,Object(E.jsx)(S.EuiFlyoutBody,null,Object(E.jsx)("section",null,Object(E.jsx)(S.EuiFlexGroup,null,Object(E.jsx)(S.EuiFlexItem,null,Object(E.jsx)(S.EuiDescriptionList,null,Object(E.jsx)(S.EuiDescriptionListTitle,null,Object(E.jsx)(S.EuiTitle,{size:"xs"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexDetailPanel.statusLabel",defaultMessage:"Status"}))),Object(E.jsx)(S.EuiDescriptionListDescription,{"data-test-subj":"status"},o?Object(E.jsx)(S.EuiHealth,{color:"subdued"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexDetailPanel.pausedStatus",defaultMessage:"Paused"})):Object(E.jsx)(S.EuiHealth,{color:"success"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexDetailPanel.activeStatus",defaultMessage:"Active"})))))),Object(E.jsx)(S.EuiSpacer,{size:"s"}),Object(E.jsx)(S.EuiFlexGroup,null,Object(E.jsx)(S.EuiFlexItem,null,Object(E.jsx)(S.EuiDescriptionList,null,Object(E.jsx)(S.EuiDescriptionListTitle,null,Object(E.jsx)(S.EuiTitle,{size:"xs"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexDetailPanel.remoteClusterLabel",defaultMessage:"Remote cluster"}))),Object(E.jsx)(S.EuiDescriptionListDescription,{"data-test-subj":"remoteCluster"},e))),Object(E.jsx)(S.EuiFlexItem,null,Object(E.jsx)(S.EuiDescriptionList,null,Object(E.jsx)(S.EuiDescriptionListTitle,null,Object(E.jsx)(S.EuiTitle,{size:"xs"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexDetailPanel.leaderIndexLabel",defaultMessage:"Leader index"}))),Object(E.jsx)(S.EuiDescriptionListDescription,{"data-test-subj":"leaderIndex"},t))))),Object(E.jsx)(S.EuiSpacer,{size:"l"}),Object(E.jsx)("section",{"aria-labelledby":"ccrFollowerIndexDetailSettingsTitle","data-test-subj":"settingsSection"},Object(E.jsx)(S.EuiTitle,{size:"s"},Object(E.jsx)("h3",{id:"ccrFollowerIndexDetailSettingsTitle"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexDetailPanel.settingsTitle",defaultMessage:"Settings"}))),Object(E.jsx)(S.EuiSpacer,{size:"s"}),o?Object(E.jsx)(S.EuiCallOut,{size:"s",title:Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexDetailPanel.pausedFollowerCalloutTitle",defaultMessage:"A paused follower index does not have settings or shard statistics."})}):Object(E.jsx)(r.a.Fragment,null,Object(E.jsx)(S.EuiFlexGroup,null,Object(E.jsx)(S.EuiFlexItem,null,Object(E.jsx)(S.EuiDescriptionList,{"data-test-subj":"settingsValues"},Object(E.jsx)(S.EuiDescriptionListTitle,null,Object(E.jsx)(S.EuiTitle,{size:"xs"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexForm.advancedSettings.maxReadRequestOperationCountTitle",defaultMessage:"Max read request operation count"}))),Object(E.jsx)(S.EuiDescriptionListDescription,{"data-test-subj":"maxReadReqOpCount"},n))),Object(E.jsx)(S.EuiFlexItem,null,Object(E.jsx)(S.EuiDescriptionList,{"data-test-subj":"settingsValues"},Object(E.jsx)(S.EuiDescriptionListTitle,null,Object(E.jsx)(S.EuiTitle,{size:"xs"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexForm.advancedSettings.maxOutstandingReadRequestsTitle",defaultMessage:"Max outstanding read requests"}))),Object(E.jsx)(S.EuiDescriptionListDescription,{"data-test-subj":"maxOutstandingReadReq"},l)))),Object(E.jsx)(S.EuiSpacer,{size:"s"}),Object(E.jsx)(S.EuiFlexGroup,null,Object(E.jsx)(S.EuiFlexItem,null,Object(E.jsx)(S.EuiDescriptionList,{"data-test-subj":"settingsValues"},Object(E.jsx)(S.EuiDescriptionListTitle,null,Object(E.jsx)(S.EuiTitle,{size:"xs"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexForm.advancedSettings.maxReadRequestSizeTitle",defaultMessage:"Max read request size"}))),Object(E.jsx)(S.EuiDescriptionListDescription,{"data-test-subj":"maxReadReqSize"},i))),Object(E.jsx)(S.EuiFlexItem,null,Object(E.jsx)(S.EuiDescriptionList,{"data-test-subj":"settingsValues"},Object(E.jsx)(S.EuiDescriptionListTitle,null,Object(E.jsx)(S.EuiTitle,{size:"xs"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexForm.advancedSettings.maxWriteRequestOperationCountTitle",defaultMessage:"Max write request operation count"}))),Object(E.jsx)(S.EuiDescriptionListDescription,{"data-test-subj":"maxWriteReqOpCount"},c)))),Object(E.jsx)(S.EuiSpacer,{size:"s"}),Object(E.jsx)(S.EuiFlexGroup,null,Object(E.jsx)(S.EuiFlexItem,null,Object(E.jsx)(S.EuiDescriptionList,{"data-test-subj":"settingsValues"},Object(E.jsx)(S.EuiDescriptionListTitle,null,Object(E.jsx)(S.EuiTitle,{size:"xs"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexForm.advancedSettings.maxWriteRequestSizeTitle",defaultMessage:"Max write request size"}))),Object(E.jsx)(S.EuiDescriptionListDescription,{"data-test-subj":"maxWriteReqSize"},u))),Object(E.jsx)(S.EuiFlexItem,null,Object(E.jsx)(S.EuiDescriptionList,{"data-test-subj":"settingsValues"},Object(E.jsx)(S.EuiDescriptionListTitle,null,Object(E.jsx)(S.EuiTitle,{size:"xs"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexForm.advancedSettings.maxOutstandingWriteRequestsTitle",defaultMessage:"Max outstanding write requests"}))),Object(E.jsx)(S.EuiDescriptionListDescription,{"data-test-subj":"maxOutstandingWriteReq"},d)))),Object(E.jsx)(S.EuiSpacer,{size:"s"}),Object(E.jsx)(S.EuiFlexGroup,null,Object(E.jsx)(S.EuiFlexItem,null,Object(E.jsx)(S.EuiDescriptionList,{"data-test-subj":"settingsValues"},Object(E.jsx)(S.EuiDescriptionListTitle,null,Object(E.jsx)(S.EuiTitle,{size:"xs"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexForm.advancedSettings.maxWriteBufferCountTitle",defaultMessage:"Max write buffer count"}))),Object(E.jsx)(S.EuiDescriptionListDescription,{"data-test-subj":"maxWriteBufferCount"},p))),Object(E.jsx)(S.EuiFlexItem,null,Object(E.jsx)(S.EuiDescriptionList,{"data-test-subj":"settingsValues"},Object(E.jsx)(S.EuiDescriptionListTitle,null,Object(E.jsx)(S.EuiTitle,{size:"xs"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexForm.advancedSettings.maxWriteBufferSizeTitle",defaultMessage:"Max write buffer size"}))),Object(E.jsx)(S.EuiDescriptionListDescription,{"data-test-subj":"maxWriteBufferSize"},x)))),Object(E.jsx)(S.EuiSpacer,{size:"s"}),Object(E.jsx)(S.EuiFlexGroup,null,Object(E.jsx)(S.EuiFlexItem,null,Object(E.jsx)(S.EuiDescriptionList,{"data-test-subj":"settingsValues"},Object(E.jsx)(S.EuiDescriptionListTitle,null,Object(E.jsx)(S.EuiTitle,{size:"xs"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexForm.advancedSettings.maxRetryDelayTitle",defaultMessage:"Max retry delay"}))),Object(E.jsx)(S.EuiDescriptionListDescription,{"data-test-subj":"maxRetryDelay"},f))),Object(E.jsx)(S.EuiFlexItem,null,Object(E.jsx)(S.EuiDescriptionList,{"data-test-subj":"settingsValues"},Object(E.jsx)(S.EuiDescriptionListTitle,null,Object(E.jsx)(S.EuiTitle,{size:"xs"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexForm.advancedSettings.readPollTimeoutTitle",defaultMessage:"Read poll timeout"}))),Object(E.jsx)(S.EuiDescriptionListDescription,{"data-test-subj":"readPollTimeout"},m)))))),Object(E.jsx)(S.EuiSpacer,{size:"l"}),Object(E.jsx)("section",{"data-test-subj":"shardsStatsSection"},a&&a.map(((e,t)=>Object(E.jsx)(s.Fragment,{key:t},Object(E.jsx)(S.EuiSpacer,{size:"m"}),Object(E.jsx)(S.EuiTitle,{size:"xs"},Object(E.jsx)("h3",null,Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexDetailPanel.shardStatsTitle",defaultMessage:"Shard {id} stats",values:{id:e.id}}))),Object(E.jsx)(S.EuiSpacer,{size:"s"}),Object(E.jsx)(S.EuiCodeBlock,{language:"json","data-test-subj":"shardsStats"},JSON.stringify(e,null,2))))))))}renderContent(){const{apiStatus:e,followerIndex:t}=this.props;return e===z.a.LOADING?Object(E.jsx)(S.EuiFlyoutBody,null,Object(E.jsx)(S.EuiFlexGroup,{justifyContent:"flexStart",alignItems:"center",gutterSize:"s"},Object(E.jsx)(S.EuiFlexItem,{grow:!1},Object(E.jsx)(S.EuiLoadingSpinner,{size:"m"})),Object(E.jsx)(S.EuiFlexItem,{grow:!1},Object(E.jsx)(S.EuiText,null,Object(E.jsx)(S.EuiTextColor,{color:"subdued"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexDetailPanel.loadingLabel",defaultMessage:"Loading follower index…"})))))):t?this.renderFollowerIndex():Object(E.jsx)(S.EuiFlyoutBody,null,Object(E.jsx)(S.EuiFlexGroup,{justifyContent:"flexStart",alignItems:"center",gutterSize:"s"},Object(E.jsx)(S.EuiFlexItem,{grow:!1},Object(E.jsx)(S.EuiIcon,{size:"m",type:"warning",color:"danger"})),Object(E.jsx)(S.EuiFlexItem,{grow:!1},Object(E.jsx)(S.EuiText,null,Object(E.jsx)(S.EuiTextColor,{color:"subdued"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexDetailPanel.notFoundLabel",defaultMessage:"Follower index not found"}))))))}renderFooter(){const{followerIndexId:e,followerIndex:t,closeDetailPanel:o}=this.props,s=Object(Ct.getIndexListUri)(`name:${e}`);return Object(E.jsx)(S.EuiFlyoutFooter,null,Object(E.jsx)(S.EuiFlexGroup,{justifyContent:"spaceBetween",alignItems:"center"},Object(E.jsx)(S.EuiFlexItem,{grow:!1},Object(E.jsx)(S.EuiButtonEmpty,{iconType:"cross",flush:"left",onClick:o,"data-test-subj":"closeFlyoutButton"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexDetailPanel.closeButtonLabel",defaultMessage:"Close"}))),Object(E.jsx)(S.EuiFlexItem,{grow:!1},Object(E.jsx)(S.EuiFlexGroup,null,Object(E.jsx)(S.EuiFlexItem,{grow:!1},Object(E.jsx)(S.EuiButton,{href:B._reactRouter.getUrlForApp("management",{path:`data/index_management${s}`}),"data-test-subj":"viewIndexManagementButton"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexDetailPanel.viewIndexLink",defaultMessage:"View in Index Management"}))),t&&Object(E.jsx)(S.EuiFlexItem,{grow:!1},Object(E.jsx)(context_menu_ContextMenu,{iconSide:"left",iconType:"arrowUp",anchorPosition:"upRight",label:Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexDetailPanel.manageButtonLabel",defaultMessage:"Manage"}),followerIndices:[t],testSubj:"manageButton"}))))))}render(){const{followerIndexId:e,closeDetailPanel:t}=this.props;return Object(E.jsx)(S.EuiFlyout,{"data-test-subj":"followerIndexDetail",onClose:t,"aria-labelledby":"followerIndexDetailsFlyoutTitle",size:"m",maxWidth:600},Object(E.jsx)(S.EuiFlyoutHeader,null,Object(E.jsx)(S.EuiTitle,{size:"m",id:"followerIndexDetailsFlyoutTitle","data-test-subj":"title"},Object(E.jsx)("h2",null,e))),this.renderContent(),this.renderFooter())}}const St=z.b.FOLLOWER_INDEX,Tt=Object(n.connect)((e=>({followerIndexId:se("detail")(e),followerIndex:re("detail")(e),apiStatus:G(St)(e)})))(detail_panel_detail_panel_DetailPanel);class follower_indices_list_FollowerIndicesList extends s.PureComponent{constructor(...e){super(...e),k()(this,"state",{lastFollowerIndexId:null,isDetailPanelOpen:!1})}static getDerivedStateFromProps({followerIndexId:e},{lastFollowerIndexId:t}){return e!==t?{lastFollowerIndexId:e,isDetailPanelOpen:!!e}:null}componentDidMount(){const{loadFollowerIndices:e,selectFollowerIndex:t,history:o}=this.props;Object(ke.c)(ke.a.LOADED,z.o),e(),t((({location:{search:e}})=>{const{name:t}=Object(l.extractQueryParams)(e);return t?decodeURIComponent(t):null})(o)),this.interval=setInterval((()=>e(!0)),3e4)}componentDidUpdate(e,t){const{history:o}=this.props,{lastFollowerIndexId:s}=this.state;s!==t.lastFollowerIndexId&&(s?o.replace({search:`?name=${encodeURIComponent(s)}`}):o.replace({search:""}))}componentWillUnmount(){clearInterval(this.interval)}renderEmpty(){return Object(E.jsx)(S.EuiPageContent_Deprecated,{hasShadow:!1,paddingSize:"none",verticalPosition:"center",horizontalPosition:"center"},Object(E.jsx)(S.EuiEmptyPrompt,{iconType:"managementApp","data-test-subj":"emptyPrompt",title:Object(E.jsx)("h1",null,Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexList.emptyPromptTitle",defaultMessage:"Create your first follower index"})),body:Object(E.jsx)("p",null,Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexList.emptyPromptDescription",defaultMessage:"Use a follower index to replicate a leader index on a remote cluster."})),actions:Object(E.jsx)(S.EuiButton,h()({},Object(i.reactRouterNavigate)(this.props.history,"/follower_indices/add"),{fill:!0,iconType:"plusInCircle","data-test-subj":"createFollowerIndexButton"}),Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.addFollowerButtonLabel",defaultMessage:"Create a follower index"}))}))}renderLoading(){return Object(E.jsx)(l.PageLoading,null,Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexList.loadingTitle",defaultMessage:"Loading follower indices..."}))}renderList(){const{selectFollowerIndex:e,followerIndices:t}=this.props,{isDetailPanelOpen:o}=this.state;return Object(E.jsx)(r.a.Fragment,null,Object(E.jsx)(S.EuiText,null,Object(E.jsx)("p",null,Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexList.followerIndicesDescription",defaultMessage:"A follower index replicates a leader index on a remote cluster."}))),Object(E.jsx)(S.EuiSpacer,{size:"l"}),Object(E.jsx)(_t,{followerIndices:t}),o&&Object(E.jsx)(Tt,{closeDetailPanel:()=>e(null)}))}render(){const{followerIndices:e,apiError:t,isAuthorized:o,apiStatus:s}=this.props,r=s===z.a.IDLE&&!e.length;if(!o)return Object(E.jsx)(l.PageError,{title:Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexList.permissionErrorTitle",defaultMessage:"Permission error"}),error:{error:Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexList.noPermissionText",defaultMessage:"You do not have permission to view or add follower indices."})}});if(t){const e=c.i18n.translate("xpack.crossClusterReplication.followerIndexList.loadingErrorTitle",{defaultMessage:"Error loading follower indices"});return Object(E.jsx)(l.PageError,{title:e,error:t.body})}return r?this.renderEmpty():s===z.a.LOADING?this.renderLoading():this.renderList()}}const Lt=z.b.FOLLOWER_INDEX,kt=Object(n.connect)((e=>({followerIndices:ae(e),followerIndexId:se("detail")(e),apiStatus:G(Lt)(e),apiError:H(Lt)(e),isAuthorized:Y(Lt)(e)})),(e=>({loadFollowerIndices:t=>e(Se(t)),selectFollowerIndex:t=>e(_e(t))})))(follower_indices_list_FollowerIndicesList);class home_CrossClusterReplicationHome extends s.PureComponent{constructor(...e){super(...e),k()(this,"state",{activeSection:"follower_indices"}),k()(this,"tabs",[{id:"follower_indices",name:Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternList.followerIndicesTitle",defaultMessage:"Follower indices"}),testSubj:"followerIndicesTab"},{id:"auto_follow_patterns",name:Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternList.autoFollowPatternsTitle",defaultMessage:"Auto-follow patterns"}),testSubj:"autoFollowPatternsTab"}]),k()(this,"onSectionChange",(e=>{u([p(`/${e}`)]),B.navigate(`/${e}`)}))}componentDidMount(){u([p()])}static getDerivedStateFromProps(e){const{match:{params:{section:t}}}=e;return{activeSection:t}}render(){return Object(E.jsx)(r.a.Fragment,null,Object(E.jsx)(S.EuiPageHeader,{bottomBorder:!0,pageTitle:Object(E.jsx)("span",{"data-test-subj":"appTitle"},Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternList.crossClusterReplicationTitle",defaultMessage:"Cross-Cluster Replication"})),tabs:this.tabs.map((e=>({onClick:()=>this.onSectionChange(e.id),isSelected:e.id===this.state.activeSection,key:e.id,"data-test-subj":e.testSubj,label:e.name})))}),Object(E.jsx)(S.EuiSpacer,{size:"l"}),Object(E.jsx)(y,null,Object(E.jsx)(M,{exact:!0,path:"/follower_indices",component:kt}),Object(E.jsx)(M,{exact:!0,path:"/auto_follow_patterns",component:Pt})))}}const At=Object(n.connect)((e=>({autoFollowPatterns:ee(e),isAutoFollowApiAuthorized:Y(z.b.AUTO_FOLLOW_PATTERN)(e),followerIndices:ae(e),isFollowerIndexApiAuthorized:Y(z.b.FOLLOWER_INDEX)(e)})),null)(home_CrossClusterReplicationHome);class auto_follow_pattern_add_AutoFollowPatternAdd extends s.PureComponent{componentDidMount(){u([p("/auto_follow_patterns"),x])}componentWillUnmount(){this.props.clearApiError()}render(){const{saveAutoFollowPattern:e,apiStatus:t,apiError:o,match:{url:s}}=this.props;return Object(E.jsx)(remote_clusters_provider_RemoteClustersProvider,null,(({isLoading:r,error:a,remoteClusters:n})=>r?Object(E.jsx)(S.EuiPageContent_Deprecated,{verticalPosition:"center",horizontalPosition:"center",color:"subdued","data-test-subj":"remoteClustersLoading"},Object(E.jsx)(l.SectionLoading,null,Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternCreateForm.loadingRemoteClustersMessage",defaultMessage:"Loading remote clusters…"}))):Object(E.jsx)(S.EuiPageContentBody_Deprecated,{restrictWidth:!0,style:{width:"100%"}},Object(E.jsx)(Je,{title:Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPattern.addTitle",defaultMessage:"Add auto-follow pattern"})}),Object(E.jsx)(auto_follow_pattern_form_AutoFollowPatternForm,{apiStatus:t,apiError:o,currentUrl:s,remoteClusters:a?[]:n,saveAutoFollowPattern:e,saveButtonLabel:Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternCreateForm.saveButtonLabel",defaultMessage:"Create"})}))))}}const Dt=z.b.AUTO_FOLLOW_PATTERN,Nt=Object(n.connect)((e=>({apiStatus:G(`${Dt}-save`)(e),apiError:H(`${Dt}-save`)(e)})),(e=>({saveAutoFollowPattern:(t,o)=>e(Pe(t,o)),clearApiError:()=>e(Ce(Dt))})))(auto_follow_pattern_add_AutoFollowPatternAdd);class auto_follow_pattern_edit_AutoFollowPatternEdit extends s.PureComponent{constructor(...e){super(...e),k()(this,"state",{lastAutoFollowPatternId:void 0})}static getDerivedStateFromProps({autoFollowPatternId:e},{lastAutoFollowPatternId:t}){return t!==e?{lastAutoFollowPatternId:e}:null}componentDidMount(){const{match:{params:{id:e}},selectAutoFollowPattern:t}=this.props;t(decodeURIComponent(e)),u([p("/auto_follow_patterns"),f])}componentDidUpdate(e,t){const{autoFollowPattern:o,getAutoFollowPattern:s}=this.props;o||t.lastAutoFollowPatternId===this.state.lastAutoFollowPatternId||s(this.state.lastAutoFollowPatternId)}componentWillUnmount(){this.props.clearApiError()}renderGetAutoFollowPatternError(e){const{match:{params:{id:t}}}=this.props,o=404===e.body.statusCode?{error:c.i18n.translate("xpack.crossClusterReplication.autoFollowPatternEditForm.loadingErrorMessage",{defaultMessage:"The auto-follow pattern '{name}' does not exist.",values:{name:t}})}:e;return Object(E.jsx)(S.EuiPageContent_Deprecated,{verticalPosition:"center",horizontalPosition:"center",color:"danger"},Object(E.jsx)(S.EuiEmptyPrompt,{iconType:"warning",title:Object(E.jsx)("h2",null,Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternEditForm.loadingErrorTitle",defaultMessage:"Error loading auto-follow pattern"})),body:Object(E.jsx)("p",null,o),actions:Object(E.jsx)(S.EuiButton,h()({},Object(i.reactRouterNavigate)(this.props.history,"/auto_follow_patterns"),{color:"danger",flush:"left",iconType:"arrowLeft","data-test-subj":"viewAutoFollowPatternListButton"}),Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternEditForm.viewAutoFollowPatternsButtonLabel",defaultMessage:"View auto-follow patterns"}))}))}renderLoading(e){return Object(E.jsx)(S.EuiPageContent_Deprecated,{verticalPosition:"center",horizontalPosition:"center",color:"subdued"},Object(E.jsx)(l.SectionLoading,null,e))}render(){const{saveAutoFollowPattern:e,apiStatus:t,apiError:o,autoFollowPattern:s,match:{url:r}}=this.props;return t.get!==z.a.LOADING&&s?o.get?this.renderGetAutoFollowPatternError(o.get):Object(E.jsx)(remote_clusters_provider_RemoteClustersProvider,null,(({isLoading:a,error:n,remoteClusters:l})=>a?this.renderLoading(c.i18n.translate("xpack.crossClusterReplication.autoFollowPatternEditForm.loadingRemoteClustersMessage",{defaultMessage:"Loading remote clusters…"})):Object(E.jsx)(S.EuiPageContentBody_Deprecated,{restrictWidth:!0,style:{width:"100%"}},Object(E.jsx)(Je,{title:Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPattern.editTitle",defaultMessage:"Edit auto-follow pattern"})}),Object(E.jsx)(auto_follow_pattern_form_AutoFollowPatternForm,{apiStatus:t.save,apiError:o.save,currentUrl:r,remoteClusters:n?[]:l,autoFollowPattern:s,saveAutoFollowPattern:e,saveButtonLabel:Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.autoFollowPatternEditForm.saveButtonLabel",defaultMessage:"Update"})})))):this.renderLoading(c.i18n.translate("xpack.crossClusterReplication.autoFollowPatternEditForm.loadingTitle",{defaultMessage:"Loading auto-follow pattern…"}))}}const Bt=z.b.AUTO_FOLLOW_PATTERN,qt=Object(n.connect)((e=>({apiStatus:{get:G(`${Bt}-get`)(e),save:G(`${Bt}-save`)(e)},apiError:{get:H(`${Bt}-get`)(e),save:H(`${Bt}-save`)(e)},autoFollowPatternId:J("edit")(e),autoFollowPattern:Z("edit")(e)})),(e=>({getAutoFollowPattern:t=>e((e=>Ee({label:pe,scope:`${Me}-get`,handler:async()=>await Object(q.d)(e)}))(t)),selectAutoFollowPattern:t=>e((e=>({type:ue,payload:e}))(t)),saveAutoFollowPattern:(t,o)=>{const{active:s,remoteCluster:r,leaderIndexPatterns:a,followIndexPattern:n}=o;e(Pe(t,{active:s,remoteCluster:r,leaderIndexPatterns:a,followIndexPattern:n},!0))},clearApiError:()=>{e(Ce(`${Bt}-get`)),e(Ce(`${Bt}-save`))}})))(auto_follow_pattern_edit_AutoFollowPatternEdit);class follower_index_add_FollowerIndexAdd extends s.PureComponent{componentDidMount(){u([p("/follower_indices"),x])}componentWillUnmount(){this.props.clearApiError()}render(){const{saveFollowerIndex:e,clearApiError:t,apiStatus:o,apiError:s,match:{url:r}}=this.props;return Object(E.jsx)(remote_clusters_provider_RemoteClustersProvider,null,(({isLoading:a,error:n,remoteClusters:i})=>a?Object(E.jsx)(S.EuiPageContent_Deprecated,{verticalPosition:"center",horizontalPosition:"center",color:"subdued","data-test-subj":"remoteClustersLoading"},Object(E.jsx)(l.SectionLoading,null,Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexCreateForm.loadingRemoteClustersMessage",defaultMessage:"Loading remote clusters…"}))):Object(E.jsx)(S.EuiPageContentBody_Deprecated,{restrictWidth:!0,style:{width:"100%"}},Object(E.jsx)(mt,{title:Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndex.addTitle",defaultMessage:"Add follower index"})}),Object(E.jsx)(follower_index_form_FollowerIndexForm,{apiStatus:o,apiError:s,currentUrl:r,remoteClusters:n?[]:i,saveFollowerIndex:e,clearApiError:t,saveButtonLabel:Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexCreateForm.saveButtonLabel",defaultMessage:"Create"})}))))}}const zt=z.b.FOLLOWER_INDEX,Ut=Object(n.connect)((e=>({apiStatus:G(`${zt}-save`)(e),apiError:H(`${zt}-save`)(e)})),(e=>({saveFollowerIndex:(t,o)=>e(Te(t,o)),clearApiError:()=>e(Ce(`${zt}-save`))})))(follower_index_add_FollowerIndexAdd);class follower_index_edit_FollowerIndexEdit extends s.PureComponent{constructor(...e){super(...e),k()(this,"state",{lastFollowerIndexId:void 0,showConfirmModal:!1}),k()(this,"saveFollowerIndex",((e,t)=>{this.editedFollowerIndexPayload={name:e,followerIndex:t},this.showConfirmModal()})),k()(this,"confirmSaveFollowerIhdex",(()=>{const{name:e,followerIndex:t}=this.editedFollowerIndexPayload;this.props.saveFollowerIndex(e,t),this.closeConfirmModal()})),k()(this,"showConfirmModal",(()=>this.setState({showConfirmModal:!0}))),k()(this,"closeConfirmModal",(()=>this.setState({showConfirmModal:!1}))),k()(this,"renderConfirmModal",(()=>{const{followerIndexId:e,followerIndex:{isPaused:t}}=this.props,o=c.i18n.translate("xpack.crossClusterReplication.followerIndexEditForm.confirmModal.title",{defaultMessage:"Update follower index '{id}'?",values:{id:e}});return Object(E.jsx)(S.EuiConfirmModal,{title:o,onCancel:this.closeConfirmModal,onConfirm:this.confirmSaveFollowerIhdex,cancelButtonText:c.i18n.translate("xpack.crossClusterReplication.followerIndexEditForm.confirmModal.cancelButtonText",{defaultMessage:"Cancel"}),confirmButtonText:t?Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexEditForm.confirmModal.confirmAndResumeButtonText",defaultMessage:"Update and resume"}):Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexEditForm.confirmModal.confirmButtonText",defaultMessage:"Update"})},Object(E.jsx)("p",null,t?Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexEditForm.confirmModal.resumeDescription",defaultMessage:"Updating a follower index resumes replication of its leader index."}):Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexEditForm.confirmModal.description",defaultMessage:"The follower index is paused, then resumed. If the update fails, try manually resuming replication."})))}))}static getDerivedStateFromProps({followerIndexId:e},{lastFollowerIndexId:t}){return t!==e?{lastFollowerIndexId:e}:null}componentDidMount(){const{match:{params:{id:e}},selectFollowerIndex:t}=this.props;let o;try{o=decodeURI(e),o=decodeURIComponent(o)}catch(t){o=decodeURIComponent(e)}t(o),u([p("/follower_indices"),f])}componentDidUpdate(e,t){const{followerIndex:o,getFollowerIndex:s}=this.props;o||t.lastFollowerIndexId===this.state.lastFollowerIndexId||s(this.state.lastFollowerIndexId)}componentWillUnmount(){this.props.clearApiError()}renderLoading(e){return Object(E.jsx)(S.EuiPageContent_Deprecated,{verticalPosition:"center",horizontalPosition:"center",color:"subdued"},Object(E.jsx)(l.SectionLoading,null,e))}renderGetFollowerIndexError(e){const{match:{params:{id:t}}}=this.props,o=404===e.body.statusCode?{error:c.i18n.translate("xpack.crossClusterReplication.followerIndexEditForm.loadingErrorMessage",{defaultMessage:"The follower index '{name}' does not exist.",values:{name:t}})}:e;return Object(E.jsx)(S.EuiPageContent_Deprecated,{verticalPosition:"center",horizontalPosition:"center",color:"danger"},Object(E.jsx)(S.EuiEmptyPrompt,{iconType:"warning",title:Object(E.jsx)("h2",null,Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexEditForm.loadingErrorTitle",defaultMessage:"Error loading follower index"})),body:Object(E.jsx)("p",null,o),actions:Object(E.jsx)(S.EuiButton,h()({},Object(i.reactRouterNavigate)(this.props.history,"/follower_indices"),{color:"danger",flush:"left",iconType:"arrowLeft"}),Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexEditForm.viewFollowerIndicesButtonLabel",defaultMessage:"View follower indices"}))}))}render(){const{clearApiError:e,apiStatus:t,apiError:o,followerIndex:s,match:{url:r}}=this.props,{showConfirmModal:a}=this.state,{shards:n,...l}=s||{};return t.get!==z.a.LOADING&&s?o.get?this.renderGetFollowerIndexError(o.get):Object(E.jsx)(remote_clusters_provider_RemoteClustersProvider,null,(({isLoading:s,error:n,remoteClusters:i})=>s?this.renderLoading(c.i18n.translate("xpack.crossClusterReplication.followerIndexEditForm.loadingRemoteClustersMessage",{defaultMessage:"Loading remote clusters…"})):Object(E.jsx)(S.EuiPageContentBody_Deprecated,{restrictWidth:!0,style:{width:"100%"}},Object(E.jsx)(mt,{title:Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndex.editTitle",defaultMessage:"Edit follower index"})}),Object(E.jsx)(follower_index_form_FollowerIndexForm,{followerIndex:l,apiStatus:t.save,apiError:o.save,currentUrl:r,remoteClusters:n?[]:i,saveFollowerIndex:this.saveFollowerIndex,clearApiError:e,saveButtonLabel:Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.followerIndexEditForm.saveButtonLabel",defaultMessage:"Update"})}),a&&this.renderConfirmModal()))):this.renderLoading(c.i18n.translate("xpack.crossClusterReplication.followerIndexEditForm.loadingFollowerIndexTitle",{defaultMessage:"Loading follower index…"}))}}const Wt=z.b.FOLLOWER_INDEX,Vt=Object(n.connect)((e=>({apiStatus:{get:G(`${Wt}-get`)(e),save:G(`${Wt}-save`)(e)},apiError:{get:H(`${Wt}-get`)(e),save:H(`${Wt}-save`)(e)},followerIndexId:se("edit")(e),followerIndex:re("edit")(e)})),(e=>({getFollowerIndex:t=>e((e=>Ee({label:he,scope:`${ye}-get`,handler:async()=>await Object(q.e)(e)}))(t)),selectFollowerIndex:t=>e((e=>({type:be,payload:e}))(t)),saveFollowerIndex:(t,o)=>e(Te(t,o,!0)),clearApiError:()=>{e(Ce(`${Wt}-get`)),e(Ce(`${Wt}-save`))}})))(follower_index_edit_FollowerIndexEdit);class app_AppComponent extends s.Component{constructor(e){super(e),this.registerRouter(),this.state={isFetchingPermissions:!1,fetchPermissionError:void 0,hasPermission:!1,missingClusterPrivileges:[]}}componentDidMount(){this.checkPermissions()}async checkPermissions(){this.setState({isFetchingPermissions:!0});try{const{hasPermission:e,missingClusterPrivileges:t}=await Object(q.j)();this.setState({isFetchingPermissions:!1,hasPermission:e,missingClusterPrivileges:t})}catch(e){if(e&&e.body)return this.setState({isFetchingPermissions:!1,fetchPermissionError:e});Object(T.a)().add(e,c.i18n.translate("xpack.crossClusterReplication.app.checkPermissionsFatalErrorTitle",{defaultMessage:"Cross-Cluster Replication app"}))}}registerRouter(){const{history:e,getUrlForApp:t}=this.props;B.reactRouter={history:e,route:{location:e.location},getUrlForApp:t}}render(){const{isFetchingPermissions:e,fetchPermissionError:t,hasPermission:o,missingClusterPrivileges:s}=this.state;return e?Object(E.jsx)(S.EuiPageContent_Deprecated,{verticalPosition:"center",horizontalPosition:"center",color:"subdued"},Object(E.jsx)(l.SectionLoading,null,Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.app.permissionCheckTitle",defaultMessage:"Checking permissions…"}))):t?Object(E.jsx)(l.PageError,{title:Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.app.permissionCheckErrorTitle",defaultMessage:"Error checking permissions"}),error:t}):o?Object(E.jsx)(v,{history:this.props.history},Object(E.jsx)(y,null,Object(E.jsx)(b.Redirect,{exact:!0,from:"/",to:"/follower_indices"}),Object(E.jsx)(M,{exact:!0,path:"/auto_follow_patterns/add",component:Nt}),Object(E.jsx)(M,{exact:!0,path:"/auto_follow_patterns/edit/:id",component:qt}),Object(E.jsx)(M,{exact:!0,path:"/follower_indices/add",component:Ut}),Object(E.jsx)(M,{exact:!0,path:"/follower_indices/edit/:id",component:Vt}),Object(E.jsx)(M,{exact:!0,path:["/:section"],component:At}))):Object(E.jsx)(S.EuiPageContent_Deprecated,{verticalPosition:"center",horizontalPosition:"center",color:"subdued"},Object(E.jsx)(S.EuiEmptyPrompt,{iconType:"securityApp",title:Object(E.jsx)("h2",null,Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.app.deniedPermissionTitle",defaultMessage:"You're missing cluster privileges"})),body:Object(E.jsx)("p",null,Object(E.jsx)(_.FormattedMessage,{id:"xpack.crossClusterReplication.app.deniedPermissionDescription",defaultMessage:"To use Cross-Cluster Replication, you must have {clusterPrivilegesCount, plural, one {this cluster privilege} other {these cluster privileges}}: {clusterPrivileges}.",values:{clusterPrivileges:s.join(", "),clusterPrivilegesCount:s.length}}))}))}}const $t=app_AppComponent;var Gt=o(46),Ht=o(76),Yt=o.n(Ht);const Xt={status:{[z.b.AUTO_FOLLOW_PATTERN]:z.a.IDLE,[z.b.FOLLOWER_INDEX]:z.a.IDLE},error:{[z.b.AUTO_FOLLOW_PATTERN]:null,[z.b.FOLLOWER_INDEX]:null}},Kt={byId:{},selectedDetailId:null,selectedEditId:null},Qt=e=>`${e}_SUCCESS`,Jt=(e,t,o)=>{const s={...t};return e.forEach((e=>{s[e].active=o})),s},Zt=e=>{const{followIndexPatternPrefix:t,followIndexPatternSuffix:o}=(e=>{let t,o;const s="{{leader_index}}",r=e.indexOf(s);return r>=0&&(t=e.slice(0,r),o=e.slice(r+s.length)),{followIndexPatternPrefix:t,followIndexPatternSuffix:o}})(e.followIndexPattern);return{...e,followIndexPatternPrefix:t,followIndexPatternSuffix:o}},eo={byId:{},selectedDetailId:null,selectedEditId:null},to=e=>`${e}_SUCCESS`,oo=e=>({...e,isPaused:"paused"===e.status}),so=e=>{if(!e.leaderIndex)return null;const{leaderIndex:t,autoFollowException:o,timestamp:s}=e;return{id:t.substring(0,t.lastIndexOf(":")),timestamp:s,leaderIndex:t,autoFollowException:o}},ro=(e,t=5)=>e.map(so).filter((e=>null!==e)).reduce(((e,o)=>(e[o.id]||(e[o.id]=[]),e[o.id].length===t||e[o.id].push(o),e)),{}),ao={autoFollow:null},no=Object(Gt.combineReducers)({autoFollowPattern:(e=Kt,t)=>{switch(t.type){case Qt(de):return{...e,byId:V(t.payload.patterns.map(Zt),"name")};case Qt(pe):return{...e,byId:{...e.byId,[t.payload.name]:Zt(t.payload)}};case ce:return{...e,selectedDetailId:t.payload};case ue:return{...e,selectedEditId:t.payload};case Qt(xe):{const o={...e.byId},{itemsDeleted:s}=t.payload;return s.forEach((e=>delete o[e])),{...e,byId:o}}case Qt(fe):{const{itemsPaused:o}=t.payload;return{...e,byId:Jt(o,e.byId,!1)}}case Qt(me):{const{itemsResumed:o}=t.payload;return{...e,byId:Jt(o,e.byId,!0)}}default:return e}},followerIndex:(e=eo,t)=>{switch(t.type){case to(ge):return{...e,byId:V(t.payload.indices.map(oo),"name")};case to(he):return{...e,byId:{...e.byId,[t.payload.name]:oo(t.payload)}};case je:return{...e,selectedDetailId:t.payload};case be:return{...e,selectedEditId:t.payload};case to(we):{const o={...e.byId},{itemsUnfollowed:s}=t.payload;return s.forEach((e=>delete o[e])),{...e,byId:o}}default:return e}},api:(e=Xt,t)=>{const o=t.payload||{},{scope:s,status:r,error:a}=o;switch(t.type){case ne:return{...e,status:{...e.status,[s]:r}};case le:return{...e,status:{...e.status,[s]:z.a.IDLE}};case ie:return{...e,error:{...e.error,[s]:a}};default:return e}},stats:(e=ao,t)=>{if(t.type===(e=>`${e}_SUCCESS`)(Oe)){const{recentAutoFollowErrors:o,...s}=t.payload;return{...e,autoFollow:{...s,recentAutoFollowErrors:ro(o)}}}return e}}),lo=function(e={}){const t=[Object(Gt.applyMiddleware)(Yt.a)];return window.__REDUX_DEVTOOLS_EXTENSION__&&t.push(window.__REDUX_DEVTOOLS_EXTENSION__()),Object(Gt.createStore)(no,e,Object(Gt.compose)(...t))}(),io=({history:e,executionContext:t,getUrlForApp:o})=>(Object(i.useExecutionContext)(t,{type:"application",page:"crossClusterReplication"}),Object(E.jsx)($t,{history:e,getUrlForApp:o})),co=(e,t,o,s,r,l)=>(Object(a.render)(Object(E.jsx)(t,null,Object(E.jsx)(i.KibanaThemeProvider,{theme$:r},Object(E.jsx)(n.Provider,{store:lo},Object(E.jsx)(io,{history:o,getUrlForApp:s,executionContext:l})))),e),()=>Object(a.unmountComponentAtNode)(e));async function uo({element:e,setBreadcrumbs:t,I18nContext:o,docLinks:s,history:r,getUrlForApp:a,theme$:n,executionContext:l}){return d(t),j(s),co(e,o,r,a,n,l)}}])]);