NIM_Web_Netcall_v4.8.0.js 92.3 KB
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Netcall=e():t.Netcall=e()}(this,function(){return function(t){function e(i){if(n[i])return n[i].exports;var o=n[i]={exports:{},id:i,loaded:!1};return t[i].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}var o=n(98),r=i(o),s="4.8.0",a="2.4.0.208",c=n(343),u=n(219),l=n(276),d=n(341),h=n(203),f=n(285),p=n(286),v=n(287),m=void 0,_=(0,r["default"])({version:s,versionAgent:a},h,{webgl:c,install:function(t,e){u.install(t,e),l.install(t,e),t.parser.mixin({configMap:f,serializeMap:p,unserializeMap:v}),d.install(t,e)},getInstance:function(t){return m||(m=new d(t)),m},destroy:function(){m&&(m.destroy(),m=null)}});t.exports=_},,function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e,n){var i=n(35)("wks"),o=n(22),r=n(2).Symbol,s="function"==typeof r,a=t.exports=function(t){return i[t]||(i[t]=s&&r[t]||(s?r:o)("Symbol."+t))};a.store=i},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},,function(t,e){"use strict";e.__esModule=!0,e["default"]=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e,n){t.exports=!n(18)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e,n){var i=n(9),o=n(21);t.exports=n(7)?function(t,e,n){return i.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var i=n(14),o=n(50),r=n(37),s=Object.defineProperty;e.f=n(7)?Object.defineProperty:function(t,e,n){if(i(t),e=r(e,!0),i(n),o)try{return s(t,e,n)}catch(a){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e){var n=t.exports={version:"2.5.3"};"number"==typeof __e&&(__e=n)},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){var i=n(57),o=n(32);t.exports=function(t){return i(o(t))}},function(t,e,n){(function(e){"use strict";var n="'4cb44d7578c1b21a823b0bbf6da74f19e0b51d15",i="4cb44d75'",o="4.8.0",r="2.4.0.208",s="3.7.0",a="45",c=1,u="https://lbs.netease.im/lbs/webconf.jsp",l="development"===e.env.NODE_ENV?6e3:42e3,d={info:{hash:n,shortHash:i,version:o,sdkVersion:a,nrtcVersion:s,protocolVersion:c},agentVersion:r,lbsUrl:u,connectTimeout:l,xhrTimeout:l,socketTimeout:l,reconnectionDelay:656.25,reconnectionDelayMax:l,reconnectionJitter:.1,heartbeatInterval:18e4,cmdTimeout:l};d.formatSocketUrl=function(t){var e=t.url,n=t.secure,i=n?"https":"http";return e.indexOf("http")===-1?i+"://"+e:e},d.fileServerUrl="https://nos.netease.com",d.replaceUrl="http://nos.netease.im",d.genUploadUrl=function(t){return d.uploadUrl?d.uploadUrl+"/"+t:d.fileServerUrl+"/"+t},d.genDownloadUrl=function(t,e){return d.downloadUrl?d.replaceUrl+"/"+t+"/"+e:"https://"+t+".nosdn.127.net/"+e},t.exports=d}).call(e,n(28))},function(t,e,n){var i=n(11);t.exports=function(t){if(!i(t))throw TypeError(t+" is not an object!");return t}},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var o=n(121),r=i(o),s=n(120),a=i(s),c=n(20),u=i(c);e["default"]=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+("undefined"==typeof e?"undefined":(0,u["default"])(e)));t.prototype=(0,a["default"])(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(r["default"]?(0,r["default"])(t,e):t.__proto__=e)}},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var o=n(20),r=i(o);e["default"]=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==("undefined"==typeof e?"undefined":(0,r["default"])(e))&&"function"!=typeof e?t:e}},function(t,e,n){var i=n(2),o=n(10),r=n(45),s=n(8),a="prototype",c=function(t,e,n){var u,l,d,h=t&c.F,f=t&c.G,p=t&c.S,v=t&c.P,m=t&c.B,_=t&c.W,g=f?o:o[e]||(o[e]={}),y=g[a],C=f?i:p?i[e]:(i[e]||{})[a];f&&(n=e);for(u in n)l=!h&&C&&void 0!==C[u],l&&u in g||(d=l?C[u]:n[u],g[u]=f&&"function"!=typeof C[u]?n[u]:m&&l?r(d,i):_&&C[u]==d?function(t){var e=function(e,n,i){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,i)}return t.apply(this,arguments)};return e[a]=t[a],e}(d):v&&"function"==typeof d?r(Function.call,d):d,v&&((g.virtual||(g.virtual={}))[u]=d,t&c.R&&y&&!y[u]&&s(y,u,d)))};c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,t.exports=c},function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},function(t,e,n){"use strict";function i(){}function o(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function r(){this._events=new i,this._eventsCount=0}var s=Object.prototype.hasOwnProperty,a="~";Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(a=!1)),r.prototype.eventNames=function(){var t,e,n=[];if(0===this._eventsCount)return n;for(e in t=this._events)s.call(t,e)&&n.push(a?e.slice(1):e);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},r.prototype.listeners=function(t,e){var n=a?a+t:t,i=this._events[n];if(e)return!!i;if(!i)return[];if(i.fn)return[i.fn];for(var o=0,r=i.length,s=new Array(r);o<r;o++)s[o]=i[o].fn;return s},r.prototype.emit=function(t,e,n,i,o,r){var s=a?a+t:t;if(!this._events[s])return!1;var c,u,l=this._events[s],d=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),d){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,n),!0;case 4:return l.fn.call(l.context,e,n,i),!0;case 5:return l.fn.call(l.context,e,n,i,o),!0;case 6:return l.fn.call(l.context,e,n,i,o,r),!0}for(u=1,c=new Array(d-1);u<d;u++)c[u-1]=arguments[u];l.fn.apply(l.context,c)}else{var h,f=l.length;for(u=0;u<f;u++)switch(l[u].once&&this.removeListener(t,l[u].fn,void 0,!0),d){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,e);break;case 3:l[u].fn.call(l[u].context,e,n);break;case 4:l[u].fn.call(l[u].context,e,n,i);break;default:if(!c)for(h=1,c=new Array(d-1);h<d;h++)c[h-1]=arguments[h];l[u].fn.apply(l[u].context,c)}}return!0},r.prototype.on=function(t,e,n){var i=new o(e,n||this),r=a?a+t:t;return this._events[r]?this._events[r].fn?this._events[r]=[this._events[r],i]:this._events[r].push(i):(this._events[r]=i,this._eventsCount++),this},r.prototype.once=function(t,e,n){var i=new o(e,n||this,!0),r=a?a+t:t;return this._events[r]?this._events[r].fn?this._events[r]=[this._events[r],i]:this._events[r].push(i):(this._events[r]=i,this._eventsCount++),this},r.prototype.removeListener=function(t,e,n,o){var r=a?a+t:t;if(!this._events[r])return this;if(!e)return 0===--this._eventsCount?this._events=new i:delete this._events[r],this;var s=this._events[r];if(s.fn)s.fn!==e||o&&!s.once||n&&s.context!==n||(0===--this._eventsCount?this._events=new i:delete this._events[r]);else{for(var c=0,u=[],l=s.length;c<l;c++)(s[c].fn!==e||o&&!s[c].once||n&&s[c].context!==n)&&u.push(s[c]);u.length?this._events[r]=1===u.length?u[0]:u:0===--this._eventsCount?this._events=new i:delete this._events[r]}return this},r.prototype.removeAllListeners=function(t){var e;return t?(e=a?a+t:t,this._events[e]&&(0===--this._eventsCount?this._events=new i:delete this._events[e])):(this._events=new i,this._eventsCount=0),this},r.prototype.off=r.prototype.removeListener,r.prototype.addListener=r.prototype.on,r.prototype.setMaxListeners=function(){return this},r.prefixed=a,r.EventEmitter=r,t.exports=r},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var o=n(74),r=i(o),s=n(73),a=i(s),c="function"==typeof a["default"]&&"symbol"==typeof r["default"]?function(t){return typeof t}:function(t){return t&&"function"==typeof a["default"]&&t.constructor===a["default"]&&t!==a["default"].prototype?"symbol":typeof t};e["default"]="function"==typeof a["default"]&&"symbol"===c(r["default"])?function(t){return"undefined"==typeof t?"undefined":c(t)}:function(t){return t&&"function"==typeof a["default"]&&t.constructor===a["default"]&&t!==a["default"].prototype?"symbol":"undefined"==typeof t?"undefined":c(t)}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){var n=0,i=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+i).toString(36))}},,function(t,e,n){var i=n(53),o=n(33);t.exports=Object.keys||function(t){return i(t,o)}},function(t,e){e.f={}.propertyIsEnumerable},function(t,e){t.exports={}},,function(t,e){function n(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function o(t){if(l===setTimeout)return setTimeout(t,0);if((l===n||!l)&&setTimeout)return l=setTimeout,setTimeout(t,0);try{return l(t,0)}catch(e){try{return l.call(null,t,0)}catch(e){return l.call(this,t,0)}}}function r(t){if(d===clearTimeout)return clearTimeout(t);if((d===i||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(t);try{return d(t)}catch(e){try{return d.call(null,t)}catch(e){return d.call(this,t)}}}function s(){v&&f&&(v=!1,f.length?p=f.concat(p):m=-1,p.length&&a())}function a(){if(!v){var t=o(s);v=!0;for(var e=p.length;e;){for(f=p,p=[];++m<e;)f&&f[m].run();m=-1,e=p.length}f=null,v=!1,r(t)}}function c(t,e){this.fun=t,this.array=e}function u(){}var l,d,h=t.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:n}catch(t){l=n}try{d="function"==typeof clearTimeout?clearTimeout:i}catch(t){d=i}}();var f,p=[],v=!1,m=-1;h.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];p.push(new c(t,e)),1!==p.length||v||o(a)},c.prototype.run=function(){this.fun.apply(null,this.array)},h.title="browser",h.browser=!0,h.env={},h.argv=[],h.version="",h.versions={},h.on=u,h.addListener=u,h.once=u,h.off=u,h.removeListener=u,h.removeAllListeners=u,h.emit=u,h.prependListener=u,h.prependOnceListener=u,h.listeners=function(t){return[]},h.binding=function(t){throw new Error("process.binding is not supported")},h.cwd=function(){return"/"},h.chdir=function(t){throw new Error("process.chdir is not supported")},h.umask=function(){return 0}},,function(t,e){t.exports=!0},function(t,e,n){var i=n(9).f,o=n(4),r=n(3)("toStringTag");t.exports=function(t,e,n){t&&!o(t=n?t:t.prototype,r)&&i(t,r,{configurable:!0,value:e})}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on  "+t);return t}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){var i=n(35)("keys"),o=n(22);t.exports=function(t){return i[t]||(i[t]=o(t))}},function(t,e,n){var i=n(2),o="__core-js_shared__",r=i[o]||(i[o]={});t.exports=function(t){return r[t]||(r[t]={})}},function(t,e){var n=Math.ceil,i=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?i:n)(t)}},function(t,e,n){var i=n(11);t.exports=function(t,e){if(!i(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!i(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!i(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!i(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e,n){var i=n(2),o=n(10),r=n(30),s=n(39),a=n(9).f;t.exports=function(t){var e=o.Symbol||(o.Symbol=r?{}:i.Symbol||{});"_"==t.charAt(0)||t in e||a(e,t,{value:s.f(t)})}},function(t,e,n){e.f=n(3)},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var o=n(114);Object.defineProperty(e,"ajax",{enumerable:!0,get:function(){return i(o)["default"]}});var r=n(115);Object.defineProperty(e,"element",{enumerable:!0,get:function(){return i(r)["default"]}});var s=n(116);Object.defineProperty(e,"tool",{enumerable:!0,get:function(){return i(s)["default"]}})},function(t,e,n){var i=n(14),o=n(84),r=n(33),s=n(34)("IE_PROTO"),a=function(){},c="prototype",u=function(){var t,e=n(46)("iframe"),i=r.length,o="<",s=">";for(e.style.display="none",n(67).appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write(o+"script"+s+"document.F=Object"+o+"/script"+s),t.close(),u=t.F;i--;)delete u[c][r[i]];return u()};t.exports=Object.create||function(t,e){var n;return null!==t?(a[c]=i(t),n=new a,a[c]=null,n[s]=t):n=u(),void 0===e?n:o(n,e)}},function(t,e){e.f=Object.getOwnPropertySymbols},,function(t,e,n){var i=n(56);t.exports=function(t,e,n){if(i(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,i){return t.call(e,n,i)};case 3:return function(n,i,o){return t.call(e,n,i,o)}}return function(){return t.apply(e,arguments)}}},function(t,e,n){var i=n(11),o=n(2).document,r=i(o)&&i(o.createElement);t.exports=function(t){return r?o.createElement(t):{}}},,,,function(t,e,n){t.exports=!n(7)&&!n(18)(function(){return 7!=Object.defineProperty(n(46)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){"use strict";var i=n(30),o=n(17),r=n(54),s=n(8),a=n(4),c=n(26),u=n(81),l=n(31),d=n(86),h=n(3)("iterator"),f=!([].keys&&"next"in[].keys()),p="@@iterator",v="keys",m="values",_=function(){return this};t.exports=function(t,e,n,g,y,C,T){u(n,e,g);var A,S,b,E=function(t){if(!f&&t in w)return w[t];switch(t){case v:return function(){return new n(this,t)};case m:return function(){return new n(this,t)}}return function(){return new n(this,t)}},I=e+" Iterator",O=y==m,M=!1,w=t.prototype,N=w[h]||w[p]||y&&w[y],k=!f&&N||E(y),x=y?O?E("entries"):k:void 0,L="Array"==e?w.entries||N:N;if(L&&(b=d(L.call(new t)),b!==Object.prototype&&b.next&&(l(b,I,!0),i||a(b,h)||s(b,h,_))),O&&N&&N.name!==m&&(M=!0,k=function(){return N.call(this)}),i&&!T||!f&&!M&&w[h]||s(w,h,k),c[e]=k,c[I]=_,y)if(A={values:O?k:E(m),keys:C?k:E(v),entries:x},T)for(S in A)S in w||r(w,S,A[S]);else o(o.P+o.F*(f||M),e,A);return A}},function(t,e,n){var i=n(53),o=n(33).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return i(t,o)}},function(t,e,n){var i=n(4),o=n(12),r=n(78)(!1),s=n(34)("IE_PROTO");t.exports=function(t,e){var n,a=o(t),c=0,u=[];for(n in a)n!=s&&i(a,n)&&u.push(n);for(;e.length>c;)i(a,n=e[c++])&&(~r(u,n)||u.push(n));return u}},function(t,e,n){t.exports=n(8)},,function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){var i=n(40);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==i(t)?t.split(""):Object(t)}},function(t,e,n){var i=n(25),o=n(21),r=n(12),s=n(37),a=n(4),c=n(50),u=Object.getOwnPropertyDescriptor;e.f=n(7)?u:function(t,e){if(t=r(t),e=s(e,!0),c)try{return u(t,e)}catch(n){}if(a(t,e))return o(!i.f.call(t,e),t[e])}},function(t,e,n){var i=n(32);t.exports=function(t){return Object(i(t))}},,,,,,,,function(t,e,n){var i=n(2).document;t.exports=i&&i.documentElement},function(t,e,n){var i=n(36),o=Math.min;t.exports=function(t){return t>0?o(i(t),9007199254740991):0}},function(t,e){},function(t,e,n){"use strict";var i=n(87)(!0);n(51)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=i(e,n),this._i+=t.length,{value:t,done:!1})})},function(t,e,n){n(89);for(var i=n(2),o=n(8),r=n(26),s=n(3)("toStringTag"),a="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),c=0;c<a.length;c++){var u=a[c],l=i[u],d=l&&l.prototype;d&&!d[s]&&o(d,s,u),r[u]=r.Array}},,function(t,e,n){t.exports={"default":n(75),__esModule:!0}},function(t,e,n){t.exports={"default":n(76),__esModule:!0}},function(t,e,n){n(90),n(69),n(91),n(92),t.exports=n(10).Symbol},function(t,e,n){n(70),n(71),t.exports=n(39).f("iterator")},function(t,e){t.exports=function(){}},function(t,e,n){var i=n(12),o=n(68),r=n(88);t.exports=function(t){return function(e,n,s){var a,c=i(e),u=o(c.length),l=r(s,u);if(t&&n!=n){for(;u>l;)if(a=c[l++],a!=a)return!0}else for(;u>l;l++)if((t||l in c)&&c[l]===n)return t||l||0;return!t&&-1}}},function(t,e,n){var i=n(24),o=n(43),r=n(25);t.exports=function(t){var e=i(t),n=o.f;if(n)for(var s,a=n(t),c=r.f,u=0;a.length>u;)c.call(t,s=a[u++])&&e.push(s);return e}},function(t,e,n){var i=n(40);t.exports=Array.isArray||function(t){return"Array"==i(t)}},function(t,e,n){"use strict";var i=n(42),o=n(21),r=n(31),s={};n(8)(s,n(3)("iterator"),function(){return this}),t.exports=function(t,e,n){t.prototype=i(s,{next:o(1,n)}),r(t,e+" Iterator")}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,n){var i=n(22)("meta"),o=n(11),r=n(4),s=n(9).f,a=0,c=Object.isExtensible||function(){return!0},u=!n(18)(function(){return c(Object.preventExtensions({}))}),l=function(t){s(t,i,{value:{i:"O"+ ++a,w:{}}})},d=function(t,e){if(!o(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!r(t,i)){if(!c(t))return"F";if(!e)return"E";l(t)}return t[i].i},h=function(t,e){if(!r(t,i)){if(!c(t))return!0;if(!e)return!1;l(t)}return t[i].w},f=function(t){return u&&p.NEED&&c(t)&&!r(t,i)&&l(t),t},p=t.exports={KEY:i,NEED:!1,fastKey:d,getWeak:h,onFreeze:f}},function(t,e,n){var i=n(9),o=n(14),r=n(24);t.exports=n(7)?Object.defineProperties:function(t,e){o(t);for(var n,s=r(e),a=s.length,c=0;a>c;)i.f(t,n=s[c++],e[n]);return t}},function(t,e,n){var i=n(12),o=n(52).f,r={}.toString,s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],a=function(t){try{return o(t)}catch(e){return s.slice()}};t.exports.f=function(t){return s&&"[object Window]"==r.call(t)?a(t):o(i(t))}},function(t,e,n){var i=n(4),o=n(59),r=n(34)("IE_PROTO"),s=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=o(t),i(t,r)?t[r]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?s:null}},function(t,e,n){var i=n(36),o=n(32);t.exports=function(t){return function(e,n){var r,s,a=String(o(e)),c=i(n),u=a.length;return c<0||c>=u?t?"":void 0:(r=a.charCodeAt(c),r<55296||r>56319||c+1===u||(s=a.charCodeAt(c+1))<56320||s>57343?t?a.charAt(c):r:t?a.slice(c,c+2):(r-55296<<10)+(s-56320)+65536)}}},function(t,e,n){var i=n(36),o=Math.max,r=Math.min;t.exports=function(t,e){return t=i(t),t<0?o(t+e,0):r(t,e)}},function(t,e,n){"use strict";var i=n(77),o=n(82),r=n(26),s=n(12);t.exports=n(51)(Array,"Array",function(t,e){this._t=s(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,o(1)):"keys"==e?o(0,n):"values"==e?o(0,t[n]):o(0,[n,t[n]])},"values"),r.Arguments=r.Array,i("keys"),i("values"),i("entries")},function(t,e,n){"use strict";var i=n(2),o=n(4),r=n(7),s=n(17),a=n(54),c=n(83).KEY,u=n(18),l=n(35),d=n(31),h=n(22),f=n(3),p=n(39),v=n(38),m=n(79),_=n(80),g=n(14),y=n(11),C=n(12),T=n(37),A=n(21),S=n(42),b=n(85),E=n(58),I=n(9),O=n(24),M=E.f,w=I.f,N=b.f,k=i.Symbol,x=i.JSON,L=x&&x.stringify,D="prototype",R=f("_hidden"),U=f("toPrimitive"),P={}.propertyIsEnumerable,j=l("symbol-registry"),V=l("symbols"),F=l("op-symbols"),H=Object[D],W="function"==typeof k,B=i.QObject,Y=!B||!B[D]||!B[D].findChild,Q=r&&u(function(){return 7!=S(w({},"a",{get:function(){return w(this,"a",{value:7}).a}})).a})?function(t,e,n){var i=M(H,e);i&&delete H[e],w(t,e,n),i&&t!==H&&w(H,e,i)}:w,q=function(t){var e=V[t]=S(k[D]);return e._k=t,e},z=W&&"symbol"==typeof k.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof k},G=function(t,e,n){return t===H&&G(F,e,n),g(t),e=T(e,!0),g(n),o(V,e)?(n.enumerable?(o(t,R)&&t[R][e]&&(t[R][e]=!1),n=S(n,{enumerable:A(0,!1)})):(o(t,R)||w(t,R,A(1,{})),t[R][e]=!0),Q(t,e,n)):w(t,e,n)},J=function(t,e){g(t);for(var n,i=m(e=C(e)),o=0,r=i.length;r>o;)G(t,n=i[o++],e[n]);return t},X=function(t,e){return void 0===e?S(t):J(S(t),e)},K=function(t){var e=P.call(this,t=T(t,!0));return!(this===H&&o(V,t)&&!o(F,t))&&(!(e||!o(this,t)||!o(V,t)||o(this,R)&&this[R][t])||e)},$=function(t,e){if(t=C(t),e=T(e,!0),t!==H||!o(V,e)||o(F,e)){var n=M(t,e);return!n||!o(V,e)||o(t,R)&&t[R][e]||(n.enumerable=!0),n}},Z=function(t){for(var e,n=N(C(t)),i=[],r=0;n.length>r;)o(V,e=n[r++])||e==R||e==c||i.push(e);return i},tt=function(t){for(var e,n=t===H,i=N(n?F:C(t)),r=[],s=0;i.length>s;)!o(V,e=i[s++])||n&&!o(H,e)||r.push(V[e]);return r};W||(k=function(){if(this instanceof k)throw TypeError("Symbol is not a constructor!");var t=h(arguments.length>0?arguments[0]:void 0),e=function(n){this===H&&e.call(F,n),o(this,R)&&o(this[R],t)&&(this[R][t]=!1),Q(this,t,A(1,n))};return r&&Y&&Q(H,t,{configurable:!0,set:e}),q(t)},a(k[D],"toString",function(){return this._k}),E.f=$,I.f=G,n(52).f=b.f=Z,n(25).f=K,n(43).f=tt,r&&!n(30)&&a(H,"propertyIsEnumerable",K,!0),p.f=function(t){return q(f(t))}),s(s.G+s.W+s.F*!W,{Symbol:k});for(var et="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),nt=0;et.length>nt;)f(et[nt++]);for(var it=O(f.store),ot=0;it.length>ot;)v(it[ot++]);s(s.S+s.F*!W,"Symbol",{"for":function(t){return o(j,t+="")?j[t]:j[t]=k(t)},keyFor:function(t){if(!z(t))throw TypeError(t+" is not a symbol!");for(var e in j)if(j[e]===t)return e},useSetter:function(){Y=!0},useSimple:function(){Y=!1}}),s(s.S+s.F*!W,"Object",{create:X,defineProperty:G,defineProperties:J,getOwnPropertyDescriptor:$,getOwnPropertyNames:Z,getOwnPropertySymbols:tt}),x&&s(s.S+s.F*(!W||u(function(){var t=k();return"[null]"!=L([t])||"{}"!=L({a:t})||"{}"!=L(Object(t))})),"JSON",{stringify:function(t){for(var e,n,i=[t],o=1;arguments.length>o;)i.push(arguments[o++]);if(n=e=i[1],(y(e)||void 0!==t)&&!z(t))return _(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!z(e))return e}),i[1]=e,L.apply(x,i)}}),k[D][U]||n(8)(k[D],U,k[D].valueOf),d(k,"Symbol"),d(Math,"Math",!0),d(i.JSON,"JSON",!0)},function(t,e,n){n(38)("asyncIterator")},function(t,e,n){n(38)("observable")},,,,,,function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var o=n(119),r=i(o);e["default"]=r["default"]||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}},,,,,,,function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var o=n(6),r=i(o),s=n(41),a=n(13),c=a.info.nrtcVersion,u="https://statistic.live.126.net/statistic/realtime/sdkFunctioninfo",l=function h(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,r["default"])(this,h);var e=t.appkey,n=t.platform;this.apis={},this.isRtc=/WebRTC/.test(n),this.init(e,n),this.resetStatus()};e["default"]=l;var d=l.prototype;d.init=function(t,e){this.apis=Object.assign(this.apis,{ver:1,platform:e,sdk_ver:c||"v4.4.0",uid:null,appkey:t,time:null})},d.start=function(t){this.calling=!0,this.apis=Object.assign(this.apis,t)},d.resetStatus=function(){this.calling=!1,this.apis=Object.assign(this.apis,{p2p:{value:0},meeting:{value:0},bypass:{value:0},call_control_type:{value:0},self_mute:{value:-1},self_mic_mute:{value:-1},switch_p2p_type:{value:0},set_speaker:{value:-1},net_detect:{value:this.isRtc?-1:0},beautify:{value:-1},water_mark:{value:-1},audio_samples:{value:-1},video_samples:{value:-1},pre_view_mirror:{value:-1},code_mirror:{value:-1},custom_audio:{value:-1},custom_video:{value:-1},audio_mix:{value:-1},snap_shot:{value:-1},record:{value:0},audio_record:{value:0},display:{value:0},android_compatibility:{value:-1},hd_audio:{value:0},video_quality:{value:0},fps:{value:0},prefered_video_encoder:{value:-1},prefered_video_decoder:{value:-1},video_max_encode_bitrate:{value:this.isRtc?-1:0},audio_scene:{value:-1},video_adaptive_strategy:{value:this.isRtc?-1:0},ans:{value:this.isRtc?-1:0},agc:{value:-1},dtx:{value:-1},aec:{value:this.isRtc?-1:0},awc:{value:this.isRtc?-1:0}})},d.update=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments[1],n=t.key,i=t.ext;t.constructor===String&&(n=t),i=i||e,this.apis[n]&&(this.apis[n].value=1,void 0!==i&&(this.apis[n].ext=i),/(p2p|meeting)/.test(n)&&(this.calling=!0))},d.send=function(){var t=this;this.calling&&(this.calling=!1,this.apis.time=Date.now(),(0,s.ajax)({type:"post",url:u,data:this.apis}).then(function(e){t.resetStatus()})["catch"](function(e){console.log("err",e),t.resetStatus()}))},t.exports=e["default"]},,,,,,,,,function(t,e){"use strict";e.__esModule=!0,e["default"]=function(t){if(!t.url||!t.data)return Promise.reject("参数不完整,无法发起请求");t.dataType=t.dataType||"json";var e=new XMLHttpRequest;return e.open(t.type||"GET",t.url,!0),e.responseType=""+t.dataType,e.setRequestHeader("Content-type","application/json;charset=UTF-8"),new Promise(function(n,i){e.onload=function(){var t=e.response;n(t)},e.onerror=function(t){i(t)},e.send(JSON.stringify(t.data))})};t.exports=e["default"]},function(t,e){"use strict";e.__esModule=!0,e["default"]={html2node:function(t){var e=document.createElement("div");e.innerHTML=t;var n,i,o=[];if(e.children)for(n=0,i=e.children.length;n<i;n++)o.push(e.children[n]);else for(n=0,i=e.childNodes.length;n<i;n++){var r=e.childNodes[n];1===r.nodeType&&o.push(r)}return o.length>1?e:o[0]},n2node:function(t){return t?/HTML.+Element/gi.test(t)?t:t[0]&&/HTML.+Element/gi.test(t[0])?t[0]:null:null}},t.exports=e["default"]},function(t,e){"use strict";e.__esModule=!0,e["default"]={merge:function(){var t=arguments;return t[0]=Object.assign.apply(Object.assign,arguments),t[0]},verifyOptions:function(){var t=arguments;if(t[0]&&t[0].constructor===Object)for(var e=1;e<arguments.length;e++){var n=t[e];n=n.split(" "),n.map(function(e){if(!t[0][e])throw Error("参数缺失 "+e)})}},guid:function(){var t=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return function(){return t()+t()+t()+t()+t()+t()+t()+t()}}()},t.exports=e["default"]},,,function(t,e,n){t.exports={"default":n(122),__esModule:!0}},function(t,e,n){t.exports={"default":n(123),__esModule:!0}},function(t,e,n){t.exports={"default":n(124),__esModule:!0}},function(t,e,n){n(127),t.exports=n(10).Object.assign},function(t,e,n){n(128);var i=n(10).Object;t.exports=function(t,e){return i.create(t,e)}},function(t,e,n){n(129),t.exports=n(10).Object.setPrototypeOf},function(t,e,n){"use strict";var i=n(24),o=n(43),r=n(25),s=n(59),a=n(57),c=Object.assign;t.exports=!c||n(18)(function(){var t={},e={},n=Symbol(),i="abcdefghijklmnopqrst";return t[n]=7,i.split("").forEach(function(t){e[t]=t}),7!=c({},t)[n]||Object.keys(c({},e)).join("")!=i})?function(t,e){for(var n=s(t),c=arguments.length,u=1,l=o.f,d=r.f;c>u;)for(var h,f=a(arguments[u++]),p=l?i(f).concat(l(f)):i(f),v=p.length,m=0;v>m;)d.call(f,h=p[m++])&&(n[h]=f[h]);return n}:c},function(t,e,n){var i=n(11),o=n(14),r=function(t,e){if(o(t),!i(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,i){try{i=n(45)(Function.call,n(58).f(Object.prototype,"__proto__").set,2),i(t,[]),e=!(t instanceof Array)}catch(o){e=!0}return function(t,n){return r(t,n),e?t.__proto__=n:i(t,n),t}}({},!1):void 0),check:r}},function(t,e,n){var i=n(17);i(i.S+i.F,"Object",{assign:n(125)})},function(t,e,n){var i=n(17);i(i.S,"Object",{create:n(42)})},function(t,e,n){var i=n(17);i(i.S,"Object",{setPrototypeOf:n(126).set})},,,,,,,,,,,,,,,,,,,,function(t,e){function n(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}t.exports=n,n.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),n=Math.floor(e*this.jitter*t);t=0==(1&Math.floor(10*e))?t-n:t+n}return 0|Math.min(t,this.max)},n.prototype.reset=function(){this.attempts=0},n.prototype.setMin=function(t){this.ms=t},n.prototype.setMax=function(t){this.max=t},n.prototype.setJitter=function(t){this.jitter=t}},,,function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var o=n(105),r=i(o),s=n(172),a=i(s),c=n(173),u=i(c);e["default"]={DataApi:function(t){return new r["default"](t)},DataRtc:function(t){return new a["default"](t)},DataStats:function(t){return new u["default"](t)}},t.exports=e["default"]},,,,,,,,,,function(t,e){"use strict";function n(t){i(t.enable)&&(this.enable=t.enable?1:0),i(t.needBadge)&&(this.needBadge=t.needBadge?1:0),i(t.needPushNick)&&(this.needPushNick=t.needPushNick?1:0),i(t.pushContent)&&(this.pushContent=""+t.pushContent),i(t.custom)&&(this.custom=""+t.custom),i(t.pushPayload)&&(this.pushPayload=""+t.pushPayload),i(t.sound)&&(this.sound=""+t.sound),i(t.webrtcEnable)&&(this.webrtcEnable=t.webrtcEnable?1:0)}e.__esModule=!0,e["default"]=function(t){var e=t.util;return i=e.notundef,n};var i=void 0;t.exports=e["default"]},,,,,,,,,,function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var o=n(6),r=i(o),s=n(41),a=n(13),c=a.info.nrtcVersion,u="https://statistic.live.126.net/statistic/realtime/sdkinfo",l=function f(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,r["default"])(this,f);var e=t.appkey;this.infos={},this.userlist=[],this.localVolumn=0,this.local={},this.remote={},this.init(e),this.resetStatus()};e["default"]=l;var d=l.prototype;d.init=function(t){this.infos=Object.assign(this.infos,{ver:1,device:-1,isp:-1,platform:h.convertPlatform(platform.os.family)+"-"+platform.os.version,browser:platform.name+"-"+platform.version,sdk_ver:c||"3.6.0",appkey:t,interval:60,samples:30,time:null,qos_algorithm:-1,fec_algorithm:-1,qos_scene:-1,qos_strategy:-1})},d.resetStatus=function(){this.infos=Object.assign(this.infos,{uid:null,cid:null,push_url:null,turn_ip:null,proxy_ip:null,meeting:!1,live:!1}),this.clearInfoData(),this.uidSsrcMap={},this.userlist=[]},d.initInfoData=function(t){var e={uid:t,cid:this.imInfo&&this.imInfo.channelId||-1,push_url:this.sessionConfig&&this.sessionConfig.rtmpUrl||-1,turn_ip:this.imInfo&&this.imInfo.turnMap||-1,proxy_ip:this.imInfo&&this.imInfo.turnMap||-1,meeting:/^meeting$/gi.test(this.imInfo.sessionMode),live:this.sessionConfig&&this.sessionConfig.liveEnable||!1,p2p:!1,isp:-1,net:-1,connect_state:this.imInfo&&this.imInfo.code||200,signalling_time:(this.sessionConfig&&this.sessionConfig.signalEndTime||0)-(this.sessionConfig&&this.sessionConfig.signalStartTime||0),connect_time:(this.sessionConfig&&this.sessionConfig.rtcEndTime||0)-(this.sessionConfig&&this.sessionConfig.rtcStartTime||0)};this.infos=Object.assign(this.infos,e)},d.clearInfoData=function(){this.localVolumn=0,this.infos=Object.assign(this.infos,{rx:{audio:[],video:[]},tx:{a_lost:[],v_lost:[],rtt:[],rtt_mdev:[],set_v_fps:[],qos_v_fps:[],v_fps:[],set_v_quality:[],real_v_res:[],real_v_kbps:[],real_v_kbps_n:[],real_a_kbps:[],real_a_kbps_n:[],set_v_kbps:[],qos_v_kbps:[],tx_bw_kbps:[],a_volume:[]}})},d.start=function(t){var e=this,n=t.info,i=t.imInfo,o=t.remoteUidMsidMap,r=t.sessionConfig,s=t.rtcConnection,a=t.uid;i&&o&&s&&(this.infos.appkey=n.appKey||n.appkey||this.infos.appkey,this.imInfo=i||{},this.remoteUidMsidMap=o||{},this.sessionConfig=r||{},this.rtcConnection=s,this.videoConfig=t.videoConfig||{},this.statsTimer||(this.getTurnMap(),this.initInfoData(a),this.format(),this.statsTimer=setInterval(function(){e.sendInfo()},1e3*this.infos.interval)))},
d.stop=function(){this.statsTimer&&(clearInterval(this.statsTimer),this.statsTimer=null,this.resetStatus())},d.update=function(t){this.rtcStats=t,this.format(),this.updateRxMediaInfo(),this.updateTxMediaInfo()},d.updateOnce=function(t){var e=t.imInfo,n=t.remoteUidMsidMap,i=t.sessionConfig,o=t.rtcConnection;e&&(this.imInfo=e||{},this.remoteUidMsidMap=n||{},this.sessionConfig=i||{},this.rtcConnection=o||{},this.videoConfig=t.videoConfig||{},this.getTurnMap(),this.initInfoData(),this.sendInfo())},d.updateLocalVolumn=function(t){this.localVolumn=t},d.updateRxMediaInfo=function(){var t=this,e={u:[],g:[],c:[],bn:[],bc:[]},n={u:[],i:[],bn:[],bc:[],r:[],f:[]};this.userlist.map(function(i){var o=t.getMediaStats(i);e.u.push(o.audio.u),e.g.push(-1),e.c.push(-1),e.bn.push(o.audio.bn),e.bc.push(o.audio.bc),n.u.push(o.video.u),n.i.push(o.video.i),n.bn.push(o.video.bn),n.bc.push(o.video.bc),n.r.push(o.video.r),n.f.push(o.video.f)}),this.infos.rx.audio.push(e),this.infos.rx.video.push(n)},d.getMediaStats=function(t){var e=this.rtcStats,n={audio:{u:+t,g:-1,c:-1,bn:0,bc:0},video:{u:+t,i:-1,bn:0,bc:0,r:-1,f:0}},i={},o=this.uidSsrcMap[t];if(!o)return n;o=o.join("|");var r=new RegExp("("+o+")");return e.results.filter(function(t){return r.test(t.ssrc)&&(i[t.mediaType]=t),r.test(t)}),i.audio&&(n.audio.bn=(i.audio.availableBandwidth||0)-0,n.audio.bc=-1),i.video&&(n.video.bn=(i.video.availableBandwidth||0)-0,n.video.bc=i.video.googFrameWidthReceived+"x"+i.video.googFrameHeightReceived,n.video.f=(i.video.googFrameRateDecoded||0)-0),n},d.getLocalMediaStats=function(){var t=this.rtcStats,e={a_lost:-1,v_lost:-1,rtt:0,rtt_mdev:-1,set_v_fps:this.videoConfig.frameRate||0,qos_v_fps:0,v_fps:0,set_v_quality:this.sessionConfig.videoQuality,real_v_res:0,real_v_kbps:0,real_v_kbps_n:0,real_a_kbps:-1,real_a_kbps_n:0,set_v_kbps:-1,qos_v_kbps:0,tx_bw_kbps:0,a_volume:0},n={},i=this.imInfo.uid,o=this.uidSsrcMap[i];if(!o)return e;o=o.join("|");var r=new RegExp("("+o+")");return t.results.filter(function(t){return t.localCandidateId?void(n.rtt=t):(r.test(t.ssrc)&&(n[t.mediaType]=t),r.test(t))}),n.audio&&(e.real_a_kbps_n=(n.audio.availableBandwidth||t.audio.send.availableBandwidth)-0,e.a_volume=this.localVolumn-0),n.video&&(e.qos_v_fps=n.video.googFrameRateInput-0,e.v_fps=n.video.googFrameRateSent-0,e.real_v_res=n.video.googFrameWidthSent+"x"+n.video.googFrameHeightSent,e.real_v_kbps=n.video.googEncodeUsagePercent-0,e.real_v_kbps_n=n.video.availableBandwidth-0),e.rtt=n.rtt.googRtt-0,e.tx_bw_kbps=(t.connectionType.bitsSentPerSecond||0)-0,e},d.updateTxMediaInfo=function(){var t=this.getLocalMediaStats(),e=this.infos.tx;for(var n in t)e[n].push(t[n]);this.infos.net=h.convertNetwork(this.rtcStats.connectionType.local.networkType[0])},d.getTurnMap=function(){var t=this.imInfo;t.serverMap&&(t.turnMap=JSON.parse(t.serverMap||null),t.turnMap=t.turnMap&&t.turnMap.turnaddrs,t.turnMap=t.turnMap&&t.turnMap[0],t.turnMap=t.turnMap.constructor===Array?t.turnMap[0]:t.turnMap,t.turnMap=t.turnMap&&t.turnMap.match(/\d+\.\d+.\d+\.\d+/),t.turnMap=t.turnMap[0])},d.getSsrc=function(t,e){var n=[],i={audio:this.getTypeSsrc("audio",t,e),video:this.getTypeSsrc("video",t,e)};return i.audio&&n.push(i.audio),i.video&&n.push(i.video),n},d.getTypeSsrc=function(t,e,n){var i=void 0,o="";if(i=new RegExp(t+"[.\\r\\n\\s\\S]*ssrc:(\\d+)\\smsid:"+e),o=n.match(i),o=o&&o[0])return i=new RegExp("ssrc:\\d+\\smsid:"+e),o=o.match(i),o=o.map(function(t){return i=new RegExp("ssrc:(\\d+)\\s"),t=t.match(i),t[1]})},d.format=function(){this.formatLocal(),this.formatRemote()},d.formatLocal=function(){this.localSdp=this.rtcConnection.localDescription,this.localStream=this.rtcConnection.getLocalStreams()[0],this.localStream&&(this.uidSsrcMap[this.imInfo.uid]=this.getSsrc(this.localStream.id,this.localSdp.sdp),this.local.ssrc=this.uidSsrcMap[this.imInfo.uid])},d.formatRemote=function(){this.remoteSdp=this.rtcConnection.remoteDescription,this.userlist=[];var t=this.remoteUidMsidMap;for(var e in t)this.userlist.push(e),this.remote[e]={},this.uidSsrcMap[e]=this.getSsrc(t[e],this.remoteSdp.sdp),this.remote[e].ssrc=this.uidSsrcMap[e]},d.sendInfo=function(){var t=this;this.infos.uid&&this.infos.cid&&(this.infos.time=Date.now(),this.infos.samples=this.infos.rx.audio.length,(0,s.ajax)({type:"post",url:u,data:this.infos}).then(function(e){t.clearInfoData()})["catch"](function(e){t.clearInfoData()}))};var h={convertNetwork:function(t){var e={wlan:"wifi",lan:"ethernet"};return e[t]||"unknown"},convertPlatform:function(t){var e=/Windows/i,n=/OS X/i,i=void 0;return i=e.test(t)&&"Win"||t,i=n.test(i)&&"Mac"||i}};t.exports=e["default"]},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var o=n(6),r=i(o),s=n(41),a=n(13),c=a.info.nrtcVersion,u="//statistic.live.126.net/webrtc/stat",l=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,r["default"])(this,t);var n=e.appkey;this.infos={},this.init(n),this.resetStatus()}return t.prototype.resetStatus=function(){},t.prototype.init=function(t){this.infos=Object.assign(this.infos,{interval:60,ver:1,platform:d.convertPlatform(platform.os.family)+"-"+platform.os.version,browser:platform.name+"-"+platform.version,sdk_ver:c||"3.6.0",uid:null,appkey:t,time:null,data:{}})},t.prototype.clear=function(){this.infos.data={}},t.prototype.start=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.infos.appkey=e.appKey||e.appkey||this.infos.appkey,this.infos.cid=e.cid,this.infos.uid=e.uid,this.statsTimer||(this.statsTimer=setInterval(function(){t.send()},1e3*this.infos.interval))},t.prototype.stop=function(){this.statsTimer&&(clearInterval(this.statsTimer),this.statsTimer=null,this.clear())},t.prototype.update=function(t){this.infos.data["stat_"+Date.now()]=t},t.prototype.send=function(){var t=this;0!==Object.keys(this.infos.data).length&&(this.infos.time=Date.now(),(0,s.ajax)({type:"post",url:u,data:this.infos}).then(function(e){t.clear()})["catch"](function(t){console.log("err",t)}))},t}();e["default"]=l;var d={convertNetwork:function(t){var e={wlan:"wifi",lan:"ethernet"};return e[t]||"unknown"},convertPlatform:function(t){var e=/Windows/i,n=/OS X/i,i=void 0;return i=e.test(t)&&"Win"||t,i=n.test(i)&&"Mac"||i}};t.exports=e["default"]},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e){"use strict";e.__esModule=!0;var n,i,o={NETCALL_TYPE_AUDIO:1,NETCALL_TYPE_VIDEO:2,NETCALL_CONTROL_COMMAND_NOTIFY_AUDIO_ON:1,NETCALL_CONTROL_COMMAND_NOTIFY_AUDIO_OFF:2,NETCALL_CONTROL_COMMAND_NOTIFY_VIDEO_ON:3,NETCALL_CONTROL_COMMAND_NOTIFY_VIDEO_OFF:4,NETCALL_CONTROL_COMMAND_SWITCH_AUDIO_TO_VIDEO:5,NETCALL_CONTROL_COMMAND_SWITCH_AUDIO_TO_VIDEO_AGREE:6,NETCALL_CONTROL_COMMAND_SWITCH_AUDIO_TO_VIDEO_REJECT:7,NETCALL_CONTROL_COMMAND_SWITCH_VIDEO_TO_AUDIO:8,NETCALL_CONTROL_COMMAND_BUSY:9,NETCALL_CONTROL_COMMAND_SELF_CAMERA_INVALID:10,NETCALL_CONTROL_COMMAND_SELF_AUDIO_INVALID:11,NETCALL_CONTROL_COMMAND_SELF_ON_BACKGROUND:12,NETCALL_CONTROL_COMMAND_START_NOTIFY_RECEIVED:13,NETCALL_CONTROL_COMMAND_NOTIFY_RECORD_START:14,NETCALL_CONTROL_COMMAND_NOTIFY_RECORD_STOP:15,DEVICE_TYPE_AUDIO_IN:0,DEVICE_TYPE_AUDIO_OUT_LOCAL:1,DEVICE_TYPE_AUDIO_OUT_CHAT:2,DEVICE_TYPE_VIDEO:3,DEVICE_STATUS_NO_CHANGE:0,DEVICE_STATUS_CHANGE:1,DEVICE_STATUS_WORK_REMOVE:2,DEVICE_STATUS_RESET:4,DEVICE_STATUS_START:8,DEVICE_STATUS_END:16,CHAT_VIDEO_QUALITY_NORMAL:0,CHAT_VIDEO_QUALITY_LOW:1,CHAT_VIDEO_QUALITY_MEDIUM:2,CHAT_VIDEO_QUALITY_HIGH:3,CHAT_VIDEO_QUALITY_480P:4,CHAT_VIDEO_QUALITY_720P:5,CHAT_VIDEO_QUALITY_540P:6,CHAT_VIDEO_ENCODEMODE_NORMAL:0,CHAT_VIDEO_ENCODEMODE_SMOOTH:1,CHAT_VIDEO_ENCODEMODE_QUALITY:2,CHAT_VIDEO_ENCODEMODE_SCREEN:3,CHAT_VIDEO_FRAME_RATE_NORMAL:0,CHAT_VIDEO_FRAME_RATE_5:1,CHAT_VIDEO_FRAME_RATE_10:2,CHAT_VIDEO_FRAME_RATE_15:3,CHAT_VIDEO_FRAME_RATE_20:4,CHAT_VIDEO_FRAME_RATE_25:5,CHAT_VIDEO_SCALE_None:0,CHAT_VIDEO_SCALE_1x1:1,CHAT_VIDEO_SCALE_4x3:2,CHAT_VIDEO_SCALE_16x9:3,CHAT_USER_LEFT_TIMEOUT:-1,CHAT_USER_LEFT_NORMAL:0,CHAT_NET_STATUS_VERY_GOOD:0,CHAT_NET_STATUS_GOOD:1,CHAT_NET_STATUS_POOR:2,CHAT_NET_STATUS_BAD:3,CHAT_NET_STATUS_VERY_BAD:4,CLIENT_TYPE_AOS:1,CLIENT_TYPE_IOS:2,CLIENT_TYPE_PC:4,CLIENT_TYPE_WINPHONE:8,CLIENT_TYPE_WEB:16,CLIENT_TYPE_REST:32,LAYOUT_SPLITBOTTOMHORFLOATING:0,LAYOUT_SPLITTOPHORFLOATING:1,LAYOUT_SPLITLATTICETILE:2,LAYOUT_SPLITLATTICECUTTINGTILE:3,LAYOUT_SPLITCUSTOMLAYOUT:4,LAYOUT_SPLITAUDIOLAYOUT:5,NETDETECT_AUDIO:0,NETDETECT_VIDEO:1};o.deviceTypeMap=(n={},n[o.DEVICE_TYPE_AUDIO_IN]="audioIn",n[o.DEVICE_TYPE_AUDIO_OUT_CHAT]="audioOut",n[o.DEVICE_TYPE_VIDEO]="video",n),o.getDeviceTypeStr=function(t){return o.deviceTypeMap[t]},o.deviceStatusMap=(i={},i[o.DEVICE_STATUS_NO_CHANGE]="noChange",i[o.DEVICE_STATUS_CHANGE]="change",i[o.DEVICE_STATUS_WORK_REMOVE]="workRemove",i[o.DEVICE_STATUS_RESET]="reset",i[o.DEVICE_STATUS_START]="start",i[o.DEVICE_STATUS_END]="end",i),o.getDeviceStatusStr=function(t){return o.deviceStatusMap[t]},e["default"]=o,t.exports=e["default"]},,,,,,,,,,,,,,,,function(t,e,n){"use strict";var i=n(162),o={};o.install=function(t){var e=t.fn,n=t.util,o=i({util:n});e.initNetcall=function(t){return n.verifyOptions(t,"type accounts","netcall::initNetcall"),t.pushContent="",t.custom="",t.pushConfig||(t.pushConfig={}),t.pushConfig.webrtcEnable=t.webrtcEnable,t.pushConfig=new o(t.pushConfig),this.cbAndSendCmd("initNetcall",t)},e.keepCalling=function(t){return n.verifyOptions(t,"type accounts channelId","netcall::keepCalling"),this.cbAndSendCmd("keepCalling",t)},e.calleeAck=function(t){return n.verifyOptions(t,"account channelId type accepted","netcall::calleeAck"),this.cbAndSendCmd("calleeAck",t)},e.hangup=function(t){return n.verifyOptions(t,"channelId","netcall::hangup"),this.cbAndSendCmd("hangup",t)},e.netcallControl=function(t){return n.verifyOptions(t,"channelId type","netcall::netcallControl"),this.cbAndSendCmd("netcallControl",t)},e.createChannel=function(t){return this.cbAndSendCmd("createChannel",t)},e.joinChannel=function(t){return n.verifyOptions(t,"channelName","netcall::joinChannel"),n.verifyBooleanWithDefault(t,"liveEnable",!1,"","netcall::joinChannel"),n.verifyBooleanWithDefault(t,"webrtcEnable",!1,"","netcall::joinChannel"),this.cbAndSendCmd("joinChannel",{channelName:t.channelName,liveOption:{liveEnable:t.liveEnable?1:0,webrtcEnable:t.webrtcEnable?1:0}})},e.queryAccountUidMap=function(t,e){return this.cbAndSendCmd("queryAccountUidMap",{channelName:t,uids:e})}},t.exports=o},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e){"use strict";var n={};n.install=function(t){var e=t.Protocol.fn;e.processNetcall=function(t){switch(t.cmd){case"initNetcall":this.onInitNetcall(t);break;case"beCalled":this.onBeCalled(t);break;case"keepCalling":this.onKeepCalling(t);break;case"calleeAck":break;case"notifyCalleeAck":this.onNotifyCalleeAck(t);break;case"hangup":break;case"notifyHangup":this.onNotifyHangup(t);break;case"notifyNetcallControl":this.onNetcallControl(t);break;case"notifyCalleeAckSync":this.onNotifyCalleeAckSync(t);break;case"notifyNetcallRecord":this.onMsg(t);break;case"createChannel":break;case"joinChannel":this.joinChannel(t);break;case"notifyJoin":this.notifyJoin(t)}},e.onInitNetcall=function(t){if(!t.error){var e=t.obj.type;t.obj=t.content,t.obj.type=e,t.obj.accounts=t.obj.keepCallingAccounts,this.setCurrentNetcall(t.obj.channelId),this.keepCalling(t)}},e.setCurrentNetcall=function(t){this.currentNetcallChannelId=t},e.onKeepCalling=function(t){t.error||t.content.accounts.length&&this.keepCalling(t)},e.keepCalling=function(t){var e=this,n=t.obj,i=n.type,o=n.accounts,r=n.channelId;o&&o.length&&setTimeout(function(){e.currentNetcallChannelId&&e.currentNetcallChannelId===r&&e.api.keepCalling({type:i,accounts:o,channelId:r})["catch"](function(){})},3e3)},e.onBeCalled=function(t){t.error||this.emitAPI({type:"beCalled",obj:t.content})},e.onNotifyCalleeAck=function(t){t.error||this.emitAPI({type:"notifyCalleeAck",obj:t.content})},e.onNotifyHangup=function(t){t.error||this.emitAPI({type:"notifyHangup",obj:t.content})},e.onNetcallControl=function(t){t.error||this.emitAPI({type:"netcallControl",obj:t.content})},e.onNotifyCalleeAckSync=function(t){t.error||this.emitAPI({type:"notifyCalleeAckSync",obj:t.content})},e.notifyJoin=function(t){t.error||this.emitAPI({type:"notifyJoin",obj:t.content})},e.joinChannel=function(t){t.obj=t.content}},t.exports=n},,,,,,,,,function(t,e){"use strict";var n=9,i={netcall:{id:n,initNetcall:1,keepCalling:3,calleeAck:4,notifyCalleeAck:5,hangup:6,notifyHangup:7,netcallControl:8,notifyNetcallControl:9,verifyChannelId:10,createChannel:13,joinChannel:14,queryAccountUidMap:16}},o={initNetcall:{sid:n,cid:i.netcall.initNetcall,params:[{type:"byte",name:"type"},{type:"StrArray",name:"accounts"},{type:"String",name:"pushContent"},{type:"String",name:"custom"},{type:"Property",name:"pushConfig"}]},keepCalling:{sid:n,cid:i.netcall.keepCalling,params:[{type:"byte",name:"type"},{type:"StrArray",name:"accounts"},{type:"long",name:"channelId"}]},calleeAck:{sid:n,cid:i.netcall.calleeAck,params:[{type:"string",name:"account"},{type:"long",name:"channelId"},{type:"byte",name:"type"},{type:"bool",name:"accepted"}]},hangup:{sid:n,cid:i.netcall.hangup,params:[{type:"long",name:"channelId"}]},netcallControl:{sid:n,cid:i.netcall.netcallControl,params:[{type:"long",name:"channelId"},{type:"byte",name:"type"}]},verifyChannelId:{sid:n,cid:i.netcall.verifyChannelId,params:[{type:"long",name:"channelId"},{type:"String",name:"account"}]},createChannel:{sid:n,cid:i.netcall.createChannel,params:[{type:"String",name:"channelName"},{type:"String",name:"custom"},{type:"String",name:"webrtcEnable"}]},joinChannel:{sid:n,cid:i.netcall.joinChannel,params:[{type:"String",name:"channelName"},{type:"Property",name:"liveOption"}]},queryAccountUidMap:{sid:n,cid:i.netcall.queryAccountUidMap,params:[{type:"String",name:"channelName"},{type:"LongArray",name:"uids"}]}},r="netcall",s={"9_1":{service:r,cmd:"initNetcall",response:[{type:"Number",name:"timetag"},{type:"Number",name:"uid"},{type:"Number",name:"channelId"},{type:"StrArray",name:"turnServerList"},{type:"StrArray",name:"sturnServerList"},{type:"StrArray",name:"proxyServerList"},{type:"StrArray",name:"keepCallingAccounts"},{type:"StrLongMap",name:"accountUidMap"},{type:"String",name:"clientConfig"},{type:"String",name:"serverMap"}]},"9_2":{service:r,cmd:"beCalled",response:[{type:"Number",name:"timetag"},{type:"Number",name:"type"},{type:"Number",name:"channelId"},{type:"String",name:"account"},{type:"Number",name:"uid"},{type:"StrArray",name:"turnServerList"},{type:"StrArray",name:"sturnServerList"},{type:"StrArray",name:"proxyServerList"},{type:"StrLongMap",name:"accountUidMap"},{type:"String",name:"clientConfig"},{type:"String",name:"custom"},{type:"Property",name:"pushConfig"},{type:"String",name:"serverMap"}]},"9_3":{service:r,cmd:"keepCalling",response:[{type:"StrArr",name:"accounts"}]},"9_4":{service:r,cmd:"calleeAck",response:[]},"9_5":{service:r,cmd:"notifyCalleeAck",response:[{type:"String",name:"account"},{type:"long",name:"channelId"},{type:"byte",name:"type"},{type:"bool",name:"accepted"}]},"9_6":{service:r,cmd:"hangup",response:[]},"9_7":{service:r,cmd:"notifyHangup",response:[{type:"long",name:"channelId"},{type:"String",name:"account"},{type:"long",name:"timetag"}]},"9_8":{service:r,cmd:"netcallControl",response:[]},"9_9":{service:r,cmd:"notifyNetcallControl",response:[{type:"String",name:"account"},{type:"byte",name:"type"},{type:"long",name:"channelId"}]},"9_10":{service:r,cmd:"verifyChannelId",response:[]},"9_11":{service:r,cmd:"notifyNetcallRecord",response:[{type:"Property",name:"msg"}]},"9_12":{service:r,cmd:"notifyCalleeAckSync",response:[{type:"String",name:"timetag"},{type:"long",name:"channelId"},{type:"byte",name:"type"},{type:"bool",name:"accepted"},{type:"byte",name:"fromClientType"}]},"9_13":{service:r,cmd:"createChannel",response:[{type:"long",name:"timetag"}]},"9_14":{service:r,cmd:"joinChannel",response:[{type:"long",name:"timetag"},{type:"long",name:"channelId"},{type:"StrLongMap",name:"accountUidMap"},{type:"String",name:"serverMap"},{type:"String",name:"clientConfig"},{type:"String",name:"custom"}]},"9_15":{service:r,cmd:"notifyJoin",response:[{type:"Long",name:"channelId"},{type:"StrLongMap",name:"accountUidMap"}]},"9_16":{service:r,cmd:"queryAccountUidMap",response:[]}};t.exports={idMap:i,cmdConfig:o,packetConfig:s}},function(t,e){"use strict";t.exports={pushConfig:{enable:1,needBadge:2,needPushNick:3,pushContent:4,custom:5,pushPayload:6,sound:7,webrtcEnable:10},liveOption:{liveEnable:1,webrtcEnable:2}}},function(t,e){"use strict";t.exports={pushConfig:{1:"enable",2:"needBadge",3:"needPushNick",4:"pushContent",5:"custom",6:"pushPayload",7:"sound",10:"webrtcEnable"},liveOption:{1:"liveEnable",2:"webrtcEnable"}}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}var o=n(98),r=i(o),s=n(6),a=i(s),c=n(16),u=i(c),l=n(15),d=i(l),h=n(41),f=n(152),p=void 0,v=void 0,m=n(19),_=n(351),g=n(13),y=n(352),C=n(353),T=n(342),A=n(203),S=g.agentVersion,b=function(t){function e(n){(0,a["default"])(this,e);var i=(0,u["default"])(this,t.call(this));return n.container=h.element.n2node(n.container),n.remoteContainer=h.element.n2node(n.remoteContainer),i.setUtil(p),p.undef(n.heartbeat)&&(n.heartbeat=!0),p.merge(i,n),i.init(),i}return(0,d["default"])(e,t),e}(m);b.install=function(t){p=t.util,v=t.Promise,y.install(t),C.install(t),T.install(t)};var E=b.prototype;E.init=function(){this.signal=null,this.signalInited=!1,this.localStreamInfo=null,this.resetStatus(),this.initProtocol(),this.dataApi=(0,f.DataApi)({appkey:this.nim.options.appKey,platform:"PC-Agent"})},E.resetStatus=function(){this.channelId=null,this.channelName=null,this.type=null,this.target=null,this.sessionMode=null,this.sessionConfig={},this.isCaller=!1,this.callee=null,this.remoteStreamInfo={},this.calling=!1,this.callAccepted=!1,this.callerInfo=null,this.nim.protocol.setCurrentNetcall(),this.needQueryAccountMap={}},E.initProtocol=function(){var t=this.nim;this.account=this.nim.account,t.on("beCalled",this.onBeCalled.bind(this)),t.on("notifyCalleeAck",this.onCalleeAck.bind(this)),t.on("notifyHangup",this.onHangup.bind(this)),t.on("notifyUploadLog",this.uploadLog.bind(this)),t.on("netcallControl",this.onNetcallControl.bind(this)),t.on("notifyCalleeAckSync",this.onCalleeAckSync.bind(this)),t.on("notifyJoin",this.onNotifyJoin.bind(this))},E.getAccount=function(){return this.nim.account},E.getUid=function(){return this.accountUidMap?this.accountUidMap[this.nim.account]||"-1":"-1"},E.isCurrentChannelId=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.channelId&&this.channelId===t.channelId},E.notCurrentChannelId=function(t){return!this.isCurrentChannelId(t)},E.rejectWithNoSignal=function(){return this.resetWhenHangup(),v.reject({code:"noConnection"})},E.initSignal=function(){var t=this;return this.signal?this.stopSignal().then(function(){return t._initSignal()}):this._initSignal()},E._initSignal=function(){var t=this;return new v(function(e,n){var i=t.signal=new y({url:_.signalUrl,client:t,kickLast:t.kickLast,account:t.getAccount(),heartbeat:t.heartbeat,appkey:t.nim.options.appKey});i.on("init",function(i){return t.log(i),t.checkAgentVersion(i.version)?(t.localStreamInfo=i,t.signalInited=!0,void e()):(t.log("插件版本有更新,请下载最新的插件再使用音视频功能"),t.stopSignal(),i.error="请安装最新版插件,方可使用视频功能",i.errorType="agent_update",void n(i))}),i.on("initError",function(e){t.log(e),e=e||{},417===e.code&&(e.error="设备被别的程序占用中, 请检查重试",e.errorType="device_busy"),"noPC"===e.code&&(e.error="请安装插件PC Agent,方可使用音视频功能",e.errorType="agent_empty"),n(e),t.rejectWithNoSignal()}),i.on("close",function(){t.emit("signalClosed"),t.stopSignal()}),i.on("devices",function(e){t.emit("devices",e)}),i.on("login",function(e){t.emit("sessionStarted",e)}),i.on("deviceStatus",function(e){t.emit("deviceStatus",e)}),i.on("userJoined",t.onUserJoin.bind(t)),i.on("userLeft",t.onUserLeft.bind(t)),i.on("logUploaded",t.onLogUploaded.bind(t)),i.on("netStatus",function(e){var n=e.id,i=e.status;t.emit("netStatus",{account:t.getAccountWithUid(n),status:i})}),i.on("statistics",function(e){t.emit("statistics",e)}),i.on("audioVolume",function(e){var n=e.self,i=e.receiver,o={self:n};i&&i.forEach(function(e){var n=e.id,i=e.status;o[t.getAccountWithUid(n)]={status:i}}),t.emit("audioVolume",o)}),i.on("error",t.onError.bind(t)),i.on("recordMp4",t.onRecordMp4.bind(t)),i.on("heartBeatError",t.onError.bind(t))})},E.checkAgentVersion=function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"0.0.0.0",e=t.split("."),n=S.split("."),i=0;i<e.length;i++){if(+e[i]>+n[i])return!0;if(+e[i]<+n[i])return!1}return!0},E.stopSignal=function(){var t=this;return this.stopLocalStream(),this.stopRemoteStream(),this.signal?this.signal.stopSession().then(function(){t.signal.destroy(),t.signal=null,t.signalInited=!1}):v.resolve()},E.initNetcall=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.type,i=e.pushConfig;return this.type=n,this.sessionMode="p2p",this.nim.initNetcall({type:n,accounts:[this.callee],webrtcEnable:!0,pushConfig:i}).then(function(e){return t.callerInfo=e,t.channelId=e.channelId,v.resolve(e)},function(e){throw t.resetWhenHangup(),e})},E.initSession=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.signalInited){var n=this.isCaller?this.callerInfo:e.beCalledInfo;this.parseAccountUidMap(n.accountUidMap);var i=this.sessionConfig||{};return i.awc&&this.dataApi.update({key:"awc"}),i.ans&&this.dataApi.update({key:"ans"}),i.aec&&this.dataApi.update({key:"aec"}),this.signal.startSession((0,r["default"])({},n,i)).then(function(){return{channelId:t.channelId}})}return this.rejectWithNoSignal()},E.call=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.dataApi.update("p2p"),new v(function(n,i){if(!t.signalInited||t.calling)return t.resetStatus(),i({type:"statusNotMatch",error:"呼叫失败: 当前正在通话中或者Agent唤起失败,请排查"});var o=e.account,r=e.type,s=e.pushConfig,a=e.sessionConfig,c=void 0===a?{}:a;if(t.calling=!0,t.isCaller=!0,t.callee=t.target=o,t.sessionConfig=c,c.highAudio&&t.dataApi.update("hd_audio"),void 0!==c.videoFrameRate&&t.dataApi.update("fps",0===+c.videoFrameRate?0:+c.videoFrameRate+1),void 0!==c.videoEncodeMode&&t.dataApi.update("video_adaptive_strategy",c.videoEncodeMode||0),void 0!==c.videoBitrate&&t.dataApi.update("video_max_encode_bitrate",c.videoBitrate||""),void 0!==c.videoQuality){var u=c.videoQuality;u===A.CHAT_VIDEO_QUALITY_540P?u=A.CHAT_VIDEO_QUALITY_720P:u===A.CHAT_VIDEO_QUALITY_720P&&(u=A.CHAT_VIDEO_QUALITY_540P),t.dataApi.update("video_quality",u||0)}return o?t.initNetcall({type:r,pushConfig:s}).then(function(t){n(t)})["catch"](function(t){i(t)}):(t.resetStatus(),void i({code:"noCalleeAccount"}))})},E.onBeCalled=function(t){this.log("beCalling",t),this.emit("beCalling",t)},E.response=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.dataApi.update("p2p");var n=e.beCalledInfo;if(!n)return v.resolve();var i=n.accepted=e.accepted!==!1,o=this.sessionConfig=e.sessionConfig||{};if(o.highAudio&&this.dataApi.update("hd_audio"),void 0!==o.videoFrameRate&&this.dataApi.update("fps",0===+o.videoFrameRate?0:+o.videoFrameRate+1),void 0!==o.videoEncodeMode&&this.dataApi.update("video_adaptive_strategy",o.videoEncodeMode||0),void 0!==o.videoBitrate&&this.dataApi.update("video_max_encode_bitrate",o.videoBitrate||""),void 0!==o.videoQuality){var r=o.videoQuality;r===A.CHAT_VIDEO_QUALITY_540P?r=A.CHAT_VIDEO_QUALITY_720P:r===A.CHAT_VIDEO_QUALITY_720P&&(r=A.CHAT_VIDEO_QUALITY_540P),this.dataApi.update("video_quality",r||0)}return i?(this.type=n.type,this.channelId=n.channelId,this.target=n.account,this.calling=!0):(this.log("rejectNetcall",n),this.packNetcallRecord({type:n.type,channelId:n.channelId,isCaller:!1,target:n.account,recordType:"rejectNetcall"})),this.sessionMode="p2p",this.nim.calleeAck(n).then(function(){if(i)return t.initSession({beCalledInfo:n})},function(e){throw t.log(e),e})},E.onCalleeAck=function(t){if(!this.notCurrentChannelId(t))return t.accepted?this.initSession({type:t.type}):(this.log("netcallRejected",t),this.packNetcallRecord({type:t.type,channelId:t.channelId,isCaller:!0,target:t.account,recordType:"netcallRejected"}),this.resetWhenHangup(),this.emit("callRejected",t),void 0)},E.onUserJoin=function(t){this.log("onUserJoin ",t);var e=t.account,n=t.uid;return!e&&n&&(t.account=e=this.getAccountWithUid(n)),e?void this.emitUserJoin(t):(this.needQueryAccountMap[n]=t,void this.nim.queryAccountUidMap(this.channelName,[n]))},E.emitUserJoin=function(t){var e=t.uid,n=t.isMeeting;this.remoteStreamInfo[e]=t,this.dataApi.start({uid:this.getUid()}),n?this.emit("joinChannel",{type:t.type,uid:t.uid,account:t.account}):(this.callAccepted||(this.callAccepted=!0),this.emit("callAccepted",{type:t.type,account:t.account,uid:t.uid}))},E.onUserLeft=function(t){var e=this,n=t.account,i=t.uid,o=t.isMeeting;o?(!n&&i&&(t.account=this.getAccountWithUid(i)),this.emit("leaveChannel",{account:t.account})):(this.log("on user left",t),this.calling&&setTimeout(function(){t.account=e.getAccountWithUid(t.uid),e.onHangup(t)},1e3))},E.onNetcallControl=function(t){this.emit("control",t)},E.onCalleeAckSync=function(t){this.emit("callerAckSync",t),this.isCurrentChannelId(t)&&this.resetWhenHangup()},E.onNotifyJoin=function(t){var e=t.accountUidMap,n=this.needQueryAccountMap;this.parseAccountUidMap(e);for(var i in e){var o=i,r=e[i];if(r in n){var s=n[r];s.account=o,this.emitUserJoin(s),delete n[r]}}},E.onHangup=function(t){this.dataApi.send(),this.emit("hangup",t),this.isCurrentChannelId(t)&&this.resetWhenHangup()},E.hangup=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.channelId;!e&&this.calling&&this.channelId&&(e=this.channelId),e&&(this.dataApi.send(),this.nim.hangup({channelId:e})),e===this.channelId&&(this.isCaller&&!this.callAccepted&&(this.log("cancelNetcallBeforeAccept",{channelId:e}),this.packNetcallRecord({recordType:"cancelNetcallBeforeAccept"})),this.resetWhenHangup())},E.packNetcallRecord=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.recordType,n=p.exist(t.type)?t.type:this.type,i=p.exist(t.channelId)?t.channelId:this.channelId,o=p.exist(t.duration)?t.duration:0,r=p.exist(t.isCaller)?t.isCaller:this.isCaller,s=p.exist(t.target)?t.target:this.target,a=this.getAccount(),c=r?a:s,u=r?s:a,l=+new Date;this.nim.protocol.onMsg({content:{msg:{attach:JSON.stringify({data:{calltype:n,channel:i,duration:o,ids:[a,s],time:l},id:e}),from:c,fromClientType:r?16:0,fromDeviceId:"",fromNick:"",idClient:p.guid(),idServer:p.guid(),scene:0,time:l,to:u,type:5}}})},E.resetWhenHangup=function(){this.resetStatus(),this.signalInited&&this.signal.stopSession()},E.control=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.command,i=e.channelId;if(i||(i=this.channelId),n&&i)return this.dataApi.update("call_control_type"),this.nim.netcallControl({channelId:i,type:n})["catch"](function(e){throw t.log(e),e})},E.setVideoViewSize=function(t){return this.signalInited?this.signal.setVideoViewSize(t):this.rejectWithNoSignal()},E.setVideoViewRemoteSize=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.signalInited?(t.account&&(t.id=this.getUidWithAccount(t.account)),this.signal.setVideoViewRemoteSize(t)):this.rejectWithNoSignal()},E.setVideoScale=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.signalInited?(t.account&&(t.id=this.getUidWithAccount(t.account)),this.signal.setVideoScale(t)):this.rejectWithNoSignal()},E.startLocalStream=function(t){var e=this;if(this.dataApi.update("display"),this.signalInited&&!this.stream&&this.localStreamInfo){var n=t||this.container,i=this.localStreamInfo.port;this.stream=new C({client:this,url:_.genStreamUrl(i),container:n,mirror:this.mirror}),this.stream.on("resize",function(t){e.emit("streamResize",t)}),this.stream.on("error",function(t){e.emit("error",t)})}},E.stopLocalStream=function(){this.stream&&(this.stream.destroy(),this.stream=null)},E.startRemoteStream=function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"p2p"===this.sessionMode?(t=this.getUidWithAccount(this.target),this.remoteContainer||this.target||this.nim.logger.error("不传参数且点对点模式实例化Netcall必须设置remoteContainer与target;传参数必须包含account,node"),!this.getRemoteStream(t)&&this.remoteStreamInfo[t]&&this.addRemoteStream(this.remoteStreamInfo[t])):(t=e.uid||this.getUidWithAccount(e.account),e.node=h.element.n2node(e.node),t&&e.node?this.addRemoteStream(this.remoteStreamInfo[t],e.node):this.nim.logger.error("不传参数且点对点模式实例化Netcall必须设置remoteContainer与target;传参数必须包含account,node"))},E.stopRemoteStream=function(t){return t?this.removeRemoteStream(t):this.removeRemoteStreams()},E.addRemoteStream=function(t,e){var n=this,i=t.uid,o=t.port;this.remoteStreams||(this.remoteStreams={});var r=this.remoteStreams[i];r&&r.destroy(),r=this.remoteStreams[i]=new C({client:this,isRemote:!0,url:_.genStreamUrl(o),container:e||this.remoteContainer,mirror:this.mirrorRemote}),r.on("resize",function(t){n.emit("remoteStreamResize",t)}),r.on("error",function(t){n.emit("error",t)})},E.removeRemoteStreams=function(){var t=this;this.remoteStreams&&Object.keys(this.remoteStreams).forEach(function(e){t.remoteStreams[e].destroy()}),this.remoteStreams={}},E.removeRemoteStream=function(t){var e=this.getUidWithAccount(t);if(!this.remoteStreams[e]){var n={code:"accountNotMatch"};throw n}this.remoteStreams[e].destroy()},E.getRemoteStream=function(t){var e=this.getUidWithAccount(t);return this.remoteStreams&&this.remoteStreams[e]},E.suspendLocalStream=function(){this.stream&&this.stream.suspend()},E.resumeLocalStream=function(){this.stream&&this.stream.resume()},E.suspendRemoteStream=function(t){var e=this.getRemoteStream(t||this.target);e&&e.suspend()},E.resumeRemoteStream=function(t){var e=this.getRemoteStream(t||this.target);e&&e.resume()},E.switchVideoToAudio=function(){var t=this;return this.signalInited?(this.dataApi.update("switch_p2p_type"),this.signal.switchVideoToAudio().then(function(){t.type=A.NETCALL_TYPE_AUDIO})):this.rejectWithNoSignal()},E.switchAudioToVideo=function(){var t=this;return this.signalInited?(this.dataApi.update("switch_p2p_type"),this.signal.switchAudioToVideo().then(function(){t.type=A.NETCALL_TYPE_VIDEO})):this.rejectWithNoSignal()},E.getDevicesOfType=function(t){return this.signalInited?this.signal.getDevicesOfType(t):this.rejectWithNoSignal()},E.getStoredDevicesOfType=function(t){return this.signalInited?(t=+t,t===A.DEVICE_TYPE_AUDIO_OUT_LOCAL&&(t=A.DEVICE_TYPE_AUDIO_OUT_CHAT),this.signal.devicesMap[t]):void this.rejectWithNoSignal()},E.hasDevicesOfType=function(t){return this.getStoredDevicesOfType(t)},E.getStartedDeviceOfType=function(t){return this.signalInited?this.signal.deviceMap[t]:this.rejectWithNoSignal()},E.hasStartedDeviceOfType=function(t){return this.getStartedDeviceOfType(t)},E.stopDevice=function(t){return this.signalInited?this.hasStartedDeviceOfType(t)?this.signal.stopDevice(t):v.resolve():this.rejectWithNoSignal()},E.startDevice=function(t){var e=t.type,n=t.device;if(this.signalInited){if(p.exist(e)&&!n){if(this.hasStartedDeviceOfType(e))return v.resolve();this.hasDevicesOfType(e)&&(n=t.device=this.getStoredDevicesOfType(e)[0])}return n?this.signal.startDevice(t):v.reject((0,r["default"])({type:"noDevice"},t))}return this.rejectWithNoSignal()},E.setSessionVideoQuality=function(t){if(this.signalInited){if(void 0!==t){var e=t;e===A.CHAT_VIDEO_QUALITY_540P?e=A.CHAT_VIDEO_QUALITY_720P:e===A.CHAT_VIDEO_QUALITY_720P&&(e=A.CHAT_VIDEO_QUALITY_540P),this.dataApi.update("video_quality",e||0)}return this.signal.setVideoQuality(t)}return this.rejectWithNoSignal()},E.setSessionVideoFrameRate=function(t){return this.signalInited?(this.dataApi.update("fps",void 0!==t?+t+1:0),this.signal.setVideoFrameRate(t)):this.rejectWithNoSignal();
},E.setSessionVideoBitrate=function(t){return this.signalInited?(this.dataApi.update("video_max_encode_bitrate",t||""),this.signal.setVideoBitrate(t)):this.rejectWithNoSignal()},E.setCaptureVolume=function(t){return t=void 0===t?255:t,t.constructor===String&&(t=+t||255),this.signalInited?this.signal.setCaptureVolume(t):this.rejectWithNoSignal()},E.setPlayVolume=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};/(Number|String)/.test(t.constructor)&&(t={volume:t});var e=t,n=e.volume;return n=void 0===n?255:n,this.signalInited?this.signal.setPlayVolume(n):this.rejectWithNoSignal()},E.netDetect=function(t,e){return this.dataApi.update({key:"net_detect"}),t=void 0===t?A.NETDETECT_AUDIO:t,e=e||A.CHAT_VIDEO_QUALITY_480P,this.signalInited?this.signal.netDetect({appKey:this.nim.options.appKey,type:t,quality:e}):this.rejectWithNoSignal()},E.uploadLog=function(){var t=this;this.signalInited&&this.nim.getSimpleNosToken().then(function(e){t.signal.uploadLog(e)},function(e){t.log(e)})},E.onLogUploaded=function(t){this.nim.uploadSdkLogUrl(t)},E.log=function(){var t=this.nim.logger;t.log.apply(t,arguments)},E.info=function(){var t=this.nim.logger;t.info.apply(t,arguments)},E.parseAccountUidMap=function(t){var e=this;Object.keys(t).forEach(function(n){e.addAccountUidMap({account:n,uid:t[n]})})},E.addAccountUidMap=function(t){var e=t.account,n=t.uid;this.uidAccountMap||(this.uidAccountMap={}),this.uidAccountMap[n]=e,this.accountUidMap||(this.accountUidMap={}),this.accountUidMap[e]=n},E.getAccountWithUid=function(t){if(this.uidAccountMap)return this.uidAccountMap[t]},E.getUidWithAccount=function(t){if(this.accountUidMap)return this.accountUidMap[t]},E.onError=function(t){this.emit("error",t)},E.setAudioBlack=function(t){var e=this.getUidWithAccount(t);if(e)return this.signal.setAudioBlack(this.getUidWithAccount(t),1);var n={code:"accountNotMatch"};return v.reject(n)},E.setAudioStart=function(t){var e=this.getUidWithAccount(t);if(e)return this.signal.setAudioBlack(this.getUidWithAccount(t),0);var n={code:"accountNotMatch"};return v.reject(n)},E.setVideoBlack=function(t){return this.signal.setVideoBlack(this.getUidWithAccount(t),1)},E.setVideoShow=function(t){return this.signal.setVideoBlack(this.getUidWithAccount(t),0)},E.startRecordMp4=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.dataApi.update({key:"record"}),p.verifyOptions(t,"path"),t.account&&(t.id=t.account===this.account?0:this.getUidWithAccount(t.account)),this.signal.startRecordMp4(t)},E.stopRecordMp4=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.account&&(t.id=t.account===this.account?0:this.getUidWithAccount(t.account)),this.signal.stopRecordMp4(t)},E.startRecordAac=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.dataApi.update({key:"audio_record"}),p.verifyOptions(t,"path"),this.signal.startRecordAac(t)},E.stopRecordAac=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.signal.stopRecordAac(t)},E.onRecordMp4=function(t,e){t.type=e,this.emit("recordMp4",t)},E.destroy=function(){},E.setNetcallSession=function(t){return this.calling?v.reject({type:"statusNotMatch",error:"开启会话失败: 当前正在通话中"}):(this.calling=!0,this.channelId=t.channelId,this.type=+t.netcallType,this.imInfo=t,this.imInfo.rtcUrls=t.rtcServerMap,this.beCalledInfo=this.imInfo,this.target=t.target.account,this.parseAccountUidMap(t.accountUidMap),this.signal.startSession((0,r["default"])({},this.imInfo,{type:this.type},this.imInfo.sessionConfig),!1))},E.ans=function(t){return this.signal?(this.dataApi.update({key:"ans"}),this.sessionConfig.ns=~~t,this.signal.audioControl({ns:this.sessionConfig.ns})):v.reject({code:"noConnection"})},E.aec=function(t){return this.signal?(this.dataApi.update({key:"aec"}),this.sessionConfig.aec=~~t,this.signal.audioControl({aec:this.sessionConfig.aec})):v.reject({code:"noConnection"})},E.voiceDetection=function(t){return this.signal?(this.sessionConfig.vad=~~t,this.signal.audioControl({vad:this.sessionConfig.vad})):v.reject({code:"noConnection"})},E.awc=function(t){return this.signal?(this.dataApi.update({key:"awc"}),this.sessionConfig.awc=~~t,this.signal.awc(this.sessionConfig.awc)):v.reject({code:"noConnection"})},t.exports=b,n(350)},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}var o=n(6),r=i(o),s=n(16),a=i(s),c=n(15),u=i(c),l=void 0,d=n(19),h=n(343),f=n(364),p=n(363),v=function(t){function e(n){(0,r["default"])(this,e);var i=(0,a["default"])(this,t.call(this));return l.merge(i,n),i.init(),i}return(0,u["default"])(e,t),e}(d);v.install=function(t){l=t.util};var m=v.prototype;m.init=function(){this.reset()},m.reset=function(){this.width=0,this.height=0},m.initCanvas=function(t){l.merge(this,t);var e=this.container||document.body,n=this.canvas;n||(n=this.canvas=document.createElement("canvas"),e.appendChild(n)),n.width=this.width,n.height=this.height;var i=this.gl;if(i||(i=this.gl=h.getWebGLContext(n)),i)i.viewport(0,0,this.width,this.height),i.clearColor(0,0,0,1),i.clear(i.COLOR_BUFFER_BIT),h.initShaders(i,f,p),this.initBuffer(i),this.initTextures(i);else{var o={code:"notSupportWebGl"};this.emit("error",o)}},m.initBuffer=function(t){this.positionLocation=t.getAttribLocation(t.program,"a_position"),this.texCoordLocation=t.getAttribLocation(t.program,"a_texCoord"),this.texCoordBuffer=t.createBuffer()},m.initTextures=function(t){this.yTexture=this.createTexture(t.TEXTURE0),this.uTexture=this.createTexture(t.TEXTURE1),this.vTexture=this.createTexture(t.TEXTURE2);var e=t.getUniformLocation(t.program,"Ytex");t.uniform1i(e,0);var n=t.getUniformLocation(t.program,"Utex");t.uniform1i(n,1);var i=t.getUniformLocation(t.program,"Vtex");t.uniform1i(i,2)},m.createTexture=function(t){var e=this.gl,n=e.createTexture();return e.activeTexture(t),e.bindTexture(e.TEXTURE_2D,n),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),n},m.destroyTextures=function(){var t=this.gl;t&&(t.deleteTexture(this.yTexture),t.deleteTexture(this.uTexture),t.deleteTexture(this.vTexture)),this.yTexture=null,this.uTexture=null,this.vTexture=null},m.destroyBuffer=function(){var t=this.gl;t&&this.texCoordBuffer&&t.deleteBuffer(this.texCoordBuffer),this.texCoordBuffer=null},m.updateShaders=function(){var t=this.gl,e=void 0;e=this.mirror?new Float32Array([-1,1,1,0,-1,-1,1,1,1,1,0,0,1,-1,0,1]):new Float32Array([-1,1,0,0,-1,-1,0,1,1,1,1,0,1,-1,1,1]),t.bindBuffer(t.ARRAY_BUFFER,this.texCoordBuffer),t.bufferData(t.ARRAY_BUFFER,e,t.STATIC_DRAW);var n=e.BYTES_PER_ELEMENT;t.vertexAttribPointer(this.positionLocation,2,t.FLOAT,!1,4*n,0),t.vertexAttribPointer(this.texCoordLocation,2,t.FLOAT,!1,4*n,2*n),t.enableVertexAttribArray(this.positionLocation),t.enableVertexAttribArray(this.texCoordLocation)},m.updateTextures=function(t){var e=t.y,n=t.u,i=t.v,o=this.gl,r=this.width,s=this.height;this.updateTexture(o.TEXTURE0,this.yTexture,e,r,s),this.updateTexture(o.TEXTURE1,this.uTexture,n,r/2,s/2),this.updateTexture(o.TEXTURE2,this.vTexture,i,r/2,s/2),o.finish()},m.updateTexture=function(t,e,n,i,o){var r=this.gl;r.activeTexture(t),r.bindTexture(r.TEXTURE_2D,e),r.texImage2D(r.TEXTURE_2D,0,r.LUMINANCE,i,o,0,r.LUMINANCE,r.UNSIGNED_BYTE,n)},m.drawImage=function(t){if(!this.destroyed){var e=t.width,n=t.height,i=t.y,o=t.u,r=t.v;e===this.width&&n===this.height||(this.width=e,this.height=n,this.clean(),this.initCanvas({width:e,height:n}),this.emit("resize",{width:e,height:n,isRemote:this.isRemote,container:this.container})),this.updateShaders(),this.updateTextures({y:i,u:o,v:r});var s=this.gl;s.drawArrays(s.TRIANGLE_STRIP,0,4)}},m.destroy=function(){this.destroyed||(this.destroyed=!0,this.clean(),this.reset())},m.clean=function(){this.destroyTextures(),this.destroyBuffer(),this.removeGl()},m.removeGl=function(){this.canvas&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas),this.canvas=null,this.canvasInited=!1,this.gl=null},t.exports=v},function(t,e){"use strict";var n={},i=n.create3DContext=function(t,e){for(var n=["webgl","experimental-webgl","webkit-3d","moz-webgl"],i=null,o=0;o<n.length;++o){try{i=t.getContext(n[o],e)}catch(r){}if(i){console.log("use",n[o]);break}}return i};n.initShaders=function(t,e,n){var i=o(t,e,n);return i?(t.useProgram(i),t.program=i,!0):(console.log("Failed to create program"),!1)};var o=n.createProgram=function(t,e,n){var i=r(t,t.VERTEX_SHADER,e),o=r(t,t.FRAGMENT_SHADER,n);if(!i||!o)return null;var s=t.createProgram();if(!s)return null;t.attachShader(s,i),t.attachShader(s,o),t.linkProgram(s);var a=t.getProgramParameter(s,t.LINK_STATUS);if(!a){var c=t.getProgramInfoLog(s);return console.log("Failed to link program: "+c),t.deleteProgram(s),t.deleteShader(o),t.deleteShader(i),null}return s},r=n.loadShader=function(t,e,n){var i=t.createShader(e);return null==i?(console.log("unable to create shader"),null):(t.shaderSource(i,n),t.compileShader(i),i)};n.getWebGLContext=function(t,e){var n=i(t);return n?n:null},window.requestAnimationFrame||(window.requestAnimationFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)}}()),window.cancelAnimationFrame||(window.cancelAnimationFrame=window.cancelRequestAnimationFrame||window.webkitCancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.mozCancelAnimationFrame||window.mozCancelRequestAnimationFrame||window.msCancelAnimationFrame||window.msCancelRequestAnimationFrame||window.oCancelAnimationFrame||window.oCancelRequestAnimationFrame||window.clearTimeout),t.exports=n},,,,,,,function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}var o=n(98),r=i(o),s=n(341),a=n(203),c=s.prototype,u=void 0;c.setUtil=function(t){u=t},c.createChannel=function(t){return u.verifyOptions(t,"channelName"),t.custom=t.custom||"",this.dataApi.update("meeting"),t.webrtcEnable=!0,this.nim.createChannel(t)},c.joinChannel=function(t){var e=this;this.dataApi.update("meeting"),u.verifyOptions(t,"channelName type");var n=t.type,i=t.sessionConfig,o=void 0===i?{}:i;if(o.bypassRtmp=t.liveEnable,o.customLayout=t.layout||t.customLayout,t.liveEnable&&this.dataApi.update("bypass",void 0!==o.splitMode?+o.splitMode+1:0),o.highAudio&&this.dataApi.update("hd_audio"),void 0!==o.videoFrameRate&&this.dataApi.update("fps",0===+o.videoFrameRate?0:+o.videoFrameRate+1),void 0!==o.videoEncodeMode&&this.dataApi.update("video_adaptive_strategy",o.videoEncodeMode||0),void 0!==o.videoBitrate&&this.dataApi.update("video_max_encode_bitrate",o.videoBitrate||""),void 0!==o.videoQuality){var s=o.videoQuality;s===a.CHAT_VIDEO_QUALITY_540P?s=a.CHAT_VIDEO_QUALITY_720P:s===a.CHAT_VIDEO_QUALITY_720P&&(s=a.CHAT_VIDEO_QUALITY_540P),this.dataApi.update("video_quality",s||0)}if(o.awc&&this.dataApi.update({key:"awc"}),o.ans&&this.dataApi.update({key:"ans"}),o.aec&&this.dataApi.update({key:"aec"}),this.signalInited)return this.nim.joinChannel({channelName:t.channelName,liveEnable:t.liveEnable,webrtcEnable:!0}).then(function(i){return console.log("joinchannel obj",i),console.log("joinchannel options",t),e.callerInfo=i,e.channelId=i.channelId,e.channelName=t.channelName,e.sessionMode="meeting",e.parseAccountUidMap(i.accountUidMap),i.uid=e.getUidWithAccount(e.account),e.dataApi.start({uid:i.uid}),e.signal.startSession((0,r["default"])({},i,{type:n},t.sessionConfig),!0).then(function(t){return t.custom=i.custom,t})});var c={code:"noConnection"};return Promise.reject(c)},c.leaveChannel=function(){if(this.signalInited)return this.dataApi.send(),this.signal.stopSession();var t={code:"noConnection"};return Promise.reject(t)},c.changeRoleToPlayer=function(){return this.signal.setRole(0)},c.changeRoleToAudience=function(){return this.signal.setRole(1)},c.updateRtmpUrl=function(t){return this.signal.updateRtmpUrl(t)}},function(t,e){"use strict";var n="wss://localhost.netease.im:",i={baseUrl:n,signalUrl:n+"30000",streamUrl:n+"40000",genStreamUrl:function(t){return""+n+t}};t.exports=i},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}var o=n(98),r=i(o),s=n(6),a=i(s),c=n(16),u=i(c),l=n(15),d=i(l),h=void 0,f=n(19),p=n(203),v=n(354),m=n(149),_=function(t){function e(n){(0,a["default"])(this,e);var i=(0,u["default"])(this,t.call(this));return h.merge(i,n),i.reset(),window.addEventListener("beforeunload",function(){i.destroy()}),i}return(0,d["default"])(e,t),e}(f);_.install=function(t){h=t.util};var g=_.prototype;g.reset=function(){this.inited=!1,this.isMeeting=!1,this.hasInvokePC=!1,this.cmdId=1,this.cmdTasksMap={},this.sessionStopped=!1,this.devicesMap={},this.deviceMap={},this.initSocket(),this.audioGroup={aec:1,ns:1,vad:1,awc:0}},g.initSocket=function(){var t=this.socket=new WebSocket(this.url);t.onopen=this.onOpen.bind(this),t.onmessage=this.onMessage.bind(this),t.onerror=this.onError.bind(this),t.onclose=this.onClose.bind(this)},g.onOpen=function(t){var e=this,n=this.heartbeat?1:0,i=this.getName()+" open -> signal.js";this.inited=!0,this.logToConsole(i),this.log(i),this.emit("open"),this.sendCmd({type:"on_init",info:{account:this.account,type:this.kickLast?1:0,heartbeat:n,app_key:this.appkey}}).then(this.onInit.bind(this))["catch"](function(t){e.logToConsole("init error -> signal.js",t),e.emit("initError",t)})},g.onError=function(t){if(!this.destroyed&&this.inited){var e=this.getName()+" error -> signal.js";this.logToConsole(e)}},g.onClose=function(t){var e=this;if(!this.destroyed)if(this.inited){var n=this.getName()+" close -> signal.js : "+t.code;this.logToConsole(n),this.inited=!1,this.emit("close")}else{this.hasInvokePC||(this.hasInvokePC=!0,this.invokePC());var i=this.backoff;i||(i=this.backoff=new m({min:1e3,max:2e3})),3===i.attempts?this.emit("initError",{code:"noPC"}):setTimeout(function(){e.initSocket()},i.duration())}},g.invokePC=function(){var t="NIMWebAgent:invokePC",e=document.createElement("iframe");e.src=t,document.body.appendChild(e),setTimeout(function(){e.parentNode&&e.parentNode.removeChild(e)},0)},g.onMessage=function(t){if(!this.destroyed){var e=JSON.parse(t.data),n=e.cmd_id,i=e.cmd_type,o=e.cmd_info;this.shouldPrintMsg({cmdType:i,cmdInfo:o})&&"on_heartbeat_notify"!==i&&this.client.info("signal socket msg",e);var r=this.cmdTasksMap[n];if(r)delete this.cmdTasksMap[n],200===o.code?r.resolve(o):r.reject(o);else switch(i){case"device_status_notify":this.onDeviceStatus(o);break;case"session_notify":this.onSessionNotify(o);break;case"upload_log_notify":this.onUploadLogNotify(o)}}},g.shouldPrintMsg=function(t){var e=t.cmdType,n=t.cmdInfo;return"session_notify"!==e||!n.audio_volume&&!n.net&&!n.static_info},g.sendCmd=function(t){var e=this;return new Promise(function(n,i){var o="on_heartbeat"===t.type?0:e.cmdId++,s=(0,r["default"])({cmd_id:o,cmd_type:t.type,cmd_info:t.info||{}},t.extra);e.socket&&e.socket.readyState===WebSocket.OPEN?("on_heartbeat"!==t.type&&e.logToConsole("send signal cmd",s),e.cmdTasksMap[o]={resolve:n,reject:i},e.socket.send(JSON.stringify(s))):i({code:"noConnection"})})},g.onInit=function(t){var e=t.code,n=t.version,i=t.port,o=t.device_list_notify;200===e&&(o.forEach(this.onDevices,this),this.emit("init",{port:i,version:n,code:e}),this.startHeartBeat())},g.startHeartBeat=function(){var t=this;this.heartBeatTimer&&this.stopHeartBeat(),this.heartBeatTimer=setInterval(function(){t.sendCmd({type:"on_heartbeat",info:{}})["catch"](function(){t.emit("heartBeatError",{type:"heartbeatError"})})},15e3)},g.stopHeartBeat=function(){clearInterval(this.heartBeatTimer),this.heartBeatTimer=null},g.setVideoViewSize=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=parseInt(t.width)||0,n=parseInt(t.height)||0,i=void 0===t.cut?1:~~t.cut;return this.sendCmd({type:"on_capture_video_size",info:{width:e,height:n,cut:i}})},g.setVideoViewRemoteSize=function(t){var e=parseInt(t.width)||0,n=parseInt(t.height)||0,i=t.id||0,o=void 0===t.cut?1:~~t.cut;return this.sendCmd({type:"on_rec_video_size",info:{id:i,width:e,height:n,cut:o}})},g.setVideoScale=function(t){var e=t.type,n=void 0===e?p.CHAT_VIDEO_SCALE_None:e,i=t.id;return this.sendCmd({type:"on_send_video_Scale",info:{id:i,type:n}})},g.getDevicesOfType=function(t){var e=this;return this.sendCmd({type:"on_get_devices",info:{type:t}}).then(function(t){return t.devices=t.devices||[],e.onDevices(t),t})["catch"](function(t){throw t})},g.onDevices=function(t){var e=t.type,n=t.devices;if(n&&n.length){v.sortDevices(n);var i=p.getDeviceTypeStr(e);i&&(this.devicesMap[e]=n,this.emit("devices",{type:e,typeStr:i,devices:n}))}},g.startAllDevices=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.videoQuality,i=e.audioOutType;Object.keys(this.devicesMap).forEach(function(e){e=+e,e===p.DEVICE_TYPE_AUDIO_OUT_CHAT&&i===p.DEVICE_TYPE_AUDIO_OUT_LOCAL&&(e=i);var o=t.devicesMap[e];t.startDevice({device:o[0],type:e,videoQuality:n})})},g.startDevice=function(t){var e=this,n=t.device,i=t.type,o=t.width,r=t.height;if(n){i=+i;var s={type:i,path:n.path};return i===p.DEVICE_TYPE_VIDEO&&(s.width=parseInt(o)||0,s.height=parseInt(r)||0),this.deviceMap[i]=n,this.sendCmd({type:"on_start_device",info:s})["catch"](function(){throw delete e.deviceMap[i],s})}},g.stopDevice=function(t){var e=this,n=this.deviceMap[t];return delete this.deviceMap[t],this.sendCmd({type:"on_stop_device",info:{type:t}})["catch"](function(){e.deviceMap[t]=n})},g.onDeviceStatus=function(t){var e=t.type,n=t.status,i=1===(1&n),o=4===(4&n),s=8===(8&n),a=16===(16&n);s&&(this.deviceMap[e]=t,this.emit("deviceStatus",(0,r["default"])({},t,{status:"started"}))),a&&(delete this.deviceMap[e],this.emit("deviceStatus",(0,r["default"])({},t,{status:"stopped"}))),o&&(this.deviceMap[e]=t,this.emit("deviceStatus",(0,r["default"])({},t,{status:"reset"}))),i&&this.emit("deviceStatus",(0,r["default"])({},t,{status:"change"}))},g.startSession=function(t,e){var n=this;this.sessionStopped=!1;var i=h.guid();this.sessionId=i;var o=t.type;this.type=o;var r={id:t.uid,cid:t.channelId,type:o,p2p_connect:1,dispatch:t.serverMap,config:t.clientConfig,v_encode_mode:this.normalizeVideoEncodeMode(t.videoEncodeMode),video_quality:this.normalizeVideoQuality(t.videoQuality),video_record:t.recordVideo?1:0,record:t.recordAudio?1:0,high_rate:t.highAudio?1:0,frame_rate:this.normalizeVideoFrameRate(t.videoFrameRate),max_video_rate:this.normalizeVideoBitrate(t.videoBitrate),custom_layout:t.customLayout};return e&&(r.meeting_mode=1,r.bypass_rtmp=t.bypassRtmp?1:0,r.rtmp_url=t.rtmpUrl||"",r.rtmp_record=t.rtmpRecord?1:0,r.split_mode=t.splitMode||0),this.sendCmd({type:"on_start_chat",info:r,extra:{session_id:i}}).then(function(i){var o=i.login,r=i.error;if(r)throw r;return n.isMeeting=e,void 0!==t.ns&&n.audioControl({ns:t.ns}),void 0!==t.vad&&n.audioControl({vad:t.vad}),void 0!==t.aec&&n.audioControl({aec:t.aec}),void 0!==t.awc&&n.awc(t.awc),{login:o}})},g.stopSession=function(){return this.sessionStopped?Promise.resolve():(this.sessionStopped=!0,this.isMeeting=!1,this.sendCmd({type:"on_stop_chat"}))},g.clear=function(){this.sendCmd({type:"on_clear"})},g.switchVideoToAudio=function(){return this.sendCmd({type:"on_set_chat_mode",info:{type:p.NETCALL_TYPE_AUDIO}})},g.switchAudioToVideo=function(){return this.sendCmd({type:"on_set_chat_mode",info:{type:p.NETCALL_TYPE_VIDEO}})},g.logToConsole=function(){var t=this.client;t&&t.log.apply(t,arguments)},g.log=function(t){t&&this.doLog({msg:t,level:3})},g.warn=function(t){t&&this.doLog({msg:t,level:2})},g.err=function(t){t&&this.doLog({msg:t,level:1})},g.doLog=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.msg,n=t.level;return this.sendCmd({type:"on_log",info:{type:n,content:""+e}})["catch"](function(){})},g.uploadLog=function(t){var e=t.bucket,n=t.objectName,i=t.token;return this.sendCmd({type:"on_upload_log",info:{nos_bucket:e,nos_object:n,nos_header_token:i}})["catch"](function(){})},g.normalizeVideoEncodeMode=function(t){return parseInt(t)||p.CHAT_VIDEO_ENCODEMODE_NORMAL},g.normalizeVideoQuality=function(t){return parseInt(t)||p.CHAT_VIDEO_QUALITY_480P},g.setVideoQuality=function(t){return this.sendCmd({type:"on_set_video_quality",info:{type:this.normalizeVideoQuality(t)}})},g.normalizeVideoFrameRate=function(t){return parseInt(t)||p.CHAT_VIDEO_FRAME_RATE_NORMAL},g.setVideoFrameRate=function(t){return this.sendCmd({type:"on_set_video_frame_rate",info:{type:this.normalizeVideoFrameRate(t)}})},g.normalizeVideoBitrate=function(t){return parseInt(t)||0},g.setVideoBitrate=function(t){return this.sendCmd({type:"on_set_video_bitrate",info:{code:this.normalizeVideoBitrate(t)}})},g.netDetect=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.appKey,n=t.type,i=t.quality,o=void 0===i?0:i;return this.sendCmd({type:"on_net_detect",info:{app_key:e,type:n,quality:o}})},g.normalizeVolumn=function(t){return t=+t,h.isNumber(t)&&!isNaN(t)||(t=255),t<0&&(t=0),t>255&&(t=255),t},g.setCaptureVolume=function(t){return t=this.normalizeVolumn(t),this.sendCmd({type:"on_capture_volume",info:{status:t}})},g.setPlayVolume=function(t){return t=this.normalizeVolumn(t),this.sendCmd({type:"on_play_volume",info:{status:t}})},g.setRole=function(t){return this.sendCmd({type:"on_set_viewer",info:{status:t}})},g.setAudioBlack=function(t,e){return this.sendCmd({type:"on_set_audio_black",info:{id:t,status:e}})},g.setVideoBlack=function(t,e){return this.sendCmd({type:"on_set_video_black",info:{id:t,status:e}})},g.updateRtmpUrl=function(t){return this.sendCmd({type:"on_update_rtmp_url",info:{content:t}})},g.startRecordMp4=function(t){var e=t.path,n=t.id,i=void 0===n?"":n;return this.sendCmd({type:"on_record_mp4",info:{path:e,id:i}})},g.stopRecordMp4=function(t){var e=t.id,n=void 0===e?0:e;return this.sendCmd({type:"on_stop_record_mp4",info:{id:n}})},g.startRecordAac=function(t){var e=t.path;return this.sendCmd({type:"on_record_aac",info:{path:e}})},g.stopRecordAac=function(){return this.sendCmd({type:"on_stop_record_aac",info:{}})},g.onSessionNotify=function(t){t&&(t.user_joined?(console.log("onSessionNotify ",t),this.emit("userJoined",{uid:t.user_joined.id,port:t.user_joined.port,type:this.type,isMeeting:this.isMeeting})):t.user_left?this.emit("userLeft",{uid:t.user_left.id,type:t.user_left.status,isMeeting:this.isMeeting}):t.net?this.emit("netStatus",t.net):t.static_info?this.emit("statistics",t.static_info):t.audio_volume?this.emit("audioVolume",t.audio_volume):t.error?this.emit("error",t.error):t.mp4_start?this.emit("recordMp4",t.mp4_start,"start"):t.mp4_close&&this.emit("recordMp4",t.mp4_close,"close"))},g.onUploadLogNotify=function(t){var e=t.code,n=t.url;200===e&&this.emit("logUploaded",{url:n})},g.getName=function(){return"signal socket "+this.url},g.destroy=function(){this.destroyed=!0,this.stopHeartBeat();var t="signal close -> signal.js";this.logToConsole(t),this.socket&&(this.socket.onopen=null,this.socket.onmessage=null,this.socket.onerror=null,this.socket.onclose=null,this.socket.readyState===WebSocket.OPEN&&(this.clear(),this.socket.close()),this.socket=null)},g.audioControl=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return h.merge(this.audioGroup,t),this.sendCmd({type:"on_audio_process",info:this.audioGroup,id:++this.cmdId})},g.awc=function(t){return this.sendCmd({type:"on_audio_howling",info:{status:~~t},id:++this.cmdId})},t.exports=_},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}var o=n(6),r=i(o),s=n(16),a=i(s),c=n(15),u=i(c),l=void 0,d=n(19),h=n(342),f=n(362),p=function(t){function e(n){(0,r["default"])(this,e);var i=(0,a["default"])(this,t.call(this));return l.merge(i,n),i.init(),i}return(0,u["default"])(e,t),e}(d);p.install=function(t){l=t.util};var v=p.prototype;v.init=function(){this.reset(),this.initRender(),this.initWorker(),window.addEventListener("beforeunload",this.destroy.bind(this))},v.initRender=function(){var t=this;this.render=new h({client:this.client,stream:this,isRemote:this.isRemote,container:this.container,mirror:this.mirror}),this.render.on("resize",function(e){t.emit("resize",e)}),this.render.on("error",function(e){t.emit("error",e)})},v.reset=function(){this.currFrameCount=0,this.width=0,this.height=0,this.timetag=0,this.worker=null,this.render=null},v.initWorker=function(){var t=this,e=new Blob([f],{type:"application/javascript"}),n=this.worker=new Worker(URL.createObjectURL(e));n.addEventListener("message",function(e){var n=e.data;switch(n.cmd){case"open":t.onOpen();break;case"error":t.onError();break;case"close":t.onClose();break;case"message":t.onMessage(n)}}),this.sendWorkerCmd({cmd:"init",info:{url:this.url}})},v.destroyWorker=function(){this.worker&&this.worker.terminate()},v.sendWorkerCmd=function(t){this.worker&&this.worker.postMessage(t)},v.getName=function(){return(this.isRemote?"remote ":"")+"stream socket "+this.url},v.onOpen=function(t){var e=this.getName()+" open -> stream.js";this.logToConsole(e),this.logToPC(e)},v.startStatisticsTimer=function(){var t=this;this.statisticsTimer=setInterval(function(){var e=t.currFrameCount-t.lastFrameCount;t.sendWorkerCmd({cmd:"msg",info:{cmd:"statistics",info:{lastFrameCount:t.lastFrameCount,fps:e,latency:t.latency}}}),t.lastFrameCount=t.currFrameCount,t.latency=0},1e3)},v.onError=function(t){if(!this.destroyed){var e=this.getName()+" error -> stream.js";this.logToConsole(e),this.logToPC(e),this.destroy()}},v.onClose=function(t){this.destroy(t)},v.onMessage=function(t){var e=t.data;if(!this.destroyed&&e instanceof ArrayBuffer){var n=e.byteLength;this.render&&!this.suspended&&this.renderFrame(e,n)}},v.renderFrame=function(t,e){var n=16,i=new DataView(t),o=this.width=i.getUint32(0),r=this.height=i.getUint32(4),s=i.getUint32(8),a=i.getUint32(12);this.timetag=1e3*s+a;var c=o*r,u=c/4,l=c/4;if(n+c+u+l!==e){var d="yuv数据长度不匹配: total "+e+", meta "+n+", width "+o+", height "+r+", yLength "+c+" uLength "+u+" vLength "+l;return this.logToConsole(d),void this.logToPC(d)}this.currFrameCount++,this.scheduleRender({id:this.currFrameCount,width:o,height:r,y:new Uint8Array(t,n,c),u:new Uint8Array(t,n+c,u),v:new Uint8Array(t,n+c+u)})},v.scheduleRender=function(t){this.render&&!this.suspended&&this.render.drawImage(t)},v.suspend=function(){this.suspended=!0},v.resume=function(){this.suspended=!1},v.destroy=function(t){this.sendWorkerCmd({cmd:"close",info:{cmd_type:"on_clear_media"}}),this.destroyed=!0,this.render&&this.render.destroy(),this.reset();var e=t&&t.constructor===Object?t.code:"",n=this.getName()+" destroy: code - "+e+" -> stream.js";this.logToConsole(n),this.logToPC(n)},v.logToConsole=function(){var t=this.client;t&&t.log.apply(t,arguments)},v.logToPC=function(){var t=this.client;if(t){var e=t.signal;e&&e.log.apply(e,arguments)}},t.exports=p},function(t,e){"use strict";var n={};n.sortDevices=function(t){t&&t.length>1&&t.sort(function(t,e){var n=t.name.toLowerCase().indexOf("virtual")!==-1,i=t.path.toLowerCase().indexOf("virtual")!==-1,o=e.name.toLowerCase().indexOf("virtual")!==-1,r=e.path.toLowerCase().indexOf("virtual")!==-1;return i?1:r?-1:n&&o?0:n?1:o?-1:0})},t.exports=n},,,,,,,,function(t,e){t.exports="'use strict';\n\n/* 该web worker 职能为向 websocket 发送指令及数据*/\n\nvar that = {};\n\nthat.init = function (data) {\n  if (!that.socket) {\n    var url = that.url = data.info.url;\n    var socket = that.socket = new WebSocket(url);\n    socket.onopen = function (event) {\n      postMessage({\n        cmd: 'open'\n      });\n    };\n    socket.onmessage = function (event) {\n      postMessage({\n        cmd: 'message',\n        data: event.data\n      }, [event.data]);\n    };\n    socket.onerror = function (event) {\n      postMessage({\n        cmd: 'error'\n      });\n    };\n    socket.onclose = function (event) {\n      postMessage({ // web 端被动结束\n        cmd: 'close'\n      });\n    };\n    socket.binaryType = 'arraybuffer';\n  }\n};\n\nthat.close = function () {\n  if (that.socket) {\n    that.socket.onopen = null;\n    that.socket.onmessage = null;\n    that.socket.onerror = null;\n    that.socket.onclose = null;\n    that.socket.close(); // 结束socket\n    that.socket = null;\n  }\n  self.close(); // 结束worker,web端主动\n};\n\nthat.send = function (obj) {\n  if (that.socket && that.socket.readyState === WebSocket.OPEN) {\n    that.socket.send(JSON.stringify(obj));\n  }\n};\n// 侦听主线程的worker消息\nself.addEventListener('message', function (event) {\n  var data = event.data;\n  switch (data.cmd) {\n    case 'init':\n      // worker第一步2\n      that.init(data);\n      break;\n    case 'close':\n      // web发起,结束worker及相应socket\n      that.send(data.info);\n      that.close(data);\n      break;\n    case 'msg':\n      that.send(data.info);\n      break;\n  }\n});"},function(t,e){t.exports="precision mediump float;\r\nuniform sampler2D Ytex, Utex, Vtex;\r\nvarying vec2 v_texCoord;\r\nvoid main(void) {\r\n  float r, g, b, y, u, v;\r\n  vec4 yuv, rgb;\r\n  y = texture2D(Ytex, v_texCoord).r;\r\n  u = texture2D(Utex, v_texCoord).r;\r\n  v = texture2D(Vtex, v_texCoord).r;\r\n  yuv = vec4(y, u, v, 1.0);\r\n  yuv = yuv - vec4(0.0625, 0.5, 0.5, 0.0);\r\n  yuv = mat4(\r\n    1.1643, 0.0, 0.0, 0.0,\r\n    0.0, 1.0, 0.0, 0.0,\r\n    0.0, 0.0, 1.0, 0.0,\r\n    0.0, 0.0, 0.0, 1.0\r\n  ) * yuv;\r\n  rgb = mat4(\r\n    1.0, 1.0, 1.0, 0.0,\r\n    0.0, -0.3917, 2.017, 0.0,\r\n    1.5958, -0.8129, 0.0, 0.0,\r\n    0.0, 0.0, 0.0, 1.0\r\n  ) * yuv;\r\n  gl_FragColor = rgb;\r\n  // y = 1.1643 * (y - 0.0625);\r\n  // u = u - 0.5;\r\n  // v = v - 0.5;\r\n  // r = y + 1.5958 * v;\r\n  // g = y - 0.39173 * u - 0.81290 * v;\r\n  // b = y + 2.017 * u;\r\n  // gl_FragColor = vec4(r, g, b, 1.0);\r\n}\r\n"},function(t,e){t.exports="attribute vec4 a_position;\r\nattribute vec2 a_texCoord;\r\nvarying vec2 v_texCoord;\r\nvoid main () {\r\n  gl_Position = a_position;\r\n  v_texCoord = a_texCoord;\r\n}\r\n"}])});