import { i18n } from "../../../i18n/gpt/dialog/index.js";
export function getAlertGptInfo(gptAlert) {
    return {
        alertMessage: gptAlert?.message || i18n('alert-gpt-presets-info'),
        alertTheme: gptAlert?.theme || 'info',
        alertClassName: gptAlert?.className,
    };
}
export function getDisableReplaceButtonText(disablePromptPresets) {
    return disablePromptPresets ? i18n(`replace-disabled`) : i18n(`replace`);
}
export function getInputPlaceHolder(disablePromptPresets, disabledPromptPlaceholder, customPromptPlaceholder) {
    return disablePromptPresets ? disabledPromptPlaceholder : customPromptPlaceholder;
}
export const isEnter = (event) => event.code === 'Enter' || event.code === 'NumpadEnter';
export function focusWithoutScroll(element) {
    const x = window.scrollX;
    const y = window.scrollY;
    element?.focus({
        preventScroll: true,
    });
    window.scrollTo(x, y);
}
export function isEmptyGptPrompts(gptWidgetOptions, disablePromptPresets) {
    if (disablePromptPresets && !gptWidgetOptions.onCustomPromptApply)
        return true;
    if (!disablePromptPresets &&
        !gptWidgetOptions.promptPresets?.length &&
        !gptWidgetOptions.onCustomPromptApply)
        return true;
    return false;
}
//# sourceMappingURL=utils.js.map
