"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.shouldShowSelectionToolbar = void 0;
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
/**
 * Determines whether the selection (inline) toolbar should be shown based on contextual formatting mode
 * and toolbar docking position preference.
 *
 * @param contextualFormattingEnabled - The contextual formatting mode
 * @param toolbarDockingPosition - The user's toolbar docking preference
 * @returns true if the selection toolbar should be displayed, false otherwise
 */
var shouldShowSelectionToolbar = exports.shouldShowSelectionToolbar = function shouldShowSelectionToolbar(contextualFormattingEnabled, toolbarDockingPosition) {
  if ((0, _platformFeatureFlags.fg)('platform_editor_toolbar_aifc_placement_overridden')) {
    if (contextualFormattingEnabled === 'controlled') {
      return toolbarDockingPosition === 'top';
    }
    if (contextualFormattingEnabled === 'always-inline') {
      return true;
    }
    return false;
  }
  return toolbarDockingPosition === 'top';
};