import { CustomError } from '@iqser/common-ui';
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
import { HeaderElements, TextPopups } from '../../file-preview/utils/constants';
import { List } from '@iqser/common-ui/lib/utils';

export const ROTATION_BUTTONS = [HeaderElements.ROTATE_LEFT_BUTTON, HeaderElements.ROTATE_RIGHT_BUTTON];
export const ROTATION_ACTION_BUTTONS = [HeaderElements.APPLY_ROTATION, HeaderElements.DISCARD_ROTATION];

export const TEXT_POPUPS_TO_TOGGLE = [TextPopups.REDACT_TEXT, TextPopups.ADD_HINT, TextPopups.ADD_RECTANGLE, TextPopups.ADD_FALSE_POSITIVE];

export const HEADER_ITEMS_TO_TOGGLE = [HeaderElements.SHAPE_TOOL_GROUP_BUTTON];

export const ALLOWED_ACTIONS_WHEN_PAGE_EXCLUDED: string[] = [
    TextPopups.ADD_RECTANGLE,
    TextPopups.REDACT_TEXT,
    TextPopups.ADD_HINT,
    HeaderElements.SHAPE_TOOL_GROUP_BUTTON,
];

export const ALLOWED_KEYBOARD_SHORTCUTS: List = ['+', '-', 'p', 'r', 'Escape'] as const;

export const DOCUMENT_LOADING_ERROR = new CustomError(_('error.file-preview.label'), _('error.file-preview.action'), 'iqser:refresh');

export const ViewerEvents = {
    LOAD_ALL_ANNOTATIONS: 'LOAD_ALL_ANNOTATIONS',
} as const;

export const USELESS_ELEMENTS = [
    'pageNavOverlay',
    'menuButton',
    'textHighlightToolButton',
    'textUnderlineToolButton',
    'textSquigglyToolButton',
    'textStrikeoutToolButton',
    'viewControlsButton',
    'contextMenuPopup',
    'linkButton',
    'toggleNotesButton',
    'notesPanel',
    'thumbnailControl',
    'documentControl',
    'ribbons',
    'toolsHeader',
    'rotateClockwiseButton',
    'rotateCounterClockwiseButton',
    'annotationStyleEditButton',
    'annotationGroupButton',
];

export const DISABLED_HOTKEYS = [
    'CTRL+SHIFT+EQUAL',
    'COMMAND+SHIFT+EQUAL',
    'CTRL+SHIFT+MINUS',
    'COMMAND+SHIFT+MINUS',
    'CTRL+V',
    'COMMAND+V',
    'CTRL+Y',
    'COMMAND+Y',
    'CTRL+O',
    'COMMAND+O',
    'CTRL+P',
    'COMMAND+P',
    'CTRL+F',
    'COMMAND+F',
    'SPACE',
    'UP',
    'DOWN',
    'R',
    'P',
    'A',
    'C',
    'E',
    'I',
    'F',
    'L',
    'N',
    'O',
    'T',
    'S',
    'G',
    'H',
    'K',
    'U',
] as const;

export const AnnotationToolNames = {
    AnnotationCreateRectangle: 'AnnotationCreateRectangle',
} as const;
