"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.shouldShowPrimaryToolbar = void 0;
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
/**
 * Determines whether the primary (top) 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 primary toolbar should be displayed, false otherwise
 */
var shouldShowPrimaryToolbar = exports.shouldShowPrimaryToolbar = function shouldShowPrimaryToolbar(contextualFormattingEnabled, toolbarDockingPosition) {
  if ((0, _platformFeatureFlags.fg)('platform_editor_toolbar_aifc_placement_overridden')) {
    if (contextualFormattingEnabled === 'controlled') {
      return toolbarDockingPosition !== 'none';
    }
    if (contextualFormattingEnabled === 'always-pinned') {
      return true;
    }
    return false;
  }
  return toolbarDockingPosition !== 'none';
};