!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e||self).tinykeys={})}(this,function(e){var t=["Shift","Meta","Alt","Control"],n="object"==typeof navigator?navigator.platform:"",i=/Mac|iPod|iPhone|iPad/.test(n),o=i?"Meta":"Control",r="Win32"===n?["Control","Alt"]:i?["Alt"]:[];function a(e,t){return"function"==typeof e.getModifierState&&(e.getModifierState(t)||r.includes(t)&&e.getModifierState("AltGraph"))}function u(e){return e.trim().split(" ").map(function(e){var t=e.split(/\b\+/),n=t.pop(),i=n.match(/^\((.+)\)$/);return i&&(n=new RegExp("^"+i[1]+"$")),[t=t.map(function(e){return"$mod"===e?o:e}),n]})}function f(e,n){var i=n[0],o=n[1];return!((o instanceof RegExp?!o.test(e.key)&&!o.test(e.code):o.toUpperCase()!==e.key.toUpperCase()&&o!==e.code)||i.find(function(t){return!a(e,t)})||t.find(function(t){return!i.includes(t)&&o!==t&&a(e,t)}))}function c(e,t){var n;void 0===t&&(t={});var i=null!=(n=t.timeout)?n:1e3,o=Object.keys(e).map(function(t){return[u(t),e[t]]}),r=new Map,c=null;return function(e){e instanceof KeyboardEvent&&(o.forEach(function(t){var n=t[0],i=t[1],o=r.get(n)||n;f(e,o[0])?o.length>1?r.set(n,o.slice(1)):(r.delete(n),i(e)):a(e,e.key)||r.delete(n)}),c&&clearTimeout(c),c=setTimeout(r.clear.bind(r),i))}}e.createKeybindingsHandler=c,e.matchKeyBindingPress=f,e.parseKeybinding=u,e.tinykeys=function(e,t,n){var i=void 0===n?{}:n,o=i.event,r=void 0===o?"keydown":o,a=i.capture,u=c(t,{timeout:i.timeout});return e.addEventListener(r,u,a),function(){e.removeEventListener(r,u,a)}}});
//# sourceMappingURL=tinykeys.umd.js.map
