Socket
Socket
Sign inDemoInstall

opentok-network-test-js

Package Overview
Dependencies
13
Maintainers
4
Versions
41
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.4.2 to 2.4.3

2

dist/NetworkTest/index.js

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("OpenTokNetworkConnectivity",[],t):"object"==typeof exports?exports.OpenTokNetworkConnectivity=t():e.OpenTokNetworkConnectivity=t()}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=20)}([function(e,t,r){"use strict";var n=r(7),o=Object.prototype.toString;function s(e){return"[object Array]"===o.call(e)}function i(e){return void 0===e}function a(e){return null!==e&&"object"==typeof e}function c(e){if("[object Object]"!==o.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function u(e){return"[object Function]"===o.call(e)}function l(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),s(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}e.exports={isArray:s,isArrayBuffer:function(e){return"[object ArrayBuffer]"===o.call(e)},isBuffer:function(e){return null!==e&&!i(e)&&null!==e.constructor&&!i(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:a,isPlainObject:c,isUndefined:i,isDate:function(e){return"[object Date]"===o.call(e)},isFile:function(e){return"[object File]"===o.call(e)},isBlob:function(e){return"[object Blob]"===o.call(e)},isFunction:u,isStream:function(e){return a(e)&&u(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:l,merge:function e(){var t={};function r(r,n){c(t[n])&&c(r)?t[n]=e(t[n],r):c(r)?t[n]=e({},r):s(r)?t[n]=r.slice():t[n]=r}for(var n=0,o=arguments.length;n<o;n++)l(arguments[n],r);return t},extend:function(e,t,r){return l(t,(function(t,o){e[o]=r&&"function"==typeof t?n(t,r):t})),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assoc=(e,t,r)=>Object.assign({},r,{[e]:t}),t.assocPath=(e,r,n)=>{const o=e.split("."),s=o[0];if(!o.length)return n;if(1===o.length)return t.assoc(s,r,n);const i=t.get(s,n),a=i&&"object"==typeof i?i:Object.assign({},n,{[s]:{}}),c=t.assoc(s,t.assocPath(o.slice(1).join("."),r,t.get(s,a)),n);return Object.assign({},n,c)},t.get=(e,r)=>{if(!r)return r;const[n,...o]=e.split("."),s=r[n];return null==s?s:o.length?t.get(o.join("."),s):s},t.getOr=(e,r,n)=>t.get(r,n)||e,t.pick=(e,t,r=!1)=>e.reduce((e,n)=>void 0!==t[n]||r?Object.assign({},e,{[n]:t[n]}):e,{}),t.pickAll=(e,r)=>t.pick(e,r,!0),t.last=e=>e[e.length-1],t.nth=(e,t)=>e<0?t[t.length+e]:t[e],t.head=e=>t.nth(0,e)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(1);!function(e){e.NETWORK_TEST_ERROR="NetworkTestError",e.MISSING_OPENTOK_INSTANCE="MissingOpenTokInstanceError",e.INCOMPLETE_SESSON_CREDENTIALS="IncompleteSessionCredentialsError",e.MISSING_SESSON_CREDENTIALS="MissingSessionCredentialsError",e.INVALID_ON_UPDATE_CALLBACK="InvalidOnUpdateCallback",e.CONNECTIVITY_ERROR="ConnectivityError",e.API_CONNECTIVITY_ERROR="APIConnectivityError",e.CONNECT_TO_SESSION_ERROR="ConnectToSessionError",e.CONNECT_TO_SESSION_TOKEN_ERROR="ConnectToSessionTokenError",e.CONNECT_TO_SESSION_ID_ERROR="ConnectToSessionSessionIdError",e.CONNECT_TO_SESSION_NETWORK_ERROR="ConnectToSessionNetworkError",e.MEDIA_DEVICE_ERROR="MediaDeviceError",e.FAILED_TO_OBTAIN_MEDIA_DEVICES="FailedToObtainMediaDevices",e.NO_VIDEO_CAPTURE_DEVICES="NoVideoCaptureDevicesError",e.NO_AUDIO_CAPTURE_DEVICES="NoAudioCaptureDevicesError",e.PUBLISH_TO_SESSION_ERROR="PublishToSessionError",e.INIT_PUBLISHER_ERROR="InitPublisherError",e.FAILED_MESSAGING_SERVER_TEST="FailedMessagingServerTestError",e.FAILED_TO_CREATE_LOCAL_PUBLISHER="FailedToCreateLocalPublisher",e.PUBLISH_TO_SESSION_NOT_CONNECTED="PublishToSessionNotConnectedError",e.PUBLISH_TO_SESSION_PERMISSION_OR_TIMEOUT_ERROR="PublishToSessionPermissionOrTimeoutError",e.PUBLISH_TO_SESSION_NETWORK_ERROR="PublishToSessionNetworkError",e.SUBSCRIBE_TO_SESSION_ERROR="SubscribeToSessionError",e.LOGGING_SERVER_CONNECTION_ERROR="LoggingServerConnectionError",e.QUALITY_TEST_ERROR="QualityTestError",e.UNSUPPORTED_BROWSER="UnsupportedBrowser",e.SUBSCRIBER_GET_STATS_ERROR="SubscriberGetStatsError",e.MISSING_SUBSCRIBER_ERROR="MissingSubscriberError"}(t.ErrorNames||(t.ErrorNames={})),function(e){e.JS_EXCEPTION="JS_EXCEPTION",e.OT_AUTHENTICATION_ERROR="OT_AUTHENTICATION_ERROR",e.OT_INVALID_HTTP_STATUS="OT_INVALID_HTTP_STATUS",e.OT_CONNECT_FAILED="OT_CONNECT_FAILED",e.OT_INVALID_SESSION_ID="OT_INVALID_SESSION_ID",e.CONNECT_FAILED="CONNECT_FAILED",e.CONNECT_REJECTED="CONNECT_REJECTED",e.CONNECTION_TIMEOUT="CONNECTION_TIMEOUT",e.NOT_CONNECTED="NOT_CONNECTED",e.INVALID_PARAMETER="INVALID_PARAMETER",e.P2P_CONNECTION_FAILED="P2P_CONNECTION_FAILED",e.API_RESPONSE_FAILURE="API_RESPONSE_FAILURE",e.TERMS_OF_SERVICE_FAILURE="TERMS_OF_SERVICE_FAILURE",e.CONNECTION_LIMIT_EXCEEDED="CONNECTION_LIMIT_EXCEEDED",e.UNABLE_TO_PUBLISH="UNABLE_TO_PUBLISH",e.UNABLE_TO_SUBSCRIBE="UNABLE_TO_SUBSCRIBE",e.UNSUPPORTED_VIDEO_CODEC="UNSUPPORTED_VIDEO_CODEC",e.UNABLE_TO_FORCE_DISCONNECT="UNABLE_TO_FORCE_DISCONNECT",e.UNABLE_TO_FORCE_UNPUBLISH="UNABLE_TO_FORCE_UNPUBLISH",e.PUBLISHER_ICE_WORKFLOW_FAILED="PUBLISHER_ICE_WORKFLOW_FAILED",e.SUBSCRIBER_ICE_WORKFLOW_FAILED="SUBSCRIBER_ICE_WORKFLOW_FAILED",e.STREAM_LIMIT_EXCEEDED="STREAM_LIMIT_EXCEEDED",e.UNEXPECTED_SERVER_RESPONSE="UNEXPECTED_SERVER_RESPONSE",e.REPORT_ISSUE_ERROR="REPORT_ISSUE_ERROR",e.ANVIL_BADLY_FORMED_RESPONSE="ANVIL_BADLY_FORMED_RESPONSE",e.ANVIL_INVALID_HTTP_STATUS="ANVIL_INVALID_HTTP_STATUS",e.ANVIL_XDOMAIN_OR_PARSING_ERROR="ANVIL_XDOMAIN_OR_PARSING_ERROR",e.ANVIL_UNKNOWN_HTTP_ERROR="ANVIL_UNKNOWN_HTTP_ERROR",e.ANVIL_UNEXPECTED_ERROR_CODE="ANVIL_UNEXPECTED_ERROR_CODE",e.ANVIL_EMPTY_RESPONSE_BODY="ANVIL_EMPTY_RESPONSE_BODY",e.ANVIL_CONNECT_FAILED="ANVIL_CONNECT_FAILED"}(t.OTErrorType||(t.OTErrorType={})),t.errorHasName=(e=null,t)=>n.get("name",e)===t},function(e,t,r){"use strict";var n=r(16);function o(){}var s=null,i={};function a(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("Promise constructor's argument is not a function");this._U=0,this._V=0,this._W=null,this._X=null,e!==o&&p(e,this)}function c(e,t){for(;3===e._V;)e=e._W;if(a._Y&&a._Y(e),0===e._V)return 0===e._U?(e._U=1,void(e._X=t)):1===e._U?(e._U=2,void(e._X=[e._X,t])):void e._X.push(t);!function(e,t){n((function(){var r=1===e._V?t.onFulfilled:t.onRejected;if(null!==r){var n=function(e,t){try{return e(t)}catch(e){return s=e,i}}(r,e._W);n===i?l(t.promise,s):u(t.promise,n)}else 1===e._V?u(t.promise,e._W):l(t.promise,e._W)}))}(e,t)}function u(e,t){if(t===e)return l(e,new TypeError("A promise cannot be resolved with itself."));if(t&&("object"==typeof t||"function"==typeof t)){var r=function(e){try{return e.then}catch(e){return s=e,i}}(t);if(r===i)return l(e,s);if(r===e.then&&t instanceof a)return e._V=3,e._W=t,void d(e);if("function"==typeof r)return void p(r.bind(t),e)}e._V=1,e._W=t,d(e)}function l(e,t){e._V=2,e._W=t,a._Z&&a._Z(e,t),d(e)}function d(e){if(1===e._U&&(c(e,e._X),e._X=null),2===e._U){for(var t=0;t<e._X.length;t++)c(e,e._X[t]);e._X=null}}function f(e,t,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=r}function p(e,t){var r=!1,n=function(e,t,r){try{e(t,r)}catch(e){return s=e,i}}(e,(function(e){r||(r=!0,u(t,e))}),(function(e){r||(r=!0,l(t,e))}));r||n!==i||(r=!0,l(t,s))}e.exports=a,a._Y=null,a._Z=null,a._0=o,a.prototype.then=function(e,t){if(this.constructor!==a)return function(e,t,r){return new e.constructor((function(n,s){var i=new a(o);i.then(n,s),c(e,new f(t,r,i))}))}(this,e,t);var r=new a(o);return c(this,new f(e,t,r)),r}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default={getStatsInterval:1e3,getStatsVideoAndAudioTestDuration:3e4,getStatsAudioOnlyDuration:1e4,subscribeOptions:{testNetwork:!0,audioVolume:0},minimumVideoAndAudioTestSampleSize:5,steadyStateSampleWindow:5e3,steadyStateAllowedDelta:.05,qualityThresholds:{video:[{bps:1e6,plr:.005,recommendedSetting:"1280x720 @ 30FPS"},{bps:6e5,plr:.005,recommendedSetting:"640x480 @ 30FPS"},{bps:3e5,plr:.005,recommendedSetting:"320x240 @ 30FPS"},{bps:35e4,plr:.03,recommendedSetting:"1280x720 @ 30FPS"},{bps:25e4,plr:.03,recommendedSetting:"640x480 @ 30FPS"},{bps:15e4,plr:.03,recommendedSetting:"320x240 @ 30FPS"}],audio:[{minMos:2.4}]},strings:{bandwidthLow:"Bandwidth too low.",noCam:"No camera was found.",noMic:"No microphone was found."}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(2);class o extends Error{constructor(e,t){super(e),this.name=t||n.ErrorNames.NETWORK_TEST_ERROR,this.stack=new Error(e).stack}}t.NetworkTestError=o;t.MissingOpenTokInstanceError=class extends o{constructor(){super("An instance of OT, the OpenTok.js client SDK, is required."),this.name=n.ErrorNames.MISSING_OPENTOK_INSTANCE}};t.IncompleteSessionCredentialsError=class extends o{constructor(){super("NetworkConnectivity requires an apiKey, sessionId, and token.",n.ErrorNames.INCOMPLETE_SESSON_CREDENTIALS)}};t.MissingSessionCredentialsError=class extends o{constructor(){super("NetworkConnectivity requires OpenTok session credentials.",n.ErrorNames.MISSING_SESSON_CREDENTIALS)}};t.InvalidOnUpdateCallback=class extends o{constructor(){super("The onUpdate callback must be a function that accepts a single parameter.",n.ErrorNames.INVALID_ON_UPDATE_CALLBACK)}}},function(e,t,r){e.exports=r(23)},function(e,t,r){"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}}},function(e,t,r){"use strict";var n=r(0);function o(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,r){if(!t)return e;var s;if(r)s=r(t);else if(n.isURLSearchParams(t))s=t.toString();else{var i=[];n.forEach(t,(function(e,t){null!=e&&(n.isArray(e)?t+="[]":e=[e],n.forEach(e,(function(e){n.isDate(e)?e=e.toISOString():n.isObject(e)&&(e=JSON.stringify(e)),i.push(o(t)+"="+o(e))})))})),s=i.join("&")}if(s){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}},function(e,t,r){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,r){"use strict";(function(t){var n=r(0),o=r(29),s={"Content-Type":"application/x-www-form-urlencoded"};function i(e,t){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var a,c={adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==t&&"[object process]"===Object.prototype.toString.call(t))&&(a=r(11)),a),transformRequest:[function(e,t){return o(t,"Accept"),o(t,"Content-Type"),n.isFormData(e)||n.isArrayBuffer(e)||n.isBuffer(e)||n.isStream(e)||n.isFile(e)||n.isBlob(e)?e:n.isArrayBufferView(e)?e.buffer:n.isURLSearchParams(e)?(i(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):n.isObject(e)?(i(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},n.forEach(["delete","get","head"],(function(e){c.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){c.headers[e]=n.merge(s)})),e.exports=c}).call(this,r(28))},function(e,t,r){"use strict";var n=r(0),o=r(30),s=r(32),i=r(8),a=r(33),c=r(36),u=r(37),l=r(12);e.exports=function(e){return new Promise((function(t,r){var d=e.data,f=e.headers;n.isFormData(d)&&delete f["Content-Type"];var p=new XMLHttpRequest;if(e.auth){var E=e.auth.username||"",h=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";f.Authorization="Basic "+btoa(E+":"+h)}var _=a(e.baseURL,e.url);if(p.open(e.method.toUpperCase(),i(_,e.params,e.paramsSerializer),!0),p.timeout=e.timeout,p.onreadystatechange=function(){if(p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in p?c(p.getAllResponseHeaders()):null,s={data:e.responseType&&"text"!==e.responseType?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:n,config:e,request:p};o(t,r,s),p=null}},p.onabort=function(){p&&(r(l("Request aborted",e,"ECONNABORTED",p)),p=null)},p.onerror=function(){r(l("Network Error",e,null,p)),p=null},p.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(l(t,e,"ECONNABORTED",p)),p=null},n.isStandardBrowserEnv()){var S=(e.withCredentials||u(_))&&e.xsrfCookieName?s.read(e.xsrfCookieName):void 0;S&&(f[e.xsrfHeaderName]=S)}if("setRequestHeader"in p&&n.forEach(f,(function(e,t){void 0===d&&"content-type"===t.toLowerCase()?delete f[t]:p.setRequestHeader(t,e)})),n.isUndefined(e.withCredentials)||(p.withCredentials=!!e.withCredentials),e.responseType)try{p.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&p.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&p.upload&&p.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){p&&(p.abort(),r(e),p=null)})),d||(d=null),p.send(d)}))}},function(e,t,r){"use strict";var n=r(31);e.exports=function(e,t,r,o,s){var i=new Error(e);return n(i,t,r,o,s)}},function(e,t,r){"use strict";var n=r(0);e.exports=function(e,t){t=t||{};var r={},o=["url","method","data"],s=["headers","auth","proxy","params"],i=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],a=["validateStatus"];function c(e,t){return n.isPlainObject(e)&&n.isPlainObject(t)?n.merge(e,t):n.isPlainObject(t)?n.merge({},t):n.isArray(t)?t.slice():t}function u(o){n.isUndefined(t[o])?n.isUndefined(e[o])||(r[o]=c(void 0,e[o])):r[o]=c(e[o],t[o])}n.forEach(o,(function(e){n.isUndefined(t[e])||(r[e]=c(void 0,t[e]))})),n.forEach(s,u),n.forEach(i,(function(o){n.isUndefined(t[o])?n.isUndefined(e[o])||(r[o]=c(void 0,e[o])):r[o]=c(void 0,t[o])})),n.forEach(a,(function(n){n in t?r[n]=c(e[n],t[n]):n in e&&(r[n]=c(void 0,e[n]))}));var l=o.concat(s).concat(i).concat(a),d=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===l.indexOf(e)}));return n.forEach(d,u),r}},function(e,t,r){"use strict";function n(e){this.message=e}n.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},n.prototype.__CANCEL__=!0,e.exports=n},function(e,t,r){"use strict";e.exports=r(41)},function(e,t,r){"use strict";(function(t){function r(e){o.length||(n(),!0),o[o.length]=e}e.exports=r;var n,o=[],s=0;function i(){for(;s<o.length;){var e=s;if(s+=1,o[e].call(),s>1024){for(var t=0,r=o.length-s;t<r;t++)o[t]=o[t+s];o.length-=s,s=0}}o.length=0,s=0,!1}var a,c,u,l=void 0!==t?t:self,d=l.MutationObserver||l.WebKitMutationObserver;function f(e){return function(){var t=setTimeout(n,0),r=setInterval(n,50);function n(){clearTimeout(t),clearInterval(r),e()}}}"function"==typeof d?(a=1,c=new d(i),u=document.createTextNode(""),c.observe(u,{characterData:!0}),n=function(){a=-a,u.data=a}):n=f(i),r.requestFlush=n,r.makeRequestCallFromTimer=f}).call(this,r(42))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4),o=r(1);t.default=function(e){const t=o.getOr(0,"timestamp",o.last(e))-n.default.steadyStateSampleWindow;return e.filter(e=>e.timestamp>=t)}},function(e,t,r){"use strict";function n(e,t){const r=[];for(let n=1;n<t.length;n+=1){const o=t[n],s=t[n-1];if(o[e]&&s[e]){const t=8*(o[e].bytesReceived?o[e].bytesReceived-s[e].bytesReceived:0)/((o.timestamp-s.timestamp)/1e3),n=o[e].packetsReceived,i=o[e].packetsLost,a=i+n;let c=0;a>0&&i>0&&(c=i/a);const u="video"===e?{frameRate:o[e].frameRate}:{};r.push(Object.assign({averageBitrate:t,packetLossRatio:c},u))}}return r}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(e.length<2)throw new Error("Cannot calculate bitrate with less than two data points.");return{audio:n("audio",e),video:n("video",e)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class n{constructor(e){this.stats={audio:{},video:{}},this.bandwidth={audio:0,video:0},this.hasAudioTrack=()=>this.statsLog[0]&&!!this.statsLog[0].audio,this.hasVideoTrack=()=>this.statsLog[0]&&!!this.statsLog[0].video,this.statsLog=[],this.audioScoresLog=[],this.videoScoresLog=[],this.audioOnlyFallback=!!e}audioScore(){return this.audioScoresLog.reduce((e,t)=>e+t,0)/this.audioScoresLog.length}videoScore(){return this.videoScoresLog.reduce((e,t)=>e+t,0)/this.videoScoresLog.length}clearInterval(){this.intervalId&&window.clearInterval(this.intervalId),this.intervalId=void 0}pruneAudioScores(){const e=this.audioScoresLog;for(;e.length>n.maxLogLength;)e.shift();this.audioScoresLog=e}pruneVideoScores(){const e=this.videoScoresLog;for(;e.length>n.maxLogLength;)e.shift();this.videoScoresLog=e}pruneScores(){this.pruneAudioScores(),this.pruneVideoScores()}audioQualityScore(){return this.hasAudioTrack()?this.audioScore():1}videoQualityScore(){return this.hasVideoTrack()?this.videoScore():1}}n.maxLogLength=1e3,n.scoreInterval=1e3,t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(21).version,o=r(22),s=r(51),i=r(5),a=r(59);t.default=class{constructor(e,t,r){this.validateOT(e),this.validateCredentials(t);const n=this.validateProxyUrl(r);this.otLogging=this.startLoggingEngine(t.apiKey,t.sessionId,n),this.OT=e,this.credentials=t,this.options=r,this.setProxyUrl(n)}validateOT(e){if(!e||"object"!=typeof e||!e.initSession)throw new i.MissingOpenTokInstanceError}validateCredentials(e){if(!e)throw new i.MissingSessionCredentialsError;if(!e.apiKey||!e.sessionId||!e.token)throw new i.IncompleteSessionCredentialsError}validateProxyUrl(e){return e&&e.proxyServerUrl?e.proxyServerUrl:""}setProxyUrl(e){this.OT.setProxyUrl&&"function"==typeof this.OT.setProxyUrl&&e&&this.OT.setProxyUrl(e)}startLoggingEngine(e,t,r){return new a({sessionId:t,partnerId:e,source:window.location.href,clientVersion:"js-network-test-"+n,name:"opentok-network-test",componentId:"opentok-network-test"},{proxyUrl:r})}testConnectivity(){return this.otLogging.logEvent({action:"testConnectivity",variation:"Attempt"}),o.testConnectivity(this.OT,this.credentials,this.otLogging,this.options)}testQuality(e){if(this.otLogging.logEvent({action:"testQuality",variation:"Attempt"}),e&&("function"!=typeof e||1!==e.length))throw this.otLogging.logEvent({action:"testQuality",variation:"Failure"}),new i.InvalidOnUpdateCallback;return s.testQuality(this.OT,this.credentials,this.otLogging,this.options,e)}stop(){s.stopQualityTest()}};var c=r(2);t.ErrorNames=c.ErrorNames},function(e){e.exports=JSON.parse('{"name":"opentok-network-test-js","version":"2.4.2","description":"Precall network test for applications using the OpenTok platform.","main":"dist/NetworkTest/index.js","types":"dist/NetworkTest/index.d.ts","scripts":{"build":"rm -rf dist && webpack --config webpack.config.js","test-setup":"node test/setup/setup.js","test-teardown":"rm test/credentials.json","karma":"karma start","test":"npm run test-setup && npm run karma && npm run test-teardown","example":"npm run build && cd sample && npm run build && python -m SimpleHTTPServer","tslint":"./node_modules/tslint/bin/tslint -p tsconfig.json"},"repository":{"type":"git","url":"git+https://github.com/opentok/opentok-network-test-js.git"},"keywords":["tokbox","opentok","network test","connectivity","webrtc"],"author":{"name":"TokBox","email":"contact@tokbox.com"},"license":"MIT","bugs":{"url":"https://github.com/opentok/network-connectivity-js/issues"},"homepage":"https://github.com/opentok/network-connectivity-js#readme","dependencies":{"axios":"^0.21.1","opentok-solutions-logging":"^1.1.1","promise":"^8.0.1"},"devDependencies":{"@opentok/client":"^2.18.0","@types/expect.js":"^0.3.29","@types/jasmine":"^2.8.8","@types/jasmine-matchers":"^0.2.30","@types/mocha":"^5.2.2","@types/node":"^10.3.2","@types/opentok":"^2.3.4","@types/promise":"^7.1.30","@types/webrtc":"0.0.22","dotenv":"^4.0.0","fs-extra":"^4.0.3","jasmine":"^2.99.0","jasmine-core":"^2.99.1","karma":"^5.1.1","karma-chrome-launcher":"^2.2.0","karma-cli":"^1.0.1","karma-firefox-launcher":"^1.1.0","karma-jasmine":"^1.1.2","karma-mocha-reporter":"^2.2.5","karma-safari-launcher":"^1.0.0","karma-safaritechpreview-launcher":"0.0.6","karma-sauce-launcher":"^1.2.0","karma-sourcemap-loader":"^0.3.7","karma-webpack":"^2.0.13","opentok":"^2.9.1","terser-webpack-plugin":"^2.3.3","ts-loader":"^4.4.1","tslint":"^5.10.0","tslint-config-airbnb":"^5.9.2","typescript":"2.9.2","webpack":"^4.12.0","webpack-cli":"^3.0.4","webpack-node-externals":"^1.7.2"}}')},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6),o=r(15),s=r(49),i=r(2),a=r(50),c=r(1);function u(e){return new o((t,r)=>{e.on("sessionDisconnected",()=>{e.off(),t()}),e.disconnect()})}function l(e){return new o((t,r)=>{e.on("destroyed",()=>{t()}),e||t(),e.destroy()})}function d(e,t){return new o((r,n)=>{(function(e){return new o((t,r)=>{e.getDevices((e,n=[])=>{if(e)r(new s.FailedToObtainMediaDevices);else{const e=n.reduce((e,t)=>{const r="audioInput"===t.kind?"audio":"video";return Object.assign({},e,{[r]:Object.assign({},e[r],{[t.deviceId]:t})})},{audio:{},video:{}});Object.keys(e.audio).length||Object.keys(e.video).length?t(e):r(new s.FailedToObtainMediaDevices)}})})})(e).then(o=>{const i=document.createElement("div");i.style.position="fixed",i.style.bottom="-1px",i.style.width="1px",i.style.height="1px",i.style.opacity="0.01",document.body.appendChild(i);const a={width:"100%",height:"100%",insertMode:"append",showControls:!1};t&&t.audioSource&&(a.audioSource=t.audioSource),t&&t.videoSource&&(a.videoSource=t.videoSource),t&&t.audioOnly&&(a.videoSource=null),Object.keys(o.audio).length||(a.audioSource=null),Object.keys(o.video).length||(a.videoSource=null);const c=e.initPublisher(i,a,e=>{e?n(new s.FailedToCreateLocalPublisher):r({publisher:c})});c.on("streamCreated",()=>{i.style.visibility="hidden"})}).catch(n)})}function f({session:e,publisher:t}){return new o((r,n)=>{const o={testNetwork:!0,audioVolume:0},i=r=>{l(t).then(()=>u(e)).then(()=>{n(r)})};if(t.stream){const n=document.createElement("div"),a=e.subscribe(t.stream,n,o,n=>{n?i(new s.SubscribeToSessionError):r(Object.assign({session:e},{publisher:t},{subscriber:a}))})}else i(new s.SubscribeToSessionError)})}function p(e,t,r){return new o((o,i)=>{const a=c.getOr("","properties.loggingURL",e)+"/logging/ClientEvent",u=t&&t.proxyServerUrl&&`${t.proxyServerUrl}/${a.replace("https://","")}`||a,l=()=>i(new s.LoggingServerConnectionError);n.default.post(u).then(e=>200===e.status?o(r):l()).catch(l)})}t.testConnectivity=function(e,t,r,n){return new o((c,E)=>{(function(e,{apiKey:t,sessionId:r,token:n},a){return new o((o,c)=>{let u={};a&&a.initSessionOptions&&(u=a.initSessionOptions),a&&a.proxyServerUrl&&(e.hasOwnProperty("setProxyUrl")||(u.proxyUrl=a.proxyServerUrl));const l=e.initSession(t,r,u);l.connect(n,e=>{i.errorHasName(e,i.OTErrorType.OT_AUTHENTICATION_ERROR)?c(new s.ConnectToSessionTokenError):i.errorHasName(e,i.OTErrorType.OT_INVALID_SESSION_ID)?c(new s.ConnectToSessionSessionIdError):i.errorHasName(e,i.OTErrorType.OT_CONNECT_FAILED)?c(new s.ConnectToSessionNetworkError):i.errorHasName(e,i.OTErrorType.OT_INVALID_HTTP_STATUS)?c(new s.APIConnectivityError):e?c(new s.ConnectToSessionError):o(l)})})})(e,t,n).then(t=>function(e,t,r){return new o((n,o)=>{const a=e=>{u(t).then(()=>{o(e)})};d(e,r).then(({publisher:e})=>{t.publish(e,r=>{r?i.errorHasName(r,i.OTErrorType.NOT_CONNECTED)?a(new s.PublishToSessionNotConnectedError):i.errorHasName(r,i.OTErrorType.UNABLE_TO_PUBLISH)?a(new s.PublishToSessionPermissionOrTimeoutError):r&&a(new s.PublishToSessionError):n(Object.assign({session:t},{publisher:e}))})}).catch(e=>{a(e)})})}(e,t,n)).then(f).then(t=>p(e,n,t)).then(e=>{const t={success:!0,failedTests:[]};return r.logEvent({action:"testConnectivity",variation:"Success"}),(n=e.session,s=e.subscriber,new o((e,t)=>{s.on("destroyed",()=>{e()}),s||e(),n.unsubscribe(s)})).then(()=>l(e.publisher)).then(()=>u(e.session)).then(()=>c(t));var n,s}).catch(t=>{const o=(...e)=>{const t=a.mapErrors(...e),n=t.find(e=>"messaging"===e.type),o={failedTests:[...t,...n?a.mapErrors(new s.FailedMessagingServerTestError):[]],success:!1};r.logEvent({action:"testConnectivity",variation:"Success"}),c(o)};"LoggingServerConnectionError"===t.name?o(t):p(e,n).then(()=>o(t)).catch(e=>o(t,e))})})}},function(e,t,r){"use strict";var n=r(0),o=r(7),s=r(24),i=r(13);function a(e){var t=new s(e),r=o(s.prototype.request,t);return n.extend(r,s.prototype,t),n.extend(r,t),r}var c=a(r(10));c.Axios=s,c.create=function(e){return a(i(c.defaults,e))},c.Cancel=r(14),c.CancelToken=r(38),c.isCancel=r(9),c.all=function(e){return Promise.all(e)},c.spread=r(39),c.isAxiosError=r(40),e.exports=c,e.exports.default=c},function(e,t,r){"use strict";var n=r(0),o=r(8),s=r(25),i=r(26),a=r(13);function c(e){this.defaults=e,this.interceptors={request:new s,response:new s}}c.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=a(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[i,void 0],r=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)r=r.then(t.shift(),t.shift());return r},c.prototype.getUri=function(e){return e=a(this.defaults,e),o(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},n.forEach(["delete","get","head","options"],(function(e){c.prototype[e]=function(t,r){return this.request(a(r||{},{method:e,url:t,data:(r||{}).data}))}})),n.forEach(["post","put","patch"],(function(e){c.prototype[e]=function(t,r,n){return this.request(a(n||{},{method:e,url:t,data:r}))}})),e.exports=c},function(e,t,r){"use strict";var n=r(0);function o(){this.handlers=[]}o.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},o.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},o.prototype.forEach=function(e){n.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=o},function(e,t,r){"use strict";var n=r(0),o=r(27),s=r(9),i=r(10);function a(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return a(e),e.headers=e.headers||{},e.data=o(e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||i.adapter)(e).then((function(t){return a(e),t.data=o(t.data,t.headers,e.transformResponse),t}),(function(t){return s(t)||(a(e),t&&t.response&&(t.response.data=o(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},function(e,t,r){"use strict";var n=r(0);e.exports=function(e,t,r){return n.forEach(r,(function(r){e=r(e,t)})),e}},function(e,t){var r,n,o=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(e){if(r===setTimeout)return setTimeout(e,0);if((r===s||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:s}catch(e){r=s}try{n="function"==typeof clearTimeout?clearTimeout:i}catch(e){n=i}}();var c,u=[],l=!1,d=-1;function f(){l&&c&&(l=!1,c.length?u=c.concat(u):d=-1,u.length&&p())}function p(){if(!l){var e=a(f);l=!0;for(var t=u.length;t;){for(c=u,u=[];++d<t;)c&&c[d].run();d=-1,t=u.length}c=null,l=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===i||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function E(e,t){this.fun=e,this.array=t}function h(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new E(e,t)),1!==u.length||l||a(p)},E.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=h,o.addListener=h,o.once=h,o.off=h,o.removeListener=h,o.removeAllListeners=h,o.emit=h,o.prependListener=h,o.prependOnceListener=h,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,r){"use strict";var n=r(0);e.exports=function(e,t){n.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))}},function(e,t,r){"use strict";var n=r(12);e.exports=function(e,t,r){var o=r.config.validateStatus;r.status&&o&&!o(r.status)?t(n("Request failed with status code "+r.status,r.config,null,r.request,r)):e(r)}},function(e,t,r){"use strict";e.exports=function(e,t,r,n,o){return e.config=t,r&&(e.code=r),e.request=n,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},function(e,t,r){"use strict";var n=r(0);e.exports=n.isStandardBrowserEnv()?{write:function(e,t,r,o,s,i){var a=[];a.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),n.isString(o)&&a.push("path="+o),n.isString(s)&&a.push("domain="+s),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(e,t,r){"use strict";var n=r(34),o=r(35);e.exports=function(e,t){return e&&!n(t)?o(e,t):t}},function(e,t,r){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t,r){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,r){"use strict";var n=r(0),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,r,s,i={};return e?(n.forEach(e.split("\n"),(function(e){if(s=e.indexOf(":"),t=n.trim(e.substr(0,s)).toLowerCase(),r=n.trim(e.substr(s+1)),t){if(i[t]&&o.indexOf(t)>=0)return;i[t]="set-cookie"===t?(i[t]?i[t]:[]).concat([r]):i[t]?i[t]+", "+r:r}})),i):i}},function(e,t,r){"use strict";var n=r(0);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function o(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=o(window.location.href),function(t){var r=n.isString(t)?o(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},function(e,t,r){"use strict";var n=r(14);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;e((function(e){r.reason||(r.reason=new n(e),t(r.reason))}))}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var e;return{token:new o((function(t){e=t})),cancel:e}},e.exports=o},function(e,t,r){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,r){"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}},function(e,t,r){"use strict";e.exports=r(3),r(43),r(44),r(45),r(46),r(48)},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){"use strict";var n=r(3);e.exports=n,n.prototype.done=function(e,t){var r=arguments.length?this.then.apply(this,arguments):this;r.then(null,(function(e){setTimeout((function(){throw e}),0)}))}},function(e,t,r){"use strict";var n=r(3);e.exports=n,n.prototype.finally=function(e){return this.then((function(t){return n.resolve(e()).then((function(){return t}))}),(function(t){return n.resolve(e()).then((function(){throw t}))}))}},function(e,t,r){"use strict";var n=r(3);e.exports=n;var o=l(!0),s=l(!1),i=l(null),a=l(void 0),c=l(0),u=l("");function l(e){var t=new n(n._0);return t._V=1,t._W=e,t}n.resolve=function(e){if(e instanceof n)return e;if(null===e)return i;if(void 0===e)return a;if(!0===e)return o;if(!1===e)return s;if(0===e)return c;if(""===e)return u;if("object"==typeof e||"function"==typeof e)try{var t=e.then;if("function"==typeof t)return new n(t.bind(e))}catch(e){return new n((function(t,r){r(e)}))}return l(e)};var d=function(e){return"function"==typeof Array.from?(d=Array.from,Array.from(e)):(d=function(e){return Array.prototype.slice.call(e)},Array.prototype.slice.call(e))};n.all=function(e){var t=d(e);return new n((function(e,r){if(0===t.length)return e([]);var o=t.length;function s(i,a){if(a&&("object"==typeof a||"function"==typeof a)){if(a instanceof n&&a.then===n.prototype.then){for(;3===a._V;)a=a._W;return 1===a._V?s(i,a._W):(2===a._V&&r(a._W),void a.then((function(e){s(i,e)}),r))}var c=a.then;if("function"==typeof c)return void new n(c.bind(a)).then((function(e){s(i,e)}),r)}t[i]=a,0==--o&&e(t)}for(var i=0;i<t.length;i++)s(i,t[i])}))},n.reject=function(e){return new n((function(t,r){r(e)}))},n.race=function(e){return new n((function(t,r){d(e).forEach((function(e){n.resolve(e).then(t,r)}))}))},n.prototype.catch=function(e){return this.then(null,e)}},function(e,t,r){"use strict";var n=r(3),o=r(47);e.exports=n,n.denodeify=function(e,t){return"number"==typeof t&&t!==1/0?function(e,t){for(var r=[],o=0;o<t;o++)r.push("a"+o);var i=["return function ("+r.join(",")+") {","var self = this;","return new Promise(function (rs, rj) {","var res = fn.call(",["self"].concat(r).concat([s]).join(","),");","if (res &&",'(typeof res === "object" || typeof res === "function") &&','typeof res.then === "function"',") {rs(res);}","});","};"].join("");return Function(["Promise","fn"],i)(n,e)}(e,t):function(e){for(var t=Math.max(e.length-1,3),r=[],o=0;o<t;o++)r.push("a"+o);var i=["return function ("+r.join(",")+") {","var self = this;","var args;","var argLength = arguments.length;","if (arguments.length > "+t+") {","args = new Array(arguments.length + 1);","for (var i = 0; i < arguments.length; i++) {","args[i] = arguments[i];","}","}","return new Promise(function (rs, rj) {","var cb = "+s+";","var res;","switch (argLength) {",r.concat(["extra"]).map((function(e,t){return"case "+t+":res = fn.call("+["self"].concat(r.slice(0,t)).concat("cb").join(",")+");break;"})).join(""),"default:","args[argLength] = cb;","res = fn.apply(self, args);","}","if (res &&",'(typeof res === "object" || typeof res === "function") &&','typeof res.then === "function"',") {rs(res);}","});","};"].join("");return Function(["Promise","fn"],i)(n,e)}(e)};var s="function (err, res) {if (err) { rj(err); } else { rs(res); }}";n.nodeify=function(e){return function(){var t=Array.prototype.slice.call(arguments),r="function"==typeof t[t.length-1]?t.pop():null,s=this;try{return e.apply(this,arguments).nodeify(r,s)}catch(e){if(null==r)return new n((function(t,r){r(e)}));o((function(){r.call(s,e)}))}}},n.prototype.nodeify=function(e,t){if("function"!=typeof e)return this;this.then((function(r){o((function(){e.call(t,null,r)}))}),(function(r){o((function(){e.call(t,r)}))}))}},function(e,t,r){"use strict";var n=r(16),o=[],s=[],i=n.makeRequestCallFromTimer((function(){if(s.length)throw s.shift()}));function a(e){var t;(t=o.length?o.pop():new c).task=e,n(t)}function c(){this.task=null}e.exports=a,c.prototype.call=function(){try{this.task.call()}catch(e){a.onerror?a.onerror(e):(s.push(e),i())}finally{this.task=null,o[o.length]=this}}},function(e,t,r){"use strict";var n=r(3);e.exports=n,n.enableSynchronous=function(){n.prototype.isPending=function(){return 0==this.getState()},n.prototype.isFulfilled=function(){return 1==this.getState()},n.prototype.isRejected=function(){return 2==this.getState()},n.prototype.getValue=function(){if(3===this._V)return this._W.getValue();if(!this.isFulfilled())throw new Error("Cannot get a value of an unfulfilled promise.");return this._W},n.prototype.getReason=function(){if(3===this._V)return this._W.getReason();if(!this.isRejected())throw new Error("Cannot get a rejection reason of a non-rejected promise.");return this._W},n.prototype.getState=function(){return 3===this._V?this._W.getState():-1===this._V||-2===this._V?0:this._V}},n.disableSynchronous=function(){n.prototype.isPending=void 0,n.prototype.isFulfilled=void 0,n.prototype.isRejected=void 0,n.prototype.getValue=void 0,n.prototype.getReason=void 0,n.prototype.getState=void 0}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5),o=r(2);class s extends n.NetworkTestError{constructor(e,t){super(e,t||o.ErrorNames.CONNECTIVITY_ERROR)}}t.ConnectivityError=s;t.APIConnectivityError=class extends s{constructor(){super("Failed to connect to OpenTOK API Server",o.ErrorNames.API_CONNECTIVITY_ERROR)}};class i extends s{constructor(e,t){super(e||"Failed to connect to the session due to a network error.",t||o.ErrorNames.CONNECT_TO_SESSION_ERROR)}}t.ConnectToSessionError=i;t.ConnectToSessionTokenError=class extends i{constructor(){super("Failed to connect to the session due to an invalid token.",o.ErrorNames.CONNECT_TO_SESSION_TOKEN_ERROR)}};t.ConnectToSessionSessionIdError=class extends i{constructor(){super("Failed to connect to the session due to an invalid session ID.",o.ErrorNames.CONNECT_TO_SESSION_ID_ERROR)}};t.ConnectToSessionNetworkError=class extends i{constructor(){super("Failed to connect to the session due to a network error.",o.ErrorNames.CONNECT_TO_SESSION_NETWORK_ERROR)}};class a extends s{constructor(e,t){super(e||"OpenTok failed to find media devices for this browser.",t||o.ErrorNames.MEDIA_DEVICE_ERROR)}}t.MediaDeviceError=a;t.FailedToObtainMediaDevices=class extends a{constructor(){super("Failed to obtain media devices.",o.ErrorNames.FAILED_TO_OBTAIN_MEDIA_DEVICES)}};t.NoVideoCaptureDevicesError=class extends a{constructor(){super("This browser has no video capture devices",o.ErrorNames.NO_VIDEO_CAPTURE_DEVICES)}};t.NoAudioCaptureDevicesError=class extends a{constructor(){super("This browser has no audio capture devices.",o.ErrorNames.NO_AUDIO_CAPTURE_DEVICES)}};class c extends s{constructor(e,t){super(e||"Encountered an unknown error while attempting to publish to a session.",t||o.ErrorNames.PUBLISH_TO_SESSION_ERROR)}}t.PublishToSessionError=c;t.FailedMessagingServerTestError=class extends c{constructor(){super("Failed to connect to media server due to messaging server connection failure",o.ErrorNames.FAILED_MESSAGING_SERVER_TEST)}};t.FailedToCreateLocalPublisher=class extends c{constructor(){super("Failed to create a local publisher object.",o.ErrorNames.FAILED_TO_CREATE_LOCAL_PUBLISHER)}};t.PublishToSessionNotConnectedError=class extends c{constructor(){super("Precall failed to publish to the session because it was not connected.",o.ErrorNames.PUBLISH_TO_SESSION_NOT_CONNECTED)}};t.PublishToSessionPermissionOrTimeoutError=class extends c{constructor(){super("Precall failed to publish to the session due a permissions error or timeout.",o.ErrorNames.PUBLISH_TO_SESSION_PERMISSION_OR_TIMEOUT_ERROR)}};t.PublishToSessionNetworkError=class extends c{constructor(){super("Precall failed to publish to the session due a network error.",o.ErrorNames.PUBLISH_TO_SESSION_NETWORK_ERROR)}};t.SubscribeToSessionError=class extends s{constructor(e){super(e||"Encountered an unknown error while attempting to subscribe to a session.",o.ErrorNames.SUBSCRIBE_TO_SESSION_ERROR)}};t.LoggingServerConnectionError=class extends s{constructor(){super("Failed to connect to the OpenTok logging server.",o.ErrorNames.LOGGING_SERVER_CONNECTION_ERROR)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(2);var o;!function(e){e.Api="api",e.Messaging="messaging",e.OpentokJs="OpenTok.js",e.Media="media",e.Logging="logging",e.ConnectivityError="OpenTok.js"}(o=t.FailureType||(t.FailureType={}));const s=e=>({error:e,type:(()=>{switch(e.name){case n.ErrorNames.API_CONNECTIVITY_ERROR:case n.ErrorNames.CONNECT_TO_SESSION_NETWORK_ERROR:return o.Api;case n.ErrorNames.CONNECT_TO_SESSION_ERROR:case n.ErrorNames.CONNECT_TO_SESSION_TOKEN_ERROR:case n.ErrorNames.CONNECT_TO_SESSION_ID_ERROR:return o.Messaging;case n.ErrorNames.MEDIA_DEVICE_ERROR:case n.ErrorNames.FAILED_TO_OBTAIN_MEDIA_DEVICES:case n.ErrorNames.NO_VIDEO_CAPTURE_DEVICES:case n.ErrorNames.NO_AUDIO_CAPTURE_DEVICES:case n.ErrorNames.FAILED_TO_CREATE_LOCAL_PUBLISHER:case n.ErrorNames.PUBLISH_TO_SESSION_NOT_CONNECTED:case n.ErrorNames.PUBLISH_TO_SESSION_PERMISSION_OR_TIMEOUT_ERROR:case n.ErrorNames.PUBLISH_TO_SESSION_NETWORK_ERROR:return o.OpentokJs;case n.ErrorNames.PUBLISH_TO_SESSION_ERROR:case n.ErrorNames.SUBSCRIBE_TO_SESSION_ERROR:case n.ErrorNames.FAILED_MESSAGING_SERVER_TEST:return o.Media;case n.ErrorNames.LOGGING_SERVER_CONNECTION_ERROR:return o.Logging;default:return o.OpentokJs}})()});t.mapErrors=(...e)=>e.map(s)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(15),o=r(1),s=r(52),i=r(2),a=r(53),c=r(19),u=r(4),l=r(58);let d,f,p,E=!1,h=!1,_=!1;function S(e,t){return r=>new n((o,a)=>{const c=document.createElement("div");c.style.position="fixed",c.style.bottom="-1px",c.style.width="1px",c.style.height="1px",c.style.opacity="0",document.body.appendChild(c),function(e){return new n((t,r)=>{e.getDevices((e,n=[])=>{if(e)r(new s.FailedToObtainMediaDevices);else{const e=n.reduce((e,t)=>{const r="audioInput"===t.kind?"audio":"video";return Object.assign({},e,{[r]:Object.assign({},e[r],{[t.deviceId]:t})})},{audio:{},video:{}});Object.keys(e.audio).length?t(e):r(new s.NoAudioCaptureDevicesError)}})})}(e).then(n=>{Object.keys(n.video).length||(E=!0);const u={resolution:"1280x720",width:"100%",height:"100%",insertMode:"append",showControls:!1};t&&t.audioSource&&(u.audioSource=t.audioSource),t&&t.videoSource&&(u.videoSource=t.videoSource),E&&(u.videoSource=null);const l=e.initPublisher(c,u,e=>{e?a(new s.InitPublisherError(e.message)):r.publish(l,e=>{if(e)return i.errorHasName(e,i.OTErrorType.NOT_CONNECTED)?a(new s.PublishToSessionNotConnectedError):i.errorHasName(e,i.OTErrorType.UNABLE_TO_PUBLISH)?a(new s.PublishToSessionPermissionOrTimeoutError):a(new s.PublishToSessionError)})});l.on("streamCreated",e=>{const t=r.subscribe(e.stream,c,{testNetwork:!0,insertMode:"append"},e=>e?a(new s.SubscribeToSessionError(e.message)):o({publisher:l,subscriber:t}))})}).catch(a)})}function O(e,t,r,o){return new n((a,c)=>{(function(e,t){return new n((r,n)=>{e.connection?r(e):e.connect(t,t=>{t&&(i.errorHasName(t,i.OTErrorType.OT_AUTHENTICATION_ERROR)?n(new s.ConnectToSessionTokenError):i.errorHasName(t,i.OTErrorType.OT_INVALID_SESSION_ID)?n(new s.ConnectToSessionSessionIdError):i.errorHasName(t,i.OTErrorType.OT_CONNECT_FAILED)?n(new s.ConnectToSessionNetworkError):n(new s.ConnectToSessionError)),r(e)})})})(t,r.token).then(S(e,o)).then(a).catch(c)})}function m(e,t,r,i,l,S){let T;return new n((g,N)=>{O(e,t,r,i).then(({publisher:O,subscriber:v})=>{if(v)try{const s=Object.assign({state:new c.default(S)},{subscriber:v},{credentials:r}),N=(e,t)=>{var r;t&&l&&l((r=t,Object.assign({},r,{phase:E?"audio-only":"audio-video"})))},y=()=>{const a=function(e){const t=["bitrate","packetLossRatio","supported","reason","mos"];return e.state.stats.audio.mos=e.state.audioQualityScore(),e.state.stats.video.mos=e.state.videoQualityScore(),e.state.stats.audio.mos>=u.default.qualityThresholds.audio[0].minMos?e.state.stats.audio.supported=!0:(e.state.stats.audio.supported=!1,e.state.stats.audio.reason=u.default.strings.bandwidthLow),{audio:o.pick(t,e.state.stats.audio),video:o.pick(t.concat(["frameRate","recommendedResolution","recommendedFrameRate"]),e.state.stats.video)}}(s);if(E||(c=a).audio.mos&&c.audio.mos>=u.default.qualityThresholds.audio[0].minMos||_)t.on("sessionDisconnected",()=>{g(a),t.off()}),function(e,t){return new n((r,n)=>{t.on("destroyed",()=>{r()}),t||r(),e.unsubscribe(t)})}(t,v).then(()=>function(e){return new n((t,r)=>{e.on("destroyed",()=>{t()}),e||t(),e.destroy()})}(O)).then(()=>t.disconnect());else{E=!0;const n=a.video;m(e,t,r,i,l,!0).then(e=>{e.video=n,g(e)})}var c};f=()=>{y()};const R=e=>{clearTimeout(T),y()};a.default(s.state,v,O,N,R),T=window.setTimeout(y,d+1),window.clearTimeout(p),p=window.setTimeout(()=>{h=!0,_&&f&&f()},5e3)}catch(e){N(new s.SubscriberGetStatsError)}else N(new s.MissingSubscriberError)}).catch(N)})}t.testQuality=function(e,t,r,o,i){return h=!1,_=!1,new n((a,c)=>{E=!(!o||!o.audioOnly),d=E?u.default.getStatsAudioOnlyDuration:u.default.getStatsVideoAndAudioTestDuration,o&&o.timeout&&(d=Math.min(d,o.timeout,3e4));const p=e=>{f=void 0,r.logEvent({action:"testQuality",variation:"Success"}),a(e)},h=e=>{f=void 0,r.logEvent({action:"testQuality",variation:"Failure"}),c(e)};new n((e,t)=>{const{supported:r,browser:n}=l.default();return r?e():t(new s.UnsupportedBrowserError(n))}).then(()=>{let r={};o&&o.initSessionOptions&&(r=o.initSessionOptions),o&&o.proxyServerUrl&&(e.hasOwnProperty("setProxyUrl")||(r.proxyUrl=o.proxyServerUrl));const n=e.initSession(t.apiKey,t.sessionId,r);m(e,n,t,o,i).then(p).catch(h)}).catch(h)})},t.stopQualityTest=function(){_=!0,h&&f&&f()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5),o=r(2);class s extends n.NetworkTestError{constructor(e,t){super(e,t||o.ErrorNames.QUALITY_TEST_ERROR)}}t.QualityTestError=s;t.UnsupportedBrowserError=class extends s{constructor(e){super(`Your current browser (${e}) does not support the audio-video quality test. Please run the test in a supported browser.`,o.ErrorNames.UNSUPPORTED_BROWSER)}};class i extends s{constructor(e,t){super(e||"Failed to connect to the session due to a network error.",t||o.ErrorNames.CONNECT_TO_SESSION_ERROR)}}t.ConnectToSessionError=i;t.ConnectToSessionTokenError=class extends i{constructor(){super("Failed to connect to the session due to an invalid token.",o.ErrorNames.CONNECT_TO_SESSION_TOKEN_ERROR)}};t.ConnectToSessionSessionIdError=class extends i{constructor(){super("Failed to connect to the session due to an invalid session ID.",o.ErrorNames.CONNECT_TO_SESSION_ID_ERROR)}};t.ConnectToSessionNetworkError=class extends i{constructor(){super("Failed to connect to the session due to a network error.",o.ErrorNames.CONNECT_TO_SESSION_NETWORK_ERROR)}};t.MediaDeviceError=class extends s{constructor(e,t){super(e||"OpenTok failed to find media devices for this browser.",t||o.ErrorNames.MEDIA_DEVICE_ERROR)}};t.FailedToObtainMediaDevices=class extends s{constructor(){super("Failed to obtain media devices.",o.ErrorNames.FAILED_TO_OBTAIN_MEDIA_DEVICES)}};t.NoVideoCaptureDevicesError=class extends s{constructor(){super("This browser has no video capture devices",o.ErrorNames.NO_VIDEO_CAPTURE_DEVICES)}};t.NoAudioCaptureDevicesError=class extends s{constructor(){super("This browser has no audio capture devices.",o.ErrorNames.NO_AUDIO_CAPTURE_DEVICES)}};class a extends s{constructor(e,t){super(e||"Encountered an unknown error while attempting to publish to a session.",t||o.ErrorNames.PUBLISH_TO_SESSION_ERROR)}}t.PublishToSessionError=a;t.InitPublisherError=class extends a{constructor(e){super(e||"Failed to initialize publisher.",o.ErrorNames.INIT_PUBLISHER_ERROR)}};t.PublishToSessionNotConnectedError=class extends a{constructor(){super("Precall failed to publish to the session because it was not connected.",o.ErrorNames.PUBLISH_TO_SESSION_NOT_CONNECTED)}};t.PublishToSessionPermissionOrTimeoutError=class extends a{constructor(){super("Precall failed to publish to the session due a permissions error or timeout.",o.ErrorNames.PUBLISH_TO_SESSION_PERMISSION_OR_TIMEOUT_ERROR)}};class c extends s{constructor(e,t){super(e||"Encountered an unknown error while attempting to publish to a session.",t||o.ErrorNames.SUBSCRIBE_TO_SESSION_ERROR)}}t.SubscribeToSessionError=c;t.SubscriberGetStatsError=class extends c{constructor(){super("Failed to get network stats for a subscriber.",o.ErrorNames.SUBSCRIBER_GET_STATS_ERROR)}};t.MissingSubscriberError=class extends c{constructor(){super("Call checkSubscribeToSession before calling checkSubscriberQuality.",o.ErrorNames.MISSING_SUBSCRIBER_ERROR)}}},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,s){function i(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){e.done?o(e.value):new r((function(t){t(e.value)})).then(i,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const o=r(54),s=r(55),i=r(19),a=r(1),c=r(57),u=e=>a.getOr(0,"packetsLost",e),l=e=>u(e)+(e=>a.getOr(0,"packetsReceived",e))(e);function d(e,t,r){const n=()=>1e3*(()=>{if(t){const{rtcStatsReport:e}=t[0];let r=0;e.forEach(e=>{"remote-inbound-rtp"===e.type&&"audio"===e.kind&&(r=isNaN(e.roundTripTime)?0:e.roundTripTime)})}return 0})()/2||150,o=a.last(r),s=a.nth(-2,r);if(!o||!s||!e.stream)return 1;const i=(d=s,l(o[c="audio"])-l(d[c]));var c,d;if(0===i)return 1;let f=(u(o.audio)-u(s.audio))/i;return f<0&&(f=0),(e=>{const t=n();return(r=(()=>{const r=t+30;return 93.2-(.024*r+.11*(r-177.3)*(r-177.3<0?0:1))-(0+19.8*Math.log(1+29.7*e))})())<0?1:r>100?4.5:1+.035*r+r*(r-60)*(100-r)*7e-6;var r})(f)}t.default=function(e,t,r,u,l){return e.intervalId=window.setInterval(()=>{t.getStats((i,f)=>n(this,void 0,void 0,(function*(){if(!f)return null;let n=null;try{n=yield c.default(r)}catch(e){}if(f.audio.bytesReceived<0||a.getOr(1,"video.bytesReceived",f)<0)return e.clearInterval(),l(e);if(f&&e.statsLog.push(f),u&&"function"==typeof u&&u(i,f),e.statsLog.length<2)return null;e.stats=s.default(e);const p=function(e,t){const r=a.last(t),n=a.nth(-2,t);if(!r||!n||!e.stream)return 1;const o=((e,t,r)=>{const n=t.timestamp-r.timestamp;return t[e]&&t[e].bytesReceived?8*(t[e].bytesReceived-r[e].bytesReceived)/(n/1e3):0})("video",r,n),s=(e=>{const t=2.069924867*Math.pow(Math.log10(e),.6250223771);return Math.pow(10,t)})(e.stream.videoDimensions.width*e.stream.videoDimensions.height);if(o<3e4)return 1;const i=Math.min(o,s);let c=Math.log(i/3e4)/Math.log(s/3e4)*4+1;return c=Math.min(c,4.5),c}(t,e.statsLog);e.videoScoresLog.push(p);const E=d(t,n,e.statsLog);return e.audioScoresLog.push(E),e.pruneScores(),o.default(e.statsLog)?(e.clearInterval(),l(e)):null})))},i.default.scoreInterval),t.on("destroyed",e.clearInterval.bind(e)),e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(17),o=r(18),s=r(4);t.default=function(e){const t=n.default(e),r=s.default.steadyStateAllowedDelta;let i=!0;if(t.length<s.default.minimumVideoAndAudioTestSampleSize)return!1;const a=o.default(t);return["video","audio"].forEach(e=>{for(let t=1;t<a[e].length;t+=1){const n=a[e][t].averageBitrate,o=a[e][t-1].averageBitrate;n-o>o*r&&(i=!1)}}),i}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(17),o=r(18),s=r(56),i=r(4),a=r(1);function c(e,t){let r=0,n=0,o=0;t.forEach(t=>{r+=t.averageBitrate,n+=t.packetLossRatio,"video"===e&&(o+=Number(a.getOr(0,"frameRate",t)))});const i={bitrate:r/t.length,packetLossRatio:n/t.length};if("video"===e){const{supported:r,reason:n,recommendedResolution:a,recommendedFrameRate:c}=s.default(i),u="video"===e?{recommendedResolution:a,recommendedFrameRate:c,frameRate:o/t.length}:{};return Object.assign({},i,{supported:r,reason:n},u)}return Object.assign({},i)}t.default=function(e){const t=n.default(e.statsLog),r=o.default(t);return{audio:e.hasAudioTrack()?c("audio",r.audio):{supported:!1,reason:i.default.strings.noMic},video:e.audioOnlyFallback?{supported:!1,reason:i.default.strings.bandwidthLow}:e.hasVideoTrack()?c("video",r.video):{supported:!1,reason:i.default.strings.noCam}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4),o=r(1);t.default=function(e){const t=n.default.qualityThresholds.video,r=e.bitrate,s=e.packetLossRatio;let i,a=!1,c=30,u="";for(let e=0;e<t.length;e+=1){const n=t[e];if(r>=n.bps&&s<=n.plr){a=!0,i=o.get("recommendedSetting",n),c=Number(i.substring(i.indexOf("@")+1).replace("FPS","")),u=i.substring(0,i.indexOf("@")-1);break}}const l={supported:a,recommendedFrameRate:c,recommendedResolution:u};return a?(l.recommendedFrameRate=c,l.recommendedResolution=u):l.reason=n.default.strings.bandwidthLow,l}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=e=>new Promise(t=>{if("function"!=typeof e.getRtcStatsReport)return t(null);const r=e.getRtcStatsReport();r?r.then(t).catch(()=>t(null)):e.getRtcStatsReport((e,r)=>{t(r)})})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(1);t.default=function(){const e=function(){const e=window&&window.navigator;return"undefined"!=typeof window&&window.navigator?n.get("mozGetUserMedia",e)?"Firefox":n.get("webkitGetUserMedia",e)?window.hasOwnProperty("webkitRTCPeerConnection")?e.userAgent.match(/Edg/)?"Edge":e.userAgent.match(/Opera|OPR\//)?"Opera":"Chrome":e.userAgent.match(/Version\/(\d+).(\d+)/)?"Safari":"WebKit browser without WebRTC support":e.mediaDevices&&e.userAgent.match(/Edge\/(\d+).(\d+)$/)?"non-Chromium Edge":e.userAgent.indexOf("MSIE ")>0||e.userAgent.match(/Trident.*rv\:11\./)?"Internet Explorer":e.mediaDevices&&e.userAgent.match(/AppleWebKit\/(\d+)\./)?"Safari":"unsupported browser":"not a browser"}();return{browser:e,supported:["Chrome","Firefox","Safari","Edge","Opera"].indexOf(e)>-1}}},function(e,t,r){var n,o,s;var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};"function"==typeof Symbol&&Symbol.iterator;o=[r(6)],void 0===(s="function"==typeof(n=function(e){var t=!1,r=void 0,n=function(e){return function(e){if(t)return null;for(var r=e+"=",n=document.cookie.split(";"),o=void 0,s=0;s<n.length;s++){for(o=n[s];" "===o.charAt(0);)o=o.substring(1,o.length);if(0===o.indexOf(r))return o.substring(r.length,o.length)}return null}(e)||function(e,r,n){if(t)return r;var o="",s=void 0;n&&((s=new Date).setTime(s.getTime()+24*n*60*60*1e3),o=["; expires=",s.toGMTString()].join(""));var i=[e,"=",r,o,"; path=/"].join("");return document.cookie=i,r}(e,function(){for(var e=[],t="0123456789abcdef",r=0;r<36;r++)e.push(t.substr(Math.floor(16*Math.random()),1));return e[14]="4",e[19]=t.substr(3&e[19]|8,1),e[8]=e[13]=e[18]=e[23]="-",e.join("")}(),7)},o=function(n){var o=function(e){if(!e.clientVersion)throw console.log("Error. The clientVersion field cannot be null in the log entry"),new Error("The clientVersion field cannot be null in the log entry");if(!e.source)throw console.log("Error. The source field cannot be null in the log entry"),new Error("The source field cannot be null in the log entry");if(!e.componentId)throw console.log("Error. The componentId field cannot be null in the log entry"),new Error("The componentId field cannot be null in the log entry");if(!e.name)throw console.log("Error. The name field cannot be null in the log entry"),new Error("The guid field cannot be null in the log entry");var t=e.logVersion||"2",r=e.clientSystemTime||(new Date).getTime();return a({},e,{logVersion:t,clientSystemTime:r})}(n);if(t)e.post(r,o);else{var s=new XMLHttpRequest;s.open("POST",r,!0),s.setRequestHeader("Content-type","application/json"),s.send(JSON.stringify(o))}};return function(){function e(o,s){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.analyticsData=o,t=s&&s.server;var i="hlg.tokbox.com/prod/logging/ClientEvent";r=s&&s.proxyUrl&&s.proxyUrl+"/"+i||"https://"+i,this.analyticsData.guid=n(o.name)}return i(e,[{key:"addSessionInfo",value:function(e){if(!e.sessionId)throw console.log("Error. The sessionId field cannot be null in the log entry"),new Error("The sessionId field cannot be null in the log entry");if(this.analyticsData.sessionId=e.sessionId,!e.connectionId)throw console.log("Error. The connectionId field cannot be null in the log entry"),new Error("The connectionId field cannot be null in the log entry");if(this.analyticsData.connectionId=e.connectionId,0===e.partnerId)throw console.log("Error. The partnerId field cannot be null in the log entry"),new Error("The partnerId field cannot be null in the log entry");this.analyticsData.partnerId=e.partnerId}},{key:"logEvent",value:function(e){this.analyticsData=a({},this.analyticsData,e,{clientSystemTime:(new Date).getTime()}),o(this.analyticsData)}}]),e}()})?n.apply(t,o):n)||(e.exports=s)}])}));
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("OpenTokNetworkConnectivity",[],t):"object"==typeof exports?exports.OpenTokNetworkConnectivity=t():e.OpenTokNetworkConnectivity=t()}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=20)}([function(e,t,r){"use strict";var n=r(7),o=Object.prototype.toString;function s(e){return"[object Array]"===o.call(e)}function i(e){return void 0===e}function a(e){return null!==e&&"object"==typeof e}function c(e){if("[object Object]"!==o.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function u(e){return"[object Function]"===o.call(e)}function l(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),s(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}e.exports={isArray:s,isArrayBuffer:function(e){return"[object ArrayBuffer]"===o.call(e)},isBuffer:function(e){return null!==e&&!i(e)&&null!==e.constructor&&!i(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:a,isPlainObject:c,isUndefined:i,isDate:function(e){return"[object Date]"===o.call(e)},isFile:function(e){return"[object File]"===o.call(e)},isBlob:function(e){return"[object Blob]"===o.call(e)},isFunction:u,isStream:function(e){return a(e)&&u(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:l,merge:function e(){var t={};function r(r,n){c(t[n])&&c(r)?t[n]=e(t[n],r):c(r)?t[n]=e({},r):s(r)?t[n]=r.slice():t[n]=r}for(var n=0,o=arguments.length;n<o;n++)l(arguments[n],r);return t},extend:function(e,t,r){return l(t,(function(t,o){e[o]=r&&"function"==typeof t?n(t,r):t})),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assoc=(e,t,r)=>Object.assign({},r,{[e]:t}),t.assocPath=(e,r,n)=>{const o=e.split("."),s=o[0];if(!o.length)return n;if(1===o.length)return t.assoc(s,r,n);const i=t.get(s,n),a=i&&"object"==typeof i?i:Object.assign({},n,{[s]:{}}),c=t.assoc(s,t.assocPath(o.slice(1).join("."),r,t.get(s,a)),n);return Object.assign({},n,c)},t.get=(e,r)=>{if(!r)return r;const[n,...o]=e.split("."),s=r[n];return null==s?s:o.length?t.get(o.join("."),s):s},t.getOr=(e,r,n)=>t.get(r,n)||e,t.pick=(e,t,r=!1)=>e.reduce((e,n)=>void 0!==t[n]||r?Object.assign({},e,{[n]:t[n]}):e,{}),t.pickAll=(e,r)=>t.pick(e,r,!0),t.last=e=>e[e.length-1],t.nth=(e,t)=>e<0?t[t.length+e]:t[e],t.head=e=>t.nth(0,e)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(1);!function(e){e.NETWORK_TEST_ERROR="NetworkTestError",e.MISSING_OPENTOK_INSTANCE="MissingOpenTokInstanceError",e.INCOMPLETE_SESSON_CREDENTIALS="IncompleteSessionCredentialsError",e.MISSING_SESSON_CREDENTIALS="MissingSessionCredentialsError",e.INVALID_ON_UPDATE_CALLBACK="InvalidOnUpdateCallback",e.CONNECTIVITY_ERROR="ConnectivityError",e.API_CONNECTIVITY_ERROR="APIConnectivityError",e.CONNECT_TO_SESSION_ERROR="ConnectToSessionError",e.CONNECT_TO_SESSION_TOKEN_ERROR="ConnectToSessionTokenError",e.CONNECT_TO_SESSION_ID_ERROR="ConnectToSessionSessionIdError",e.CONNECT_TO_SESSION_NETWORK_ERROR="ConnectToSessionNetworkError",e.MEDIA_DEVICE_ERROR="MediaDeviceError",e.FAILED_TO_OBTAIN_MEDIA_DEVICES="FailedToObtainMediaDevices",e.NO_VIDEO_CAPTURE_DEVICES="NoVideoCaptureDevicesError",e.NO_AUDIO_CAPTURE_DEVICES="NoAudioCaptureDevicesError",e.PUBLISH_TO_SESSION_ERROR="PublishToSessionError",e.INIT_PUBLISHER_ERROR="InitPublisherError",e.FAILED_MESSAGING_SERVER_TEST="FailedMessagingServerTestError",e.FAILED_TO_CREATE_LOCAL_PUBLISHER="FailedToCreateLocalPublisher",e.PUBLISH_TO_SESSION_NOT_CONNECTED="PublishToSessionNotConnectedError",e.PUBLISH_TO_SESSION_PERMISSION_OR_TIMEOUT_ERROR="PublishToSessionPermissionOrTimeoutError",e.PUBLISH_TO_SESSION_NETWORK_ERROR="PublishToSessionNetworkError",e.SUBSCRIBE_TO_SESSION_ERROR="SubscribeToSessionError",e.LOGGING_SERVER_CONNECTION_ERROR="LoggingServerConnectionError",e.QUALITY_TEST_ERROR="QualityTestError",e.UNSUPPORTED_BROWSER="UnsupportedBrowser",e.SUBSCRIBER_GET_STATS_ERROR="SubscriberGetStatsError",e.MISSING_SUBSCRIBER_ERROR="MissingSubscriberError"}(t.ErrorNames||(t.ErrorNames={})),function(e){e.JS_EXCEPTION="JS_EXCEPTION",e.OT_AUTHENTICATION_ERROR="OT_AUTHENTICATION_ERROR",e.OT_INVALID_HTTP_STATUS="OT_INVALID_HTTP_STATUS",e.OT_CONNECT_FAILED="OT_CONNECT_FAILED",e.OT_INVALID_SESSION_ID="OT_INVALID_SESSION_ID",e.CONNECT_FAILED="CONNECT_FAILED",e.CONNECT_REJECTED="CONNECT_REJECTED",e.CONNECTION_TIMEOUT="CONNECTION_TIMEOUT",e.NOT_CONNECTED="NOT_CONNECTED",e.INVALID_PARAMETER="INVALID_PARAMETER",e.P2P_CONNECTION_FAILED="P2P_CONNECTION_FAILED",e.API_RESPONSE_FAILURE="API_RESPONSE_FAILURE",e.TERMS_OF_SERVICE_FAILURE="TERMS_OF_SERVICE_FAILURE",e.CONNECTION_LIMIT_EXCEEDED="CONNECTION_LIMIT_EXCEEDED",e.UNABLE_TO_PUBLISH="UNABLE_TO_PUBLISH",e.UNABLE_TO_SUBSCRIBE="UNABLE_TO_SUBSCRIBE",e.UNSUPPORTED_VIDEO_CODEC="UNSUPPORTED_VIDEO_CODEC",e.UNABLE_TO_FORCE_DISCONNECT="UNABLE_TO_FORCE_DISCONNECT",e.UNABLE_TO_FORCE_UNPUBLISH="UNABLE_TO_FORCE_UNPUBLISH",e.PUBLISHER_ICE_WORKFLOW_FAILED="PUBLISHER_ICE_WORKFLOW_FAILED",e.SUBSCRIBER_ICE_WORKFLOW_FAILED="SUBSCRIBER_ICE_WORKFLOW_FAILED",e.STREAM_LIMIT_EXCEEDED="STREAM_LIMIT_EXCEEDED",e.UNEXPECTED_SERVER_RESPONSE="UNEXPECTED_SERVER_RESPONSE",e.REPORT_ISSUE_ERROR="REPORT_ISSUE_ERROR",e.ANVIL_BADLY_FORMED_RESPONSE="ANVIL_BADLY_FORMED_RESPONSE",e.ANVIL_INVALID_HTTP_STATUS="ANVIL_INVALID_HTTP_STATUS",e.ANVIL_XDOMAIN_OR_PARSING_ERROR="ANVIL_XDOMAIN_OR_PARSING_ERROR",e.ANVIL_UNKNOWN_HTTP_ERROR="ANVIL_UNKNOWN_HTTP_ERROR",e.ANVIL_UNEXPECTED_ERROR_CODE="ANVIL_UNEXPECTED_ERROR_CODE",e.ANVIL_EMPTY_RESPONSE_BODY="ANVIL_EMPTY_RESPONSE_BODY",e.ANVIL_CONNECT_FAILED="ANVIL_CONNECT_FAILED"}(t.OTErrorType||(t.OTErrorType={})),t.errorHasName=(e=null,t)=>n.get("name",e)===t},function(e,t,r){"use strict";var n=r(16);function o(){}var s=null,i={};function a(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("Promise constructor's argument is not a function");this._U=0,this._V=0,this._W=null,this._X=null,e!==o&&p(e,this)}function c(e,t){for(;3===e._V;)e=e._W;if(a._Y&&a._Y(e),0===e._V)return 0===e._U?(e._U=1,void(e._X=t)):1===e._U?(e._U=2,void(e._X=[e._X,t])):void e._X.push(t);!function(e,t){n((function(){var r=1===e._V?t.onFulfilled:t.onRejected;if(null!==r){var n=function(e,t){try{return e(t)}catch(e){return s=e,i}}(r,e._W);n===i?l(t.promise,s):u(t.promise,n)}else 1===e._V?u(t.promise,e._W):l(t.promise,e._W)}))}(e,t)}function u(e,t){if(t===e)return l(e,new TypeError("A promise cannot be resolved with itself."));if(t&&("object"==typeof t||"function"==typeof t)){var r=function(e){try{return e.then}catch(e){return s=e,i}}(t);if(r===i)return l(e,s);if(r===e.then&&t instanceof a)return e._V=3,e._W=t,void d(e);if("function"==typeof r)return void p(r.bind(t),e)}e._V=1,e._W=t,d(e)}function l(e,t){e._V=2,e._W=t,a._Z&&a._Z(e,t),d(e)}function d(e){if(1===e._U&&(c(e,e._X),e._X=null),2===e._U){for(var t=0;t<e._X.length;t++)c(e,e._X[t]);e._X=null}}function f(e,t,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=r}function p(e,t){var r=!1,n=function(e,t,r){try{e(t,r)}catch(e){return s=e,i}}(e,(function(e){r||(r=!0,u(t,e))}),(function(e){r||(r=!0,l(t,e))}));r||n!==i||(r=!0,l(t,s))}e.exports=a,a._Y=null,a._Z=null,a._0=o,a.prototype.then=function(e,t){if(this.constructor!==a)return function(e,t,r){return new e.constructor((function(n,s){var i=new a(o);i.then(n,s),c(e,new f(t,r,i))}))}(this,e,t);var r=new a(o);return c(this,new f(e,t,r)),r}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default={getStatsInterval:1e3,getStatsVideoAndAudioTestDuration:3e4,getStatsAudioOnlyDuration:1e4,subscribeOptions:{testNetwork:!0,audioVolume:0},minimumVideoAndAudioTestSampleSize:5,steadyStateSampleWindow:5e3,steadyStateAllowedDelta:.05,qualityThresholds:{video:[{bps:1e6,plr:.005,recommendedSetting:"1280x720 @ 30FPS"},{bps:6e5,plr:.005,recommendedSetting:"640x480 @ 30FPS"},{bps:3e5,plr:.005,recommendedSetting:"320x240 @ 30FPS"},{bps:35e4,plr:.03,recommendedSetting:"1280x720 @ 30FPS"},{bps:25e4,plr:.03,recommendedSetting:"640x480 @ 30FPS"},{bps:15e4,plr:.03,recommendedSetting:"320x240 @ 30FPS"}],audio:[{minMos:2.4}]},strings:{bandwidthLow:"Bandwidth too low.",noCam:"No camera was found.",noMic:"No microphone was found."}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(2);class o extends Error{constructor(e,t){super(e),this.name=t||n.ErrorNames.NETWORK_TEST_ERROR,this.stack=new Error(e).stack}}t.NetworkTestError=o;t.MissingOpenTokInstanceError=class extends o{constructor(){super("An instance of OT, the OpenTok.js client SDK, is required."),this.name=n.ErrorNames.MISSING_OPENTOK_INSTANCE}};t.IncompleteSessionCredentialsError=class extends o{constructor(){super("NetworkConnectivity requires an apiKey, sessionId, and token.",n.ErrorNames.INCOMPLETE_SESSON_CREDENTIALS)}};t.MissingSessionCredentialsError=class extends o{constructor(){super("NetworkConnectivity requires OpenTok session credentials.",n.ErrorNames.MISSING_SESSON_CREDENTIALS)}};t.InvalidOnUpdateCallback=class extends o{constructor(){super("The onUpdate callback must be a function that accepts a single parameter.",n.ErrorNames.INVALID_ON_UPDATE_CALLBACK)}}},function(e,t,r){e.exports=r(23)},function(e,t,r){"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}}},function(e,t,r){"use strict";var n=r(0);function o(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,r){if(!t)return e;var s;if(r)s=r(t);else if(n.isURLSearchParams(t))s=t.toString();else{var i=[];n.forEach(t,(function(e,t){null!=e&&(n.isArray(e)?t+="[]":e=[e],n.forEach(e,(function(e){n.isDate(e)?e=e.toISOString():n.isObject(e)&&(e=JSON.stringify(e)),i.push(o(t)+"="+o(e))})))})),s=i.join("&")}if(s){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}},function(e,t,r){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,r){"use strict";(function(t){var n=r(0),o=r(29),s={"Content-Type":"application/x-www-form-urlencoded"};function i(e,t){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var a,c={adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==t&&"[object process]"===Object.prototype.toString.call(t))&&(a=r(11)),a),transformRequest:[function(e,t){return o(t,"Accept"),o(t,"Content-Type"),n.isFormData(e)||n.isArrayBuffer(e)||n.isBuffer(e)||n.isStream(e)||n.isFile(e)||n.isBlob(e)?e:n.isArrayBufferView(e)?e.buffer:n.isURLSearchParams(e)?(i(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):n.isObject(e)?(i(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},n.forEach(["delete","get","head"],(function(e){c.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){c.headers[e]=n.merge(s)})),e.exports=c}).call(this,r(28))},function(e,t,r){"use strict";var n=r(0),o=r(30),s=r(32),i=r(8),a=r(33),c=r(36),u=r(37),l=r(12);e.exports=function(e){return new Promise((function(t,r){var d=e.data,f=e.headers;n.isFormData(d)&&delete f["Content-Type"];var p=new XMLHttpRequest;if(e.auth){var E=e.auth.username||"",h=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";f.Authorization="Basic "+btoa(E+":"+h)}var _=a(e.baseURL,e.url);if(p.open(e.method.toUpperCase(),i(_,e.params,e.paramsSerializer),!0),p.timeout=e.timeout,p.onreadystatechange=function(){if(p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in p?c(p.getAllResponseHeaders()):null,s={data:e.responseType&&"text"!==e.responseType?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:n,config:e,request:p};o(t,r,s),p=null}},p.onabort=function(){p&&(r(l("Request aborted",e,"ECONNABORTED",p)),p=null)},p.onerror=function(){r(l("Network Error",e,null,p)),p=null},p.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(l(t,e,"ECONNABORTED",p)),p=null},n.isStandardBrowserEnv()){var S=(e.withCredentials||u(_))&&e.xsrfCookieName?s.read(e.xsrfCookieName):void 0;S&&(f[e.xsrfHeaderName]=S)}if("setRequestHeader"in p&&n.forEach(f,(function(e,t){void 0===d&&"content-type"===t.toLowerCase()?delete f[t]:p.setRequestHeader(t,e)})),n.isUndefined(e.withCredentials)||(p.withCredentials=!!e.withCredentials),e.responseType)try{p.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&p.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&p.upload&&p.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){p&&(p.abort(),r(e),p=null)})),d||(d=null),p.send(d)}))}},function(e,t,r){"use strict";var n=r(31);e.exports=function(e,t,r,o,s){var i=new Error(e);return n(i,t,r,o,s)}},function(e,t,r){"use strict";var n=r(0);e.exports=function(e,t){t=t||{};var r={},o=["url","method","data"],s=["headers","auth","proxy","params"],i=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],a=["validateStatus"];function c(e,t){return n.isPlainObject(e)&&n.isPlainObject(t)?n.merge(e,t):n.isPlainObject(t)?n.merge({},t):n.isArray(t)?t.slice():t}function u(o){n.isUndefined(t[o])?n.isUndefined(e[o])||(r[o]=c(void 0,e[o])):r[o]=c(e[o],t[o])}n.forEach(o,(function(e){n.isUndefined(t[e])||(r[e]=c(void 0,t[e]))})),n.forEach(s,u),n.forEach(i,(function(o){n.isUndefined(t[o])?n.isUndefined(e[o])||(r[o]=c(void 0,e[o])):r[o]=c(void 0,t[o])})),n.forEach(a,(function(n){n in t?r[n]=c(e[n],t[n]):n in e&&(r[n]=c(void 0,e[n]))}));var l=o.concat(s).concat(i).concat(a),d=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===l.indexOf(e)}));return n.forEach(d,u),r}},function(e,t,r){"use strict";function n(e){this.message=e}n.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},n.prototype.__CANCEL__=!0,e.exports=n},function(e,t,r){"use strict";e.exports=r(41)},function(e,t,r){"use strict";(function(t){function r(e){o.length||(n(),!0),o[o.length]=e}e.exports=r;var n,o=[],s=0;function i(){for(;s<o.length;){var e=s;if(s+=1,o[e].call(),s>1024){for(var t=0,r=o.length-s;t<r;t++)o[t]=o[t+s];o.length-=s,s=0}}o.length=0,s=0,!1}var a,c,u,l=void 0!==t?t:self,d=l.MutationObserver||l.WebKitMutationObserver;function f(e){return function(){var t=setTimeout(n,0),r=setInterval(n,50);function n(){clearTimeout(t),clearInterval(r),e()}}}"function"==typeof d?(a=1,c=new d(i),u=document.createTextNode(""),c.observe(u,{characterData:!0}),n=function(){a=-a,u.data=a}):n=f(i),r.requestFlush=n,r.makeRequestCallFromTimer=f}).call(this,r(42))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4),o=r(1);t.default=function(e){const t=o.getOr(0,"timestamp",o.last(e))-n.default.steadyStateSampleWindow;return e.filter(e=>e.timestamp>=t)}},function(e,t,r){"use strict";function n(e,t){const r=[];for(let n=1;n<t.length;n+=1){const o=t[n],s=t[n-1];if(o[e]&&s[e]){const t=8*(o[e].bytesReceived?o[e].bytesReceived-s[e].bytesReceived:0)/((o.timestamp-s.timestamp)/1e3),n=o[e].packetsReceived,i=o[e].packetsLost,a=i+n;let c=0;a>0&&i>0&&(c=i/a);const u="video"===e?{frameRate:o[e].frameRate}:{};r.push(Object.assign({averageBitrate:t,packetLossRatio:c},u))}}return r}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(e.length<2)throw new Error("Cannot calculate bitrate with less than two data points.");return{audio:n("audio",e),video:n("video",e)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class n{constructor(e){this.stats={audio:{},video:{}},this.bandwidth={audio:0,video:0},this.hasAudioTrack=()=>this.statsLog[0]&&!!this.statsLog[0].audio,this.hasVideoTrack=()=>this.statsLog[0]&&!!this.statsLog[0].video,this.statsLog=[],this.audioScoresLog=[],this.videoScoresLog=[],this.audioOnlyFallback=!!e}audioScore(){return this.audioScoresLog.reduce((e,t)=>e+t,0)/this.audioScoresLog.length}videoScore(){return this.videoScoresLog.reduce((e,t)=>e+t,0)/this.videoScoresLog.length}clearInterval(){this.intervalId&&window.clearInterval(this.intervalId),this.intervalId=void 0}pruneAudioScores(){const e=this.audioScoresLog;for(;e.length>n.maxLogLength;)e.shift();this.audioScoresLog=e}pruneVideoScores(){const e=this.videoScoresLog;for(;e.length>n.maxLogLength;)e.shift();this.videoScoresLog=e}pruneScores(){this.pruneAudioScores(),this.pruneVideoScores()}audioQualityScore(){return this.hasAudioTrack()?this.audioScore():1}videoQualityScore(){return this.hasVideoTrack()?this.videoScore():1}}n.maxLogLength=1e3,n.scoreInterval=1e3,t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(21).version,o=r(22),s=r(51),i=r(5),a=r(59);t.default=class{constructor(e,t,r){this.validateOT(e),this.validateCredentials(t);const n=this.validateProxyUrl(r);this.otLogging=this.startLoggingEngine(t.apiKey,t.sessionId,n),this.OT=e,this.credentials=t,this.options=r,this.setProxyUrl(n)}validateOT(e){if(!e||"object"!=typeof e||!e.initSession)throw new i.MissingOpenTokInstanceError}validateCredentials(e){if(!e)throw new i.MissingSessionCredentialsError;if(!e.apiKey||!e.sessionId||!e.token)throw new i.IncompleteSessionCredentialsError}validateProxyUrl(e){return e&&e.proxyServerUrl?e.proxyServerUrl:""}setProxyUrl(e){this.OT.setProxyUrl&&"function"==typeof this.OT.setProxyUrl&&e&&this.OT.setProxyUrl(e)}startLoggingEngine(e,t,r){return new a({sessionId:t,partnerId:e,source:window.location.href,clientVersion:"js-network-test-"+n,name:"opentok-network-test",componentId:"opentok-network-test"},{proxyUrl:r})}testConnectivity(){return this.otLogging.logEvent({action:"testConnectivity",variation:"Attempt"}),o.testConnectivity(this.OT,this.credentials,this.otLogging,this.options)}testQuality(e){if(this.otLogging.logEvent({action:"testQuality",variation:"Attempt"}),e&&("function"!=typeof e||1!==e.length))throw this.otLogging.logEvent({action:"testQuality",variation:"Failure"}),new i.InvalidOnUpdateCallback;return s.testQuality(this.OT,this.credentials,this.otLogging,this.options,e)}stop(){s.stopQualityTest()}};var c=r(2);t.ErrorNames=c.ErrorNames},function(e){e.exports=JSON.parse('{"name":"opentok-network-test-js","version":"2.4.3","description":"Precall network test for applications using the OpenTok platform.","main":"dist/NetworkTest/index.js","types":"dist/NetworkTest/index.d.ts","scripts":{"build":"rm -rf dist && webpack --config webpack.config.js","test-setup":"node test/setup/setup.js","test-teardown":"rm test/credentials.json","karma":"karma start","test":"npm run test-setup && npm run karma && npm run test-teardown","example":"npm run build && cd sample && npm run build && python -m SimpleHTTPServer","tslint":"./node_modules/tslint/bin/tslint -p tsconfig.json"},"repository":{"type":"git","url":"git+https://github.com/opentok/opentok-network-test-js.git"},"keywords":["tokbox","opentok","network test","connectivity","webrtc"],"author":{"name":"TokBox","email":"contact@tokbox.com"},"license":"MIT","bugs":{"url":"https://github.com/opentok/network-connectivity-js/issues"},"homepage":"https://github.com/opentok/network-connectivity-js#readme","dependencies":{"axios":"^0.21.1","opentok-solutions-logging":"^1.1.1","promise":"^8.0.1"},"devDependencies":{"@opentok/client":"^2.18.0","@types/expect.js":"^0.3.29","@types/jasmine":"^2.8.8","@types/jasmine-matchers":"^0.2.30","@types/mocha":"^5.2.2","@types/node":"^10.3.2","@types/opentok":"^2.3.4","@types/promise":"^7.1.30","@types/webrtc":"0.0.22","dotenv":"^4.0.0","fs-extra":"^4.0.3","jasmine":"^2.99.0","jasmine-core":"^2.99.1","karma":"^5.1.1","karma-chrome-launcher":"^2.2.0","karma-cli":"^1.0.1","karma-firefox-launcher":"^1.1.0","karma-jasmine":"^1.1.2","karma-mocha-reporter":"^2.2.5","karma-safari-launcher":"^1.0.0","karma-safaritechpreview-launcher":"0.0.6","karma-sauce-launcher":"^1.2.0","karma-sourcemap-loader":"^0.3.7","karma-webpack":"^2.0.13","opentok":"^2.9.1","terser-webpack-plugin":"^2.3.3","ts-loader":"^4.4.1","tslint":"^5.10.0","tslint-config-airbnb":"^5.9.2","typescript":"2.9.2","webpack":"^4.12.0","webpack-cli":"^3.0.4","webpack-node-externals":"^1.7.2"}}')},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6),o=r(15),s=r(49),i=r(2),a=r(50),c=r(1);function u(e){return new o((t,r)=>{e.on("sessionDisconnected",()=>{e.off(),t()}),e.disconnect()})}function l(e){return new o((t,r)=>{e.on("destroyed",()=>{t()}),e||t(),e.destroy()})}function d(e,t){return new o((r,n)=>{(function(e){return new o((t,r)=>{e.getDevices((e,n=[])=>{if(e)r(new s.FailedToObtainMediaDevices);else{const e=n.reduce((e,t)=>{const r="audioInput"===t.kind?"audio":"video";return Object.assign({},e,{[r]:Object.assign({},e[r],{[t.deviceId]:t})})},{audio:{},video:{}});Object.keys(e.audio).length||Object.keys(e.video).length?t(e):r(new s.FailedToObtainMediaDevices)}})})})(e).then(o=>{const i=document.createElement("div");i.style.position="fixed",i.style.bottom="-1px",i.style.width="1px",i.style.height="1px",i.style.opacity="0.01",document.body.appendChild(i);const a={width:"100%",height:"100%",insertMode:"append",showControls:!1};t&&t.audioSource&&(a.audioSource=t.audioSource),t&&t.videoSource&&(a.videoSource=t.videoSource),t&&t.audioOnly&&(a.videoSource=null),Object.keys(o.audio).length||(a.audioSource=null),Object.keys(o.video).length||(a.videoSource=null);const c=e.initPublisher(i,a,e=>{e?n(new s.FailedToCreateLocalPublisher):r({publisher:c})});c.on("streamCreated",()=>{i.style.visibility="hidden"})}).catch(n)})}function f({session:e,publisher:t}){return new o((r,n)=>{const o={testNetwork:!0,audioVolume:0},i=r=>{l(t).then(()=>u(e)).then(()=>{n(r)})};if(t.stream){const n=document.createElement("div"),a=e.subscribe(t.stream,n,o,n=>{n?i(new s.SubscribeToSessionError):r(Object.assign({session:e},{publisher:t},{subscriber:a}))})}else i(new s.SubscribeToSessionError)})}function p(e,t,r){return new o((o,i)=>{const a=c.getOr("","properties.loggingURL",e)+"/logging/ClientEvent",u=t&&t.proxyServerUrl&&`${t.proxyServerUrl}/${a.replace("https://","")}`||a,l=()=>i(new s.LoggingServerConnectionError);n.default.post(u).then(e=>200===e.status?o(r):l()).catch(l)})}t.testConnectivity=function(e,t,r,n){return new o((c,E)=>{(function(e,{apiKey:t,sessionId:r,token:n},a){return new o((o,c)=>{let u={};a&&a.initSessionOptions&&(u=a.initSessionOptions),a&&a.proxyServerUrl&&(e.hasOwnProperty("setProxyUrl")||(u.proxyUrl=a.proxyServerUrl));const l=e.initSession(t,r,u);l.connect(n,e=>{i.errorHasName(e,i.OTErrorType.OT_AUTHENTICATION_ERROR)?c(new s.ConnectToSessionTokenError):i.errorHasName(e,i.OTErrorType.OT_INVALID_SESSION_ID)?c(new s.ConnectToSessionSessionIdError):i.errorHasName(e,i.OTErrorType.OT_CONNECT_FAILED)?c(new s.ConnectToSessionNetworkError):i.errorHasName(e,i.OTErrorType.OT_INVALID_HTTP_STATUS)?c(new s.APIConnectivityError):e?c(new s.ConnectToSessionError):o(l)})})})(e,t,n).then(t=>function(e,t,r){return new o((n,o)=>{const a=e=>{u(t).then(()=>{o(e)})};d(e,r).then(({publisher:e})=>{t.publish(e,r=>{r?i.errorHasName(r,i.OTErrorType.NOT_CONNECTED)?a(new s.PublishToSessionNotConnectedError):i.errorHasName(r,i.OTErrorType.UNABLE_TO_PUBLISH)?a(new s.PublishToSessionPermissionOrTimeoutError):r&&a(new s.PublishToSessionError):n(Object.assign({session:t},{publisher:e}))})}).catch(e=>{a(e)})})}(e,t,n)).then(f).then(t=>p(e,n,t)).then(e=>{const t={success:!0,failedTests:[]};return r.logEvent({action:"testConnectivity",variation:"Success"}),(n=e.session,s=e.subscriber,new o((e,t)=>{s.on("destroyed",()=>{e()}),s||e(),n.unsubscribe(s)})).then(()=>l(e.publisher)).then(()=>u(e.session)).then(()=>c(t));var n,s}).catch(t=>{const o=(...e)=>{const t=a.mapErrors(...e),n=t.find(e=>"messaging"===e.type),o={failedTests:[...t,...n?a.mapErrors(new s.FailedMessagingServerTestError):[]],success:!1};r.logEvent({action:"testConnectivity",variation:"Success"}),c(o)};"LoggingServerConnectionError"===t.name?o(t):p(e,n).then(()=>o(t)).catch(e=>o(t,e))})})}},function(e,t,r){"use strict";var n=r(0),o=r(7),s=r(24),i=r(13);function a(e){var t=new s(e),r=o(s.prototype.request,t);return n.extend(r,s.prototype,t),n.extend(r,t),r}var c=a(r(10));c.Axios=s,c.create=function(e){return a(i(c.defaults,e))},c.Cancel=r(14),c.CancelToken=r(38),c.isCancel=r(9),c.all=function(e){return Promise.all(e)},c.spread=r(39),c.isAxiosError=r(40),e.exports=c,e.exports.default=c},function(e,t,r){"use strict";var n=r(0),o=r(8),s=r(25),i=r(26),a=r(13);function c(e){this.defaults=e,this.interceptors={request:new s,response:new s}}c.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=a(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[i,void 0],r=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)r=r.then(t.shift(),t.shift());return r},c.prototype.getUri=function(e){return e=a(this.defaults,e),o(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},n.forEach(["delete","get","head","options"],(function(e){c.prototype[e]=function(t,r){return this.request(a(r||{},{method:e,url:t,data:(r||{}).data}))}})),n.forEach(["post","put","patch"],(function(e){c.prototype[e]=function(t,r,n){return this.request(a(n||{},{method:e,url:t,data:r}))}})),e.exports=c},function(e,t,r){"use strict";var n=r(0);function o(){this.handlers=[]}o.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},o.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},o.prototype.forEach=function(e){n.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=o},function(e,t,r){"use strict";var n=r(0),o=r(27),s=r(9),i=r(10);function a(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return a(e),e.headers=e.headers||{},e.data=o(e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||i.adapter)(e).then((function(t){return a(e),t.data=o(t.data,t.headers,e.transformResponse),t}),(function(t){return s(t)||(a(e),t&&t.response&&(t.response.data=o(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},function(e,t,r){"use strict";var n=r(0);e.exports=function(e,t,r){return n.forEach(r,(function(r){e=r(e,t)})),e}},function(e,t){var r,n,o=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(e){if(r===setTimeout)return setTimeout(e,0);if((r===s||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:s}catch(e){r=s}try{n="function"==typeof clearTimeout?clearTimeout:i}catch(e){n=i}}();var c,u=[],l=!1,d=-1;function f(){l&&c&&(l=!1,c.length?u=c.concat(u):d=-1,u.length&&p())}function p(){if(!l){var e=a(f);l=!0;for(var t=u.length;t;){for(c=u,u=[];++d<t;)c&&c[d].run();d=-1,t=u.length}c=null,l=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===i||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function E(e,t){this.fun=e,this.array=t}function h(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new E(e,t)),1!==u.length||l||a(p)},E.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=h,o.addListener=h,o.once=h,o.off=h,o.removeListener=h,o.removeAllListeners=h,o.emit=h,o.prependListener=h,o.prependOnceListener=h,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,r){"use strict";var n=r(0);e.exports=function(e,t){n.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))}},function(e,t,r){"use strict";var n=r(12);e.exports=function(e,t,r){var o=r.config.validateStatus;r.status&&o&&!o(r.status)?t(n("Request failed with status code "+r.status,r.config,null,r.request,r)):e(r)}},function(e,t,r){"use strict";e.exports=function(e,t,r,n,o){return e.config=t,r&&(e.code=r),e.request=n,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},function(e,t,r){"use strict";var n=r(0);e.exports=n.isStandardBrowserEnv()?{write:function(e,t,r,o,s,i){var a=[];a.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),n.isString(o)&&a.push("path="+o),n.isString(s)&&a.push("domain="+s),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(e,t,r){"use strict";var n=r(34),o=r(35);e.exports=function(e,t){return e&&!n(t)?o(e,t):t}},function(e,t,r){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t,r){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,r){"use strict";var n=r(0),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,r,s,i={};return e?(n.forEach(e.split("\n"),(function(e){if(s=e.indexOf(":"),t=n.trim(e.substr(0,s)).toLowerCase(),r=n.trim(e.substr(s+1)),t){if(i[t]&&o.indexOf(t)>=0)return;i[t]="set-cookie"===t?(i[t]?i[t]:[]).concat([r]):i[t]?i[t]+", "+r:r}})),i):i}},function(e,t,r){"use strict";var n=r(0);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function o(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=o(window.location.href),function(t){var r=n.isString(t)?o(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},function(e,t,r){"use strict";var n=r(14);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;e((function(e){r.reason||(r.reason=new n(e),t(r.reason))}))}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var e;return{token:new o((function(t){e=t})),cancel:e}},e.exports=o},function(e,t,r){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,r){"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}},function(e,t,r){"use strict";e.exports=r(3),r(43),r(44),r(45),r(46),r(48)},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){"use strict";var n=r(3);e.exports=n,n.prototype.done=function(e,t){var r=arguments.length?this.then.apply(this,arguments):this;r.then(null,(function(e){setTimeout((function(){throw e}),0)}))}},function(e,t,r){"use strict";var n=r(3);e.exports=n,n.prototype.finally=function(e){return this.then((function(t){return n.resolve(e()).then((function(){return t}))}),(function(t){return n.resolve(e()).then((function(){throw t}))}))}},function(e,t,r){"use strict";var n=r(3);e.exports=n;var o=l(!0),s=l(!1),i=l(null),a=l(void 0),c=l(0),u=l("");function l(e){var t=new n(n._0);return t._V=1,t._W=e,t}n.resolve=function(e){if(e instanceof n)return e;if(null===e)return i;if(void 0===e)return a;if(!0===e)return o;if(!1===e)return s;if(0===e)return c;if(""===e)return u;if("object"==typeof e||"function"==typeof e)try{var t=e.then;if("function"==typeof t)return new n(t.bind(e))}catch(e){return new n((function(t,r){r(e)}))}return l(e)};var d=function(e){return"function"==typeof Array.from?(d=Array.from,Array.from(e)):(d=function(e){return Array.prototype.slice.call(e)},Array.prototype.slice.call(e))};n.all=function(e){var t=d(e);return new n((function(e,r){if(0===t.length)return e([]);var o=t.length;function s(i,a){if(a&&("object"==typeof a||"function"==typeof a)){if(a instanceof n&&a.then===n.prototype.then){for(;3===a._V;)a=a._W;return 1===a._V?s(i,a._W):(2===a._V&&r(a._W),void a.then((function(e){s(i,e)}),r))}var c=a.then;if("function"==typeof c)return void new n(c.bind(a)).then((function(e){s(i,e)}),r)}t[i]=a,0==--o&&e(t)}for(var i=0;i<t.length;i++)s(i,t[i])}))},n.reject=function(e){return new n((function(t,r){r(e)}))},n.race=function(e){return new n((function(t,r){d(e).forEach((function(e){n.resolve(e).then(t,r)}))}))},n.prototype.catch=function(e){return this.then(null,e)}},function(e,t,r){"use strict";var n=r(3),o=r(47);e.exports=n,n.denodeify=function(e,t){return"number"==typeof t&&t!==1/0?function(e,t){for(var r=[],o=0;o<t;o++)r.push("a"+o);var i=["return function ("+r.join(",")+") {","var self = this;","return new Promise(function (rs, rj) {","var res = fn.call(",["self"].concat(r).concat([s]).join(","),");","if (res &&",'(typeof res === "object" || typeof res === "function") &&','typeof res.then === "function"',") {rs(res);}","});","};"].join("");return Function(["Promise","fn"],i)(n,e)}(e,t):function(e){for(var t=Math.max(e.length-1,3),r=[],o=0;o<t;o++)r.push("a"+o);var i=["return function ("+r.join(",")+") {","var self = this;","var args;","var argLength = arguments.length;","if (arguments.length > "+t+") {","args = new Array(arguments.length + 1);","for (var i = 0; i < arguments.length; i++) {","args[i] = arguments[i];","}","}","return new Promise(function (rs, rj) {","var cb = "+s+";","var res;","switch (argLength) {",r.concat(["extra"]).map((function(e,t){return"case "+t+":res = fn.call("+["self"].concat(r.slice(0,t)).concat("cb").join(",")+");break;"})).join(""),"default:","args[argLength] = cb;","res = fn.apply(self, args);","}","if (res &&",'(typeof res === "object" || typeof res === "function") &&','typeof res.then === "function"',") {rs(res);}","});","};"].join("");return Function(["Promise","fn"],i)(n,e)}(e)};var s="function (err, res) {if (err) { rj(err); } else { rs(res); }}";n.nodeify=function(e){return function(){var t=Array.prototype.slice.call(arguments),r="function"==typeof t[t.length-1]?t.pop():null,s=this;try{return e.apply(this,arguments).nodeify(r,s)}catch(e){if(null==r)return new n((function(t,r){r(e)}));o((function(){r.call(s,e)}))}}},n.prototype.nodeify=function(e,t){if("function"!=typeof e)return this;this.then((function(r){o((function(){e.call(t,null,r)}))}),(function(r){o((function(){e.call(t,r)}))}))}},function(e,t,r){"use strict";var n=r(16),o=[],s=[],i=n.makeRequestCallFromTimer((function(){if(s.length)throw s.shift()}));function a(e){var t;(t=o.length?o.pop():new c).task=e,n(t)}function c(){this.task=null}e.exports=a,c.prototype.call=function(){try{this.task.call()}catch(e){a.onerror?a.onerror(e):(s.push(e),i())}finally{this.task=null,o[o.length]=this}}},function(e,t,r){"use strict";var n=r(3);e.exports=n,n.enableSynchronous=function(){n.prototype.isPending=function(){return 0==this.getState()},n.prototype.isFulfilled=function(){return 1==this.getState()},n.prototype.isRejected=function(){return 2==this.getState()},n.prototype.getValue=function(){if(3===this._V)return this._W.getValue();if(!this.isFulfilled())throw new Error("Cannot get a value of an unfulfilled promise.");return this._W},n.prototype.getReason=function(){if(3===this._V)return this._W.getReason();if(!this.isRejected())throw new Error("Cannot get a rejection reason of a non-rejected promise.");return this._W},n.prototype.getState=function(){return 3===this._V?this._W.getState():-1===this._V||-2===this._V?0:this._V}},n.disableSynchronous=function(){n.prototype.isPending=void 0,n.prototype.isFulfilled=void 0,n.prototype.isRejected=void 0,n.prototype.getValue=void 0,n.prototype.getReason=void 0,n.prototype.getState=void 0}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5),o=r(2);class s extends n.NetworkTestError{constructor(e,t){super(e,t||o.ErrorNames.CONNECTIVITY_ERROR)}}t.ConnectivityError=s;t.APIConnectivityError=class extends s{constructor(){super("Failed to connect to OpenTOK API Server",o.ErrorNames.API_CONNECTIVITY_ERROR)}};class i extends s{constructor(e,t){super(e||"Failed to connect to the session due to a network error.",t||o.ErrorNames.CONNECT_TO_SESSION_ERROR)}}t.ConnectToSessionError=i;t.ConnectToSessionTokenError=class extends i{constructor(){super("Failed to connect to the session due to an invalid token.",o.ErrorNames.CONNECT_TO_SESSION_TOKEN_ERROR)}};t.ConnectToSessionSessionIdError=class extends i{constructor(){super("Failed to connect to the session due to an invalid session ID.",o.ErrorNames.CONNECT_TO_SESSION_ID_ERROR)}};t.ConnectToSessionNetworkError=class extends i{constructor(){super("Failed to connect to the session due to a network error.",o.ErrorNames.CONNECT_TO_SESSION_NETWORK_ERROR)}};class a extends s{constructor(e,t){super(e||"OpenTok failed to find media devices for this browser.",t||o.ErrorNames.MEDIA_DEVICE_ERROR)}}t.MediaDeviceError=a;t.FailedToObtainMediaDevices=class extends a{constructor(){super("Failed to obtain media devices.",o.ErrorNames.FAILED_TO_OBTAIN_MEDIA_DEVICES)}};t.NoVideoCaptureDevicesError=class extends a{constructor(){super("This browser has no video capture devices",o.ErrorNames.NO_VIDEO_CAPTURE_DEVICES)}};t.NoAudioCaptureDevicesError=class extends a{constructor(){super("This browser has no audio capture devices.",o.ErrorNames.NO_AUDIO_CAPTURE_DEVICES)}};class c extends s{constructor(e,t){super(e||"Encountered an unknown error while attempting to publish to a session.",t||o.ErrorNames.PUBLISH_TO_SESSION_ERROR)}}t.PublishToSessionError=c;t.FailedMessagingServerTestError=class extends c{constructor(){super("Failed to connect to media server due to messaging server connection failure",o.ErrorNames.FAILED_MESSAGING_SERVER_TEST)}};t.FailedToCreateLocalPublisher=class extends c{constructor(){super("Failed to create a local publisher object.",o.ErrorNames.FAILED_TO_CREATE_LOCAL_PUBLISHER)}};t.PublishToSessionNotConnectedError=class extends c{constructor(){super("Precall failed to publish to the session because it was not connected.",o.ErrorNames.PUBLISH_TO_SESSION_NOT_CONNECTED)}};t.PublishToSessionPermissionOrTimeoutError=class extends c{constructor(){super("Precall failed to publish to the session due a permissions error or timeout.",o.ErrorNames.PUBLISH_TO_SESSION_PERMISSION_OR_TIMEOUT_ERROR)}};t.PublishToSessionNetworkError=class extends c{constructor(){super("Precall failed to publish to the session due a network error.",o.ErrorNames.PUBLISH_TO_SESSION_NETWORK_ERROR)}};t.SubscribeToSessionError=class extends s{constructor(e){super(e||"Encountered an unknown error while attempting to subscribe to a session.",o.ErrorNames.SUBSCRIBE_TO_SESSION_ERROR)}};t.LoggingServerConnectionError=class extends s{constructor(){super("Failed to connect to the OpenTok logging server.",o.ErrorNames.LOGGING_SERVER_CONNECTION_ERROR)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(2);var o;!function(e){e.Api="api",e.Messaging="messaging",e.OpentokJs="OpenTok.js",e.Media="media",e.Logging="logging",e.ConnectivityError="OpenTok.js"}(o=t.FailureType||(t.FailureType={}));const s=e=>({error:e,type:(()=>{switch(e.name){case n.ErrorNames.API_CONNECTIVITY_ERROR:case n.ErrorNames.CONNECT_TO_SESSION_NETWORK_ERROR:return o.Api;case n.ErrorNames.CONNECT_TO_SESSION_ERROR:case n.ErrorNames.CONNECT_TO_SESSION_TOKEN_ERROR:case n.ErrorNames.CONNECT_TO_SESSION_ID_ERROR:return o.Messaging;case n.ErrorNames.MEDIA_DEVICE_ERROR:case n.ErrorNames.FAILED_TO_OBTAIN_MEDIA_DEVICES:case n.ErrorNames.NO_VIDEO_CAPTURE_DEVICES:case n.ErrorNames.NO_AUDIO_CAPTURE_DEVICES:case n.ErrorNames.FAILED_TO_CREATE_LOCAL_PUBLISHER:case n.ErrorNames.PUBLISH_TO_SESSION_NOT_CONNECTED:case n.ErrorNames.PUBLISH_TO_SESSION_PERMISSION_OR_TIMEOUT_ERROR:case n.ErrorNames.PUBLISH_TO_SESSION_NETWORK_ERROR:return o.OpentokJs;case n.ErrorNames.PUBLISH_TO_SESSION_ERROR:case n.ErrorNames.SUBSCRIBE_TO_SESSION_ERROR:case n.ErrorNames.FAILED_MESSAGING_SERVER_TEST:return o.Media;case n.ErrorNames.LOGGING_SERVER_CONNECTION_ERROR:return o.Logging;default:return o.OpentokJs}})()});t.mapErrors=(...e)=>e.map(s)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(15),o=r(1),s=r(52),i=r(2),a=r(53),c=r(19),u=r(4),l=r(58);let d,f,p,E=!1,h=!1,_=!1;function S(e,t){return r=>new n((o,a)=>{const c=document.createElement("div");c.style.position="fixed",c.style.bottom="-1px",c.style.width="1px",c.style.height="1px",c.style.opacity="0",document.body.appendChild(c),function(e){return new n((t,r)=>{e.getDevices((e,n=[])=>{if(e)r(new s.FailedToObtainMediaDevices);else{const e=n.reduce((e,t)=>{const r="audioInput"===t.kind?"audio":"video";return Object.assign({},e,{[r]:Object.assign({},e[r],{[t.deviceId]:t})})},{audio:{},video:{}});Object.keys(e.audio).length?t(e):r(new s.NoAudioCaptureDevicesError)}})})}(e).then(n=>{Object.keys(n.video).length||(E=!0);const u={resolution:"1280x720",width:"100%",height:"100%",insertMode:"append",showControls:!1};t&&t.audioSource&&(u.audioSource=t.audioSource),t&&t.videoSource&&(u.videoSource=t.videoSource),E&&(u.videoSource=null);const l=e.initPublisher(c,u,e=>{e?a(new s.InitPublisherError(e.message)):r.publish(l,e=>{if(e)return i.errorHasName(e,i.OTErrorType.NOT_CONNECTED)?a(new s.PublishToSessionNotConnectedError):i.errorHasName(e,i.OTErrorType.UNABLE_TO_PUBLISH)?a(new s.PublishToSessionPermissionOrTimeoutError):a(new s.PublishToSessionError)})});l.on("streamCreated",e=>{const t=r.subscribe(e.stream,c,{testNetwork:!0,insertMode:"append"},e=>e?a(new s.SubscribeToSessionError(e.message)):o({publisher:l,subscriber:t}))})}).catch(a)})}function O(e,t,r,o){return new n((a,c)=>{(function(e,t){return new n((r,n)=>{e.connection?r(e):e.connect(t,t=>{t&&(i.errorHasName(t,i.OTErrorType.OT_AUTHENTICATION_ERROR)?n(new s.ConnectToSessionTokenError):i.errorHasName(t,i.OTErrorType.OT_INVALID_SESSION_ID)?n(new s.ConnectToSessionSessionIdError):i.errorHasName(t,i.OTErrorType.OT_CONNECT_FAILED)?n(new s.ConnectToSessionNetworkError):n(new s.ConnectToSessionError)),r(e)})})})(t,r.token).then(S(e,o)).then(a).catch(c)})}function m(e,t,r,i,l,S){let T;return new n((g,N)=>{O(e,t,r,i).then(({publisher:O,subscriber:v})=>{if(v)try{const s=Object.assign({state:new c.default(S)},{subscriber:v},{credentials:r}),N=(e,t)=>{var r;t&&l&&l((r=t,Object.assign({},r,{phase:E?"audio-only":"audio-video"})))},y=()=>{const a=function(e){const t=["bitrate","packetLossRatio","supported","reason","mos"];return e.state.stats.audio.mos=e.state.audioQualityScore(),e.state.stats.video.mos=e.state.videoQualityScore(),e.state.stats.audio.mos>=u.default.qualityThresholds.audio[0].minMos?e.state.stats.audio.supported=!0:(e.state.stats.audio.supported=!1,e.state.stats.audio.reason=u.default.strings.bandwidthLow),{audio:o.pick(t,e.state.stats.audio),video:o.pick(t.concat(["frameRate","recommendedResolution","recommendedFrameRate"]),e.state.stats.video)}}(s);if(E||(c=a).audio.mos&&c.audio.mos>=u.default.qualityThresholds.audio[0].minMos||_)t.on("sessionDisconnected",()=>{g(a),t.off()}),function(e,t){return new n((r,n)=>{t.on("destroyed",()=>{r()}),t||r(),e.unsubscribe(t)})}(t,v).then(()=>function(e){return new n((t,r)=>{e.on("destroyed",()=>{t()}),e||t(),e.destroy()})}(O)).then(()=>t.disconnect());else{E=!0;const n=a.video;m(e,t,r,i,l,!0).then(e=>{e.video=n,g(e)})}var c};f=()=>{y()};const R=e=>{clearTimeout(T),y()};a.default(s.state,v,O,N,R),T=window.setTimeout(y,d+1),window.clearTimeout(p),p=window.setTimeout(()=>{h=!0,_&&f&&f()},5e3)}catch(e){N(new s.SubscriberGetStatsError)}else N(new s.MissingSubscriberError)}).catch(N)})}t.testQuality=function(e,t,r,o,i){return h=!1,_=!1,new n((a,c)=>{E=!(!o||!o.audioOnly),d=E?u.default.getStatsAudioOnlyDuration:u.default.getStatsVideoAndAudioTestDuration,o&&o.timeout&&(d=Math.min(d,o.timeout,3e4));const p=e=>{f=void 0,r.logEvent({action:"testQuality",variation:"Success"}),a(e)},h=e=>{f=void 0,r.logEvent({action:"testQuality",variation:"Failure"}),c(e)};new n((e,t)=>{const{supported:r,browser:n}=l.default();return r?e():t(new s.UnsupportedBrowserError(n))}).then(()=>{let r={};o&&o.initSessionOptions&&(r=o.initSessionOptions),o&&o.proxyServerUrl&&(e.hasOwnProperty("setProxyUrl")||(r.proxyUrl=o.proxyServerUrl));const n=e.initSession(t.apiKey,t.sessionId,r);m(e,n,t,o,i).then(p).catch(h)}).catch(h)})},t.stopQualityTest=function(){_=!0,h&&f&&f()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5),o=r(2);class s extends n.NetworkTestError{constructor(e,t){super(e,t||o.ErrorNames.QUALITY_TEST_ERROR)}}t.QualityTestError=s;t.UnsupportedBrowserError=class extends s{constructor(e){super(`Your current browser (${e}) does not support the audio-video quality test. Please run the test in a supported browser.`,o.ErrorNames.UNSUPPORTED_BROWSER)}};class i extends s{constructor(e,t){super(e||"Failed to connect to the session due to a network error.",t||o.ErrorNames.CONNECT_TO_SESSION_ERROR)}}t.ConnectToSessionError=i;t.ConnectToSessionTokenError=class extends i{constructor(){super("Failed to connect to the session due to an invalid token.",o.ErrorNames.CONNECT_TO_SESSION_TOKEN_ERROR)}};t.ConnectToSessionSessionIdError=class extends i{constructor(){super("Failed to connect to the session due to an invalid session ID.",o.ErrorNames.CONNECT_TO_SESSION_ID_ERROR)}};t.ConnectToSessionNetworkError=class extends i{constructor(){super("Failed to connect to the session due to a network error.",o.ErrorNames.CONNECT_TO_SESSION_NETWORK_ERROR)}};t.MediaDeviceError=class extends s{constructor(e,t){super(e||"OpenTok failed to find media devices for this browser.",t||o.ErrorNames.MEDIA_DEVICE_ERROR)}};t.FailedToObtainMediaDevices=class extends s{constructor(){super("Failed to obtain media devices.",o.ErrorNames.FAILED_TO_OBTAIN_MEDIA_DEVICES)}};t.NoVideoCaptureDevicesError=class extends s{constructor(){super("This browser has no video capture devices",o.ErrorNames.NO_VIDEO_CAPTURE_DEVICES)}};t.NoAudioCaptureDevicesError=class extends s{constructor(){super("This browser has no audio capture devices.",o.ErrorNames.NO_AUDIO_CAPTURE_DEVICES)}};class a extends s{constructor(e,t){super(e||"Encountered an unknown error while attempting to publish to a session.",t||o.ErrorNames.PUBLISH_TO_SESSION_ERROR)}}t.PublishToSessionError=a;t.InitPublisherError=class extends a{constructor(e){super(e||"Failed to initialize publisher.",o.ErrorNames.INIT_PUBLISHER_ERROR)}};t.PublishToSessionNotConnectedError=class extends a{constructor(){super("Precall failed to publish to the session because it was not connected.",o.ErrorNames.PUBLISH_TO_SESSION_NOT_CONNECTED)}};t.PublishToSessionPermissionOrTimeoutError=class extends a{constructor(){super("Precall failed to publish to the session due a permissions error or timeout.",o.ErrorNames.PUBLISH_TO_SESSION_PERMISSION_OR_TIMEOUT_ERROR)}};class c extends s{constructor(e,t){super(e||"Encountered an unknown error while attempting to publish to a session.",t||o.ErrorNames.SUBSCRIBE_TO_SESSION_ERROR)}}t.SubscribeToSessionError=c;t.SubscriberGetStatsError=class extends c{constructor(){super("Failed to get network stats for a subscriber.",o.ErrorNames.SUBSCRIBER_GET_STATS_ERROR)}};t.MissingSubscriberError=class extends c{constructor(){super("Call checkSubscribeToSession before calling checkSubscriberQuality.",o.ErrorNames.MISSING_SUBSCRIBER_ERROR)}}},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,s){function i(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){e.done?o(e.value):new r((function(t){t(e.value)})).then(i,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const o=r(54),s=r(55),i=r(19),a=r(1),c=r(57),u=e=>a.getOr(0,"packetsLost",e),l=e=>u(e)+(e=>a.getOr(0,"packetsReceived",e))(e);function d(e,t,r){const n=()=>1e3*(()=>{if(t){const{rtcStatsReport:e}=t[0];let r=0;e.forEach(e=>{"remote-inbound-rtp"===e.type&&"audio"===e.kind&&(r=isNaN(e.roundTripTime)?0:e.roundTripTime)})}return 0})()/2||150,o=a.last(r),s=a.nth(-2,r);if(!o||!s||!e.stream)return 1;const i=(d=s,l(o[c="audio"])-l(d[c]));var c,d;if(0===i)return 1;let f=(u(o.audio)-u(s.audio))/i;return f<0&&(f=0),(e=>{const t=n();return(r=(()=>{const r=t+30;return 93.2-(.024*r+.11*(r-177.3)*(r-177.3<0?0:1))-(0+19.8*Math.log(1+29.7*e))})())<0?1:r>100?4.5:1+.035*r+r*(r-60)*(100-r)*7e-6;var r})(f)}t.default=function(e,t,r,u,l){return e.intervalId=window.setInterval(()=>{t.getStats((i,f)=>n(this,void 0,void 0,(function*(){if(!f)return null;let n=null;try{n=yield c.default(r)}catch(e){}if(f.audio.bytesReceived<0||a.getOr(1,"video.bytesReceived",f)<0)return e.clearInterval(),l(e);if(f&&e.statsLog.push(f),u&&"function"==typeof u&&u(i,f),e.statsLog.length<2)return null;e.stats=s.default(e);const p=function(e,t){const r=a.last(t),n=a.nth(-2,t);if(!r||!n||!e.stream)return 1;const o=((e,t,r)=>{const n=t.timestamp-r.timestamp;return t[e]&&t[e].bytesReceived?8*(t[e].bytesReceived-r[e].bytesReceived)/(n/1e3):0})("video",r,n),s=(e=>{const t=2.069924867*Math.pow(Math.log10(e),.6250223771);return Math.pow(10,t)})(e.stream.videoDimensions.width*e.stream.videoDimensions.height);if(o<3e4)return 1;const i=Math.min(o,s);let c=Math.log(i/3e4)/Math.log(s/3e4)*4+1;return c=Math.min(c,4.5),c}(t,e.statsLog);e.videoScoresLog.push(p);const E=d(t,n,e.statsLog);return e.audioScoresLog.push(E),e.pruneScores(),o.default(e.statsLog)?(e.clearInterval(),l(e)):null})))},i.default.scoreInterval),t.on("destroyed",e.clearInterval.bind(e)),e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(17),o=r(18),s=r(4);t.default=function(e){const t=n.default(e),r=s.default.steadyStateAllowedDelta;let i=!0;if(t.length<s.default.minimumVideoAndAudioTestSampleSize)return!1;const a=o.default(t);return["video","audio"].forEach(e=>{for(let t=1;t<a[e].length;t+=1){const n=a[e][t].averageBitrate,o=a[e][t-1].averageBitrate;n-o>o*r&&(i=!1)}}),i}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(17),o=r(18),s=r(56),i=r(4),a=r(1);function c(e,t){let r=0,n=0,o=0;t.forEach(t=>{r+=t.averageBitrate,n+=t.packetLossRatio,"video"===e&&(o+=Number(a.getOr(0,"frameRate",t)))});const i={bitrate:r/t.length,packetLossRatio:n/t.length};if("video"===e){const{supported:r,reason:n,recommendedResolution:a,recommendedFrameRate:c}=s.default(i),u="video"===e?{recommendedResolution:a,recommendedFrameRate:c,frameRate:o/t.length}:{};return Object.assign({},i,{supported:r,reason:n},u)}return Object.assign({},i)}t.default=function(e){const t=n.default(e.statsLog),r=o.default(t);return{audio:e.hasAudioTrack()?c("audio",r.audio):{supported:!1,reason:i.default.strings.noMic},video:e.audioOnlyFallback?{supported:!1,reason:i.default.strings.bandwidthLow}:e.hasVideoTrack()?c("video",r.video):{supported:!1,reason:i.default.strings.noCam}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4),o=r(1);t.default=function(e){const t=n.default.qualityThresholds.video,r=e.bitrate,s=e.packetLossRatio;let i,a=!1,c=30,u="";for(let e=0;e<t.length;e+=1){const n=t[e];if(r>=n.bps&&s<=n.plr){a=!0,i=o.get("recommendedSetting",n),c=Number(i.substring(i.indexOf("@")+1).replace("FPS","")),u=i.substring(0,i.indexOf("@")-1);break}}const l={supported:a,recommendedFrameRate:c,recommendedResolution:u};return a?(l.recommendedFrameRate=c,l.recommendedResolution=u):l.reason=n.default.strings.bandwidthLow,l}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=e=>new Promise(t=>{if("function"!=typeof e.getRtcStatsReport)return t(null);const r=e.getRtcStatsReport();r?r.then(t).catch(()=>t(null)):e.getRtcStatsReport((e,r)=>{t(r)})})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(1);t.default=function(){const e=function(){const e=window&&window.navigator;return"undefined"!=typeof window&&window.navigator?n.get("mozGetUserMedia",e)?"Firefox":n.get("webkitGetUserMedia",e)?window.hasOwnProperty("webkitRTCPeerConnection")?e.userAgent.match(/Edg/)?"Edge":e.userAgent.match(/Opera|OPR\//)?"Opera":"Chrome":e.userAgent.match(/Version\/(\d+).(\d+)/)?"Safari":"WebKit browser without WebRTC support":e.mediaDevices&&e.userAgent.match(/Edge\/(\d+).(\d+)$/)?"non-Chromium Edge":e.userAgent.indexOf("MSIE ")>0||e.userAgent.match(/Trident.*rv\:11\./)?"Internet Explorer":e.mediaDevices&&e.userAgent.match(/AppleWebKit\/(\d+)\./)?"Safari":"unsupported browser":"not a browser"}();return{browser:e,supported:["Chrome","Firefox","Safari","Edge","Opera"].indexOf(e)>-1}}},function(e,t,r){var n,o,s;var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};"function"==typeof Symbol&&Symbol.iterator;o=[r(6)],void 0===(s="function"==typeof(n=function(e){var t=!1,r=void 0,n=function(e){return function(e){if(t)return null;for(var r=e+"=",n=document.cookie.split(";"),o=void 0,s=0;s<n.length;s++){for(o=n[s];" "===o.charAt(0);)o=o.substring(1,o.length);if(0===o.indexOf(r))return o.substring(r.length,o.length)}return null}(e)||function(e,r,n){if(t)return r;var o="",s=void 0;n&&((s=new Date).setTime(s.getTime()+24*n*60*60*1e3),o=["; expires=",s.toGMTString()].join(""));var i=[e,"=",r,o,"; path=/"].join("");return document.cookie=i,r}(e,function(){for(var e=[],t="0123456789abcdef",r=0;r<36;r++)e.push(t.substr(Math.floor(16*Math.random()),1));return e[14]="4",e[19]=t.substr(3&e[19]|8,1),e[8]=e[13]=e[18]=e[23]="-",e.join("")}(),7)},o=function(n){var o=function(e){if(!e.clientVersion)throw console.log("Error. The clientVersion field cannot be null in the log entry"),new Error("The clientVersion field cannot be null in the log entry");if(!e.source)throw console.log("Error. The source field cannot be null in the log entry"),new Error("The source field cannot be null in the log entry");if(!e.componentId)throw console.log("Error. The componentId field cannot be null in the log entry"),new Error("The componentId field cannot be null in the log entry");if(!e.name)throw console.log("Error. The name field cannot be null in the log entry"),new Error("The guid field cannot be null in the log entry");var t=e.logVersion||"2",r=e.clientSystemTime||(new Date).getTime();return a({},e,{logVersion:t,clientSystemTime:r})}(n);if(t)e.post(r,o);else{var s=new XMLHttpRequest;s.open("POST",r,!0),s.setRequestHeader("Content-type","application/json"),s.send(JSON.stringify(o))}};return function(){function e(o,s){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.analyticsData=o,t=s&&s.server;var i="hlg.tokbox.com/prod/logging/ClientEvent";r=s&&s.proxyUrl&&s.proxyUrl+"/"+i||"https://"+i,this.analyticsData.guid=n(o.name)}return i(e,[{key:"addSessionInfo",value:function(e){if(!e.sessionId)throw console.log("Error. The sessionId field cannot be null in the log entry"),new Error("The sessionId field cannot be null in the log entry");if(this.analyticsData.sessionId=e.sessionId,!e.connectionId)throw console.log("Error. The connectionId field cannot be null in the log entry"),new Error("The connectionId field cannot be null in the log entry");if(this.analyticsData.connectionId=e.connectionId,0===e.partnerId)throw console.log("Error. The partnerId field cannot be null in the log entry"),new Error("The partnerId field cannot be null in the log entry");this.analyticsData.partnerId=e.partnerId}},{key:"logEvent",value:function(e){this.analyticsData=a({},this.analyticsData,e,{clientSystemTime:(new Date).getTime()}),o(this.analyticsData)}}]),e}()})?n.apply(t,o):n)||(e.exports=s)}])}));
//# sourceMappingURL=index.js.map
{
"name": "opentok-network-test-js",
"version": "2.4.2",
"version": "2.4.3",
"description": "Precall network test for applications using the OpenTok platform.",

@@ -5,0 +5,0 @@ "main": "dist/NetworkTest/index.js",

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc