"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _keycodes = require("@wordpress/keycodes");
/**
 * WordPress dependencies
 */
/**
 * Hook to prevent default behaviors for key combinations otherwise handled
 * internally by RichText.
 */
var _default = () => node => {
  function onKeydown(event) {
    if (_keycodes.isKeyboardEvent.primary(event, 'z') || _keycodes.isKeyboardEvent.primary(event, 'y') || _keycodes.isKeyboardEvent.primaryShift(event, 'z')) {
      event.preventDefault();
    }
  }
  node.addEventListener('keydown', onKeydown);
  return () => {
    node.removeEventListener('keydown', onKeydown);
  };
};
exports.default = _default;
//# sourceMappingURL=remove-browser-shortcuts.js.map