PageSourceSearch

https://dashboard.rx2go.ai/dist/js/1718.654971fc.js

js rx2go.ai collected 2026-10-05 08:05:29 UTC 49,629 bytes, 2 lines download raw bytes

1"use strict";(self["webpackChunkrx2go_dashboard"]=self["webpackChunkrx2go_dashboard"]||[]).push([[1718],{42496:function(e,t,n){var r=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(41339),o=n(5593),s=n(42686),a=n(87182),c=n(50583),u="1.6",d=30,p=function(e){function t(n,r,i){var o=e.call(this)||this;if(!(o instanceof t))return new t(n,r,i);var s={TransportFactory:c.default};for(var u in i=i||{},s)u in i||(i[u]=s[u]);o.options=i,o.token=n||"",o.status="disconnected",o.gateway=null,o.region=null,o._messageQueue=[],o._preferredUri=null,o._uris=r,o._handleTransportClose=o._handleTransportClose.bind(o),o._handleTransportError=o._handleTransportError.bind(o),o._handleTransportMessage=o._handleTransportMessage.bind(o),o._handleTransportOpen=o._handleTransportOpen.bind(o),o._log=new a.default("PStream"),o.on("error",(function(){o._log.warn("Unexpected error handled in pstream")}));var d=o;return o.addListener("ready",(function(){d.status="ready"})),o.addListener("offline",(function(){d.status="offline"})),o.addListener("close",(function(){d._log.info('Received "close" from server. Destroying PStream...'),d._destroy()})),o.transport=new o.options.TransportFactory(o._uris,{backoffMaxMs:o.options.backoffMaxMs,maxPreferredDurationMs:o.options.maxPreferredDurationMs}),Object.defineProperties(o,{uri:{enumerable:!0,get:function(){return this.transport.uri}}}),o.transport.on("close",o._handleTransportClose),o.transport.on("error",o._handleTransportError),o.transport.on("message",o._handleTransportMessage),o.transport.on("open",o._handleTransportOpen),o.transport.open(),o}return r(t,e),t}(i.EventEmitter);function l(){var e="undefined"!==typeof navigator?navigator:{},t={browser:{platform:e.platform||"unknown",userAgent:e.userAgent||"unknown"},p:"browser",plugin:"rtc",v:o.RELEASE_VERSION};return t}p.prototype._handleTransportClose=function(){this.emit("transportClose"),"disconnected"!==this.status&&("offline"!==this.status&&this.emit("offline",this),this.status="disconnected")},p.prototype._handleTransportError=function(e){e?this.emit("error","undefined"!==typeof e.code?{error:e}:e):this.emit("error",{error:{code:31e3,message:"Websocket closed without a provided reason",twilioError:new s.SignalingErrors.ConnectionDisconnected}})},p.prototype._handleTransportMessage=function(e){if(e&&e.data&&"string"===typeof e.data){var t=JSON.parse(e.data),n=t.type,r=t.payload,i=void 0===r?{}:r;this.gateway=i.gateway||this.gateway,this.region=i.region||this.region,"error"===n&&i.error&&(i.error.twilioError=new s.SignalingErrors.ConnectionError),this.emit(n,i)}},p.prototype._handleTransportOpen=function(){var e=this;this.status="connected",this.setToken(this.token),this.emit("transportOpen");var t=this._messageQueue.splice(0,this._messageQueue.length);t.forEach((function(t){return e._publish.apply(e,t)}))},p.toString=function(){return"[Twilio.PStream class]"},p.prototype.toString=function(){return"[Twilio.PStream instance]"},p.prototype.setToken=function(e){this._log.info("Setting token and publishing listen"),this.token=e;var t=0,n=this.options.maxPreferredDurationMs;this._log.info("maxPreferredDurationMs:"+n),"number"===typeof n&&n>=0&&(t=Math.min(Math.ceil(n/1e3),d)),this._log.info("reconnectTimeout:"+t);var r={browserinfo:l(),reconnectTimeout:t,token:e};this._publish("listen",r)},p.prototype.sendMessage=function(e,t,n,r,i){void 0===n&&(n="application/json");var o={callsid:e,content:t,contenttype:n,messagetype:r,voiceeventsid:i};this._publish("message",o,!0)},p.prototype.register=function(e){var t={media:e};this._publish("register",t,!0)},p.prototype.invite=function(e,t,n,r){var i={callsid:t,preflight:!!n,sdp:e,twilio:r?{params:r}:{}};this._publish("invite",i,!0)},p.prototype.reconnect=function(e,t,n,r){var i={callsid:t,preflight:!1,reconnect:n,sdp:e,twilio:r?{params:r}:{}};this._publish("invite",i,!0)},p.prototype.answer=function(e,t){this._publish("answer",{sdp:e,callsid:t},!0)},p.prototype.dtmf=function(e,t){this._publish("dtmf",{callsid:e,dtmf:t},!0)},p.prototype.hangup=function(e,t){var n=t?{callsid:e,message:t}:{callsid:e};this._publish("hangup",n,!0)},p.prototype.reject=function(e){this._publish("reject",{callsid:e},!0)},p.prototype.reinvite=function(e,t){this._publish("reinvite",{sdp:e,callsid:t},!1)},p.prototype._destroy=function(){this.transport.removeListener("close",this._handleTrans
1portClose),this.transport.removeListener("error",this._handleTransportError),this.transport.removeListener("message",this._handleTransportMessage),this.transport.removeListener("open",this._handleTransportOpen),this.transport.close(),this.emit("offline",this)},p.prototype.destroy=function(){return this._log.info("PStream.destroy() called..."),this._destroy(),this},p.prototype.updatePreferredURI=function(e){this._preferredUri=e,this.transport.updatePreferredURI(e)},p.prototype.updateURIs=function(e){this._uris=e,this.transport.updateURIs(this._uris)},p.prototype.publish=function(e,t){return this._publish(e,t,!0)},p.prototype._publish=function(e,t,n){var r=JSON.stringify({payload:t,type:e,version:u}),i=!!this.transport.send(r);i||(this.emit("error",{error:{code:31009,message:"No transport available to send or receive messages",twilioError:new s.GeneralErrors.TransportError}}),n&&this._messageQueue.push([e,t,!0]))},t["default"]=p},12065:(e,t,n)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.getRegionShortcode=t.getChunderURIs=t.createSignalingEndpointURL=t.createEventGatewayURI=t.defaultEdge=t.regionToEdge=t.regionShortcodes=t.Region=t.Edge=void 0;var i,o,s=n(42686);(function(e){e["Sydney"]="sydney",e["SaoPaulo"]="sao-paulo",e["Dublin"]="dublin",e["Frankfurt"]="frankfurt",e["Tokyo"]="tokyo",e["Singapore"]="singapore",e["Ashburn"]="ashburn",e["Umatilla"]="umatilla",e["Roaming"]="roaming",e["AshburnIx"]="ashburn-ix",e["SanJoseIx"]="san-jose-ix",e["LondonIx"]="london-ix",e["FrankfurtIx"]="frankfurt-ix",e["SingaporeIx"]="singapore-ix",e["SydneyIx"]="sydney-ix",e["TokyoIx"]="tokyo-ix"})(i=t.Edge||(t.Edge={})),function(e){e["Au1"]="au1",e["Au1Ix"]="au1-ix",e["Br1"]="br1",e["De1"]="de1",e["De1Ix"]="de1-ix",e["Gll"]="gll",e["Ie1"]="ie1",e["Ie1Ix"]="ie1-ix",e["Ie1Tnx"]="ie1-tnx",e["Jp1"]="jp1",e["Jp1Ix"]="jp1-ix",e["Sg1"]="sg1",e["Sg1Ix"]="sg1-ix",e["Sg1Tnx"]="sg1-tnx",e["Us1"]="us1",e["Us1Ix"]="us1-ix",e["Us1Tnx"]="us1-tnx",e["Us2"]="us2",e["Us2Ix"]="us2-ix",e["Us2Tnx"]="us2-tnx"}(o=t.Region||(t.Region={})),t.regionShortcodes={ASIAPAC_SINGAPORE:o.Sg1,ASIAPAC_SYDNEY:o.Au1,ASIAPAC_TOKYO:o.Jp1,EU_FRANKFURT:o.De1,EU_IRELAND:o.Ie1,SOUTH_AMERICA_SAO_PAULO:o.Br1,US_EAST_VIRGINIA:o.Us1,US_WEST_OREGON:o.Us2},t.regionToEdge=(r={},r[o.Au1]=i.Sydney,r[o.Br1]=i.SaoPaulo,r[o.Ie1]=i.Dublin,r[o.De1]=i.Frankfurt,r[o.Jp1]=i.Tokyo,r[o.Sg1]=i.Singapore,r[o.Us1]=i.Ashburn,r[o.Us2]=i.Umatilla,r[o.Gll]=i.Roaming,r[o.Us1Ix]=i.AshburnIx,r[o.Us2Ix]=i.SanJoseIx,r[o.Ie1Ix]=i.LondonIx,r[o.De1Ix]=i.FrankfurtIx,r[o.Sg1Ix]=i.SingaporeIx,r[o.Au1Ix]=i.SydneyIx,r[o.Jp1Ix]=i.TokyoIx,r[o.Us1Tnx]=i.AshburnIx,r[o.Us2Tnx]=i.AshburnIx,r[o.Ie1Tnx]=i.LondonIx,r[o.Sg1Tnx]=i.SingaporeIx,r),t.defaultEdge=i.Roaming;var a="eventgw.twilio.com";function c(e){return"voice-js."+e+".twilio.com"}function u(e){return e?"eventgw."+e+".twilio.com":a}function d(e){return"wss://"+e+"/signal"}function p(e){if(e&&"string"!==typeof e&&!Array.isArray(e))throw new s.InvalidArgumentError("If `edge` is provided, it must be of type `string` or an array of strings.");var n;if(e){var r=Array.isArray(e)?e:[e];n=r.map((function(e){return c(e)}))}else n=[c(t.defaultEdge)];return n}function l(e){return t.regionShortcodes[e]||null}t.createEventGatewayURI=u,t.createSignalingEndpointURL=d,t.getChunderURIs=p,t.getRegionShortcode=l},80089:(e,t)=>{function n(e,t,n){var r=JSON.stringify(t.body||{}),i=new Headers;t.headers=t.headers||[],Object.entries(t.headers).forEach((function(e){var t=e[0],n=e[1];return i.append(t,n)})),fetch(t.url,{body:r,headers:i,method:e}).then((function(e){return e.text()}),n).then((function(e){return n(null,e)}),n)}Object.defineProperty(t,"__esModule",{value:!0});var r=n;r.get=function(e,t){return new this("GET",e,t)},r.post=function(e,t){return new this("POST",e,t)},t["default"]=r},1603:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=n(42686),i=n(48630);function o(e,t){return t=t||{},t.util=t.util||i,t.navigator=t.navigator||("undefined"!==typeof navigator?navigator:null),new Promise((function(n,i){if(!t.navigator)throw new r.NotSupportedError("getUserMedia is not supported");switch("function"){case typeof(t.navigator.mediaDevices&&t.navigator.mediaDevices.getUserMedia):return n(t.navigator.mediaDevices.getUserMedia(e));case typeof t.navigator.webkitGetUserMedia:return t.navigator.webkitGetUserMedia(e,n,i);case typeof t.navigator.mozGetUserMedia:return t.navigator.mozGetUserMedia(e,n,i);case typeof t.navigator.getUserMedia:return t.navigator.getUserMedia(e,n,i);default:throw new r.NotSupportedError("getUserMedia is not supported")}})).catch((function(e){throw t.util.isFirefox()&&"NotReadableError"===e.name?new r.NotSupportedError("Firefox does not currently support opening multiple audio input trackssimultaneously, even across different tabs.\nRelated Bugzilla thread: https://bugzilla.mozilla.org/show_bug.cgi?id=1299324"):e}))}t["default"]=o},56506:(e,t)=>
1{Object.defineProperty(t,"__esModule",{value:!0}),t.IceCandidate=void 0;var n=function(){function e(e,t){var n;void 0===t&&(t=!1),this.deleted=!1;var r=e.candidate.split("network-cost ");r[1]&&(n=parseInt(r[1],10)),this.candidateType=e.type,this.ip=e.ip||e.address,this.isRemote=t,this.networkCost=n,this.port=e.port,this.priority=e.priority,this.protocol=e.protocol,this.relatedAddress=e.relatedAddress,this.relatedPort=e.relatedPort,this.tcpType=e.tcpType,this.transportId=e.sdpMid}return e.prototype.toPayload=function(){return{candidate_type:this.candidateType,deleted:this.deleted,ip:this.ip,is_remote:this.isRemote,"network-cost":this.networkCost,port:this.port,priority:this.priority,protocol:this.protocol,related_address:this.relatedAddress,related_port:this.relatedPort,tcp_type:this.tcpType,transport_id:this.transportId}},e}();t.IceCandidate=n},25580:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PeerConnection=t.getMediaEngine=t.enabled=void 0;var r=n(65394);t.PeerConnection=r.default;var i=n(31582);function o(){return i.default.test()}function s(){return"undefined"!==typeof RTCIceGatherer?"ORTC":"WebRTC"}t.enabled=o,t.getMediaEngine=s},22144:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});var n=32767,r="undefined"!==typeof window?window.RTCStatsReport:void 0;function i(e){if(!(this instanceof i))return new i(e);var t=this;Object.defineProperties(this,{_map:{value:e},size:{enumerable:!0,get:function(){return t._map.size}}}),this[Symbol.iterator]=e[Symbol.iterator]}function o(e){return{bytesReceived:void 0,bytesSent:void 0,dtlsState:void 0,id:e.id,localCertificateId:e.stat("localCertificateId"),remoteCertificateId:e.stat("remoteCertificateId"),rtcpTransportStatsId:void 0,selectedCandidatePairId:e.stat("selectedCandidatePairId"),timestamp:Date.parse(e.timestamp),type:"transport"}}function s(e){return{channels:void 0,clockRate:void 0,id:e.id,implementation:void 0,mimeType:e.stat("mediaType")+"/"+e.stat("googCodecName"),payloadType:void 0,sdpFmtpLine:void 0,timestamp:Date.parse(e.timestamp),type:"codec"}}function a(e){return{audioLevel:S(e,"audioOutputLevel")?v(e,"audioOutputLevel")/n:(v(e,"audioInputLevel")||0)/n,detached:void 0,echoReturnLoss:_(e,"googEchoCancellationReturnLoss"),echoReturnLossEnhancement:_(e,"googEchoCancellationReturnLossEnhancement"),ended:void 0,frameHeight:S(e,"googFrameHeightReceived")?v(e,"googFrameHeightReceived"):v(e,"googFrameHeightSent"),frameWidth:S(e,"googFrameWidthReceived")?v(e,"googFrameWidthReceived"):v(e,"googFrameWidthSent"),framesCorrupted:void 0,framesDecoded:v(e,"framesDecoded"),framesDropped:void 0,framesPerSecond:void 0,framesReceived:void 0,framesSent:v(e,"framesEncoded"),fullFramesLost:void 0,id:e.id,kind:e.stat("mediaType"),partialFramesLost:void 0,remoteSource:void 0,ssr
1cIds:void 0,timestamp:Date.parse(e.timestamp),trackIdentifier:e.stat("googTrackId"),type:"track"}}function c(e,t){return{associateStatsId:void 0,codecId:"codec-"+e.id,firCount:t?v(e,"googFirsSent"):void 0,id:e.id,isRemote:void 0,mediaType:e.stat("mediaType"),nackCount:v(e,t?"googNacksSent":"googNacksReceived"),pliCount:v(e,t?"googPlisSent":"googPlisReceived"),qpSum:v(e,"qpSum"),sliCount:void 0,ssrc:e.stat("ssrc"),timestamp:Date.parse(e.timestamp),trackId:"track-"+e.id,transportId:e.stat("transportId")}}function u(e){var t=c(e,!0);return Object.assign(t,{burstDiscardCount:void 0,burstDiscardRate:void 0,burstLossCount:void 0,burstLossRate:void 0,burstPacketsDiscarded:void 0,burstPacketsLost:void 0,bytesReceived:v(e,"bytesReceived"),fractionLost:void 0,framesDecoded:v(e,"framesDecoded"),gapDiscardRate:void 0,gapLossRate:void 0,jitter:m(e.stat("googJitterReceived")),packetsDiscarded:void 0,packetsLost:v(e,"packetsLost"),packetsReceived:v(e,"packetsReceived"),packetsRepaired:void 0,roundTripTime:m(e.stat("googRtt")),type:"inbound-rtp"}),t}function d(e){var t=c(e,!1);return Object.assign(t,{bytesSent:v(e,"bytesSent"),framesEncoded:v(e,"framesEncoded"),packetsSent:v(e,"packetsSent"),remoteTimestamp:void 0,targetBitrate:void 0,type:"outbound-rtp"}),t}function p(e,t){return{candidateType:g(e.stat("candidateType")),deleted:void 0,id:e.id,ip:e.stat("ipAddress"),isRemote:t,port:v(e,"portNumber"),priority:_(e,"priority"),protocol:e.stat("transport"),relayProtocol:void 0,timestamp:Date.parse(e.timestamp),transportId:void 0,type:t?"remote-candidate":"local-candidate",url:void 0}}function l(e){return{availableIncomingBitrate:void 0,availableOutgoingBitrate:void 0,bytesReceived:v(e,"bytesReceived"),bytesSent:v(e,"bytesSent"),consentRequestsSent:v(e,"consentRequestsSent"),currentRoundTripTime:m(e.stat("googRtt")),id:e.id,lastPacketReceivedTimestamp:void 0,lastPacketSentTimestamp:void 0,localCandidateId:e.stat("localCandidateId"),nominated:void 0,priority:void 0,readable:void 0,remoteCandidateId:e.stat("remoteCandidateId"),requestsReceived:v(e,"requestsReceived"),requestsSent:v(e,"requestsSent"),responsesReceived:v(e,"responsesReceived"),responsesSent:v(e,"responsesSent"),retransmissionsReceived:void 0,retransmissionsSent:void 0,state:void 0,timestamp:Date.parse(e.timestamp),totalRoundTripTime:void 0,transportId:e.stat("googChannelId"),type:"candidate-pair",writable:y(e,"googWritable")}}function h(e){return{base64Certificate:e.stat("googDerBase64"),fingerprint:e.stat("googFingerprint"),fingerprintAlgorithm:e.stat("googFingerprintAlgorithm"),id:e.id,issuerCertificateId:e.stat("googIssuerId"),timestamp:Date.parse(e.timestamp),type:"certificate"}}function f(e){return{bytesReceived:void 0,bytesSent:void 0,datachannelid:e.stat("datachannelid"),id:e.id,label:e.stat("label"),messagesReceived:void 0,messagesSent:void 0,protocol:e.stat("protocol"),state:e.stat("state"),timestamp:Date.parse(e.timestamp),transportId:e.stat("transportId"),type:"data-channel"}}function m(e){return isNaN(e)||""===e?void 0:parseInt(e,10)/1e3}function g(e){switch(e){case"peerreflexive":return"prflx";case"serverreflexive":return"srflx";case"host":case"relay":default:return e}}function v(e,t){var n=e.stat(t);return S(e,t)?parseInt(n,10):void 0}function _(e,t){var n=e.stat(t);return S(e,t)?parseFloat(n):void 0}function y(e,t){var n=e.stat(t);return S(e,t)?"true"===n||!0===n:void 0}function S(e,t){var n=e.stat(t);return"undefined"!==typeof n&&""!==n}r&&(i.prototype=Object.create(r.prototype),i.prototype.constructor=i),["entries","forEach","get","has","keys","values"].forEach((function(e){i.prototype[e]=function(){for(var t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return(t=this._map)[e].apply(t,n)}})),i.fromArray=function(e){return new i(e.reduce((function(e,t){return e.set(t.id,t),e}),new Map))},i.fromRTCStatsResponse=function(e){var t,n=new Map,r=e.result().reduce((function(e,r){var i=r.id;switch(r.type){case"googCertificate":e.set(i,h(r));break;case"datachannel":e.set(i,f(r));break;case"googCandidatePair":y(r,"googActiveConnection")&&(t=i),e.set(i,l(r));break;case"localcandidate":e.set(i,p(r,!1));break;
1case"remotecandidate":e.set(i,p(r,!0));break;case"ssrc":S(r,"packetsReceived")?e.set("rtp-"+i,u(r)):e.set("rtp-"+i,d(r)),e.set("track-"+i,a(r)),e.set("codec-"+i,s(r));break;case"googComponent":var c=o(r);n.set(c.selectedCandidatePairId,i),e.set(i,o(r));break}return e}),new Map);if(t){var c=n.get(t);c&&(r.get(c).dtlsState="connected")}return new i(r)},t["default"]=i},29537:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isNonNegativeNumber=t.calculate=void 0;var n=94.768;function r(e,t,r){if("number"!==typeof e||"number"!==typeof t||"number"!==typeof r||!i(e)||!i(t)||!i(r))return null;var o=e+2*t+10,s=0;switch(!0){case o<160:s=n-o/40;break;case o<1e3:s=n-(o-120)/10;break}switch(!0){case r<=s/2.5:s=Math.max(s-2.5*r,6.52);break;default:s=0;break}var a=1+.035*s+7e-6*s*(s-60)*(100-s);return a}function i(e){return"number"===typeof e&&!isNaN(e)&&isFinite(e)&&e>=0}t.calculate=r,t.isNonNegativeNumber=i,t["default"]={calculate:r,isNonNegativeNumber:i}},65394:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=n(42686),i=n(87182),o=n(48630),s=n(31582),a=n(22237),c=15e3,u="none",d="timeout",p="new",l=50;function h(e,t,n){if(!e||!t)throw new r.InvalidArgumentError("Audiohelper, and pstream are required arguments");if(!(this instanceof h))return new h(e,t,n);function s(){this._log.warn("Unexpected noop call in peerconnection")}this._log=new i.default("PeerConnection"),this.onaudio=s,this.onopen=s,this.onerror=s,this.onclose=s,this.ondisconnected=s,this.onfailed=s,this.onconnected=s,this.onreconnected=s,this.onsignalingstatechange=s,this.ondtlstransportstatechange=s,this.onicegatheringfailure=s,this.onicegatheringstatechange=s,this.oniceconnectionstatechange=s,this.onpcconnectionstatechange=s,this.onicecandidate=s,this.onselectedcandidatepairchange=s,this.onvolume=s,this.version=null,this.pstream=t,this.stream=null,this.sinkIds=new Set(["default"]),this.outputs=new Map,this.status="connecting",this.callSid=null,this.isMuted=!1;var a="undefined"!==typeof window&&(window.AudioContext||window.webkitAudioContext);return this._isSinkSupported=!!a&&"undefined"!==typeof HTMLAudioElement&&HTMLAudioElement.prototype.setSinkId,this._audioContext=a&&e._audioContext,this._audioHelper=e,this._hasIceCandidates=!1,this._hasIceGatheringFailures=!1,this._iceGatheringTimeoutId=null,this._masterAudio=null,this._masterAudioDeviceId=null,this._mediaStreamSource=null,this._dtmfSender=null,this._dtmfSenderUnsupported=!1,this._callEvents=[],this._nextTimeToPublish=Date.now(),this._onAnswerOrRinging=s,this._onHangup=s,this._remoteStream=null,this._shouldManageStream=!0,this._iceState=p,this._isUnifiedPlan=n.isUnifiedPlan,this.options=n=n||{},this.navigator=n.navigator||("undefined"!==typeof navigator?navigator:null),this.util=n.util||o,this.codecPreferences=n.codecPreferences,this}function f(e,t){"function"===typeof e.addTrack?t.getAudioTracks().forEach((function(n){e.addTrack(n,t)})):e.addStream(t)}function m(e){var t="undefined"!==typeof MediaStream?new MediaStream:new webkitMediaStream;return e.getAudioTracks().forEach(t.addTrack,t),t}function g(e,t){"function"===typeof e.removeTrack?e.getSenders().forEach((function(t){e.removeTrack(t)})):e.removeStream(t)}function v(e,t){if("undefined"!==typeof e.srcObject)e.srcObject=t;else if("undefined"!==typeof e.mozSrcObject)e.mozSrcObject=t;else{if("undefined"===typeof e.src)return!1;var n=e.options.window||window;e.src=(n.URL||n.webkitURL).createObjectURL(t)}return!0}h.prototype.uri=function(){return this._uri},h.prototype.openDefaultDeviceWithConstraints=function(e){return this._audioHelper._openDefaultDeviceWithConstraints(e).then(this._setInputTracksFromStream.bind(this,!1))},h.prototype.setInputTracksFromStream=function(e){var t=this;return this._setInputTracksFromStream(!0,e).then((function(){t._shouldManageStream=!1}))},h.prototype._createAnalyser=function(e,t){t=Object.assign({fftSize:32,smoothingTimeConstant:.3},t);var n=e.createAnalyser();for(var r in t)n[r]=t[r];return n},h.prototype._setVolumeHandler=function(e){this.onvolume=e},h.prototype._startPollingVolume=function(){if(this._audioContext&&this.stream&&this._remoteStream){var e=this._audioContext,t=this._inputAnalyser=this._createAnalyser(e),n=t.frequencyBinCount,r=new Uint8Array(n);this._inputAnalyser2=this._createAnalyser(e,{maxDecibels:0,minDecibels:-127,smoothingTimeConstant:0});var i=this._outputAnalyser=this._createAnalyser(e),o=i.frequencyBinCount,s=new Uint8Array(o);this._outputAnalyser2=this._createAnalyser(e,{maxDecibels:0,minDecibels:-127,smoothingTimeConstant:0}),this._updateInputStreamSource(this.stream),this._updateOutputStreamSource(this._remoteStream);var a=this;setTimeout((function e(){if(a._audioContext){if("closed"===a.status)return a._inputAnalyser.disconnect(),a._outputAnalyser.disconnect(),a._inputAnalyser2.disconnect(),void a._outputAnalyser2.disconnect();a._inputAnalyser.getByteFrequencyData(r);var t=a.util.average(r);a._inputAnalyser2.getByteFrequencyData(r);var n=a.util.average(r);a._outputAnalyser.getByteFrequencyData(s);var i=a.util.average(s);a._outputAnalyser2.getByteFrequencyData(s);var o=a.util.average(s);a.onvolume(t/255,i/255,n,o),setTimeout(e,l)}}),l)}},h.prototype._stopStream=function(){this._shouldManageStream&&this._audioHelper._stopDefaultInputDeviceStream()},h.prototype._updateInputStreamSource=function(e){this._inputStreamSource&&this._inputStreamSource.disconnect();try{this._inputStreamSource=this._audioContext.createMediaStreamSource(e),this._inputStreamSource.connect(this._inputAnalyser),this._inputStreamSource.connect(this._inputAnalyser2)}catch(t){this._log.warn("Unable to update input MediaStreamSource",t),this._inputStreamSource=null}},h.prototype._updateOutputStreamSource=function(e){this._outputStreamSource&&this._outputStreamSource.disconnect();try{this._outputStreamSource=this._audioContext.createMediaStreamSource(e),this._outputStreamSource.connect(this._outputAnalyser),this._outputStreamSource.connect(this._outputAnalyser2)}catch(t){this._log.warn("Unable to update output MediaStreamSource",t),this._outputStreamSource=null}},h.prototype._setInputTracksFromStream=function(e,t){return this._isUnifiedPlan?this._setInputTracksForUnifiedPlan(e,t):this._setInputTracksForPlanB(e,t)},h.prototype._setInputTracksForPlanB=function(e,t){var n=this;if(!t)return Promise.reject(new r.InvalidArgumentError("Can not set input stream to null while in a call"));if(!t.getAudioTracks().length)return Promise.reject(new r.InvalidArgumentError("Supplied input stream has no audio tracks"));var i=this.stream;return i?(this._stopStream(),g(this.version.pc,i),i.getAudioTracks().forEac
1h(i.removeTrack,i),t.getAudioTracks().forEach(i.addTrack,i),f(this.version.pc,t),this._updateInputStreamSource(this.stream)):this.stream=e?m(t):t,this.mute(this.isMuted),this.version?new Promise((function(e,t){n.version.createOffer(n.options.maxAverageBitrate,n.codecPreferences,{audio:!0},(function(){n.version.processAnswer(n.codecPreferences,n._answerSdp,(function(){e(n.stream)}),t)}),t)})):Promise.resolve(this.stream)},h.prototype._setInputTracksForUnifiedPlan=function(e,t){var n=this;if(!t)return Promise.reject(new r.InvalidArgumentError("Can not set input stream to null while in a call"));if(!t.getAudioTracks().length)return Promise.reject(new r.InvalidArgumentError("Supplied input stream has no audio tracks"));var i=this.stream,o=function(){return n.mute(n.isMuted),Promise.resolve(n.stream)};return i?(this._shouldManageStream&&this._stopStream(),this._sender||(this._sender=this.version.pc.getSenders()[0]),this._sender.replaceTrack(t.getAudioTracks()[0]).then((function(){return n._updateInputStreamSource(t),n.stream=e?m(t):t,o()}))):(this.stream=e?m(t):t,o())},h.prototype._onInputDevicesChanged=function(){if(this.stream){var e=this.stream.getAudioTracks().every((function(e){return"ended"===e.readyState}));e&&this._shouldManageStream&&this.openDefaultDeviceWithConstraints({audio:!0})}},h.prototype._onIceGatheringFailure=function(e){this._hasIceGatheringFailures=!0,this.onicegatheringfailure(e)},h.prototype._onMediaConnectionStateChange=function(e){var t,n=this._iceState;if(n!==e&&("connected"===e||"disconnected"===e||"failed"===e))switch(this._iceState=e,e){case"connected":"disconnected"===n||"failed"===n?(t="ICE liveliness check succeeded. Connection with Twilio restored",this._log.info(t),this.onreconnected(t)):(t="Media connection established.",this._log.info(t),this.onconnected(t)),this._stopIceGatheringTimeout(),this._hasIceGatheringFailures=!1;break;case"disconnected":t="ICE liveliness check failed. May be having trouble connecting to Twilio",this._log.warn(t),this.ondisconnected(t);break;case"failed":t="Connection with Twilio was interrupted.",this._log.warn(t),this.onfailed(t);break}},h.prototype._setSinkIds=function(e){return this._isSinkSupported?(this.sinkIds=new Set(e.forEach?e:[e]),this.version?this._updateAudioOutputs():Promise.resolve()):Promise.reject(new r.NotSupportedError("Audio output selection is not supported by this browser"))},h.prototype._startIceGatheringTimeout=function(){var e=this;this._stopIceGatheringTimeout(),this._iceGatheringTimeoutId=setTimeout((function(){e._onIceGatheringFailure(d)}),c)},h.prototype._stopIceGatheringTimeout=function(){clearInterval(this._iceGatheringTimeoutId)},h.prototype._updateAudioOutputs=function(){var e=Array.from(this.sinkIds).filter((function(e){return!this.outputs.has(e)}),this),t=Array.from(this.outputs.keys()).filter((function(e){return!this.sinkIds.has(e)}),this),n=this,r=e.map(this._createAudioOutput,this);return Promise.all(r).then((function(){return Promise.all(t.map(n._removeAudioOutput,n))}))},h.prototype._createAudio=function(e){var t=new Audio(e);return this.onaudio(t),t},h.prototype._createAudioOutput=function(e){var t=null;this._mediaStreamSource&&(t=this._audioContext.createMediaStreamDestination(),this._mediaStreamSource.connect(t));var n=this._createAudio();v(n,t&&t.stream?t.stream:this.pcStream);var r=this;return n.setSinkId(e).then((function(){return n.play()})).then((function(){r.outputs.set(e,{audio:n,dest:t})}))},h.prototype._removeAudioOutputs=function(){return this._masterAudio&&"undefined"!==typeof this._masterAudioDeviceId&&(this._disableOutput(this,this._masterAudioDeviceId),this.outputs.delete(this._masterAudioDeviceId),this._masterAudioDeviceId=null,this._masterAudio.paused||this._masterAudio.pause(),"undefined"!==typeof this._masterAudio.srcObject?this._masterAudio.srcObject=null:this._masterAudio.src="",this._masterAudio=null),Array.from(this.outputs.keys()).map(this._removeAudioOutput,this)},h.prototype._disableOutput=function(e,t){var n=e.outputs.get(t);n&&(n.audio&&(n.audio.pause(),n.audio.src=""),n.dest&&n.dest.disconnect())},h.prototype._reassignMasterOutput=function(e,t){var n=e.outputs.get(t);e.outputs.delete(t);var r=this,i=Array.from(e.outputs.keys())[0]||"default";return n.audio.setSinkId(i).then((function(){r._disableOutput(e,i
1),e.outputs.set(i,n),e._masterAudioDeviceId=i})).catch((function(){e.outputs.set(t,n),r._log.info("Could not reassign master output. Attempted to roll back.")}))},h.prototype._removeAudioOutput=function(e){return this._masterAudioDeviceId===e?this._reassignMasterOutput(this,e):(this._disableOutput(this,e),this.outputs.delete(e),Promise.resolve())},h.prototype._onAddTrack=function(e,t){var n=e._masterAudio=this._createAudio();v(n,t),n.play();var r=Array.from(e.outputs.keys())[0]||"default";e._masterAudioDeviceId=r,e.outputs.set(r,{audio:n});try{e._mediaStreamSource=e._audioContext.createMediaStreamSource(t)}catch(i){this._log.warn("Unable to create a MediaStreamSource from onAddTrack",i),this._mediaStreamSource=null}e.pcStream=t,e._updateAudioOutputs()},h.prototype._fallbackOnAddTrack=function(e,t){var n=document&&document.createElement("audio");n.autoplay=!0,v(n,t)||e._log.info("Error attaching stream to element."),e.outputs.set("default",{audio:n})},h.prototype._setEncodingParameters=function(e){if(e&&this._sender&&"function"===typeof this._sender.getParameters&&"function"===typeof this._sender.setParameters){var t=this._sender.getParameters();(t.priority||t.encodings&&t.encodings.length)&&(t.priority="high",t.encodings&&t.encodings.length&&t.encodings.forEac
1h((function(e){e.priority="high",e.networkPriority="high"})),this._sender.setParameters(t))}},h.prototype._setupPeerConnection=function(e){var t=this,n=this,r=new(this.options.rtcpcFactory||s.default)({RTCPeerConnection:this.options.RTCPeerConnection});r.create(e),f(r.pc,this.stream);var i="ontrack"in r.pc?"ontrack":"onaddstream";return r.pc[i]=function(e){var i=n._remoteStream=e.stream||e.streams[0];"function"===typeof r.pc.getSenders&&(t._sender=r.pc.getSenders()[0]),n._isSinkSupported?n._onAddTrack(n,i):n._fallbackOnAddTrack(n,i),n._startPollingVolume()},r},h.prototype._maybeSetIceAggressiveNomination=function(e){return this.options.forceAggressiveIceNomination?a.setIceAggressiveNomination(e):e},h.prototype._setupChannel=function(){var e=this,t=this.version.pc;this.version.pc.onopen=function(){e.status="open",e.onopen()},this.version.pc.onstatechange=function(){e.version.pc&&"stable"===e.version.pc.readyState&&(e.status="open",e.onopen())},this.version.pc.onsignalingstatechange=function(){var n=t.signalingState;e._log.info('signalingState is "'+n+'"'),e.version.pc&&"stable"===e.version.pc.signalingState&&(e.status="open",e.onopen()),e.onsignalingstatechange(t.signalingState)},t.onconnectionstatechange=function(n){var r=t.connectionState;if(!r&&n&&n.target){var i=n.target;r=i.connectionState||i.connectionState_,e._log.info("pc.connectionState not detected. Using target PC. State="+r)}r?e._log.info('pc.connectionState is "'+r+'"'):e._log.warn('onconnectionstatechange detected but state is "'+r+'"'),e.onpcconnectionstatechange(r),e._onMediaConnectionStateChange(r)},t.onicecandidate=function(t){var n=t.candidate;n&&(e._hasIceCandidates=!0,e.onicecandidate(n),e._setupRTCIceTransportListener()),e._log.info("ICE Candidate: "+JSON.stringify(n))},t.onicegatheringstatechange=function(){var n=t.iceGatheringState;"gathering"===n?e._startIceGatheringTimeout():"complete"===n&&(e._stopIceGatheringTimeout(),e._hasIceCandidates||e._onIceGatheringFailure(u),e._hasIceCandidates&&e._hasIceGatheringFailures&&e._startIceGatheringTimeout()),e._log.info('pc.iceGatheringState is "'+t.iceGatheringState+'"'),e.onicegatheringstatechange(n)},t.oniceconnectionstatechange=function(){e._log.info('pc.iceConnectionState is "'+t.iceConnectionState+'"'),e.oniceconnectionstatechange(t.iceConnectionState),e._onMediaConnectionStateChange(t.iceConnectionState)}},h.prototype._initializeMediaStream=function(e){return"open"!==this.status&&("disconnected"===this.pstream.status?(this.onerror
1({info:{code:31e3,message:"Cannot establish connection. Client is disconnected",twilioError:new r.SignalingErrors.ConnectionDisconnected}}),this.close(),!1):(this.version=this._setupPeerConnection(e),this._setupChannel(),!0))},h.prototype._removeReconnectionListeners=function(){this.pstream&&(this.pstream.removeListener("answer",this._onAnswerOrRinging),this.pstream.removeListener("hangup",this._onHangup))},h.prototype._setupRTCDtlsTransportListener=function(){var e=this,t=this.getRTCDtlsTransport();if(t&&!t.onstatechange){var n=function(){e._log.info('dtlsTransportState is "'+t.state+'"'),e.ondtlstransportstatechange(t.state)};n(),t.onstatechange=n}},h.prototype._setupRTCIceTransportListener=function(){var e=this,t=this._getRTCIceTransport();t&&!t.onselectedcandidatepairchange&&(t.onselectedcandidatepairchange=function(){return e.onselectedcandidatepairchange(t.getSelectedCandidatePair())})},h.prototype.iceRestart=function(){var e=this;this._log.info("Attempting to restart ICE..."),this._hasIceCandidates=!1,this.version.createOffer(this.options.maxAverageBitrate,this.codecPreferences,{iceRestart:!0}).then((function(){e._removeReconnectionListeners(),e._onAnswerOrRinging=function(t){if(e._removeReconnectionListeners(),t.sdp&&"have-local-offer"===e.version.pc.signalingState){var n=e._maybeSetIceAggressiveNomination(t.sdp);e._answerSdp=n,"closed"!==e.status&&e.version.processAnswer(e.codecPreferences,n,null,(function(t){var n=t&&t.message?t.message:t;e._log.error("Failed to process answer during ICE Restart. Error: "+n)}))}else{var r="Invalid state or param during ICE Restart:hasSdp:"+!!t.sdp+", signalingState:"+e.version.pc.signalingState;e._log.warn(r)}},e._onHangup=function(){e._log.info("Received hangup during ICE Restart"),e._removeReconnectionListeners()},e.pstream.on("answer",e._onAnswerOrRinging),e.pstream.on("hangup",e._onHangup),e.pstream.reinvite(e.version.getSDP(),e.callSid)})).catch((function(t){var n=t&&t.message?t.message:t;e._log.error("Failed to createOffer during ICE Restart. Error: "+n),e.onfailed(n)}))},h.prototype.makeOutgoingCall=function(e,t,n,i,o){var s=this;if(this._initializeMediaStream(i)){var a=this;this.callSid=n,this._onAnswerOrRinging=function(e){if(e.sdp){var t=s._maybeSetIceAggressiveNomination(e.sdp);a._answerSdp=t,"closed"!==a.status&&a.version.processAnswer(s.codecPreferences,t,c,u),a.pstream.removeListener("answer",a._onAnswerOrRinging),a.pstream.removeListener("ringing",a._onAnswerOrRinging)}},this.pstream.on("answer",this._onAnswerOrRinging),this.pstream.on("ringing",this._onAnswerOrRinging),this.version.createOffer(this.options.maxAverageBitrate,this.codecPreferences,{audio:!0},d,p)}function c(){a.options&&a._setEncodingParameters(a.options.dscp),o(a.version.pc)}function u(e){var t=e.message||e;a.onerror({info:{code:31e3,message:"Error processing answer: "+t,twilioError:new r.MediaErrors.ClientRemoteDescFailed}})}function d(){"closed"!==a.status&&(a.pstream.invite(a.version.getSDP(),a.callSid,a.options.preflight,t),a._setupRTCDtlsTransportListener())}function p(e){var t=e.message||e;a.onerror({info:{code:31e3,message:"Error creating the offer: "+t,twilioError:new r.MediaErrors.ClientLocalDescFailed}})}},h.prototype.answerIncomingCall=function(e,t,n,i){if(this._initializeMediaStream(n)){t=this._maybeSetIceAggressiveNomination(t),this._answerSdp=t.replace(/^a=setup:actpass$/gm,"a=setup:passive"),this.callSid=e;var o=this;this.version.processSDP(this.options.maxAverageBitrate,this.codecPreferences,t,{audio:!0},s,a)}function s(){"closed"!==o.status&&(o.pstream.answer(o.version.getSDP(),e),o.options&&o._setEncodingParameters(o.options.dscp),i(o.version.pc),o._setupRTCDtlsTransportListener())}function a(e){var t=e.message||e;o.onerror({info:{code:31e3,message:"Error creating the answer: "+t,twilioError:new r.MediaErrors.ClientRemoteDescFailed}})}},h.prototype.close=function(){this.version&&this.version.pc&&("closed"!==this.version.pc.signalingState&&this.version.pc.close(),this.version.pc=null),this.stream&&(this.mute(!1),this._stopStream()),this.stream=null,this._removeReconnectionListeners(),this._stopIceGatheringTimeout(),Promise.all(this._removeAudioOutputs()).catch((function(){})),this._mediaStreamSource&&this._mediaStreamSource.disconnect(),this._inputAnalyser&&this._inputAnalyser.disconnect(),this._outputAnalyser&&this._outputAnalyser.disconnect(),this._inputAnalyser2&&this._inputAnalyser2.disconnect(),this._outputAnalyser2&&this._outputAnalyser2.disconnect(),this.status="closed",this.onclose()},h.prototype.reject=function(e){this.callSid=e},h.prototype.ignore=function(e){this.callSid=e},h.prototype.mute=function(e){if(this.isMuted=e,this.stream)if(this._sender&&this._sender.track)this._sender.track.enabled=!e;else{var t="function"===typeof this.stream.getAudioTracks?this.stream.getAudioTracks():this.stream.audioTracks;t.forEach((function(t){t.enabled=!e}))}},h.prototype.getOrCreateDTMFSender=function(){if(this._dtmfSender||this._dtmfSenderUnsupported)return this._dtmfSender||null;var e=this,t=this.version.pc;if(!t)return this._log.warn("No RTCPeerConnection available to call createDTMFSender on"),null;if("function"===typeof t.getSenders&&("function"===typeof RTCDTMFSender||"function"===typeof RTCDtmfSender)){var n=t.getSenders().find((function(e){return e.dtmf}));if(n)return this._log.info("Using RTCRtpSender#dtmf"),this._dtmfSender=n.dtmf,this._dtmfSender}if("function"===typeof t.createDTMFSender&&"function"===typeof t.getLocalStreams){var r=t.getLocalStreams().map((function(t){var n=e._getAudioTracks(t);return n&&n[0]}))[0];return r?(this._log.info("Creating RTCDTMFSender"),this._dtmfSender=t.createDTMFSender(r),this._dtmfSender):(this._log.warn("No local audio MediaStreamTrack available on the RTCPeerConnection to pass to createDTMFSender"),null)}return this._log.info("RTCPeerConnection does not support RTCDTMFSender"),this._dtmfSenderUnsupported=!0,null},h.prototype.getRTCDtlsTransport=function(){var e=this.version&&this.version.pc&&"function"===typeof this.version.pc.getSenders&&this.version.pc.getSenders()[0];return e&&e.transport||null},h.prototype._canStopMediaStreamTrack=function(){return"function"===typeof MediaStreamTrack.prototype.stop},h.prototype._getAudioTracks=function(e){return"function"===typeof e.getAudioTracks?e.getAudioTracks():e.audioTracks},h.prototype._getRTCIceTransport=function(){var e=this.getRTCDtlsTransport();return e&&e.iceTransport||null},h.protocol=function(){return s.default.test()?new s.default:null}(),h.enabled=s.default.test(),t["default"]=h}
1,31582:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=n(87182),i=n(48630),o=n(22237),s=n(169);function a(e){"undefined"!==typeof window?e&&e.RTCPeerConnection?this.RTCPeerConnection=e.RTCPeerConnection:i.isLegacyEdge()?this.RTCPeerConnection=new s("undefined"!==typeof window?window:n.g):"function"===typeof window.RTCPeerConnection?this.RTCPeerConnection=window.RTCPeerConnection:"function"===typeof window.webkitRTCPeerConnection?this.RTCPeerConnection=webkitRTCPeerConnection:"function"===typeof window.mozRTCPeerConnection?(this.RTCPeerConnection=mozRTCPeerConnection,window.RTCSessionDescription=mozRTCSessionDescription,window.RTCIceCandidate=mozRTCIceCandidate):this.log.info("No RTCPeerConnection implementation available"):this.log.info("No RTCPeerConnection implementation available. The window object was not found.")}function c(e,t,n,r){return function(){var i=Array.prototype.slice.call(arguments);return new Promise((function(n){var o=e.apply(t,i);if(r){if("object"!==typeof o||"function"!==typeof o.then)throw new Error;n(o)}else n(o)})).catch((function(){return new Promise((function(r,o){e.apply(t,n?[r,o].concat(i):i.concat([r,o]))}))}))}}function u(e,t){return c(e,t,!0,!0)}function d(e,t){return c(e,t,!1,!1)}a.prototype.create=function(e){this.log=new r.default("RTCPC"),this.pc=new this.RTCPeerConnection(e)},a.prototype.createModernConstraints=function(e){if("undefined"===typeof e)return null;var t=Object.assign({},e);return"undefined"===typeof webkitRTCPeerConnection||i.isLegacyEdge()?("undefined"!==typeof e.audio&&(t.offerToReceiveAudio=e.audio),"undefined"!==typeof e.video&&(t.offerToReceiveVideo=e.video)):(t.mandatory={},"undefined"!==typeof e.audio&&(t.mandatory.OfferToReceiveAudio=e.audio),"undefined"!==typeof e.video&&(t.mandatory.OfferToReceiveVideo=e.video)),delete t.audio,delete t.video,t},a.prototype.createOffer=function(e,t,n,r,i){var s=this;return n=this.createModernConstraints(n),u(this.pc.createOffer,this.pc)(n).then((function(n){if(!s.pc)return Promise.resolve();var r=o.setMaxAverageBitrate(n.sdp,e);return d(s.pc.setLocalDescription,s.pc)(new RTCSessionDescription({sdp:o.setCodecPreferences(r,t),type:"offer"}))})).then(r,i)},a.prototype.createAnswer=function(e,t,n,r,i){var s=this;return n=this.createModernConstraints(n),u(this.pc.createAnswer,this.pc)(n).then((function(n){if(!s.pc)return Promise.resolve();var r=o.setMaxAverageBitrate(n.sdp,e);return d(s.pc.setLocalDescription,s.pc)(new RTCSessionDescription({sdp:o.setCodecPreferences(r,t),type:"answer"}))})).then(r,i)},a.prototype.processSDP=function(e,t,n,r,i,s){var a=this;n=o.setCodecPreferences(n,t);var c=new RTCSessionDescription({sdp:n,type:"offer"});return d(this.pc.setRemoteDescription,this.pc)(c).then((function(){a.createAnswer(e,t,r,i,s)}))},a.prototype.getSDP=function(){return this.pc.localDescription.sdp},a.prototype.processAnswer=function(e,t,n,r){return this.pc?(t=o.setCodecPreferences(t,e),d(this.pc.setRemoteDescription,this.pc)(new RTCSessionDescription({sdp:t,type:"answer"})).then(n,r)):Promise.resolve()},a.test=function(){if("object"===typeof navigator){var e=navigator.mediaDevices&&navigator.mediaDevices.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.getUserMedia;if(i.isLegacyEdge(navigator))return!1;if(e&&"function"===typeof window.RTCPeerConnection)return!0;if(e&&"function"===typeof window.webkitRTCPeerConnection)return!0;if(e&&"function"===typeof window.mozRTCPeerConnection){try{var t=new window.mozRTCPeerConnection;if("function"!==typeof t.getLocalStreams)return!1}catch(n){return!1}return!0}if("undefined"!==typeof RTCIceGatherer)return!0}return!1},t["default"]=a},22237:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.setMaxAverageBitrate=t.setIceAggressiveNomination=t.setCodecPreferences=t.getPreferredCodecInfo=void 0;var r=n(48630),i={0:"PCMU",8:"PCMA"},o=111,s=51e4,a=6e3;function c(e){var t=/a=rtpmap:(\d+) (\S+)/m.exec(e)||[null,"",""],n=t[1],r=t[2],i=new RegExp("a=fmtp:"+n+" (\\S+)","m"),o=i.exec(e)||[null,""],s=o[1];return{codecName:r,codecParams:s}}function u(e){return r.isChrome(window,window.navigator)?e.split("\n").filter((function(e){return-1===e.indexOf("a=ice-lite")})).join("\n"):e}function d(e,t){if("number"!==typeof t||t<a||t>s)return e;var n=/a=rtpmap:(\d+) opus/m.exec(e),r=n&&n.length?n[1]:o,i=new RegExp("a=fmtp:"+r),c=e.split("\n").map((function(e){return i.test(e)?e+";maxaveragebitrate="+t:e}));return c.join("\n")}function p(e,t){var n=l(e),r=e.split("\r\nm=")[0];return[r].concat(n.map((function(e){if(!/^m=(audio|video)/.test(e))return e;var n=e.match(/^m=(audio|video)/)[1],r=h(e),i=f(r,t),o=m(i,e),s=r.get("pcma")||[],a=r.get("pcmu")||[],c="audio"===n?new Set(s.concat(a)):new Set;return c.has(i[0])?o.replace(/\r\nb=(AS|TIAS):([0-9]+)/g,""):o}))).join("\r\n")}function l(e,t,n){return e.replace(/\r\n\r\n$/,"\r\n").split("\r\nm=").slice(1).map((function(e){return"m="+e})).filter((function(e){var r=new RegExp("m="+(t||".*"),"gm"),i=new RegExp("a="+(n||".*"),"gm");return r.test(e)&&i.test(e)}))}function h(e){return Array.from(g(e)).reduce((function(e,t){var n=t[0],r=t[1],i=e.get(r)||[];return e.set(r,i.concat(n))}),new Map)}function f(e,t){t=t.map((function(e){return e.toLowerCase()}));var n=r.flatMap(t,(function(t){return e.get(t)||[]})),i=r.difference(Array.from(e.keys()),t),o=r.flatMap(i,(function(t){return e.get(t)}));return n.concat(o)}function m(e,t){var n=t.split("\r\n"),r=n[0],i=n.slice(1);return r=r.replace(/([0-9]+\s?)+$/,e.join(" ")),[r].concat(i).join("\r\n")}function g(e){return v(e).reduce((function(t,n){var r=new RegExp("a=rtpmap:"+n+" ([^/]+)"),o=e.match(r),s=o?o[1].toLowerCase():i[n]?i[n].toLowerCase():"";return t.set(n,s)}),new Map)}function v(e){var t=e.split("\r\n")[0],n=t.match(/([0-9]+)/g);return n?n.slice(1).map((function(e){return parseInt(e,10)})):[]}t.getPreferredCodecInfo=c,t.setIceAggressiveNomination=u,t.setMaxAverageBitrate=d,t.setCodecPreferences=p},84735:function(e,t,n){var r=this&&this.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],s=0,a=o.length;s<a;s++,i++)r[i]=o[s];return r};
1Object.defineProperty(t,"__esModule",{value:!0}),t.getRTCIceCandidateStatsReport=t.getRTCStats=void 0;var i=n(42686),o=n(22144),s="PeerConnection is null",a="WebRTC statistics are unsupported";function c(e,t){return"function"===typeof e.get?e.get(t):e.find((function(e){return e.id===t}))}function u(e){if(!e)return Promise.reject(new i.InvalidArgumentError(s));if("function"!==typeof e.getStats)return Promise.reject(new i.NotSupportedError(a));var t;try{t=e.getStats()}catch(n){t=new Promise((function(t){return e.getStats(t)})).then(o.default.fromRTCStatsResponse)}return t}function d(e,t){return t=Object.assign({createRTCSample:h},t),u(e).then(t.createRTCSample)}function p(e){return u(e).then((function(e){var t,n=Array.from(e.values()).reduce((function(e,t){switch(["candidatePairs","localCandidates","remoteCandidates"].forEach((function(t){e[t]||(e[t]=[])})),t.type){case"candidate-pair":e.candidatePairs.push(t);break;case"local-candidate":e.localCandidates.push(t);break;case"remote-candidate":e.remoteCandidates.push(t);break;case"transport":t.selectedCandidatePairId&&(e.transport=t);break}return e}),{}),i=n.candidatePairs,o=n.localCandidates,s=n.remoteCandidates,a=n.transport,c=i.find((function(e){return e.selected||a&&e.id===a.selectedCandidatePairId}));return c&&(t={localCandidate:o.find((function(e){return e.id===c.localCandidateId})),remoteCandidate:s.find((function(e){return e.id===c.remoteCandidateId}))}),{iceCandidateStats:r(o,s),selectedIceCandidatePairStats:t}}))}function l(){}function h(e){var t,n=null,r=new l;Array.from(e.values()).forEach((function(i){if(!i.isRemote){var o=i.type.replace("-","");if(t=t||i.timestamp,i.remoteId){var s=c(e,i.remoteId);s&&s.roundTripTime&&(r.rtt=1e3*s.roundTripTime)}switch(o){case"inboundrtp":r.timestamp=r.timestamp||i.timestamp,r.jitter=1e3*i.jitter,r.packetsLost=i.packetsLost,r.packetsReceived=i.packetsReceived,r.bytesReceived=i.bytesReceived;break;case"outboundrtp":if(r.timestamp=i.timestamp,r.packetsSent=i.packetsSent,r.bytesSent=i.bytesSent,i.codecId){var a=c(e,i.codecId);r.codecName=a?a.mimeType&&a.mimeType.match(/(.*\/)?(.*)/)[2]:i.codecId}break;case"transport":n=i.id;break}}})),r.timestamp||(r.timestamp=t);var i=c(e,n);if(!i)return r;var o=c(e,i.selectedCandidatePairId);if(!o)return r;var s=c(e,o.localCandidateId),a=c(e,o.remoteCandidateId);return r.rtt||(r.rtt=o&&1e3*o.currentRoundTripTime),Object.assign(r,{localAddress:s&&(s.address||s.ip),remoteAddress:a&&(a.address||a.ip)}),r}t.getRTCStats=d,t.getRTCIceCandidateStatsReport=p},8611:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){Object.defineProperties(this,{deviceId:{get:function(){return e.deviceId}},groupId:{get:function(){return e.groupId}},kind:{get:function(){return e.kind}},label:{get:function(){return e.label}}})}return e}();t["default"]=n},93087:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=n(17701),i=n(90995),o=n(42686);function s(e,t,n){if(!(this instanceof s))return new s(e,t,n);if(!e||!t)throw new o.InvalidArgumentError("name and url are required arguments");n=Object.assign({AudioFactory:"undefined"!==typeof Audio?Audio:null,maxDuration:0,shouldLoop:!1},n),n.AudioPlayer=n.audioContext?i.default.bind(i.default,n.audioContext):n.AudioFactory,Object.defineProperties(this,{_Audio:{value:n.AudioPlayer},_activeEls:{value:new Map},_isSinkSupported:{value:null!==n.AudioFactory&&"function"===typeof n.AudioFactory.prototype.setSinkId},_maxDuration:{value:n.maxDuration},_maxDurationTimeout:{value:null,writable:!0},_operations:{value:new r.AsyncQueue},_playPromise:{value:null,writable:!0},_shouldLoop:{value:n.shouldLoop},_sinkIds:{value:["default"]},isPlaying:{enumerable:!0,get:function(){return!!this._playPromise}},name:{enumerable:!0,value:e},url:{enumerable:!0,value:t}}),this._Audio&&this._play(!0,!1)}function a(e){e&&(e.pause(),e.src="",e.srcObject=null,e.load())}s.prototype._playAudioElement=function(e,t,n){var r=this,i=this._activeEls.get(e);if(!i)throw new o.InvalidArgumentError('sinkId: "'+e+"\" doesn't have an audio element");return i.muted=!!t,i.loop=!!n,i.play().then((function(){return i})).catch((function(t){throw a(i),r._activeEls.delete(e),t}))},s.prototype._play=function(e,t){this.isPlaying&&this._stop(),this._maxDuration>0&&(this._maxDurationTimeout=setTimeout(this._stop.bind(this),this._maxDuration)),t="boolean"===typeof t?t:this._shouldLoop;
1var n=this,r=this._playPromise=Promise.all(this._sinkIds.map((function(r){if(!n._Audio)return Promise.resolve();var i=n._activeEls.get(r);return i?n._playAudioElement(r,e,t):(i=new n._Audio(n.url),"function"===typeof i.setAttribute&&i.setAttribute("crossorigin","anonymous"),new Promise((function(e){i.addEventListener("canplaythrough",e)})).then((function(){return(n._isSinkSupported?i.setSinkId(r):Promise.resolve()).then((function(){return n._activeEls.set(r,i),n._playPromise?n._playAudioElement(r,e,t):Promise.resolve()}))})))})));return r},s.prototype._stop=function(){var e=this;this._activeEls.forEach((function(t,n){e._sinkIds.includes(n)?(t.pause(),t.currentTime=0):(a(t),e._activeEls.delete(n))})),clearTimeout(this._maxDurationTimeout),this._playPromise=null,this._maxDurationTimeout=null},s.prototype.setSinkIds=function(e){this._isSinkSupported&&(e=e.forEach?e:[e],[].splice.apply(this._sinkIds,[0,this._sinkIds.length].concat(e)))},s.prototype.stop=function(){var e=this;this._operations.enqueue((function(){return e._stop(),Promise.resolve()}))},s.prototype.play=function(){var e=this;return this._operations.enqueue((function(){return e._play()}))},t["default"]=s}}]);
2//# sourceMappingURL=1718.654971fc.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.