!function(e,t,n){function r(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function a(e){if("keypress"==e.type){var t=String.fromCharCode(e.which);return e.shiftKey||(t=t.toLowerCase()),t}return u[e.which]?u[e.which]:p[e.which]?p[e.which]:String.fromCharCode(e.which).toLowerCase()}function i(e){return"shift"==e||"ctrl"==e||"alt"==e||"meta"==e}function o(e,t){var n,r,a,o=[];for(n="+"===(n=e)?["+"]:(n=n.replace(/\+{2}/g,"+plus")).split("+"),a=0;ac||u.hasOwnProperty(c)&&(l[u[c]]=c);a=l[n]?"keydown":"keypress"}return"keypress"==a&&o.length&&(a="keydown"),{key:r,modifiers:o,action:a}}function c(e,n){return null!==e&&e!==t&&(e===n||c(e.parentNode,n))}function s(e){function n(e){e=e||{};var t,n=!1;for(t in y)e[t]?n=!0:y[t]=0;n||(b=!1)}function c(e,t,n,r,a,o){var c,s,l=[],u=n.type;if(!h._callbacks[e])return[];for("keyup"==u&&i(e)&&(t=[e]),c=0;c":".","?":"/","|":"\\"},h={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"};for(n=1;20>n;++n)u[111+n]="f"+n;for(n=0;9>=n;++n)u[n+96]=n;s.prototype.bind=function(e,t,n){return e=e instanceof Array?e:[e],this._bindMultiple.call(this,e,t,n),this},s.prototype.unbind=function(e,t){return this.bind.call(this,e,(function(){}),t)},s.prototype.trigger=function(e,t){return this._directMap[e+":"+t]&&this._directMap[e+":"+t]({},e),this},s.prototype.reset=function(){return this._callbacks={},this._directMap={},this},s.prototype.stopCallback=function(e,t){return!(-1<(" "+t.className+" ").indexOf(" mousetrap ")||c(t,this.target))&&("INPUT"==t.tagName||"SELECT"==t.tagName||"TEXTAREA"==t.tagName||t.isContentEditable)},s.prototype.handleKey=function(){return this._handleKey.apply(this,arguments)},s.init=function(){var e,n=s(t);for(e in n)"_"!==e.charAt(0)&&(s[e]=function(e){return function(){return n[e].apply(n,arguments)}}(e))},s.init(),e.Mousetrap=s,"undefined"!=typeof module&&module.exports&&(module.exports=s),"function"==typeof define&&define.amd&&define((function(){return s}))}(window,document);