(window["alertingDashboards_bundle_jsonpfunction"]=window["alertingDashboards_bundle_jsonpfunction"]||[]).push([[19],{2155: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__(2766)},2766: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__(17));var _reactRouterDom=__webpack_require__(74);var _react2=__webpack_require__(10);var _i18n=__webpack_require__(2);var _eui=__webpack_require__(4);var _lib=__webpack_require__(627);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function(e){return e?t:r})(e)}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u]}return n.default=e,t&&t.set(e,n),n}let allowedObjectTypes;const title=_i18n.i18n.translate("savedObjectsManagement.objects.savedObjectsTitle",{defaultMessage:"Saved Objects"});const SavedObjectsEditionPage=(0,_react.lazy)(()=>__webpack_require__.e(14).then(__webpack_require__.t.bind(null,2790,7)));const SavedObjectsTablePage=(0,_react.lazy)(()=>__webpack_require__.e(10).then(__webpack_require__.t.bind(null,2799,7)));const mountManagementSection=async _ref=>{let{core:core,mountParams:mountParams,serviceRegistry:serviceRegistry,dataSourceEnabled:dataSourceEnabled,dataSourceManagement:dataSourceManagement}=_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;let{children:children}=_ref2;const allowed=(_capabilities$managem=capabilities===null||capabilities===void 0||(_capabilities$managem2=capabilities.management)===null||_capabilities$managem2===void 0||(_capabilities$managem2=_capabilities$managem2.opensearchDashboards)===null||_capabilities$managem2===void 0?void 0:_capabilities$managem2.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,dataSourceEnabled:dataSourceEnabled,dataSourceManagement:dataSourceManagement}))))))),element);return()=>{_reactDom.default.unmountComponentAtNode(element)}};exports.mountManagementSection=mountManagementSection}}]);