"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),n=require("../utils/customHooks/useEventListener.js"),t=require("../utils/genericFunctions/eventDispatch.js");require("../node_modules/tslib/tslib.es6.js"),require("../store/index.js"),require("../node_modules/react-redux/es/index.js");var s=require("../lib/phone/call.js"),l=require("../node_modules/react-redux/es/hooks/useDispatch.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=u(e);exports.CallEvents=function(e){var u=e.sipHost,r=l.useDispatch();return n.useEventListener("phone-island-call-start",(function(e){var n=function(e){return e.replace(/[^0-9+*#]/g,"")}(e.number);s.callNumber(n,u)})),n.useEventListener("phone-island-call-hold",(function(){s.pauseCurrentCall()})),n.useEventListener("phone-island-call-unhold",(function(){s.unpauseCurrentCall()})),n.useEventListener("phone-island-call-mute",(function(){s.muteCurrentCall()})),n.useEventListener("phone-island-call-unmute",(function(){s.unmuteCurrentCall()})),n.useEventListener("phone-island-call-park",(function(){s.parkCurrentCall()})),n.useEventListener("phone-island-call-answer",(function(){s.answerIncomingCall()})),n.useEventListener("phone-island-call-end",(function(){s.hangupCurrentCall()})),n.useEventListener("phone-island-call-listen",(function(e){r.listen.setUpdateListenStatus(!0,e.number),t.eventDispatch("phone-island-call-listened",{}),r.island.toggleActionsExpanded(!1)})),n.useEventListener("phone-island-call-intrude",(function(e){r.listen.setUpdateIntrudeStatus(!0,e.number),t.eventDispatch("phone-island-call-intruded",{}),r.island.toggleActionsExpanded(!1)})),i.default.createElement(i.default.Fragment,null)},exports.dispatchOutgoingCallStarted=function(e,n){void 0===e&&(e=""),void 0===n&&(n="");var s={name:e,number:n};t.eventDispatch("phone-island-outgoing-call-started",s)};
//# sourceMappingURL=CallEvents.js.map
