(window["alertingDashboards_bundle_jsonpfunction"]=window["alertingDashboards_bundle_jsonpfunction"]||[]).push([[19],{2965:function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _react=_interopRequireWildcard(__webpack_require__(0));var _query_editor_extension=__webpack_require__(822);var _utils=__webpack_require__(3432);const _excluded=["configMap","componentContainer","bannerContainer","bottomPanelContainer","queryControlsContainer"];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&&{}.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}function _objectWithoutProperties(e,t){if(null==e)return{};var o,r,i=_objectWithoutPropertiesLoose(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(r=0;r<n.length;r++)o=n[r],-1===t.indexOf(o)&&{}.propertyIsEnumerable.call(e,o)&&(i[o]=e[o])}return i}function _objectWithoutPropertiesLoose(r,e){if(null==r)return{};var t={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(-1!==e.indexOf(n))continue;t[n]=r[n]}return t}const QueryEditorExtensions=_react.default.memo(props=>{const{configMap:configMap,componentContainer:componentContainer,bannerContainer:bannerContainer,bottomPanelContainer:bottomPanelContainer,queryControlsContainer:queryControlsContainer}=props,dependencies=_objectWithoutProperties(props,_excluded);const sortedConfigs=(0,_react.useMemo)(()=>{if(!configMap||Object.keys(configMap).length===0)return[];return Object.values(configMap).sort((a,b)=>a.order-b.order)},[configMap]);return _react.default.createElement(_react.default.Fragment,null,sortedConfigs.map(config=>{const extensionComponentContainer=(0,_utils.createOrGetExtensionContainer)({extensionConfigId:config.id,containerName:"osdQueryEditorExtensionComponent",parentContainer:componentContainer});const extensionQueryControlsContainer=(0,_utils.createOrGetExtensionContainer)({extensionConfigId:config.id,containerName:"osdQueryEditorExtensionQueryControls",parentContainer:queryControlsContainer});const extensionActionBarContainer=(0,_utils.createOrGetExtensionContainer)({extensionConfigId:config.id,containerName:"osdQueryEditorExtensionActionBarContainer",parentContainer:document.getElementById(_query_editor_extension.ACTION_BAR_BUTTONS_CONTAINER_ID)});return _react.default.createElement(_query_editor_extension.QueryEditorExtension,{key:config.id,config:config,dependencies:dependencies,componentContainer:extensionComponentContainer,bannerContainer:bannerContainer,bottomPanelContainer:bottomPanelContainer,queryControlsContainer:extensionQueryControlsContainer,actionBarContainer:extensionActionBarContainer})}))});var _default=exports.default=QueryEditorExtensions;module.exports=exports.default},3432:function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.createOrGetExtensionContainer=void 0;const createOrGetExtensionContainer=_ref=>{let{extensionConfigId:extensionConfigId,containerName:containerName,parentContainer:parentContainer}=_ref;const extensionId=`${containerName}-${extensionConfigId}`;let extensionContainer=document.getElementById(extensionId);if(!extensionContainer){extensionContainer=document.createElement("div");extensionContainer.className=`${containerName} ${containerName}__${extensionConfigId}`;extensionContainer.id=extensionId;parentContainer===null||parentContainer===void 0||parentContainer.appendChild(extensionContainer)}return extensionContainer};exports.createOrGetExtensionContainer=createOrGetExtensionContainer}}]);