"use strict";var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;exports.__esModule = true;exports.extractAction = exports.Actions = void 0;

var _constants = require("../../../lib/date/constants");
var Keyboard = _interopRequireWildcard(require("../../../lib/events/keyboard/identifiers"));
var _extractKeyboardAction = require("../../../lib/extractKeyboardAction");

var delimiters = [
function (e) {return new RegExp(_constants.SEPARATOR).test(e.key);},
Keyboard.isKeySpace,
Keyboard.isCodeMinus,
Keyboard.isCodeComma,
Keyboard.isCodePeriod,
Keyboard.isCodeSlash,
Keyboard.isCodeBackslash,
Keyboard.isCodeIntlBackslash,
Keyboard.isCodeNumpadDecimal,
Keyboard.isCodeNumpadDivide,
Keyboard.isCodeNumpadSubtract];var


Actions = exports.Actions = /*#__PURE__*/function (Actions) {Actions[Actions["Unknown"] = 0] = "Unknown";Actions[Actions["Ignore"] = 1] = "Ignore";Actions[Actions["MoveSelectionLeft"] = 2] = "MoveSelectionLeft";Actions[Actions["MoveSelectionRight"] = 3] = "MoveSelectionRight";Actions[Actions["MoveSelectionFirst"] = 4] = "MoveSelectionFirst";Actions[Actions["MoveSelectionLast"] = 5] = "MoveSelectionLast";Actions[Actions["Decrement"] = 6] = "Decrement";Actions[Actions["Increment"] = 7] = "Increment";Actions[Actions["FullSelection"] = 8] = "FullSelection";Actions[Actions["ClearSelection"] = 9] = "ClearSelection";Actions[Actions["ClearOneChar"] = 10] = "ClearOneChar";Actions[Actions["Digit"] = 11] = "Digit";Actions[Actions["Separator"] = 12] = "Separator";Actions[Actions["WrongInput"] = 13] = "WrongInput";Actions[Actions["PasteValue"] = 14] = "PasteValue";Actions[Actions["CopyValue"] = 15] = "CopyValue";return Actions;}({});


















var extractAction = exports.extractAction = new _extractKeyboardAction.KeyboardActionExctracterBuilder().
add(Actions.PasteValue, Keyboard.isShortcutPaste).
add(Actions.CopyValue, Keyboard.isShortcutCopy).
add(Actions.FullSelection, Keyboard.isShortcutSelectAll).
add(Actions.Ignore, Keyboard.someKeys(Keyboard.isModified(), Keyboard.isKeyFs, Keyboard.isKeyTab)).
add(Actions.MoveSelectionLeft, Keyboard.isKeyArrowLeft).
add(Actions.MoveSelectionRight, Keyboard.isKeyArrowRight).
add(Actions.MoveSelectionFirst, Keyboard.isKeyHome).
add(Actions.MoveSelectionLast, Keyboard.isKeyEnd).
add(Actions.Separator, Keyboard.someKeys.apply(Keyboard, delimiters)).
add(Actions.Increment, Keyboard.isKeyArrowUp).
add(Actions.Decrement, Keyboard.isKeyArrowDown).
add(Actions.ClearSelection, function (e) {return Keyboard.isKeyDelete(e);}).
add(Actions.ClearOneChar, Keyboard.isKeyBackspace).
add(Actions.Digit, Keyboard.isKeyNumber).
add(Actions.WrongInput, function (e) {return !Keyboard.isKeyNumber(e);}).
build(Actions.Unknown);