text: // Generated by purs version 0.11.7
  "use strict";
  var $foreign = require("./foreign");
  var Control_Monad_Eff = require("../Control.Monad.Eff");
  var Control_Semigroupoid = require("../Control.Semigroupoid");
  var DOM = require("../DOM");
  var DOM_Event_Types = require("../DOM.Event.Types");
  var Data_Bounded = require("../Data.Bounded");
  var Data_Enum = require("../Data.Enum");
  var Data_Eq = require("../Data.Eq");
  var Data_Foreign = require("../Data.Foreign");
  var Data_Maybe = require("../Data.Maybe");
  var Data_Ord = require("../Data.Ord");
  var Data_Ordering = require("../Data.Ordering");
  var Prelude = require("../Prelude");
  var Standard = (function () {
      function Standard() {
  
      };
      Standard.value = new Standard();
      return Standard;
  })();
  var Left = (function () {
      function Left() {
  
      };
      Left.value = new Left();
      return Left;
  })();
  var Right = (function () {
      function Right() {
  
      };
      Right.value = new Right();
      return Right;
  })();
  var Numpad = (function () {
      function Numpad() {
  
      };
      Numpad.value = new Numpad();
      return Numpad;
  })();
  var toEnumKeyLocation = function (v) {
      if (v === 0) {
          return new Data_Maybe.Just(Standard.value);
      };
      if (v === 1) {
          return new Data_Maybe.Just(Left.value);
      };
      if (v === 2) {
          return new Data_Maybe.Just(Right.value);
      };
      if (v === 3) {
          return new Data_Maybe.Just(Numpad.value);
      };
      return Data_Maybe.Nothing.value;
  };
  var fromEnumKeyLocation = function (v) {
      if (v instanceof Standard) {
          return 0;
      };
      if (v instanceof Left) {
          return 1;
      };
      if (v instanceof Right) {
          return 2;
      };
      if (v instanceof Numpad) {
          return 3;
      };
      throw new Error("Failed pattern match at DOM.Event.KeyboardEvent line 92, column 3 - line 98, column 1: " + [ v.constructor.name ]);
  };
  var eventToKeyboardEvent = function ($13) {
      return DOM_Event_Types.readKeyboardEvent(Data_Foreign.toForeign($13));
  };
  var eqKeyLocation = new Data_Eq.Eq(function (x) {
      return function (y) {
          if (x instanceof Standard && y instanceof Standard) {
              return true;
          };
          if (x instanceof Left && y instanceof Left) {
              return true;
          };
          if (x instanceof Right && y instanceof Right) {
              return true;
          };
          if (x instanceof Numpad && y instanceof Numpad) {
              return true;
          };
          return false;
      };
  });
  var ordKeyLocation = new Data_Ord.Ord(function () {
      return eqKeyLocation;
  }, function (x) {
      return function (y) {
          if (x instanceof Standard && y instanceof Standard) {
              return Data_Ordering.EQ.value;
          };
          if (x instanceof Standard) {
              return Data_Ordering.LT.value;
          };
          if (y instanceof Standard) {
              return Data_Ordering.GT.value;
          };
          if (x instanceof Left && y instanceof Left) {
              return Data_Ordering.EQ.value;
          };
          if (x instanceof Left) {
              return Data_Ordering.LT.value;
          };
          if (y instanceof Left) {
              return Data_Ordering.GT.value;
          };
          if (x instanceof Right && y instanceof Right) {
              return Data_Ordering.EQ.value;
          };
          if (x instanceof Right) {
              return Data_Ordering.LT.value;
          };
          if (y instanceof Right) {
              return Data_Ordering.GT.value;
          };
          if (x instanceof Numpad && y instanceof Numpad) {
              return Data_Ordering.EQ.value;
          };
          throw new Error("Failed pattern match at DOM.Event.KeyboardEvent line 66, column 8 - line 66, column 50: " + [ x.constructor.name, y.constructor.name ]);
      };
  });
  var enumKeyLocation = new Data_Enum.Enum(function () {
      return ordKeyLocation;
  }, Data_Enum.defaultPred(toEnumKeyLocation)(fromEnumKeyLocation), Data_Enum.defaultSucc(toEnumKeyLocation)(fromEnumKeyLocation));
  var boundedKeyLocation = new Data_Bounded.Bounded(function () {
      return ordKeyLocation;
  }, Standard.value, Numpad.value);
  var boundedEnumKeyLocation = new Data_Enum.BoundedEnum(function () {
      return boundedKeyLocation;
  }, function () {
      return enumKeyLocation;
  }, 4, fromEnumKeyLocation, toEnumKeyLocation);
  var location = function (dictPartial) {
      return function ($14) {
          return Data_Maybe.fromJust(dictPartial)(Data_Enum.toEnum(boundedEnumKeyLocation)($foreign.locationIndex($14)));
      };
  };
  module.exports = {
      eventToKeyboardEvent: eventToKeyboardEvent,
      location: location,
      Standard: Standard,
      Left: Left,
      Right: Right,
      Numpad: Numpad,
      toEnumKeyLocation: toEnumKeyLocation,
      fromEnumKeyLocation: fromEnumKeyLocation,
      eqKeyLocation: eqKeyLocation,
      ordKeyLocation: ordKeyLocation,
      boundedKeyLocation: boundedKeyLocation,
      enumKeyLocation: enumKeyLocation,
      boundedEnumKeyLocation: boundedEnumKeyLocation,
      key: $foreign.key,
      code: $foreign.code,
      locationIndex: $foreign.locationIndex,
      ctrlKey: $foreign.ctrlKey,
      shiftKey: $foreign.shiftKey,
      altKey: $foreign.altKey,
      metaKey: $foreign.metaKey,
      repeat: $foreign.repeat,
      isComposing: $foreign.isComposing,
      getModifierState: $foreign.getModifierState
  };
  