import '../../../../globals.js';
// Copyright 2017-2024, University of Colorado Boulder
/**
 * General help information for how to navigation a simulation with a keyboard. In general, this file supports a fair
 * number of options, like displaying group content, or shortcuts for checkbox interaction. The algorithm this type
 * implements set all the optional potential rows as null, and then fills them in if the options is provided. Then at the
 * end anything that is null is filtered out.
 *
 * @author Jesse Greenberg (PhET Interactive Simulations)
 * @author Michael Kauzmann (PhET Interactive Simulations)
 */
import optionize from '../../../../phet-core/js/optionize.js';
import ResetAllButton from '../../buttons/ResetAllButton.js';
import sceneryPhet from '../../sceneryPhet.js';
import SceneryPhetStrings from '../../SceneryPhetStrings.js';
import NumberKeyNode from '../NumberKeyNode.js';
import TextKeyNode from '../TextKeyNode.js';
import KeyboardHelpIconFactory from './KeyboardHelpIconFactory.js';
import KeyboardHelpSection from './KeyboardHelpSection.js';
import KeyboardHelpSectionRow from './KeyboardHelpSectionRow.js';
export default class BasicActionsKeyboardHelpSection extends KeyboardHelpSection {
    constructor(providedOptions) {
        const options = optionize()({
            withCheckboxContent: false,
            withKeypadContent: false
        }, providedOptions);
        // 'Move to next item or group'
        const tabKeyNode = TextKeyNode.tab();
        const moveToNextItemRow = KeyboardHelpSectionRow.labelWithIcon(SceneryPhetStrings.keyboardHelpDialog.moveToNextItemOrGroupStringProperty, tabKeyNode, {
            labelInnerContent: SceneryPhetStrings.a11y.keyboardHelpDialog.general.tabGroupDescriptionStringProperty
        });
        // 'Move to previous item or group'
        const shiftPlusTabIcon = KeyboardHelpIconFactory.shiftPlusIcon(tabKeyNode);
        const moveToPreviousItemRow = KeyboardHelpSectionRow.labelWithIcon(SceneryPhetStrings.keyboardHelpDialog.moveToPreviousItemOrGroupStringProperty, shiftPlusTabIcon, {
            labelInnerContent: SceneryPhetStrings.a11y.keyboardHelpDialog.general.shiftTabGroupDescriptionStringProperty
        });
        // 'Move between items in a group'
        const leftRightArrowsIcon = KeyboardHelpIconFactory.leftRightArrowKeysRowIcon();
        const upDownArrowsIcon = KeyboardHelpIconFactory.upDownArrowKeysRowIcon();
        const arrowsIcon = KeyboardHelpIconFactory.iconOrIcon(leftRightArrowsIcon, upDownArrowsIcon);
        const moveBetweenItemsInAGroupRow = KeyboardHelpSectionRow.labelWithIcon(SceneryPhetStrings.keyboardHelpDialog.moveBetweenItemsInAGroupStringProperty, arrowsIcon, {
            labelInnerContent: SceneryPhetStrings.a11y.keyboardHelpDialog.general.groupNavigationDescriptionStringProperty
        });
        // 'Press buttons'
        const spaceKeyNode = TextKeyNode.space();
        const enterKeyNode = TextKeyNode.enter();
        const spaceOrEnterIcon = KeyboardHelpIconFactory.iconOrIcon(spaceKeyNode, enterKeyNode);
        const pressButtonsItemRow = KeyboardHelpSectionRow.labelWithIcon(SceneryPhetStrings.keyboardHelpDialog.pressButtonsStringProperty, spaceOrEnterIcon, {
            labelInnerContent: SceneryPhetStrings.a11y.keyboardHelpDialog.general.pressButtonsDescriptionStringProperty
        });
        // 'Reset All'
        const resetAllRow = KeyboardHelpSectionRow.fromHotkeyData(ResetAllButton.RESET_ALL_HOTKEY_DATA);
        // 'Exit a dialog'
        const escapeKeyNode = TextKeyNode.esc();
        const exitADialogRow = KeyboardHelpSectionRow.labelWithIcon(SceneryPhetStrings.keyboardHelpDialog.exitADialogStringProperty, escapeKeyNode, {
            labelInnerContent: SceneryPhetStrings.a11y.keyboardHelpDialog.general.exitDialogDescriptionStringProperty
        });
        const content = [
            moveToNextItemRow,
            moveToPreviousItemRow,
            moveBetweenItemsInAGroupRow
        ];
        if (options.withKeypadContent) {
            // 'Set values within keypad'
            const zeroToNineIcon = KeyboardHelpIconFactory.iconToIcon(new NumberKeyNode(0), new NumberKeyNode(9));
            const setValuesInKeypadRow = KeyboardHelpSectionRow.labelWithIcon(SceneryPhetStrings.keyboardHelpDialog.setValuesInKeypadStringProperty, zeroToNineIcon, {
                labelInnerContent: SceneryPhetStrings.a11y.keyboardHelpDialog.general.setValuesInKeypadDescriptionStringProperty
            });
            content.push(setValuesInKeypadRow);
        }
        // 'Toggle checkboxes'
        if (options.withCheckboxContent) {
            const checkboxSpaceKeyNode = TextKeyNode.space();
            const toggleCheckboxes = KeyboardHelpSectionRow.labelWithIcon(SceneryPhetStrings.keyboardHelpDialog.toggleCheckboxesStringProperty, checkboxSpaceKeyNode, {
                labelInnerContent: SceneryPhetStrings.a11y.keyboardHelpDialog.general.toggleCheckboxesDescriptionStringProperty
            });
            content.push(toggleCheckboxes);
        }
        // a bit strange, but important for ordering with optional rows
        content.push(...[
            pressButtonsItemRow,
            resetAllRow,
            exitADialogRow
        ]);
        // order the rows of content
        super(SceneryPhetStrings.keyboardHelpDialog.basicActionsStringProperty, content, options);
    }
}
sceneryPhet.register('BasicActionsKeyboardHelpSection', BasicActionsKeyboardHelpSection);
//# sourceMappingURL=BasicActionsKeyboardHelpSection.js.map