(window["alertingDashboards_bundle_jsonpfunction"]=window["alertingDashboards_bundle_jsonpfunction"]||[]).push([[18],{2271:function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"mountManagementSection",{enumerable:true,get:function(){return _mount_section.mountManagementSection}});var _mount_section=__webpack_require__(2758)},2758:function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.mountManagementSection=void 0;var _react=_interopRequireWildcard(__webpack_require__(0));var _reactDom=_interopRequireDefault(__webpack_require__(19));var _reactRouterDom=__webpack_require__(87);var _react2=__webpack_require__(11);var _i18n=__webpack_require__(2);var _eui=__webpack_require__(4);var _lib=__webpack_require__(677);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap;var cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj}}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj)}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc)}else{newObj[key]=obj[key]}}}newObj.default=obj;if(cache){cache.set(obj,newObj)}return newObj}let allowedObjectTypes;const title=_i18n.i18n.translate("savedObjectsManagement.objects.savedObjectsTitle",{defaultMessage:"Saved Objects"});const SavedObjectsEditionPage=(0,_react.lazy)(()=>__webpack_require__.e(13).then(__webpack_require__.t.bind(null,2759,7)));const SavedObjectsTablePage=(0,_react.lazy)(()=>__webpack_require__.e(8).then(__webpack_require__.t.bind(null,2768,7)));const mountManagementSection=async _ref=>{let{core:core,mountParams:mountParams,serviceRegistry:serviceRegistry}=_ref;const[coreStart,{data:data,uiActions:uiActions},pluginStart]=await core.getStartServices();const{element:element,history:history,setBreadcrumbs:setBreadcrumbs}=mountParams;if(allowedObjectTypes===undefined){allowedObjectTypes=await(0,_lib.getAllowedTypes)(coreStart.http)}coreStart.chrome.docTitle.change(title);const capabilities=coreStart.application.capabilities;const RedirectToHomeIfUnauthorized=_ref2=>{var _capabilities$managem,_capabilities$managem2,_capabilities$managem3;let{children:children}=_ref2;const allowed=(_capabilities$managem=capabilities===null||capabilities===void 0?void 0:(_capabilities$managem2=capabilities.management)===null||_capabilities$managem2===void 0?void 0:(_capabilities$managem3=_capabilities$managem2.opensearchDashboards)===null||_capabilities$managem3===void 0?void 0:_capabilities$managem3.objects)!==null&&_capabilities$managem!==void 0?_capabilities$managem:false;if(!allowed){coreStart.application.navigateToApp("home");return null}return children};_reactDom.default.render(_react.default.createElement(_react2.I18nProvider,null,_react.default.createElement(_reactRouterDom.Router,{history:history},_react.default.createElement(_reactRouterDom.Switch,null,_react.default.createElement(_reactRouterDom.Route,{path:"/:service/:id",exact:true},_react.default.createElement(RedirectToHomeIfUnauthorized,null,_react.default.createElement(_react.Suspense,{fallback:_react.default.createElement(_eui.EuiLoadingSpinner,null)},_react.default.createElement(SavedObjectsEditionPage,{coreStart:coreStart,uiActionsStart:uiActions,serviceRegistry:serviceRegistry,setBreadcrumbs:setBreadcrumbs,history:history})))),_react.default.createElement(_reactRouterDom.Route,{path:"/",exact:false},_react.default.createElement(RedirectToHomeIfUnauthorized,null,_react.default.createElement(_react.Suspense,{fallback:_react.default.createElement(_eui.EuiLoadingSpinner,null)},_react.default.createElement(SavedObjectsTablePage,{coreStart:coreStart,dataStart:data,serviceRegistry:serviceRegistry,actionRegistry:pluginStart.actions,columnRegistry:pluginStart.columns,namespaceRegistry:pluginStart.namespaces,allowedTypes:allowedObjectTypes,setBreadcrumbs:setBreadcrumbs}))))))),element);return()=>{_reactDom.default.unmountComponentAtNode(element)}};exports.mountManagementSection=mountManagementSection}}]);