forked from pili-engineering/QNRTC-Web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpili-rtc-web.js
7 lines (7 loc) · 254 KB
/
pili-rtc-web.js
1
2
3
4
5
6
7
var QNRTC=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=364)}([function(e,t,n){var r=n(2),i=n(26),o=n(13),a=n(12),s=n(20),c=function(e,t,n){var u,f,d,l,p=e&c.F,h=e&c.G,v=e&c.S,m=e&c.P,g=e&c.B,y=h?r:v?r[t]||(r[t]={}):(r[t]||{}).prototype,b=h?i:i[t]||(i[t]={}),S=b.prototype||(b.prototype={});for(u in h&&(n=t),n)d=((f=!p&&y&&void 0!==y[u])?y:n)[u],l=g&&f?s(d,r):m&&"function"==typeof d?s(Function.call,d):d,y&&a(y,u,d,e&c.U),b[u]!=d&&o(b,u,l),m&&S[u]!=d&&(S[u]=d)};r.core=i,c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,e.exports=c},function(e,t,n){var r=n(4);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){var r=n(66)("wks"),i=n(41),o=n(2).Symbol,a="function"==typeof o;(e.exports=function(e){return r[e]||(r[e]=a&&o[e]||(a?o:i)("Symbol."+e))}).store=r},function(e,t,n){var r=n(23),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},function(e,t,n){var r=n(1),i=n(133),o=n(25),a=Object.defineProperty;t.f=n(8)?Object.defineProperty:function(e,t,n){if(r(e),t=o(t,!0),r(n),i)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){e.exports=!n(3)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(24);e.exports=function(e){return Object(r(e))}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){var r=n(0),i=n(3),o=n(24),a=/"/g,s=function(e,t,n,r){var i=String(o(e)),s="<"+t;return""!==n&&(s+=" "+n+'="'+String(r).replace(a,""")+'"'),s+">"+i+"</"+t+">"};e.exports=function(e,t){var n={};n[e]=t(s),r(r.P+r.F*i(function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}),"String",n)}},function(e,t,n){var r=n(2),i=n(13),o=n(14),a=n(41)("src"),s=Function.toString,c=(""+s).split("toString");n(26).inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,n,s){var u="function"==typeof n;u&&(o(n,"name")||i(n,"name",t)),e[t]!==n&&(u&&(o(n,a)||i(n,a,e[t]?""+e[t]:c.join(String(t)))),e===r?e[t]=n:s?e[t]?e[t]=n:i(e,t,n):(delete e[t],i(e,t,n)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[a]||s.call(this)})},function(e,t,n){var r=n(7),i=n(42);e.exports=n(8)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){var r=n(14),i=n(9),o=n(94)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),r(e,o)?e[o]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},function(e,t,n){var r=n(51),i=n(42),o=n(17),a=n(25),s=n(14),c=n(133),u=Object.getOwnPropertyDescriptor;t.f=n(8)?u:function(e,t){if(e=o(e),t=a(t,!0),c)try{return u(e,t)}catch(e){}if(s(e,t))return i(!r.f.call(e,t),e[t])}},function(e,t,n){var r=n(52),i=n(24);e.exports=function(e){return r(i(e))}},function(e,t,n){"use strict";var r=n(3);e.exports=function(e,t){return!!e&&r(function(){t?e.call(null,function(){},1):e.call(null)})}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){var r=n(10);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){var r=n(20),i=n(52),o=n(9),a=n(6),s=n(77);e.exports=function(e,t){var n=1==e,c=2==e,u=3==e,f=4==e,d=6==e,l=5==e||d,p=t||s;return function(t,s,h){for(var v,m,g=o(t),y=i(g),b=r(s,h,3),S=a(y.length),w=0,T=n?p(t,S):c?p(t,0):void 0;S>w;w++)if((l||w in y)&&(m=b(v=y[w],w,g),e))if(n)T[w]=m;else if(m)switch(e){case 3:return!0;case 5:return v;case 6:return w;case 2:T.push(v)}else if(f)return!1;return d?-1:u||f?f:T}}},function(e,t,n){var r=n(0),i=n(26),o=n(3);e.exports=function(e,t){var n=(i.Object||{})[e]||Object[e],a={};a[e]=t(n),r(r.S+r.F*o(function(){n(1)}),"Object",a)}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(4);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t){var n=e.exports={version:"2.5.3"};"number"==typeof __e&&(__e=n)},function(e,t,n){var r=n(112),i=n(0),o=n(66)("metadata"),a=o.store||(o.store=new(n(109))),s=function(e,t,n){var i=a.get(e);if(!i){if(!n)return;a.set(e,i=new r)}var o=i.get(t);if(!o){if(!n)return;i.set(t,o=new r)}return o};e.exports={store:a,map:s,has:function(e,t,n){var r=s(t,n,!1);return void 0!==r&&r.has(e)},get:function(e,t,n){var r=s(t,n,!1);return void 0===r?void 0:r.get(e)},set:function(e,t,n,r){s(n,r,!0).set(e,t)},keys:function(e,t){var n=s(e,t,!1),r=[];return n&&n.forEach(function(e,t){r.push(t)}),r},key:function(e){return void 0===e||"symbol"==typeof e?e:String(e)},exp:function(e){i(i.S,"Reflect",e)}}},function(e,t,n){"use strict";if(n(8)){var r=n(40),i=n(2),o=n(3),a=n(0),s=n(56),c=n(71),u=n(20),f=n(34),d=n(42),l=n(13),p=n(32),h=n(23),v=n(6),m=n(107),g=n(38),y=n(25),b=n(14),S=n(50),w=n(4),T=n(9),R=n(80),E=n(37),C=n(15),_=n(36).f,k=n(78),P=n(41),x=n(5),O=n(21),I=n(65),M=n(58),j=n(75),A=n(46),L=n(61),D=n(35),N=n(76),F=n(117),U=n(7),B=n(16),W=U.f,G=B.f,V=i.RangeError,z=i.TypeError,$=i.Uint8Array,J=Array.prototype,X=c.ArrayBuffer,H=c.DataView,q=O(0),K=O(2),Y=O(3),Z=O(4),Q=O(5),ee=O(6),te=I(!0),ne=I(!1),re=j.values,ie=j.keys,oe=j.entries,ae=J.lastIndexOf,se=J.reduce,ce=J.reduceRight,ue=J.join,fe=J.sort,de=J.slice,le=J.toString,pe=J.toLocaleString,he=x("iterator"),ve=x("toStringTag"),me=P("typed_constructor"),ge=P("def_constructor"),ye=s.CONSTR,be=s.TYPED,Se=s.VIEW,we=O(1,function(e,t){return _e(M(e,e[ge]),t)}),Te=o(function(){return 1===new $(new Uint16Array([1]).buffer)[0]}),Re=!!$&&!!$.prototype.set&&o(function(){new $(1).set({})}),Ee=function(e,t){var n=h(e);if(n<0||n%t)throw V("Wrong offset!");return n},Ce=function(e){if(w(e)&&be in e)return e;throw z(e+" is not a typed array!")},_e=function(e,t){if(!(w(e)&&me in e))throw z("It is not a typed array constructor!");return new e(t)},ke=function(e,t){return Pe(M(e,e[ge]),t)},Pe=function(e,t){for(var n=0,r=t.length,i=_e(e,r);r>n;)i[n]=t[n++];return i},xe=function(e,t,n){W(e,t,{get:function(){return this._d[n]}})},Oe=function(e){var t,n,r,i,o,a,s=T(e),c=arguments.length,f=c>1?arguments[1]:void 0,d=void 0!==f,l=k(s);if(void 0!=l&&!R(l)){for(a=l.call(s),r=[],t=0;!(o=a.next()).done;t++)r.push(o.value);s=r}for(d&&c>2&&(f=u(f,arguments[2],2)),t=0,n=v(s.length),i=_e(this,n);n>t;t++)i[t]=d?f(s[t],t):s[t];return i},Ie=function(){for(var e=0,t=arguments.length,n=_e(this,t);t>e;)n[e]=arguments[e++];return n},Me=!!$&&o(function(){pe.call(new $(1))}),je=function(){return pe.apply(Me?de.call(Ce(this)):Ce(this),arguments)},Ae={copyWithin:function(e,t){return F.call(Ce(this),e,t,arguments.length>2?arguments[2]:void 0)},every:function(e){return Z(Ce(this),e,arguments.length>1?arguments[1]:void 0)},fill:function(e){return N.apply(Ce(this),arguments)},filter:function(e){return ke(this,K(Ce(this),e,arguments.length>1?arguments[1]:void 0))},find:function(e){return Q(Ce(this),e,arguments.length>1?arguments[1]:void 0)},findIndex:function(e){return ee(Ce(this),e,arguments.length>1?arguments[1]:void 0)},forEach:function(e){q(Ce(this),e,arguments.length>1?arguments[1]:void 0)},indexOf:function(e){return ne(Ce(this),e,arguments.length>1?arguments[1]:void 0)},includes:function(e){return te(Ce(this),e,arguments.length>1?arguments[1]:void 0)},join:function(e){return ue.apply(Ce(this),arguments)},lastIndexOf:function(e){return ae.apply(Ce(this),arguments)},map:function(e){return we(Ce(this),e,arguments.length>1?arguments[1]:void 0)},reduce:function(e){return se.apply(Ce(this),arguments)},reduceRight:function(e){return ce.apply(Ce(this),arguments)},reverse:function(){for(var e,t=Ce(this).length,n=Math.floor(t/2),r=0;r<n;)e=this[r],this[r++]=this[--t],this[t]=e;return this},some:function(e){return Y(Ce(this),e,arguments.length>1?arguments[1]:void 0)},sort:function(e){return fe.call(Ce(this),e)},subarray:function(e,t){var n=Ce(this),r=n.length,i=g(e,r);return new(M(n,n[ge]))(n.buffer,n.byteOffset+i*n.BYTES_PER_ELEMENT,v((void 0===t?r:g(t,r))-i))}},Le=function(e,t){return ke(this,de.call(Ce(this),e,t))},De=function(e){Ce(this);var t=Ee(arguments[1],1),n=this.length,r=T(e),i=v(r.length),o=0;if(i+t>n)throw V("Wrong length!");for(;o<i;)this[t+o]=r[o++]},Ne={entries:function(){return oe.call(Ce(this))},keys:function(){return ie.call(Ce(this))},values:function(){return re.call(Ce(this))}},Fe=function(e,t){return w(e)&&e[be]&&"symbol"!=typeof t&&t in e&&String(+t)==String(t)},Ue=function(e,t){return Fe(e,t=y(t,!0))?d(2,e[t]):G(e,t)},Be=function(e,t,n){return!(Fe(e,t=y(t,!0))&&w(n)&&b(n,"value"))||b(n,"get")||b(n,"set")||n.configurable||b(n,"writable")&&!n.writable||b(n,"enumerable")&&!n.enumerable?W(e,t,n):(e[t]=n.value,e)};ye||(B.f=Ue,U.f=Be),a(a.S+a.F*!ye,"Object",{getOwnPropertyDescriptor:Ue,defineProperty:Be}),o(function(){le.call({})})&&(le=pe=function(){return ue.call(this)});var We=p({},Ae);p(We,Ne),l(We,he,Ne.values),p(We,{slice:Le,set:De,constructor:function(){},toString:le,toLocaleString:je}),xe(We,"buffer","b"),xe(We,"byteOffset","o"),xe(We,"byteLength","l"),xe(We,"length","e"),W(We,ve,{get:function(){return this[be]}}),e.exports=function(e,t,n,c){var u=e+((c=!!c)?"Clamped":"")+"Array",d="get"+e,p="set"+e,h=i[u],g=h||{},y=h&&C(h),b=!h||!s.ABV,T={},R=h&&h.prototype,k=function(e,n){W(e,n,{get:function(){return function(e,n){var r=e._d;return r.v[d](n*t+r.o,Te)}(this,n)},set:function(e){return function(e,n,r){var i=e._d;c&&(r=(r=Math.round(r))<0?0:r>255?255:255&r),i.v[p](n*t+i.o,r,Te)}(this,n,e)},enumerable:!0})};b?(h=n(function(e,n,r,i){f(e,h,u,"_d");var o,a,s,c,d=0,p=0;if(w(n)){if(!(n instanceof X||"ArrayBuffer"==(c=S(n))||"SharedArrayBuffer"==c))return be in n?Pe(h,n):Oe.call(h,n);o=n,p=Ee(r,t);var g=n.byteLength;if(void 0===i){if(g%t)throw V("Wrong length!");if((a=g-p)<0)throw V("Wrong length!")}else if((a=v(i)*t)+p>g)throw V("Wrong length!");s=a/t}else s=m(n),o=new X(a=s*t);for(l(e,"_d",{b:o,o:p,l:a,e:s,v:new H(o)});d<s;)k(e,d++)}),R=h.prototype=E(We),l(R,"constructor",h)):o(function(){h(1)})&&o(function(){new h(-1)})&&L(function(e){new h,new h(null),new h(1.5),new h(e)},!0)||(h=n(function(e,n,r,i){var o;return f(e,h,u),w(n)?n instanceof X||"ArrayBuffer"==(o=S(n))||"SharedArrayBuffer"==o?void 0!==i?new g(n,Ee(r,t),i):void 0!==r?new g(n,Ee(r,t)):new g(n):be in n?Pe(h,n):Oe.call(h,n):new g(m(n))}),q(y!==Function.prototype?_(g).concat(_(y)):_(g),function(e){e in h||l(h,e,g[e])}),h.prototype=R,r||(R.constructor=h));var P=R[he],x=!!P&&("values"==P.name||void 0==P.name),O=Ne.values;l(h,me,!0),l(R,be,u),l(R,Se,!0),l(R,ge,h),(c?new h(1)[ve]==u:ve in R)||W(R,ve,{get:function(){return u}}),T[u]=h,a(a.G+a.W+a.F*(h!=g),T),a(a.S,u,{BYTES_PER_ELEMENT:t}),a(a.S+a.F*o(function(){g.of.call(h,1)}),u,{from:Oe,of:Ie}),"BYTES_PER_ELEMENT"in R||l(R,"BYTES_PER_ELEMENT",t),a(a.P,u,Ae),D(u),a(a.P+a.F*Re,u,{set:De}),a(a.P+a.F*!x,u,Ne),r||R.toString==le||(R.toString=le),a(a.P+a.F*o(function(){new h(1).slice()}),u,{slice:Le}),a(a.P+a.F*(o(function(){return[1,2].toLocaleString()!=new h([1,2]).toLocaleString()})||!o(function(){R.toLocaleString.call([1,2])})),u,{toLocaleString:je}),A[u]=x?P:O,r||x||l(R,he,O)}}else e.exports=function(){}},function(e,t,n){"use strict";var r=!0,i=!0;function o(e,t,n){var r=e.match(t);return r&&r.length>=n&&parseInt(r[n],10)}e.exports={extractVersion:o,wrapPeerConnectionEvent:function(e,t,n){if(e.RTCPeerConnection){var r=e.RTCPeerConnection.prototype,i=r.addEventListener;r.addEventListener=function(e,r){if(e!==t)return i.apply(this,arguments);var o=function(e){r(n(e))};return this._eventMap=this._eventMap||{},this._eventMap[r]=o,i.apply(this,[e,o])};var o=r.removeEventListener;r.removeEventListener=function(e,n){if(e!==t||!this._eventMap||!this._eventMap[n])return o.apply(this,arguments);var r=this._eventMap[n];return delete this._eventMap[n],o.apply(this,[e,r])},Object.defineProperty(r,"on"+t,{get:function(){return this["_on"+t]},set:function(e){this["_on"+t]&&(this.removeEventListener(t,this["_on"+t]),delete this["_on"+t]),e&&this.addEventListener(t,this["_on"+t]=e)}})}},disableLog:function(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(r=e,e?"adapter.js logging disabled":"adapter.js logging enabled")},disableWarnings:function(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(i=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))},log:function(){if("object"==typeof window){if(r)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}},deprecated:function(e,t){i&&console.warn(e+" is deprecated, please use "+t+" instead.")},detectBrowser:function(e){var t=e&&e.navigator,n={browser:null,version:null};if(void 0===e||!e.navigator)return n.browser="Not a browser.",n;if(t.mozGetUserMedia)n.browser="firefox",n.version=o(t.userAgent,/Firefox\/(\d+)\./,1);else if(t.webkitGetUserMedia)n.browser="chrome",n.version=o(t.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(t.mediaDevices&&t.userAgent.match(/Edge\/(\d+).(\d+)$/))n.browser="edge",n.version=o(t.userAgent,/Edge\/(\d+).(\d+)$/,2);else{if(!e.RTCPeerConnection||!t.userAgent.match(/AppleWebKit\/(\d+)\./))return n.browser="Not a supported browser.",n;n.browser="safari",n.version=o(t.userAgent,/AppleWebKit\/(\d+)\./,1)}return n}}},function(e,t,n){var r=n(5)("unscopables"),i=Array.prototype;void 0==i[r]&&n(13)(i,r,{}),e.exports=function(e){i[r][e]=!0}},function(e,t,n){var r=n(41)("meta"),i=n(4),o=n(14),a=n(7).f,s=0,c=Object.isExtensible||function(){return!0},u=!n(3)(function(){return c(Object.preventExtensions({}))}),f=function(e){a(e,r,{value:{i:"O"+ ++s,w:{}}})},d=e.exports={KEY:r,NEED:!1,fastKey:function(e,t){if(!i(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!o(e,r)){if(!c(e))return"F";if(!t)return"E";f(e)}return e[r].i},getWeak:function(e,t){if(!o(e,r)){if(!c(e))return!0;if(!t)return!1;f(e)}return e[r].w},onFreeze:function(e){return u&&d.NEED&&c(e)&&!o(e,r)&&f(e),e}}},function(e,t,n){var r=n(12);e.exports=function(e,t,n){for(var i in t)r(e,i,t[i],n);return e}},function(e,t,n){var r=n(20),i=n(119),o=n(80),a=n(1),s=n(6),c=n(78),u={},f={};(t=e.exports=function(e,t,n,d,l){var p,h,v,m,g=l?function(){return e}:c(e),y=r(n,d,t?2:1),b=0;if("function"!=typeof g)throw TypeError(e+" is not iterable!");if(o(g)){for(p=s(e.length);p>b;b++)if((m=t?y(a(h=e[b])[0],h[1]):y(e[b]))===u||m===f)return m}else for(v=g.call(e);!(h=v.next()).done;)if((m=i(v,y,h.value,t))===u||m===f)return m}).BREAK=u,t.RETURN=f},function(e,t){e.exports=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e}},function(e,t,n){"use strict";var r=n(2),i=n(7),o=n(8),a=n(5)("species");e.exports=function(e){var t=r[e];o&&t&&!t[a]&&i.f(t,a,{configurable:!0,get:function(){return this}})}},function(e,t,n){var r=n(131),i=n(93).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},function(e,t,n){var r=n(1),i=n(130),o=n(93),a=n(94)("IE_PROTO"),s=function(){},c=function(){var e,t=n(96)("iframe"),r=o.length;for(t.style.display="none",n(92).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),c=e.F;r--;)delete c.prototype[o[r]];return c()};e.exports=Object.create||function(e,t){var n;return null!==e?(s.prototype=r(e),n=new s,s.prototype=null,n[a]=e):n=c(),void 0===t?n:i(n,t)}},function(e,t,n){var r=n(23),i=Math.max,o=Math.min;e.exports=function(e,t){return(e=r(e))<0?i(e+t,0):o(e,t)}},function(e,t,n){var r=n(131),i=n(93);e.exports=Object.keys||function(e){return r(e,i)}},function(e,t){e.exports=!1},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function o(e){return(o=Object.getPrototypeOf||function(e){return e.__proto__})(e)}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(e,t,n){return(s="object"===("undefined"==typeof Reflect?"undefined":r(Reflect))&&Reflect.construct||function(e,t,n){var r=[null];return r.push.apply(r,t),a(new(e.bind.apply(e,r)),n.prototype)})(e,t,n)}function c(e){var t="function"==typeof Map?new Map:void 0;return(c=function(e){if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),a(n,a(function(){return s(e,arguments,o(this).constructor)},e))})(e)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,n))).code=e,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,c(Error)),t}();t.QNRTCError=u,t.UNEXPECTED_ERROR=function(e){return new u(11e3,"piliRTC: unexpected error ".concat(e))},t.AUTH_ENTER_ROOM_ERROR=function(e){return new u(11001,"enterRoom error, can not get accessToken. Error: ".concat(e,"\n please check enterRoom arguments"))},t.PUBLISH_ERROR=function(e,t){return new u(e,"publish error, signaling code: ".concat(e,", msg: ").concat(t))},t.PUBLISH_ICE_ERROR=new u(11002,"publish faild, ice not ready"),t.SUB_ICE_ERROR=new u(11003,"subscribe faild, ice not ready"),t.SUB_ERROR_NO_STREAM=function(e){return new u(11004,"subscribe faild, can not find this player in streams, userId: ".concat(e))},t.SUB_P2P_ERROR=function(e){return new u(11005,"subscribe faild, can not create p2p connection, ".concat(e))},t.PUB_P2P_ERROR=function(e){return new u(11006,"publish faild, can not create p2p connection, ".concat(e))},t.UNSUPPORT_FMT=function(e){return new u(11007,"media format not support, ".concat(e))},t.JOIN_ROOM_ERROR=function(e,t){return new u(e,"joinRoom error, code: ".concat(e,", ").concat(t))},t.SUB_ERROR=function(e,t){return new u(e,"subscribe error, signaling code: ".concat(e,", msg: ").concat(t))},t.UNPUBLISH_ERROR=function(e,t){return new u(e,"unpublish error, code: ${code}, msg: ${msg}")},t.UNSUB_ERROR=function(e,t){return new u(e,"unsubscribe error, code: ${code}, msg: ${msg}")},t.CONTROL_ERROR=function(e,t){return new u(e,"send control error, code: ${code}, msg: ${msg}")}},function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n(144)),r(n(142)),r(n(141)),t.getPayloadFromJwt=function(e){var t=e.split(".")[1];if(!t)throw new Error("parse jwt error, can not find payload string.");var n=atob(t);return JSON.parse(n)},t.getRoomAccessFromToken=function(e){var t=e.split(":")[2],n=atob(t);return JSON.parse(n)},t.arrayCheck=function(e,t,n){for(var r=0;r<e.length;r+=1)if(e[r][n]===t[n])return!0;return!1},t.removeElementFromArray=function(e,t,n){for(var r=[],i=null,o=0;o<e.length;o+=1)e[o][t]!==n?r.push(e[o]):i=e[o];return{removeElement:i,newArray:r}},t.getElementFromObject=function(e,t,n){for(var r in e){var i=e[r];if(i[t]===n)return{key:r,obj:i}}return null},t.getElementFromArray=function(e,t,n){for(var r=0;r<e.length;r+=1){var i=e[r];if(i[t]===n)return i}return null},t.sendMsgWaitResponse=function(e,t,n,r){return e.sendWsMsg(t,n),new Promise(function(t){e.once(r,t)})}},function(e,t,n){var r=n(4);e.exports=function(e,t){if(!r(e)||e._t!==t)throw TypeError("Incompatible receiver, "+t+" required!");return e}},function(e,t){e.exports={}},function(e,t,n){var r=n(0),i=n(24),o=n(3),a=n(90),s="["+a+"]",c=RegExp("^"+s+s+"*"),u=RegExp(s+s+"*$"),f=function(e,t,n){var i={},s=o(function(){return!!a[e]()||"
"!="
"[e]()}),c=i[e]=s?t(d):a[e];n&&(i[n]=c),r(r.P+r.F*s,"String",i)},d=f.trim=function(e,t){return e=String(i(e)),1&t&&(e=e.replace(c,"")),2&t&&(e=e.replace(u,"")),e};e.exports=f},function(e,t,n){var r=n(7).f,i=n(14),o=n(5)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,o)&&r(e,o,{configurable:!0,value:t})}},function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.level=t}var t,n,i;return t=e,(n=[{key:"setLevel",value:function(e){this.level=e}},{key:"log",value:function(){var e;if("log"===this.level){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];(e=console).info.apply(e,["%cLOG","color: #66ccff; font-weight: bold;"].concat(n))}}},{key:"debug",value:function(){var e;if("log"===this.level||"debug"===this.level){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];(e=console).info.apply(e,["%cDEBUG","color: #A28148; font-weight: bold;"].concat(n))}}},{key:"warning",value:function(){var e;if("disable"!==this.level){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];(e=console).warn.apply(e,["%cWARNING","color: #E44F44; font-weight: bold;"].concat(n))}}}])&&r(t.prototype,n),i&&r(t,i),e}();t.LogModel=i,t.log=new i("log")},function(e,t,n){var r=n(19),i=n(5)("toStringTag"),o="Arguments"==r(function(){return arguments}());e.exports=function(e){var t,n,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),i))?n:o?r(t):"Object"==(a=r(t))&&"function"==typeof t.callee?"Arguments":a}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){var r=n(19);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t,n){"use strict";var r=n(0),i=n(10),o=n(20),a=n(33);e.exports=function(e){r(r.S,e,{from:function(e){var t,n,r,s,c=arguments[1];return i(this),(t=void 0!==c)&&i(c),void 0==e?new this:(n=[],t?(r=0,s=o(c,arguments[2],2),a(e,!1,function(e){n.push(s(e,r++))})):a(e,!1,n.push,n),new this(n))}})}},function(e,t,n){"use strict";var r=n(0);e.exports=function(e){r(r.S,e,{of:function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];return new this(t)}})}},function(e,t,n){"use strict";e.exports=n(40)||!n(3)(function(){var e=Math.random();__defineSetter__.call(null,e,function(){}),delete n(2)[e]})},function(e,t,n){for(var r,i=n(2),o=n(13),a=n(41),s=a("typed_array"),c=a("view"),u=!(!i.ArrayBuffer||!i.DataView),f=u,d=0,l="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");d<9;)(r=i[l[d++]])?(o(r.prototype,s,!0),o(r.prototype,c,!0)):f=!1;e.exports={ABV:u,CONSTR:f,TYPED:s,VIEW:c}},function(e,t,n){"use strict";var r=n(2),i=n(0),o=n(12),a=n(32),s=n(31),c=n(33),u=n(34),f=n(4),d=n(3),l=n(61),p=n(48),h=n(89);e.exports=function(e,t,n,v,m,g){var y=r[e],b=y,S=m?"set":"add",w=b&&b.prototype,T={},R=function(e){var t=w[e];o(w,e,"delete"==e?function(e){return!(g&&!f(e))&&t.call(this,0===e?0:e)}:"has"==e?function(e){return!(g&&!f(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return g&&!f(e)?void 0:t.call(this,0===e?0:e)}:"add"==e?function(e){return t.call(this,0===e?0:e),this}:function(e,n){return t.call(this,0===e?0:e,n),this})};if("function"==typeof b&&(g||w.forEach&&!d(function(){(new b).entries().next()}))){var E=new b,C=E[S](g?{}:-0,1)!=E,_=d(function(){E.has(1)}),k=l(function(e){new b(e)}),P=!g&&d(function(){for(var e=new b,t=5;t--;)e[S](t,t);return!e.has(-0)});k||((b=t(function(t,n){u(t,b,e);var r=h(new y,t,b);return void 0!=n&&c(n,m,r[S],r),r})).prototype=w,w.constructor=b),(_||P)&&(R("delete"),R("has"),m&&R("get")),(P||C)&&R(S),g&&w.clear&&delete w.clear}else b=v.getConstructor(t,e,m,S),a(b.prototype,n),s.NEED=!0;return p(b,e),T[e]=b,i(i.G+i.W+i.F*(b!=y),T),g||v.setStrong(b,e,m),b}},function(e,t,n){var r=n(1),i=n(10),o=n(5)("species");e.exports=function(e,t){var n,a=r(e).constructor;return void 0===a||void 0==(n=r(a)[o])?t:i(n)}},function(e,t,n){"use strict";var r=n(13),i=n(12),o=n(3),a=n(24),s=n(5);e.exports=function(e,t,n){var c=s(e),u=n(a,c,""[e]),f=u[0],d=u[1];o(function(){var t={};return t[c]=function(){return 7},7!=""[e](t)})&&(i(String.prototype,e,f),r(RegExp.prototype,c,2==t?function(e,t){return d.call(e,this,t)}:function(e){return d.call(e,this)}))}},function(e,t,n){"use strict";var r=n(1);e.exports=function(){var e=r(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},function(e,t,n){var r=n(5)("iterator"),i=!1;try{var o=[7][r]();o.return=function(){i=!0},Array.from(o,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!i)return!1;var n=!1;try{var o=[7],a=o[r]();a.next=function(){return{done:n=!0}},o[r]=function(){return a},e(o)}catch(e){}return n}},function(e,t,n){var r=n(4),i=n(19),o=n(5)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[o])?!!t:"RegExp"==i(e))}},function(e,t,n){var r=n(19);e.exports=Array.isArray||function(e){return"Array"==r(e)}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,n){var r=n(17),i=n(6),o=n(38);e.exports=function(e){return function(t,n,a){var s,c=r(t),u=i(c.length),f=o(a,u);if(e&&n!=n){for(;u>f;)if((s=c[f++])!=s)return!0}else for(;u>f;f++)if((e||f in c)&&c[f]===n)return e||f||0;return!e&&-1}}},function(e,t,n){var r=n(2),i=r["__core-js_shared__"]||(r["__core-js_shared__"]={});e.exports=function(e){return i[e]||(i[e]={})}},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var i=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(a,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});var o=n(139),a=n(98),s=n(135),c=n(44),u=n(43),f=function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.enableAudio=!0,this.enableVideo=!0,this.muteAudio=!1,this.muteVideo=!1,this.isDestroyed=!1,this.streamId=n,this.userId=r,t&&this.setMediaStream(t)}var t,n,f;return t=e,(n=[{key:"play",value:function(e,t){this.video=e,this.video&&(this.video.autoplay=!0,this.video.muted=!!t,this.mediaStream&&(this.video.srcObject=this.mediaStream))}},{key:"onAudioBuffer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4096;this.audioBufferCallback=e,this.audioBufferSize=t,this.initScriptNode(this.audioBufferSize)}},{key:"getCurrentTimeDomainData",value:function(){var e=new Uint8Array(2048);return this.analyserNode?(this.analyserNode.getByteTimeDomainData(e),e):e}},{key:"getCurrentFrequencyData",value:function(){var e=new Uint8Array(2048);return this.analyserNode?(this.analyserNode.getByteFrequencyData(e),e):e}},{key:"getStats",value:function(){return this.stats?this.stats:c.defaultStatsReport}},{key:"setMicVolume",value:function(e){this.gainNode&&this.gainNode.gain.setValueAtTime(e,o.audioContext.currentTime)}},{key:"setMute",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.muteAudio=e,this.muteVideo=t,this.videoTrack&&(this.videoTrack.enabled=!this.muteVideo),this.audioTrack&&(this.audioTrack.enabled=!this.muteAudio)}},{key:"setEnable",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.enableAudio=e,this.enableVideo=t,this.videoTrack&&!this.enableVideo&&(this.videoTrack=void 0),this.audioTrack&&!this.enableAudio&&(this.audioTrack=void 0)}},{key:"setMediaStream",value:function(e){return i(this,void 0,void 0,regeneratorRuntime.mark(function t(){var n=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(this.mediaStream&&this.releaseStream(),this.originMediaStream=e,this.originMediaStream.getTracks().forEach(function(e){"video"===e.kind&&n.enableVideo&&(n.videoTrack=e,n.muteVideo&&(n.videoTrack.enabled=!1)),"audio"===e.kind&&n.enableAudio&&(n.audioTrack=e,n.muteAudio&&(n.audioTrack.enabled=!1))}),!this.enableAudio){t.next=9;break}return t.next=6,this.initAudioContext();case 6:this.mediaStream=t.sent,t.next=10;break;case 9:this.mediaStream=this.originMediaStream;case 10:a.browserReport.replaceTrack?(this.videoSender&&this.videoTrack&&this.videoSender.replaceTrack&&this.videoSender.replaceTrack(this.videoTrack),this.audioSender&&this.audioTrack&&this.audioSender.replaceTrack&&this.audioSender.replaceTrack(this.audioTrack)):this.session&&this.session.publish(this,this.streamId).then().catch(function(e){n.session&&n.session.emit("error",e)}),this.video&&(this.video.srcObject=this.mediaStream);case 12:case"end":return t.stop()}},t,this)}))}},{key:"bindWithPeerConnection",value:function(e,t){this.pc&&(this.releaseStat(),c.releasePC(this.pc)),this.pc=e,this.connId=t,t||(this.audioTrack&&this.mediaStream&&(this.audioSender=this.pc.addTrack(this.audioTrack,this.mediaStream)),this.videoTrack&&this.mediaStream&&(this.videoSender=this.pc.addTrack(this.videoTrack,this.mediaStream))),a.browserReport.stats&&(this.statInterval=setInterval(this.handleStat.bind(this),1e3))}},{key:"getPeerConnection",value:function(){return this.pc}},{key:"getAudioEncodings",value:function(){return this.audioSender?this.audioSender.getParameters().encodings:void 0}},{key:"getVideoEncodings",value:function(){return this.videoSender?this.videoSender.getParameters().encodings:void 0}},{key:"setRecordConfig",value:function(e){this.recordConfig=e}},{key:"setSession",value:function(e){this.session=e}},{key:"processSDP",value:function(e){if(!this.recordConfig)return e;var t={audio:this.recordConfig.audio.bitrate||64,video:this.recordConfig.video.bitrate||512};if(e=s.BandwidthHandler.setApplicationSpecificBandwidth(e,t),e=s.BandwidthHandler.setVideoBitrates(e,{min:t.video,max:t.video}),this.audioTrack){var n=this.audioTrack.getConstraints();e=s.BandwidthHandler.setOpusAttributes(e,{stereo:this.connId&&2===n.channelCount?1:void 0,"sprop-stereo":this.connId||2!==n.channelCount?void 0:1})}return e}},{key:"release",value:function(){this.isDestroyed=!0,this.releaseStream(),this.video&&(this.video.srcObject=null),this.pc&&(this.releaseStat(),c.releasePC(this.pc))}},{key:"releaseStat",value:function(){this.stats=void 0,this.statInterval&&(clearInterval(this.statInterval),this.statInterval=void 0)}},{key:"releaseStream",value:function(){this.pc&&(this.audioSender&&(this.pc.removeTrack(this.audioSender),this.audioSender=void 0),this.videoSender&&(this.pc.removeTrack(this.videoSender),this.videoSender=void 0)),this.mediaStream&&this.mediaStream.getTracks().forEach(function(e){e.stop()}),this.originMediaStream&&this.originMediaStream.getTracks().forEach(function(e){e.stop()})}},{key:"handleAudioBuffer",value:function(e){var t=e.inputBuffer.getChannelData(0);this.audioBufferCallback&&this.audioBufferCallback(t)}},{key:"handleStat",value:function(){return i(this,void 0,void 0,regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.pc){e.next=2;break}return e.abrupt("return",void(this.stats=c.defaultStatsReport));case 2:return e.next=4,c.getPCStats(this.pc,this.connId?"recv":"send");case 4:t=e.sent,this.stats?this.stats=c.getRateStats(t,this.stats):this.stats=t;case 6:case"end":return e.stop()}},e,this)}))}},{key:"initAudioContext",value:function(){return i(this,void 0,void 0,regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.originMediaStream&&this.audioTrack){e.next=2;break}throw u.UNEXPECTED_ERROR("can not set audio context on ".concat(this.originMediaStream));case 2:if(e.t0="suspended"===o.audioContext.state,!e.t0){e.next=6;break}return e.next=6,o.audioContext.resume();case 6:if(this.audioSource=o.audioContext.createMediaStreamSource(this.originMediaStream),this.analyserNode=o.audioContext.createAnalyser(),this.analyserNode.fftSize=2048,this.audioSource.connect(this.analyserNode),this.audioBufferSize&&this.initScriptNode(this.audioBufferSize),this.gainNode=o.audioContext.createGain(),this.audioSource.connect(this.gainNode),!this.connId){e.next=15;break}return e.abrupt("return",this.originMediaStream);case 15:if(!a.browserReport.mediaStreamDest){e.next=18;break}return t=o.audioContext.createMediaStreamDestination(),e.abrupt("return",(this.gainNode.connect(t),this.audioTrack=t.stream.getTracks()[0],this.videoTrack&&(this.videoTrack=this.videoTrack.clone(),t.stream.addTrack(this.videoTrack)),t.stream));case 18:return e.abrupt("return",this.originMediaStream);case 19:case"end":return e.stop()}},e,this)}))}},{key:"initScriptNode",value:function(e){this.audioSource&&(this.scriptNode=o.audioContext.createScriptProcessor(e,1,1),this.scriptNode.onaudioprocess=this.handleAudioBuffer.bind(this),this.audioSource.connect(this.scriptNode),this.scriptNode.connect(o.audioContext.destination))}}])&&r(t.prototype,n),f&&r(t,f),e}();t.Stream=f},function(e,t,n){var r;
/*!
* EventEmitter v5.2.4 - git.io/ee
* Unlicense - http://unlicense.org/
* Oliver Caldwell - http://oli.me.uk/
* @preserve
*/!function(t){"use strict";function i(){}var o=i.prototype,a=t.EventEmitter;function s(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function c(e){return function(){return this[e].apply(this,arguments)}}o.getListeners=function(e){var t,n,r=this._getEvents();if(e instanceof RegExp)for(n in t={},r)r.hasOwnProperty(n)&&e.test(n)&&(t[n]=r[n]);else t=r[e]||(r[e]=[]);return t},o.flattenListeners=function(e){var t,n=[];for(t=0;t<e.length;t+=1)n.push(e[t].listener);return n},o.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&((t={})[e]=n),t||n},o.addListener=function(e,t){if(!function e(t){return"function"==typeof t||t instanceof RegExp||!(!t||"object"!=typeof t)&&e(t.listener)}(t))throw new TypeError("listener must be a function");var n,r=this.getListenersAsObject(e),i="object"==typeof t;for(n in r)r.hasOwnProperty(n)&&-1===s(r[n],t)&&r[n].push(i?t:{listener:t,once:!1});return this},o.on=c("addListener"),o.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},o.once=c("addOnceListener"),o.defineEvent=function(e){return this.getListeners(e),this},o.defineEvents=function(e){for(var t=0;t<e.length;t+=1)this.defineEvent(e[t]);return this},o.removeListener=function(e,t){var n,r,i=this.getListenersAsObject(e);for(r in i)i.hasOwnProperty(r)&&-1!==(n=s(i[r],t))&&i[r].splice(n,1);return this},o.off=c("removeListener"),o.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},o.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},o.manipulateListeners=function(e,t,n){var r,i,o=e?this.removeListener:this.addListener,a=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(r=n.length;r--;)o.call(this,t,n[r]);else for(r in t)t.hasOwnProperty(r)&&(i=t[r])&&("function"==typeof i?o.call(this,r,i):a.call(this,r,i));return this},o.removeEvent=function(e){var t,n=typeof e,r=this._getEvents();if("string"===n)delete r[e];else if(e instanceof RegExp)for(t in r)r.hasOwnProperty(t)&&e.test(t)&&delete r[t];else delete this._events;return this},o.removeAllListeners=c("removeEvent"),o.emitEvent=function(e,t){var n,r,i,o,a=this.getListenersAsObject(e);for(o in a)if(a.hasOwnProperty(o))for(n=a[o].slice(0),i=0;i<n.length;i++)!0===(r=n[i]).once&&this.removeListener(e,r.listener),r.listener.apply(this,t||[])===this._getOnceReturnValue()&&this.removeListener(e,r.listener);return this},o.trigger=c("emitEvent"),o.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},o.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},o._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},o._getEvents=function(){return this._events||(this._events={})},i.noConflict=function(){return t.EventEmitter=a,i},void 0===(r=function(){return i}.call(t,n,t,e))||(e.exports=r)}(this||{})},function(e,t,n){var r=n(2).navigator;e.exports=r&&r.userAgent||""},function(e,t,n){"use strict";var r=n(2),i=n(8),o=n(40),a=n(56),s=n(13),c=n(32),u=n(3),f=n(34),d=n(23),l=n(6),p=n(107),h=n(36).f,v=n(7).f,m=n(76),g=n(48),y="prototype",b="Wrong index!",S=r.ArrayBuffer,w=r.DataView,T=r.Math,R=r.RangeError,E=r.Infinity,C=S,_=T.abs,k=T.pow,P=T.floor,x=T.log,O=T.LN2,I=i?"_b":"buffer",M=i?"_l":"byteLength",j=i?"_o":"byteOffset";function A(e,t,n){var r,i,o,a=new Array(n),s=8*n-t-1,c=(1<<s)-1,u=c>>1,f=23===t?k(2,-24)-k(2,-77):0,d=0,l=e<0||0===e&&1/e<0?1:0;for((e=_(e))!=e||e===E?(i=e!=e?1:0,r=c):(r=P(x(e)/O),e*(o=k(2,-r))<1&&(r--,o*=2),(e+=r+u>=1?f/o:f*k(2,1-u))*o>=2&&(r++,o/=2),r+u>=c?(i=0,r=c):r+u>=1?(i=(e*o-1)*k(2,t),r+=u):(i=e*k(2,u-1)*k(2,t),r=0));t>=8;a[d++]=255&i,i/=256,t-=8);for(r=r<<t|i,s+=t;s>0;a[d++]=255&r,r/=256,s-=8);return a[--d]|=128*l,a}function L(e,t,n){var r,i=8*n-t-1,o=(1<<i)-1,a=o>>1,s=i-7,c=n-1,u=e[c--],f=127&u;for(u>>=7;s>0;f=256*f+e[c],c--,s-=8);for(r=f&(1<<-s)-1,f>>=-s,s+=t;s>0;r=256*r+e[c],c--,s-=8);if(0===f)f=1-a;else{if(f===o)return r?NaN:u?-E:E;r+=k(2,t),f-=a}return(u?-1:1)*r*k(2,f-t)}function D(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]}function N(e){return[255&e]}function F(e){return[255&e,e>>8&255]}function U(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]}function B(e){return A(e,52,8)}function W(e){return A(e,23,4)}function G(e,t,n){v(e[y],t,{get:function(){return this[n]}})}function V(e,t,n,r){var i=p(+n);if(i+t>e[M])throw R(b);var o=e[I]._b,a=i+e[j],s=o.slice(a,a+t);return r?s:s.reverse()}function z(e,t,n,r,i,o){var a=p(+n);if(a+t>e[M])throw R(b);for(var s=e[I]._b,c=a+e[j],u=r(+i),f=0;f<t;f++)s[c+f]=u[o?f:t-f-1]}if(a.ABV){if(!u(function(){S(1)})||!u(function(){new S(-1)})||u(function(){return new S,new S(1.5),new S(NaN),"ArrayBuffer"!=S.name})){for(var $,J=(S=function(e){return f(this,S),new C(p(e))})[y]=C[y],X=h(C),H=0;X.length>H;)($=X[H++])in S||s(S,$,C[$]);o||(J.constructor=S)}var q=new w(new S(2)),K=w[y].setInt8;q.setInt8(0,2147483648),q.setInt8(1,2147483649),!q.getInt8(0)&&q.getInt8(1)||c(w[y],{setInt8:function(e,t){K.call(this,e,t<<24>>24)},setUint8:function(e,t){K.call(this,e,t<<24>>24)}},!0)}else S=function(e){f(this,S,"ArrayBuffer");var t=p(e);this._b=m.call(new Array(t),0),this[M]=t},w=function(e,t,n){f(this,w,"DataView"),f(e,S,"DataView");var r=e[M],i=d(t);if(i<0||i>r)throw R("Wrong offset!");if(i+(n=void 0===n?r-i:l(n))>r)throw R("Wrong length!");this[I]=e,this[j]=i,this[M]=n},i&&(G(S,"byteLength","_l"),G(w,"buffer","_b"),G(w,"byteLength","_l"),G(w,"byteOffset","_o")),c(w[y],{getInt8:function(e){return V(this,1,e)[0]<<24>>24},getUint8:function(e){return V(this,1,e)[0]},getInt16:function(e){var t=V(this,2,e,arguments[1]);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=V(this,2,e,arguments[1]);return t[1]<<8|t[0]},getInt32:function(e){return D(V(this,4,e,arguments[1]))},getUint32:function(e){return D(V(this,4,e,arguments[1]))>>>0},getFloat32:function(e){return L(V(this,4,e,arguments[1]),23,4)},getFloat64:function(e){return L(V(this,8,e,arguments[1]),52,8)},setInt8:function(e,t){z(this,1,e,N,t)},setUint8:function(e,t){z(this,1,e,N,t)},setInt16:function(e,t){z(this,2,e,F,t,arguments[2])},setUint16:function(e,t){z(this,2,e,F,t,arguments[2])},setInt32:function(e,t){z(this,4,e,U,t,arguments[2])},setUint32:function(e,t){z(this,4,e,U,t,arguments[2])},setFloat32:function(e,t){z(this,4,e,W,t,arguments[2])},setFloat64:function(e,t){z(this,8,e,B,t,arguments[2])}});g(S,"ArrayBuffer"),g(w,"DataView"),s(w[y],a.VIEW,!0),t.ArrayBuffer=S,t.DataView=w},function(e,t,n){"use strict";var r=n(10);e.exports.f=function(e){return new function(e){var t,n;this.promise=new e(function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r}),this.resolve=r(t),this.reject=r(n)}(e)}},function(e,t,n){var r=n(2),i=n(74).set,o=r.MutationObserver||r.WebKitMutationObserver,a=r.process,s=r.Promise,c="process"==n(19)(a);e.exports=function(){var e,t,n,u=function(){var r,i;for(c&&(r=a.domain)&&r.exit();e;){i=e.fn,e=e.next;try{i()}catch(r){throw e?n():t=void 0,r}}t=void 0,r&&r.enter()};if(c)n=function(){a.nextTick(u)};else if(!o||r.navigator&&r.navigator.standalone)if(s&&s.resolve){var f=s.resolve();n=function(){f.then(u)}}else n=function(){i.call(r,u)};else{var d=!0,l=document.createTextNode("");new o(u).observe(l,{characterData:!0}),n=function(){l.data=d=!d}}return function(r){var i={fn:r,next:void 0};t&&(t.next=i),e||(e=i,n()),t=i}}},function(e,t,n){var r,i,o,a=n(20),s=n(126),c=n(92),u=n(96),f=n(2),d=f.process,l=f.setImmediate,p=f.clearImmediate,h=f.MessageChannel,v=f.Dispatch,m=0,g={},y=function(){var e=+this;if(g.hasOwnProperty(e)){var t=g[e];delete g[e],t()}},b=function(e){y.call(e.data)};l&&p||(l=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return g[++m]=function(){s("function"==typeof e?e:Function(e),t)},r(m),m},p=function(e){delete g[e]},"process"==n(19)(d)?r=function(e){d.nextTick(a(y,e,1))}:v&&v.now?r=function(e){v.now(a(y,e,1))}:h?(o=(i=new h).port2,i.port1.onmessage=b,r=a(o.postMessage,o,1)):f.addEventListener&&"function"==typeof postMessage&&!f.importScripts?(r=function(e){f.postMessage(e+"","*")},f.addEventListener("message",b,!1)):r="onreadystatechange"in u("script")?function(e){c.appendChild(u("script")).onreadystatechange=function(){c.removeChild(this),y.call(e)}}:function(e){setTimeout(a(y,e,1),0)}),e.exports={set:l,clear:p}},function(e,t,n){"use strict";var r=n(30),i=n(116),o=n(46),a=n(17);e.exports=n(84)(Array,"Array",function(e,t){this._t=a(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,i(1)):i(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])},"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(e,t,n){"use strict";var r=n(9),i=n(38),o=n(6);e.exports=function(e){for(var t=r(this),n=o(t.length),a=arguments.length,s=i(a>1?arguments[1]:void 0,n),c=a>2?arguments[2]:void 0,u=void 0===c?n:i(c,n);u>s;)t[s++]=e;return t}},function(e,t,n){var r=n(271);e.exports=function(e,t){return new(r(e))(t)}},function(e,t,n){var r=n(50),i=n(5)("iterator"),o=n(46);e.exports=n(26).getIteratorMethod=function(e){if(void 0!=e)return e[i]||e["@@iterator"]||o[r(e)]}},function(e,t,n){"use strict";var r=n(7),i=n(42);e.exports=function(e,t,n){t in e?r.f(e,t,i(0,n)):e[t]=n}},function(e,t,n){var r=n(46),i=n(5)("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||o[i]===e)}},function(e,t,n){var r=n(5)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[r]=!1,!"/./"[e](t)}catch(e){}}return!0}},function(e,t,n){var r=n(62),i=n(24);e.exports=function(e,t,n){if(r(t))throw TypeError("String#"+n+" doesn't accept regex!");return String(i(e))}},function(e,t,n){"use strict";var r=n(37),i=n(42),o=n(48),a={};n(13)(a,n(5)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(a,{next:i(1,n)}),o(e,t+" Iterator")}},function(e,t,n){"use strict";var r=n(40),i=n(0),o=n(12),a=n(13),s=n(14),c=n(46),u=n(83),f=n(48),d=n(15),l=n(5)("iterator"),p=!([].keys&&"next"in[].keys()),h=function(){return this};e.exports=function(e,t,n,v,m,g,y){u(n,t,v);var b,S,w,T=function(e){if(!p&&e in _)return _[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},R=t+" Iterator",E="values"==m,C=!1,_=e.prototype,k=_[l]||_["@@iterator"]||m&&_[m],P=!p&&k||T(m),x=m?E?T("entries"):P:void 0,O="Array"==t&&_.entries||k;if(O&&(w=d(O.call(new e)))!==Object.prototype&&w.next&&(f(w,R,!0),r||s(w,l)||a(w,l,h)),E&&k&&"values"!==k.name&&(C=!0,P=function(){return k.call(this)}),r&&!y||!p&&!C&&_[l]||a(_,l,P),c[t]=P,c[R]=h,m)if(b={values:E?P:T("values"),keys:g?P:T("keys"),entries:x},y)for(S in b)S in _||o(_,S,b[S]);else i(i.P+i.F*(p||C),t,b);return b}},function(e,t,n){var r=n(23),i=n(24);e.exports=function(e){return function(t,n){var o,a,s=String(i(t)),c=r(n),u=s.length;return c<0||c>=u?e?"":void 0:(o=s.charCodeAt(c))<55296||o>56319||c+1===u||(a=s.charCodeAt(c+1))<56320||a>57343?e?s.charAt(c):o:e?s.slice(c,c+2):a-56320+(o-55296<<10)+65536}}},function(e,t){var n=Math.expm1;e.exports=!n||n(10)>22025.465794806718||n(10)<22025.465794806718||-2e-17!=n(-2e-17)?function(e){return 0==(e=+e)?e:e>-1e-6&&e<1e-6?e+e*e/2:Math.exp(e)-1}:n},function(e,t){e.exports=Math.sign||function(e){return 0==(e=+e)||e!=e?e:e<0?-1:1}},function(e,t,n){"use strict";var r=n(23),i=n(24);e.exports=function(e){var t=String(i(this)),n="",o=r(e);if(o<0||o==1/0)throw RangeError("Count can't be negative");for(;o>0;(o>>>=1)&&(t+=t))1&o&&(n+=t);return n}},function(e,t,n){var r=n(4),i=n(91).set;e.exports=function(e,t,n){var o,a=t.constructor;return a!==n&&"function"==typeof a&&(o=a.prototype)!==n.prototype&&r(o)&&i&&i(e,o),e}},function(e,t){e.exports="\t\n\v\f\r \u2028\u2029\ufeff"},function(e,t,n){var r=n(4),i=n(1),o=function(e,t){if(i(e),!r(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,r){try{(r=n(20)(Function.call,n(16).f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,n){return o(e,n),t?e.__proto__=n:r(e,n),e}}({},!1):void 0),check:o}},function(e,t,n){var r=n(2).document;e.exports=r&&r.documentElement},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){var r=n(66)("keys"),i=n(41);e.exports=function(e){return r[e]||(r[e]=i(e))}},function(e,t,n){var r=n(2),i=n(26),o=n(40),a=n(132),s=n(7).f;e.exports=function(e){var t=i.Symbol||(i.Symbol=o?{}:r.Symbol||{});"_"==e.charAt(0)||e in t||s(t,e,{value:a.f(e)})}},function(e,t,n){var r=n(4),i=n(2).document,o=r(i)&&r(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},function(e,t){var n,r,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var c,u=[],f=!1,d=-1;function l(){f&&c&&(f=!1,c.length?u=c.concat(u):d=-1,u.length&&p())}function p(){if(!f){var e=s(l);f=!0;for(var t=u.length;t;){for(c=u,u=[];++d<t;)c&&c[d].run();d=-1,t=u.length}c=null,f=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function v(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];u.push(new h(e,t)),1!==u.length||f||s(p)},h.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=v,i.addListener=v,i.once=v,i.off=v,i.removeListener=v,i.removeAllListeners=v,i.emit=v,i.prependListener=v,i.prependOnceListener=v,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(138),i=n(136);t.browserReport=function(){var e=r.detect();if(!e)return{support:!1};switch(e.name){case"chrome":return{support:i.gt(e.version,"56.0.0"),mediaStreamDest:i.gt(e.version,"56.0.0"),replaceTrack:i.gt(e.version,"65.0.0"),stats:i.gt(e.version,"56.0.0"),ondevicechange:!0};case"safari":return{support:i.gt(e.version,"11.0.0"),replaceTrack:i.gt(e.version,"11.0.0"),stats:!1,ondevicechange:!1,mediaStreamDest:!1}}return{support:!1}}()},function(e,t,n){"use strict";var r={generateIdentifier:function(){return Math.random().toString(36).substr(2,10)}};r.localCName=r.generateIdentifier(),r.splitLines=function(e){return e.trim().split("\n").map(function(e){return e.trim()})},r.splitSections=function(e){return e.split("\nm=").map(function(e,t){return(t>0?"m="+e:e).trim()+"\r\n"})},r.getDescription=function(e){var t=r.splitSections(e);return t&&t[0]},r.getMediaSections=function(e){var t=r.splitSections(e);return t.shift(),t},r.matchPrefix=function(e,t){return r.splitLines(e).filter(function(e){return 0===e.indexOf(t)})},r.parseCandidate=function(e){for(var t,n={foundation:(t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" "))[0],component:parseInt(t[1],10),protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],port:parseInt(t[5],10),type:t[7]},r=8;r<t.length;r+=2)switch(t[r]){case"raddr":n.relatedAddress=t[r+1];break;case"rport":n.relatedPort=parseInt(t[r+1],10);break;case"tcptype":n.tcpType=t[r+1];break;case"ufrag":n.ufrag=t[r+1],n.usernameFragment=t[r+1];break;default:n[t[r]]=t[r+1]}return n},r.writeCandidate=function(e){var t=[];t.push(e.foundation),t.push(e.component),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.ip),t.push(e.port);var n=e.type;return t.push("typ"),t.push(n),"host"!==n&&e.relatedAddress&&e.relatedPort&&(t.push("raddr"),t.push(e.relatedAddress),t.push("rport"),t.push(e.relatedPort)),e.tcpType&&"tcp"===e.protocol.toLowerCase()&&(t.push("tcptype"),t.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(t.push("ufrag"),t.push(e.usernameFragment||e.ufrag)),"candidate:"+t.join(" ")},r.parseIceOptions=function(e){return e.substr(14).split(" ")},r.parseRtpMap=function(e){var t=e.substr(9).split(" "),n={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),n.name=t[0],n.clockRate=parseInt(t[1],10),n.numChannels=3===t.length?parseInt(t[2],10):1,n},r.writeRtpMap=function(e){var t=e.payloadType;return void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType),"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==e.numChannels?"/"+e.numChannels:"")+"\r\n"},r.parseExtmap=function(e){var t=e.substr(9).split(" ");return{id:parseInt(t[0],10),direction:t[0].indexOf("/")>0?t[0].split("/")[1]:"sendrecv",uri:t[1]}},r.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+"\r\n"},r.parseFmtp=function(e){for(var t,n={},r=e.substr(e.indexOf(" ")+1).split(";"),i=0;i<r.length;i++)n[(t=r[i].trim().split("="))[0].trim()]=t[1];return n},r.writeFmtp=function(e){var t="",n=e.payloadType;if(void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){var r=[];Object.keys(e.parameters).forEach(function(t){r.push(t+"="+e.parameters[t])}),t+="a=fmtp:"+n+" "+r.join(";")+"\r\n"}return t},r.parseRtcpFb=function(e){var t=e.substr(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},r.writeRtcpFb=function(e){var t="",n=e.payloadType;return void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach(function(e){t+="a=rtcp-fb:"+n+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"}),t},r.parseSsrcMedia=function(e){var t=e.indexOf(" "),n={ssrc:parseInt(e.substr(7,t-7),10)},r=e.indexOf(":",t);return r>-1?(n.attribute=e.substr(t+1,r-t-1),n.value=e.substr(r+1)):n.attribute=e.substr(t+1),n},r.getMid=function(e){var t=r.matchPrefix(e,"a=mid:")[0];if(t)return t.substr(6)},r.parseFingerprint=function(e){var t=e.substr(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1]}},r.getDtlsParameters=function(e,t){return{role:"auto",fingerprints:r.matchPrefix(e+t,"a=fingerprint:").map(r.parseFingerprint)}},r.writeDtlsParameters=function(e,t){var n="a=setup:"+t+"\r\n";return e.fingerprints.forEach(function(e){n+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"}),n},r.getIceParameters=function(e,t){var n=r.splitLines(e);return{usernameFragment:(n=n.concat(r.splitLines(t))).filter(function(e){return 0===e.indexOf("a=ice-ufrag:")})[0].substr(12),password:n.filter(function(e){return 0===e.indexOf("a=ice-pwd:")})[0].substr(10)}},r.writeIceParameters=function(e){return"a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n"},r.parseRtpParameters=function(e){for(var t={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},n=r.splitLines(e)[0].split(" "),i=3;i<n.length;i++){var o=n[i],a=r.matchPrefix(e,"a=rtpmap:"+o+" ")[0];if(a){var s=r.parseRtpMap(a),c=r.matchPrefix(e,"a=fmtp:"+o+" ");switch(s.parameters=c.length?r.parseFmtp(c[0]):{},s.rtcpFeedback=r.matchPrefix(e,"a=rtcp-fb:"+o+" ").map(r.parseRtcpFb),t.codecs.push(s),s.name.toUpperCase()){case"RED":case"ULPFEC":t.fecMechanisms.push(s.name.toUpperCase())}}}return r.matchPrefix(e,"a=extmap:").forEach(function(e){t.headerExtensions.push(r.parseExtmap(e))}),t},r.writeRtpDescription=function(e,t){var n="";n+="m="+e+" ",n+=t.codecs.length>0?"9":"0",n+=" UDP/TLS/RTP/SAVPF ",n+=t.codecs.map(function(e){return void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType}).join(" ")+"\r\n",n+="c=IN IP4 0.0.0.0\r\n",n+="a=rtcp:9 IN IP4 0.0.0.0\r\n",t.codecs.forEach(function(e){n+=r.writeRtpMap(e),n+=r.writeFmtp(e),n+=r.writeRtcpFb(e)});var i=0;return t.codecs.forEach(function(e){e.maxptime>i&&(i=e.maxptime)}),i>0&&(n+="a=maxptime:"+i+"\r\n"),n+="a=rtcp-mux\r\n",t.headerExtensions.forEach(function(e){n+=r.writeExtmap(e)}),n},r.parseRtpEncodingParameters=function(e){var t,n=[],i=r.parseRtpParameters(e),o=-1!==i.fecMechanisms.indexOf("RED"),a=-1!==i.fecMechanisms.indexOf("ULPFEC"),s=r.matchPrefix(e,"a=ssrc:").map(function(e){return r.parseSsrcMedia(e)}).filter(function(e){return"cname"===e.attribute}),c=s.length>0&&s[0].ssrc,u=r.matchPrefix(e,"a=ssrc-group:FID").map(function(e){var t=e.split(" ");return t.shift(),t.map(function(e){return parseInt(e,10)})});u.length>0&&u[0].length>1&&u[0][0]===c&&(t=u[0][1]),i.codecs.forEach(function(e){if("RTX"===e.name.toUpperCase()&&e.parameters.apt){var r={ssrc:c,codecPayloadType:parseInt(e.parameters.apt,10),rtx:{ssrc:t}};n.push(r),o&&((r=JSON.parse(JSON.stringify(r))).fec={ssrc:t,mechanism:a?"red+ulpfec":"red"},n.push(r))}}),0===n.length&&c&&n.push({ssrc:c});var f=r.matchPrefix(e,"b=");return f.length&&(f=0===f[0].indexOf("b=TIAS:")?parseInt(f[0].substr(7),10):0===f[0].indexOf("b=AS:")?1e3*parseInt(f[0].substr(5),10)*.95-16e3:void 0,n.forEach(function(e){e.maxBitrate=f})),n},r.parseRtcpParameters=function(e){var t={},n=r.matchPrefix(e,"a=ssrc:").map(function(e){return r.parseSsrcMedia(e)}).filter(function(e){return"cname"===e.attribute})[0];n&&(t.cname=n.value,t.ssrc=n.ssrc);var i=r.matchPrefix(e,"a=rtcp-rsize");t.reducedSize=i.length>0,t.compound=0===i.length;var o=r.matchPrefix(e,"a=rtcp-mux");return t.mux=o.length>0,t},r.parseMsid=function(e){var t,n=r.matchPrefix(e,"a=msid:");if(1===n.length)return{stream:(t=n[0].substr(7).split(" "))[0],track:t[1]};var i=r.matchPrefix(e,"a=ssrc:").map(function(e){return r.parseSsrcMedia(e)}).filter(function(e){return"msid"===e.attribute});return i.length>0?{stream:(t=i[0].value.split(" "))[0],track:t[1]}:void 0},r.generateSessionId=function(){return Math.random().toString().substr(2,21)},r.writeSessionBoilerplate=function(e,t){var n=void 0!==t?t:2;return"v=0\r\no=thisisadapterortc "+(e||r.generateSessionId())+" "+n+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},r.writeMediaSection=function(e,t,n,i){var o=r.writeRtpDescription(e.kind,t);if(o+=r.writeIceParameters(e.iceGatherer.getLocalParameters()),o+=r.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===n?"actpass":"active"),o+="a=mid:"+e.mid+"\r\n",e.direction?o+="a="+e.direction+"\r\n":e.rtpSender&&e.rtpReceiver?o+="a=sendrecv\r\n":e.rtpSender?o+="a=sendonly\r\n":e.rtpReceiver?o+="a=recvonly\r\n":o+="a=inactive\r\n",e.rtpSender){var a="msid:"+i.id+" "+e.rtpSender.track.id+"\r\n";o+="a="+a,o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+a,e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+a,o+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+r.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+r.localCName+"\r\n"),o},r.getDirection=function(e,t){for(var n=r.splitLines(e),i=0;i<n.length;i++)switch(n[i]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return n[i].substr(2)}return t?r.getDirection(t):"sendrecv"},r.getKind=function(e){return r.splitLines(e)[0].split(" ")[0].substr(2)},r.isRejected=function(e){return"0"===e.split(" ",2)[1]},r.parseMLine=function(e){var t=r.splitLines(e)[0].substr(2).split(" ");return{kind:t[0],port:parseInt(t[1],10),protocol:t[2],fmt:t.slice(3).join(" ")}},r.parseOLine=function(e){var t=r.matchPrefix(e,"o=")[0].substr(2).split(" ");return{username:t[0],sessionId:t[1],sessionVersion:parseInt(t[2],10),netType:t[3],addressType:t[4],address:t[5]}},e.exports=r},function(e,t){e.exports=Math.scale||function(e,t,n,r,i){return 0===arguments.length||e!=e||t!=t||n!=n||r!=r||i!=i?NaN:e===1/0||e===-1/0?e:(e-t)*(i-r)/(n-t)+r}},function(e,t,n){var r=n(33);e.exports=function(e,t){var n=[];return r(e,!1,n.push,n,t),n}},function(e,t,n){var r=n(50),i=n(101);e.exports=function(e){return function(){if(r(this)!=e)throw TypeError(e+"#toJSON isn't generic");return i(this)}}},function(e,t,n){var r=n(39),i=n(17),o=n(51).f;e.exports=function(e){return function(t){for(var n,a=i(t),s=r(a),c=s.length,u=0,f=[];c>u;)o.call(a,n=s[u++])&&f.push(e?[n,a[n]]:a[n]);return f}}},function(e,t,n){var r=n(6),i=n(88),o=n(24);e.exports=function(e,t,n,a){var s=String(o(e)),c=s.length,u=void 0===n?" ":String(n),f=r(t);if(f<=c||""==u)return s;var d=f-c,l=i.call(u,Math.ceil(d/u.length));return l.length>d&&(l=l.slice(0,d)),a?l+s:s+l}},function(e,t,n){"use strict";var r=n(63),i=n(4),o=n(6),a=n(20),s=n(5)("isConcatSpreadable");e.exports=function e(t,n,c,u,f,d,l,p){for(var h,v,m=f,g=0,y=!!l&&a(l,p,3);g<u;){if(g in c){if(h=y?y(c[g],g,n):c[g],v=!1,i(h)&&(v=void 0!==(v=h[s])?!!v:r(h)),v&&d>0)m=e(t,n,h,o(h.length),m,d-1)-1;else{if(m>=9007199254740991)throw TypeError();t[m]=h}m++}g++}return m}},function(e,t,n){var r=n(36),i=n(64),o=n(1),a=n(2).Reflect;e.exports=a&&a.ownKeys||function(e){var t=r.f(o(e)),n=i.f;return n?t.concat(n(e)):t}},function(e,t,n){var r=n(23),i=n(6);e.exports=function(e){if(void 0===e)return 0;var t=r(e),n=i(t);if(t!==n)throw RangeError("Wrong length!");return n}},function(e,t,n){"use strict";var r=n(32),i=n(31).getWeak,o=n(1),a=n(4),s=n(34),c=n(33),u=n(21),f=n(14),d=n(45),l=u(5),p=u(6),h=0,v=function(e){return e._l||(e._l=new m)},m=function(){this.a=[]},g=function(e,t){return l(e.a,function(e){return e[0]===t})};m.prototype={get:function(e){var t=g(this,e);if(t)return t[1]},has:function(e){return!!g(this,e)},set:function(e,t){var n=g(this,e);n?n[1]=t:this.a.push([e,t])},delete:function(e){var t=p(this.a,function(t){return t[0]===e});return~t&&this.a.splice(t,1),!!~t}},e.exports={getConstructor:function(e,t,n,o){var u=e(function(e,r){s(e,u,t,"_i"),e._t=t,e._i=h++,e._l=void 0,void 0!=r&&c(r,n,e[o],e)});return r(u.prototype,{delete:function(e){if(!a(e))return!1;var n=i(e);return!0===n?v(d(this,t)).delete(e):n&&f(n,this._i)&&delete n[this._i]},has:function(e){if(!a(e))return!1;var n=i(e);return!0===n?v(d(this,t)).has(e):n&&f(n,this._i)}}),u},def:function(e,t,n){var r=i(o(t),!0);return!0===r?v(e).set(t,n):r[e._i]=n,e},ufstore:v}},function(e,t,n){"use strict";var r,i=n(21)(0),o=n(12),a=n(31),s=n(128),c=n(108),u=n(4),f=n(3),d=n(45),l=a.getWeak,p=Object.isExtensible,h=c.ufstore,v={},m=function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},g={get:function(e){if(u(e)){var t=l(e);return!0===t?h(d(this,"WeakMap")).get(e):t?t[this._i]:void 0}},set:function(e,t){return c.def(d(this,"WeakMap"),e,t)}},y=e.exports=n(57)("WeakMap",m,g,c,!0,!0);f(function(){return 7!=(new y).set((Object.freeze||Object)(v),7).get(v)})&&(s((r=c.getConstructor(m,"WeakMap")).prototype,g),a.NEED=!0,i(["delete","has","get","set"],function(e){var t=y.prototype,n=t[e];o(t,e,function(t,i){if(u(t)&&!p(t)){this._f||(this._f=new r);var o=this._f[e](t,i);return"set"==e?this:o}return n.call(this,t,i)})}))},function(e,t,n){"use strict";var r=n(111),i=n(45);e.exports=n(57)("Set",function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{add:function(e){return r.def(i(this,"Set"),e=0===e?0:e,e)}},r)},function(e,t,n){"use strict";var r=n(7).f,i=n(37),o=n(32),a=n(20),s=n(34),c=n(33),u=n(84),f=n(116),d=n(35),l=n(8),p=n(31).fastKey,h=n(45),v=l?"_s":"size",m=function(e,t){var n,r=p(t);if("F"!==r)return e._i[r];for(n=e._f;n;n=n.n)if(n.k==t)return n};e.exports={getConstructor:function(e,t,n,u){var f=e(function(e,r){s(e,f,t,"_i"),e._t=t,e._i=i(null),e._f=void 0,e._l=void 0,e[v]=0,void 0!=r&&c(r,n,e[u],e)});return o(f.prototype,{clear:function(){for(var e=h(this,t),n=e._i,r=e._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete n[r.i];e._f=e._l=void 0,e[v]=0},delete:function(e){var n=h(this,t),r=m(n,e);if(r){var i=r.n,o=r.p;delete n._i[r.i],r.r=!0,o&&(o.n=i),i&&(i.p=o),n._f==r&&(n._f=i),n._l==r&&(n._l=o),n[v]--}return!!r},forEach:function(e){h(this,t);for(var n,r=a(e,arguments.length>1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(r(n.v,n.k,this);n&&n.r;)n=n.p},has:function(e){return!!m(h(this,t),e)}}),l&&r(f.prototype,"size",{get:function(){return h(this,t)[v]}}),f},def:function(e,t,n){var r,i,o=m(e,t);return o?o.v=n:(e._l=o={i:i=p(t,!0),k:t,v:n,p:r=e._l,n:void 0,r:!1},e._f||(e._f=o),r&&(r.n=o),e[v]++,"F"!==i&&(e._i[i]=o)),e},getEntry:m,setStrong:function(e,t,n){u(e,t,function(e,n){this._t=h(e,t),this._k=n,this._l=void 0},function(){for(var e=this._k,t=this._l;t&&t.r;)t=t.p;return this._t&&(this._l=t=t?t.n:this._t._f)?f(0,"keys"==e?t.k:"values"==e?t.v:[t.k,t.v]):(this._t=void 0,f(1))},n?"entries":"values",!n,!0),d(t)}}},function(e,t,n){"use strict";var r=n(111),i=n(45);e.exports=n(57)("Map",function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{get:function(e){var t=r.getEntry(i(this,"Map"),e);return t&&t.v},set:function(e,t){return r.def(i(this,"Map"),0===e?0:e,t)}},r,!0)},function(e,t,n){var r=n(1),i=n(4),o=n(72);e.exports=function(e,t){if(r(e),i(t)&&t.constructor===e)return t;var n=o.f(e);return(0,n.resolve)(t),n.promise}},function(e,t){e.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},function(e,t,n){n(8)&&"g"!=/./g.flags&&n(7).f(RegExp.prototype,"flags",{configurable:!0,get:n(60)})},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){"use strict";var r=n(9),i=n(38),o=n(6);e.exports=[].copyWithin||function(e,t){var n=r(this),a=o(n.length),s=i(e,a),c=i(t,a),u=arguments.length>2?arguments[2]:void 0,f=Math.min((void 0===u?a:i(u,a))-c,a-s),d=1;for(c<s&&s<c+f&&(d=-1,c+=f-1,s+=f-1);f-- >0;)c in n?n[s]=n[c]:delete n[s],s+=d,c+=d;return n}},function(e,t,n){var r=n(10),i=n(9),o=n(52),a=n(6);e.exports=function(e,t,n,s,c){r(t);var u=i(e),f=o(u),d=a(u.length),l=c?d-1:0,p=c?-1:1;if(n<2)for(;;){if(l in f){s=f[l],l+=p;break}if(l+=p,c?l<0:d<=l)throw TypeError("Reduce of empty array with no initial value")}for(;c?l>=0:d>l;l+=p)l in f&&(s=t(s,f[l],l,u));return s}},function(e,t,n){var r=n(1);e.exports=function(e,t,n,i){try{return i?t(r(n)[0],n[1]):t(n)}catch(t){var o=e.return;throw void 0!==o&&r(o.call(e)),t}}},function(e,t,n){var r=n(87),i=Math.pow,o=i(2,-52),a=i(2,-23),s=i(2,127)*(2-a),c=i(2,-126);e.exports=Math.fround||function(e){var t,n,i=Math.abs(e),u=r(e);return i<c?u*(i/c/a+1/o-1/o)*c*a:(n=(t=(1+a/o)*i)-(t-i))>s||n!=n?u*(1/0):u*n}},function(e,t){e.exports=Math.log1p||function(e){return(e=+e)>-1e-8&&e<1e-8?e-e*e/2:Math.log(1+e)}},function(e,t,n){var r=n(4),i=Math.floor;e.exports=function(e){return!r(e)&&isFinite(e)&&i(e)===e}},function(e,t,n){var r=n(19);e.exports=function(e,t){if("number"!=typeof e&&"Number"!=r(e))throw TypeError(t);return+e}},function(e,t,n){var r=n(2).parseFloat,i=n(47).trim;e.exports=1/r(n(90)+"-0")!=-1/0?function(e){var t=i(String(e),3),n=r(t);return 0===n&&"-"==t.charAt(0)?-0:n}:r},function(e,t,n){var r=n(2).parseInt,i=n(47).trim,o=n(90),a=/^[-+]?0[xX]/;e.exports=8!==r(o+"08")||22!==r(o+"0x16")?function(e,t){var n=i(String(e),3);return r(n,t>>>0||(a.test(n)?16:10))}:r},function(e,t){e.exports=function(e,t,n){var r=void 0===n;switch(t.length){case 0:return r?e():e.call(n);case 1:return r?e(t[0]):e.call(n,t[0]);case 2:return r?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)}},function(e,t,n){"use strict";var r=n(10),i=n(4),o=n(126),a=[].slice,s={};e.exports=Function.bind||function(e){var t=r(this),n=a.call(arguments,1),c=function(){var r=n.concat(a.call(arguments));return this instanceof c?function(e,t,n){if(!(t in s)){for(var r=[],i=0;i<t;i++)r[i]="a["+i+"]";s[t]=Function("F,a","return new F("+r.join(",")+")")}return s[t](e,n)}(t,r.length,r):o(t,r,e)};return i(t.prototype)&&(c.prototype=t.prototype),c}},function(e,t,n){"use strict";var r=n(39),i=n(64),o=n(51),a=n(9),s=n(52),c=Object.assign;e.exports=!c||n(3)(function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach(function(e){t[e]=e}),7!=c({},e)[n]||Object.keys(c({},t)).join("")!=r})?function(e,t){for(var n=a(e),c=arguments.length,u=1,f=i.f,d=o.f;c>u;)for(var l,p=s(arguments[u++]),h=f?r(p).concat(f(p)):r(p),v=h.length,m=0;v>m;)d.call(p,l=h[m++])&&(n[l]=p[l]);return n}:c},function(e,t,n){var r=n(17),i=n(36).f,o={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return a&&"[object Window]"==o.call(e)?function(e){try{return i(e)}catch(e){return a.slice()}}(e):i(r(e))}},function(e,t,n){var r=n(7),i=n(1),o=n(39);e.exports=n(8)?Object.defineProperties:function(e,t){i(e);for(var n,a=o(t),s=a.length,c=0;s>c;)r.f(e,n=a[c++],t[n]);return e}},function(e,t,n){var r=n(14),i=n(17),o=n(65)(!1),a=n(94)("IE_PROTO");e.exports=function(e,t){var n,s=i(e),c=0,u=[];for(n in s)n!=a&&r(s,n)&&u.push(n);for(;t.length>c;)r(s,n=t[c++])&&(~o(u,n)||u.push(n));return u}},function(e,t,n){t.f=n(5)},function(e,t,n){e.exports=!n(8)&&!n(3)(function(){return 7!=Object.defineProperty(n(96)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}var a=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(a,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});var s=n(69),c=n(68),u=n(44),f=n(98),d=n(49),l=n(44),p=n(43),h=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this))).constraints={audio:{},video:{}},e.deviceTSMap={"@default":1},e.deviceTimeTick=0,e}var n,r,h;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,s),n=t,(r=[{key:"changeDevice",value:function(e,t){var n=u.getElementFromArray(this.deviceInfo,"deviceId",t);if(n){switch(this.deviceTimeTick+=1,this.deviceTSMap[t]=this.deviceTimeTick,e){case"audio":this.audioDevice=n;break;case"video":this.videoDevice=n}d.log.log("device-update",this.deviceInfo),this.emit("device-update"),this.getUserMedia().then().catch(function(e){throw e})}}},{key:"getLocalStream",value:function(e){return a(this,void 0,void 0,regeneratorRuntime.mark(function t(){var n,r,i,o,a;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return this.config=e,this.constraints=l.transferRecordOptionToMediaConstraints(e),t.next=3,this.getUserMedia(!0);case 3:if(n=t.sent){t.next=6;break}throw p.UNEXPECTED_ERROR("can not get mediaStream from media device");case 6:return this.stream=new c.Stream(n),this.stream.setEnable(e.audio.enabled,e.video.enabled),this.stream.setRecordConfig(this.config),t.next=11,this.updateDeivceInfo();case 11:if(!this.stream.audioTrack||!this.deviceInfo){t.next=14;break}r=this.stream.audioTrack.getSettings().deviceId,i=u.getElementFromArray(this.deviceInfo,"deviceId",r),this.audioDevice=i||{deviceId:"@default"};case 14:return this.stream.videoTrack&&this.deviceInfo&&(o=this.stream.videoTrack.getSettings().deviceId,a=u.getElementFromArray(this.deviceInfo,"deviceId",o),this.videoDevice=a||{deviceId:"@default"}),t.abrupt("return",(!f.browserReport.ondevicechange&&this.deviceInterval?clearInterval(this.deviceInterval):this.deviceInterval=setInterval(this.handleDevice.bind(this),1e3),f.browserReport.ondevicechange&&(navigator.mediaDevices.ondevicechange=this.handleDevice.bind(this)),this.volume&&this.stream.setMicVolume(this.volume),this.stream));case 16:case"end":return t.stop()}},t,this)}))}},{key:"setVolume",value:function(e){this.volume=e,this.stream&&!this.stream.isDestroyed&&this.stream.setMicVolume(e)}},{key:"getUserMedia",value:function(e){return a(this,void 0,void 0,regeneratorRuntime.mark(function t(){var n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(this.audioDevice&&this.constraints.audio&&(this.constraints.audio.deviceId="@default"===this.audioDevice.deviceId?void 0:this.audioDevice.deviceId,this.constraints.audio.groupId="@default"===this.audioDevice.deviceId?void 0:this.audioDevice.groupId),this.videoDevice&&this.constraints.video&&(this.constraints.video.deviceId="@default"===this.videoDevice.deviceId?void 0:this.videoDevice.deviceId,this.constraints.video.groupId="@default"===this.videoDevice.deviceId?void 0:this.videoDevice.groupId),!(e||this.stream&&!this.stream.isDestroyed)){t.next=10;break}return d.log.debug("request to get user media",this.constraints),t.next=4,navigator.mediaDevices.getUserMedia(this.constraints);case 4:if(n=t.sent,t.t0=this.stream&&!e,!t.t0){t.next=9;break}return t.next=9,this.stream.setMediaStream(n);case 9:return t.abrupt("return",n);case 10:case"end":return t.stop()}},t,this)}))}},{key:"updateDeivceInfo",value:function(){return a(this,void 0,void 0,regeneratorRuntime.mark(function e(){var t,n,r=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.deviceTimeTick+=1,e.next=3,navigator.mediaDevices.enumerateDevices();case 3:return this.deviceInfo=e.sent,t=this.deviceInfo.map(function(e){return e.deviceId}),n=0,e.abrupt("return",(Object.keys(this.deviceTSMap).forEach(function(e){-1===t.indexOf(e)&&"@default"!==e&&(delete r.deviceTSMap[e],r.audioDevice&&r.audioDevice.deviceId===e&&(r.audioDevice=void 0),r.videoDevice&&r.videoDevice.deviceId===e&&(r.videoDevice=void 0),n=-1)}),this.deviceInfo.forEach(function(e){r.deviceTSMap[e.deviceId]||(r.deviceTSMap[e.deviceId]=r.deviceTimeTick,n=1)}),n));case 7:case"end":return e.stop()}},e,this)}))}},{key:"handleDevice",value:function(){return a(this,void 0,void 0,regeneratorRuntime.mark(function e(){var t,n,r=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.deviceInfo&&this.stream){e.next=2;break}return e.abrupt("return");case 2:return t=!1,e.next=5,this.updateDeivceInfo();case 5:if(n=e.sent,this.deviceInfo.forEach(function(e){"videoinput"===e.kind&&r.stream.enableVideo&&(r.videoDevice&&r.deviceTSMap[r.videoDevice.deviceId]?r.deviceTSMap[e.deviceId]>r.deviceTSMap[r.videoDevice.deviceId]&&(r.videoDevice=e,t=!0):(r.videoDevice=e,t=!0)),"audioinput"===e.kind&&r.stream.enableAudio&&(r.audioDevice&&r.deviceTSMap[r.audioDevice.deviceId]?r.deviceTSMap[e.deviceId]>r.deviceTSMap[r.audioDevice.deviceId]&&(r.audioDevice=e,t=!0):(r.audioDevice=e,t=!0))}),0!==n&&this.emit("device-update"),e.t0=t,!e.t0){e.next=12;break}return e.next=12,this.getUserMedia();case 12:case"end":return e.stop()}},e,this)}))}}])&&i(n.prototype,r),h&&i(n,h),t}();t.DeviceManager=h,t.deviceManager=new h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=navigator.userAgent.toLowerCase().indexOf("firefox")>-1;function i(e,t,n){return function(e,t,n,r,i){for(var o=-1!==n?n:e.length,a=t;a<o;++a)if(0===e[a].indexOf(r)&&(!i||-1!==e[a].toLowerCase().indexOf(i.toLowerCase())))return a;return null}(e,0,-1,t,n)}function o(e){var t=new RegExp("a=rtpmap:(\\d+) \\w+\\/\\d+"),n=e.match(t);return n&&2===n.length?n[1]:null}t.BandwidthHandler={setApplicationSpecificBandwidth:function(e,t,n){return function(e,t,n){return t?void 0!==r&&r?e:(n&&(t.screen?t.screen<300&&console.warn("It seems that you are using wrong bandwidth value for screen. Screen sharing is expected to fail."):console.warn("It seems that you are not using bandwidth for screen. Screen sharing is expected to fail.")),t.screen&&n&&(e=(e=e.replace(/b=AS([^\r\n]+\r\n)/g,"")).replace(/a=mid:video\r\n/g,"a=mid:video\r\nb=AS:"+t.screen+"\r\n")),(t.audio||t.video||t.data)&&(e=e.replace(/b=AS([^\r\n]+\r\n)/g,"")),t.audio&&(e=e.replace(/a=mid:audio\r\n/g,"a=mid:audio\r\nb=AS:"+t.audio+"\r\n")),t.video&&(e=e.replace(/a=mid:video\r\n/g,"a=mid:video\r\nb=AS:"+(n?t.screen:t.video)+"\r\n")),e):e}(e,t,n)},setVideoBitrates:function(e,t){return function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.min,a=n.max,s=e.split("\r\n"),c=i(s,"a=rtpmap","VP8/90000");if(c&&(t=o(s[c])),!t)return e;var u,f=i(s,"a=rtpmap","rtx/90000");if(f&&(u=o(s[f])),!f||!u)return e;var d=i(s,"a=fmtp:"+u.toString());if(null!==d){var l="\r\n";l+="a=fmtp:"+t+" x-google-min-bitrate="+(r||"228")+"; x-google-max-bitrate="+(a||"228"),s[d]=s[d].concat(l),e=s.join("\r\n")}return e}(e,t)},setOpusAttributes:function(e,t){return function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.split("\r\n"),a=i(r,"a=rtpmap","opus/48000");if(a&&(t=o(r[a])),!t)return e;var s=i(r,"a=fmtp:"+t.toString());if(null===s)return e;var c="";return c+="; stereo="+(void 0!==n.stereo?n.stereo:"1"),c+="; sprop-stereo="+(void 0!==n["sprop-stereo"]?n["sprop-stereo"]:"1"),void 0!==n.maxaveragebitrate&&(c+="; maxaveragebitrate="+(n.maxaveragebitrate||1048576)),void 0!==n.maxplaybackrate&&(c+="; maxplaybackrate="+(n.maxplaybackrate||1048576)),void 0!==n.cbr&&(c+="; cbr="+(void 0!==n.cbr?n.cbr:"1")),void 0!==n.useinbandfec&&(c+="; useinbandfec="+n.useinbandfec),void 0!==n.usedtx&&(c+="; usedtx="+n.usedtx),void 0!==n.maxptime&&(c+="\r\na=maxptime:"+n.maxptime),r[s]=r[s].concat(c),r.join("\r\n")}(e,t)}}},function(e,t,n){(function(n){var r;t=e.exports=H,r="object"==typeof n&&n.env&&n.env.NODE_DEBUG&&/\bsemver\b/i.test(n.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},t.SEMVER_SPEC_VERSION="2.0.0";var i=256,o=Number.MAX_SAFE_INTEGER||9007199254740991,a=t.re=[],s=t.src=[],c=0,u=c++;s[u]="0|[1-9]\\d*";var f=c++;s[f]="[0-9]+";var d=c++;s[d]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var l=c++;s[l]="("+s[u]+")\\.("+s[u]+")\\.("+s[u]+")";var p=c++;s[p]="("+s[f]+")\\.("+s[f]+")\\.("+s[f]+")";var h=c++;s[h]="(?:"+s[u]+"|"+s[d]+")";var v=c++;s[v]="(?:"+s[f]+"|"+s[d]+")";var m=c++;s[m]="(?:-("+s[h]+"(?:\\."+s[h]+")*))";var g=c++;s[g]="(?:-?("+s[v]+"(?:\\."+s[v]+")*))";var y=c++;s[y]="[0-9A-Za-z-]+";var b=c++;s[b]="(?:\\+("+s[y]+"(?:\\."+s[y]+")*))";var S=c++,w="v?"+s[l]+s[m]+"?"+s[b]+"?";s[S]="^"+w+"$";var T="[v=\\s]*"+s[p]+s[g]+"?"+s[b]+"?",R=c++;s[R]="^"+T+"$";var E=c++;s[E]="((?:<|>)?=?)";var C=c++;s[C]=s[f]+"|x|X|\\*";var _=c++;s[_]=s[u]+"|x|X|\\*";var k=c++;s[k]="[v=\\s]*("+s[_]+")(?:\\.("+s[_]+")(?:\\.("+s[_]+")(?:"+s[m]+")?"+s[b]+"?)?)?";var P=c++;s[P]="[v=\\s]*("+s[C]+")(?:\\.("+s[C]+")(?:\\.("+s[C]+")(?:"+s[g]+")?"+s[b]+"?)?)?";var x=c++;s[x]="^"+s[E]+"\\s*"+s[k]+"$";var O=c++;s[O]="^"+s[E]+"\\s*"+s[P]+"$";var I=c++;s[I]="(?:^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])";var M=c++;s[M]="(?:~>?)";var j=c++;s[j]="(\\s*)"+s[M]+"\\s+",a[j]=new RegExp(s[j],"g");var A=c++;s[A]="^"+s[M]+s[k]+"$";var L=c++;s[L]="^"+s[M]+s[P]+"$";var D=c++;s[D]="(?:\\^)";var N=c++;s[N]="(\\s*)"+s[D]+"\\s+",a[N]=new RegExp(s[N],"g");var F=c++;s[F]="^"+s[D]+s[k]+"$";var U=c++;s[U]="^"+s[D]+s[P]+"$";var B=c++;s[B]="^"+s[E]+"\\s*("+T+")$|^$";var W=c++;s[W]="^"+s[E]+"\\s*("+w+")$|^$";var G=c++;s[G]="(\\s*)"+s[E]+"\\s*("+T+"|"+s[k]+")",a[G]=new RegExp(s[G],"g");var V=c++;s[V]="^\\s*("+s[k]+")\\s+-\\s+("+s[k]+")\\s*$";var z=c++;s[z]="^\\s*("+s[P]+")\\s+-\\s+("+s[P]+")\\s*$";var $=c++;s[$]="(<|>)?=?\\s*\\*";for(var J=0;J<c;J++)r(J,s[J]),a[J]||(a[J]=new RegExp(s[J]));function X(e,t){if(e instanceof H)return e;if("string"!=typeof e)return null;if(e.length>i)return null;if(!(t?a[R]:a[S]).test(e))return null;try{return new H(e,t)}catch(e){return null}}function H(e,t){if(e instanceof H){if(e.loose===t)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>i)throw new TypeError("version is longer than "+i+" characters");if(!(this instanceof H))return new H(e,t);r("SemVer",e,t),this.loose=t;var n=e.trim().match(t?a[R]:a[S]);if(!n)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>o||this.major<0)throw new TypeError("Invalid major version");if(this.minor>o||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>o||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t<o)return t}return e}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}t.parse=X,t.valid=function(e,t){var n=X(e,t);return n?n.version:null},t.clean=function(e,t){var n=X(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null},t.SemVer=H,H.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},H.prototype.toString=function(){return this.version},H.prototype.compare=function(e){return r("SemVer.compare",this.version,this.loose,e),e instanceof H||(e=new H(e,this.loose)),this.compareMain(e)||this.comparePre(e)},H.prototype.compareMain=function(e){return e instanceof H||(e=new H(e,this.loose)),K(this.major,e.major)||K(this.minor,e.minor)||K(this.patch,e.patch)},H.prototype.comparePre=function(e){if(e instanceof H||(e=new H(e,this.loose)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;var t=0;do{var n=this.prerelease[t],i=e.prerelease[t];if(r("prerelease compare",t,n,i),void 0===n&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===n)return-1;if(n!==i)return K(n,i)}while(++t)},H.prototype.inc=function(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t),this.inc("pre",t);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{for(var n=this.prerelease.length;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);-1===n&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this},t.inc=function(e,t,n,r){"string"==typeof n&&(r=n,n=void 0);try{return new H(e,n).inc(t,r).version}catch(e){return null}},t.diff=function(e,t){if(ee(e,t))return null;var n=X(e),r=X(t);if(n.prerelease.length||r.prerelease.length){for(var i in n)if(("major"===i||"minor"===i||"patch"===i)&&n[i]!==r[i])return"pre"+i;return"prerelease"}for(var i in n)if(("major"===i||"minor"===i||"patch"===i)&&n[i]!==r[i])return i},t.compareIdentifiers=K;var q=/^[0-9]+$/;function K(e,t){var n=q.test(e),r=q.test(t);return n&&r&&(e=+e,t=+t),n&&!r?-1:r&&!n?1:e<t?-1:e>t?1:0}function Y(e,t,n){return new H(e,n).compare(new H(t,n))}function Z(e,t,n){return Y(e,t,n)>0}function Q(e,t,n){return Y(e,t,n)<0}function ee(e,t,n){return 0===Y(e,t,n)}function te(e,t,n){return 0!==Y(e,t,n)}function ne(e,t,n){return Y(e,t,n)>=0}function re(e,t,n){return Y(e,t,n)<=0}function ie(e,t,n,r){var i;switch(t){case"===":"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),i=e===n;break;case"!==":"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),i=e!==n;break;case"":case"=":case"==":i=ee(e,n,r);break;case"!=":i=te(e,n,r);break;case">":i=Z(e,n,r);break;case">=":i=ne(e,n,r);break;case"<":i=Q(e,n,r);break;case"<=":i=re(e,n,r);break;default:throw new TypeError("Invalid operator: "+t)}return i}function oe(e,t){if(e instanceof oe){if(e.loose===t)return e;e=e.value}if(!(this instanceof oe))return new oe(e,t);r("comparator",e,t),this.loose=t,this.parse(e),this.semver===ae?this.value="":this.value=this.operator+this.semver.version,r("comp",this)}t.rcompareIdentifiers=function(e,t){return K(t,e)},t.major=function(e,t){return new H(e,t).major},t.minor=function(e,t){return new H(e,t).minor},t.patch=function(e,t){return new H(e,t).patch},t.compare=Y,t.compareLoose=function(e,t){return Y(e,t,!0)},t.rcompare=function(e,t,n){return Y(t,e,n)},t.sort=function(e,n){return e.sort(function(e,r){return t.compare(e,r,n)})},t.rsort=function(e,n){return e.sort(function(e,r){return t.rcompare(e,r,n)})},t.gt=Z,t.lt=Q,t.eq=ee,t.neq=te,t.gte=ne,t.lte=re,t.cmp=ie,t.Comparator=oe;var ae={};function se(e,t){if(e instanceof se)return e.loose===t?e:new se(e.raw,t);if(e instanceof oe)return new se(e.value,t);if(!(this instanceof se))return new se(e,t);if(this.loose=t,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(function(e){return this.parseRange(e.trim())},this).filter(function(e){return e.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);this.format()}function ce(e){return!e||"x"===e.toLowerCase()||"*"===e}function ue(e,t,n,r,i,o,a,s,c,u,f,d,l){return((t=ce(n)?"":ce(r)?">="+n+".0.0":ce(i)?">="+n+"."+r+".0":">="+t)+" "+(s=ce(c)?"":ce(u)?"<"+(+c+1)+".0.0":ce(f)?"<"+c+"."+(+u+1)+".0":d?"<="+c+"."+u+"."+f+"-"+d:"<="+s)).trim()}function fe(e,t){for(var n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length){for(n=0;n<e.length;n++)if(r(e[n].semver),e[n].semver!==ae&&e[n].semver.prerelease.length>0){var i=e[n].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}function de(e,t,n){try{t=new se(t,n)}catch(e){return!1}return t.test(e)}function le(e,t,n,r){var i,o,a,s,c;switch(e=new H(e,r),t=new se(t,r),n){case">":i=Z,o=re,a=Q,s=">",c=">=";break;case"<":i=Q,o=ne,a=Z,s="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(de(e,t,r))return!1;for(var u=0;u<t.set.length;++u){var f=null,d=null;if(t.set[u].forEach(function(e){e.semver===ae&&(e=new oe(">=0.0.0")),f=f||e,d=d||e,i(e.semver,f.semver,r)?f=e:a(e.semver,d.semver,r)&&(d=e)}),f.operator===s||f.operator===c)return!1;if((!d.operator||d.operator===s)&&o(e,d.semver))return!1;if(d.operator===c&&a(e,d.semver))return!1}return!0}oe.prototype.parse=function(e){var t=this.loose?a[B]:a[W],n=e.match(t);if(!n)throw new TypeError("Invalid comparator: "+e);this.operator=n[1],"="===this.operator&&(this.operator=""),n[2]?this.semver=new H(n[2],this.loose):this.semver=ae},oe.prototype.toString=function(){return this.value},oe.prototype.test=function(e){return r("Comparator.test",e,this.loose),this.semver===ae||("string"==typeof e&&(e=new H(e,this.loose)),ie(e,this.operator,this.semver,this.loose))},oe.prototype.intersects=function(e,t){if(!(e instanceof oe))throw new TypeError("a Comparator is required");var n;if(""===this.operator)return n=new se(e.value,t),de(this.value,n,t);if(""===e.operator)return n=new se(this.value,t),de(e.semver,n,t);var r=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),i=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),o=this.semver.version===e.semver.version,a=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),s=ie(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),c=ie(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return r||i||o&&a||s||c},t.Range=se,se.prototype.format=function(){return this.range=this.set.map(function(e){return e.join(" ").trim()}).join("||").trim(),this.range},se.prototype.toString=function(){return this.range},se.prototype.parseRange=function(e){var t=this.loose;e=e.trim(),r("range",e,t);var n=t?a[z]:a[V];e=e.replace(n,ue),r("hyphen replace",e),e=e.replace(a[G],"$1$2$3"),r("comparator trim",e,a[G]),e=(e=(e=e.replace(a[j],"$1~")).replace(a[N],"$1^")).split(/\s+/).join(" ");var i=t?a[B]:a[W],o=e.split(" ").map(function(e){return function(e,t){return r("comp",e),e=function(e,t){return e.trim().split(/\s+/).map(function(e){return function(e,t){r("caret",e,t);var n=t?a[U]:a[F];return e.replace(n,function(t,n,i,o,a){var s;return r("caret",e,t,n,i,o,a),ce(n)?s="":ce(i)?s=">="+n+".0.0 <"+(+n+1)+".0.0":ce(o)?s="0"===n?">="+n+"."+i+".0 <"+n+"."+(+i+1)+".0":">="+n+"."+i+".0 <"+(+n+1)+".0.0":a?(r("replaceCaret pr",a),"-"!==a.charAt(0)&&(a="-"+a),s="0"===n?"0"===i?">="+n+"."+i+"."+o+a+" <"+n+"."+i+"."+(+o+1):">="+n+"."+i+"."+o+a+" <"+n+"."+(+i+1)+".0":">="+n+"."+i+"."+o+a+" <"+(+n+1)+".0.0"):(r("no pr"),s="0"===n?"0"===i?">="+n+"."+i+"."+o+" <"+n+"."+i+"."+(+o+1):">="+n+"."+i+"."+o+" <"+n+"."+(+i+1)+".0":">="+n+"."+i+"."+o+" <"+(+n+1)+".0.0"),r("caret return",s),s})}(e,t)}).join(" ")}(e,t),r("caret",e),e=function(e,t){return e.trim().split(/\s+/).map(function(e){return function(e,t){var n=t?a[L]:a[A];return e.replace(n,function(t,n,i,o,a){var s;return r("tilde",e,t,n,i,o,a),ce(n)?s="":ce(i)?s=">="+n+".0.0 <"+(+n+1)+".0.0":ce(o)?s=">="+n+"."+i+".0 <"+n+"."+(+i+1)+".0":a?(r("replaceTilde pr",a),"-"!==a.charAt(0)&&(a="-"+a),s=">="+n+"."+i+"."+o+a+" <"+n+"."+(+i+1)+".0"):s=">="+n+"."+i+"."+o+" <"+n+"."+(+i+1)+".0",r("tilde return",s),s})}(e,t)}).join(" ")}(e,t),r("tildes",e),e=function(e,t){return r("replaceXRanges",e,t),e.split(/\s+/).map(function(e){return function(e,t){e=e.trim();var n=t?a[O]:a[x];return e.replace(n,function(t,n,i,o,a,s){r("xRange",e,t,n,i,o,a,s);var c=ce(i),u=c||ce(o),f=u||ce(a),d=f;return"="===n&&d&&(n=""),c?t=">"===n||"<"===n?"<0.0.0":"*":n&&d?(u&&(o=0),f&&(a=0),">"===n?(n=">=",u?(i=+i+1,o=0,a=0):f&&(o=+o+1,a=0)):"<="===n&&(n="<",u?i=+i+1:o=+o+1),t=n+i+"."+o+"."+a):u?t=">="+i+".0.0 <"+(+i+1)+".0.0":f&&(t=">="+i+"."+o+".0 <"+i+"."+(+o+1)+".0"),r("xRange return",t),t})}(e,t)}).join(" ")}(e,t),r("xrange",e),e=function(e,t){return r("replaceStars",e,t),e.trim().replace(a[$],"")}(e,t),r("stars",e),e}(e,t)}).join(" ").split(/\s+/);return this.loose&&(o=o.filter(function(e){return!!e.match(i)})),o=o.map(function(e){return new oe(e,t)})},se.prototype.intersects=function(e,t){if(!(e instanceof se))throw new TypeError("a Range is required");return this.set.some(function(n){return n.every(function(n){return e.set.some(function(e){return e.every(function(e){return n.intersects(e,t)})})})})},t.toComparators=function(e,t){return new se(e,t).set.map(function(e){return e.map(function(e){return e.value}).join(" ").trim().split(" ")})},se.prototype.test=function(e){if(!e)return!1;"string"==typeof e&&(e=new H(e,this.loose));for(var t=0;t<this.set.length;t++)if(fe(this.set[t],e))return!0;return!1},t.satisfies=de,t.maxSatisfying=function(e,t,n){var r=null,i=null;try{var o=new se(t,n)}catch(e){return null}return e.forEach(function(e){o.test(e)&&(r&&-1!==i.compare(e)||(i=new H(r=e,n)))}),r},t.minSatisfying=function(e,t,n){var r=null,i=null;try{var o=new se(t,n)}catch(e){return null}return e.forEach(function(e){o.test(e)&&(r&&1!==i.compare(e)||(i=new H(r=e,n)))}),r},t.validRange=function(e,t){try{return new se(e,t).range||"*"}catch(e){return null}},t.ltr=function(e,t,n){return le(e,t,"<",n)},t.gtr=function(e,t,n){return le(e,t,">",n)},t.outside=le,t.prerelease=function(e,t){var n=X(e,t);return n&&n.prerelease.length?n.prerelease:null},t.intersects=function(e,t,n){return e=new se(e,n),t=new se(t,n),e.intersects(t)},t.coerce=function(e){if(e instanceof H)return e;if("string"!=typeof e)return null;var t=e.match(a[I]);return null==t?null:X((t[1]||"0")+"."+(t[2]||"0")+"."+(t[3]||"0"))}}).call(this,n(97))},function(e,t){t.endianness=function(){return"LE"},t.hostname=function(){return"undefined"!=typeof location?location.hostname:""},t.loadavg=function(){return[]},t.uptime=function(){return 0},t.freemem=function(){return Number.MAX_VALUE},t.totalmem=function(){return Number.MAX_VALUE},t.cpus=function(){return[]},t.type=function(){return"Browser"},t.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},t.networkInterfaces=t.getNetworkInterfaces=function(){return{}},t.arch=function(){return"javascript"},t.platform=function(){return"browser"},t.tmpdir=t.tmpDir=function(){return"/tmp"},t.EOL="\n",t.homedir=function(){return"/"}},function(e,t,n){(function(t){function r(e){var t=a([["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/],["Search Bot",/(nuhk)|(Googlebot)|(Yammybot)|(Openbot)|(Slurp)|(MSNBot)|(Ask Jeeves\/Teoma)|(ia_archiver)/]]).filter(function(t){return t.rule&&t.rule.test(e)})[0];return t?t.name:null}function i(){return"undefined"==typeof navigator&&void 0!==t?{name:"node",version:t.version.slice(1),os:n(137).type().toLowerCase()}:null}function o(e){var t=a([["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["vivaldi",/Vivaldi\/([0-9\.]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)$/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FBAV\/([0-9\.]+)/],["instagram",/Instagram\ ([0-9\.]+)/]]);if(!e)return null;var n=t.map(function(t){var n=t.rule.exec(e),r=n&&n[1].split(/[._]/).slice(0,3);return r&&r.length<3&&(r=r.concat(1==r.length?[0,0]:[0])),n&&{name:t.name,version:r.join(".")}}).filter(Boolean)[0]||null;return n&&(n.os=r(e)),/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/i.test(e)&&((n=n||{}).bot=!0),n}function a(e){return e.map(function(e){return{name:e[0],rule:e[1]}})}e.exports={detect:function(){var e=i();return e||("undefined"!=typeof navigator?o(navigator.userAgent):null)},detectOS:r,getNodeVersion:i,parseUserAgent:o}}).call(this,n(97))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=window.AudioContext||window.webkitAudioContext;t.audioContext=new r},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}Object.defineProperty(t,"__esModule",{value:!0});var a=n(69),s=n(43),c=n(49),u=["ping","auth-res","pub-res","unpub-res","webrtc-answer","webrtc-candidate","on-player-in","on-player-out","on-add-stream","on-remove-stream","disconnect","mute-stream"],f=function(e){function t(e,n,r){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(i=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this))).onWsOpen=function(){i.emit("ws:onopen"),c.log.log("signaling: websocket open"),i.wsOpen=!0;var e={token:i.accessToken,playerdata:i.playerData,reconntoken:i.reconnectToken};i.sendWsMsg("auth",e)},i.onWsMsg=function(e){var t=e.data;i.emit("ws:onmessage",t);var n=t.indexOf("=");if(!(n>0&&n<t.length-1))throw s.UNEXPECTED_ERROR("signaling model can not parse message: ".concat(t));var r=t.substring(0,n),o=JSON.parse(t.substring(n+1));i.receiveWsMsg(r,o)},i.onWsError=function(e){c.log.warning("signaling: websocket error",e),i.emit("ws:onerror"),i.disconnect()},i.onWsClose=function(e){c.log.warning("signaling: websocket close",e),i.emit("ws:onclose"),i.disconnect()},i.sendWsMsg=function(e,t){var n=JSON.stringify(t);i.ws.send("".concat(e,"=").concat(n)),i.emit("send",e,t)},i.disconnect=function(){i.reconnecting||(i.wsOpen=!1,i.reconnecting=!0,i.emit("ws-disconnect"))},i.reconnect=function(e){e&&(i.reconnectToken=e),c.log.debug("signaling: websocket reconnecting"),i.ws.close(),i.initWs(),setTimeout(function(){i.reconnecting=!1,i.wsOpen||i.disconnect()},3e3)},i.handlePing=function(){i.sendWsMsg("pong",{}),i.reconnectTimeoutID&&clearTimeout(i.reconnectTimeoutID),i.reconnectTimeoutID=setTimeout(i.disconnect,6e3)},i.receiveWsMsg=function(e,t){switch(i.emit("receive",e,t),e){case"ping":i.handlePing();break;case"auth-res":case"pub-res":case"unpub-res":case"webrtc-candidate":case"on-player-in":case"on-player-out":case"on-add-stream":case"on-remove-stream":case"disconnect":case"mute-stream":i.emit(e,t);break;case"webrtc-answer":i.emit(e,t),i.emit("".concat(e,"-streamid-").concat(t.streamid,"-connid-").concat(t.connid),t);case"webrtc-icestate":i.emit(e,t),t.connid?i.emit("".concat(e,"-connid-").concat(t.connid),t):i.emit("".concat(e,"-stream-").concat(t.streamid),t);break;case"sub-res":case"unsub-res":i.emit(e,t),i.emit("".concat(e,"-").concat(t.streamid),t);break;case"control-res":i.emit(e,t),i.emit("".concat(e,"-").concat(t.command,"-").concat(t.playerid),t)}},i.url=e,i.accessToken=n,i.playerData=r,i.wsOpen=!1,i.reconnecting=!1,i}var n,r,f;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,a),n=t,(r=[{key:"initWs",value:function(){try{this.ws=new WebSocket(this.url)}catch(e){throw s.UNEXPECTED_ERROR("init signaling websocket faild!\nError: ".concat(e))}this.ws.onopen=this.onWsOpen,this.ws.onclose=this.onWsClose,this.ws.onerror=this.onWsError,this.ws.onmessage=this.onWsMsg}},{key:"release",value:function(){var e=this;this.ws.close(),u.forEach(function(t){return e.removeAllListeners(t)})}}])&&i(n.prototype,r),f&&i(n,f),t}();t.SignalingWS=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.transferSignalingUserToUser=function(e){return{userId:e.playerid,published:!1}},t.transferRecordOptionToMediaConstraints=function(e){return e?{audio:!1!==e.audio.enabled&&{sampleRate:e.audio.sampleRate,sampleSize:e.audio.sampleSize,channelCount:e.audio.channelCount,volume:2},video:!1!==e.video.enabled&&{frameRate:e.video.frameRate,height:e.video.height,width:e.video.width}}:{audio:{},video:{}}}},function(e,t,n){"use strict";var r=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(a,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});var i=n(44),o=n(49),a=n(43);t.releasePC=function(e){e&&(e.close(),e=null)},t.checkPcConnect=function(e){return!!e&&"closed"!==e.signalingState&&"stable"!==e.signalingState&&"failed"!==e.iceConnectionState&&"closed"!==e.iceConnectionState},t.createP2PConnection=function(e,t,n){return r(this,void 0,void 0,regeneratorRuntime.mark(function r(){var s,c,u,f,d,l;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return s=n.connid,c=n.stream,u=!!e.addTransceiver,c.bindWithPeerConnection(e,s),u&&(f=new MediaStream,c.enableAudio&&e.addTransceiver("audio",{direction:s?"recvonly":"sendonly",sendEncodings:s?void 0:c.getAudioEncodings(),streams:s?[f]:void 0}),c.enableVideo&&e.addTransceiver("video",{direction:s?"recvonly":"sendonly",sendEncodings:s?void 0:c.getVideoEncodings(),streams:s?[f]:void 0})),r.next=4,e.createOffer({offerToReceiveAudio:s&&!u?c.enableAudio:void 0,offerToReceiveVideo:s&&!u?c.enableVideo:void 0});case 4:return(d=r.sent).sdp=c.processSDP(d.sdp),o.log.log("".concat(n.connid?"subscribe:":"publish:"," create offer"),d,"userId ".concat(n.stream.userId)),r.next=9,e.setLocalDescription(d);case 9:return r.next=11,i.sendMsgWaitResponse(t,"webrtc-offer",{streamid:c.streamId,connid:s,sdp:e.localDescription.sdp},"webrtc-answer-streamid-".concat(c.streamId,"-connid-").concat(s||""));case 11:return r.t0=r.sent.sdp,l={type:"answer",sdp:r.t0},o.log.log("".concat(n.connid?"subscribe:":"publish:"," get answer"),l,"userId ".concat(n.stream.userId)),r.prev=14,r.next=17,e.setRemoteDescription(l);case 17:r.next=22;break;case 19:throw r.prev=19,r.t1=r.catch(14),a.UNSUPPORT_FMT(r.t1.message);case 22:return r.abrupt("return",d);case 23:case"end":return r.stop()}},r,this,[[14,19]])}))},t.defaultStatsReport={pctype:"send",bandwidth:0,videoPacketLossRate:0,audioPacketLossRate:0,videoBitrate:0,audioBitrate:0,videoBytes:0,audioBytes:0,videoPackets:0,videoPacketLoss:0,audioPackets:0,audioPacketLoss:0},t.getPCStats=function(e,n){return r(this,void 0,void 0,regeneratorRuntime.mark(function r(){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,new Promise(function(r,i){var o=window.getStats;e.getPeerStats=o,e.getPeerStats(void 0,function(e){var i=Object.assign({},t.defaultStatsReport);i.pctype=n,i.bandwidth=e.bandwidth.availableSendBandwidth,"send"===n?(i.videoBytes=e.video.bytesSent,i.audioBytes=e.audio.bytesSent):(i.videoBytes=e.video.bytesReceived,i.audioBytes=e.audio.bytesReceived),e.results.forEach(function(e){if("ssrc"===e.type&&"Channel-audio-1"===e.transportId){var t="audio"===e.mediaType,r=-1!==e.id.indexOf("_send"),o=e.packetsLost,a=e.packetsSent,s=e.packetsReceived;t&&r&&"send"===n?(i.audioPacketLoss=Number(o)||0,i.audioPackets=Number(a)||0):!t&&r&&"send"===n?(i.videoPacketLoss=Number(o)||0,i.videoPackets=Number(a)||0):t&&!r&&"recv"===n?(i.audioPacketLoss=Number(o)||0,i.audioPackets=Number(s)||0):t||r||"recv"!==n||(i.videoPacketLoss=Number(o)||0,i.videoPackets=Number(s)||0)}}),r(i)})});case 2:return r.abrupt("return",r.sent);case 3:case"end":return r.stop()}},r,this)}))},t.getRateStats=function(e,t){if(!t)return e;var n=Object.assign({},e),r=e.videoPackets-t.videoPackets,i=e.videoPacketLoss-t.videoPacketLoss;n.videoPacketLossRate=i/r;var o=e.audioPackets-t.audioPackets,a=e.audioPacketLoss-t.audioPacketLoss;return n.audioPacketLossRate=a/o,n.videoBitrate=8*(e.videoBytes-t.videoBytes),n.audioBitrate=8*(e.audioBytes-t.audioBytes),n}},function(e,t,n){var r,i,o;i=[t,e],void 0===(o="function"==typeof(r=function(e,t){"use strict";var n={timeout:5e3,jsonpCallback:"callback",jsonpCallbackFunction:null};function r(e){try{delete window[e]}catch(t){window[e]=void 0}}function i(e){var t=document.getElementById(e);t&&document.getElementsByTagName("head")[0].removeChild(t)}t.exports=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],o=e,a=t.timeout||n.timeout,s=t.jsonpCallback||n.jsonpCallback,c=void 0;return new Promise(function(n,u){var f=t.jsonpCallbackFunction||"jsonp_"+Date.now()+"_"+Math.ceil(1e5*Math.random()),d=s+"_"+f;window[f]=function(e){n({ok:!0,json:function(){return Promise.resolve(e)}}),c&&clearTimeout(c),i(d),r(f)},o+=-1===o.indexOf("?")?"?":"&";var l=document.createElement("script");l.setAttribute("src",""+o+s+"="+f),t.charset&&l.setAttribute("charset",t.charset),l.id=d,document.getElementsByTagName("head")[0].appendChild(l),c=setTimeout(function(){u(new Error("JSONP request to "+e+" timed out")),r(f),i(d),window[f]=function(){r(f)}},a),l.onerror=function(){u(new Error("JSONP request to "+e+" failed")),r(f),i(d),c&&clearTimeout(c)}})}})?r.apply(t,i):r)||(e.exports=o)},function(e,t,n){"use strict";var r=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(a,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});var i=n(143);t.request=function(e){return r(this,void 0,void 0,regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i(e);case 2:return t.abrupt("return",t.sent.json());case 3:case"end":return t.stop()}},t,this)}))}},function(e,t,n){"use strict";var r=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(a,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});var i=n(44),o=n(43),a="https://rtc.qiniuapi.com";t.getAccessToken=function(e,t){return r(this,void 0,void 0,regeneratorRuntime.mark(function n(){var r,s,c,u;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return r=e.appId,s=e.roomName,c=e.userId,u="".concat(a,"/v3/apps/").concat(r,"/rooms/").concat(s,"/jsauth?user=").concat(c,"&token=").concat(t),n.prev=1,n.next=4,i.request(u);case 4:return n.abrupt("return",n.sent.accessToken);case 7:throw n.prev=7,n.t0=n.catch(1),o.AUTH_ENTER_ROOM_ERROR(n.t0);case 10:case"end":return n.stop()}},n,this,[[1,7]])}))}},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){(function(e,n){var r=200,i="Expected a function",o="__lodash_hash_undefined__",a=1,s=2,c=1/0,u=9007199254740991,f="[object Arguments]",d="[object Array]",l="[object Boolean]",p="[object Date]",h="[object Error]",v="[object Function]",m="[object GeneratorFunction]",g="[object Map]",y="[object Number]",b="[object Object]",S="[object RegExp]",w="[object Set]",T="[object String]",R="[object Symbol]",E="[object ArrayBuffer]",C="[object DataView]",_=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,k=/^\w*$/,P=/^\./,x=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,O=/\\(\\)?/g,I=/^\[object .+?Constructor\]$/,M=/^(?:0|[1-9]\d*)$/,j={};j["[object Float32Array]"]=j["[object Float64Array]"]=j["[object Int8Array]"]=j["[object Int16Array]"]=j["[object Int32Array]"]=j["[object Uint8Array]"]=j["[object Uint8ClampedArray]"]=j["[object Uint16Array]"]=j["[object Uint32Array]"]=!0,j[f]=j[d]=j[E]=j[l]=j[C]=j[p]=j[h]=j[v]=j[g]=j[y]=j[b]=j[S]=j[w]=j[T]=j["[object WeakMap]"]=!1;var A="object"==typeof e&&e&&e.Object===Object&&e,L="object"==typeof self&&self&&self.Object===Object&&self,D=A||L||Function("return this")(),N="object"==typeof t&&t&&!t.nodeType&&t,F=N&&"object"==typeof n&&n&&!n.nodeType&&n,U=F&&F.exports===N&&A.process,B=function(){try{return U&&U.binding("util")}catch(e){}}(),W=B&&B.isTypedArray;function G(e,t){return!!(e?e.length:0)&&function(e,t,n){if(t!=t)return function(e,t,n,r){var i=e.length,o=n+(r?1:-1);for(;r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}(e,$,n);var r=n-1,i=e.length;for(;++r<i;)if(e[r]===t)return r;return-1}(e,t,0)>-1}function V(e,t,n){for(var r=-1,i=e?e.length:0;++r<i;)if(n(t,e[r]))return!0;return!1}function z(e,t){for(var n=-1,r=e?e.length:0;++n<r;)if(t(e[n],n,e))return!0;return!1}function $(e){return e!=e}function J(e,t){return e.has(t)}function X(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function H(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function q(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var K,Y,Z,Q=Array.prototype,ee=Function.prototype,te=Object.prototype,ne=D["__core-js_shared__"],re=(K=/[^.]+$/.exec(ne&&ne.keys&&ne.keys.IE_PROTO||""))?"Symbol(src)_1."+K:"",ie=ee.toString,oe=te.hasOwnProperty,ae=te.toString,se=RegExp("^"+ie.call(oe).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ce=D.Symbol,ue=D.Uint8Array,fe=te.propertyIsEnumerable,de=Q.splice,le=(Y=Object.keys,Z=Object,function(e){return Y(Z(e))}),pe=ze(D,"DataView"),he=ze(D,"Map"),ve=ze(D,"Promise"),me=ze(D,"Set"),ge=ze(D,"WeakMap"),ye=ze(Object,"create"),be=Ze(pe),Se=Ze(he),we=Ze(ve),Te=Ze(me),Re=Ze(ge),Ee=ce?ce.prototype:void 0,Ce=Ee?Ee.valueOf:void 0,_e=Ee?Ee.toString:void 0;function ke(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Pe(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function xe(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Oe(e){var t=-1,n=e?e.length:0;for(this.__data__=new xe;++t<n;)this.add(e[t])}function Ie(e){this.__data__=new Pe(e)}function Me(e,t){var n=nt(e)||tt(e)?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],r=n.length,i=!!r;for(var o in e)!t&&!oe.call(e,o)||i&&("length"==o||Je(o,r))||n.push(o);return n}function je(e,t){for(var n=e.length;n--;)if(et(e[n][0],t))return n;return-1}function Ae(e,t){for(var n=0,r=(t=Xe(t,e)?[t]:Be(t)).length;null!=e&&n<r;)e=e[Ye(t[n++])];return n&&n==r?e:void 0}function Le(e,t){return null!=e&&t in Object(e)}function De(e,t,n,r,i){return e===t||(null==e||null==t||!at(e)&&!st(t)?e!=e&&t!=t:function(e,t,n,r,i,o){var c=nt(e),u=nt(t),v=d,m=d;c||(v=(v=$e(e))==f?b:v);u||(m=(m=$e(t))==f?b:m);var _=v==b&&!X(e),k=m==b&&!X(t),P=v==m;if(P&&!_)return o||(o=new Ie),c||ut(e)?Ge(e,t,n,r,i,o):function(e,t,n,r,i,o,c){switch(n){case C:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case E:return!(e.byteLength!=t.byteLength||!r(new ue(e),new ue(t)));case l:case p:case y:return et(+e,+t);case h:return e.name==t.name&&e.message==t.message;case S:case T:return e==t+"";case g:var u=H;case w:var f=o&s;if(u||(u=q),e.size!=t.size&&!f)return!1;var d=c.get(e);if(d)return d==t;o|=a,c.set(e,t);var v=Ge(u(e),u(t),r,i,o,c);return c.delete(e),v;case R:if(Ce)return Ce.call(e)==Ce.call(t)}return!1}(e,t,v,n,r,i,o);if(!(i&s)){var x=_&&oe.call(e,"__wrapped__"),O=k&&oe.call(t,"__wrapped__");if(x||O){var I=x?e.value():e,M=O?t.value():t;return o||(o=new Ie),n(I,M,r,i,o)}}if(!P)return!1;return o||(o=new Ie),function(e,t,n,r,i,o){var a=i&s,c=ft(e),u=c.length,f=ft(t).length;if(u!=f&&!a)return!1;for(var d=u;d--;){var l=c[d];if(!(a?l in t:oe.call(t,l)))return!1}var p=o.get(e);if(p&&o.get(t))return p==t;var h=!0;o.set(e,t),o.set(t,e);for(var v=a;++d<u;){l=c[d];var m=e[l],g=t[l];if(r)var y=a?r(g,m,l,t,e,o):r(m,g,l,e,t,o);if(!(void 0===y?m===g||n(m,g,r,i,o):y)){h=!1;break}v||(v="constructor"==l)}if(h&&!v){var b=e.constructor,S=t.constructor;b!=S&&"constructor"in e&&"constructor"in t&&!("function"==typeof b&&b instanceof b&&"function"==typeof S&&S instanceof S)&&(h=!1)}return o.delete(e),o.delete(t),h}(e,t,n,r,i,o)}(e,t,De,n,r,i))}function Ne(e){return!(!at(e)||re&&re in e)&&(it(e)||X(e)?se:I).test(Ze(e))}function Fe(e){return"function"==typeof e?e:null==e?dt:"object"==typeof e?nt(e)?function(e,t){if(Xe(e)&&He(t))return qe(Ye(e),t);return function(n){var r=function(e,t,n){var r=null==e?void 0:Ae(e,t);return void 0===r?n:r}(n,e);return void 0===r&&r===t?function(e,t){return null!=e&&function(e,t,n){var r,i=-1,o=(t=Xe(t,e)?[t]:Be(t)).length;for(;++i<o;){var a=Ye(t[i]);if(!(r=null!=e&&n(e,a)))break;e=e[a]}if(r)return r;return!!(o=e?e.length:0)&&ot(o)&&Je(a,o)&&(nt(e)||tt(e))}(e,t,Le)}(n,e):De(t,r,void 0,a|s)}}(e[0],e[1]):function(e){var t=function(e){var t=ft(e),n=t.length;for(;n--;){var r=t[n],i=e[r];t[n]=[r,i,He(i)]}return t}(e);if(1==t.length&&t[0][2])return qe(t[0][0],t[0][1]);return function(n){return n===e||function(e,t,n,r){var i=n.length,o=i,c=!r;if(null==e)return!o;for(e=Object(e);i--;){var u=n[i];if(c&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++i<o;){var f=(u=n[i])[0],d=e[f],l=u[1];if(c&&u[2]){if(void 0===d&&!(f in e))return!1}else{var p=new Ie;if(r)var h=r(d,l,f,e,t,p);if(!(void 0===h?De(l,d,r,a|s,p):h))return!1}}return!0}(n,e,t)}}(e):Xe(t=e)?(n=Ye(t),function(e){return null==e?void 0:e[n]}):function(e){return function(t){return Ae(t,e)}}(t);var t,n}function Ue(e){if(n=(t=e)&&t.constructor,r="function"==typeof n&&n.prototype||te,t!==r)return le(e);var t,n,r,i=[];for(var o in Object(e))oe.call(e,o)&&"constructor"!=o&&i.push(o);return i}function Be(e){return nt(e)?e:Ke(e)}ke.prototype.clear=function(){this.__data__=ye?ye(null):{}},ke.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},ke.prototype.get=function(e){var t=this.__data__;if(ye){var n=t[e];return n===o?void 0:n}return oe.call(t,e)?t[e]:void 0},ke.prototype.has=function(e){var t=this.__data__;return ye?void 0!==t[e]:oe.call(t,e)},ke.prototype.set=function(e,t){return this.__data__[e]=ye&&void 0===t?o:t,this},Pe.prototype.clear=function(){this.__data__=[]},Pe.prototype.delete=function(e){var t=this.__data__,n=je(t,e);return!(n<0||(n==t.length-1?t.pop():de.call(t,n,1),0))},Pe.prototype.get=function(e){var t=this.__data__,n=je(t,e);return n<0?void 0:t[n][1]},Pe.prototype.has=function(e){return je(this.__data__,e)>-1},Pe.prototype.set=function(e,t){var n=this.__data__,r=je(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},xe.prototype.clear=function(){this.__data__={hash:new ke,map:new(he||Pe),string:new ke}},xe.prototype.delete=function(e){return Ve(this,e).delete(e)},xe.prototype.get=function(e){return Ve(this,e).get(e)},xe.prototype.has=function(e){return Ve(this,e).has(e)},xe.prototype.set=function(e,t){return Ve(this,e).set(e,t),this},Oe.prototype.add=Oe.prototype.push=function(e){return this.__data__.set(e,o),this},Oe.prototype.has=function(e){return this.__data__.has(e)},Ie.prototype.clear=function(){this.__data__=new Pe},Ie.prototype.delete=function(e){return this.__data__.delete(e)},Ie.prototype.get=function(e){return this.__data__.get(e)},Ie.prototype.has=function(e){return this.__data__.has(e)},Ie.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Pe){var i=n.__data__;if(!he||i.length<r-1)return i.push([e,t]),this;n=this.__data__=new xe(i)}return n.set(e,t),this};var We=me&&1/q(new me([,-0]))[1]==c?function(e){return new me(e)}:function(){};function Ge(e,t,n,r,i,o){var c=i&s,u=e.length,f=t.length;if(u!=f&&!(c&&f>u))return!1;var d=o.get(e);if(d&&o.get(t))return d==t;var l=-1,p=!0,h=i&a?new Oe:void 0;for(o.set(e,t),o.set(t,e);++l<u;){var v=e[l],m=t[l];if(r)var g=c?r(m,v,l,t,e,o):r(v,m,l,e,t,o);if(void 0!==g){if(g)continue;p=!1;break}if(h){if(!z(t,function(e,t){if(!h.has(t)&&(v===e||n(v,e,r,i,o)))return h.add(t)})){p=!1;break}}else if(v!==m&&!n(v,m,r,i,o)){p=!1;break}}return o.delete(e),o.delete(t),p}function Ve(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function ze(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Ne(n)?n:void 0}var $e=function(e){return ae.call(e)};function Je(e,t){return!!(t=null==t?u:t)&&("number"==typeof e||M.test(e))&&e>-1&&e%1==0&&e<t}function Xe(e,t){if(nt(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!ct(e))||(k.test(e)||!_.test(e)||null!=t&&e in Object(t))}function He(e){return e==e&&!at(e)}function qe(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}(pe&&$e(new pe(new ArrayBuffer(1)))!=C||he&&$e(new he)!=g||ve&&"[object Promise]"!=$e(ve.resolve())||me&&$e(new me)!=w||ge&&"[object WeakMap]"!=$e(new ge))&&($e=function(e){var t=ae.call(e),n=t==b?e.constructor:void 0,r=n?Ze(n):void 0;if(r)switch(r){case be:return C;case Se:return g;case we:return"[object Promise]";case Te:return w;case Re:return"[object WeakMap]"}return t});var Ke=Qe(function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(ct(e))return _e?_e.call(e):"";var t=e+"";return"0"==t&&1/e==-c?"-0":t}(t);var n=[];return P.test(e)&&n.push(""),e.replace(x,function(e,t,r,i){n.push(r?i.replace(O,"$1"):t||e)}),n});function Ye(e){if("string"==typeof e||ct(e))return e;var t=e+"";return"0"==t&&1/e==-c?"-0":t}function Ze(e){if(null!=e){try{return ie.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Qe(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError(i);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a),a};return n.cache=new(Qe.Cache||xe),n}function et(e,t){return e===t||e!=e&&t!=t}function tt(e){return function(e){return st(e)&&rt(e)}(e)&&oe.call(e,"callee")&&(!fe.call(e,"callee")||ae.call(e)==f)}Qe.Cache=xe;var nt=Array.isArray;function rt(e){return null!=e&&ot(e.length)&&!it(e)}function it(e){var t=at(e)?ae.call(e):"";return t==v||t==m}function ot(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=u}function at(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function st(e){return!!e&&"object"==typeof e}function ct(e){return"symbol"==typeof e||st(e)&&ae.call(e)==R}var ut=W?function(e){return function(t){return e(t)}}(W):function(e){return st(e)&&ot(e.length)&&!!j[ae.call(e)]};function ft(e){return rt(e)?Me(e):Ue(e)}function dt(e){return e}n.exports=function(e,t){return e&&e.length?function(e,t,n){var i=-1,o=G,a=e.length,s=!0,c=[],u=c;if(n)s=!1,o=V;else if(a>=r){var f=t?null:We(e);if(f)return q(f);s=!1,o=J,u=new Oe}else u=t?[]:c;e:for(;++i<a;){var d=e[i],l=t?t(d):d;if(d=n||0!==d?d:0,s&&l==l){for(var p=u.length;p--;)if(u[p]===l)continue e;t&&u.push(l),c.push(d)}else o(u,l,n)||(u!==c&&u.push(l),c.push(d))}return c}(e,Fe(t)):[]}}).call(this,n(67),n(146)(e))},function(e,t,n){"use strict";var r=n(99),i=n(29);e.exports={shimRTCIceCandidate:function(e){if(!(e.RTCIceCandidate&&"foundation"in e.RTCIceCandidate.prototype)){var t=e.RTCIceCandidate;e.RTCIceCandidate=function(e){if("object"==typeof e&&e.candidate&&0===e.candidate.indexOf("a=")&&((e=JSON.parse(JSON.stringify(e))).candidate=e.candidate.substr(2)),e.candidate&&e.candidate.length){var n=new t(e),i=r.parseCandidate(e.candidate),o=Object.assign(n,i);return o.toJSON=function(){return{candidate:o.candidate,sdpMid:o.sdpMid,sdpMLineIndex:o.sdpMLineIndex,usernameFragment:o.usernameFragment}},o}return new t(e)},e.RTCIceCandidate.prototype=t.prototype,i.wrapPeerConnectionEvent(e,"icecandidate",function(t){return t.candidate&&Object.defineProperty(t,"candidate",{value:new e.RTCIceCandidate(t.candidate),writable:"false"}),t})}},shimCreateObjectURL:function(e){var t=e&&e.URL;if("object"==typeof e&&e.HTMLMediaElement&&"srcObject"in e.HTMLMediaElement.prototype&&t.createObjectURL&&t.revokeObjectURL){var n=t.createObjectURL.bind(t),r=t.revokeObjectURL.bind(t),o=new Map,a=0;t.createObjectURL=function(e){if("getTracks"in e){var t="polyblob:"+ ++a;return o.set(t,e),i.deprecated("URL.createObjectURL(stream)","elem.srcObject = stream"),t}return n(e)},t.revokeObjectURL=function(e){r(e),o.delete(e)};var s=Object.getOwnPropertyDescriptor(e.HTMLMediaElement.prototype,"src");Object.defineProperty(e.HTMLMediaElement.prototype,"src",{get:function(){return s.get.apply(this)},set:function(e){return this.srcObject=o.get(e)||null,s.set.apply(this,[e])}});var c=e.HTMLMediaElement.prototype.setAttribute;e.HTMLMediaElement.prototype.setAttribute=function(){return 2===arguments.length&&"src"===(""+arguments[0]).toLowerCase()&&(this.srcObject=o.get(arguments[1])||null),c.apply(this,arguments)}}},shimMaxMessageSize:function(e){if(!e.RTCSctpTransport&&e.RTCPeerConnection){var t=i.detectBrowser(e);"sctp"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"sctp",{get:function(){return void 0===this._sctp?null:this._sctp}});var n=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){var e,i,o,a;if(this._sctp=null,o=arguments[0],(a=r.splitSections(o.sdp)).shift(),a.some(function(e){var t=r.parseMLine(e);return t&&"application"===t.kind&&-1!==t.protocol.indexOf("SCTP")})){var s,c=function(e){var t=e.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===t||t.length<2)return-1;var n=parseInt(t[1],10);return n!=n?-1:n}(arguments[0]),u=(e=c,i=65536,"firefox"===t.browser&&(i=t.version<57?-1===e?16384:2147483637:57===t.version?65535:65536),i),f=function(e,n){var i=65536;"firefox"===t.browser&&57===t.version&&(i=65535);var o=r.matchPrefix(e.sdp,"a=max-message-size:");return o.length>0?i=parseInt(o[0].substr(19),10):"firefox"===t.browser&&-1!==n&&(i=2147483637),i}(arguments[0],c);s=0===u&&0===f?Number.POSITIVE_INFINITY:0===u||0===f?Math.max(u,f):Math.min(u,f);var d={};Object.defineProperty(d,"maxMessageSize",{get:function(){return s}}),this._sctp=d}return n.apply(this,arguments)}}},shimSendThrowTypeError:function(e){if(e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){var e=this,n=t.apply(e,arguments),r=n.send;return n.send=function(){var t=arguments[0];if((t.length||t.size||t.byteLength)>e.sctp.maxMessageSize)throw new DOMException("Message too large (can send a maximum of "+e.sctp.maxMessageSize+" bytes)","TypeError");return r.apply(this,arguments)},n}}}}},function(e,t,n){"use strict";var r=n(29);e.exports={shimLocalStreamsAPI:function(e){if("object"==typeof e&&e.RTCPeerConnection){if("getLocalStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),"getStreamById"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getStreamById=function(e){var t=null;return this._localStreams&&this._localStreams.forEach(function(n){n.id===e&&(t=n)}),this._remoteStreams&&this._remoteStreams.forEach(function(n){n.id===e&&(t=n)}),t}),!("addStream"in e.RTCPeerConnection.prototype)){var t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(e){this._localStreams||(this._localStreams=[]),-1===this._localStreams.indexOf(e)&&this._localStreams.push(e);var n=this;e.getTracks().forEach(function(r){t.call(n,r,e)})},e.RTCPeerConnection.prototype.addTrack=function(e,n){return n&&(this._localStreams?-1===this._localStreams.indexOf(n)&&this._localStreams.push(n):this._localStreams=[n]),t.call(this,e,n)}}"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){this._localStreams||(this._localStreams=[]);var t=this._localStreams.indexOf(e);if(-1!==t){this._localStreams.splice(t,1);var n=this,r=e.getTracks();this.getSenders().forEach(function(e){-1!==r.indexOf(e.track)&&n.removeTrack(e)})}})}},shimRemoteStreamsAPI:function(e){"object"==typeof e&&e.RTCPeerConnection&&("getRemoteStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),"onaddstream"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"onaddstream",{get:function(){return this._onaddstream},set:function(e){var t=this;this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=e),this.addEventListener("track",this._onaddstreampoly=function(e){e.streams.forEach(function(e){if(t._remoteStreams||(t._remoteStreams=[]),!(t._remoteStreams.indexOf(e)>=0)){t._remoteStreams.push(e);var n=new Event("addstream");n.stream=e,t.dispatchEvent(n)}})})}}))},shimCallbacksAPI:function(e){if("object"==typeof e&&e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype,n=t.createOffer,r=t.createAnswer,i=t.setLocalDescription,o=t.setRemoteDescription,a=t.addIceCandidate;t.createOffer=function(e,t){var r=arguments.length>=2?arguments[2]:arguments[0],i=n.apply(this,[r]);return t?(i.then(e,t),Promise.resolve()):i},t.createAnswer=function(e,t){var n=arguments.length>=2?arguments[2]:arguments[0],i=r.apply(this,[n]);return t?(i.then(e,t),Promise.resolve()):i};var s=function(e,t,n){var r=i.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r};t.setLocalDescription=s,s=function(e,t,n){var r=o.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r},t.setRemoteDescription=s,s=function(e,t,n){var r=a.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r},t.addIceCandidate=s}},shimGetUserMedia:function(e){var t=e&&e.navigator;t.getUserMedia||(t.webkitGetUserMedia?t.getUserMedia=t.webkitGetUserMedia.bind(t):t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,n,r){t.mediaDevices.getUserMedia(e).then(n,r)}.bind(t)))},shimRTCIceServerUrls:function(e){var t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,n){if(e&&e.iceServers){for(var i=[],o=0;o<e.iceServers.length;o++){var a=e.iceServers[o];!a.hasOwnProperty("urls")&&a.hasOwnProperty("url")?(r.deprecated("RTCIceServer.url","RTCIceServer.urls"),(a=JSON.parse(JSON.stringify(a))).urls=a.url,delete a.url,i.push(a)):i.push(e.iceServers[o])}e.iceServers=i}return new t(e,n)},e.RTCPeerConnection.prototype=t.prototype,"generateCertificate"in e.RTCPeerConnection&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:function(){return t.generateCertificate}})},shimTrackEventTransceiver:function(e){"object"==typeof e&&e.RTCPeerConnection&&"receiver"in e.RTCTrackEvent.prototype&&!e.RTCTransceiver&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})},shimCreateOfferLegacy:function(e){var t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(e){var n=this;if(e){var r=n.getTransceivers().find(function(e){return e.sender.track&&"audio"===e.sender.track.kind});!1===e.offerToReceiveAudio&&r?"sendrecv"===r.direction?r.setDirection?r.setDirection("sendonly"):r.direction="sendonly":"recvonly"===r.direction&&(r.setDirection?r.setDirection("inactive"):r.direction="inactive"):!0!==e.offerToReceiveAudio||r||n.addTransceiver("audio");var i=n.getTransceivers().find(function(e){return e.sender.track&&"video"===e.sender.track.kind});!1===e.offerToReceiveVideo&&i?"sendrecv"===i.direction?i.setDirection("sendonly"):"recvonly"===i.direction&&i.setDirection("inactive"):!0!==e.offerToReceiveVideo||i||n.addTransceiver("video")}return t.apply(n,arguments)}}}},function(e,t,n){"use strict";var r=n(29),i=r.log;e.exports=function(e){var t=r.detectBrowser(e),n=e&&e.navigator,o=e&&e.MediaStreamTrack,a=function(e){return{name:{InternalError:"NotReadableError",NotSupportedError:"TypeError",PermissionDeniedError:"NotAllowedError",SecurityError:"NotAllowedError"}[e.name]||e.name,message:{"The operation is insecure.":"The request is not allowed by the user agent or the platform in the current context."}[e.message]||e.message,constraint:e.constraint,toString:function(){return this.name+(this.message&&": ")+this.message}}},s=function(e,r,o){var s=function(e){if("object"!=typeof e||e.require)return e;var t=[];return Object.keys(e).forEach(function(n){if("require"!==n&&"advanced"!==n&&"mediaSource"!==n){var r=e[n]="object"==typeof e[n]?e[n]:{ideal:e[n]};if(void 0===r.min&&void 0===r.max&&void 0===r.exact||t.push(n),void 0!==r.exact&&("number"==typeof r.exact?r.min=r.max=r.exact:e[n]=r.exact,delete r.exact),void 0!==r.ideal){e.advanced=e.advanced||[];var i={};"number"==typeof r.ideal?i[n]={min:r.ideal,max:r.ideal}:i[n]=r.ideal,e.advanced.push(i),delete r.ideal,Object.keys(r).length||delete e[n]}}}),t.length&&(e.require=t),e};return e=JSON.parse(JSON.stringify(e)),t.version<38&&(i("spec: "+JSON.stringify(e)),e.audio&&(e.audio=s(e.audio)),e.video&&(e.video=s(e.video)),i("ff37: "+JSON.stringify(e))),n.mozGetUserMedia(e,r,function(e){o(a(e))})};if(n.mediaDevices||(n.mediaDevices={getUserMedia:function(e){return new Promise(function(t,n){s(e,t,n)})},addEventListener:function(){},removeEventListener:function(){}}),n.mediaDevices.enumerateDevices=n.mediaDevices.enumerateDevices||function(){return new Promise(function(e){e([{kind:"audioinput",deviceId:"default",label:"",groupId:""},{kind:"videoinput",deviceId:"default",label:"",groupId:""}])})},t.version<41){var c=n.mediaDevices.enumerateDevices.bind(n.mediaDevices);n.mediaDevices.enumerateDevices=function(){return c().then(void 0,function(e){if("NotFoundError"===e.name)return[];throw e})}}if(t.version<49){var u=n.mediaDevices.getUserMedia.bind(n.mediaDevices);n.mediaDevices.getUserMedia=function(e){return u(e).then(function(t){if(e.audio&&!t.getAudioTracks().length||e.video&&!t.getVideoTracks().length)throw t.getTracks().forEach(function(e){e.stop()}),new DOMException("The object can not be found here.","NotFoundError");return t},function(e){return Promise.reject(a(e))})}}if(!(t.version>55&&"autoGainControl"in n.mediaDevices.getSupportedConstraints())){var f=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])},d=n.mediaDevices.getUserMedia.bind(n.mediaDevices);if(n.mediaDevices.getUserMedia=function(e){return"object"==typeof e&&"object"==typeof e.audio&&(e=JSON.parse(JSON.stringify(e)),f(e.audio,"autoGainControl","mozAutoGainControl"),f(e.audio,"noiseSuppression","mozNoiseSuppression")),d(e)},o&&o.prototype.getSettings){var l=o.prototype.getSettings;o.prototype.getSettings=function(){var e=l.apply(this,arguments);return f(e,"mozAutoGainControl","autoGainControl"),f(e,"mozNoiseSuppression","noiseSuppression"),e}}if(o&&o.prototype.applyConstraints){var p=o.prototype.applyConstraints;o.prototype.applyConstraints=function(e){return"audio"===this.kind&&"object"==typeof e&&(e=JSON.parse(JSON.stringify(e)),f(e,"autoGainControl","mozAutoGainControl"),f(e,"noiseSuppression","mozNoiseSuppression")),p.apply(this,[e])}}}n.getUserMedia=function(e,i,o){if(t.version<44)return s(e,i,o);r.deprecated("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),n.mediaDevices.getUserMedia(e).then(i,o)}}},function(e,t,n){"use strict";var r=n(29);e.exports={shimGetUserMedia:n(150),shimOnTrack:function(e){"object"!=typeof e||!e.RTCPeerConnection||"ontrack"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get:function(){return this._ontrack},set:function(e){this._ontrack&&(this.removeEventListener("track",this._ontrack),this.removeEventListener("addstream",this._ontrackpoly)),this.addEventListener("track",this._ontrack=e),this.addEventListener("addstream",this._ontrackpoly=function(e){e.stream.getTracks().forEach(function(t){var n=new Event("track");n.track=t,n.receiver={track:t},n.transceiver={receiver:n.receiver},n.streams=[e.stream],this.dispatchEvent(n)}.bind(this))}.bind(this))}}),"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})},shimSourceObject:function(e){"object"==typeof e&&(!e.HTMLMediaElement||"srcObject"in e.HTMLMediaElement.prototype||Object.defineProperty(e.HTMLMediaElement.prototype,"srcObject",{get:function(){return this.mozSrcObject},set:function(e){this.mozSrcObject=e}}))},shimPeerConnection:function(e){var t=r.detectBrowser(e);if("object"==typeof e&&(e.RTCPeerConnection||e.mozRTCPeerConnection)){e.RTCPeerConnection||(e.RTCPeerConnection=function(n,r){if(t.version<38&&n&&n.iceServers){for(var i=[],o=0;o<n.iceServers.length;o++){var a=n.iceServers[o];if(a.hasOwnProperty("urls"))for(var s=0;s<a.urls.length;s++){var c={url:a.urls[s]};0===a.urls[s].indexOf("turn")&&(c.username=a.username,c.credential=a.credential),i.push(c)}else i.push(n.iceServers[o])}n.iceServers=i}return new e.mozRTCPeerConnection(n,r)},e.RTCPeerConnection.prototype=e.mozRTCPeerConnection.prototype,e.mozRTCPeerConnection.generateCertificate&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:function(){return e.mozRTCPeerConnection.generateCertificate}}),e.RTCSessionDescription=e.mozRTCSessionDescription,e.RTCIceCandidate=e.mozRTCIceCandidate),["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(t){var n=e.RTCPeerConnection.prototype[t];e.RTCPeerConnection.prototype[t]=function(){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}});var n=e.RTCPeerConnection.prototype.addIceCandidate;e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?n.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())};var i={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},o=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(e,n,r){return o.apply(this,[e||null]).then(function(e){if(t.version<48&&(e=function(e){var t=new Map;return Object.keys(e).forEach(function(n){t.set(n,e[n]),t[n]=e[n]}),t}(e)),t.version<53&&!n)try{e.forEach(function(e){e.type=i[e.type]||e.type})}catch(t){if("TypeError"!==t.name)throw t;e.forEach(function(t,n){e.set(n,Object.assign({},t,{type:i[t.type]||t.type}))})}return e}).then(n,r)}}},shimRemoveStream:function(e){!e.RTCPeerConnection||"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;r.deprecated("removeStream","removeTrack"),this.getSenders().forEach(function(n){n.track&&-1!==e.getTracks().indexOf(n.track)&&t.removeTrack(n)})})}}},function(e,t,n){"use strict";e.exports=function(e){var t=e&&e.navigator,n=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(e){return n(e).catch(function(e){return Promise.reject(function(e){return{name:{PermissionDeniedError:"NotAllowedError"}[e.name]||e.name,message:e.message,constraint:e.constraint,toString:function(){return this.name}}}(e))})}}},function(e,t,n){"use strict";var r=n(99);function i(e,t,n,i,o){var a=r.writeRtpDescription(e.kind,t);if(a+=r.writeIceParameters(e.iceGatherer.getLocalParameters()),a+=r.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===n?"actpass":o||"active"),a+="a=mid:"+e.mid+"\r\n",e.rtpSender&&e.rtpReceiver?a+="a=sendrecv\r\n":e.rtpSender?a+="a=sendonly\r\n":e.rtpReceiver?a+="a=recvonly\r\n":a+="a=inactive\r\n",e.rtpSender){var s=e.rtpSender._initialTrackId||e.rtpSender.track.id;e.rtpSender._initialTrackId=s;var c="msid:"+(i?i.id:"-")+" "+s+"\r\n";a+="a="+c,a+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+c,e.sendEncodingParameters[0].rtx&&(a+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+c,a+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return a+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+r.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(a+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+r.localCName+"\r\n"),a}function o(e,t){var n={codecs:[],headerExtensions:[],fecMechanisms:[]},r=function(e,t){e=parseInt(e,10);for(var n=0;n<t.length;n++)if(t[n].payloadType===e||t[n].preferredPayloadType===e)return t[n]},i=function(e,t,n,i){var o=r(e.parameters.apt,n),a=r(t.parameters.apt,i);return o&&a&&o.name.toLowerCase()===a.name.toLowerCase()};return e.codecs.forEach(function(r){for(var o=0;o<t.codecs.length;o++){var a=t.codecs[o];if(r.name.toLowerCase()===a.name.toLowerCase()&&r.clockRate===a.clockRate){if("rtx"===r.name.toLowerCase()&&r.parameters&&a.parameters.apt&&!i(r,a,e.codecs,t.codecs))continue;(a=JSON.parse(JSON.stringify(a))).numChannels=Math.min(r.numChannels,a.numChannels),n.codecs.push(a),a.rtcpFeedback=a.rtcpFeedback.filter(function(e){for(var t=0;t<r.rtcpFeedback.length;t++)if(r.rtcpFeedback[t].type===e.type&&r.rtcpFeedback[t].parameter===e.parameter)return!0;return!1});break}}}),e.headerExtensions.forEach(function(e){for(var r=0;r<t.headerExtensions.length;r++){var i=t.headerExtensions[r];if(e.uri===i.uri){n.headerExtensions.push(i);break}}}),n}function a(e,t,n){return-1!=={offer:{setLocalDescription:["stable","have-local-offer"],setRemoteDescription:["stable","have-remote-offer"]},answer:{setLocalDescription:["have-remote-offer","have-local-pranswer"],setRemoteDescription:["have-local-offer","have-remote-pranswer"]}}[t][e].indexOf(n)}function s(e,t){var n=e.getRemoteCandidates().find(function(e){return t.foundation===e.foundation&&t.ip===e.ip&&t.port===e.port&&t.priority===e.priority&&t.protocol===e.protocol&&t.type===e.type});return n||e.addRemoteCandidate(t),!n}function c(e,t){var n=new Error(t);return n.name=e,n.code={NotSupportedError:9,InvalidStateError:11,InvalidAccessError:15,TypeError:void 0,OperationError:void 0}[e],n}e.exports=function(e,t){function n(t,n){n.addTrack(t),n.dispatchEvent(new e.MediaStreamTrackEvent("addtrack",{track:t}))}function u(t,n,r,i){var o=new Event("track");o.track=n,o.receiver=r,o.transceiver={receiver:r},o.streams=i,e.setTimeout(function(){t._dispatchEvent("track",o)})}var f=function(n){var i=this,o=document.createDocumentFragment();if(["addEventListener","removeEventListener","dispatchEvent"].forEach(function(e){i[e]=o[e].bind(o)}),this.canTrickleIceCandidates=null,this.needNegotiation=!1,this.localStreams=[],this.remoteStreams=[],this.localDescription=null,this.remoteDescription=null,this.signalingState="stable",this.iceConnectionState="new",this.connectionState="new",this.iceGatheringState="new",n=JSON.parse(JSON.stringify(n||{})),this.usingBundle="max-bundle"===n.bundlePolicy,"negotiate"===n.rtcpMuxPolicy)throw c("NotSupportedError","rtcpMuxPolicy 'negotiate' is not supported");switch(n.rtcpMuxPolicy||(n.rtcpMuxPolicy="require"),n.iceTransportPolicy){case"all":case"relay":break;default:n.iceTransportPolicy="all"}switch(n.bundlePolicy){case"balanced":case"max-compat":case"max-bundle":break;default:n.bundlePolicy="balanced"}if(n.iceServers=function(e,t){var n=!1;return(e=JSON.parse(JSON.stringify(e))).filter(function(e){if(e&&(e.urls||e.url)){var r=e.urls||e.url;e.url&&!e.urls&&console.warn("RTCIceServer.url is deprecated! Use urls instead.");var i="string"==typeof r;return i&&(r=[r]),r=r.filter(function(e){return 0!==e.indexOf("turn:")||-1===e.indexOf("transport=udp")||-1!==e.indexOf("turn:[")||n?0===e.indexOf("stun:")&&t>=14393&&-1===e.indexOf("?transport=udp"):(n=!0,!0)}),delete e.url,e.urls=i?r[0]:r,!!r.length}})}(n.iceServers||[],t),this._iceGatherers=[],n.iceCandidatePoolSize)for(var a=n.iceCandidatePoolSize;a>0;a--)this._iceGatherers.push(new e.RTCIceGatherer({iceServers:n.iceServers,gatherPolicy:n.iceTransportPolicy}));else n.iceCandidatePoolSize=0;this._config=n,this.transceivers=[],this._sdpSessionId=r.generateSessionId(),this._sdpSessionVersion=0,this._dtlsRole=void 0,this._isClosed=!1};f.prototype.onicecandidate=null,f.prototype.onaddstream=null,f.prototype.ontrack=null,f.prototype.onremovestream=null,f.prototype.onsignalingstatechange=null,f.prototype.oniceconnectionstatechange=null,f.prototype.onconnectionstatechange=null,f.prototype.onicegatheringstatechange=null,f.prototype.onnegotiationneeded=null,f.prototype.ondatachannel=null,f.prototype._dispatchEvent=function(e,t){this._isClosed||(this.dispatchEvent(t),"function"==typeof this["on"+e]&&this["on"+e](t))},f.prototype._emitGatheringStateChange=function(){var e=new Event("icegatheringstatechange");this._dispatchEvent("icegatheringstatechange",e)},f.prototype.getConfiguration=function(){return this._config},f.prototype.getLocalStreams=function(){return this.localStreams},f.prototype.getRemoteStreams=function(){return this.remoteStreams},f.prototype._createTransceiver=function(e,t){var n=this.transceivers.length>0,r={track:null,iceGatherer:null,iceTransport:null,dtlsTransport:null,localCapabilities:null,remoteCapabilities:null,rtpSender:null,rtpReceiver:null,kind:e,mid:null,sendEncodingParameters:null,recvEncodingParameters:null,stream:null,associatedRemoteMediaStreams:[],wantReceive:!0};if(this.usingBundle&&n)r.iceTransport=this.transceivers[0].iceTransport,r.dtlsTransport=this.transceivers[0].dtlsTransport;else{var i=this._createIceAndDtlsTransports();r.iceTransport=i.iceTransport,r.dtlsTransport=i.dtlsTransport}return t||this.transceivers.push(r),r},f.prototype.addTrack=function(t,n){if(this._isClosed)throw c("InvalidStateError","Attempted to call addTrack on a closed peerconnection.");var r;if(this.transceivers.find(function(e){return e.track===t}))throw c("InvalidAccessError","Track already exists.");for(var i=0;i<this.transceivers.length;i++)this.transceivers[i].track||this.transceivers[i].kind!==t.kind||(r=this.transceivers[i]);return r||(r=this._createTransceiver(t.kind)),this._maybeFireNegotiationNeeded(),-1===this.localStreams.indexOf(n)&&this.localStreams.push(n),r.track=t,r.stream=n,r.rtpSender=new e.RTCRtpSender(t,r.dtlsTransport),r.rtpSender},f.prototype.addStream=function(e){var n=this;if(t>=15025)e.getTracks().forEach(function(t){n.addTrack(t,e)});else{var r=e.clone();e.getTracks().forEach(function(e,t){var n=r.getTracks()[t];e.addEventListener("enabled",function(e){n.enabled=e.enabled})}),r.getTracks().forEach(function(e){n.addTrack(e,r)})}},f.prototype.removeTrack=function(t){if(this._isClosed)throw c("InvalidStateError","Attempted to call removeTrack on a closed peerconnection.");if(!(t instanceof e.RTCRtpSender))throw new TypeError("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.");var n=this.transceivers.find(function(e){return e.rtpSender===t});if(!n)throw c("InvalidAccessError","Sender was not created by this connection.");var r=n.stream;n.rtpSender.stop(),n.rtpSender=null,n.track=null,n.stream=null,-1===this.transceivers.map(function(e){return e.stream}).indexOf(r)&&this.localStreams.indexOf(r)>-1&&this.localStreams.splice(this.localStreams.indexOf(r),1),this._maybeFireNegotiationNeeded()},f.prototype.removeStream=function(e){var t=this;e.getTracks().forEach(function(e){var n=t.getSenders().find(function(t){return t.track===e});n&&t.removeTrack(n)})},f.prototype.getSenders=function(){return this.transceivers.filter(function(e){return!!e.rtpSender}).map(function(e){return e.rtpSender})},f.prototype.getReceivers=function(){return this.transceivers.filter(function(e){return!!e.rtpReceiver}).map(function(e){return e.rtpReceiver})},f.prototype._createIceGatherer=function(t,n){var r=this;if(n&&t>0)return this.transceivers[0].iceGatherer;if(this._iceGatherers.length)return this._iceGatherers.shift();var i=new e.RTCIceGatherer({iceServers:this._config.iceServers,gatherPolicy:this._config.iceTransportPolicy});return Object.defineProperty(i,"state",{value:"new",writable:!0}),this.transceivers[t].bufferedCandidateEvents=[],this.transceivers[t].bufferCandidates=function(e){var n=!e.candidate||0===Object.keys(e.candidate).length;i.state=n?"completed":"gathering",null!==r.transceivers[t].bufferedCandidateEvents&&r.transceivers[t].bufferedCandidateEvents.push(e)},i.addEventListener("localcandidate",this.transceivers[t].bufferCandidates),i},f.prototype._gather=function(t,n){var i=this,o=this.transceivers[n].iceGatherer;if(!o.onlocalcandidate){var a=this.transceivers[n].bufferedCandidateEvents;this.transceivers[n].bufferedCandidateEvents=null,o.removeEventListener("localcandidate",this.transceivers[n].bufferCandidates),o.onlocalcandidate=function(e){if(!(i.usingBundle&&n>0)){var a=new Event("icecandidate");a.candidate={sdpMid:t,sdpMLineIndex:n};var s=e.candidate,c=!s||0===Object.keys(s).length;if(c)"new"!==o.state&&"gathering"!==o.state||(o.state="completed");else{"new"===o.state&&(o.state="gathering"),s.component=1;var u=r.writeCandidate(s);a.candidate=Object.assign(a.candidate,r.parseCandidate(u)),a.candidate.candidate=u}var f=r.getMediaSections(i.localDescription.sdp);f[a.candidate.sdpMLineIndex]+=c?"a=end-of-candidates\r\n":"a="+a.candidate.candidate+"\r\n",i.localDescription.sdp=r.getDescription(i.localDescription.sdp)+f.join("");var d=i.transceivers.every(function(e){return e.iceGatherer&&"completed"===e.iceGatherer.state});"gathering"!==i.iceGatheringState&&(i.iceGatheringState="gathering",i._emitGatheringStateChange()),c||i._dispatchEvent("icecandidate",a),d&&(i._dispatchEvent("icecandidate",new Event("icecandidate")),i.iceGatheringState="complete",i._emitGatheringStateChange())}},e.setTimeout(function(){a.forEach(function(e){o.onlocalcandidate(e)})},0)}},f.prototype._createIceAndDtlsTransports=function(){var t=this,n=new e.RTCIceTransport(null);n.onicestatechange=function(){t._updateIceConnectionState(),t._updateConnectionState()};var r=new e.RTCDtlsTransport(n);return r.ondtlsstatechange=function(){t._updateConnectionState()},r.onerror=function(){Object.defineProperty(r,"state",{value:"failed",writable:!0}),t._updateConnectionState()},{iceTransport:n,dtlsTransport:r}},f.prototype._disposeIceAndDtlsTransports=function(e){var t=this.transceivers[e].iceGatherer;t&&(delete t.onlocalcandidate,delete this.transceivers[e].iceGatherer);var n=this.transceivers[e].iceTransport;n&&(delete n.onicestatechange,delete this.transceivers[e].iceTransport);var r=this.transceivers[e].dtlsTransport;r&&(delete r.ondtlsstatechange,delete r.onerror,delete this.transceivers[e].dtlsTransport)},f.prototype._transceive=function(e,n,i){var a=o(e.localCapabilities,e.remoteCapabilities);n&&e.rtpSender&&(a.encodings=e.sendEncodingParameters,a.rtcp={cname:r.localCName,compound:e.rtcpParameters.compound},e.recvEncodingParameters.length&&(a.rtcp.ssrc=e.recvEncodingParameters[0].ssrc),e.rtpSender.send(a)),i&&e.rtpReceiver&&a.codecs.length>0&&("video"===e.kind&&e.recvEncodingParameters&&t<15019&&e.recvEncodingParameters.forEach(function(e){delete e.rtx}),e.recvEncodingParameters.length?a.encodings=e.recvEncodingParameters:a.encodings=[{}],a.rtcp={compound:e.rtcpParameters.compound},e.rtcpParameters.cname&&(a.rtcp.cname=e.rtcpParameters.cname),e.sendEncodingParameters.length&&(a.rtcp.ssrc=e.sendEncodingParameters[0].ssrc),e.rtpReceiver.receive(a))},f.prototype.setLocalDescription=function(e){var t,n,i=this;if(-1===["offer","answer"].indexOf(e.type))return Promise.reject(c("TypeError",'Unsupported type "'+e.type+'"'));if(!a("setLocalDescription",e.type,i.signalingState)||i._isClosed)return Promise.reject(c("InvalidStateError","Can not set local "+e.type+" in state "+i.signalingState));if("offer"===e.type)t=r.splitSections(e.sdp),n=t.shift(),t.forEach(function(e,t){var n=r.parseRtpParameters(e);i.transceivers[t].localCapabilities=n}),i.transceivers.forEach(function(e,t){i._gather(e.mid,t)});else if("answer"===e.type){t=r.splitSections(i.remoteDescription.sdp),n=t.shift();var s=r.matchPrefix(n,"a=ice-lite").length>0;t.forEach(function(e,t){var a=i.transceivers[t],c=a.iceGatherer,u=a.iceTransport,f=a.dtlsTransport,d=a.localCapabilities,l=a.remoteCapabilities;if(!(r.isRejected(e)&&0===r.matchPrefix(e,"a=bundle-only").length)&&!a.rejected){var p=r.getIceParameters(e,n),h=r.getDtlsParameters(e,n);s&&(h.role="server"),i.usingBundle&&0!==t||(i._gather(a.mid,t),"new"===u.state&&u.start(c,p,s?"controlling":"controlled"),"new"===f.state&&f.start(h));var v=o(d,l);i._transceive(a,v.codecs.length>0,!1)}})}return i.localDescription={type:e.type,sdp:e.sdp},"offer"===e.type?i._updateSignalingState("have-local-offer"):i._updateSignalingState("stable"),Promise.resolve()},f.prototype.setRemoteDescription=function(i){var o=this;if(-1===["offer","answer"].indexOf(i.type))return Promise.reject(c("TypeError",'Unsupported type "'+i.type+'"'));if(!a("setRemoteDescription",i.type,o.signalingState)||o._isClosed)return Promise.reject(c("InvalidStateError","Can not set remote "+i.type+" in state "+o.signalingState));var f={};o.remoteStreams.forEach(function(e){f[e.id]=e});var d=[],l=r.splitSections(i.sdp),p=l.shift(),h=r.matchPrefix(p,"a=ice-lite").length>0,v=r.matchPrefix(p,"a=group:BUNDLE ").length>0;o.usingBundle=v;var m=r.matchPrefix(p,"a=ice-options:")[0];return o.canTrickleIceCandidates=!!m&&m.substr(14).split(" ").indexOf("trickle")>=0,l.forEach(function(a,c){var u=r.splitLines(a),l=r.getKind(a),m=r.isRejected(a)&&0===r.matchPrefix(a,"a=bundle-only").length,g=u[0].substr(2).split(" ")[2],y=r.getDirection(a,p),b=r.parseMsid(a),S=r.getMid(a)||r.generateIdentifier();if("application"===l&&"DTLS/SCTP"===g||m)o.transceivers[c]={mid:S,kind:l,rejected:!0};else{var w,T,R,E,C,_,k,P,x;!m&&o.transceivers[c]&&o.transceivers[c].rejected&&(o.transceivers[c]=o._createTransceiver(l,!0));var O,I,M=r.parseRtpParameters(a);m||(O=r.getIceParameters(a,p),(I=r.getDtlsParameters(a,p)).role="client"),k=r.parseRtpEncodingParameters(a);var j=r.parseRtcpParameters(a),A=r.matchPrefix(a,"a=end-of-candidates",p).length>0,L=r.matchPrefix(a,"a=candidate:").map(function(e){return r.parseCandidate(e)}).filter(function(e){return 1===e.component});if(("offer"===i.type||"answer"===i.type)&&!m&&v&&c>0&&o.transceivers[c]&&(o._disposeIceAndDtlsTransports(c),o.transceivers[c].iceGatherer=o.transceivers[0].iceGatherer,o.transceivers[c].iceTransport=o.transceivers[0].iceTransport,o.transceivers[c].dtlsTransport=o.transceivers[0].dtlsTransport,o.transceivers[c].rtpSender&&o.transceivers[c].rtpSender.setTransport(o.transceivers[0].dtlsTransport),o.transceivers[c].rtpReceiver&&o.transceivers[c].rtpReceiver.setTransport(o.transceivers[0].dtlsTransport)),"offer"!==i.type||m)"answer"!==i.type||m||(T=(w=o.transceivers[c]).iceGatherer,R=w.iceTransport,E=w.dtlsTransport,C=w.rtpReceiver,_=w.sendEncodingParameters,P=w.localCapabilities,o.transceivers[c].recvEncodingParameters=k,o.transceivers[c].remoteCapabilities=M,o.transceivers[c].rtcpParameters=j,L.length&&"new"===R.state&&(!h&&!A||v&&0!==c?L.forEach(function(e){s(w.iceTransport,e)}):R.setRemoteCandidates(L)),v&&0!==c||("new"===R.state&&R.start(T,O,"controlling"),"new"===E.state&&E.start(I)),o._transceive(w,"sendrecv"===y||"recvonly"===y,"sendrecv"===y||"sendonly"===y),!C||"sendrecv"!==y&&"sendonly"!==y?delete w.rtpReceiver:(x=C.track,b?(f[b.stream]||(f[b.stream]=new e.MediaStream),n(x,f[b.stream]),d.push([x,C,f[b.stream]])):(f.default||(f.default=new e.MediaStream),n(x,f.default),d.push([x,C,f.default]))));else{(w=o.transceivers[c]||o._createTransceiver(l)).mid=S,w.iceGatherer||(w.iceGatherer=o._createIceGatherer(c,v)),L.length&&"new"===w.iceTransport.state&&(!A||v&&0!==c?L.forEach(function(e){s(w.iceTransport,e)}):w.iceTransport.setRemoteCandidates(L)),P=e.RTCRtpReceiver.getCapabilities(l),t<15019&&(P.codecs=P.codecs.filter(function(e){return"rtx"!==e.name})),_=w.sendEncodingParameters||[{ssrc:1001*(2*c+2)}];var D,N=!1;if("sendrecv"===y||"sendonly"===y){if(N=!w.rtpReceiver,C=w.rtpReceiver||new e.RTCRtpReceiver(w.dtlsTransport,l),N)x=C.track,b&&"-"===b.stream||(b?(f[b.stream]||(f[b.stream]=new e.MediaStream,Object.defineProperty(f[b.stream],"id",{get:function(){return b.stream}})),Object.defineProperty(x,"id",{get:function(){return b.track}}),D=f[b.stream]):(f.default||(f.default=new e.MediaStream),D=f.default)),D&&(n(x,D),w.associatedRemoteMediaStreams.push(D)),d.push([x,C,D])}else w.rtpReceiver&&w.rtpReceiver.track&&(w.associatedRemoteMediaStreams.forEach(function(t){var n,r,i=t.getTracks().find(function(e){return e.id===w.rtpReceiver.track.id});i&&(n=i,(r=t).removeTrack(n),r.dispatchEvent(new e.MediaStreamTrackEvent("removetrack",{track:n})))}),w.associatedRemoteMediaStreams=[]);w.localCapabilities=P,w.remoteCapabilities=M,w.rtpReceiver=C,w.rtcpParameters=j,w.sendEncodingParameters=_,w.recvEncodingParameters=k,o._transceive(o.transceivers[c],!1,N)}}}),void 0===o._dtlsRole&&(o._dtlsRole="offer"===i.type?"active":"passive"),o.remoteDescription={type:i.type,sdp:i.sdp},"offer"===i.type?o._updateSignalingState("have-remote-offer"):o._updateSignalingState("stable"),Object.keys(f).forEach(function(t){var n=f[t];if(n.getTracks().length){if(-1===o.remoteStreams.indexOf(n)){o.remoteStreams.push(n);var r=new Event("addstream");r.stream=n,e.setTimeout(function(){o._dispatchEvent("addstream",r)})}d.forEach(function(e){var t=e[0],r=e[1];n.id===e[2].id&&u(o,t,r,[n])})}}),d.forEach(function(e){e[2]||u(o,e[0],e[1],[])}),e.setTimeout(function(){o&&o.transceivers&&o.transceivers.forEach(function(e){e.iceTransport&&"new"===e.iceTransport.state&&e.iceTransport.getRemoteCandidates().length>0&&(console.warn("Timeout for addRemoteCandidate. Consider sending an end-of-candidates notification"),e.iceTransport.addRemoteCandidate({}))})},4e3),Promise.resolve()},f.prototype.close=function(){this.transceivers.forEach(function(e){e.iceTransport&&e.iceTransport.stop(),e.dtlsTransport&&e.dtlsTransport.stop(),e.rtpSender&&e.rtpSender.stop(),e.rtpReceiver&&e.rtpReceiver.stop()}),this._isClosed=!0,this._updateSignalingState("closed")},f.prototype._updateSignalingState=function(e){this.signalingState=e;var t=new Event("signalingstatechange");this._dispatchEvent("signalingstatechange",t)},f.prototype._maybeFireNegotiationNeeded=function(){var t=this;"stable"===this.signalingState&&!0!==this.needNegotiation&&(this.needNegotiation=!0,e.setTimeout(function(){if(t.needNegotiation){t.needNegotiation=!1;var e=new Event("negotiationneeded");t._dispatchEvent("negotiationneeded",e)}},0))},f.prototype._updateIceConnectionState=function(){var e,t={new:0,closed:0,checking:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach(function(e){t[e.iceTransport.state]++}),e="new",t.failed>0?e="failed":t.checking>0?e="checking":t.disconnected>0?e="disconnected":t.new>0?e="new":t.connected>0?e="connected":t.completed>0&&(e="completed"),e!==this.iceConnectionState){this.iceConnectionState=e;var n=new Event("iceconnectionstatechange");this._dispatchEvent("iceconnectionstatechange",n)}},f.prototype._updateConnectionState=function(){var e,t={new:0,closed:0,connecting:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach(function(e){t[e.iceTransport.state]++,t[e.dtlsTransport.state]++}),t.connected+=t.completed,e="new",t.failed>0?e="failed":t.connecting>0?e="connecting":t.disconnected>0?e="disconnected":t.new>0?e="new":t.connected>0&&(e="connected"),e!==this.connectionState){this.connectionState=e;var n=new Event("connectionstatechange");this._dispatchEvent("connectionstatechange",n)}},f.prototype.createOffer=function(){var n=this;if(n._isClosed)return Promise.reject(c("InvalidStateError","Can not call createOffer after close"));var o=n.transceivers.filter(function(e){return"audio"===e.kind}).length,a=n.transceivers.filter(function(e){return"video"===e.kind}).length,s=arguments[0];if(s){if(s.mandatory||s.optional)throw new TypeError("Legacy mandatory/optional constraints not supported.");void 0!==s.offerToReceiveAudio&&(o=!0===s.offerToReceiveAudio?1:!1===s.offerToReceiveAudio?0:s.offerToReceiveAudio),void 0!==s.offerToReceiveVideo&&(a=!0===s.offerToReceiveVideo?1:!1===s.offerToReceiveVideo?0:s.offerToReceiveVideo)}for(n.transceivers.forEach(function(e){"audio"===e.kind?--o<0&&(e.wantReceive=!1):"video"===e.kind&&--a<0&&(e.wantReceive=!1)});o>0||a>0;)o>0&&(n._createTransceiver("audio"),o--),a>0&&(n._createTransceiver("video"),a--);var u=r.writeSessionBoilerplate(n._sdpSessionId,n._sdpSessionVersion++);n.transceivers.forEach(function(i,o){var a=i.track,s=i.kind,c=i.mid||r.generateIdentifier();i.mid=c,i.iceGatherer||(i.iceGatherer=n._createIceGatherer(o,n.usingBundle));var u=e.RTCRtpSender.getCapabilities(s);t<15019&&(u.codecs=u.codecs.filter(function(e){return"rtx"!==e.name})),u.codecs.forEach(function(e){"H264"===e.name&&void 0===e.parameters["level-asymmetry-allowed"]&&(e.parameters["level-asymmetry-allowed"]="1"),i.remoteCapabilities&&i.remoteCapabilities.codecs&&i.remoteCapabilities.codecs.forEach(function(t){e.name.toLowerCase()===t.name.toLowerCase()&&e.clockRate===t.clockRate&&(e.preferredPayloadType=t.payloadType)})}),u.headerExtensions.forEach(function(e){(i.remoteCapabilities&&i.remoteCapabilities.headerExtensions||[]).forEach(function(t){e.uri===t.uri&&(e.id=t.id)})});var f=i.sendEncodingParameters||[{ssrc:1001*(2*o+1)}];a&&t>=15019&&"video"===s&&!f[0].rtx&&(f[0].rtx={ssrc:f[0].ssrc+1}),i.wantReceive&&(i.rtpReceiver=new e.RTCRtpReceiver(i.dtlsTransport,s)),i.localCapabilities=u,i.sendEncodingParameters=f}),"max-compat"!==n._config.bundlePolicy&&(u+="a=group:BUNDLE "+n.transceivers.map(function(e){return e.mid}).join(" ")+"\r\n"),u+="a=ice-options:trickle\r\n",n.transceivers.forEach(function(e,t){u+=i(e,e.localCapabilities,"offer",e.stream,n._dtlsRole),u+="a=rtcp-rsize\r\n",!e.iceGatherer||"new"===n.iceGatheringState||0!==t&&n.usingBundle||(e.iceGatherer.getLocalCandidates().forEach(function(e){e.component=1,u+="a="+r.writeCandidate(e)+"\r\n"}),"completed"===e.iceGatherer.state&&(u+="a=end-of-candidates\r\n"))});var f=new e.RTCSessionDescription({type:"offer",sdp:u});return Promise.resolve(f)},f.prototype.createAnswer=function(){var n=this;if(n._isClosed)return Promise.reject(c("InvalidStateError","Can not call createAnswer after close"));if("have-remote-offer"!==n.signalingState&&"have-local-pranswer"!==n.signalingState)return Promise.reject(c("InvalidStateError","Can not call createAnswer in signalingState "+n.signalingState));var a=r.writeSessionBoilerplate(n._sdpSessionId,n._sdpSessionVersion++);n.usingBundle&&(a+="a=group:BUNDLE "+n.transceivers.map(function(e){return e.mid}).join(" ")+"\r\n");var s=r.getMediaSections(n.remoteDescription.sdp).length;n.transceivers.forEach(function(e,r){if(!(r+1>s)){if(e.rejected)return"application"===e.kind?a+="m=application 0 DTLS/SCTP 5000\r\n":"audio"===e.kind?a+="m=audio 0 UDP/TLS/RTP/SAVPF 0\r\na=rtpmap:0 PCMU/8000\r\n":"video"===e.kind&&(a+="m=video 0 UDP/TLS/RTP/SAVPF 120\r\na=rtpmap:120 VP8/90000\r\n"),void(a+="c=IN IP4 0.0.0.0\r\na=inactive\r\na=mid:"+e.mid+"\r\n");var c;if(e.stream)"audio"===e.kind?c=e.stream.getAudioTracks()[0]:"video"===e.kind&&(c=e.stream.getVideoTracks()[0]),c&&t>=15019&&"video"===e.kind&&!e.sendEncodingParameters[0].rtx&&(e.sendEncodingParameters[0].rtx={ssrc:e.sendEncodingParameters[0].ssrc+1});var u=o(e.localCapabilities,e.remoteCapabilities);!u.codecs.filter(function(e){return"rtx"===e.name.toLowerCase()}).length&&e.sendEncodingParameters[0].rtx&&delete e.sendEncodingParameters[0].rtx,a+=i(e,u,"answer",e.stream,n._dtlsRole),e.rtcpParameters&&e.rtcpParameters.reducedSize&&(a+="a=rtcp-rsize\r\n")}});var u=new e.RTCSessionDescription({type:"answer",sdp:a});return Promise.resolve(u)},f.prototype.addIceCandidate=function(e){var t,n=this;return e&&void 0===e.sdpMLineIndex&&!e.sdpMid?Promise.reject(new TypeError("sdpMLineIndex or sdpMid required")):new Promise(function(i,o){if(!n.remoteDescription)return o(c("InvalidStateError","Can not add ICE candidate without a remote description"));if(e&&""!==e.candidate){var a=e.sdpMLineIndex;if(e.sdpMid)for(var u=0;u<n.transceivers.length;u++)if(n.transceivers[u].mid===e.sdpMid){a=u;break}var f=n.transceivers[a];if(!f)return o(c("OperationError","Can not add ICE candidate"));if(f.rejected)return i();var d=Object.keys(e.candidate).length>0?r.parseCandidate(e.candidate):{};if("tcp"===d.protocol&&(0===d.port||9===d.port))return i();if(d.component&&1!==d.component)return i();if((0===a||a>0&&f.iceTransport!==n.transceivers[0].iceTransport)&&!s(f.iceTransport,d))return o(c("OperationError","Can not add ICE candidate"));var l=e.candidate.trim();0===l.indexOf("a=")&&(l=l.substr(2)),(t=r.getMediaSections(n.remoteDescription.sdp))[a]+="a="+(d.type?l:"end-of-candidates")+"\r\n",n.remoteDescription.sdp=t.join("")}else for(var p=0;p<n.transceivers.length&&(n.transceivers[p].rejected||(n.transceivers[p].iceTransport.addRemoteCandidate({}),(t=r.getMediaSections(n.remoteDescription.sdp))[p]+="a=end-of-candidates\r\n",n.remoteDescription.sdp=r.getDescription(n.remoteDescription.sdp)+t.join(""),!n.usingBundle));p++);i()})},f.prototype.getStats=function(){var e=[];this.transceivers.forEach(function(t){["rtpSender","rtpReceiver","iceGatherer","iceTransport","dtlsTransport"].forEach(function(n){t[n]&&e.push(t[n].getStats())})});return new Promise(function(t){var n=new Map;Promise.all(e).then(function(e){e.forEach(function(e){Object.keys(e).forEach(function(t){var r;e[t].type={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[(r=e[t]).type]||r.type,n.set(t,e[t])})}),t(n)})})};var d=["createOffer","createAnswer"];return d.forEach(function(e){var t=f.prototype[e];f.prototype[e]=function(){var e=arguments;return"function"==typeof e[0]||"function"==typeof e[1]?t.apply(this,[arguments[2]]).then(function(t){"function"==typeof e[0]&&e[0].apply(null,[t])},function(t){"function"==typeof e[1]&&e[1].apply(null,[t])}):t.apply(this,arguments)}}),(d=["setLocalDescription","setRemoteDescription","addIceCandidate"]).forEach(function(e){var t=f.prototype[e];f.prototype[e]=function(){var e=arguments;return"function"==typeof e[1]||"function"==typeof e[2]?t.apply(this,arguments).then(function(){"function"==typeof e[1]&&e[1].apply(null)},function(t){"function"==typeof e[2]&&e[2].apply(null,[t])}):t.apply(this,arguments)}}),["getStats"].forEach(function(e){var t=f.prototype[e];f.prototype[e]=function(){var e=arguments;return"function"==typeof e[1]?t.apply(this,arguments).then(function(){"function"==typeof e[1]&&e[1].apply(null)}):t.apply(this,arguments)}}),f}},function(e,t,n){"use strict";var r=n(29),i=n(153);e.exports={shimGetUserMedia:n(152),shimPeerConnection:function(e){var t=r.detectBrowser(e);if(e.RTCIceGatherer&&(e.RTCIceCandidate||(e.RTCIceCandidate=function(e){return e}),e.RTCSessionDescription||(e.RTCSessionDescription=function(e){return e}),t.version<15025)){var n=Object.getOwnPropertyDescriptor(e.MediaStreamTrack.prototype,"enabled");Object.defineProperty(e.MediaStreamTrack.prototype,"enabled",{set:function(e){n.set.call(this,e);var t=new Event("enabled");t.enabled=e,this.dispatchEvent(t)}})}!e.RTCRtpSender||"dtmf"in e.RTCRtpSender.prototype||Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get:function(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=new e.RTCDtmfSender(this):"video"===this.track.kind&&(this._dtmf=null)),this._dtmf}}),e.RTCPeerConnection=i(e,t.version)},shimReplaceTrack:function(e){!e.RTCRtpSender||"replaceTrack"in e.RTCRtpSender.prototype||(e.RTCRtpSender.prototype.replaceTrack=e.RTCRtpSender.prototype.setTrack)}}},function(e,t,n){"use strict";var r=n(29),i=r.log;e.exports=function(e){var t=r.detectBrowser(e),n=e&&e.navigator,o=function(e){if("object"!=typeof e||e.mandatory||e.optional)return e;var t={};return Object.keys(e).forEach(function(n){if("require"!==n&&"advanced"!==n&&"mediaSource"!==n){var r="object"==typeof e[n]?e[n]:{ideal:e[n]};void 0!==r.exact&&"number"==typeof r.exact&&(r.min=r.max=r.exact);var i=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==r.ideal){t.optional=t.optional||[];var o={};"number"==typeof r.ideal?(o[i("min",n)]=r.ideal,t.optional.push(o),(o={})[i("max",n)]=r.ideal,t.optional.push(o)):(o[i("",n)]=r.ideal,t.optional.push(o))}void 0!==r.exact&&"number"!=typeof r.exact?(t.mandatory=t.mandatory||{},t.mandatory[i("",n)]=r.exact):["min","max"].forEach(function(e){void 0!==r[e]&&(t.mandatory=t.mandatory||{},t.mandatory[i(e,n)]=r[e])})}}),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},a=function(e,r){if(t.version>=61)return r(e);if((e=JSON.parse(JSON.stringify(e)))&&"object"==typeof e.audio){var a=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])};a((e=JSON.parse(JSON.stringify(e))).audio,"autoGainControl","googAutoGainControl"),a(e.audio,"noiseSuppression","googNoiseSuppression"),e.audio=o(e.audio)}if(e&&"object"==typeof e.video){var s=e.video.facingMode;s=s&&("object"==typeof s?s:{ideal:s});var c,u=t.version<66;if(s&&("user"===s.exact||"environment"===s.exact||"user"===s.ideal||"environment"===s.ideal)&&(!n.mediaDevices.getSupportedConstraints||!n.mediaDevices.getSupportedConstraints().facingMode||u))if(delete e.video.facingMode,"environment"===s.exact||"environment"===s.ideal?c=["back","rear"]:"user"!==s.exact&&"user"!==s.ideal||(c=["front"]),c)return n.mediaDevices.enumerateDevices().then(function(t){var n=(t=t.filter(function(e){return"videoinput"===e.kind})).find(function(e){return c.some(function(t){return-1!==e.label.toLowerCase().indexOf(t)})});return!n&&t.length&&-1!==c.indexOf("back")&&(n=t[t.length-1]),n&&(e.video.deviceId=s.exact?{exact:n.deviceId}:{ideal:n.deviceId}),e.video=o(e.video),i("chrome: "+JSON.stringify(e)),r(e)});e.video=o(e.video)}return i("chrome: "+JSON.stringify(e)),r(e)},s=function(e){return{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[e.name]||e.name,message:e.message,constraint:e.constraintName,toString:function(){return this.name+(this.message&&": ")+this.message}}};n.getUserMedia=function(e,t,r){a(e,function(e){n.webkitGetUserMedia(e,t,function(e){r&&r(s(e))})})};var c=function(e){return new Promise(function(t,r){n.getUserMedia(e,t,r)})};if(n.mediaDevices||(n.mediaDevices={getUserMedia:c,enumerateDevices:function(){return new Promise(function(t){var n={audio:"audioinput",video:"videoinput"};return e.MediaStreamTrack.getSources(function(e){t(e.map(function(e){return{label:e.label,kind:n[e.kind],deviceId:e.id,groupId:""}}))})})},getSupportedConstraints:function(){return{deviceId:!0,echoCancellation:!0,facingMode:!0,frameRate:!0,height:!0,width:!0}}}),n.mediaDevices.getUserMedia){var u=n.mediaDevices.getUserMedia.bind(n.mediaDevices);n.mediaDevices.getUserMedia=function(e){return a(e,function(e){return u(e).then(function(t){if(e.audio&&!t.getAudioTracks().length||e.video&&!t.getVideoTracks().length)throw t.getTracks().forEach(function(e){e.stop()}),new DOMException("","NotFoundError");return t},function(e){return Promise.reject(s(e))})})}}else n.mediaDevices.getUserMedia=function(e){return c(e)};void 0===n.mediaDevices.addEventListener&&(n.mediaDevices.addEventListener=function(){i("Dummy mediaDevices.addEventListener called.")}),void 0===n.mediaDevices.removeEventListener&&(n.mediaDevices.removeEventListener=function(){i("Dummy mediaDevices.removeEventListener called.")})}},function(e,t,n){"use strict";var r=n(29),i=r.log;e.exports={shimGetUserMedia:n(155),shimMediaStream:function(e){e.MediaStream=e.MediaStream||e.webkitMediaStream},shimOnTrack:function(e){if("object"!=typeof e||!e.RTCPeerConnection||"ontrack"in e.RTCPeerConnection.prototype)"RTCRtpTransceiver"in e||r.wrapPeerConnectionEvent(e,"track",function(e){return e.transceiver||(e.transceiver={receiver:e.receiver}),e});else{Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get:function(){return this._ontrack},set:function(e){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=e)}});var t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){var n=this;return n._ontrackpoly||(n._ontrackpoly=function(t){t.stream.addEventListener("addtrack",function(r){var i;i=e.RTCPeerConnection.prototype.getReceivers?n.getReceivers().find(function(e){return e.track&&e.track.id===r.track.id}):{track:r.track};var o=new Event("track");o.track=r.track,o.receiver=i,o.transceiver={receiver:i},o.streams=[t.stream],n.dispatchEvent(o)}),t.stream.getTracks().forEach(function(r){var i;i=e.RTCPeerConnection.prototype.getReceivers?n.getReceivers().find(function(e){return e.track&&e.track.id===r.id}):{track:r};var o=new Event("track");o.track=r,o.receiver=i,o.transceiver={receiver:i},o.streams=[t.stream],n.dispatchEvent(o)})},n.addEventListener("addstream",n._ontrackpoly)),t.apply(n,arguments)}}},shimGetSendersWithDtmf:function(e){if("object"==typeof e&&e.RTCPeerConnection&&!("getSenders"in e.RTCPeerConnection.prototype)&&"createDTMFSender"in e.RTCPeerConnection.prototype){var t=function(e,t){return{track:t,get dtmf(){return void 0===this._dtmf&&("audio"===t.kind?this._dtmf=e.createDTMFSender(t):this._dtmf=null),this._dtmf},_pc:e}};if(!e.RTCPeerConnection.prototype.getSenders){e.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};var n=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,r){var i=n.apply(this,arguments);return i||(i=t(this,e),this._senders.push(i)),i};var r=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){r.apply(this,arguments);var t=this._senders.indexOf(e);-1!==t&&this._senders.splice(t,1)}}var i=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){var n=this;n._senders=n._senders||[],i.apply(n,[e]),e.getTracks().forEach(function(e){n._senders.push(t(n,e))})};var o=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;t._senders=t._senders||[],o.apply(t,[e]),e.getTracks().forEach(function(e){var n=t._senders.find(function(t){return t.track===e});n&&t._senders.splice(t._senders.indexOf(n),1)})}}else if("object"==typeof e&&e.RTCPeerConnection&&"getSenders"in e.RTCPeerConnection.prototype&&"createDTMFSender"in e.RTCPeerConnection.prototype&&e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)){var a=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){var e=this,t=a.apply(e,[]);return t.forEach(function(t){t._pc=e}),t},Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get:function(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}},shimSourceObject:function(e){var t=e&&e.URL;"object"==typeof e&&(!e.HTMLMediaElement||"srcObject"in e.HTMLMediaElement.prototype||Object.defineProperty(e.HTMLMediaElement.prototype,"srcObject",{get:function(){return this._srcObject},set:function(e){var n=this;this._srcObject=e,this.src&&t.revokeObjectURL(this.src),e?(this.src=t.createObjectURL(e),e.addEventListener("addtrack",function(){n.src&&t.revokeObjectURL(n.src),n.src=t.createObjectURL(e)}),e.addEventListener("removetrack",function(){n.src&&t.revokeObjectURL(n.src),n.src=t.createObjectURL(e)})):this.src=""}}))},shimAddTrackRemoveTrackWithNative:function(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){var e=this;return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(function(t){return e._shimmedLocalStreams[t][0]})};var t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,n){if(!n)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};var r=t.apply(this,arguments);return this._shimmedLocalStreams[n.id]?-1===this._shimmedLocalStreams[n.id].indexOf(r)&&this._shimmedLocalStreams[n.id].push(r):this._shimmedLocalStreams[n.id]=[n,r],r};var n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){var t=this;this._shimmedLocalStreams=this._shimmedLocalStreams||{},e.getTracks().forEach(function(e){if(t.getSenders().find(function(t){return t.track===e}))throw new DOMException("Track already exists.","InvalidAccessError")});var r=t.getSenders();n.apply(this,arguments);var i=t.getSenders().filter(function(e){return-1===r.indexOf(e)});this._shimmedLocalStreams[e.id]=[e].concat(i)};var r=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],r.apply(this,arguments)};var i=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){var t=this;return this._shimmedLocalStreams=this._shimmedLocalStreams||{},e&&Object.keys(this._shimmedLocalStreams).forEach(function(n){var r=t._shimmedLocalStreams[n].indexOf(e);-1!==r&&t._shimmedLocalStreams[n].splice(r,1),1===t._shimmedLocalStreams[n].length&&delete t._shimmedLocalStreams[n]}),i.apply(this,arguments)}},shimAddTrackRemoveTrack:function(e){var t=r.detectBrowser(e);if(e.RTCPeerConnection.prototype.addTrack&&t.version>=65)return this.shimAddTrackRemoveTrackWithNative(e);var n=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){var e=this,t=n.apply(this);return e._reverseStreams=e._reverseStreams||{},t.map(function(t){return e._reverseStreams[t.id]})};var i=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){var n=this;if(n._streams=n._streams||{},n._reverseStreams=n._reverseStreams||{},t.getTracks().forEach(function(e){if(n.getSenders().find(function(t){return t.track===e}))throw new DOMException("Track already exists.","InvalidAccessError")}),!n._reverseStreams[t.id]){var r=new e.MediaStream(t.getTracks());n._streams[t.id]=r,n._reverseStreams[r.id]=t,t=r}i.apply(n,[t])};var o=e.RTCPeerConnection.prototype.removeStream;function a(e,t){var n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach(function(t){var r=e._reverseStreams[t],i=e._streams[r.id];n=n.replace(new RegExp(i.id,"g"),r.id)}),new RTCSessionDescription({type:t.type,sdp:n})}e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;t._streams=t._streams||{},t._reverseStreams=t._reverseStreams||{},o.apply(t,[t._streams[e.id]||e]),delete t._reverseStreams[t._streams[e.id]?t._streams[e.id].id:e.id],delete t._streams[e.id]},e.RTCPeerConnection.prototype.addTrack=function(t,n){var r=this;if("closed"===r.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");var i=[].slice.call(arguments,1);if(1!==i.length||!i[0].getTracks().find(function(e){return e===t}))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(r.getSenders().find(function(e){return e.track===t}))throw new DOMException("Track already exists.","InvalidAccessError");r._streams=r._streams||{},r._reverseStreams=r._reverseStreams||{};var o=r._streams[n.id];if(o)o.addTrack(t),Promise.resolve().then(function(){r.dispatchEvent(new Event("negotiationneeded"))});else{var a=new e.MediaStream([t]);r._streams[n.id]=a,r._reverseStreams[a.id]=n,r.addStream(a)}return r.getSenders().find(function(e){return e.track===t})},["createOffer","createAnswer"].forEach(function(t){var n=e.RTCPeerConnection.prototype[t];e.RTCPeerConnection.prototype[t]=function(){var e=this,t=arguments;return arguments.length&&"function"==typeof arguments[0]?n.apply(e,[function(n){var r=a(e,n);t[0].apply(null,[r])},function(e){t[1]&&t[1].apply(null,e)},arguments[2]]):n.apply(e,arguments).then(function(t){return a(e,t)})}});var s=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=function(e,t){var n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach(function(t){var r=e._reverseStreams[t],i=e._streams[r.id];n=n.replace(new RegExp(r.id,"g"),i.id)}),new RTCSessionDescription({type:t.type,sdp:n})}(this,arguments[0]),s.apply(this,arguments)):s.apply(this,arguments)};var c=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get:function(){var e=c.get.apply(this);return""===e.type?e:a(this,e)}}),e.RTCPeerConnection.prototype.removeTrack=function(e){var t,n=this;if("closed"===n.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!e._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(e._pc===n))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");n._streams=n._streams||{},Object.keys(n._streams).forEach(function(r){n._streams[r].getTracks().find(function(t){return e.track===t})&&(t=n._streams[r])}),t&&(1===t.getTracks().length?n.removeStream(n._reverseStreams[t.id]):t.removeTrack(e.track),n.dispatchEvent(new Event("negotiationneeded")))}},shimPeerConnection:function(e){var t=r.detectBrowser(e);if(!e.RTCPeerConnection&&e.webkitRTCPeerConnection)e.RTCPeerConnection=function(t,n){return i("PeerConnection"),t&&t.iceTransportPolicy&&(t.iceTransports=t.iceTransportPolicy),new e.webkitRTCPeerConnection(t,n)},e.RTCPeerConnection.prototype=e.webkitRTCPeerConnection.prototype,e.webkitRTCPeerConnection.generateCertificate&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:function(){return e.webkitRTCPeerConnection.generateCertificate}});else{var n=e.RTCPeerConnection;e.RTCPeerConnection=function(e,t){if(e&&e.iceServers){for(var i=[],o=0;o<e.iceServers.length;o++){var a=e.iceServers[o];!a.hasOwnProperty("urls")&&a.hasOwnProperty("url")?(r.deprecated("RTCIceServer.url","RTCIceServer.urls"),(a=JSON.parse(JSON.stringify(a))).urls=a.url,i.push(a)):i.push(e.iceServers[o])}e.iceServers=i}return new n(e,t)},e.RTCPeerConnection.prototype=n.prototype,Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:function(){return n.generateCertificate}})}var o=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(e,t,n){var r=this,i=arguments;if(arguments.length>0&&"function"==typeof e)return o.apply(this,arguments);if(0===o.length&&(0===arguments.length||"function"!=typeof arguments[0]))return o.apply(this,[]);var a=function(e){var t={};return e.result().forEach(function(e){var n={id:e.id,timestamp:e.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type};e.names().forEach(function(t){n[t]=e.stat(t)}),t[n.id]=n}),t},s=function(e){return new Map(Object.keys(e).map(function(t){return[t,e[t]]}))};if(arguments.length>=2){return o.apply(this,[function(e){i[1](s(a(e)))},arguments[0]])}return new Promise(function(e,t){o.apply(r,[function(t){e(s(a(t)))},t])}).then(t,n)},t.version<51&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(t){var n=e.RTCPeerConnection.prototype[t];e.RTCPeerConnection.prototype[t]=function(){var e=arguments,t=this,r=new Promise(function(r,i){n.apply(t,[e[0],r,i])});return e.length<2?r:r.then(function(){e[1].apply(null,[])},function(t){e.length>=3&&e[2].apply(null,[t])})}}),t.version<52&&["createOffer","createAnswer"].forEach(function(t){var n=e.RTCPeerConnection.prototype[t];e.RTCPeerConnection.prototype[t]=function(){var e=this;if(arguments.length<1||1===arguments.length&&"object"==typeof arguments[0]){var t=1===arguments.length?arguments[0]:void 0;return new Promise(function(r,i){n.apply(e,[r,i,t])})}return n.apply(this,arguments)}}),["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(t){var n=e.RTCPeerConnection.prototype[t];e.RTCPeerConnection.prototype[t]=function(){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}});var a=e.RTCPeerConnection.prototype.addIceCandidate;e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?a.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())}}}},function(e,t,n){"use strict";var r=n(29);e.exports=function(e,t){var i=e&&e.window,o={shimChrome:!0,shimFirefox:!0,shimEdge:!0,shimSafari:!0};for(var a in t)hasOwnProperty.call(t,a)&&(o[a]=t[a]);var s=r.log,c=r.detectBrowser(i),u=n(156)||null,f=n(154)||null,d=n(151)||null,l=n(149)||null,p=n(148)||null,h={browserDetails:c,commonShim:p,extractVersion:r.extractVersion,disableLog:r.disableLog,disableWarnings:r.disableWarnings};switch(c.browser){case"chrome":if(!u||!u.shimPeerConnection||!o.shimChrome)return s("Chrome shim is not included in this adapter release."),h;s("adapter.js shimming chrome."),h.browserShim=u,p.shimCreateObjectURL(i),u.shimGetUserMedia(i),u.shimMediaStream(i),u.shimSourceObject(i),u.shimPeerConnection(i),u.shimOnTrack(i),u.shimAddTrackRemoveTrack(i),u.shimGetSendersWithDtmf(i),p.shimRTCIceCandidate(i),p.shimMaxMessageSize(i),p.shimSendThrowTypeError(i);break;case"firefox":if(!d||!d.shimPeerConnection||!o.shimFirefox)return s("Firefox shim is not included in this adapter release."),h;s("adapter.js shimming firefox."),h.browserShim=d,p.shimCreateObjectURL(i),d.shimGetUserMedia(i),d.shimSourceObject(i),d.shimPeerConnection(i),d.shimOnTrack(i),d.shimRemoveStream(i),p.shimRTCIceCandidate(i),p.shimMaxMessageSize(i),p.shimSendThrowTypeError(i);break;case"edge":if(!f||!f.shimPeerConnection||!o.shimEdge)return s("MS edge shim is not included in this adapter release."),h;s("adapter.js shimming edge."),h.browserShim=f,p.shimCreateObjectURL(i),f.shimGetUserMedia(i),f.shimPeerConnection(i),f.shimReplaceTrack(i),p.shimMaxMessageSize(i),p.shimSendThrowTypeError(i);break;case"safari":if(!l||!o.shimSafari)return s("Safari shim is not included in this adapter release."),h;s("adapter.js shimming safari."),h.browserShim=l,p.shimCreateObjectURL(i),l.shimRTCIceServerUrls(i),l.shimCallbacksAPI(i),l.shimLocalStreamsAPI(i),l.shimRemoteStreamsAPI(i),l.shimTrackEventTransceiver(i),l.shimGetUserMedia(i),l.shimCreateOfferLegacy(i),p.shimRTCIceCandidate(i),p.shimMaxMessageSize(i),p.shimSendThrowTypeError(i);break;default:s("Unsupported browser!")}return h}},function(e,t,n){"use strict";(function(t){var r=n(157);e.exports=r({window:t.window})}).call(this,n(67))},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}var s=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(a,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),n(158);var c,u,f=n(69),d=n(147),l=n(145),p=n(140),h=n(68),v=n(49),m=n(44),g=n(43);(u=c=t.RoomState||(t.RoomState={}))[u.Idle=0]="Idle",u[u.Connecting=1]="Connecting",u[u.Connected=2]="Connected",u[u.Reconnecting=3]="Reconnecting";var y=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this))).handleLocalICECandidate=function(t,n){return function(r){if(r.candidate){if(!e.signaling)throw g.UNEXPECTED_ERROR("no signaling model");e.signaling.sendWsMsg("webrtc-candidate",{streamid:t,connid:n||"",candidate:JSON.stringify(r.candidate)})}}},e.streamInfo=[],e.users=[],e.subscribedUsers={},e._roomState=c.Idle,e}var n,r,u;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,f),n=t,(r=[{key:"joinRoomWithToken",value:function(e){return s(this,void 0,void 0,regeneratorRuntime.mark(function t(){var n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(this.roomState===c.Idle){t.next=2;break}throw g.UNEXPECTED_ERROR("roomState is not idle! Do not repeat join room, please run leaveRoom first");case 2:if(this.roomState=c.Connecting,n=m.getRoomAccessFromToken(e),this.userId=n.userId,this.roomName=n.roomName,v.log.log("join room, token:",e),v.log.debug("join room, roomName: ".concat(this.roomName,", userId: ").concat(this.userId)),this.roomName.match(/^[a-zA-Z0-9_-]{3,64}$/)){t.next=6;break}throw this.roomState=c.Idle,g.UNEXPECTED_ERROR("invalid roomname. roomname must match /^[a-zA-Z0-9_-]{3,64}$/");case 6:if(this.userId.match(/^[a-zA-Z0-9_-]{3,50}$/)){t.next=8;break}throw this.roomState=c.Idle,g.UNEXPECTED_ERROR("invalid userId. userId must match /^[a-zA-Z0-9_-]{3,50}$/");case 8:return t.next=10,l.getAccessToken(n,e);case 10:return this.accessToken=t.sent,t.next=13,this.joinRoomWithAccess(this.accessToken);case 13:return t.abrupt("return",t.sent);case 14:case"end":return t.stop()}},t,this)}))}},{key:"joinRoomWithAccess",value:function(e){return s(this,void 0,void 0,regeneratorRuntime.mark(function t(){var n,r,i=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=m.getPayloadFromJwt(e),this.signaling=new p.SignalingWS(n.signalingurl,e),this.signaling.on("on-player-in",this.handlePlayerIn.bind(this)),this.signaling.on("on-player-out",this.handlePlayerOut.bind(this)),this.signaling.on("on-add-stream",this.handleAddStream.bind(this)),this.signaling.on("on-remove-stream",this.handleRemoveStream.bind(this)),this.signaling.on("webrtc-candidate",this.handleIceCandidate.bind(this)),this.signaling.on("disconnect",this.handleDisconnect.bind(this)),this.signaling.on("mute-stream",this.handleMute.bind(this)),this.signaling.on("ws-disconnect",this.reconnect.bind(this)),v.log.log("init signaling websocket"),this.signaling.initWs(),t.next=4,new Promise(function(e,t){i.signaling.once("auth-res",function(n){var r=n;r.error&&(i.roomState=c.Idle,t(g.JOIN_ROOM_ERROR(r.code,r.error))),e(r)})});case 4:return r=t.sent,t.abrupt("return",(this.handleAuth(r),this.roomState=c.Connected,this.users));case 6:case"end":return t.stop()}},t,this)}))}},{key:"publish",value:function(e,t){return s(this,void 0,void 0,regeneratorRuntime.mark(function n(){var r,i,o;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(this.roomState===c.Connected){n.next=2;break}throw g.UNEXPECTED_ERROR("not connected to the room, please run joinRoom first");case 2:return r=this.signaling,v.log.debug("start publish",e),n.next=6,m.sendMsgWaitResponse(r,"pub",{"enable-audio":e.enableAudio,"enable-video":e.enableVideo,streamid:t},"pub-res");case 6:if(!(i=n.sent).error){n.next=9;break}throw g.PUBLISH_ERROR(i.code,i.error);case 9:return e.userId=this.userId,e.streamId=i.streamid,this.stream=e,n.next=14,this.createLocalConnection(e);case 14:return o=m.getElementFromArray(this.users,"userId",this.stream.userId),n.abrupt("return",(o&&(o.published=!0,o.stream=this.stream),this.stream));case 16:case"end":return n.stop()}},n,this)}))}},{key:"unpublish",value:function(){return s(this,void 0,void 0,regeneratorRuntime.mark(function e(){var t,n,r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.roomState===c.Connected&&this.stream){e.next=2;break}throw g.UNEXPECTED_ERROR("can not find publish stream, please run publish first");case 2:return v.log.debug("unpublish"),t=this.stream.streamId,e.next=6,m.sendMsgWaitResponse(this.signaling,"unpub",{streamid:t},"unpub-res");case 6:if(!(n=e.sent).error){e.next=9;break}throw g.UNPUBLISH_ERROR(n.code,n.error);case 9:(r=m.getElementFromArray(this.users,"userId",this.stream.userId))&&(r.published=!1,r.stream=void 0),this.stream.release(),this.stream=void 0;case 11:case"end":return e.stop()}},e,this)}))}},{key:"subscribe",value:function(e,t){return s(this,void 0,void 0,regeneratorRuntime.mark(function n(){var r,i,o,a,s;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(this.roomState===c.Connected){n.next=2;break}throw g.UNEXPECTED_ERROR("can not connected to the room, please joinRoom first");case 2:if(e!==this.userId){n.next=4;break}throw g.SUB_ERROR(10044,"can not subscribe yourself");case 4:if(r=m.getElementFromArray(this.streamInfo,"playerid",e),i=m.getElementFromArray(this.users,"userId",e),r&&i){n.next=7;break}throw g.SUB_ERROR_NO_STREAM(e);case 7:return o=r.streamid,v.log.debug("subscribe",e),n.next=11,m.sendMsgWaitResponse(this.signaling,"sub",{streamid:o,connid:t},"sub-res-".concat(o));case 11:if(!(a=n.sent).error){n.next=14;break}throw g.SUB_ERROR(a.code,a.error);case 14:return this.connid=a.connid,t?((s=m.getElementFromObject(this.subscribedUsers,"connId",t))&&s.key===e||(this.subscribedUsers[e]=new h.Stream(void 0,o,e)),this.subscribedUsers[e].connId=this.connid):(this.subscribedUsers[e]=new h.Stream(void 0,o,e),this.subscribedUsers[e].connId=this.connid),n.next=17,this.createRemoteConnection(e);case 17:return i.stream=this.subscribedUsers[e],this.subscribedUsers[e].setMute(r["mute-audio"],r["mute-video"]),this.subscribedUsers[e].setEnable(r["enable-audio"],r["enable-video"]),n.abrupt("return",this.subscribedUsers[e]);case 21:case"end":return n.stop()}},n,this)}))}},{key:"unsubscribe",value:function(e){return s(this,void 0,void 0,regeneratorRuntime.mark(function t(){var n,r,i,o;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if((n=this.subscribedUsers[e])&&this.roomState===c.Connected){t.next=3;break}return t.abrupt("return",void v.log.warning(g.UNEXPECTED_ERROR("can not find connid or can not connected to the room, please run subscribe first")));case 3:return r=n.streamId,v.log.debug("unsubscribe"),t.next=7,m.sendMsgWaitResponse(this.signaling,"unsub",{streamid:r,connid:n.connId},"unsub-res-".concat(r));case 7:if(!(i=t.sent).error){t.next=10;break}throw g.UNSUB_ERROR(i.code,i.error);case 10:(o=m.getElementFromArray(this.users,"userId",e))&&(o.stream=void 0),delete this.subscribedUsers[e];case 12:case"end":return t.stop()}},t,this)}))}},{key:"mute",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.roomState!==c.Connected||!this.stream)throw g.UNEXPECTED_ERROR("no strem or signaling model, please run publish first");v.log.log("muteAudio",e,"muteVideo",t),this.stream.setMute(e,t),this.signaling.sendWsMsg("mute-stream",{streamid:this.stream.streamId,"mute-audio":e,"mute-video":t})}},{key:"kickoutUser",value:function(e){return s(this,void 0,void 0,regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return v.log.log("kickoutUser",e),t.next=3,this.control("kickplayer",e);case 3:case"end":return t.stop()}},t,this)}))}},{key:"leaveRoom",value:function(){if(this.roomState!==c.Connected)throw g.UNEXPECTED_ERROR("can not connected to the room, please run joinRoom first");v.log.log("leave room"),this.signaling.sendWsMsg("disconnect",{}),this.releaseRoom()}},{key:"createRemoteConnection",value:function(e){return s(this,void 0,void 0,regeneratorRuntime.mark(function t(){var n,r,o,a,s,u,f,d=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(this.roomState===c.Connected){t.next=2;break}throw g.UNEXPECTED_ERROR("can not connected to the room, please run joinRoom first");case 2:if(n=new RTCPeerConnection({iceServers:[{urls:this.stunAddr}],iceTransportPolicy:"all"}),(r=this.subscribedUsers[e]).streamId){t.next=5;break}throw g.UNEXPECTED_ERROR("no streamId");case 5:return n.onicecandidate=this.handleLocalICECandidate(r.streamId,r.connId).bind(this),o=new Promise(function(e){n.ontrack=function(t){e(t.streams[0])}}),a=new Promise(function(t,n){if(!d.signaling)throw g.UNEXPECTED_ERROR("no signaling model");d.signaling.once("webrtc-icestate-connid-".concat(r.connId),function(r){r.connected?(v.log.debug("ice: success.","subscribe",e),t(r.connected)):n(g.SUB_ICE_ERROR)})}),t.prev=7,t.next=10,m.createP2PConnection(n,this.signaling,{stream:r,connid:r.connId});case 10:t.next=15;break;case 12:throw t.prev=12,t.t0=t.catch(7),t.t0.code?t.t0:g.SUB_P2P_ERROR(t.t0.message);case 15:return t.next=17,Promise.all([o,a]);case 17:return s=t.sent,u=i(s,2),f=u[0],u[1],t.next=23,r.setMediaStream(f);case 23:case"end":return t.stop()}},t,this,[[7,12]])}))}},{key:"createLocalConnection",value:function(e){return s(this,void 0,void 0,regeneratorRuntime.mark(function t(){var n,r,i=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(this.stream&&this.roomState===c.Connected){t.next=2;break}throw g.UNEXPECTED_ERROR("no stream or not connected to the room, please run publish first");case 2:return e.setSession(this),this.localRTCPeerConnection=new RTCPeerConnection({iceServers:[{urls:this.stunAddr}],iceTransportPolicy:"all"}),(n=this.localRTCPeerConnection).onicecandidate=this.handleLocalICECandidate(this.stream.streamId).bind(this),n.onconnectionstatechange=function(){return s(i,void 0,void 0,regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(t.t0=this.localRTCPeerConnection&&"disconnected"===this.localRTCPeerConnection.connectionState,!t.t0){t.next=4;break}return t.next=4,this.createLocalConnection(e);case 4:case"end":return t.stop()}},t,this)}))},r=new Promise(function(t,n){var r=i.localRTCPeerConnection;r.oniceconnectionstatechange=function(){"connected"===r.iceConnectionState&&(v.log.debug("ice: success.","publish",e.userId),t(!0)),"failed"===r.iceConnectionState&&n("ice connection failed")}}),t.prev=6,t.next=9,m.createP2PConnection(n,this.signaling,{stream:this.stream,connid:""});case 9:t.next=14;break;case 11:throw t.prev=11,t.t0=t.catch(6),t.t0.code?t.t0:g.PUB_P2P_ERROR(t.t0.message);case 14:return t.next=16,r;case 16:if(t.sent){t.next=18;break}throw g.PUBLISH_ICE_ERROR;case 18:case"end":return t.stop()}},t,this,[[6,11]])}))}},{key:"control",value:function(e,t){return s(this,void 0,void 0,regeneratorRuntime.mark(function n(){var r;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(this.roomState===c.Connected){n.next=2;break}throw g.UNEXPECTED_ERROR("can not connected to the room, please run joinRoom first");case 2:return n.next=4,m.sendMsgWaitResponse(this.signaling,"control",{command:e,playerid:t},"control-res-".concat(e,"-").concat(t));case 4:if(!(r=n.sent).error){n.next=7;break}throw g.CONTROL_ERROR(r.code,r.error);case 7:case"end":return n.stop()}},n,this)}))}},{key:"handleIceCandidate",value:function(e){return s(this,void 0,void 0,regeneratorRuntime.mark(function t(){var n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(v.log.log("ice: get remote candidate",e),!e.connid){t.next=8;break}if(n=m.getElementFromObject(this.subscribedUsers,"connId",e.connid),t.t0=n,!t.t0){t.next=6;break}return t.next=6,n.obj.getPeerConnection().addIceCandidate(JSON.parse(e.candidate));case 6:t.next=10;break;case 8:return t.next=10,this.localRTCPeerConnection.addIceCandidate(JSON.parse(e.candidate));case 10:case"end":return t.stop()}},t,this)}))}},{key:"handlePlayerOut",value:function(e){var t=m.removeElementFromArray(this.users,"userId",e.playerid);this.users=t.newArray,t.removeElement&&(this.subscribedUsers[e.playerid]&&(this.subscribedUsers[e.playerid].release(),delete this.subscribedUsers[e.playerid]),v.log.debug("user-leave",t.removeElement),this.emit("user-leave",t.removeElement))}},{key:"handlePlayerIn",value:function(e){var t=m.transferSignalingUserToUser(e);this.users.push(t),this.users=d(this.users,"userId"),v.log.debug("user-join",t),this.emit("user-join",t)}},{key:"handleAddStream",value:function(e){var t=this,n=Object.assign({},e,{"mute-audio":!1,"mute-video":!1});this.streamInfo.push(n),this.streamInfo=d(this.streamInfo,"streamid");var r=m.getElementFromArray(this.users,"userId",n.playerid);for(var i in r&&(r.published=!0,v.log.debug("user-publish",r),this.emit("user-publish",r)),this.subscribedUsers){var o=this.subscribedUsers[i];if(o.userId===e.playerid&&e.streamid!==o.streamId)return void this.subscribe(o.userId,o.connId).then().catch(function(e){t.emit("error",e)})}}},{key:"handleRemoveStream",value:function(e){var t=m.removeElementFromArray(this.streamInfo,"streamid",e.streamid);this.streamInfo=t.newArray;var n=m.getElementFromArray(this.users,"userId",t.removeElement.playerid);n&&(this.subscribedUsers[n.userId]&&(this.subscribedUsers[n.userId].release(),delete this.subscribedUsers[n.userId]),n.published=!1,n.stream=void 0,v.log.debug("user-unpublish",n),this.emit("user-unpublish",n))}},{key:"handleMute",value:function(e){var t={userId:e.playerid,streamId:e.streamid,muteAudio:e["mute-audio"],muteVideo:e["mute-video"]},n=m.getElementFromArray(this.streamInfo,"streamid",e.streamid),r=m.getElementFromArray(this.subscriptionArray,"userId",e.playerid);n&&(n["mute-audio"]=t.muteAudio,n["mute-video"]=t.muteVideo),r&&r.setMute(t.muteAudio,t.muteVideo),v.log.log("user-mute",t),this.emit("mute",t)}},{key:"handleDisconnect",value:function(e){switch(this.emit("disconnect"),e.code){case 10006:this.emit("kicked",e.kickedid)}this.releaseRoom()}},{key:"handleAuth",value:function(e){var t=this;this.reconntoken=e.reconntoken,this.streamInfo=e.streams||[],this.users=e.players.map(function(e){var n=m.getElementFromArray(t.streamInfo,"playerid",e.playerid),r=m.transferSignalingUserToUser(e);return n&&(r.published=!0),r})||[],this.stunAddr=e["stun-server-addr"]}},{key:"reconnect",value:function(){var e=this;if(this.roomState===c.Connected||this.roomState===c.Reconnecting){this.roomState=c.Reconnecting;var t=this.signaling;t.reconnect(this.reconntoken),t.removeAllListeners("auth-res"),t.once("auth-res",function(t){if(t.error)e.joinRoomWithAccess(e.accessToken).then().catch(function(t){e.emit("error",t)});else{e.handleAuth(t),e.roomState=c.Connected;var n=t["my-pubs"],r=t["my-subs"];for(var i in!m.checkPcConnect(e.localRTCPeerConnection)&&e.stream&&(n&&n.length>0?e.publish(e.stream,n[0].streamid).then().catch(function(t){e.emit("error",t)}):e.publish(e.stream).then().catch(function(t){e.emit("error",t)})),e.subscribedUsers){var o=e.subscribedUsers[i];if(!m.checkPcConnect(o.getPeerConnection())&&o.userId){var a=m.getElementFromArray(r||[],"connid",o.connId);a?(o.streamId=a.streamid,e.subscribe(o.userId,a.connid).then().catch(function(t){e.emit("error",t)})):e.subscribe(o.userId).then().catch(function(t){e.emit("error",t)})}else e.unsubscribe(i)}}})}}},{key:"releaseRoom",value:function(){for(var e in this.signaling&&(this.signaling.release(),this.signaling=void 0),this.roomState=c.Idle,this.streamInfo=[],this.users=[],this.stream&&!this.stream.isDestroyed&&this.stream.release(),this.stream=void 0,this.connid=void 0,this.userId=void 0,this.subscribedUsers)this.subscribedUsers[e].release();this.subscribedUsers={}}},{key:"subscriptionArray",get:function(){var e=this;return Object.keys(this.subscribedUsers).map(function(t){return e.subscribedUsers[t]})}},{key:"roomState",get:function(){return this._roomState},set:function(e){this._roomState!==e&&(this._roomState=e,v.log.debug("roomState change",this._roomState),this.emit("room-state-change",this._roomState))}}])&&o(n.prototype,r),u&&o(n,u),t}();t.QNRTCSession=y},function(e,t,n){"use strict";window.getStats=function(e,t,n){var r=window.RTCPeerConnection||window.mozRTCPeerConnection||window.webkitRTCPeerConnection;"undefined"==typeof MediaStreamTrack&&(MediaStreamTrack={});var i={encryption:"sha-256",audio:{send:{tracks:[],codecs:[],availableBandwidth:0,streams:0},recv:{tracks:[],codecs:[],availableBandwidth:0,streams:0},bytesSent:0,bytesReceived:0},video:{send:{tracks:[],codecs:[],availableBandwidth:0,streams:0},recv:{tracks:[],codecs:[],availableBandwidth:0,streams:0},bytesSent:0,bytesReceived:0},bandwidth:{systemBandwidth:0,sentPerSecond:0,encodedPerSecond:0,helper:{audioBytesSent:0,videoBytestSent:0},speed:0},results:{},connectionType:{systemNetworkType:((navigator.connection||{}).type||"unknown").toString().toLowerCase(),systemIpAddress:"192.168.1.2",local:{candidateType:[],transport:[],ipAddress:[],networkType:[]},remote:{candidateType:[],transport:[],ipAddress:[],networkType:[]}},resolutions:{send:{width:0,height:0},recv:{width:0,height:0}},internal:{audio:{send:{},recv:{}},video:{send:{},recv:{}},candidates:{}},nomore:function(){s=!0}},o={checkIfOfferer:function(e){"googLibjingleSession"===e.type&&(i.isOfferer=e.googInitiator)}},a=this;if(arguments[0]instanceof r){if(a=arguments[0],navigator.mozGetUserMedia&&(e=arguments[1],t=arguments[2],n=arguments[3]),!(e instanceof MediaStreamTrack)&&navigator.mozGetUserMedia)throw"2nd argument is not instance of MediaStreamTrack."}else if(!(e instanceof MediaStreamTrack)&&navigator.mozGetUserMedia)throw"1st argument is not instance of MediaStreamTrack.";var s=!1;o.datachannel=function(e){"datachannel"===e.type&&(i.datachannel={state:e.state})},o.googCertificate=function(e){"googCertificate"==e.type&&(i.encryption=e.googFingerprintAlgorithm)};var c=["opus","isac","ilbc"];o.checkAudioTracks=function(e){if(e.googCodecName&&"audio"===e.mediaType&&-1!==c.indexOf(e.googCodecName.toLowerCase())){var t=e.id.split("_").pop();if(-1===i.audio[t].codecs.indexOf(e.googCodecName)&&i.audio[t].codecs.push(e.googCodecName),e.bytesSent){var n=0;if(e.bytesSent){i.internal.audio[t].prevBytesSent||(i.internal.audio[t].prevBytesSent=e.bytesSent);var r=e.bytesSent-i.internal.audio[t].prevBytesSent;i.internal.audio[t].prevBytesSent=e.bytesSent,n=r/1024}i.audio[t].availableBandwidth=n.toFixed(1)}if(e.bytesReceived){n=0;if(e.bytesReceived){i.internal.audio[t].prevBytesReceived||(i.internal.audio[t].prevBytesReceived=e.bytesReceived);r=e.bytesReceived-i.internal.audio[t].prevBytesReceived;i.internal.audio[t].prevBytesReceived=e.bytesReceived,n=r/1024}i.audio[t].availableBandwidth=n.toFixed(1)}-1===i.audio[t].tracks.indexOf(e.googTrackId)&&i.audio[t].tracks.push(e.googTrackId)}};var u=["vp9","vp8","h264"];o.checkVideoTracks=function(e){if(e.googCodecName&&"video"===e.mediaType&&-1!==u.indexOf(e.googCodecName.toLowerCase())){var t=e.id.split("_").pop();if(-1===i.video[t].codecs.indexOf(e.googCodecName)&&i.video[t].codecs.push(e.googCodecName),e.bytesSent){var n=0;i.internal.video[t].prevBytesSent||(i.internal.video[t].prevBytesSent=e.bytesSent);var r=e.bytesSent-i.internal.video[t].prevBytesSent;i.internal.video[t].prevBytesSent=e.bytesSent,n=r/1024}if(e.bytesReceived){n=0;i.internal.video[t].prevBytesReceived||(i.internal.video[t].prevBytesReceived=e.bytesReceived);r=e.bytesReceived-i.internal.video[t].prevBytesReceived;i.internal.video[t].prevBytesReceived=e.bytesReceived,n=r/1024}i.video[t].availableBandwidth=n.toFixed(1),e.googFrameHeightReceived&&e.googFrameWidthReceived&&(i.resolutions[t].width=e.googFrameWidthReceived,i.resolutions[t].height=e.googFrameHeightReceived),e.googFrameHeightSent&&e.googFrameWidthSent&&(i.resolutions[t].width=e.googFrameWidthSent,i.resolutions[t].height=e.googFrameHeightSent),-1===i.video[t].tracks.indexOf(e.googTrackId)&&i.video[t].tracks.push(e.googTrackId)}},o.bweforvideo=function(e){"VideoBwe"===e.type&&(i.bandwidth.availableSendBandwidth=e.googAvailableSendBandwidth,i.bandwidth.googActualEncBitrate=e.googActualEncBitrate,i.bandwidth.googAvailableSendBandwidth=e.googAvailableSendBandwidth,i.bandwidth.googAvailableReceiveBandwidth=e.googAvailableReceiveBandwidth,i.bandwidth.googRetransmitBitrate=e.googRetransmitBitrate,i.bandwidth.googTargetEncBitrate=e.googTargetEncBitrate,i.bandwidth.googBucketDelay=e.googBucketDelay,i.bandwidth.googTransmitBitrate=e.googTransmitBitrate)},o.candidatePair=function(e){if("googCandidatePair"===e.type||"candidate-pair"===e.type){if("true"==e.googActiveConnection)Object.keys(i.internal.candidates).forEach(function(t){var n=i.internal.candidates[t];-1!==n.ipAddress.indexOf(e.googLocalAddress)&&(i.connectionType.local.candidateType=n.candidateType,i.connectionType.local.ipAddress=n.ipAddress,i.connectionType.local.networkType=n.networkType,i.connectionType.local.transport=n.transport),-1!==n.ipAddress.indexOf(e.googRemoteAddress)&&(i.connectionType.remote.candidateType=n.candidateType,i.connectionType.remote.ipAddress=n.ipAddress,i.connectionType.remote.networkType=n.networkType,i.connectionType.remote.transport=n.transport)}),i.connectionType.transport=e.googTransportType,(t=i.internal.candidates[e.localCandidateId])&&t.ipAddress&&(i.connectionType.systemIpAddress=t.ipAddress),(n=i.internal.candidates[e.remoteCandidateId])&&n.ipAddress&&(i.connectionType.systemIpAddress=n.ipAddress);if("candidate-pair"===e.type&&!0===e.selected&&!0===e.nominated&&"succeeded"===e.state)var t=i.internal.candidates[e.remoteCandidateId],n=i.internal.candidates[e.remoteCandidateId]}};var f={},d={},l={},p={};o.localcandidate=function(e){"localcandidate"!==e.type&&"local-candidate"!==e.type||e.id&&(f[e.id]||(f[e.id]=[]),d[e.id]||(d[e.id]=[]),l[e.id]||(l[e.id]=[]),p[e.id]||(p[e.id]=[]),e.candidateType&&-1===f[e.id].indexOf(e.candidateType)&&f[e.id].push(e.candidateType),e.transport&&-1===d[e.id].indexOf(e.transport)&&d[e.id].push(e.transport),e.ipAddress&&-1===l[e.id].indexOf(e.ipAddress+":"+e.portNumber)&&l[e.id].push(e.ipAddress+":"+e.portNumber),e.networkType&&-1===p[e.id].indexOf(e.networkType)&&p[e.id].push(e.networkType),i.internal.candidates[e.id]={candidateType:f[e.id],ipAddress:l[e.id],portNumber:e.portNumber,networkType:p[e.id],priority:e.priority,transport:d[e.id],timestamp:e.timestamp,id:e.id,type:e.type},i.connectionType.local.candidateType=f[e.id],i.connectionType.local.ipAddress=l[e.id],i.connectionType.local.networkType=p[e.id],i.connectionType.local.transport=d[e.id])};var h={},v={},m={},g={};o.remotecandidate=function(e){"remotecandidate"!==e.type&&"remote-candidate"!==e.type||e.id&&(h[e.id]||(h[e.id]=[]),v[e.id]||(v[e.id]=[]),m[e.id]||(m[e.id]=[]),g[e.id]||(g[e.id]=[]),e.candidateType&&-1===h[e.id].indexOf(e.candidateType)&&h[e.id].push(e.candidateType),e.transport&&-1===v[e.id].indexOf(e.transport)&&v[e.id].push(e.transport),e.ipAddress&&-1===m[e.id].indexOf(e.ipAddress+":"+e.portNumber)&&m[e.id].push(e.ipAddress+":"+e.portNumber),e.networkType&&-1===g[e.id].indexOf(e.networkType)&&g[e.id].push(e.networkType),i.internal.candidates[e.id]={candidateType:h[e.id],ipAddress:m[e.id],portNumber:e.portNumber,networkType:g[e.id],priority:e.priority,transport:v[e.id],timestamp:e.timestamp,id:e.id,type:e.type},i.connectionType.remote.candidateType=h[e.id],i.connectionType.remote.ipAddress=m[e.id],i.connectionType.remote.networkType=g[e.id],i.connectionType.remote.transport=v[e.id])},o.dataSentReceived=function(e){!e.googCodecName||"video"!==e.mediaType&&"audio"!==e.mediaType||(e.bytesSent&&(i[e.mediaType].bytesSent=parseInt(e.bytesSent)),e.bytesReceived&&(i[e.mediaType].bytesReceived=parseInt(e.bytesReceived)))};var y={audio:{send:[],recv:[]},video:{send:[],recv:[]}};o.ssrc=function(e){if(e.googCodecName&&("video"===e.mediaType||"audio"===e.mediaType)&&"ssrc"===e.type){var t=e.id.split("_").pop();-1===y[e.mediaType][t].indexOf(e.ssrc)&&y[e.mediaType][t].push(e.ssrc),i[e.mediaType][t].streams=y[e.mediaType][t].length}},function r(){var c;c=function(e){e.forEach(function(e){Object.keys(o).forEach(function(t){"function"==typeof o[t]&&o[t](e)}),"local-candidate"!==e.type&&"remote-candidate"!==e.type&&e.type});try{-1!==a.iceConnectionState.search(/failed/gi)&&(s=!0)}catch(e){s=!0}!0===s&&(i.datachannel&&(i.datachannel.state="close"),i.ended=!0),i.results=e,i.audio&&i.video&&(i.bandwidth.speed=i.audio.bytesSent-i.bandwidth.helper.audioBytesSent+(i.video.bytesSent-i.bandwidth.helper.videoBytesSent),i.bandwidth.helper.audioBytesSent=i.audio.bytesSent,i.bandwidth.helper.videoBytesSent=i.video.bytesSent),t(i),s||void 0!=typeof n&&n&&setTimeout(r,n||1e3)},void 0!==window.InstallTrigger?a.getStats(e,function(e){var t=[];e.forEach(function(e){t.push(e)}),c(t)},c):a.getStats(function(e){var t=[];e.result().forEach(function(e){var n={};e.names().forEach(function(t){n[t]=e.stat(t)}),n.id=e.id,n.type=e.type,n.timestamp=e.timestamp,t.push(n)}),c(t)})}()}},function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),n(160),r(n(159)),r(n(134)),r(n(68));var i=n(49);t.log=i.log},function(e,t){e.exports=function(e,t){var n=t===Object(t)?function(e){return t[e]}:t;return function(t){return String(t).replace(e,n)}}},function(e,t,n){var r=n(0),i=n(162)(/[\\^$*+?.()|[\]{}]/g,"\\$&");r(r.S,"RegExp",{escape:function(e){return i(e)}})},function(e,t,n){n(163),e.exports=n(26).RegExp.escape},function(e,t,n){(function(t){!function(t){"use strict";var n,r=Object.prototype,i=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag",u="object"==typeof e,f=t.regeneratorRuntime;if(f)u&&(e.exports=f);else{(f=t.regeneratorRuntime=u?e.exports:{}).wrap=S;var d="suspendedStart",l="suspendedYield",p="executing",h="completed",v={},m={};m[a]=function(){return this};var g=Object.getPrototypeOf,y=g&&g(g(I([])));y&&y!==r&&i.call(y,a)&&(m=y);var b=E.prototype=T.prototype=Object.create(m);R.prototype=b.constructor=E,E.constructor=R,E[c]=R.displayName="GeneratorFunction",f.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===R||"GeneratorFunction"===(t.displayName||t.name))},f.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,c in e||(e[c]="GeneratorFunction")),e.prototype=Object.create(b),e},f.awrap=function(e){return{__await:e}},C(_.prototype),_.prototype[s]=function(){return this},f.AsyncIterator=_,f.async=function(e,t,n,r){var i=new _(S(e,t,n,r));return f.isGeneratorFunction(t)?i:i.next().then(function(e){return e.done?e.value:i.next()})},C(b),b[c]="Generator",b[a]=function(){return this},b.toString=function(){return"[object Generator]"},f.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},f.values=I,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(x),!e)for(var t in this)"t"===t.charAt(0)&&i.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=n)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(r,i){return s.type="throw",s.arg=e,t.next=r,i&&(t.method="next",t.arg=n),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=i.call(a,"catchLoc"),u=i.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),x(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;x(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:I(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=n),v}}}function S(e,t,n,r){var i=t&&t.prototype instanceof T?t:T,o=Object.create(i.prototype),a=new O(r||[]);return o._invoke=function(e,t,n){var r=d;return function(i,o){if(r===p)throw new Error("Generator is already running");if(r===h){if("throw"===i)throw o;return M()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=k(a,n);if(s){if(s===v)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===d)throw r=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var c=w(e,t,n);if("normal"===c.type){if(r=n.done?h:l,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=h,n.method="throw",n.arg=c.arg)}}}(e,n,a),o}function w(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function T(){}function R(){}function E(){}function C(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function _(e){function n(t,r,o,a){var s=w(e[t],e,r);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==typeof u&&i.call(u,"__await")?Promise.resolve(u.__await).then(function(e){n("next",e,o,a)},function(e){n("throw",e,o,a)}):Promise.resolve(u).then(function(e){c.value=e,o(c)},a)}a(s.arg)}var r;"object"==typeof t.process&&t.process.domain&&(n=t.process.domain.bind(n)),this._invoke=function(e,t){function i(){return new Promise(function(r,i){n(e,t,r,i)})}return r=r?r.then(i,i):i()}}function k(e,t){var r=e.iterator[t.method];if(r===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=n,k(e,t),"throw"===t.method))return v;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var i=w(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,v;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=n),t.delegate=null,v):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,v)}function P(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(P,this),this.reset(!0)}function I(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=function t(){for(;++r<e.length;)if(i.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=n,t.done=!0,t};return o.next=o}}return{next:M}}function M(){return{value:n,done:!0}}}("object"==typeof t?t:"object"==typeof window?window:"object"==typeof self?self:this)}).call(this,n(67))},function(e,t,n){for(var r=n(75),i=n(39),o=n(12),a=n(2),s=n(13),c=n(46),u=n(5),f=u("iterator"),d=u("toStringTag"),l=c.Array,p={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},h=i(p),v=0;v<h.length;v++){var m,g=h[v],y=p[g],b=a[g],S=b&&b.prototype;if(S&&(S[f]||s(S,f,l),S[d]||s(S,d,g),c[g]=l,y))for(m in r)S[m]||o(S,m,r[m],!0)}},function(e,t,n){var r=n(0),i=n(74);r(r.G+r.B,{setImmediate:i.set,clearImmediate:i.clear})},function(e,t,n){var r=n(2),i=n(0),o=n(70),a=[].slice,s=/MSIE .\./.test(o),c=function(e){return function(t,n){var r=arguments.length>2,i=!!r&&a.call(arguments,2);return e(r?function(){("function"==typeof t?t:Function(t)).apply(this,i)}:t,n)}};i(i.G+i.B+i.F*s,{setTimeout:c(r.setTimeout),setInterval:c(r.setInterval)})},function(e,t,n){"use strict";var r=n(0),i=n(2),o=n(26),a=n(73)(),s=n(5)("observable"),c=n(10),u=n(1),f=n(34),d=n(32),l=n(13),p=n(33),h=p.RETURN,v=function(e){return null==e?void 0:c(e)},m=function(e){var t=e._c;t&&(e._c=void 0,t())},g=function(e){return void 0===e._o},y=function(e){g(e)||(e._o=void 0,m(e))},b=function(e,t){u(e),this._c=void 0,this._o=e,e=new S(this);try{var n=t(e),r=n;null!=n&&("function"==typeof n.unsubscribe?n=function(){r.unsubscribe()}:c(n),this._c=n)}catch(t){return void e.error(t)}g(this)&&m(this)};b.prototype=d({},{unsubscribe:function(){y(this)}});var S=function(e){this._s=e};S.prototype=d({},{next:function(e){var t=this._s;if(!g(t)){var n=t._o;try{var r=v(n.next);if(r)return r.call(n,e)}catch(e){try{y(t)}finally{throw e}}}},error:function(e){var t=this._s;if(g(t))throw e;var n=t._o;t._o=void 0;try{var r=v(n.error);if(!r)throw e;e=r.call(n,e)}catch(e){try{m(t)}finally{throw e}}return m(t),e},complete:function(e){var t=this._s;if(!g(t)){var n=t._o;t._o=void 0;try{var r=v(n.complete);e=r?r.call(n,e):void 0}catch(e){try{m(t)}finally{throw e}}return m(t),e}}});var w=function(e){f(this,w,"Observable","_f")._f=c(e)};d(w.prototype,{subscribe:function(e){return new b(e,this._f)},forEach:function(e){var t=this;return new(o.Promise||i.Promise)(function(n,r){c(e);var i=t.subscribe({next:function(t){try{return e(t)}catch(e){r(e),i.unsubscribe()}},error:r,complete:n})})}}),d(w,{from:function(e){var t="function"==typeof this?this:w,n=v(u(e)[s]);if(n){var r=u(n.call(e));return r.constructor===t?r:new t(function(e){return r.subscribe(e)})}return new t(function(t){var n=!1;return a(function(){if(!n){try{if(p(e,!1,function(e){if(t.next(e),n)return h})===h)return}catch(e){if(n)throw e;return void t.error(e)}t.complete()}}),function(){n=!0}})},of:function(){for(var e=0,t=arguments.length,n=new Array(t);e<t;)n[e]=arguments[e++];return new("function"==typeof this?this:w)(function(e){var t=!1;return a(function(){if(!t){for(var r=0;r<n.length;++r)if(e.next(n[r]),t)return;e.complete()}}),function(){t=!0}})}}),l(w.prototype,s,function(){return this}),r(r.G,{Observable:w}),n(35)("Observable")},function(e,t,n){var r=n(0),i=n(73)(),o=n(2).process,a="process"==n(19)(o);r(r.G,{asap:function(e){var t=a&&o.domain;i(t?t.bind(e):e)}})},function(e,t,n){var r=n(27),i=n(1),o=n(10),a=r.key,s=r.set;r.exp({metadata:function(e,t){return function(n,r){s(e,t,(void 0!==r?i:o)(n),a(r))}}})},function(e,t,n){var r=n(27),i=n(1),o=r.has,a=r.key;r.exp({hasOwnMetadata:function(e,t){return o(e,i(t),arguments.length<3?void 0:a(arguments[2]))}})},function(e,t,n){var r=n(27),i=n(1),o=n(15),a=r.has,s=r.key,c=function(e,t,n){if(a(e,t,n))return!0;var r=o(t);return null!==r&&c(e,r,n)};r.exp({hasMetadata:function(e,t){return c(e,i(t),arguments.length<3?void 0:s(arguments[2]))}})},function(e,t,n){var r=n(27),i=n(1),o=r.keys,a=r.key;r.exp({getOwnMetadataKeys:function(e){return o(i(e),arguments.length<2?void 0:a(arguments[1]))}})},function(e,t,n){var r=n(27),i=n(1),o=r.get,a=r.key;r.exp({getOwnMetadata:function(e,t){return o(e,i(t),arguments.length<3?void 0:a(arguments[2]))}})},function(e,t,n){var r=n(110),i=n(101),o=n(27),a=n(1),s=n(15),c=o.keys,u=o.key,f=function(e,t){var n=c(e,t),o=s(e);if(null===o)return n;var a=f(o,t);return a.length?n.length?i(new r(n.concat(a))):a:n};o.exp({getMetadataKeys:function(e){return f(a(e),arguments.length<2?void 0:u(arguments[1]))}})},function(e,t,n){var r=n(27),i=n(1),o=n(15),a=r.has,s=r.get,c=r.key,u=function(e,t,n){if(a(e,t,n))return s(e,t,n);var r=o(t);return null!==r?u(e,r,n):void 0};r.exp({getMetadata:function(e,t){return u(e,i(t),arguments.length<3?void 0:c(arguments[2]))}})},function(e,t,n){var r=n(27),i=n(1),o=r.key,a=r.map,s=r.store;r.exp({deleteMetadata:function(e,t){var n=arguments.length<3?void 0:o(arguments[2]),r=a(i(t),n,!1);if(void 0===r||!r.delete(e))return!1;if(r.size)return!0;var c=s.get(t);return c.delete(n),!!c.size||s.delete(t)}})},function(e,t,n){var r=n(27),i=n(1),o=r.key,a=r.set;r.exp({defineMetadata:function(e,t,n,r){a(e,t,i(n),o(r))}})},function(e,t,n){"use strict";var r=n(0),i=n(72),o=n(114);r(r.S,"Promise",{try:function(e){var t=i.f(this),n=o(e);return(n.e?t.reject:t.resolve)(n.v),t.promise}})},function(e,t,n){"use strict";var r=n(0),i=n(26),o=n(2),a=n(58),s=n(113);r(r.P+r.R,"Promise",{finally:function(e){var t=a(this,i.Promise||o.Promise),n="function"==typeof e;return this.then(n?function(n){return s(t,e()).then(function(){return n})}:e,n?function(n){return s(t,e()).then(function(){throw n})}:e)}})},function(e,t,n){var r=n(0);r(r.S,"Math",{signbit:function(e){return(e=+e)!=e?e:0==e?1/e==1/0:e>0}})},function(e,t,n){var r=n(0);r(r.S,"Math",{umulh:function(e,t){var n=+e,r=+t,i=65535&n,o=65535&r,a=n>>>16,s=r>>>16,c=(a*o>>>0)+(i*o>>>16);return a*s+(c>>>16)+((i*s>>>0)+(65535&c)>>>16)}})},function(e,t,n){var r=n(0);r(r.S,"Math",{scale:n(100)})},function(e,t,n){var r=n(0),i=Math.PI/180;r(r.S,"Math",{radians:function(e){return e*i}})},function(e,t,n){var r=n(0);r(r.S,"Math",{RAD_PER_DEG:180/Math.PI})},function(e,t,n){var r=n(0);r(r.S,"Math",{imulh:function(e,t){var n=+e,r=+t,i=65535&n,o=65535&r,a=n>>16,s=r>>16,c=(a*o>>>0)+(i*o>>>16);return a*s+(c>>16)+((i*s>>>0)+(65535&c)>>16)}})},function(e,t,n){var r=n(0);r(r.S,"Math",{isubh:function(e,t,n,r){var i=e>>>0,o=n>>>0;return(t>>>0)-(r>>>0)-((~i&o|~(i^o)&i-o>>>0)>>>31)|0}})},function(e,t,n){var r=n(0);r(r.S,"Math",{iaddh:function(e,t,n,r){var i=e>>>0,o=n>>>0;return(t>>>0)+(r>>>0)+((i&o|(i|o)&~(i+o>>>0))>>>31)|0}})},function(e,t,n){var r=n(0),i=n(100),o=n(120);r(r.S,"Math",{fscale:function(e,t,n,r,a){return o(i(e,t,n,r,a))}})},function(e,t,n){var r=n(0),i=180/Math.PI;r(r.S,"Math",{degrees:function(e){return e*i}})},function(e,t,n){var r=n(0);r(r.S,"Math",{DEG_PER_RAD:Math.PI/180})},function(e,t,n){var r=n(0);r(r.S,"Math",{clamp:function(e,t,n){return Math.min(n,Math.max(t,e))}})},function(e,t,n){var r=n(0),i=n(19);r(r.S,"Error",{isError:function(e){return"Error"===i(e)}})},function(e,t,n){var r=n(0);r(r.S,"System",{global:n(2)})},function(e,t,n){var r=n(0);r(r.G,{global:n(2)})},function(e,t,n){n(53)("WeakSet")},function(e,t,n){n(53)("WeakMap")},function(e,t,n){n(53)("Set")},function(e,t,n){n(53)("Map")},function(e,t,n){n(54)("WeakSet")},function(e,t,n){n(54)("WeakMap")},function(e,t,n){n(54)("Set")},function(e,t,n){n(54)("Map")},function(e,t,n){var r=n(0);r(r.P+r.R,"Set",{toJSON:n(102)("Set")})},function(e,t,n){var r=n(0);r(r.P+r.R,"Map",{toJSON:n(102)("Map")})},function(e,t,n){"use strict";var r=n(0),i=n(9),o=n(25),a=n(15),s=n(16).f;n(8)&&r(r.P+n(55),"Object",{__lookupSetter__:function(e){var t,n=i(this),r=o(e,!0);do{if(t=s(n,r))return t.set}while(n=a(n))}})},function(e,t,n){"use strict";var r=n(0),i=n(9),o=n(25),a=n(15),s=n(16).f;n(8)&&r(r.P+n(55),"Object",{__lookupGetter__:function(e){var t,n=i(this),r=o(e,!0);do{if(t=s(n,r))return t.get}while(n=a(n))}})},function(e,t,n){"use strict";var r=n(0),i=n(9),o=n(10),a=n(7);n(8)&&r(r.P+n(55),"Object",{__defineSetter__:function(e,t){a.f(i(this),e,{set:o(t),enumerable:!0,configurable:!0})}})},function(e,t,n){"use strict";var r=n(0),i=n(9),o=n(10),a=n(7);n(8)&&r(r.P+n(55),"Object",{__defineGetter__:function(e,t){a.f(i(this),e,{get:o(t),enumerable:!0,configurable:!0})}})},function(e,t,n){var r=n(0),i=n(103)(!0);r(r.S,"Object",{entries:function(e){return i(e)}})},function(e,t,n){var r=n(0),i=n(103)(!1);r(r.S,"Object",{values:function(e){return i(e)}})},function(e,t,n){var r=n(0),i=n(106),o=n(17),a=n(16),s=n(79);r(r.S,"Object",{getOwnPropertyDescriptors:function(e){for(var t,n,r=o(e),c=a.f,u=i(r),f={},d=0;u.length>d;)void 0!==(n=c(r,t=u[d++]))&&s(f,t,n);return f}})},function(e,t,n){n(95)("observable")},function(e,t,n){n(95)("asyncIterator")},function(e,t,n){"use strict";var r=n(0),i=n(24),o=n(6),a=n(62),s=n(60),c=RegExp.prototype,u=function(e,t){this._r=e,this._s=t};n(83)(u,"RegExp String",function(){var e=this._r.exec(this._s);return{value:e,done:null===e}}),r(r.P,"String",{matchAll:function(e){if(i(this),!a(e))throw TypeError(e+" is not a regexp!");var t=String(this),n="flags"in c?String(e.flags):s.call(e),r=new RegExp(e.source,~n.indexOf("g")?n:"g"+n);return r.lastIndex=o(e.lastIndex),new u(r,t)}})},function(e,t,n){"use strict";n(47)("trimRight",function(e){return function(){return e(this,2)}},"trimEnd")},function(e,t,n){"use strict";n(47)("trimLeft",function(e){return function(){return e(this,1)}},"trimStart")},function(e,t,n){"use strict";var r=n(0),i=n(104),o=n(70);r(r.P+r.F*/Version\/10\.\d+(\.\d+)? Safari\//.test(o),"String",{padEnd:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0,!1)}})},function(e,t,n){"use strict";var r=n(0),i=n(104),o=n(70);r(r.P+r.F*/Version\/10\.\d+(\.\d+)? Safari\//.test(o),"String",{padStart:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0,!0)}})},function(e,t,n){"use strict";var r=n(0),i=n(85)(!0);r(r.P,"String",{at:function(e){return i(this,e)}})},function(e,t,n){"use strict";var r=n(0),i=n(105),o=n(9),a=n(6),s=n(23),c=n(77);r(r.P,"Array",{flatten:function(){var e=arguments[0],t=o(this),n=a(t.length),r=c(t,0);return i(r,t,t,n,0,void 0===e?1:s(e)),r}}),n(30)("flatten")},function(e,t,n){"use strict";var r=n(0),i=n(105),o=n(9),a=n(6),s=n(10),c=n(77);r(r.P,"Array",{flatMap:function(e){var t,n,r=o(this);return s(e),t=a(r.length),n=c(r,0),i(n,r,r,t,0,1,e,arguments[1]),n}}),n(30)("flatMap")},function(e,t,n){"use strict";var r=n(0),i=n(65)(!0);r(r.P,"Array",{includes:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),n(30)("includes")},function(e,t,n){var r=n(0),i=n(91);i&&r(r.S,"Reflect",{setPrototypeOf:function(e,t){i.check(e,t);try{return i.set(e,t),!0}catch(e){return!1}}})},function(e,t,n){var r=n(7),i=n(16),o=n(15),a=n(14),s=n(0),c=n(42),u=n(1),f=n(4);s(s.S,"Reflect",{set:function e(t,n,s){var d,l,p=arguments.length<4?t:arguments[3],h=i.f(u(t),n);if(!h){if(f(l=o(t)))return e(l,n,s,p);h=c(0)}return a(h,"value")?!(!1===h.writable||!f(p)||((d=i.f(p,n)||c(0)).value=s,r.f(p,n,d),0)):void 0!==h.set&&(h.set.call(p,s),!0)}})},function(e,t,n){var r=n(0),i=n(1),o=Object.preventExtensions;r(r.S,"Reflect",{preventExtensions:function(e){i(e);try{return o&&o(e),!0}catch(e){return!1}}})},function(e,t,n){var r=n(0);r(r.S,"Reflect",{ownKeys:n(106)})},function(e,t,n){var r=n(0),i=n(1),o=Object.isExtensible;r(r.S,"Reflect",{isExtensible:function(e){return i(e),!o||o(e)}})},function(e,t,n){var r=n(0);r(r.S,"Reflect",{has:function(e,t){return t in e}})},function(e,t,n){var r=n(0),i=n(15),o=n(1);r(r.S,"Reflect",{getPrototypeOf:function(e){return i(o(e))}})},function(e,t,n){var r=n(16),i=n(0),o=n(1);i(i.S,"Reflect",{getOwnPropertyDescriptor:function(e,t){return r.f(o(e),t)}})},function(e,t,n){var r=n(16),i=n(15),o=n(14),a=n(0),s=n(4),c=n(1);a(a.S,"Reflect",{get:function e(t,n){var a,u,f=arguments.length<3?t:arguments[2];return c(t)===f?t[n]:(a=r.f(t,n))?o(a,"value")?a.value:void 0!==a.get?a.get.call(f):void 0:s(u=i(t))?e(u,n,f):void 0}})},function(e,t,n){"use strict";var r=n(0),i=n(1),o=function(e){this._t=i(e),this._i=0;var t,n=this._k=[];for(t in e)n.push(t)};n(83)(o,"Object",function(){var e,t=this._k;do{if(this._i>=t.length)return{value:void 0,done:!0}}while(!((e=t[this._i++])in this._t));return{value:e,done:!1}}),r(r.S,"Reflect",{enumerate:function(e){return new o(e)}})},function(e,t,n){var r=n(0),i=n(16).f,o=n(1);r(r.S,"Reflect",{deleteProperty:function(e,t){var n=i(o(e),t);return!(n&&!n.configurable)&&delete e[t]}})},function(e,t,n){var r=n(7),i=n(0),o=n(1),a=n(25);i(i.S+i.F*n(3)(function(){Reflect.defineProperty(r.f({},1,{value:1}),1,{value:2})}),"Reflect",{defineProperty:function(e,t,n){o(e),t=a(t,!0),o(n);try{return r.f(e,t,n),!0}catch(e){return!1}}})},function(e,t,n){var r=n(0),i=n(37),o=n(10),a=n(1),s=n(4),c=n(3),u=n(127),f=(n(2).Reflect||{}).construct,d=c(function(){function e(){}return!(f(function(){},[],e)instanceof e)}),l=!c(function(){f(function(){})});r(r.S+r.F*(d||l),"Reflect",{construct:function(e,t){o(e),a(t);var n=arguments.length<3?e:o(arguments[2]);if(l&&!d)return f(e,t,n);if(e==n){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var r=[null];return r.push.apply(r,t),new(u.apply(e,r))}var c=n.prototype,p=i(s(c)?c:Object.prototype),h=Function.apply.call(e,p,t);return s(h)?h:p}})},function(e,t,n){var r=n(0),i=n(10),o=n(1),a=(n(2).Reflect||{}).apply,s=Function.apply;r(r.S+r.F*!n(3)(function(){a(function(){})}),"Reflect",{apply:function(e,t,n){var r=i(e),c=o(n);return a?a(r,t,c):s.call(r,t,c)}})},function(e,t,n){n(28)("Float64",8,function(e){return function(t,n,r){return e(this,t,n,r)}})},function(e,t,n){n(28)("Float32",4,function(e){return function(t,n,r){return e(this,t,n,r)}})},function(e,t,n){n(28)("Uint32",4,function(e){return function(t,n,r){return e(this,t,n,r)}})},function(e,t,n){n(28)("Int32",4,function(e){return function(t,n,r){return e(this,t,n,r)}})},function(e,t,n){n(28)("Uint16",2,function(e){return function(t,n,r){return e(this,t,n,r)}})},function(e,t,n){n(28)("Int16",2,function(e){return function(t,n,r){return e(this,t,n,r)}})},function(e,t,n){n(28)("Uint8",1,function(e){return function(t,n,r){return e(this,t,n,r)}},!0)},function(e,t,n){n(28)("Uint8",1,function(e){return function(t,n,r){return e(this,t,n,r)}})},function(e,t,n){n(28)("Int8",1,function(e){return function(t,n,r){return e(this,t,n,r)}})},function(e,t,n){var r=n(0);r(r.G+r.W+r.F*!n(56).ABV,{DataView:n(71).DataView})},function(e,t,n){"use strict";var r=n(0),i=n(56),o=n(71),a=n(1),s=n(38),c=n(6),u=n(4),f=n(2).ArrayBuffer,d=n(58),l=o.ArrayBuffer,p=o.DataView,h=i.ABV&&f.isView,v=l.prototype.slice,m=i.VIEW;r(r.G+r.W+r.F*(f!==l),{ArrayBuffer:l}),r(r.S+r.F*!i.CONSTR,"ArrayBuffer",{isView:function(e){return h&&h(e)||u(e)&&m in e}}),r(r.P+r.U+r.F*n(3)(function(){return!new l(2).slice(1,void 0).byteLength}),"ArrayBuffer",{slice:function(e,t){if(void 0!==v&&void 0===t)return v.call(a(this),e);for(var n=a(this).byteLength,r=s(e,n),i=s(void 0===t?n:t,n),o=new(d(this,l))(c(i-r)),u=new p(this),f=new p(o),h=0;r<i;)f.setUint8(h++,u.getUint8(r++));return o}}),n(35)("ArrayBuffer")},function(e,t,n){"use strict";var r=n(108),i=n(45);n(57)("WeakSet",function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{add:function(e){return r.def(i(this,"WeakSet"),e,!0)}},r,!1,!0)},function(e,t,n){"use strict";var r,i,o,a,s=n(40),c=n(2),u=n(20),f=n(50),d=n(0),l=n(4),p=n(10),h=n(34),v=n(33),m=n(58),g=n(74).set,y=n(73)(),b=n(72),S=n(114),w=n(113),T=c.TypeError,R=c.process,E=c.Promise,C="process"==f(R),_=function(){},k=i=b.f,P=!!function(){try{var e=E.resolve(1),t=(e.constructor={})[n(5)("species")]=function(e){e(_,_)};return(C||"function"==typeof PromiseRejectionEvent)&&e.then(_)instanceof t}catch(e){}}(),x=function(e){var t;return!(!l(e)||"function"!=typeof(t=e.then))&&t},O=function(e,t){if(!e._n){e._n=!0;var n=e._c;y(function(){for(var r=e._v,i=1==e._s,o=0,a=function(t){var n,o,a=i?t.ok:t.fail,s=t.resolve,c=t.reject,u=t.domain;try{a?(i||(2==e._h&&j(e),e._h=1),!0===a?n=r:(u&&u.enter(),n=a(r),u&&u.exit()),n===t.promise?c(T("Promise-chain cycle")):(o=x(n))?o.call(n,s,c):s(n)):c(r)}catch(e){c(e)}};n.length>o;)a(n[o++]);e._c=[],e._n=!1,t&&!e._h&&I(e)})}},I=function(e){g.call(c,function(){var t,n,r,i=e._v,o=M(e);if(o&&(t=S(function(){C?R.emit("unhandledRejection",i,e):(n=c.onunhandledrejection)?n({promise:e,reason:i}):(r=c.console)&&r.error&&r.error("Unhandled promise rejection",i)}),e._h=C||M(e)?2:1),e._a=void 0,o&&t.e)throw t.v})},M=function(e){return 1!==e._h&&0===(e._a||e._c).length},j=function(e){g.call(c,function(){var t;C?R.emit("rejectionHandled",e):(t=c.onrejectionhandled)&&t({promise:e,reason:e._v})})},A=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),O(t,!0))},L=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw T("Promise can't be resolved itself");(t=x(e))?y(function(){var r={_w:n,_d:!1};try{t.call(e,u(L,r,1),u(A,r,1))}catch(e){A.call(r,e)}}):(n._v=e,n._s=1,O(n,!1))}catch(e){A.call({_w:n,_d:!1},e)}}};P||(E=function(e){h(this,E,"Promise","_h"),p(e),r.call(this);try{e(u(L,this,1),u(A,this,1))}catch(e){A.call(this,e)}},(r=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(32)(E.prototype,{then:function(e,t){var n=k(m(this,E));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=C?R.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&O(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),o=function(){var e=new r;this.promise=e,this.resolve=u(L,e,1),this.reject=u(A,e,1)},b.f=k=function(e){return e===E||e===a?new o(e):i(e)}),d(d.G+d.W+d.F*!P,{Promise:E}),n(48)(E,"Promise"),n(35)("Promise"),a=n(26).Promise,d(d.S+d.F*!P,"Promise",{reject:function(e){var t=k(this);return(0,t.reject)(e),t.promise}}),d(d.S+d.F*(s||!P),"Promise",{resolve:function(e){return w(s&&this===a?E:this,e)}}),d(d.S+d.F*!(P&&n(61)(function(e){E.all(e).catch(_)})),"Promise",{all:function(e){var t=this,n=k(t),r=n.resolve,i=n.reject,o=S(function(){var n=[],o=0,a=1;v(e,!1,function(e){var s=o++,c=!1;n.push(void 0),a++,t.resolve(e).then(function(e){c||(c=!0,n[s]=e,--a||r(n))},i)}),--a||r(n)});return o.e&&i(o.v),n.promise},race:function(e){var t=this,n=k(t),r=n.reject,i=S(function(){v(e,!1,function(e){t.resolve(e).then(n.resolve,r)})});return i.e&&r(i.v),n.promise}})},function(e,t,n){n(59)("split",2,function(e,t,r){"use strict";var i=n(62),o=r,a=[].push;if("c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length){var s=void 0===/()??/.exec("")[1];r=function(e,t){var n=String(this);if(void 0===e&&0===t)return[];if(!i(e))return o.call(n,e,t);var r,c,u,f,d,l=[],p=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),h=0,v=void 0===t?4294967295:t>>>0,m=new RegExp(e.source,p+"g");for(s||(r=new RegExp("^"+m.source+"$(?!\\s)",p));(c=m.exec(n))&&!((u=c.index+c[0].length)>h&&(l.push(n.slice(h,c.index)),!s&&c.length>1&&c[0].replace(r,function(){for(d=1;d<arguments.length-2;d++)void 0===arguments[d]&&(c[d]=void 0)}),c.length>1&&c.index<n.length&&a.apply(l,c.slice(1)),f=c[0].length,h=u,l.length>=v));)m.lastIndex===c.index&&m.lastIndex++;return h===n.length?!f&&m.test("")||l.push(""):l.push(n.slice(h)),l.length>v?l.slice(0,v):l}}else"0".split(void 0,0).length&&(r=function(e,t){return void 0===e&&0===t?[]:o.call(this,e,t)});return[function(n,i){var o=e(this),a=void 0==n?void 0:n[t];return void 0!==a?a.call(n,o,i):r.call(String(o),n,i)},r]})},function(e,t,n){n(59)("search",1,function(e,t,n){return[function(n){"use strict";var r=e(this),i=void 0==n?void 0:n[t];return void 0!==i?i.call(n,r):new RegExp(n)[t](String(r))},n]})},function(e,t,n){n(59)("replace",2,function(e,t,n){return[function(r,i){"use strict";var o=e(this),a=void 0==r?void 0:r[t];return void 0!==a?a.call(r,o,i):n.call(String(o),r,i)},n]})},function(e,t,n){n(59)("match",1,function(e,t,n){return[function(n){"use strict";var r=e(this),i=void 0==n?void 0:n[t];return void 0!==i?i.call(n,r):new RegExp(n)[t](String(r))},n]})},function(e,t,n){"use strict";n(115);var r=n(1),i=n(60),o=n(8),a=/./.toString,s=function(e){n(12)(RegExp.prototype,"toString",e,!0)};n(3)(function(){return"/a/b"!=a.call({source:"a",flags:"b"})})?s(function(){var e=r(this);return"/".concat(e.source,"/","flags"in e?e.flags:!o&&e instanceof RegExp?i.call(e):void 0)}):"toString"!=a.name&&s(function(){return a.call(this)})},function(e,t,n){var r=n(2),i=n(89),o=n(7).f,a=n(36).f,s=n(62),c=n(60),u=r.RegExp,f=u,d=u.prototype,l=/a/g,p=/a/g,h=new u(l)!==l;if(n(8)&&(!h||n(3)(function(){return p[n(5)("match")]=!1,u(l)!=l||u(p)==p||"/a/i"!=u(l,"i")}))){u=function(e,t){var n=this instanceof u,r=s(e),o=void 0===t;return!n&&r&&e.constructor===u&&o?e:i(h?new f(r&&!o?e.source:e,t):f((r=e instanceof u)?e.source:e,r&&o?c.call(e):t),n?this:d,u)};for(var v=function(e){e in u||o(u,e,{configurable:!0,get:function(){return f[e]},set:function(t){f[e]=t}})},m=a(f),g=0;m.length>g;)v(m[g++]);d.constructor=u,u.prototype=d,n(12)(r,"RegExp",u)}n(35)("RegExp")},function(e,t,n){n(35)("Array")},function(e,t,n){"use strict";var r=n(0),i=n(21)(6),o="findIndex",a=!0;o in[]&&Array(1)[o](function(){a=!1}),r(r.P+r.F*a,"Array",{findIndex:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),n(30)(o)},function(e,t,n){"use strict";var r=n(0),i=n(21)(5),o=!0;"find"in[]&&Array(1).find(function(){o=!1}),r(r.P+r.F*o,"Array",{find:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),n(30)("find")},function(e,t,n){var r=n(0);r(r.P,"Array",{fill:n(76)}),n(30)("fill")},function(e,t,n){var r=n(0);r(r.P,"Array",{copyWithin:n(117)}),n(30)("copyWithin")},function(e,t,n){"use strict";var r=n(0),i=n(17),o=n(23),a=n(6),s=[].lastIndexOf,c=!!s&&1/[1].lastIndexOf(1,-0)<0;r(r.P+r.F*(c||!n(18)(s)),"Array",{lastIndexOf:function(e){if(c)return s.apply(this,arguments)||0;var t=i(this),n=a(t.length),r=n-1;for(arguments.length>1&&(r=Math.min(r,o(arguments[1]))),r<0&&(r=n+r);r>=0;r--)if(r in t&&t[r]===e)return r||0;return-1}})},function(e,t,n){"use strict";var r=n(0),i=n(65)(!1),o=[].indexOf,a=!!o&&1/[1].indexOf(1,-0)<0;r(r.P+r.F*(a||!n(18)(o)),"Array",{indexOf:function(e){return a?o.apply(this,arguments)||0:i(this,e,arguments[1])}})},function(e,t,n){"use strict";var r=n(0),i=n(118);r(r.P+r.F*!n(18)([].reduceRight,!0),"Array",{reduceRight:function(e){return i(this,e,arguments.length,arguments[1],!0)}})},function(e,t,n){"use strict";var r=n(0),i=n(118);r(r.P+r.F*!n(18)([].reduce,!0),"Array",{reduce:function(e){return i(this,e,arguments.length,arguments[1],!1)}})},function(e,t,n){"use strict";var r=n(0),i=n(21)(4);r(r.P+r.F*!n(18)([].every,!0),"Array",{every:function(e){return i(this,e,arguments[1])}})},function(e,t,n){"use strict";var r=n(0),i=n(21)(3);r(r.P+r.F*!n(18)([].some,!0),"Array",{some:function(e){return i(this,e,arguments[1])}})},function(e,t,n){"use strict";var r=n(0),i=n(21)(2);r(r.P+r.F*!n(18)([].filter,!0),"Array",{filter:function(e){return i(this,e,arguments[1])}})},function(e,t,n){"use strict";var r=n(0),i=n(21)(1);r(r.P+r.F*!n(18)([].map,!0),"Array",{map:function(e){return i(this,e,arguments[1])}})},function(e,t,n){var r=n(4),i=n(63),o=n(5)("species");e.exports=function(e){var t;return i(e)&&("function"!=typeof(t=e.constructor)||t!==Array&&!i(t.prototype)||(t=void 0),r(t)&&null===(t=t[o])&&(t=void 0)),void 0===t?Array:t}},function(e,t,n){"use strict";var r=n(0),i=n(21)(0),o=n(18)([].forEach,!0);r(r.P+r.F*!o,"Array",{forEach:function(e){return i(this,e,arguments[1])}})},function(e,t,n){"use strict";var r=n(0),i=n(10),o=n(9),a=n(3),s=[].sort,c=[1,2,3];r(r.P+r.F*(a(function(){c.sort(void 0)})||!a(function(){c.sort(null)})||!n(18)(s)),"Array",{sort:function(e){return void 0===e?s.call(o(this)):s.call(o(this),i(e))}})},function(e,t,n){"use strict";var r=n(0),i=n(92),o=n(19),a=n(38),s=n(6),c=[].slice;r(r.P+r.F*n(3)(function(){i&&c.call(i)}),"Array",{slice:function(e,t){var n=s(this.length),r=o(this);if(t=void 0===t?n:t,"Array"==r)return c.call(this,e,t);for(var i=a(e,n),u=a(t,n),f=s(u-i),d=new Array(f),l=0;l<f;l++)d[l]="String"==r?this.charAt(i+l):this[i+l];return d}})},function(e,t,n){"use strict";var r=n(0),i=n(17),o=[].join;r(r.P+r.F*(n(52)!=Object||!n(18)(o)),"Array",{join:function(e){return o.call(i(this),void 0===e?",":e)}})},function(e,t,n){"use strict";var r=n(0),i=n(79);r(r.S+r.F*n(3)(function(){function e(){}return!(Array.of.call(e)instanceof e)}),"Array",{of:function(){for(var e=0,t=arguments.length,n=new("function"==typeof this?this:Array)(t);t>e;)i(n,e,arguments[e++]);return n.length=t,n}})},function(e,t,n){"use strict";var r=n(20),i=n(0),o=n(9),a=n(119),s=n(80),c=n(6),u=n(79),f=n(78);i(i.S+i.F*!n(61)(function(e){Array.from(e)}),"Array",{from:function(e){var t,n,i,d,l=o(e),p="function"==typeof this?this:Array,h=arguments.length,v=h>1?arguments[1]:void 0,m=void 0!==v,g=0,y=f(l);if(m&&(v=r(v,h>2?arguments[2]:void 0,2)),void 0==y||p==Array&&s(y))for(n=new p(t=c(l.length));t>g;g++)u(n,g,m?v(l[g],g):l[g]);else for(d=y.call(l),n=new p;!(i=d.next()).done;g++)u(n,g,m?a(d,v,[i.value,g],!0):i.value);return n.length=g,n}})},function(e,t,n){var r=n(0);r(r.S,"Array",{isArray:n(63)})},function(e,t,n){"use strict";var r=n(1),i=n(25);e.exports=function(e){if("string"!==e&&"number"!==e&&"default"!==e)throw TypeError("Incorrect hint");return i(r(this),"number"!=e)}},function(e,t,n){var r=n(5)("toPrimitive"),i=Date.prototype;r in i||n(13)(i,r,n(279))},function(e,t,n){var r=Date.prototype,i=r.toString,o=r.getTime;new Date(NaN)+""!="Invalid Date"&&n(12)(r,"toString",function(){var e=o.call(this);return e==e?i.call(this):"Invalid Date"})},function(e,t,n){"use strict";var r=n(3),i=Date.prototype.getTime,o=Date.prototype.toISOString,a=function(e){return e>9?e:"0"+e};e.exports=r(function(){return"0385-07-25T07:06:39.999Z"!=o.call(new Date(-5e13-1))})||!r(function(){o.call(new Date(NaN))})?function(){if(!isFinite(i.call(this)))throw RangeError("Invalid time value");var e=this,t=e.getUTCFullYear(),n=e.getUTCMilliseconds(),r=t<0?"-":t>9999?"+":"";return r+("00000"+Math.abs(t)).slice(r?-6:-4)+"-"+a(e.getUTCMonth()+1)+"-"+a(e.getUTCDate())+"T"+a(e.getUTCHours())+":"+a(e.getUTCMinutes())+":"+a(e.getUTCSeconds())+"."+(n>99?n:"0"+a(n))+"Z"}:o},function(e,t,n){var r=n(0),i=n(282);r(r.P+r.F*(Date.prototype.toISOString!==i),"Date",{toISOString:i})},function(e,t,n){"use strict";var r=n(0),i=n(9),o=n(25);r(r.P+r.F*n(3)(function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}),"Date",{toJSON:function(e){var t=i(this),n=o(t);return"number"!=typeof n||isFinite(n)?t.toISOString():null}})},function(e,t,n){var r=n(0);r(r.S,"Date",{now:function(){return(new Date).getTime()}})},function(e,t,n){"use strict";n(11)("sup",function(e){return function(){return e(this,"sup","","")}})},function(e,t,n){"use strict";n(11)("sub",function(e){return function(){return e(this,"sub","","")}})},function(e,t,n){"use strict";n(11)("strike",function(e){return function(){return e(this,"strike","","")}})},function(e,t,n){"use strict";n(11)("small",function(e){return function(){return e(this,"small","","")}})},function(e,t,n){"use strict";n(11)("link",function(e){return function(t){return e(this,"a","href",t)}})},function(e,t,n){"use strict";n(11)("italics",function(e){return function(){return e(this,"i","","")}})},function(e,t,n){"use strict";n(11)("fontsize",function(e){return function(t){return e(this,"font","size",t)}})},function(e,t,n){"use strict";n(11)("fontcolor",function(e){return function(t){return e(this,"font","color",t)}})},function(e,t,n){"use strict";n(11)("fixed",function(e){return function(){return e(this,"tt","","")}})},function(e,t,n){"use strict";n(11)("bold",function(e){return function(){return e(this,"b","","")}})},function(e,t,n){"use strict";n(11)("blink",function(e){return function(){return e(this,"blink","","")}})},function(e,t,n){"use strict";n(11)("big",function(e){return function(){return e(this,"big","","")}})},function(e,t,n){"use strict";n(11)("anchor",function(e){return function(t){return e(this,"a","name",t)}})},function(e,t,n){"use strict";var r=n(0),i=n(6),o=n(82),a="".startsWith;r(r.P+r.F*n(81)("startsWith"),"String",{startsWith:function(e){var t=o(this,e,"startsWith"),n=i(Math.min(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return a?a.call(t,r,n):t.slice(n,n+r.length)===r}})},function(e,t,n){var r=n(0);r(r.P,"String",{repeat:n(88)})},function(e,t,n){"use strict";var r=n(0),i=n(82);r(r.P+r.F*n(81)("includes"),"String",{includes:function(e){return!!~i(this,e,"includes").indexOf(e,arguments.length>1?arguments[1]:void 0)}})},function(e,t,n){"use strict";var r=n(0),i=n(6),o=n(82),a="".endsWith;r(r.P+r.F*n(81)("endsWith"),"String",{endsWith:function(e){var t=o(this,e,"endsWith"),n=arguments.length>1?arguments[1]:void 0,r=i(t.length),s=void 0===n?r:Math.min(i(n),r),c=String(e);return a?a.call(t,c,s):t.slice(s-c.length,s)===c}})},function(e,t,n){"use strict";var r=n(0),i=n(85)(!1);r(r.P,"String",{codePointAt:function(e){return i(this,e)}})},function(e,t,n){"use strict";var r=n(85)(!0);n(84)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t,n){"use strict";n(47)("trim",function(e){return function(){return e(this,3)}})},function(e,t,n){var r=n(0),i=n(17),o=n(6);r(r.S,"String",{raw:function(e){for(var t=i(e.raw),n=o(t.length),r=arguments.length,a=[],s=0;n>s;)a.push(String(t[s++])),s<r&&a.push(String(arguments[s]));return a.join("")}})},function(e,t,n){var r=n(0),i=n(38),o=String.fromCharCode,a=String.fromCodePoint;r(r.S+r.F*(!!a&&1!=a.length),"String",{fromCodePoint:function(e){for(var t,n=[],r=arguments.length,a=0;r>a;){if(t=+arguments[a++],i(t,1114111)!==t)throw RangeError(t+" is not a valid code point");n.push(t<65536?o(t):o(55296+((t-=65536)>>10),t%1024+56320))}return n.join("")}})},function(e,t,n){var r=n(0);r(r.S,"Math",{trunc:function(e){return(e>0?Math.floor:Math.ceil)(e)}})},function(e,t,n){var r=n(0),i=n(86),o=Math.exp;r(r.S,"Math",{tanh:function(e){var t=i(e=+e),n=i(-e);return t==1/0?1:n==1/0?-1:(t-n)/(o(e)+o(-e))}})},function(e,t,n){var r=n(0),i=n(86),o=Math.exp;r(r.S+r.F*n(3)(function(){return-2e-17!=!Math.sinh(-2e-17)}),"Math",{sinh:function(e){return Math.abs(e=+e)<1?(i(e)-i(-e))/2:(o(e-1)-o(-e-1))*(Math.E/2)}})},function(e,t,n){var r=n(0);r(r.S,"Math",{sign:n(87)})},function(e,t,n){var r=n(0);r(r.S,"Math",{log2:function(e){return Math.log(e)/Math.LN2}})},function(e,t,n){var r=n(0);r(r.S,"Math",{log1p:n(121)})},function(e,t,n){var r=n(0);r(r.S,"Math",{log10:function(e){return Math.log(e)*Math.LOG10E}})},function(e,t,n){var r=n(0),i=Math.imul;r(r.S+r.F*n(3)(function(){return-5!=i(4294967295,5)||2!=i.length}),"Math",{imul:function(e,t){var n=+e,r=+t,i=65535&n,o=65535&r;return 0|i*o+((65535&n>>>16)*o+i*(65535&r>>>16)<<16>>>0)}})},function(e,t,n){var r=n(0),i=Math.abs;r(r.S,"Math",{hypot:function(e,t){for(var n,r,o=0,a=0,s=arguments.length,c=0;a<s;)c<(n=i(arguments[a++]))?(o=o*(r=c/n)*r+1,c=n):o+=n>0?(r=n/c)*r:n;return c===1/0?1/0:c*Math.sqrt(o)}})},function(e,t,n){var r=n(0);r(r.S,"Math",{fround:n(120)})},function(e,t,n){var r=n(0),i=n(86);r(r.S+r.F*(i!=Math.expm1),"Math",{expm1:i})},function(e,t,n){var r=n(0),i=Math.exp;r(r.S,"Math",{cosh:function(e){return(i(e=+e)+i(-e))/2}})},function(e,t,n){var r=n(0);r(r.S,"Math",{clz32:function(e){return(e>>>=0)?31-Math.floor(Math.log(e+.5)*Math.LOG2E):32}})},function(e,t,n){var r=n(0),i=n(87);r(r.S,"Math",{cbrt:function(e){return i(e=+e)*Math.pow(Math.abs(e),1/3)}})},function(e,t,n){var r=n(0),i=Math.atanh;r(r.S+r.F*!(i&&1/i(-0)<0),"Math",{atanh:function(e){return 0==(e=+e)?e:Math.log((1+e)/(1-e))/2}})},function(e,t,n){var r=n(0),i=Math.asinh;r(r.S+r.F*!(i&&1/i(0)>0),"Math",{asinh:function e(t){return isFinite(t=+t)&&0!=t?t<0?-e(-t):Math.log(t+Math.sqrt(t*t+1)):t}})},function(e,t,n){var r=n(0),i=n(121),o=Math.sqrt,a=Math.acosh;r(r.S+r.F*!(a&&710==Math.floor(a(Number.MAX_VALUE))&&a(1/0)==1/0),"Math",{acosh:function(e){return(e=+e)<1?NaN:e>94906265.62425156?Math.log(e)+Math.LN2:i(e-1+o(e-1)*o(e+1))}})},function(e,t,n){var r=n(0),i=n(125);r(r.S+r.F*(Number.parseInt!=i),"Number",{parseInt:i})},function(e,t,n){var r=n(0),i=n(124);r(r.S+r.F*(Number.parseFloat!=i),"Number",{parseFloat:i})},function(e,t,n){var r=n(0);r(r.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},function(e,t,n){var r=n(0);r(r.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},function(e,t,n){var r=n(0),i=n(122),o=Math.abs;r(r.S,"Number",{isSafeInteger:function(e){return i(e)&&o(e)<=9007199254740991}})},function(e,t,n){var r=n(0);r(r.S,"Number",{isNaN:function(e){return e!=e}})},function(e,t,n){var r=n(0);r(r.S,"Number",{isInteger:n(122)})},function(e,t,n){var r=n(0),i=n(2).isFinite;r(r.S,"Number",{isFinite:function(e){return"number"==typeof e&&i(e)}})},function(e,t,n){var r=n(0);r(r.S,"Number",{EPSILON:Math.pow(2,-52)})},function(e,t,n){"use strict";var r=n(0),i=n(3),o=n(123),a=1..toPrecision;r(r.P+r.F*(i(function(){return"1"!==a.call(1,void 0)})||!i(function(){a.call({})})),"Number",{toPrecision:function(e){var t=o(this,"Number#toPrecision: incorrect invocation!");return void 0===e?a.call(t):a.call(t,e)}})},function(e,t,n){"use strict";var r=n(0),i=n(23),o=n(123),a=n(88),s=1..toFixed,c=Math.floor,u=[0,0,0,0,0,0],f="Number.toFixed: incorrect invocation!",d=function(e,t){for(var n=-1,r=t;++n<6;)r+=e*u[n],u[n]=r%1e7,r=c(r/1e7)},l=function(e){for(var t=6,n=0;--t>=0;)n+=u[t],u[t]=c(n/e),n=n%e*1e7},p=function(){for(var e=6,t="";--e>=0;)if(""!==t||0===e||0!==u[e]){var n=String(u[e]);t=""===t?n:t+a.call("0",7-n.length)+n}return t},h=function(e,t,n){return 0===t?n:t%2==1?h(e,t-1,n*e):h(e*e,t/2,n)};r(r.P+r.F*(!!s&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!n(3)(function(){s.call({})})),"Number",{toFixed:function(e){var t,n,r,s,c=o(this,f),u=i(e),v="",m="0";if(u<0||u>20)throw RangeError(f);if(c!=c)return"NaN";if(c<=-1e21||c>=1e21)return String(c);if(c<0&&(v="-",c=-c),c>1e-21)if(n=(t=function(e){for(var t=0,n=e;n>=4096;)t+=12,n/=4096;for(;n>=2;)t+=1,n/=2;return t}(c*h(2,69,1))-69)<0?c*h(2,-t,1):c/h(2,t,1),n*=4503599627370496,(t=52-t)>0){for(d(0,n),r=u;r>=7;)d(1e7,0),r-=7;for(d(h(10,r,1),0),r=t-1;r>=23;)l(1<<23),r-=23;l(1<<r),d(1,1),l(2),m=p()}else d(0,n),d(1<<-t,0),m=p()+a.call("0",u);return m=u>0?v+((s=m.length)<=u?"0."+a.call("0",u-s)+m:m.slice(0,s-u)+"."+m.slice(s-u)):v+m}})},function(e,t,n){"use strict";var r=n(2),i=n(14),o=n(19),a=n(89),s=n(25),c=n(3),u=n(36).f,f=n(16).f,d=n(7).f,l=n(47).trim,p=r.Number,h=p,v=p.prototype,m="Number"==o(n(37)(v)),g="trim"in String.prototype,y=function(e){var t=s(e,!1);if("string"==typeof t&&t.length>2){var n,r,i,o=(t=g?t.trim():l(t,3)).charCodeAt(0);if(43===o||45===o){if(88===(n=t.charCodeAt(2))||120===n)return NaN}else if(48===o){switch(t.charCodeAt(1)){case 66:case 98:r=2,i=49;break;case 79:case 111:r=8,i=55;break;default:return+t}for(var a,c=t.slice(2),u=0,f=c.length;u<f;u++)if((a=c.charCodeAt(u))<48||a>i)return NaN;return parseInt(c,r)}}return+t};if(!p(" 0o1")||!p("0b1")||p("+0x1")){p=function(e){var t=arguments.length<1?0:e,n=this;return n instanceof p&&(m?c(function(){v.valueOf.call(n)}):"Number"!=o(n))?a(new h(y(t)),n,p):y(t)};for(var b,S=n(8)?u(h):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),w=0;S.length>w;w++)i(h,b=S[w])&&!i(p,b)&&d(p,b,f(h,b));p.prototype=v,v.constructor=p,n(12)(r,"Number",p)}},function(e,t,n){var r=n(0),i=n(124);r(r.G+r.F*(parseFloat!=i),{parseFloat:i})},function(e,t,n){var r=n(0),i=n(125);r(r.G+r.F*(parseInt!=i),{parseInt:i})},function(e,t,n){"use strict";var r=n(4),i=n(15),o=n(5)("hasInstance"),a=Function.prototype;o in a||n(7).f(a,o,{value:function(e){if("function"!=typeof this||!r(e))return!1;if(!r(this.prototype))return e instanceof this;for(;e=i(e);)if(this.prototype===e)return!0;return!1}})},function(e,t,n){var r=n(7).f,i=Function.prototype,o=/^\s*function ([^ (]*)/;"name"in i||n(8)&&r(i,"name",{configurable:!0,get:function(){try{return(""+this).match(o)[1]}catch(e){return""}}})},function(e,t,n){var r=n(0);r(r.P,"Function",{bind:n(127)})},function(e,t,n){"use strict";var r=n(50),i={};i[n(5)("toStringTag")]="z",i+""!="[object z]"&&n(12)(Object.prototype,"toString",function(){return"[object "+r(this)+"]"},!0)},function(e,t,n){var r=n(0);r(r.S,"Object",{setPrototypeOf:n(91).set})},function(e,t){e.exports=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}},function(e,t,n){var r=n(0);r(r.S,"Object",{is:n(344)})},function(e,t,n){var r=n(0);r(r.S+r.F,"Object",{assign:n(128)})},function(e,t,n){var r=n(4);n(22)("isExtensible",function(e){return function(t){return!!r(t)&&(!e||e(t))}})},function(e,t,n){var r=n(4);n(22)("isSealed",function(e){return function(t){return!r(t)||!!e&&e(t)}})},function(e,t,n){var r=n(4);n(22)("isFrozen",function(e){return function(t){return!r(t)||!!e&&e(t)}})},function(e,t,n){var r=n(4),i=n(31).onFreeze;n(22)("preventExtensions",function(e){return function(t){return e&&r(t)?e(i(t)):t}})},function(e,t,n){var r=n(4),i=n(31).onFreeze;n(22)("seal",function(e){return function(t){return e&&r(t)?e(i(t)):t}})},function(e,t,n){var r=n(4),i=n(31).onFreeze;n(22)("freeze",function(e){return function(t){return e&&r(t)?e(i(t)):t}})},function(e,t,n){n(22)("getOwnPropertyNames",function(){return n(129).f})},function(e,t,n){var r=n(9),i=n(39);n(22)("keys",function(){return function(e){return i(r(e))}})},function(e,t,n){var r=n(9),i=n(15);n(22)("getPrototypeOf",function(){return function(e){return i(r(e))}})},function(e,t,n){var r=n(17),i=n(16).f;n(22)("getOwnPropertyDescriptor",function(){return function(e,t){return i(r(e),t)}})},function(e,t,n){var r=n(0);r(r.S+r.F*!n(8),"Object",{defineProperties:n(130)})},function(e,t,n){var r=n(0);r(r.S+r.F*!n(8),"Object",{defineProperty:n(7).f})},function(e,t,n){var r=n(0);r(r.S,"Object",{create:n(37)})},function(e,t,n){var r=n(39),i=n(64),o=n(51);e.exports=function(e){var t=r(e),n=i.f;if(n)for(var a,s=n(e),c=o.f,u=0;s.length>u;)c.call(e,a=s[u++])&&t.push(a);return t}},function(e,t,n){"use strict";var r=n(2),i=n(14),o=n(8),a=n(0),s=n(12),c=n(31).KEY,u=n(3),f=n(66),d=n(48),l=n(41),p=n(5),h=n(132),v=n(95),m=n(360),g=n(63),y=n(1),b=n(4),S=n(17),w=n(25),T=n(42),R=n(37),E=n(129),C=n(16),_=n(7),k=n(39),P=C.f,x=_.f,O=E.f,I=r.Symbol,M=r.JSON,j=M&&M.stringify,A=p("_hidden"),L=p("toPrimitive"),D={}.propertyIsEnumerable,N=f("symbol-registry"),F=f("symbols"),U=f("op-symbols"),B=Object.prototype,W="function"==typeof I,G=r.QObject,V=!G||!G.prototype||!G.prototype.findChild,z=o&&u(function(){return 7!=R(x({},"a",{get:function(){return x(this,"a",{value:7}).a}})).a})?function(e,t,n){var r=P(B,t);r&&delete B[t],x(e,t,n),r&&e!==B&&x(B,t,r)}:x,$=function(e){var t=F[e]=R(I.prototype);return t._k=e,t},J=W&&"symbol"==typeof I.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof I},X=function(e,t,n){return e===B&&X(U,t,n),y(e),t=w(t,!0),y(n),i(F,t)?(n.enumerable?(i(e,A)&&e[A][t]&&(e[A][t]=!1),n=R(n,{enumerable:T(0,!1)})):(i(e,A)||x(e,A,T(1,{})),e[A][t]=!0),z(e,t,n)):x(e,t,n)},H=function(e,t){y(e);for(var n,r=m(t=S(t)),i=0,o=r.length;o>i;)X(e,n=r[i++],t[n]);return e},q=function(e){var t=D.call(this,e=w(e,!0));return!(this===B&&i(F,e)&&!i(U,e))&&(!(t||!i(this,e)||!i(F,e)||i(this,A)&&this[A][e])||t)},K=function(e,t){if(e=S(e),t=w(t,!0),e!==B||!i(F,t)||i(U,t)){var n=P(e,t);return!n||!i(F,t)||i(e,A)&&e[A][t]||(n.enumerable=!0),n}},Y=function(e){for(var t,n=O(S(e)),r=[],o=0;n.length>o;)i(F,t=n[o++])||t==A||t==c||r.push(t);return r},Z=function(e){for(var t,n=e===B,r=O(n?U:S(e)),o=[],a=0;r.length>a;)!i(F,t=r[a++])||n&&!i(B,t)||o.push(F[t]);return o};W||(s((I=function(){if(this instanceof I)throw TypeError("Symbol is not a constructor!");var e=l(arguments.length>0?arguments[0]:void 0),t=function(n){this===B&&t.call(U,n),i(this,A)&&i(this[A],e)&&(this[A][e]=!1),z(this,e,T(1,n))};return o&&V&&z(B,e,{configurable:!0,set:t}),$(e)}).prototype,"toString",function(){return this._k}),C.f=K,_.f=X,n(36).f=E.f=Y,n(51).f=q,n(64).f=Z,o&&!n(40)&&s(B,"propertyIsEnumerable",q,!0),h.f=function(e){return $(p(e))}),a(a.G+a.W+a.F*!W,{Symbol:I});for(var Q="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ee=0;Q.length>ee;)p(Q[ee++]);for(var te=k(p.store),ne=0;te.length>ne;)v(te[ne++]);a(a.S+a.F*!W,"Symbol",{for:function(e){return i(N,e+="")?N[e]:N[e]=I(e)},keyFor:function(e){if(!J(e))throw TypeError(e+" is not a symbol!");for(var t in N)if(N[t]===e)return t},useSetter:function(){V=!0},useSimple:function(){V=!1}}),a(a.S+a.F*!W,"Object",{create:function(e,t){return void 0===t?R(e):H(R(e),t)},defineProperty:X,defineProperties:H,getOwnPropertyDescriptor:K,getOwnPropertyNames:Y,getOwnPropertySymbols:Z}),M&&a(a.S+a.F*(!W||u(function(){var e=I();return"[null]"!=j([e])||"{}"!=j({a:e})||"{}"!=j(Object(e))})),"JSON",{stringify:function(e){for(var t,n,r=[e],i=1;arguments.length>i;)r.push(arguments[i++]);if(n=t=r[1],(b(t)||void 0!==e)&&!J(e))return g(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!J(t))return t}),r[1]=t,j.apply(M,r)}}),I.prototype[L]||n(13)(I.prototype,L,I.prototype.valueOf),d(I,"Symbol"),d(Math,"Math",!0),d(r.JSON,"JSON",!0)},function(e,t,n){n(361),n(359),n(358),n(357),n(356),n(355),n(354),n(353),n(352),n(351),n(350),n(349),n(348),n(347),n(346),n(345),n(343),n(342),n(341),n(340),n(339),n(338),n(337),n(336),n(335),n(334),n(333),n(332),n(331),n(330),n(329),n(328),n(327),n(326),n(325),n(324),n(323),n(322),n(321),n(320),n(319),n(318),n(317),n(316),n(315),n(314),n(313),n(312),n(311),n(310),n(309),n(308),n(307),n(306),n(305),n(304),n(303),n(302),n(301),n(300),n(299),n(298),n(297),n(296),n(295),n(294),n(293),n(292),n(291),n(290),n(289),n(288),n(287),n(286),n(285),n(284),n(283),n(281),n(280),n(278),n(277),n(276),n(275),n(274),n(273),n(272),n(270),n(269),n(268),n(267),n(266),n(265),n(264),n(263),n(262),n(261),n(260),n(259),n(258),n(75),n(257),n(256),n(115),n(255),n(254),n(253),n(252),n(251),n(112),n(110),n(109),n(250),n(249),n(248),n(247),n(246),n(245),n(244),n(243),n(242),n(241),n(240),n(239),n(238),n(237),n(236),n(235),n(234),n(233),n(232),n(231),n(230),n(229),n(228),n(227),n(226),n(225),n(224),n(223),n(222),n(221),n(220),n(219),n(218),n(217),n(216),n(215),n(214),n(213),n(212),n(211),n(210),n(209),n(208),n(207),n(206),n(205),n(204),n(203),n(202),n(201),n(200),n(199),n(198),n(197),n(196),n(195),n(194),n(193),n(192),n(191),n(190),n(189),n(188),n(187),n(186),n(185),n(184),n(183),n(182),n(181),n(180),n(179),n(178),n(177),n(176),n(175),n(174),n(173),n(172),n(171),n(170),n(169),n(168),n(167),n(166),e.exports=n(26)},function(e,t,n){"use strict";(function(e){if(n(362),n(165),n(164),e._babelPolyfill)throw new Error("only one instance of babel-polyfill is allowed");e._babelPolyfill=!0;var t="defineProperty";function r(e,n,r){e[n]||Object[t](e,n,{writable:!0,configurable:!0,value:r})}r(String.prototype,"padLeft","".padStart),r(String.prototype,"padRight","".padEnd),"pop,reverse,shift,keys,values,entries,indexOf,every,some,forEach,map,filter,find,findIndex,includes,join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill".split(",").forEach(function(e){[][e]&&r(Array,e,Function.call.bind([][e]))})}).call(this,n(67))},function(e,t,n){n(363),e.exports=n(161)}]);