import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { cn } from "../../../../lib/utils";
import { AgentModeSelector } from "./AgentModeSelector";
import { AgentSettingsPopover } from "./AgentSettingsPopover";
import { AgentPredefinedPromptsButton } from "./AgentPredefinedPromptsButton";
import { AgentMobileStatusPopover } from "./AgentMobileStatusPopover";
import { AgentPromptActionButtons } from "./AgentPromptActionButtons";
import { hasPromptPlaceholders, isPromptInPlaceholderMode, } from "../agentPromptPlaceholders";
export function AgentFullPromptControls({ prompt, hasActivePlaceholderInput, hideBottomControls, simpleMode, showAgentConfigControls, readOnly, mode, modeOptions, onModeChange, settingsOpen, onSettingsOpenChange, settingsContent, predefinedPrompts, predefinedOpen, onPredefinedOpenChange, onSelectPredefinedPrompt, showMobileStatusPopover, mobileStatusOpen, onMobileStatusOpenChange, mobileStatusContent, isVoiceDisabled, isListening, isExecuting, pendingApprovalCount, allPlaceholdersFilled, onVoicePointerDown, onVoicePointerUp, onVoicePointerCancel, onStop, onSubmit, }) {
    const isInPlaceholderMode = isPromptInPlaceholderMode({
        prompt,
        hasActivePlaceholderInput,
    });
    const placeholderShowsOwnButtons = hideBottomControls && isInPlaceholderMode;
    if (placeholderShowsOwnButtons) {
        return null;
    }
    const shouldShowConfigControls = (showAgentConfigControls ?? !hideBottomControls) &&
        !simpleMode &&
        !isInPlaceholderMode;
    return (_jsxs("div", { className: cn("mt-2 flex items-stretch gap-2", shouldShowConfigControls ? "justify-between" : "justify-end"), children: [shouldShowConfigControls ? (_jsxs("div", { className: "flex flex-wrap items-center justify-start gap-2", children: [readOnly ? (_jsx("span", { className: "rounded-badge badge-pad-sm bg-neutral-grey-5 text-2xs text-neutral-grey-50 shrink-0", title: "You have View-only access to this agent.", "data-testid": "agent-read-only-badge", children: "Read-only" })) : null, _jsx(AgentModeSelector, { mode: mode, options: modeOptions, readOnly: readOnly, onModeChange: onModeChange }), _jsx(AgentSettingsPopover, { open: settingsOpen, onOpenChange: onSettingsOpenChange, children: settingsContent }), _jsx(AgentPredefinedPromptsButton, { prompts: predefinedPrompts, open: predefinedOpen, onOpenChange: onPredefinedOpenChange, onSelectPrompt: onSelectPredefinedPrompt }), showMobileStatusPopover ? (_jsx(AgentMobileStatusPopover, { open: mobileStatusOpen, onOpenChange: onMobileStatusOpenChange, children: mobileStatusContent })) : null] })) : null, _jsx(AgentPromptActionButtons, { isVoiceDisabled: isVoiceDisabled, isListening: isListening, isExecuting: isExecuting, sendDisabled: readOnly ||
                    (!isExecuting &&
                        (pendingApprovalCount > 0 ||
                            (!prompt.trim() && !hasActivePlaceholderInput) ||
                            (hasPromptPlaceholders(prompt) && !allPlaceholdersFilled) ||
                            (hasActivePlaceholderInput && !allPlaceholdersFilled))), sendTitle: readOnly
                    ? "Read-only access"
                    : isExecuting
                        ? "Stop"
                        : pendingApprovalCount > 0
                            ? "Approve or reject pending tool calls first"
                            : "Send", onVoicePointerDown: onVoicePointerDown, onVoicePointerUp: onVoicePointerUp, onVoicePointerCancel: onVoicePointerCancel, onStop: onStop, onSubmit: onSubmit })] }));
}
//# sourceMappingURL=AgentFullPromptControls.js.map