"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getDatasourceType = exports.canRenderDatasource = void 0;
var _linkDatasource = require("@atlaskit/link-datasource");
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
var getDatasourceType = exports.getDatasourceType = function getDatasourceType(datasourceId) {
  switch (datasourceId) {
    case _linkDatasource.JIRA_LIST_OF_LINKS_DATASOURCE_ID:
      return 'jira';
    case _linkDatasource.ASSETS_LIST_OF_LINKS_DATASOURCE_ID:
      return 'assets';
    case _linkDatasource.CONFLUENCE_SEARCH_DATASOURCE_ID:
      return 'confluence-search';
    default:
      return undefined;
  }
};
var canRenderDatasource = exports.canRenderDatasource = function canRenderDatasource(datasourceId) {
  var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  var datasourceType = getDatasourceType(datasourceId);
  switch (datasourceType) {
    case 'jira':
      return true;
    case 'assets':
      if ((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.datasource-assets_objects')) {
        return true;
      }
      return false;
    default:
      return defaultValue;
  }
};