From c15aeb9358b0aaea4fe2628a9876925a056c6021 Mon Sep 17 00:00:00 2001 From: imndx Date: Tue, 7 Sep 2021 15:55:58 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=86=E9=A2=91=E9=80=9A=E8=AF=9D=EF=BC=8C?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E4=BD=BF=E7=94=A8=E5=A4=A7=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/wfc/av/engine/PeerConnectionClient.js | 6 ++++-- src/wfc/av/internal/engine-conference.min.js | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/wfc/av/engine/PeerConnectionClient.js b/src/wfc/av/engine/PeerConnectionClient.js index 1b0ea1f8..14f40993 100644 --- a/src/wfc/av/engine/PeerConnectionClient.js +++ b/src/wfc/av/engine/PeerConnectionClient.js @@ -2,6 +2,8 @@ * Copyright (c) 2020 WildFireChat. All rights reserved. */ +import WfcAVEngineKit from "./avenginekit"; + export default class PeerConnectionClient { isInitiator = false; userId; @@ -11,9 +13,9 @@ export default class PeerConnectionClient { videoMuted; audience = false; - useMainVideo = false; + useMainVideo = WfcAVEngineKit.DEFAULT_USE_MAIN_VIDEO; - setUseMainVideo(useMainVideo){ + setUseMainVideo(useMainVideo) { // will be override } diff --git a/src/wfc/av/internal/engine-conference.min.js b/src/wfc/av/internal/engine-conference.min.js index e5ddda48..31f26f58 100644 --- a/src/wfc/av/internal/engine-conference.min.js +++ b/src/wfc/av/internal/engine-conference.min.js @@ -1,2 +1,2 @@ -!function(e,o){if("object"==typeof exports&&"object"==typeof module)module.exports=o(require("../../../platform.js"),require("../../messages/messageContentType"),require("../../model/conversation"),require("../../model/conversationType"),require("../../util/longUtil.js"),require("../engine/CallSession"),require("../engine/PeerConnectionClient"),require("../engine/avenginekit"),require("../engine/avenginekitproxy"),require("../engine/callEndReason"),require("../engine/callState"),require("../messages/addParticipantsMessageContent"),require("../messages/callAnswerMessageContent"),require("../messages/callByeMessageContent"),require("../messages/callModifyMessageContent"),require("../messages/callStartMessageContent"),require("../messages/conferenceChangeModeContent"),require("../messages/muteVideoMessageContent"));else if("function"==typeof define&&define.amd)define(["../../../platform.js","../../messages/messageContentType","../../model/conversation","../../model/conversationType","../../util/longUtil.js","../engine/CallSession","../engine/PeerConnectionClient","../engine/avenginekit","../engine/avenginekitproxy","../engine/callEndReason","../engine/callState","../messages/addParticipantsMessageContent","../messages/callAnswerMessageContent","../messages/callByeMessageContent","../messages/callModifyMessageContent","../messages/callStartMessageContent","../messages/conferenceChangeModeContent","../messages/muteVideoMessageContent"],o);else{var s="object"==typeof exports?o(require("../../../platform.js"),require("../../messages/messageContentType"),require("../../model/conversation"),require("../../model/conversationType"),require("../../util/longUtil.js"),require("../engine/CallSession"),require("../engine/PeerConnectionClient"),require("../engine/avenginekit"),require("../engine/avenginekitproxy"),require("../engine/callEndReason"),require("../engine/callState"),require("../messages/addParticipantsMessageContent"),require("../messages/callAnswerMessageContent"),require("../messages/callByeMessageContent"),require("../messages/callModifyMessageContent"),require("../messages/callStartMessageContent"),require("../messages/conferenceChangeModeContent"),require("../messages/muteVideoMessageContent")):o(e["../../../platform.js"],e["../../messages/messageContentType"],e["../../model/conversation"],e["../../model/conversationType"],e["../../util/longUtil.js"],e["../engine/CallSession"],e["../engine/PeerConnectionClient"],e["../engine/avenginekit"],e["../engine/avenginekitproxy"],e["../engine/callEndReason"],e["../engine/callState"],e["../messages/addParticipantsMessageContent"],e["../messages/callAnswerMessageContent"],e["../messages/callByeMessageContent"],e["../messages/callModifyMessageContent"],e["../messages/callStartMessageContent"],e["../messages/conferenceChangeModeContent"],e["../messages/muteVideoMessageContent"]);for(var t in s)("object"==typeof exports?exports:e)[t]=s[t]}}(window,(function(e,o,s,t,r,n,i,a,l,u,d,c,f,m,_,j,p,h){return function(e){var o={};function s(t){if(o[t])return o[t].exports;var r=o[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,s),r.l=!0,r.exports}return s.m=e,s.c=o,s.d=function(e,o,t){s.o(e,o)||Object.defineProperty(e,o,{enumerable:!0,get:t})},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,o){if(1&o&&(e=s(e)),8&o)return e;if(4&o&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(s.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&o&&"string"!=typeof e)for(var r in e)s.d(t,r,function(o){return e[o]}.bind(null,r));return t},s.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(o,"a",o),o},s.o=function(e,o){return Object.prototype.hasOwnProperty.call(e,o)},s.p="",s(s.s="./av/internal/avenginekitImpl.js")}({"../../../platform.js":function(o,s){o.exports=e},"../../messages/messageContentType":function(e,s){e.exports=o},"../../model/conversation":function(e,o){e.exports=s},"../../model/conversationType":function(e,o){e.exports=t},"../../util/longUtil.js":function(e,o){e.exports=r},"../engine/CallSession":function(e,o){e.exports=n},"../engine/PeerConnectionClient":function(e,o){e.exports=i},"../engine/avenginekit":function(e,o){e.exports=a},"../engine/avenginekitproxy":function(e,o){e.exports=l},"../engine/callEndReason":function(e,o){e.exports=u},"../engine/callState":function(e,o){e.exports=d},"../messages/addParticipantsMessageContent":function(e,o){e.exports=c},"../messages/callAnswerMessageContent":function(e,o){e.exports=f},"../messages/callByeMessageContent":function(e,o){e.exports=m},"../messages/callModifyMessageContent":function(e,o){e.exports=_},"../messages/callStartMessageContent":function(e,o){e.exports=j},"../messages/conferenceChangeModeContent":function(e,o){e.exports=p},"../messages/muteVideoMessageContent":function(e,o){e.exports=h},"./av/internal/CallSessionImpl.js":function(e,o,s){"use strict";Object.defineProperty(o,"__esModule",{value:!0});var t=x(s("./node_modules/babel-runtime/helpers/extends.js")),r=x(s("./node_modules/babel-runtime/regenerator/index.js")),n=x(s("./node_modules/babel-runtime/helpers/asyncToGenerator.js")),i=x(s("./node_modules/babel-runtime/core-js/map.js")),a=x(s("./node_modules/babel-runtime/core-js/get-iterator.js")),l=x(s("./node_modules/babel-runtime/helpers/slicedToArray.js")),u=x(s("./node_modules/babel-runtime/core-js/json/stringify.js")),d=x(s("./node_modules/babel-runtime/core-js/object/get-prototype-of.js")),c=x(s("./node_modules/babel-runtime/helpers/classCallCheck.js")),f=x(s("./node_modules/babel-runtime/helpers/createClass.js")),m=x(s("./node_modules/babel-runtime/helpers/possibleConstructorReturn.js")),_=x(s("./node_modules/babel-runtime/helpers/inherits.js")),j=x(s("../engine/callState")),p=x(s("./av/internal/avenginekitImpl.js")),h=x(s("../engine/callEndReason")),y=x(s("../messages/callByeMessageContent")),b=x(s("./av/internal/PeerConnectionClientImpl.js")),v=s("../../../platform.js"),A=x(s("../engine/CallSession")),g=s("../../util/longUtil.js"),S=x(s("../engine/avenginekit")),C=x(s("../../model/conversationType")),T=x(s("../messages/conferenceChangeModeContent")),M=x(s("../../model/conversation")),k=x(s("./av/internal/roomErrorCode.js")),I=s("./av/internal/soundMeter.js"),E=x(s("../engine/avenginekitproxy")),O=x(s("../messages/muteVideoMessageContent"));function x(e){return e&&e.__esModule?e:{default:e}}var w=function(e){function o(){var e,s,t,r;(0,c.default)(this,o);for(var n=arguments.length,i=Array(n),a=0;a6e4)return void t.endCall(h.default.REASON_Timeout)}else if(t.status!==j.default.STATUS_CONNECTED&&e-o>6e4)return void t.endCall(h.default.RemoteTimeout);t.peerConnectionClientMap.forEach((function(o,s){var r=o.acceptTime?o.acceptTime:o.joinTime;o.status!==j.default.STATUS_CONNECTED&&(0,g.gt)(r,0)&&e-(0,g.numberValue)(r)>6e4&&t.endUserCall(s,h.default.RemoteTimeout)}))}},t.gotRemoteStream=function(e,o){t.sessionCallback&&t.sessionCallback.didReceiveRemoteVideoTrack(e,o.streams[0]);var s=o.streams[0];s.onremovetrack=function(o){console.log("pc remove remote stream",o),t.sessionCallback&&t.sessionCallback.didRemoveRemoteVideoTrack(e)};var r=new I.SoundMeter(window.audioContext);r.connectToSource(s,(function(e){console.log("connect to soundMeter",e)})),t.getPeerConnectionClient(e).soundMeter=r,console.log("pc received remote stream",e,o)},t.onIceCandidate=function(e,o,s){if(s.candidate){var r={};if(r.session_id=t.sessionId,e===t.selfUserInfo.uid)r.handle_id=t.handleId;else{var n=t.getClient(e);r.handle_id=n.handleId}var i={};i.candidate=s.candidate.candidate,i.sdpMLineIndex=s.candidate.sdpMLineIndex,i.sdpMid=s.candidate.sdpMid,i.pin=t.pin,r.candidate=i,p.default.sendConferenceRequest(t.sessionId,t.callId,"trickle",(0,u.default)(r),(function(e,o){0!==e&&console.log("conference request, trickle error",e)}))}},t.onIceStateChange=function(e,o,s){if(o){if(t.selfUserInfo.uid===e)return t.connectedTime||(t.connectedTime=(new Date).getTime()),void t.setState(j.default.STATUS_CONNECTED);var r=t.getClient(e);console.log("ICE state change event: ",s),"connected"===o.iceConnectionState&&(t.setState(j.default.STATUS_CONNECTED),r.status=j.default.STATUS_CONNECTED,t.sessionCallback&&t.sessionCallback.didParticipantConnected(e)),"disconnected"===o.iceConnectionState||"failed"===o.iceConnectionState&&t.endUserCall(e,h.default.REASON_MediaError)}},r=s,(0,m.default)(t,r)}var s,A,x,w,R,N;return(0,_.default)(o,e),(0,f.default)(o,[{key:"getClient",value:function(e){return this.peerConnectionClientMap.get(e)}},{key:"getParticipantIds",value:function(){var e=[],o=!0,s=!1,t=void 0;try{for(var r,n=(0,a.default)(this.peerConnectionClientMap);!(o=(r=n.next()).done);o=!0){var i=r.value,u=(0,l.default)(i,2),d=u[0];u[1];e.push(d)}}catch(e){s=!0,t=e}finally{try{!o&&n.return&&n.return()}finally{if(s)throw t}}return e}},{key:"setAcceptTime",value:function(e){this.acceptTime||(this.acceptTime=e),this.updateInitiator()}},{key:"setUserAcceptTime",value:function(e,o){console.log("setUserAcceptTime",e,o);var s=this.getClient(e);s?s.acceptTime=o:console.error("setUserAcceptTime undefined",e,this.status,this.peerConnectionClientMap)}},{key:"setUserJoinTime",value:function(e,o){this.getClient(e).joinTime=o}},{key:"getPeerConnectionClient",value:function(e){return this.peerConnectionClientMap.get(e)}},{key:"getPeerConnection",value:function(e){return this.peerConnectionClientMap.get(e).peerConnection}},{key:"answerCall",value:function(e){this.status===j.default.STATUS_INCOMING&&(this.setState(j.default.STATUS_CONNECTING),this.audioOnly&&!e&&(e=!0),this.audioOnly=e,p.default.answerCurrentCall())}},{key:"setState",value:function(e){if(this.status!==e){if(this.status!==j.default.STATUS_CONNECTED||e!==j.default.STATUS_CONNECTING){if(this.status=e,console.log("set status",e,this.startMsgUid),e===j.default.STATUS_IDLE||e===j.default.STATUS_CONNECTED){if(this.startMsgUid){var o={audioOnly:this.audioOnly};o.status=this.endReason,e===j.default.STATUS_CONNECTED?(o.connectTime=(new Date).getTime(),this.startTime=o.connectTime):o.endTime=(new Date).getTime(),p.default.updateCallStartMessageContent(this.startMsgUid,o)}}else e===j.default.STATUS_CONNECTING&&this.joinAndPublish();this.sessionCallback&&this.sessionCallback.didChangeState(e)}}else e===j.default.STATUS_CONNECTED&&this.sessionCallback&&this.sessionCallback.didChangeState(e)}},{key:"setAudioOnly",value:function(e){this.audioOnly=e,this.sessionCallback&&this.sessionCallback.didChangeMode(e)}},{key:"initSession",value:function(e,o){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],t=this,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],n=arguments.length>4&&void 0!==arguments[4]&&arguments[4];this.moCall=e,this.selfUserInfo=o,this.participantUserInfos=s,this.singleCall=s&&1===s.length,this.groupMemberUserInfos=r;var i=o;!e&&s&&s.length>0&&(i=s.filter((function(e){return e.uid===t.initiatorId}))[0]),this.sessionCallback.onInitial(this,o,i,s,r);var a=[];s&&s.length>0&&s.forEach((function(e){a.push(e.uid)})),this.initParticipantClientMap(a),n||(e?(this.setState(j.default.STATUS_OUTGOING),this.startPreview(this.audioOnly)):(this.setState(j.default.STATUS_INCOMING),this.playIncomingRing())),this.callTimeout(),window.AudioContext=window.AudioContext||window.webkitAudioContext,window.audioContext=new AudioContext,setTimeout((function(){window.addEventListener("beforeunload",t.onVoipWindowClose)}),500),this.pcStatsTimer=setInterval((function(){t.peerConnectionClientMap.forEach((function(e,o){var s=e.peerConnection;s&&s.getStats().then((function(e){e.forEach((function(e){}))}))}));var e=t.publishPeerConnection&&t.publishPeerConnection._soundMeter;if(e){var o=e.instant.toFixed(2);e.slow.toFixed(2),e.clip;t.sessionCallback.didReportAudioVolume(t.selfUserInfo.uid,Number(o))}t.peerConnectionClientMap.forEach((function(e,o){if(e.soundMeter){var s=e.soundMeter.instant.toFixed(2);e.soundMeter.slow.toFixed(2),e.soundMeter.clip;t.sessionCallback.didReportAudioVolume(o,Number(s))}}))}),100)}},{key:"initParticipantClientMap",value:function(e){var o=this;console.log("initParticipantClientMap",e),this.peerConnectionClientMap||(this.peerConnectionClientMap=new i.default),!e||e.length<1||e.forEach((function(e){var s=new b.default(e,o);e===o.selfUserInfo.uid?s.status=j.default.STATUS_OUTGOING:s.status=j.default.STATUS_INCOMING,o.peerConnectionClientMap.set(e,s)}),this)}},{key:"inviteNewParticipants",value:function(e){var o=this;e.length&&(e=e.filter((function(e){return e!==o.selfUserInfo.uid&&o.participantUserInfos.findIndex((function(o){return o.uid===e}))<0}))).length&&(this.singleCall=!1,p.default.inviteNewParticipants(e,this.pin))}},{key:"getExistParticipantsStatus",value:function(){var e=this,o=[];return o.push({userId:this.selfUserInfo.uid,acceptTime:this.acceptTime?(0,g.numberValue)(this.acceptTime):0,joinTime:this.joinTime?(0,g.numberValue)(this.joinTime):0,videoMuted:this.videoMuted}),this.participantUserInfos.forEach((function(s){var t=e.getClient(s.uid);o.push({userId:t.userId,acceptTime:t.acceptTime?(0,g.numberValue)(t.acceptTime):0,joinTime:t.joinTime?(0,g.numberValue)(t.joinTime):0,videoMuted:t.videoMuted})}),this),o}},{key:"didAddNewParticipants",value:function(e,o){var s=this;console.log("didAddNewParticipants",e,o),e.forEach((function(e){var o=new b.default(e,s);o.status=j.default.STATUS_INCOMING,s.peerConnectionClientMap.set(e,o)}),this),o.forEach((function(e){s.participantUserInfos.push(e),s.sessionCallback&&s.sessionCallback.didParticipantJoined(e.uid,e)}),this)}},{key:"updateExistParticipant",value:function(e,o){var s=this;e.forEach((function(e){var t=s.getClient(e.userId);t.status=j.default.STATUS_INCOMING,t.joinTime=o,t.videoMuted=e.videoMuted,t.acceptTime=e.acceptTime}))}},{key:"updateVideoMute",value:function(e,o){var s=this.getClient(e);s&&s.videoMuted!==o&&(s.videoMuted=o,this.sessionCallback&&this.sessionCallback.didVideoMuted(e,o))}},{key:"defaultVideoConstraints",value:function(e){return e?{audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},video:!1}:{audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},video:{width:{max:1280},height:{max:720}}}}},{key:"tinyVideoTrackConstraints",value:function(){return{width:{max:200},height:{max:200}}}},{key:"createLocalCameraVideoStream",value:(N=(0,n.default)(r.default.mark((function e(o){var s,t,n;return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,navigator.mediaDevices.getUserMedia(this.defaultVideoConstraints(o));case 3:return s=e.sent,console.log("Received local stream",s,o),this.sessionCallback&&this.sessionCallback.didCreateLocalVideoTrack(s),t=s.getVideoTracks(),o?t&&t.length>0&&t.forEach((function(e){return e.stop()})):t&&t.length>0&&console.log("Using video device: "+t[0].label),(n=s.getAudioTracks()).length>0&&console.log("Using audio device: "+n[0].label),e.abrupt("return",s);case 13:e.prev=13,e.t0=e.catch(0),console.error("getUserMedia error",e.t0);case 16:return e.abrupt("return",null);case 17:case"end":return e.stop()}}),e,this,[[0,13]])}))),function(e){return N.apply(this,arguments)})},{key:"startPreview",value:(R=(0,n.default)(r.default.mark((function e(o){return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(console.log("start preview"),!this.conference||!this.audience){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,this.createLocalCameraVideoStream(o);case 5:this.cameraVideoStream=e.sent,this.cameraVideoStream||this.endCall(h.default.REASON_MediaError);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return R.apply(this,arguments)})},{key:"getDesktopSources",value:function(e){return v.desktopCapturer?v.desktopCapturer.getSources({types:e}):null}},{key:"startScreenShare",value:(w=(0,n.default)(r.default.mark((function e(o){var s;return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isScreenSharing()&&!this.audioOnly){e.next=2;break}return e.abrupt("return");case 2:if(console.log("start screen share"),console.log("desktopCapturer ",v.desktopCapturer),!v.desktopCapturer){e.next=11;break}return e.next=7,navigator.mediaDevices.getUserMedia({audio:!1,video:{mandatory:(0,t.default)({chromeMediaSource:"desktop"},o)}});case 7:this.screenShareStream=e.sent,console.log("desktopCapturer screen share stream",this.screenShareStream),e.next=14;break;case 11:return e.next=13,navigator.mediaDevices.getDisplayMedia({audio:!1,video:!0});case 13:this.screenShareStream=e.sent;case 14:if(this.sessionCallback&&this.sessionCallback.didCreateLocalVideoTrack(this.screenShareStream),!this.videoSender){e.next=22;break}if(this.videoSender.replaceTrack(this.screenShareStream.getVideoTracks()[0]),S.default.DISABLE_DUAL_STREAM){e.next=22;break}return s=this.screenShareStream.getVideoTracks()[0].clone(),e.next=21,s.applyConstraints(this.tinyVideoTrackConstraints());case 21:this.smallVideoSender.replaceTrack(s);case 22:this.screenSharing=!0,this._stopVideoTrack(this.cameraVideoStream),S.default.DISABLE_DUAL_STREAM||this.smallVideoSender.track.stop(),this.notifyMuteState();case 26:case"end":return e.stop()}}),e,this)}))),function(e){return w.apply(this,arguments)})},{key:"isScreenSharing",value:function(){return!!this.screenShareStream}},{key:"stopScreenShare",value:function(){var e=this;this._stopVideoTrack(this.screenShareStream),this.screenShareStream=null,this.screenSharing=!1,S.default.DISABLE_DUAL_STREAM||this.smallVideoSender.track.stop(),this.videoMuted?this.notifyMuteState():(this.cameraVideoStream=null,(0,n.default)(r.default.mark((function o(){return r.default.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,e.createMediaSenders();case 2:e.sessionCallback&&e.sessionCallback.didCreateLocalVideoTrack(e.cameraVideoStream);case 3:case"end":return o.stop()}}),o,e)})))())}},{key:"_stopVideoTrack",value:function(e){e&&e.getTracks().forEach((function(e){"video"===e.kind&&e.stop()}))}},{key:"createPeerConnection",value:function(e,o){var s=this,t=this.getSelectedSdpSemantics();console.log("RTCPeerConnection configuration:",t);var r=new RTCPeerConnection(t);if(e!==this.selfUserInfo.uid){var n=this.getClient(e);n.peerConnection=r,n.isInitiator=o}return console.log("Created local peer connection object pc"),r.addEventListener("icecandidate",(function(o){return s.onIceCandidate(e,r,o)})),r.addEventListener("iceconnectionstatechange",(function(o){return s.onIceStateChange(e,r,o)})),r.addEventListener("track",(function(o){return s.gotRemoteStream(e,o)})),r.addEventListener("connectionstatechange",(function(o){return s.onConnectionStateChange(e,r,o)})),console.log("createPeerConnection",e,this.getClient(e)),r}},{key:"getSelectedSdpSemantics",value:function(){return{}}},{key:"call",value:function(){this.answerCall(this.audioOnly)}},{key:"onConnectionStateChange",value:function(e,o,s){console.log("onConnectionStateChange",e,o,s)}},{key:"hangup",value:function(){console.log("Ending call"),this.endCall(h.default.REASON_Hangup)}},{key:"downgrade2Voice",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.status===j.default.STATUS_CONNECTED){var o=this.cameraVideoStream.getVideoTracks();o&&o.length>0&&o.forEach((function(e){return e.stop()})),e&&this.downToVoice()}}},{key:"downToVoice",value:function(){if(console.log("down to voice"),this.stopIncomingRing(),this.status===j.default.STATUS_INCOMING)return this.setAudioOnly(!0),void this.answerCall(!0);this.status===j.default.STATUS_CONNECTED&&(this.audioOnly||(this.setAudioOnly(!0),p.default.downgrade2VoiceCall()))}},{key:"muteVideo",value:function(e){this.setVideoEnabled(!e)}},{key:"setVideoEnabled",value:function(e){if(!this.audioOnly&&!this.isScreenSharing()&&(this.videoMuted=!e,this.mediaStream()||e))if(e?(this.cameraVideoStream=null,this.createMediaSenders()):(this._stopVideoTrack(this.cameraVideoStream),this.smallVideoSender&&this.smallVideoSender.track.stop()),this.conference)this.notifyMuteState();else{var o=new O.default;o.callId=this.callId,o.videoMuted=this.videoMuted,o.existParticipants=this.getExistParticipantsStatus(),p.default.sendSignalMessage(o,self.currentSession.getParticipantIds(),!0)}}},{key:"muteAudio",value:function(e){this.setAudioEnabled(!e)}},{key:"setAudioEnabled",value:function(e){if(this.cameraVideoStream){var o=this.cameraVideoStream.getAudioTracks();o&&o.length>0&&(o[0].enabled=!o[0].enabled,this.audioMuted=!e,this.conference&&this.notifyMuteState())}}},{key:"endMedia",value:function(e,o){console.log("Ending media"),this.setState(j.default.STATUS_IDLE),this.stopIncomingRing(),this.publishPeerConnection&&(this.publishPeerConnection.close(),this.publishPeerConnection=null),this.cameraVideoStream&&(void 0===this.cameraVideoStream.getTracks?this.cameraVideoStream.stop():this.cameraVideoStream.getTracks().forEach((function(e){e.stop()})),this.cameraVideoStream=null)}},{key:"endUserCall",value:function(e,o){if(console.log("endUserCall",e,o),e!==this.selfUserInfo.uid){if(!this.conference&&e===this.initiatorId){var s=!1,t=!0,r=!1,n=void 0;try{for(var i,u=(0,a.default)(this.peerConnectionClientMap);!(t=(i=u.next()).done);t=!0){var d=i.value,c=(0,l.default)(d,2),f=c[0];if(c[1].acceptTime>0&&e===f){s=!0;break}}}catch(e){r=!0,n=e}finally{try{!t&&u.return&&u.return()}finally{if(r)throw n}}if(!(s=s||this.acceptTime>0))return void this.endCall(o)}var m=this.getClient(e);if(this.peerConnectionClientMap.delete(e),this.participantUserInfos&&(this.participantUserInfos=this.participantUserInfos.filter((function(o){return o.uid!==e}))),m){if(m.peerConnection)m.peerConnection.getSenders().forEach((function(e){return m.peerConnection.removeTrack(e)})),m.peerConnection.close(),m.peerConnection=null;e===this.initiatorId&&this.updateInitiator(),this.sessionCallback&&this.sessionCallback.didParticipantLeft(e,o)}this.isAllBusy=this.isAllBusy&&o===h.default.RemoteBusy,this.conference||0!==this.peerConnectionClientMap.size||(0===this.conversation.type||this.singleCall?this.endCall(o):this.endCall(this.isAllBusy?h.default.RemoteBusy:h.default.REASON_AllLeft))}else this.endCall(o)}},{key:"leaveConference",value:function(e){this.conference?this.endCall(h.default.REASON_Hangup,e):this.endCall(h.default.REASON_Hangup)}},{key:"endCall",value:function(e,o){if(console.log("endCall",e),this.endReason=e,this.status!==j.default.STATUS_IDLE){if(this.setState(j.default.STATUS_IDLE),!this.conference&&e!==h.default.REASON_AcceptByOtherClient&&e!==h.default.REASON_AllLeft&&this.getParticipantIds().length>0){var s=new y.default;s.callId=this.callId,s.inviteMsgUid=this.startMsgUid,s.reason=e,p.default.sendSignalMessage(s,this.getParticipantIds(),!1)}if(e!==h.default.REASON_AcceptByOtherClient){var t={};t.handle_id=this.handleId,(o||e===h.default.REASON_AllLeft||this.conversation&&this.conversation.type===C.default.Single&&[h.default.RemoteBusy,h.default.REASON_RemoteHangup,h.default.RemoteTimeout].indexOf(e)>-1)&&(t.destroy=!0),console.log("leave",(0,u.default)(t)),p.default.sendConferenceRequest(this.sessionId,this.callId,"leave",(0,u.default)(t),(function(e,o){0!==e&&console.log("conference request, leave error",e)}))}var r={callId:this.callId,audioOnly:this.audioOnly,pin:this.pin,host:this.host,title:this.title,desc:this.desc,audience:this.audience,advance:this.advance};this.keepAlive(!1),this.endTime=(new Date).valueOf();var n=!0,i=!1,d=void 0;try{for(var c,f=(0,a.default)(this.peerConnectionClientMap);!(n=(c=f.next()).done);n=!0){var m=c.value,_=(0,l.default)(m,2),b=(_[0],_[1]);b.peerConnection&&(b.peerConnection.close(),b.peerConnection=null)}}catch(e){i=!0,d=e}finally{try{!n&&f.return&&f.return()}finally{if(i)throw d}}p.default.currentSession=null,clearInterval(this.callTimer),clearInterval(this.pcStatsTimer),this.endMedia(e,r),this.sessionCallback&&this.sessionCallback.didCallEndWithReason(e)}}},{key:"defaultPublishMediaConstraints",value:function(){return{offerToReceiveAudio:!1,offerToReceiveVideo:!1}}},{key:"defaultSubscribeMediaConstraints",value:function(){return{offerToReceiveAudio:!0,offerToReceiveVideo:!0}}},{key:"createRoom",value:function(e){var o=this,s={participants:9};s.pin=this.pin,s.publishers=this.audioOnly?S.default.MAX_AUDIO_PARTICIPANT_COUNT:S.default.MAX_VIDEO_PARTICIPANT_COUNT,this.conference||(s.is_private=!0),this.record&&(s.record=!0),console.log("create room"),p.default.sendConferenceRequest(this.sessionId,this.callId,"create_room",(0,u.default)(s),(function(s,t){if(console.log("create_room res",s,t),0===s){var r=JSON.parse(t);o.sessionId=r.session_id,o.handleId=r.handle_id;var n=r.data;o.callId,n.room,o.keepAlive(!0),e(0),o.conference&&o.setState(j.default.STATUS_CONNECTING)}else e(s)}))}},{key:"onConferenceEvent",value:function(e){var o=this,s=JSON.parse(e);if(this.sessionId===s.session_id){console.log("onConferenceEvent",e);var t=s.data,r=t.videoroom;if("event"===r){var n=t.publishers;this.onPublish(n);var i=t.unpublished;i&&this.onUnpublish(i);var a=t.leaving;a&&("ok"===a&&"kicked"===t.reason?this.onLeave(this.selfUserInfo.uid):this.onLeave(a));var l=t.kicked;l&&this.onLeave(l);var u=t.joining;u&&this.onJoining([u]);var d=t.attendees;this.onJoining(d)}else if("slow_link"===r)t.sender;else if("destroyed"===r)this.endCall(h.default.RoomDestroyed);else if("participants"===r){var c=t.attendees;if(c&&c.length>0){var f=c.map((function(e){return{id:e}}));this.onJoining(f)}var m=t.leavings;m&&m.length>0&&m.forEach((function(e){o.onLeave(e)}))}else if("mute"===r){var _=t.mute;this.onMute(_)}}else console.log("on conference event, unknown sessionId",this.sessionId,s.session_id)}},{key:"keepAlive",value:function(e){var o=this;if(e){if(this.keepAliveTimer)return;this.keepAliveTimer=setInterval((function(){p.default.sendConferenceRequest(o.sessionId,o.callId,"keepalive","",(function(e,o){}))}),1e4)}else this.keepAliveTimer&&(clearInterval(this.keepAliveTimer),this.keepAliveTimer=0)}},{key:"joinAndPublish",value:function(){var e=this,o={};o.handle_id=this.handleId,o.user_id=this.selfUserInfo.uid,o.pin=this.pin,p.default.sendConferenceRequest(this.sessionId,this.callId,"join_pub",(0,u.default)(o),(function(o,s){if(console.log("join_pub",o,s),0===o){var t=JSON.parse(s),r=t.data,n=r.error_code;if(n>0)return console.log("conference request, join_pub error",n),void(n===k.default.JANUS_VIDEOROOM_ERROR_NO_SUCH_ROOM?e.endCall(h.default.RoomNotExist):n===k.default.JANUS_VIDEOROOM_ERROR_ID_EXISTS&&setTimeout((function(){console.log("rejoin"),e.joinAndPublish()}),500));e.sessionId=t.session_id,e.handleId=t.handle_id;var i=r.publishers;e.onPublish(i);r.id,r.videoroom;e.privateId=r.private_id;r.description,r.room;var a=r.attendees;e.onJoining(a),e.audience||e.publishMedia(),e.keepAlive(!0)}else e.endCall(h.default.REASON_SignalError)}))}},{key:"updateInitiator",value:function(){var e=this,o=(new Date).getTime()+864e5,s=void 0;(0,g.gt)(this.acceptTime,0)&&(o=this.acceptTime,s=this.selfUserInfo.uid),this.peerConnectionClientMap.forEach((function(e){(0,g.gt)(e.acceptTime,0)&&(0,g.gt)(o,e.acceptTime)&&(o=e.acceptTime,s=e.userId)}));var t=this.initiatorId;this.initiatorId=s,this.peerConnectionClientMap.forEach((function(o){o.isInitiator=e.initiatorId===o.userId})),t!==s&&s!==this.selfUserInfo.uid&&this.sessionCallback&&this.sessionCallback.didChangeInitiator(this.initiatorId)}},{key:"onParticipantPublish",value:function(e){e.talking;var o=e.id,s=!0,t=e.streams,r=!0,n=!1,i=void 0;try{for(var u,d=(0,a.default)(this.peerConnectionClientMap);!(r=(u=d.next()).done);r=!0){var c=u.value,f=(0,l.default)(c,2),m=f[0],_=f[1];if(m===o){_.streams(t),_.subscribe(),_.audience=!1,s=!1;break}}}catch(e){n=!0,i=e}finally{try{!r&&d.return&&d.return()}finally{if(n)throw i}}if(s){var p=new b.default(o,this);this.peerConnectionClientMap.set(p.userId,p);var h=(new Date).valueOf();this.setUserAcceptTime(p.userId,h),this.setUserJoinTime(p.userId,h),p.status=j.default.STATUS_CONNECTED,p.audience=!1,p.streams(t),p.subscribe(),this.sessionCallback&&(this.sessionCallback.didParticipantJoined(p.userId),this.sessionCallback.didChangeType(p.userId,!1))}else this.sessionCallback&&this.sessionCallback.didChangeType(o,!1)}},{key:"onPublish",value:function(e){if(console.log("onPublish",e),e){var o=!0,s=!1,t=void 0;try{for(var r,n=(0,a.default)(e);!(o=(r=n.next()).done);o=!0){var i=r.value;this.onParticipantPublish(i)}}catch(e){s=!0,t=e}finally{try{!o&&n.return&&n.return()}finally{if(s)throw t}}}}},{key:"onJoining",value:function(e){if(e){console.log("onJoining",e);var o=!0,s=!1,t=void 0;try{for(var r,n=(0,a.default)(e);!(o=(r=n.next()).done);o=!0){var i=r.value.id,u=!0,d=!0,c=!1,f=void 0;try{for(var m,_=(0,a.default)(this.peerConnectionClientMap);!(d=(m=_.next()).done);d=!0){var p=m.value,h=(0,l.default)(p,2),y=h[0],v=h[1];if(y===i){v.audience=!0,u=!1;break}}}catch(e){c=!0,f=e}finally{try{!d&&_.return&&_.return()}finally{if(c)throw f}}if(u){var A=new b.default(i,this);this.peerConnectionClientMap.set(A.userId,A);var g=(new Date).valueOf();this.setUserAcceptTime(A.userId,g),this.setUserJoinTime(A.userId,g),A.status=j.default.STATUS_CONNECTED,A.audience=!0,this.sessionCallback&&this.sessionCallback.didParticipantJoined(A.userId)}}}catch(e){s=!0,t=e}finally{try{!o&&n.return&&n.return()}finally{if(s)throw t}}}}},{key:"onUnpublish",value:function(e){var o=!0,s=!1,t=void 0;try{for(var r,n=(0,a.default)(this.peerConnectionClientMap);!(o=(r=n.next()).done);o=!0){var i=r.value,u=(0,l.default)(i,2),d=u[0],c=u[1];if(d===e){c.audience=!0;break}}}catch(e){s=!0,t=e}finally{try{!o&&n.return&&n.return()}finally{if(s)throw t}}this.conference&&e!==this.selfUserInfo.uid&&this.sessionCallback&&this.sessionCallback.didChangeType(e,!0)}},{key:"onLeave",value:function(e){this.getClient(e)?this.endUserCall(e,h.default.REASON_RemoteHangup):e===this.selfUserInfo.uid&&this.endCall(h.default.REASON_Hangup,!1)}},{key:"mediaStream",value:function(){return this.screenShareStream?this.screenShareStream:this.cameraVideoStream}},{key:"createDummyVideoStream",value:(x=(0,n.default)(r.default.mark((function e(){var o,s;return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(o=document.createElement("video")).autoplay=!0,o.loop=!0,o.src="data:video/mp4;base64,AAAAIGZ0eXBpc29tAAACAGlzb21pc28yYXZjMW1wNDEAAAAIZnJlZQAAAu1tZGF0AAACrQYF//+p3EXpvebZSLeWLNgg2SPu73gyNjQgLSBjb3JlIDE1NSByMjkwMSA3ZDBmZjIyIC0gSC4yNjQvTVBFRy00IEFWQyBjb2RlYyAtIENvcHlsZWZ0IDIwMDMtMjAxOCAtIGh0dHA6Ly93d3cudmlkZW9sYW4ub3JnL3gyNjQuaHRtbCAtIG9wdGlvbnM6IGNhYmFjPTEgcmVmPTMgZGVibG9jaz0xOjA6MCBhbmFseXNlPTB4MzoweDExMyBtZT1oZXggc3VibWU9NyBwc3k9MSBwc3lfcmQ9MS4wMDowLjAwIG1peGVkX3JlZj0xIG1lX3JhbmdlPTE2IGNocm9tYV9tZT0xIHRyZWxsaXM9MSA4eDhkY3Q9MSBjcW09MCBkZWFkem9uZT0yMSwxMSBmYXN0X3Bza2lwPTEgY2hyb21hX3FwX29mZnNldD0tMiB0aHJlYWRzPTMgbG9va2FoZWFkX3RocmVhZHM9MSBzbGljZWRfdGhyZWFkcz0wIG5yPTAgZGVjaW1hdGU9MSBpbnRlcmxhY2VkPTAgYmx1cmF5X2NvbXBhdD0wIGNvbnN0cmFpbmVkX2ludHJhPTAgYmZyYW1lcz0zIGJfcHlyYW1pZD0yIGJfYWRhcHQ9MSBiX2JpYXM9MCBkaXJlY3Q9MSB3ZWlnaHRiPTEgb3Blbl9nb3A9MCB3ZWlnaHRwPTIga2V5aW50PTI1MCBrZXlpbnRfbWluPTEgc2NlbmVjdXQ9NDAgaW50cmFfcmVmcmVzaD0wIHJjX2xvb2thaGVhZD00MCByYz1jcmYgbWJ0cmVlPTEgY3JmPTI4LjAgcWNvbXA9MC42MCBxcG1pbj0wIHFwbWF4PTY5IHFwc3RlcD00IGlwX3JhdGlvPTEuNDAgYXE9MToxLjAwAIAAAAAwZYiEAD//8m+P5OXfBeLGOfKE3xkODvFZuBflHv/+VwJIta6cbpIo4ABLoKBaYTkTAAAC7m1vb3YAAABsbXZoZAAAAAAAAAAAAAAAAAAAA+gAAAPoAAEAAAEAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAIYdHJhawAAAFx0a2hkAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAPoAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAACgAAAAWgAAAAAAJGVkdHMAAAAcZWxzdAAAAAAAAAABAAAD6AAAAAAAAQAAAAABkG1kaWEAAAAgbWRoZAAAAAAAAAAAAAAAAAAAQAAAAEAAVcQAAAAAAC1oZGxyAAAAAAAAAAB2aWRlAAAAAAAAAAAAAAAAVmlkZW9IYW5kbGVyAAAAATttaW5mAAAAFHZtaGQAAAABAAAAAAAAAAAAAAAkZGluZgAAABxkcmVmAAAAAAAAAAEAAAAMdXJsIAAAAAEAAAD7c3RibAAAAJdzdHNkAAAAAAAAAAEAAACHYXZjMQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAACgAFoASAAAAEgAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABj//wAAADFhdmNDAWQACv/hABhnZAAKrNlCjfkhAAADAAEAAAMAAg8SJZYBAAZo6+JLIsAAAAAYc3R0cwAAAAAAAAABAAAAAQAAQAAAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAEAAAABAAAAFHN0c3oAAAAAAAAC5QAAAAEAAAAUc3RjbwAAAAAAAAABAAAAMAAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTguMTIuMTAw",o.load(),e.next=7,o.play();case 7:return s=null,o.captureStream?s=o.captureStream():o.mozCaptureStream?s=o.mozCaptureStream():console.log("captureStream() not supported"),e.abrupt("return",s);case 10:case"end":return e.stop()}}),e,this)}))),function(){return x.apply(this,arguments)})},{key:"createMediaSenders",value:(A=(0,n.default)(r.default.mark((function e(){var o,s,t,n,i,a;return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=this.mediaStream()){e.next=9;break}return e.next=4,this.createLocalCameraVideoStream(this.audioOnly||this.videoMuted);case 4:if(this.cameraVideoStream=e.sent,this.cameraVideoStream){e.next=8;break}return this.endCall(h.default.REASON_MediaError),e.abrupt("return");case 8:o=this.cameraVideoStream;case 9:if(this.dummyVideoStream||!this.videoMuted){e.next=14;break}return e.next=12,this.createDummyVideoStream();case 12:this.dummyVideoStream=e.sent,this.notifyMuteState();case 14:if(s=o.getAudioTracks()[0],t=this.videoMuted?this.dummyVideoStream:o,s.enabled=!this.audioMuted,n=this.publishPeerConnection,this.audioOnly){e.next=28;break}if(this.audioSender?this.audioSender.replaceTrack(s):this.audioSender=n.addTrack(s,o),this.videoSender?this.videoSender.replaceTrack(t.getVideoTracks()[0]):this.videoSender=n.addTrack(t.getVideoTracks()[0],t),S.default.DISABLE_DUAL_STREAM){e.next=26;break}return i=t.getVideoTracks()[0].clone(),e.next=25,i.applyConstraints(this.tinyVideoTrackConstraints());case 25:this.smallVideoSender?this.smallVideoSender.replaceTrack(i):this.smallVideoSender=n.addTrack(i,t);case 26:e.next=29;break;case 28:this.audioSender=n.addTrack(s,o);case 29:(a=new I.SoundMeter(window.audioContext)).connectToSource(o,(function(e){console.log("connect to self soundMeter",e)})),this.publishPeerConnection._soundMeter=a,console.log("Added local stream to pc");case 33:case"end":return e.stop()}}),e,this)}))),function(){return A.apply(this,arguments)})},{key:"publishMedia",value:(s=(0,n.default)(r.default.mark((function e(){var o,s,t,n,i=this;return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.publishPeerConnection=this.createPeerConnection(this.selfUserInfo.uid),e.next=3,this.createMediaSenders();case 3:return e.prev=3,e.next=6,this.publishPeerConnection.createOffer(this.defaultPublishMediaConstraints());case 6:return o=e.sent,e.next=9,this.publishPeerConnection.setLocalDescription(o);case 9:(s={}).session_id=this.sessionId,s.handle_id=this.handleId,(t={}).request="configure",t.audio=!0,t.video=!0,t.pin=this.pin,s.body=t,(n={}).sdp=o.sdp,n.type="offer",s.jsep=n,p.default.sendConferenceRequest(this.sessionId,this.callId,"message",(0,u.default)(s),(function(e,o){if(0===e){var s=JSON.parse(o);if(i.sessionId===s.session_id){var t=s.jsep;if(t&&"answer"===t.type)i.publishPeerConnection.setRemoteDescription(t);else{var r=s.plugindata;if(r){var n=r.data;n&&(n.error_code===k.default.JANUS_VIDEOROOM_ERROR_PUBLISHERS_FULL?i.status===j.default.STATUS_CONNECTED?(i.audience=!0,i.unPublishMedia(),i.sessionCallback&&i.sessionCallback(i.selfUserInfo.uid,!0)):i.status!==j.default.STATUS_IDLE&&i.endCall(h.default.RoomParticipantsFull):i.endCall(h.default.REASON_SignalError))}}}else console.log("conference request, message unknown sessionId",i.sessionId,s.session_id)}else console.log("conference request, message, error",e)})),e.next=28;break;case 25:e.prev=25,e.t0=e.catch(3),this.endCall(h.default.REASON_MediaError);case 28:case"end":return e.stop()}}),e,this,[[3,25]])}))),function(){return s.apply(this,arguments)})},{key:"unPublishMedia",value:function(){var e=this;this.publishPeerConnection&&(this.publishPeerConnection.close(),this.publishPeerConnection=null);var o=this.mediaStream();o&&(void 0===o.getTracks||o.getTracks().forEach((function(e){e.stop()})),o.stop(),this.cameraVideoStream=null,this.screenShareStream=null);var s={};s.handle_id=this.handleId,s.pin=this.pin,p.default.sendConferenceRequest(this.sessionId,this.callId,"unpublish",(0,u.default)(s),(function(o,s){o>0&&e.endCall(h.default.REASON_SignalError)}))}},{key:"requestChangeMode",value:function(e,o){var s=new T.default(this.callId,o),t=new M.default(C.default.Single,e,0);p.default.sendSignalMessageEx(t,s,this.getParticipantIds(),!1)}},{key:"onRequestChangeMode",value:function(e){this.switchAudience(e)}},{key:"onKickoff",value:function(){this.leaveConference(!1)}},{key:"switchAudience",value:function(e){this.conference&&(e?this.audience||(this.audience=!0,this.unPublishMedia(),this.sessionCallback&&this.sessionCallback.didChangeType(this.selfUserInfo.uid,!0)):this.audience&&(this.audience=!1,this.publishMedia(),this.sessionCallback&&this.sessionCallback.didChangeType(this.selfUserInfo.uid,!1)))}},{key:"onMute",value:function(e){var o=[];this.peerConnectionClientMap.forEach((function(s,t){var r=e[t],n=!1,i=!1;r&&(n=void 0!==r.a&&r.a,i=void 0!==r.v&&r.v),s.videoMuted===i&&s.audioMuted===n||(s.videoMuted=i,s.audioMuted=n,o.push(t))})),o.length>0&&this.sessionCallback&&this.sessionCallback.didMuteStateChanged(o)}},{key:"notifyMuteState",value:function(){if(this.conference&&this.status!==j.default.STATUS_IDLE){var e={handle_id:this.handleId,a:this.audioMuted,v:this.videoMuted&&!this.isScreenSharing()};p.default.sendConferenceRequest(this.sessionId,this.callId,"mute",(0,u.default)(e),(function(e,o){console.log("mute res",e,o)}))}}},{key:"kickoffParticipant",value:function(e,o,s){if(this.status===j.default.STATUS_IDLE&&s&&s(-1),this.getClient(e)){var t={handle_id:this.handleId,user:e};p.default.sendConferenceRequest(this.sessionId,this.callId,"kick",(0,u.default)(t),(function(e,t){console.log("kick res",e,t),0===e?o&&o():s&&s(e)}))}}},{key:"closeVoipWindow",value:function(){E.default.useIframe?E.default.emitToMain("close-iframe-window"):v.currentWindow?v.currentWindow.close():window.close()}}],[{key:"newSession",value:function(e,s,t,r,n){console.log("newSession");var i=new o;return i.conversation=e,i.initiatorId=s,i.callId=t,i.audioOnly=r,i.sessionCallback=n,i}}]),o}(A.default);o.default=w},"./av/internal/PeerConnectionClientImpl.js":function(e,o,s){"use strict";Object.defineProperty(o,"__esModule",{value:!0});var t=_(s("./node_modules/babel-runtime/regenerator/index.js")),r=_(s("./node_modules/babel-runtime/helpers/asyncToGenerator.js")),n=_(s("./node_modules/babel-runtime/core-js/json/stringify.js")),i=_(s("./node_modules/babel-runtime/core-js/object/get-prototype-of.js")),a=_(s("./node_modules/babel-runtime/helpers/classCallCheck.js")),l=_(s("./node_modules/babel-runtime/helpers/createClass.js")),u=_(s("./node_modules/babel-runtime/helpers/possibleConstructorReturn.js")),d=_(s("./node_modules/babel-runtime/helpers/inherits.js")),c=_(s("../engine/PeerConnectionClient")),f=_(s("./av/internal/avenginekitImpl.js")),m=_(s("../engine/avenginekit"));function _(e){return e&&e.__esModule?e:{default:e}}var j=function(e){function o(e,s){(0,a.default)(this,o);var t=(0,u.default)(this,(o.__proto__||(0,i.default)(o)).call(this));return t.lastFramesDecoded=0,t.tickSinceLastFramesDecoded=0,t.unsubscribing=!1,t.availableVideoMids=[],t.ready=!1,t.userId=e,t.callSession=s,t.availableVideoMids=[],t.useMainVideo=m.default.DISABLE_DUAL_STREAM,t}var s;return(0,d.default)(o,e),(0,l.default)(o,[{key:"subscribe",value:function(){var e=this,o={};o.feed=this.userId,o.pin=this.callSession.pin,this.availableVideoMids.length>1&&(o.streams=[{feed:this.userId,mid:this.useMainVideo?this.availableVideoMids[0]:this.availableVideoMids[1]},{feed:this.userId,mid:"0"}]),f.default.sendConferenceRequestEx(this.callSession.sessionId,this.callSession.callId,"join_sub",(0,n.default)(o),this.callSession.advance,(function(o,s){if(0===o){var t=JSON.parse(s),r=t.session_id;if(r===e.callSession.sessionId){e.handleId=t.handle_id;var n=t.jsep;console.log("call subscribeMedia",n),e.subscribeMedia(n)}else console.log("join response, unknown sessionId",e.callSession.sessionId,r)}else console.log("join_sub error",o)}))}},{key:"subscribeMedia",value:(s=(0,r.default)(t.default.mark((function e(o){var s,r,i,a,l=this;return t.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(console.log("subscribeMedia",o),o){e.next=3;break}return e.abrupt("return");case 3:if(this.peerConnection){e.next=6;break}return e.next=6,this.callSession.createPeerConnection(this.userId);case 6:return e.prev=6,e.next=9,this.peerConnection.setRemoteDescription(o);case 9:return e.next=11,this.peerConnection.createAnswer(this.callSession.defaultSubscribeMediaConstraints());case 11:return s=e.sent,e.next=14,this.peerConnection.setLocalDescription(s);case 14:(r={}).session_id=this.callSession.sessionId,r.handle_id=this.handleId,(i={}).request="start",i.room=this.callSession.callId,r.body=i,(a={}).sdp=s.sdp,a.type="answer",r.jsep=a,f.default.sendConferenceRequestEx(this.callSession.sessionId,this.callSession.callId,"message",(0,n.default)(r),this.callSession.advance,(function(e,o){0===e?(JSON.parse(o),l.unsubscribing?l.unsubscribing=!1:l.ready=!0):console.log("conference request, message error",e)})),e.next=31;break;case 28:e.prev=28,e.t0=e.catch(6),console.log("subscribeMedia error",this.userId,e.t0);case 31:case"end":return e.stop()}}),e,this,[[6,28]])}))),function(e){return s.apply(this,arguments)})},{key:"streams",value:function(e){var o=this;e&&(this.availableVideoMids.length=0,e.forEach((function(e){if("video"===e.type){var s=e.mid;o.availableVideoMids.push(s)}})))}},{key:"subscribeStream",value:function(e,o,s,t){var r=this,i={handle_id:this.handleId,feed:this.userId,mid:e};o&&(i.unsub=1),console.log("wfc subscribe stream request",i),f.default.sendConferenceRequestEx(this.callSession.sessionId,this.callSession.callId,"subscribe",(0,n.default)(i),this.callSession.advance,(function(e,n){if(0!==e)return console.log("wfc conference request, message error",e),void(t&&t(e));console.log("wfc subscribe stream response",i);var a=JSON.parse(n).jsep;a&&(o&&(r.unsubscribing=!0),r.subscribeMedia(a)),s&&s()}))}},{key:"setUseMainVideo",value:function(e){var o=this;if(this.useMainVideo!==e&&!(this.availableVideoMids.length<2)&&this.handleId&&this.ready){this.useMainVideo=e;var s=void 0,t=void 0;e?(s=this.availableVideoMids[1],t=this.availableVideoMids[0]):(s=this.availableVideoMids[0],t=this.availableVideoMids[1]),this.ready=!1,this.subscribeStream(s,!0,(function(){setTimeout((function(){o.subscribeStream(t,!1,(function(){}),(function(e){o.ready=!0}))}),200)}),(function(e){o.ready=!0}))}}}]),o}(c.default);o.default=j},"./av/internal/avenginekitImpl.js":function(e,o,s){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.WfcAVEngineKitImpl=void 0;var t=g(s("./node_modules/babel-runtime/core-js/map.js")),r=g(s("./node_modules/babel-runtime/helpers/toConsumableArray.js")),n=g(s("./node_modules/babel-runtime/core-js/object/get-prototype-of.js")),i=g(s("./node_modules/babel-runtime/helpers/classCallCheck.js")),a=g(s("./node_modules/babel-runtime/helpers/createClass.js")),l=g(s("./node_modules/babel-runtime/helpers/possibleConstructorReturn.js")),u=g(s("./node_modules/babel-runtime/helpers/inherits.js")),d=g(s("../../messages/messageContentType")),c=g(s("../messages/callByeMessageContent")),f=g(s("../messages/callAnswerMessageContent")),m=g(s("../messages/callStartMessageContent")),_=g(s("../messages/callModifyMessageContent")),j=g(s("../../model/conversationType")),p=g(s("../engine/callEndReason")),h=g(s("../engine/avenginekitproxy")),y=g(s("../engine/callState")),b=g(s("./av/internal/CallSessionImpl.js")),v=g(s("../messages/addParticipantsMessageContent")),A=g(s("../engine/avenginekit"));g(s("../messages/muteVideoMessageContent"));function g(e){return e&&e.__esModule?e:{default:e}}var S=new(o.WfcAVEngineKitImpl=function(e){function o(){(0,i.default)(this,o);var e=(0,l.default)(this,(o.__proto__||(0,n.default)(o)).call(this));return e.sendMessageId=0,e.sendConferenceRequestId=0,e.onSendMessage=function(o,s){var t=e.sendMessageCallbackMap.get(s.sendMessageId);t&&t(s.error,s.messageUid,s.timestamp),e.sendMessageCallbackMap.delete(s.sendMessageId)},e.onSendConferenceRequest=function(o,s){var t=e.sendConferenceRequestCallbackMap.get(s.sendConferenceRequestId);t&&t(s.error,s.response),e.sendConferenceRequestCallbackMap.delete(s.sendConferenceRequestId)},e.onConferenceEvent=function(o,s){e.currentSession&&e.currentSession.onConferenceEvent(s)},e.onReceiveMessage=function(e,o){if(console.log("receive voip message ",o),!(o.conversation.type!==j.default.Single&&o.conversation.type!==j.default.Group||1!==o.direction&&o.messageContent.type!==d.default.VOIP_CONTENT_TYPE_ACCEPT&&o.messageContent.type!==d.default.VOIP_CONTENT_TYPE_END)){var s=o.messageContent;if(o.messageContent.type===d.default.VOIP_CONTENT_TYPE_SIGNAL){if(!S.currentSession||S.currentSession.status===y.default.STATUS_IDLE)return;var t=o.messageContent;t.callId!==S.currentSession.callId?S.rejectOtherCall(o.conversation,s.callId,null,o.messageUid):!S.currentSession||S.currentSession.status!==y.default.STATUS_CONNECTING&&S.currentSession.status!==y.default.STATUS_CONNECTED&&S.currentSession.status!==y.default.STATUS_OUTGOING||S.onReceiveData(o.from,t.payload)}else if(o.messageContent.type===d.default.VOIP_CONTENT_TYPE_START){console.log("callstart",o);var n=o.messageContent.targetIds;if(n.findIndex((function(e){return e===o.selfUserInfo.uid}))<0)return;n=(n=n.filter((function(e){return e!==o.selfUserInfo.uid}))).push(o.from),S.currentSession&&S.currentSession.status!==y.default.STATUS_IDLE?S.rejectOtherCall(o.conversation,s.callId,n,o.messageUid):(S.currentSession=b.default.newSession(o.conversation,o.from,s.callId,s.audioOnly,S.sessionCallback),S.currentSession.startMsgUid=o.messageUid,S.currentSession.pin=s.pin,S.currentSession.initSession(!1,o.selfUserInfo,o.participantUserInfos,o.groupMemberUserInfos),S.currentSession.setState(y.default.STATUS_INCOMING),S.currentSession.joinTime=o.timestamp,S.currentSession.setUserJoinTime(o.from,o.timestamp),o.participantUserInfos.forEach((function(e){S.currentSession.setUserJoinTime(e.uid,o.timestamp)})),S.currentSession.setUserAcceptTime(o.from,o.timestamp))}else if(o.messageContent.type===d.default.VOIP_CONTENT_TYPE_ACCEPT||o.messageContent.type===d.default.VOIP_CONTENT_TYPE_ACCEPT_T){if(S.currentSession&&S.currentSession.status!==y.default.STATUS_IDLE){if(s.callId!==S.currentSession.callId)return void(1===o.direction&&S.rejectOtherCall(o.conversation,s.callId,[o.selfUserInfo.uid]));if(0===o.direction&&S.currentSession.status===y.default.STATUS_INCOMING)return void S.currentSession.endCall(p.default.REASON_AcceptByOtherClient);S.currentSession.status===y.default.STATUS_OUTGOING&&S.currentSession.setState(y.default.STATUS_CONNECTING),!S.currentSession.audioOnly&&s.audioOnly&&S.currentSession.setAudioOnly(!0),S.currentSession.setUserAcceptTime(o.from,o.timestamp);var i=S.queueOfferMessageMap.get(o.from);i&&i.forEach((function(e){S.processSignalingMessage(o.from,e)})),S.queueOfferMessageMap.delete(o.from)}}else if(o.messageContent.type===d.default.VOIP_CONTENT_TYPE_END)if(S.currentSession&&S.currentSession.status!==y.default.STATUS_IDLE&&S.currentSession.callId===s.callId){var a=s.reason;if(1===o.direction){switch(s.reason){case p.default.REASON_Unknown:a=p.default.REASON_Unknown;break;case p.default.REASON_Busy:a=p.default.RemoteBusy;break;case p.default.REASON_SignalError:a=p.default.RemoteNetworkError;break;case p.default.REASON_Hangup:a=p.default.REASON_RemoteHangup;break;case p.default.REASON_MediaError:a=p.default.RemoteNetworkError;break;case p.default.REASON_RemoteHangup:a=p.default.REASON_Hangup;break;case p.default.REASON_OpenCameraFailure:a=p.default.RemoteNetworkError;break;case p.default.REASON_Timeout:a=p.default.RemoteTimeout;break;case p.default.REASON_AcceptByOtherClient:a=p.default.REASON_AcceptByOtherClient;break;case p.default.REASON_AllLeft:a=p.default.REASON_AllLeft;break;case p.default.RemoteBusy:a=p.default.REASON_Busy;break;case p.default.RemoteTimeout:a=p.default.REASON_Timeout;break;case p.default.RemoteNetworkError:a=p.default.REASON_SignalError;break;case p.default.RoomDestroyed:a=p.default.RoomDestroyed;break;case p.default.RoomNotExist:a=p.default.RoomNotExist;break;case p.default.RoomParticipantsFull:a=p.default.RoomParticipantsFull;break;default:a=p.default.RemoteNetworkError}S.currentSession.endUserCall(o.from,a)}else S.currentSession.endCall(a)}else console.log("invalid bye message, ignore it");else if(o.messageContent.type===d.default.VOIP_CONTENT_TYPE_MODIFY)S.currentSession&&S.currentSession.status===y.default.STATUS_CONNECTED&&S.currentSession.callId===s.callId&&(s.audioOnly?(S.currentSession.audioOnly=!0,S.currentSession.downgrade2Voice(!0)):console.log("cannot modify voice call to video call"));else if(o.messageContent.type===d.default.VOIP_CONTENT_TYPE_ADD_PARTICIPANT)if(s.participants.indexOf(o.selfUserInfo.uid)>-1){if(S.currentSession&&S.currentSession.status!==y.default.STATUS_IDLE){var l,u,c=[];if((l=c).push.apply(l,(0,r.default)(o.messageContent.participants)),o.messageContent.existParticipants)(u=c).push.apply(u,(0,r.default)(o.messageContent.existParticipants));return c.push(o.from),c=c.filter((function(e){return e!==o.selfUserInfo.uid})),void S.rejectOtherCall(o.conversation,s.callId,c)}S.currentSession=b.default.newSession(o.conversation,o.from,s.callId,s.audioOnly,S.sessionCallback),S.currentSession.pin=s.pin,S.currentSession.startMsgUid=o.messageUid;var f=o.participantUserInfos.filter((function(e){return e.uid!==o.selfUserInfo.uid}));S.currentSession.initSession(!1,o.selfUserInfo,f,o.groupMemberUserInfos),S.currentSession.joinTime=o.timestamp,f.forEach((function(e){S.currentSession.setUserJoinTime(e.uid,o.timestamp)})),S.currentSession.updateExistParticipant(s.existParticipants,o.timestamp)}else if(S.currentSession&&S.currentSession.status!==y.default.STATUS_IDLE&&S.currentSession.callId===s.callId){var m=o.participantUserInfos.filter((function(e){return s.participants.indexOf(e.uid)>-1}));S.currentSession.didAddNewParticipants(s.participants,m),m.forEach((function(e){S.currentSession.setUserJoinTime(e.uid,o.timestamp)}))}else{var _,h,v=[];if((_=v).push.apply(_,(0,r.default)(o.messageContent.participants)),o.messageContent.existParticipants)(h=v).push.apply(h,(0,r.default)(o.messageContent.existParticipants));v.push(o.from),v=v.filter((function(e){return e!==o.selfUserInfo.uid})),S.rejectOtherCall(o.conversation,s.callId,v)}else if(o.messageContent.type===d.default.VOIP_CONTENT_TYPE_MUTE_VIDEO){var A=o.messageContent;S.currentSession&&S.currentSession.callId===A.callId&&S.currentSession.status!==y.default.STATUS_IDLE&&S.currentSession.updateVideoMute(o.from,A.videoMuted)}else if(o.messageContent.type===d.default.CONFERENCE_CONTENT_TYPE_CHANGE_MODE){var g=o.messageContent;S.currentSession&&S.currentSession.callId===g.callId&&S.currentSession.onRequestChangeMode(g.audience)}else if(o.messageContent.type===d.default.CONFERENCE_CONTENT_TYPE_KICKOFF_MEMBER){var C=o.messageContent;S.currentSession&&S.currentSession.callId===C.callId&&S.currentSession.onKickoff()}}},e.startCall=function(o,s){var t=s.conversation,r=s.audioOnly;if(!e.currentSession){e.currentSession=b.default.newSession(t,s.selfUserInfo.uid,s.callId,r,S.sessionCallback),e.currentSession.pin="";for(var n=0;n<6;n++)e.currentSession.pin+=Math.floor(10*Math.random());e.currentSession.initSession(!0,s.selfUserInfo,s.participantUserInfos,s.groupMemberUserInfos),e.currentSession.setState(y.default.STATUS_OUTGOING);var i=new m.default;i.audioOnly=r,i.callId=s.callId,i.pin=e.currentSession.pin,i.targetIds=e.currentSession.getParticipantIds(),e.currentSession.createRoom((function(o){0===o?e.sendSignalMessage(i,e.currentSession.getParticipantIds(),!0,(function(o,s,t){S.currentSession&&(0!==o?e.currentSession.endCall(p.default.REASON_SignalError):(e.currentSession.startMsgUid=s,console.log("startMsgUid",e.currentSession.startMsgUid,s),e.currentSession.joinTime=t,e.currentSession.setAcceptTime(t),i.targetIds.forEach((function(o){e.currentSession.setUserJoinTime(o,t)}),e)))})):e.currentSession.endCall(p.default.REASON_SignalError)}))}},e.startConference=function(o,s){var t=s.audioOnly;e.currentSession||(e.currentSession=b.default.newSession(null,s.selfUserInfo.uid,s.callId,t,S.sessionCallback),e.currentSession.pin=s.pin,e.currentSession.host=s.host,e.currentSession.title=s.title,e.currentSession.desc=s.desc,e.currentSession.conference=!0,e.currentSession.defaultAudience=s.audience,e.currentSession.advance=s.advance,e.currentSession.record=s.record,e.currentSession.extra=s.extra,e.currentSession.initSession(!0,s.selfUserInfo,null,null,!0),e.currentSession.setState(y.default.STATUS_OUTGOING),e.currentSession.createRoom((function(o){0!==o&&e.currentSession.endCall(p.default.REASON_SignalError)})))},e.joinConference=function(o,s){e.currentSession||(console.log("joinConference",s),e.currentSession=b.default.newSession(null,s.selfUserInfo.uid,s.callId,s.audioOnly,S.sessionCallback),e.currentSession.pin=s.pin,e.currentSession.host=s.host,e.currentSession.title=s.title,e.currentSession.desc=s.desc,e.currentSession.defaultAudience=s.audience,s.audience&&s.host===s.selfUserInfo.uid?e.currentSession.audience=!1:e.currentSession.audience=s.audience,e.currentSession.conference=!0,e.currentSession.advance=s.advance,e.currentSession.audioMuted=s.muteAudio,e.currentSession.videoMuted=s.muteVideo,e.currentSession.extra=s.extra,e.currentSession.initSession(!1,s.selfUserInfo,null,null,!0),e.currentSession.setState(y.default.STATUS_CONNECTING))},e}return(0,u.default)(o,e),(0,a.default)(o,[{key:"setup",value:function(e){console.log("wfc avengine-conference"),h.default.listenVoipEvent("message",this.onReceiveMessage),h.default.listenVoipEvent("conferenceEvent",this.onConferenceEvent),h.default.listenVoipEvent("sendMessageResult",this.onSendMessage),h.default.listenVoipEvent("sendConferenceRequestResult",this.onSendConferenceRequest),h.default.listenVoipEvent("startCall",this.startCall),h.default.listenVoipEvent("startConference",this.startConference),h.default.listenVoipEvent("joinConference",this.joinConference),this.sendMessageCallbackMap=new t.default,this.sendConferenceRequestCallbackMap=new t.default,this.queueOfferMessageMap=new t.default,this.sessionCallback=e}},{key:"inviteNewParticipants",value:function(e,o){var s=S.currentSession;if(s){var t=new v.default;t.callId=s.callId,t.initiator=s.selfUserInfo.uid,console.log("inviteNewParticipants","initiator "+s.selfUserInfo),t.audioOnly=s.audioOnly,t.pin=o,t.participants=e,t.existParticipants=s.getExistParticipantsStatus();var n=[].concat((0,r.default)(s.getParticipantIds()));n.push.apply(n,(0,r.default)(e)),this.sendSignalMessage(t,n,!0,(function(o,t,r){if(console.log("send invite message success"),0===o){var n=s.groupMemberUserInfos.filter((function(o){return e.findIndex((function(e){return e===o.uid}))>-1}));console.log("didAddNewParticipants av",e,n),s.didAddNewParticipants(e,n),e.forEach((function(e){s.setUserJoinTime(e,r)}))}else console.log("send invite message error",o)}))}}},{key:"updateCallStartMessageContent",value:function(e,o){var s={messageUid:e,content:o};h.default.emitToMain("update-call-start-message",s)}},{key:"clearInviteUnreadStatus",value:function(e){}},{key:"sendSignalMessage",value:function(e,o,s,t){S.currentSession.conversation&&this.sendSignalMessageEx(S.currentSession.conversation,e,o,s,t)}},{key:"sendSignalMessageEx",value:function(e,o,s,t,r){var n={conversation:e,content:o.encode(),toUsers:s};console.log("send signal message",o),r&&(this.sendMessageId++,n.sendMessageId=this.sendMessageId,this.sendMessageCallbackMap.set(this.sendMessageId,r)),h.default.emitToMain("voip-message",n)}},{key:"sendConferenceRequest",value:function(e,o,s,t,r){this.sendConferenceRequestEx(e,o,s,t,this.currentSession.advance,r)}},{key:"sendConferenceRequestEx",value:function(e,o,s,t,r,n){var i={sessionId:e,roomId:o,request:s,data:t,advance:r};n&&(this.sendConferenceRequestId++,i.sendConferenceRequestId=this.sendConferenceRequestId,this.sendConferenceRequestCallbackMap.set(this.sendConferenceRequestId,n)),h.default.emitToMain("conference-request",i)}},{key:"rejectOtherCall",value:function(e,o,s,t){var r=new c.default;r.callId=o,r.inviteMsgUid=t,r.reason=p.default.REASON_Busy,console.log("reject other call");var n={conversation:e,content:r.encode(),toUsers:s};h.default.emitToMain("voip-message",n)}},{key:"onReceiveData",value:function(e,o){var s=JSON.parse(o);if(S.currentSession.getPeerConnection(e))S.processSignalingMessage(e,s);else{console.log("queue signal",e,s);var t=this.queueOfferMessageMap.get(e);t||(t=[],this.queueOfferMessageMap.set(e,t)),t.push(s)}}},{key:"processSignalingMessage",value:function(e,o){console.log("process remote signal:"+o)}},{key:"answerCurrentCall",value:function(){var e=this,o=new f.default;o.audioOnly=S.currentSession.audioOnly,o.callId=S.currentSession.callId,o.inviteMessageUid=S.currentSession.startMsgUid,this.sendSignalMessage(o,this.currentSession.getParticipantIds(),!0,(function(o,s,t){0===o?e.currentSession.setAcceptTime(t):e.currentSession.endCall(p.default.REASON_SignalError)}))}},{key:"downgrade2VoiceCall",value:function(){var e=new _.default;S.currentSession.audioOnly=!0,e.audioOnly=S.currentSession.audioOnly,e.callId=S.currentSession.callId,this.sendSignalMessage(e,this.currentSession.getParticipantIds(),!0)}}]),o}(A.default));o.default=S},"./av/internal/roomErrorCode.js":function(e,o,s){"use strict";Object.defineProperty(o,"__esModule",{value:!0});var t,r=s("./node_modules/babel-runtime/helpers/classCallCheck.js"),n=(t=r)&&t.__esModule?t:{default:t};var i=function e(){(0,n.default)(this,e)};i.JANUS_VIDEOROOM_ERROR_UNKNOWN_ERROR=499,i.JANUS_VIDEOROOM_ERROR_NO_MESSAGE=421,i.JANUS_VIDEOROOM_ERROR_INVALID_JSON=422,i.JANUS_VIDEOROOM_ERROR_INVALID_REQUEST=423,i.JANUS_VIDEOROOM_ERROR_JOIN_FIRST=424,i.JANUS_VIDEOROOM_ERROR_ALREADY_JOINED=425,i.JANUS_VIDEOROOM_ERROR_NO_SUCH_ROOM=426,i.JANUS_VIDEOROOM_ERROR_ROOM_EXISTS=427,i.JANUS_VIDEOROOM_ERROR_NO_SUCH_FEED=428,i.JANUS_VIDEOROOM_ERROR_MISSING_ELEMENT=429,i.JANUS_VIDEOROOM_ERROR_INVALID_ELEMENT=430,i.JANUS_VIDEOROOM_ERROR_INVALID_SDP_TYPE=431,i.JANUS_VIDEOROOM_ERROR_PUBLISHERS_FULL=432,i.JANUS_VIDEOROOM_ERROR_UNAUTHORIZED=433,i.JANUS_VIDEOROOM_ERROR_ALREADY_PUBLISHED=434,i.JANUS_VIDEOROOM_ERROR_NOT_PUBLISHED=435,i.JANUS_VIDEOROOM_ERROR_ID_EXISTS=436,i.JANUS_VIDEOROOM_ERROR_INVALID_SDP=437,o.default=i},"./av/internal/soundMeter.js":function(e,o,s){"use strict";function t(e){this.context=e,this.instant=0,this.slow=0,this.clip=0,this.script=e.createScriptProcessor(2048,1,1);var o=this;this.script.onaudioprocess=function(e){var s=e.inputBuffer.getChannelData(0),t=void 0,r=0,n=0;for(t=0;t.99&&(n+=1);o.instant=Math.sqrt(r/s.length),o.slow=.95*o.slow+.05*o.instant,o.clip=n/s.length}}Object.defineProperty(o,"__esModule",{value:!0}),o.SoundMeter=t,t.prototype.connectToSource=function(e,o){console.log("SoundMeter connecting");try{this.mic=this.context.createMediaStreamSource(e),this.mic.connect(this.script),this.script.connect(this.context.destination),void 0!==o&&o(null)}catch(e){console.error(e),void 0!==o&&o(e)}},t.prototype.stop=function(){console.log("SoundMeter stopping"),this.mic.disconnect(),this.script.disconnect()}},"./node_modules/babel-runtime/core-js/array/from.js":function(e,o,s){e.exports={default:s("./node_modules/core-js/library/fn/array/from.js"),__esModule:!0}},"./node_modules/babel-runtime/core-js/get-iterator.js":function(e,o,s){e.exports={default:s("./node_modules/core-js/library/fn/get-iterator.js"),__esModule:!0}},"./node_modules/babel-runtime/core-js/is-iterable.js":function(e,o,s){e.exports={default:s("./node_modules/core-js/library/fn/is-iterable.js"),__esModule:!0}},"./node_modules/babel-runtime/core-js/json/stringify.js":function(e,o,s){e.exports={default:s("./node_modules/core-js/library/fn/json/stringify.js"),__esModule:!0}},"./node_modules/babel-runtime/core-js/map.js":function(e,o,s){e.exports={default:s("./node_modules/core-js/library/fn/map.js"),__esModule:!0}},"./node_modules/babel-runtime/core-js/object/assign.js":function(e,o,s){e.exports={default:s("./node_modules/core-js/library/fn/object/assign.js"),__esModule:!0}},"./node_modules/babel-runtime/core-js/object/create.js":function(e,o,s){e.exports={default:s("./node_modules/core-js/library/fn/object/create.js"),__esModule:!0}},"./node_modules/babel-runtime/core-js/object/define-property.js":function(e,o,s){e.exports={default:s("./node_modules/core-js/library/fn/object/define-property.js"),__esModule:!0}},"./node_modules/babel-runtime/core-js/object/get-prototype-of.js":function(e,o,s){e.exports={default:s("./node_modules/core-js/library/fn/object/get-prototype-of.js"),__esModule:!0}},"./node_modules/babel-runtime/core-js/object/set-prototype-of.js":function(e,o,s){e.exports={default:s("./node_modules/core-js/library/fn/object/set-prototype-of.js"),__esModule:!0}},"./node_modules/babel-runtime/core-js/promise.js":function(e,o,s){e.exports={default:s("./node_modules/core-js/library/fn/promise.js"),__esModule:!0}},"./node_modules/babel-runtime/core-js/symbol.js":function(e,o,s){e.exports={default:s("./node_modules/core-js/library/fn/symbol/index.js"),__esModule:!0}},"./node_modules/babel-runtime/core-js/symbol/iterator.js":function(e,o,s){e.exports={default:s("./node_modules/core-js/library/fn/symbol/iterator.js"),__esModule:!0}},"./node_modules/babel-runtime/helpers/asyncToGenerator.js":function(e,o,s){"use strict";o.__esModule=!0;var t,r=s("./node_modules/babel-runtime/core-js/promise.js"),n=(t=r)&&t.__esModule?t:{default:t};o.default=function(e){return function(){var o=e.apply(this,arguments);return new n.default((function(e,s){return function t(r,i){try{var a=o[r](i),l=a.value}catch(e){return void s(e)}if(!a.done)return n.default.resolve(l).then((function(e){t("next",e)}),(function(e){t("throw",e)}));e(l)}("next")}))}}},"./node_modules/babel-runtime/helpers/classCallCheck.js":function(e,o,s){"use strict";o.__esModule=!0,o.default=function(e,o){if(!(e instanceof o))throw new TypeError("Cannot call a class as a function")}},"./node_modules/babel-runtime/helpers/createClass.js":function(e,o,s){"use strict";o.__esModule=!0;var t,r=s("./node_modules/babel-runtime/core-js/object/define-property.js"),n=(t=r)&&t.__esModule?t:{default:t};o.default=function(){function e(e,o){for(var s=0;s=0,n=r&&t.regeneratorRuntime;if(t.regeneratorRuntime=void 0,e.exports=s("./node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js"),r)t.regeneratorRuntime=n;else try{delete t.regeneratorRuntime}catch(e){t.regeneratorRuntime=void 0}},"./node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js":function(e,o){!function(o){"use strict";var s=Object.prototype,t=s.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag",l="object"==typeof e,u=o.regeneratorRuntime;if(u)l&&(e.exports=u);else{(u=o.regeneratorRuntime=l?e.exports:{}).wrap=j;var d={},c={};c[n]=function(){return this};var f=Object.getPrototypeOf,m=f&&f(f(M([])));m&&m!==s&&t.call(m,n)&&(c=m);var _=b.prototype=h.prototype=Object.create(c);y.prototype=_.constructor=b,b.constructor=y,b[a]=y.displayName="GeneratorFunction",u.isGeneratorFunction=function(e){var o="function"==typeof e&&e.constructor;return!!o&&(o===y||"GeneratorFunction"===(o.displayName||o.name))},u.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,a in e||(e[a]="GeneratorFunction")),e.prototype=Object.create(_),e},u.awrap=function(e){return{__await:e}},v(A.prototype),A.prototype[i]=function(){return this},u.AsyncIterator=A,u.async=function(e,o,s,t){var r=new A(j(e,o,s,t));return u.isGeneratorFunction(o)?r:r.next().then((function(e){return e.done?e.value:r.next()}))},v(_),_[a]="Generator",_[n]=function(){return this},_.toString=function(){return"[object Generator]"},u.keys=function(e){var o=[];for(var s in e)o.push(s);return o.reverse(),function s(){for(;o.length;){var t=o.pop();if(t in e)return s.value=t,s.done=!1,s}return s.done=!0,s}},u.values=M,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!e)for(var o in this)"t"===o.charAt(0)&&t.call(this,o)&&!isNaN(+o.slice(1))&&(this[o]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var o=this;function s(s,t){return i.type="throw",i.arg=e,o.next=s,t&&(o.method="next",o.arg=void 0),!!t}for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r],i=n.completion;if("root"===n.tryLoc)return s("end");if(n.tryLoc<=this.prev){var a=t.call(n,"catchLoc"),l=t.call(n,"finallyLoc");if(a&&l){if(this.prev=0;--s){var r=this.tryEntries[s];if(r.tryLoc<=this.prev&&t.call(r,"finallyLoc")&&this.prev=0;--o){var s=this.tryEntries[o];if(s.finallyLoc===e)return this.complete(s.completion,s.afterLoc),C(s),d}},catch:function(e){for(var o=this.tryEntries.length-1;o>=0;--o){var s=this.tryEntries[o];if(s.tryLoc===e){var t=s.completion;if("throw"===t.type){var r=t.arg;C(s)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,o,s){return this.delegate={iterator:M(e),resultName:o,nextLoc:s},"next"===this.method&&(this.arg=void 0),d}}}function j(e,o,s,t){var r=o&&o.prototype instanceof h?o:h,n=Object.create(r.prototype),i=new T(t||[]);return n._invoke=function(e,o,s){var t="suspendedStart";return function(r,n){if("executing"===t)throw new Error("Generator is already running");if("completed"===t){if("throw"===r)throw n;return k()}for(s.method=r,s.arg=n;;){var i=s.delegate;if(i){var a=g(i,s);if(a){if(a===d)continue;return a}}if("next"===s.method)s.sent=s._sent=s.arg;else if("throw"===s.method){if("suspendedStart"===t)throw t="completed",s.arg;s.dispatchException(s.arg)}else"return"===s.method&&s.abrupt("return",s.arg);t="executing";var l=p(e,o,s);if("normal"===l.type){if(t=s.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:s.done}}"throw"===l.type&&(t="completed",s.method="throw",s.arg=l.arg)}}}(e,s,i),n}function p(e,o,s){try{return{type:"normal",arg:e.call(o,s)}}catch(e){return{type:"throw",arg:e}}}function h(){}function y(){}function b(){}function v(e){["next","throw","return"].forEach((function(o){e[o]=function(e){return this._invoke(o,e)}}))}function A(e){var o;this._invoke=function(s,r){function n(){return new Promise((function(o,n){!function o(s,r,n,i){var a=p(e[s],e,r);if("throw"!==a.type){var l=a.arg,u=l.value;return u&&"object"==typeof u&&t.call(u,"__await")?Promise.resolve(u.__await).then((function(e){o("next",e,n,i)}),(function(e){o("throw",e,n,i)})):Promise.resolve(u).then((function(e){l.value=e,n(l)}),i)}i(a.arg)}(s,r,o,n)}))}return o=o?o.then(n,n):n()}}function g(e,o){var s=e.iterator[o.method];if(void 0===s){if(o.delegate=null,"throw"===o.method){if(e.iterator.return&&(o.method="return",o.arg=void 0,g(e,o),"throw"===o.method))return d;o.method="throw",o.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var t=p(s,e.iterator,o.arg);if("throw"===t.type)return o.method="throw",o.arg=t.arg,o.delegate=null,d;var r=t.arg;return r?r.done?(o[e.resultName]=r.value,o.next=e.nextLoc,"return"!==o.method&&(o.method="next",o.arg=void 0),o.delegate=null,d):r:(o.method="throw",o.arg=new TypeError("iterator result is not an object"),o.delegate=null,d)}function S(e){var o={tryLoc:e[0]};1 in e&&(o.catchLoc=e[1]),2 in e&&(o.finallyLoc=e[2],o.afterLoc=e[3]),this.tryEntries.push(o)}function C(e){var o=e.completion||{};o.type="normal",delete o.arg,e.completion=o}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function M(e){if(e){var o=e[n];if(o)return o.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var s=-1,r=function o(){for(;++sd;)if((a=l[d++])!=a)return!0}else for(;u>d;d++)if((e||d in l)&&l[d]===s)return e||d||0;return!e&&-1}}},"./node_modules/core-js/library/modules/_array-methods.js":function(e,o,s){var t=s("./node_modules/core-js/library/modules/_ctx.js"),r=s("./node_modules/core-js/library/modules/_iobject.js"),n=s("./node_modules/core-js/library/modules/_to-object.js"),i=s("./node_modules/core-js/library/modules/_to-length.js"),a=s("./node_modules/core-js/library/modules/_array-species-create.js");e.exports=function(e,o){var s=1==e,l=2==e,u=3==e,d=4==e,c=6==e,f=5==e||c,m=o||a;return function(o,a,_){for(var j,p,h=n(o),y=r(h),b=t(a,_,3),v=i(y.length),A=0,g=s?m(o,v):l?m(o,0):void 0;v>A;A++)if((f||A in y)&&(p=b(j=y[A],A,h),e))if(s)g[A]=p;else if(p)switch(e){case 3:return!0;case 5:return j;case 6:return A;case 2:g.push(j)}else if(d)return!1;return c?-1:u||d?d:g}}},"./node_modules/core-js/library/modules/_array-species-constructor.js":function(e,o,s){var t=s("./node_modules/core-js/library/modules/_is-object.js"),r=s("./node_modules/core-js/library/modules/_is-array.js"),n=s("./node_modules/core-js/library/modules/_wks.js")("species");e.exports=function(e){var o;return r(e)&&("function"!=typeof(o=e.constructor)||o!==Array&&!r(o.prototype)||(o=void 0),t(o)&&null===(o=o[n])&&(o=void 0)),void 0===o?Array:o}},"./node_modules/core-js/library/modules/_array-species-create.js":function(e,o,s){var t=s("./node_modules/core-js/library/modules/_array-species-constructor.js");e.exports=function(e,o){return new(t(e))(o)}},"./node_modules/core-js/library/modules/_classof.js":function(e,o,s){var t=s("./node_modules/core-js/library/modules/_cof.js"),r=s("./node_modules/core-js/library/modules/_wks.js")("toStringTag"),n="Arguments"==t(function(){return arguments}());e.exports=function(e){var o,s,i;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(s=function(e,o){try{return e[o]}catch(e){}}(o=Object(e),r))?s:n?t(o):"Object"==(i=t(o))&&"function"==typeof o.callee?"Arguments":i}},"./node_modules/core-js/library/modules/_cof.js":function(e,o){var s={}.toString;e.exports=function(e){return s.call(e).slice(8,-1)}},"./node_modules/core-js/library/modules/_collection-strong.js":function(e,o,s){"use strict";var t=s("./node_modules/core-js/library/modules/_object-dp.js").f,r=s("./node_modules/core-js/library/modules/_object-create.js"),n=s("./node_modules/core-js/library/modules/_redefine-all.js"),i=s("./node_modules/core-js/library/modules/_ctx.js"),a=s("./node_modules/core-js/library/modules/_an-instance.js"),l=s("./node_modules/core-js/library/modules/_for-of.js"),u=s("./node_modules/core-js/library/modules/_iter-define.js"),d=s("./node_modules/core-js/library/modules/_iter-step.js"),c=s("./node_modules/core-js/library/modules/_set-species.js"),f=s("./node_modules/core-js/library/modules/_descriptors.js"),m=s("./node_modules/core-js/library/modules/_meta.js").fastKey,_=s("./node_modules/core-js/library/modules/_validate-collection.js"),j=f?"_s":"size",p=function(e,o){var s,t=m(o);if("F"!==t)return e._i[t];for(s=e._f;s;s=s.n)if(s.k==o)return s};e.exports={getConstructor:function(e,o,s,u){var d=e((function(e,t){a(e,d,o,"_i"),e._t=o,e._i=r(null),e._f=void 0,e._l=void 0,e[j]=0,null!=t&&l(t,s,e[u],e)}));return n(d.prototype,{clear:function(){for(var e=_(this,o),s=e._i,t=e._f;t;t=t.n)t.r=!0,t.p&&(t.p=t.p.n=void 0),delete s[t.i];e._f=e._l=void 0,e[j]=0},delete:function(e){var s=_(this,o),t=p(s,e);if(t){var r=t.n,n=t.p;delete s._i[t.i],t.r=!0,n&&(n.n=r),r&&(r.p=n),s._f==t&&(s._f=r),s._l==t&&(s._l=n),s[j]--}return!!t},forEach:function(e){_(this,o);for(var s,t=i(e,arguments.length>1?arguments[1]:void 0,3);s=s?s.n:this._f;)for(t(s.v,s.k,this);s&&s.r;)s=s.p},has:function(e){return!!p(_(this,o),e)}}),f&&t(d.prototype,"size",{get:function(){return _(this,o)[j]}}),d},def:function(e,o,s){var t,r,n=p(e,o);return n?n.v=s:(e._l=n={i:r=m(o,!0),k:o,v:s,p:t=e._l,n:void 0,r:!1},e._f||(e._f=n),t&&(t.n=n),e[j]++,"F"!==r&&(e._i[r]=n)),e},getEntry:p,setStrong:function(e,o,s){u(e,o,(function(e,s){this._t=_(e,o),this._k=s,this._l=void 0}),(function(){for(var e=this._k,o=this._l;o&&o.r;)o=o.p;return this._t&&(this._l=o=o?o.n:this._t._f)?d(0,"keys"==e?o.k:"values"==e?o.v:[o.k,o.v]):(this._t=void 0,d(1))}),s?"entries":"values",!s,!0),c(o)}}},"./node_modules/core-js/library/modules/_collection-to-json.js":function(e,o,s){var t=s("./node_modules/core-js/library/modules/_classof.js"),r=s("./node_modules/core-js/library/modules/_array-from-iterable.js");e.exports=function(e){return function(){if(t(this)!=e)throw TypeError(e+"#toJSON isn't generic");return r(this)}}},"./node_modules/core-js/library/modules/_collection.js":function(e,o,s){"use strict";var t=s("./node_modules/core-js/library/modules/_global.js"),r=s("./node_modules/core-js/library/modules/_export.js"),n=s("./node_modules/core-js/library/modules/_meta.js"),i=s("./node_modules/core-js/library/modules/_fails.js"),a=s("./node_modules/core-js/library/modules/_hide.js"),l=s("./node_modules/core-js/library/modules/_redefine-all.js"),u=s("./node_modules/core-js/library/modules/_for-of.js"),d=s("./node_modules/core-js/library/modules/_an-instance.js"),c=s("./node_modules/core-js/library/modules/_is-object.js"),f=s("./node_modules/core-js/library/modules/_set-to-string-tag.js"),m=s("./node_modules/core-js/library/modules/_object-dp.js").f,_=s("./node_modules/core-js/library/modules/_array-methods.js")(0),j=s("./node_modules/core-js/library/modules/_descriptors.js");e.exports=function(e,o,s,p,h,y){var b=t[e],v=b,A=h?"set":"add",g=v&&v.prototype,S={};return j&&"function"==typeof v&&(y||g.forEach&&!i((function(){(new v).entries().next()})))?(v=o((function(o,s){d(o,v,e,"_c"),o._c=new b,null!=s&&u(s,h,o[A],o)})),_("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),(function(e){var o="add"==e||"set"==e;e in g&&(!y||"clear"!=e)&&a(v.prototype,e,(function(s,t){if(d(this,v,e),!o&&y&&!c(s))return"get"==e&&void 0;var r=this._c[e](0===s?0:s,t);return o?this:r}))})),y||m(v.prototype,"size",{get:function(){return this._c.size}})):(v=p.getConstructor(o,e,h,A),l(v.prototype,s),n.NEED=!0),f(v,e),S[e]=v,r(r.G+r.W+r.F,S),y||p.setStrong(v,e,h),v}},"./node_modules/core-js/library/modules/_core.js":function(e,o){var s=e.exports={version:"2.6.10"};"number"==typeof __e&&(__e=s)},"./node_modules/core-js/library/modules/_create-property.js":function(e,o,s){"use strict";var t=s("./node_modules/core-js/library/modules/_object-dp.js"),r=s("./node_modules/core-js/library/modules/_property-desc.js");e.exports=function(e,o,s){o in e?t.f(e,o,r(0,s)):e[o]=s}},"./node_modules/core-js/library/modules/_ctx.js":function(e,o,s){var t=s("./node_modules/core-js/library/modules/_a-function.js");e.exports=function(e,o,s){if(t(e),void 0===o)return e;switch(s){case 1:return function(s){return e.call(o,s)};case 2:return function(s,t){return e.call(o,s,t)};case 3:return function(s,t,r){return e.call(o,s,t,r)}}return function(){return e.apply(o,arguments)}}},"./node_modules/core-js/library/modules/_defined.js":function(e,o){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},"./node_modules/core-js/library/modules/_descriptors.js":function(e,o,s){e.exports=!s("./node_modules/core-js/library/modules/_fails.js")((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},"./node_modules/core-js/library/modules/_dom-create.js":function(e,o,s){var t=s("./node_modules/core-js/library/modules/_is-object.js"),r=s("./node_modules/core-js/library/modules/_global.js").document,n=t(r)&&t(r.createElement);e.exports=function(e){return n?r.createElement(e):{}}},"./node_modules/core-js/library/modules/_enum-bug-keys.js":function(e,o){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},"./node_modules/core-js/library/modules/_enum-keys.js":function(e,o,s){var t=s("./node_modules/core-js/library/modules/_object-keys.js"),r=s("./node_modules/core-js/library/modules/_object-gops.js"),n=s("./node_modules/core-js/library/modules/_object-pie.js");e.exports=function(e){var o=t(e),s=r.f;if(s)for(var i,a=s(e),l=n.f,u=0;a.length>u;)l.call(e,i=a[u++])&&o.push(i);return o}},"./node_modules/core-js/library/modules/_export.js":function(e,o,s){var t=s("./node_modules/core-js/library/modules/_global.js"),r=s("./node_modules/core-js/library/modules/_core.js"),n=s("./node_modules/core-js/library/modules/_ctx.js"),i=s("./node_modules/core-js/library/modules/_hide.js"),a=s("./node_modules/core-js/library/modules/_has.js"),l=function(e,o,s){var u,d,c,f=e&l.F,m=e&l.G,_=e&l.S,j=e&l.P,p=e&l.B,h=e&l.W,y=m?r:r[o]||(r[o]={}),b=y.prototype,v=m?t:_?t[o]:(t[o]||{}).prototype;for(u in m&&(s=o),s)(d=!f&&v&&void 0!==v[u])&&a(y,u)||(c=d?v[u]:s[u],y[u]=m&&"function"!=typeof v[u]?s[u]:p&&d?n(c,t):h&&v[u]==c?function(e){var o=function(o,s,t){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(o);case 2:return new e(o,s)}return new e(o,s,t)}return e.apply(this,arguments)};return o.prototype=e.prototype,o}(c):j&&"function"==typeof c?n(Function.call,c):c,j&&((y.virtual||(y.virtual={}))[u]=c,e&l.R&&b&&!b[u]&&i(b,u,c)))};l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,e.exports=l},"./node_modules/core-js/library/modules/_fails.js":function(e,o){e.exports=function(e){try{return!!e()}catch(e){return!0}}},"./node_modules/core-js/library/modules/_for-of.js":function(e,o,s){var t=s("./node_modules/core-js/library/modules/_ctx.js"),r=s("./node_modules/core-js/library/modules/_iter-call.js"),n=s("./node_modules/core-js/library/modules/_is-array-iter.js"),i=s("./node_modules/core-js/library/modules/_an-object.js"),a=s("./node_modules/core-js/library/modules/_to-length.js"),l=s("./node_modules/core-js/library/modules/core.get-iterator-method.js"),u={},d={};(o=e.exports=function(e,o,s,c,f){var m,_,j,p,h=f?function(){return e}:l(e),y=t(s,c,o?2:1),b=0;if("function"!=typeof h)throw TypeError(e+" is not iterable!");if(n(h)){for(m=a(e.length);m>b;b++)if((p=o?y(i(_=e[b])[0],_[1]):y(e[b]))===u||p===d)return p}else for(j=h.call(e);!(_=j.next()).done;)if((p=r(j,y,_.value,o))===u||p===d)return p}).BREAK=u,o.RETURN=d},"./node_modules/core-js/library/modules/_global.js":function(e,o){var s=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=s)},"./node_modules/core-js/library/modules/_has.js":function(e,o){var s={}.hasOwnProperty;e.exports=function(e,o){return s.call(e,o)}},"./node_modules/core-js/library/modules/_hide.js":function(e,o,s){var t=s("./node_modules/core-js/library/modules/_object-dp.js"),r=s("./node_modules/core-js/library/modules/_property-desc.js");e.exports=s("./node_modules/core-js/library/modules/_descriptors.js")?function(e,o,s){return t.f(e,o,r(1,s))}:function(e,o,s){return e[o]=s,e}},"./node_modules/core-js/library/modules/_html.js":function(e,o,s){var t=s("./node_modules/core-js/library/modules/_global.js").document;e.exports=t&&t.documentElement},"./node_modules/core-js/library/modules/_ie8-dom-define.js":function(e,o,s){e.exports=!s("./node_modules/core-js/library/modules/_descriptors.js")&&!s("./node_modules/core-js/library/modules/_fails.js")((function(){return 7!=Object.defineProperty(s("./node_modules/core-js/library/modules/_dom-create.js")("div"),"a",{get:function(){return 7}}).a}))},"./node_modules/core-js/library/modules/_invoke.js":function(e,o){e.exports=function(e,o,s){var t=void 0===s;switch(o.length){case 0:return t?e():e.call(s);case 1:return t?e(o[0]):e.call(s,o[0]);case 2:return t?e(o[0],o[1]):e.call(s,o[0],o[1]);case 3:return t?e(o[0],o[1],o[2]):e.call(s,o[0],o[1],o[2]);case 4:return t?e(o[0],o[1],o[2],o[3]):e.call(s,o[0],o[1],o[2],o[3])}return e.apply(s,o)}},"./node_modules/core-js/library/modules/_iobject.js":function(e,o,s){var t=s("./node_modules/core-js/library/modules/_cof.js");e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==t(e)?e.split(""):Object(e)}},"./node_modules/core-js/library/modules/_is-array-iter.js":function(e,o,s){var t=s("./node_modules/core-js/library/modules/_iterators.js"),r=s("./node_modules/core-js/library/modules/_wks.js")("iterator"),n=Array.prototype;e.exports=function(e){return void 0!==e&&(t.Array===e||n[r]===e)}},"./node_modules/core-js/library/modules/_is-array.js":function(e,o,s){var t=s("./node_modules/core-js/library/modules/_cof.js");e.exports=Array.isArray||function(e){return"Array"==t(e)}},"./node_modules/core-js/library/modules/_is-object.js":function(e,o){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},"./node_modules/core-js/library/modules/_iter-call.js":function(e,o,s){var t=s("./node_modules/core-js/library/modules/_an-object.js");e.exports=function(e,o,s,r){try{return r?o(t(s)[0],s[1]):o(s)}catch(o){var n=e.return;throw void 0!==n&&t(n.call(e)),o}}},"./node_modules/core-js/library/modules/_iter-create.js":function(e,o,s){"use strict";var t=s("./node_modules/core-js/library/modules/_object-create.js"),r=s("./node_modules/core-js/library/modules/_property-desc.js"),n=s("./node_modules/core-js/library/modules/_set-to-string-tag.js"),i={};s("./node_modules/core-js/library/modules/_hide.js")(i,s("./node_modules/core-js/library/modules/_wks.js")("iterator"),(function(){return this})),e.exports=function(e,o,s){e.prototype=t(i,{next:r(1,s)}),n(e,o+" Iterator")}},"./node_modules/core-js/library/modules/_iter-define.js":function(e,o,s){"use strict";var t=s("./node_modules/core-js/library/modules/_library.js"),r=s("./node_modules/core-js/library/modules/_export.js"),n=s("./node_modules/core-js/library/modules/_redefine.js"),i=s("./node_modules/core-js/library/modules/_hide.js"),a=s("./node_modules/core-js/library/modules/_iterators.js"),l=s("./node_modules/core-js/library/modules/_iter-create.js"),u=s("./node_modules/core-js/library/modules/_set-to-string-tag.js"),d=s("./node_modules/core-js/library/modules/_object-gpo.js"),c=s("./node_modules/core-js/library/modules/_wks.js")("iterator"),f=!([].keys&&"next"in[].keys()),m=function(){return this};e.exports=function(e,o,s,_,j,p,h){l(s,o,_);var y,b,v,A=function(e){if(!f&&e in T)return T[e];switch(e){case"keys":case"values":return function(){return new s(this,e)}}return function(){return new s(this,e)}},g=o+" Iterator",S="values"==j,C=!1,T=e.prototype,M=T[c]||T["@@iterator"]||j&&T[j],k=M||A(j),I=j?S?A("entries"):k:void 0,E="Array"==o&&T.entries||M;if(E&&(v=d(E.call(new e)))!==Object.prototype&&v.next&&(u(v,g,!0),t||"function"==typeof v[c]||i(v,c,m)),S&&M&&"values"!==M.name&&(C=!0,k=function(){return M.call(this)}),t&&!h||!f&&!C&&T[c]||i(T,c,k),a[o]=k,a[g]=m,j)if(y={values:S?k:A("values"),keys:p?k:A("keys"),entries:I},h)for(b in y)b in T||n(T,b,y[b]);else r(r.P+r.F*(f||C),o,y);return y}},"./node_modules/core-js/library/modules/_iter-detect.js":function(e,o,s){var t=s("./node_modules/core-js/library/modules/_wks.js")("iterator"),r=!1;try{var n=[7][t]();n.return=function(){r=!0},Array.from(n,(function(){throw 2}))}catch(e){}e.exports=function(e,o){if(!o&&!r)return!1;var s=!1;try{var n=[7],i=n[t]();i.next=function(){return{done:s=!0}},n[t]=function(){return i},e(n)}catch(e){}return s}},"./node_modules/core-js/library/modules/_iter-step.js":function(e,o){e.exports=function(e,o){return{value:o,done:!!e}}},"./node_modules/core-js/library/modules/_iterators.js":function(e,o){e.exports={}},"./node_modules/core-js/library/modules/_library.js":function(e,o){e.exports=!0},"./node_modules/core-js/library/modules/_meta.js":function(e,o,s){var t=s("./node_modules/core-js/library/modules/_uid.js")("meta"),r=s("./node_modules/core-js/library/modules/_is-object.js"),n=s("./node_modules/core-js/library/modules/_has.js"),i=s("./node_modules/core-js/library/modules/_object-dp.js").f,a=0,l=Object.isExtensible||function(){return!0},u=!s("./node_modules/core-js/library/modules/_fails.js")((function(){return l(Object.preventExtensions({}))})),d=function(e){i(e,t,{value:{i:"O"+ ++a,w:{}}})},c=e.exports={KEY:t,NEED:!1,fastKey:function(e,o){if(!r(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!n(e,t)){if(!l(e))return"F";if(!o)return"E";d(e)}return e[t].i},getWeak:function(e,o){if(!n(e,t)){if(!l(e))return!0;if(!o)return!1;d(e)}return e[t].w},onFreeze:function(e){return u&&c.NEED&&l(e)&&!n(e,t)&&d(e),e}}},"./node_modules/core-js/library/modules/_microtask.js":function(e,o,s){var t=s("./node_modules/core-js/library/modules/_global.js"),r=s("./node_modules/core-js/library/modules/_task.js").set,n=t.MutationObserver||t.WebKitMutationObserver,i=t.process,a=t.Promise,l="process"==s("./node_modules/core-js/library/modules/_cof.js")(i);e.exports=function(){var e,o,s,u=function(){var t,r;for(l&&(t=i.domain)&&t.exit();e;){r=e.fn,e=e.next;try{r()}catch(t){throw e?s():o=void 0,t}}o=void 0,t&&t.enter()};if(l)s=function(){i.nextTick(u)};else if(!n||t.navigator&&t.navigator.standalone)if(a&&a.resolve){var d=a.resolve(void 0);s=function(){d.then(u)}}else s=function(){r.call(t,u)};else{var c=!0,f=document.createTextNode("");new n(u).observe(f,{characterData:!0}),s=function(){f.data=c=!c}}return function(t){var r={fn:t,next:void 0};o&&(o.next=r),e||(e=r,s()),o=r}}},"./node_modules/core-js/library/modules/_new-promise-capability.js":function(e,o,s){"use strict";var t=s("./node_modules/core-js/library/modules/_a-function.js");function r(e){var o,s;this.promise=new e((function(e,t){if(void 0!==o||void 0!==s)throw TypeError("Bad Promise constructor");o=e,s=t})),this.resolve=t(o),this.reject=t(s)}e.exports.f=function(e){return new r(e)}},"./node_modules/core-js/library/modules/_object-assign.js":function(e,o,s){"use strict";var t=s("./node_modules/core-js/library/modules/_descriptors.js"),r=s("./node_modules/core-js/library/modules/_object-keys.js"),n=s("./node_modules/core-js/library/modules/_object-gops.js"),i=s("./node_modules/core-js/library/modules/_object-pie.js"),a=s("./node_modules/core-js/library/modules/_to-object.js"),l=s("./node_modules/core-js/library/modules/_iobject.js"),u=Object.assign;e.exports=!u||s("./node_modules/core-js/library/modules/_fails.js")((function(){var e={},o={},s=Symbol(),t="abcdefghijklmnopqrst";return e[s]=7,t.split("").forEach((function(e){o[e]=e})),7!=u({},e)[s]||Object.keys(u({},o)).join("")!=t}))?function(e,o){for(var s=a(e),u=arguments.length,d=1,c=n.f,f=i.f;u>d;)for(var m,_=l(arguments[d++]),j=c?r(_).concat(c(_)):r(_),p=j.length,h=0;p>h;)m=j[h++],t&&!f.call(_,m)||(s[m]=_[m]);return s}:u},"./node_modules/core-js/library/modules/_object-create.js":function(e,o,s){var t=s("./node_modules/core-js/library/modules/_an-object.js"),r=s("./node_modules/core-js/library/modules/_object-dps.js"),n=s("./node_modules/core-js/library/modules/_enum-bug-keys.js"),i=s("./node_modules/core-js/library/modules/_shared-key.js")("IE_PROTO"),a=function(){},l=function(){var e,o=s("./node_modules/core-js/library/modules/_dom-create.js")("iframe"),t=n.length;for(o.style.display="none",s("./node_modules/core-js/library/modules/_html.js").appendChild(o),o.src="javascript:",(e=o.contentWindow.document).open(),e.write("