/*! For license information please see dll.KeyControls.js.LICENSE.txt */
(window.webpackJsonp_name_dll=window.webpackJsonp_name_dll||[]).push([[58],{853:function(e,n,t){"use strict";t.r(n);var o=t(14),r=t.n(o),c=t(12),a=t.n(c),i=t(10),s=t.n(i),u=t(15),p=t.n(u),d=t(16),f=t.n(d),l=t(8),v=t.n(l),y=t(7),m=t.n(y),h=t(0),g=t(25),k=t.n(g),w=t(1),D=t.n(w),E=t(37),L=t.n(E),K=t(87),R=t.n(K),b=t(104),j=t.n(b),C=t(35);function O(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var t,o=v()(e);if(n){var r=v()(this).constructor;t=Reflect.construct(o,arguments,r)}else t=o.apply(this,arguments);return f()(this,t)}}var P=L()("isle:key-controls"),_=function(e){p()(t,e);var n=O(t);function t(e){var o;return r()(this,t),o=n.call(this,e),m()(s()(o),"addListeners",(function(){var e=R()(o.props.actions);if(P("Add keydown event listeners for ".concat(o.props.container?"container":"document",": ").concat(e.join(", "))),o.props.container)try{k.a.findDOMNode(o.props.container).addEventListener("keydown",o.triggerEvent)}catch(e){P(e.message)}else document.addEventListener("keydown",o.triggerDocEvent)})),m()(s()(o),"removeListeners",(function(e){var n=R()(o.props.actions);if(P("Remove keydown event listeners for ".concat(e?"container":"document",": ").concat(n.join(", "))),e)try{k.a.findDOMNode(e).removeEventListener("keydown",o.triggerEvent)}catch(e){P(e.message)}document.removeEventListener("keydown",o.triggerDocEvent)})),m()(s()(o),"triggerEvent",(function(e){var n=e.key;P("Received key press for container: ".concat(n));var t=o.props.actions[n],r=e.ctrlKey||e.shiftKey||e.altKey||e.metaKey;document.activeElement===o.props.container&&!r&&j()(t)&&(e.preventDefault(),e.stopPropagation(),t(e))})),m()(s()(o),"triggerDocEvent",(function(e){var n=e.key,t=e.ctrlKey||e.shiftKey||e.altKey||e.metaKey;P("Received key press for document: ".concat(n));var r=o.props.actions[n];!t&&j()(r)&&(e.preventDefault(),e.stopPropagation(),r(e))})),o}return a()(t,[{key:"componentDidMount",value:function(){P("Component has mounted..."),this.addListeners()}},{key:"componentDidUpdate",value:function(e){this.props.container!==e.container&&(P("Container has changed, re-attach event listeners..."),this.removeListeners(e.container),this.addListeners())}},{key:"componentWillUnmount",value:function(){P("Component has unmounted..."),this.removeListeners()}},{key:"render",value:function(){return null}}]),t}(h.Component);_.defaultProps={actions:{},container:null},_.propTypes={actions:D.a.objectOf(D.a.func),container:D.a.oneOfType([D.a.object,D.a.element])},_.contextType=C.default,n.default=_}}]);