UNPKG

@zoom/meetingsdk

Version:
2 lines 42.6 kB
!function(t){var e={};function s(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,s),r.l=!0,r.exports}s.m=t,s.c=e,s.d=function(t,e,n){s.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},s.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.t=function(t,e){if(1&e&&(t=s(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(s.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)s.d(n,r,function(e){return t[e]}.bind(null,r));return n},s.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return s.d(e,"a",e),e},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.p="",s(s.s=65)}([,,,,,function(t,e,s){"use strict";s.d(e,"j",(function(){return n})),s.d(e,"h",(function(){return r})),s.d(e,"l",(function(){return i})),s.d(e,"sb",(function(){return o})),s.d(e,"qb",(function(){return a})),s.d(e,"ub",(function(){return h})),s.d(e,"Z",(function(){return c})),s.d(e,"d",(function(){return l})),s.d(e,"bb",(function(){return u})),s.d(e,"db",(function(){return d})),s.d(e,"D",(function(){return _})),s.d(e,"ob",(function(){return f})),s.d(e,"H",(function(){return p})),s.d(e,"Eb",(function(){return m})),s.d(e,"n",(function(){return b})),s.d(e,"vb",(function(){return g})),s.d(e,"E",(function(){return v})),s.d(e,"b",(function(){return E})),s.d(e,"zb",(function(){return y})),s.d(e,"S",(function(){return T})),s.d(e,"I",(function(){return S})),s.d(e,"T",(function(){return D})),s.d(e,"xb",(function(){return w})),s.d(e,"f",(function(){return M})),s.d(e,"nb",(function(){return A})),s.d(e,"mb",(function(){return C})),s.d(e,"eb",(function(){return I})),s.d(e,"X",(function(){return k})),s.d(e,"V",(function(){return O})),s.d(e,"a",(function(){return R})),s.d(e,"z",(function(){return N})),s.d(e,"Fb",(function(){return L})),s.d(e,"G",(function(){return B})),s.d(e,"wb",(function(){return U})),s.d(e,"v",(function(){return q})),s.d(e,"u",(function(){return F})),s.d(e,"t",(function(){return x})),s.d(e,"w",(function(){return P})),s.d(e,"U",(function(){return H})),s.d(e,"jb",(function(){return V})),s.d(e,"kb",(function(){return j})),s.d(e,"R",(function(){return W})),s.d(e,"hb",(function(){return G})),s.d(e,"ib",(function(){return Y})),s.d(e,"F",(function(){return Q})),s.d(e,"r",(function(){return K})),s.d(e,"q",(function(){return J})),s.d(e,"y",(function(){return z})),s.d(e,"p",(function(){return X})),s.d(e,"x",(function(){return Z})),s.d(e,"Cb",(function(){return $})),s.d(e,"O",(function(){return tt})),s.d(e,"P",(function(){return et})),s.d(e,"Ab",(function(){return st})),s.d(e,"C",(function(){return nt})),s.d(e,"B",(function(){return rt})),s.d(e,"A",(function(){return it})),s.d(e,"K",(function(){return ot})),s.d(e,"J",(function(){return at})),s.d(e,"L",(function(){return ht})),s.d(e,"o",(function(){return ct})),s.d(e,"s",(function(){return lt})),s.d(e,"gb",(function(){return ut})),s.d(e,"fb",(function(){return dt})),s.d(e,"Db",(function(){return _t})),s.d(e,"Q",(function(){return ft})),s.d(e,"i",(function(){return pt})),s.d(e,"g",(function(){return mt})),s.d(e,"k",(function(){return bt})),s.d(e,"m",(function(){return gt})),s.d(e,"rb",(function(){return vt})),s.d(e,"pb",(function(){return Et})),s.d(e,"tb",(function(){return yt})),s.d(e,"Y",(function(){return Tt})),s.d(e,"cb",(function(){return St})),s.d(e,"ab",(function(){return Dt})),s.d(e,"c",(function(){return wt})),s.d(e,"M",(function(){return Mt})),s.d(e,"Bb",(function(){return At})),s.d(e,"N",(function(){return Ct})),s.d(e,"yb",(function(){return It})),s.d(e,"W",(function(){return kt})),s.d(e,"lb",(function(){return Ot})),s.d(e,"e",(function(){return Rt}));const n=1,r=2,i=3,o=7,a=8,h=9,c=12,l=14,u=15,d=16,_=18,f=20,p=21,m=24,b=26,g=27,v=30,E=31,y=35,T=36,S=37,D=38,w=47,M=48,A=50,C=51,I=52,k=53,O=54,R=56,N=57,L=60,B=61,U=62,q=66.5,F=66.6,x=67,P=68,H=69,V=71,j=72,W=73,G=75,Y=76,Q=78,K=105,J=106,z=107,X=108,Z=109,$=120,tt=121,et=122,st=123,nt=124,rt=125,it=126,ot=127,at=128,ht=129,ct=132,lt=133,ut=135,dt=136,_t=137,ft=151,pt=-1,mt=-2,bt=-3,gt=-5,vt=-7,Et=-8,yt=-9,Tt=-12,St=-14,Dt=-15,wt=-23,Mt=-26,At=-27,Ct=-28,It=-35,kt=-129,Ot=-130,Rt=-131},function(t,e,s){"use strict";s.d(e,"e",(function(){return l})),s.d(e,"b",(function(){return d})),s.d(e,"d",(function(){return _})),s.d(e,"a",(function(){return f})),s.d(e,"c",(function(){return p}));var n=s(7),r=s.n(n),i=s(14),o=s(17),a=s(5),h=s(10),c=s(13);const l={AUDIO_DECODE:1,AUDIO_ENCODE:2,VIDEO_DECODE:4,VIDEO_ENCODE:8,SHARR_DECODE:16,SHARR_ENCODE:32},u=t=>{0};class d{constructor(){this.onmessage=u,this.status=d.CLOSED,this.onopen=u,this.onclose=u,this.onwer=null}send(t){}delete(){this.onmessage=u,this.onopen=u,this.onclose=u,this.close()}sendVideo(t,e){}sendWasm(t){}open(){this.status=d.OPEN,this.onopen()}close(){this.status=d.CLOSED,this.onclose()}}r()(d,"OPEN",1),r()(d,"CLOSED",2);class _ extends d{constructor(){super({}),this.sab={},this.port=null,this.onmessage=u,this.sender=u,this.videoSender=u,this.reciver=u,this.wasmSender=u}send(t){this.sender(t)}sendVideo(t,e){this.videoSender(t,e)}sendWasm(t){this.wasmSender(t)}delete(){try{var t,e;this.onmessage=u,this.sender=u,this.videoSender=u,this.reciver=u,this.wasmSender=u;let{consumer:s}=(null===(t=this.sab)||void 0===t?void 0:t.reciver)||{};null==s||s.setDataCallback(u),null==s||s.cancelConsume(),this.sab={},this.port&&(this.port.onmessage=u),null===(e=this.port)||void 0===e||e.close()}catch(t){}}open(){this.status!=d.OPEN||this.onopen()}close(){this.status=d.CLOSED,this.delete(),this.onclose()}_onmessage(t){let{cmd:e,data:s}=t.data;switch(e){case a.J:this.reciver();break;case a.K:this.onmessage(s,0);break;case a.L:this.status=s,this.status==d.OPEN?this.onopen():this.onclose()}}createSendAndReceive(){if(!this.port)return;let{sender:t,reciver:e}=this.sab,{sabqueue:s,interval:n}=t||{};s?n?(this.sender=t=>{s.enqueue(t)},this.wasmSender=t=>{s.enqueue(t)},this.videoSender=(t,e)=>{if(!s.enqueueSafe([t,e],!1)){let n=new Uint8Array(e.length+t.length);n.set(t,0),n.set(e,t.length),s.enqueueSafe(n)}}):(this.sender=t=>{s.enqueue(t),this.port.postMessage({cmd:a.J})},this.wasmSender=t=>{s.enqueue(t),this.port.postMessage({cmd:a.J})},this.videoSender=(t,e)=>{if(!s.enqueueSafe([t,e],!1)){let n=new Uint8Array(e.length+t.length);n.set(t,0),n.set(e,t.length),s.enqueueSafe(n)}this.port.postMessage({cmd:a.J})}):(this.sender=t=>{this.port.postMessage({cmd:a.K,data:t},[t.buffer])},this.wasmSender=t=>{let e=new Uint8Array(t.length);e.set(t,0),this.port.postMessage({cmd:a.K,data:e},[e.buffer])},this.videoSender=(t,e)=>{let s=new Uint8Array(e.length+t.length);s.set(t,0),s.set(e,t.length),this.port.postMessage({cmd:a.K,data:s},[s.buffer])});let{sabqueue:r,consumer:h,useCopy:c,interval:l,offset:u}=e||{};if(h&&(h.cancelConsume(),h=null),r){const t=c?t=>{this.onmessage(t,0)}:u?t=>{this.onmessage(t.uint8s,t.begin)}:t=>{this.onmessage(t.uint8s,0)};let s=null,n=f.dataTransportMgr.monitorlogfn;if(l&&n){var d;let t=new i.b({tag:"WCL_M,VDRB"+(null===(d=this.onwer)||void 0===d?void 0:d.type),interval:1e4,reportcallback:m});s=t.timeoutReport.bind(t)}h=new o.a(r,t,s),e.consumer=h,l?h.consume(l,c):this.reciver=()=>{h.consumeAll(c)}}}setMsgPort(t){t!=this.port&&(this.port&&(this.port.onmessage=u,this.port.close(),this.port=null),this.port=t,this.port&&(this._listeners||(this._listeners=this._onmessage.bind(this)),this.port.onmessage=this._listeners,this.createSendAndReceive()))}setSabBuffer(t,e){if(null!=t&&t.sab){let{sab:e,useCopy:s,interval:n,offset:r,length:i,useOneElement:a}=t,h=new o.b(r>0?e.buffer:e,void 0,void 0,!!a,r,i,r>0?e:null);this.sab.sender={sabqueue:h,interval:n,useCopy:s,offset:r}}if(null!=e&&e.sab){var s;let{sab:t,useCopy:n,interval:r,offset:i,length:a,useOneElement:h}=e,c=new o.b(i>0?t.buffer:t,void 0,void 0,!!h,i,a,i>0?t:null),{consumer:l}=(null===(s=this.sab)||void 0===s?void 0:s.reciver)||{};l&&(l.cancelConsume(),this.sab.reciver.consumer=null,this.sab.reciver.sabqueue=null),this.sab.reciver={sabqueue:c,interval:r,useCopy:n,offset:i}}this.createSendAndReceive()}setStatus(t){this.port?this.status!=t&&(this.status=t,this.port.postMessage({cmd:a.L,data:t})):console.error("MsgQueueSocket not initialized")}}class f{constructor(t){this.onmessage=u,this.onopen=u,this.onclose=u,this.connect_type=t.connect_type||f.UDP,this.type=t.type,this.id=t.id||Math.floor(performance.now())<<10|t.type,this.sock=t.sock||new d,this.mgr=t.mgr,this.sock.onmessage=this._onmessage.bind(this),this.sock.onclose=this._onclose.bind(this),this.sock.onopen=this._onopen.bind(this),this.sock.onwer=this,this.remote=t.remote,this.sabInfo=null,this.portInfo=null,this.target_thread=h.b.NO_THREAD,this.local=!!t.local,this._create()}_create(){let t=f.dataTransportMgr;t.transportlists.push(this),!this.local&&t&&t.mainThread&&t.type==c.a.THREAD_SUB&&t.createRemoteTransport(this,t.mainThread)}_close(){let t=f.dataTransportMgr,e=t.transportlists.indexOf(this);-1!=e&&t.transportlists.splice(e,1),!this.local&&t&&t.mainThread&&t.type==c.a.THREAD_SUB&&t.closeRemoteTransport(this,t.mainThread)}_onmessage(t,e){this.onmessage(t,e)}_onclose(){this.onclose()}_onopen(){this.onopen()}isReady(){return!0}send(t){this.sock.send(t)}sendVideo(t,e){this.sock.sendVideo(t,e)}sendWasmData(t){this.sock.sendWasm(t)}setSocket(t){let e=this.sock;this.sock=t,this.sock&&(this.sock.onwer=this,this.sock.onmessage=this._onmessage.bind(this),this.sock.onclose=this._onclose.bind(this),this.sock.onopen=this._onopen.bind(this)),e&&e.delete()}open(){this.sock.open()}close(){this._close(),this.sock.close()}setMsgPort(t){if(!(this.sock instanceof _))throw new Error("tansport sock is not a MsgQueueSocket");this.sock.setMsgPort(t)}setSabBuffer(t,e){if(!(this.sock instanceof _))throw new Error("tansport sock is not a MsgQueueSocket");this.sock.setSabBuffer(t,e)}setStatus(t){this.sock instanceof _&&this.sock.setStatus(t)}}r()(f,"UDP",0),r()(f,"TCP",1),r()(f,"RLB_UDP",2),r()(f,"dataTransportMgr",null);class p{constructor(t){this.sock=null,this.onmessage=u}isReady(){return!1}send(){u()}setStatus(t){0}}function m(t,e,s,n){var r;null===(r=c.a.monitorlogfn)||void 0===r||r.call(c.a,t,"".concat(e,",").concat(s,",").concat(n))}},function(t,e,s){var n=s(35);t.exports=function(t,e,s){return(e=n(e))in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,s){"use strict";s.d(e,"q",(function(){return n})),s.d(e,"b",(function(){return r})),s.d(e,"c",(function(){return i})),s.d(e,"d",(function(){return o})),s.d(e,"i",(function(){return a})),s.d(e,"j",(function(){return h})),s.d(e,"l",(function(){return c})),s.d(e,"r",(function(){return l})),s.d(e,"s",(function(){return u})),s.d(e,"t",(function(){return d})),s.d(e,"m",(function(){return _})),s.d(e,"o",(function(){return f})),s.d(e,"e",(function(){return p})),s.d(e,"n",(function(){return m})),s.d(e,"p",(function(){return b})),s.d(e,"g",(function(){return g})),s.d(e,"h",(function(){return v})),s.d(e,"a",(function(){return E})),s.d(e,"f",(function(){return y})),s.d(e,"k",(function(){return T}));const n=1,r=2,i=3,o=4,a=5,h=6,c=7,l=8,u=9,d=10,_=11,f=129,p=130,m=131,b=132,g=133,v=134,E=135,y=136,T=137},,function(t,e,s){"use strict";s.d(e,"a",(function(){return i})),s.d(e,"b",(function(){return o}));var n=s(7),r=s.n(n);class i{constructor(){this.onmessage=()=>{}}addEventListener(){}close(){}}class o{constructor(t){this.transportMap={},this.netthreadworker=null,this.type=t.type,this.mgr=t,this.transportlistsChnagelinster=[]}addEventListener(t){-1==this.transportlistsChnagelinster.indexOf(t)&&this.transportlistsChnagelinster.push(t)}removeEventListener(t){let e=this.transportlistsChnagelinster.indexOf(t);-1!=e&&this.transportlistsChnagelinster.splice(e,1)}addTransport(t,e){t.id in this.transportMap||(this.transportMap[t.id]=t,this.transportlistsChnagelinster.forEach(s=>{s(t,e,1)}))}removeTransport(t){var e;let s=t.id;s in this.transportMap&&(delete this.transportMap[s],null===(e=t.sock)||void 0===e||e.close(),this.transportlistsChnagelinster.forEach(e=>{e(t,t.channel,0)}))}getTransportByType(t){for(let e in this.transportMap){let s=this.transportMap[e],n=s.target_thread==o.SELF_THREAD;if(s.type==t&&n)return s}return null}}r()(o,"NO_THREAD",0),r()(o,"SELF_THREAD",1)},function(t,e,s){"use strict";function n(){this.a=[],this.b=0,this.residue=null}n.prototype.getLength=function(){return this.a.length-this.b},n.prototype.isEmpty=function(){return 0==this.a.length},n.prototype.enqueue=function(t){this.a.push(t)},n.prototype.dequeue=function(){if(0!=this.a.length){var t=this.a[this.b];return 2*++this.b>=this.a.length&&(this.a=this.a.slice(this.b),this.b=0),t}return null},n.prototype.peek=function(){return 0<this.a.length?this.a[this.b]:void 0},n.prototype.clear=function(){this.a=[],this.b=0},e.a=n},function(t,e,s){"use strict";s.d(e,"a",(function(){return n})),s.d(e,"b",(function(){return r})),s.d(e,"c",(function(){return i}));const n={AUDIO:1,SHARING:2,VIDEO:3},r={VIDEO_ENCODE:"0",VIDEO_DECODE:"1",AUDIO_ENCODE:"2",AUDIO_DECODE:"3",SHARING_ENCODE:"4",SHARING_DECODE:"5"},i=((()=>{const t={};for(const e in r)t[r[e]]="WCL_"+e})(),{[r.AUDIO_ENCODE]:"audio.encode",[r.AUDIO_DECODE]:"audio.decode",[r.VIDEO_ENCODE]:"video.encode",[r.VIDEO_DECODE]:"video.decode",[r.SHARING_ENCODE]:"share.encode",[r.SHARING_DECODE]:"share.decode"})},function(t,e,s){"use strict";s.d(e,"b",(function(){return c})),s.d(e,"a",(function(){return l}));var n=s(7),r=s.n(n),i=s(5),o=s(10),a=s(6),h=s(22);function c(t,e,s){if(!t)return;let n=a.a.dataTransportMgr;n.type===l.THREAD_MAIN?(n.setSabBuffer(t,e,s),t.remote.postMessage({cmd:i.gb,transportId:t.id,sender:s,reciver:e})):(t.setSabBuffer(e,s),n.mainThread.postMessage({cmd:i.gb,transportId:t.id,sender:s,reciver:e}))}class l{constructor(t){let e=t||{};this.type=e.type||l.THREAD_MAIN,this.refs={},this.transportlists=[],this.mainThread=e.remote,this.subthreadlistner=null,this.channellists=[],this.mediadatachannel=new o.b(this)}_onrecvmainthreadlistener(t){let{cmd:e,transportId:s,data:n}=t.data,r=this.transportlists.find(t=>t.id===s);if(r||e==i.s)switch(e){case i.s:this.addRemoteTransport(t.data,null);break;case i.fb:r.setMsgPort(n||new o.a);break;case i.gb:r.setSabBuffer(t.data.sender,t.data.reciver);break;case i.o:r.remote=null,this.removeTransport(r)}}_onrecvsubthreadlistener(t,e){let{cmd:s,transportId:n,transportType:r}=e.data,o=this.transportlists.find(t=>t.id===n);switch(s){case i.s:this.addRemoteTransport(e.data,t);break;case i.gb:this.setSabBufferInfo(o,e.data.sender,e.data.reciver);break;case i.o:o.remote=null,this.removeTransport(o)}}createRemoteTransport(t,e){let s={cmd:i.s,transportType:t.type,transportId:t.id};t.portInfo?(s.port=t.portInfo,e.postMessage(s,[t.portInfo])):e.postMessage(s)}closeRemoteTransport(t,e){e.postMessage({cmd:i.o,transportType:t.type,transportId:t.id})}setRemoteTransportSABBUffer(t,e){var s,n,r,o;(null!==(s=t.sabInfo)&&void 0!==s&&s.sender||null!==(n=t.sabInfo)&&void 0!==n&&n.reciver)&&e.postMessage({cmd:i.gb,transportId:t.id,sender:null===(r=t.sabInfo)||void 0===r?void 0:r.sender,reciver:null===(o=t.sabInfo)||void 0===o?void 0:o.reciver})}addRemoteTransport(t,e){let{transportId:s,port:n,transportType:r}=t;let i=this.createMsgSocketTransport(r);i.id=s,i.remote=e,i.portInfo=n,n?i.setMsgPort(i.portInfo):this.bindMessageChannel(i),this.addTransport(i)}addTransport(t){let e=this.getChannelByTransportType(t.type);if(!e)return;let s=e.target_thread||o.b.SELF_THREAD;t.target_thread=s,this.bindTransPortForChannel(t,e)}removeTransport(t){let e=this.transportlists.indexOf(t);-1!=e&&(this.transportlists.splice(e,1),t.remote&&this.closeRemoteTransport(t,t.remote),t.target_thread!=o.b.NO_THREAD&&this.unbindTransPortForChannel(t))}createMsgSocketTransport(t){let e=null;return e=new a.a({mgr:this,sock:new a.d,type:t,local:!0}),e}bindMessageChannel(t){if(this.type!=l.THREAD_MAIN)return void console.error("error this call only in main thread");let e=new MessageChannel;t.portInfo=e.port1,t.remote.postMessage({cmd:i.fb,transportId:t.id,data:e.port2},[e.port2])}setSabBufferInfo(t,e,s){this.type==l.THREAD_MAIN?(t.sabInfo||(t.sabInfo={}),s&&(s.useCopy=!0),e&&(e.useCopy=!0),t.sabInfo={sender:e,reciver:s},t.target_thread!=o.b.NO_THREAD&&(t.target_thread!=o.b.SELF_THREAD?this.setRemoteTransportSABBUffer(t,t.target_thread):t.setSabBuffer(e,s))):console.error("<<<<< setSabBufferInfo in sub thread")}addDataChannel(t){if(t instanceof h.a){try{this.checkTransport(t)}catch(t){console.error("addDataChannel error",t)}this.channellists.push(t)}else console.error("channel must be a DataChannelWrapper")}removeDataChannel(t){if(!(t instanceof h.a))return void console.error("channel must be a DataChannelWrapper");let e=this.channellists.indexOf(t);-1!==e&&this.channellists.splice(e,1)}removeTransportByRemote(t){let e=[];for(let s=0;s<this.channellists.length;s++){let n=this.channellists[s];n.remote===t&&e.push(n)}for(let t=0;t<e.length;t++)this.removeTransport(e[t])}reinit(){let t=[...this.transportlists];for(let e=0;e<t.length;e++)this.removeTransport(t[e])}getTransportByType(t){return this.mediadatachannel.getTransportByType(t)}addTransportListChangeListener(t){this.mediadatachannel.addEventListener(t)}remoteTransportListChangeListener(t){this.mediadatachannel.removeEventListener(t)}checkTransport(t){this.transportlists.forEach(e=>{if(!t.transportlists.includes(e.type))return;let s=t.target_thread||o.b.SELF_THREAD;s==e.target_thread||(this.type==l.THREAD_MAIN&&e.target_thread!=o.b.NO_THREAD&&e.target_thread!=s&&(this.unbindTransPortForChannel(e),this.bindMessageChannel(e)),e.target_thread=s,this.bindTransPortForChannel(e,t))})}bindTransPortForChannel(t,e){t.channel=e;let s=t.target_thread;if(s!=o.b.SELF_THREAD)this.createRemoteTransport(t,s),this.setRemoteTransportSABBUffer(t,s);else{var n,r,i,a;if(t.portInfo&&t.setMsgPort(t.portInfo),null!==(n=t.sabInfo)&&void 0!==n&&n.sender||null!==(r=t.sabInfo)&&void 0!==r&&r.reciver)t.setSabBuffer(null===(i=t.sabInfo)||void 0===i?void 0:i.sender,null===(a=t.sabInfo)||void 0===a?void 0:a.reciver);this.mediadatachannel.addTransport(t,e)}}unbindTransPortForChannel(t){t.target_thread!=o.b.SELF_THREAD?this.type==l.THREAD_MAIN&&this.closeRemoteTransport(t,t.target_thread):this.mediadatachannel.removeTransport(t)}getChannelByTransportType(t){for(let e=0;e<this.channellists.length;e++){let s=this.channellists[e];if(s.isReady()&&s.transportlists.includes(t))return s}return null}}r()(l,"THREAD_MAIN",1),r()(l,"THREAD_SUB",2)},function(t,e,s){"use strict";function n(t){return t[0]<<24|t[1]<<16|t[2]<<8|t[3]}s.d(e,"b",(function(){return i})),s.d(e,"c",(function(){return r})),s.d(e,"a",(function(){return o}));const r={IsQosReport:function(t){return 21==t[4]&&0==t[13]},GetQOSSeq:function(t){!function(t){t[0],t[1]}(t.slice(17,19))},GetQOSTime:function(t){return 104==t[0]||16!=t[4]&&1!=t[5]?n(t.slice(19,23)):n(t.slice(15,19))},IsVideoPkg:function(t){return 103==t[0]}};class i{constructor(t){let e=t||{};this.last_report_time=0,this.timeout_count=0,this.interval_report_time=e.interval||3e3,this.tag=e.tag||"monitor",this.max_timeout=0,this.min_timeout=2147483647,this.reportcallback=e.reportcallback,this._timeoutid=0}_report(){this.reportcallback&&this.reportcallback(this.tag,Math.ceil(this.max_timeout),Math.ceil(this.min_timeout),this.timeout_count),this.timeout_count=0,this.max_timeout=0,this.min_timeout=2147483647}timeoutReport(t,e){if(this.timeout_count++,t>this.max_timeout&&(this.max_timeout=t),t<this.min_timeout&&(this.min_timeout=t),this._timeoutid)return;let s=this;this._timeoutid=setTimeout(()=>{s._report(),s._timeoutid=0},this.interval_report_time)}}class o extends class{constructor(t){this._tag=t.tag||"MONITOR",this._base_time=0,this._interval_id=-1,this._timeout=Math.max(1e3,t.timeout||0),this._callback=t.callback}_report(){let t=Date.now(),e=this.getSamples(t);e||(e=[]);let s="".concat(this._base_time,":").concat(t-this._base_time,":").concat(e.join("|"));this._callback&&this._callback(this._tag,s)}getSamples(t){}onStart(){}onStop(){}start(){-1==this._interval_id&&(this._base_time=Date.now(),this._interval_id=setInterval(this._report.bind(this),this._timeout),this.onStart())}stop(){-1!=this._interval_id&&(clearInterval(this._interval_id),this._interval_id=-1,this._report(),this.onStop())}}{constructor(t){super(t),this._count=0}onStart(){this._count=0}sample(){this._count++}getSamples(t){return[this._count]}}},,function(t,e,s){"use strict";const n=t=>0==(t&t-1);let r=new class{constructor(){this._highFrequencyLogs={},this.fixVersion=""}setInstance(t,e){this._instance=t,this.fixVersion=e}getMessageFromErrorOrEvent(t,e){let s=t;return e instanceof ErrorEvent?(e.filename&&(s+=" File: ".concat(e.filename)),(e.lineno||e.colno)&&(s+=" Line: ".concat(e.lineno,":").concat(e.colno)),e.message&&(s+=" Message: ".concat(e.message)),e.error&&(s+="\nStack: ".concat(e.error.stack))):e instanceof Error?(e.fileName&&(s+=" File: ".concat(e.fileName)),(e.lineNumber||e.columnNumber)&&(s+=" Line: ".concat(e.lineNumber,":").concat(e.columnNumber)),e.message&&(s+=" Message: ".concat(e.message)),e.stack&&(s+=" Stack: ".concat(e.stack)),e.name&&(s+=" Name: ".concat(e.name)),e.constraint&&(s+=" Constraint: ".concat(e.constraint))):e instanceof CloseEvent?(e.code&&(s+=" Code: ".concat(e.code)),e.reason&&(s+=" Reason: ".concat(e.reason)),s+=" wasClean: ".concat(e.wasClean)):e instanceof DOMException?(e.message&&(s+=" Message: ".concat(e.message)),e.name&&(s+=" Name: ".concat(e.name))):s+=e?e.toString():"",s}error(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;t=this.getMessageFromErrorOrEvent(t,e),this._highFrequencyLogs[t]?this._highFrequencyLogs[t]+=1:this._highFrequencyLogs[t]=1;const s=n(this._highFrequencyLogs[t]);this._instance&&s&&this._instance.error(t,[this.fixVersion])}severityerror(t,e){this._instance&&this._instance.error(JSON.stringify(t),e)}directReport(t,e){var s,n;this._instance&&(e||(e=["MEDIASDK_INFO"]),null===(s=(n=this._instance).directReport)||void 0===s||s.call(n,{msg:t},e))}warn(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;t=this.getMessageFromErrorOrEvent(t,e),this._instance&&this._instance.warn(t)}log(t){this._instance&&this._instance.log(t)}clearHighFrequencyLogs(){this._highFrequencyLogs={}}};e.a=r},function(t,e,s){"use strict";s.d(e,"b",(function(){return i})),s.d(e,"a",(function(){return o})),s.d(e,"c",(function(){return a}));var n=s(11),r=s(16);class i{static getStorageForCapacity(){return new SharedArrayBuffer(8+((arguments.length>0&&void 0!==arguments[0]?arguments[0]:80)+1)*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:1500))}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1500,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:t.byteLength,o=arguments.length>6?arguments[6]:void 0;this.offset=r,this._BYTES_PER_ELEMENT=e,this.capacity=(i-8)/e,this.usableCapacity=this.capacity-1,this.buf=t,this.write_ptr=new Uint32Array(this.buf,r,1),this.read_ptr=new Uint32Array(this.buf,r+4,1),this.storageUint8sByteOffset=r+8,this.storageUint8s=new Uint8Array(this.buf,this.storageUint8sByteOffset,i-8),this.byteLength=i,this.label=s,this.usingOneElementBuffer=n,o&&(this.wasmMemory=o),n&&(this.oneElementBuffer=new ArrayBuffer(e)),this.repushhander=0,this.repushlogcount=0,this.monitorpace=0}checkBuffer(){this.wasmMemory&&this.wasmMemory.buffer!=this.buf&&(console.log("buffer change"),this.buf=this.wasmMemory.buffer,this.storageUint8s=new Uint8Array(this.buf,this.storageUint8sByteOffset,this.byteLength-8))}enqueue(t){return this.available_write()>0&&this.push(t),{rd:Atomics.load(this.read_ptr,0),wr:Atomics.load(this.write_ptr,0)}}enqueueSafe(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;for(this.dataBuffer||(this.dataBuffer=new n.a);this.dataBuffer.getLength()>0&&this.available_write()>0;){let t=this.dataBuffer.dequeue();t&&this.push(t)}let i=this.dataBuffer.getLength();if(t){if(this.available_write()>0&&0==i)return this.push(t),!0;if(!e)return!1;this.dataBuffer.enqueue(t),++i}if(i>0&&!this.repushhander&&(this.repushhander=setTimeout(()=>{this.repushlogcount%10==0&&console.warn("<<< retry consume cache data"),this.repushlogcount++,this.repushhander=0,this.enqueueSafe(null)},30)),i>=1e3&&(r.a.warn("Cached data in SAB reached critical value, will be cleared"),this.dataBuffer.clear(),s&&s("vqslclear")),i>0&&s){let t=performance.now();(!this.monitorpace||t-this.monitorpace>2e4)&&(this.monitorpace=t,s&&s("vqsl"+i))}return!0}push(t){return t instanceof Array?this._pushArray(t):this._push(t)}_pushArray(t){var e=Atomics.load(this.write_ptr,0);this.checkBuffer();let s=0;t.forEach(t=>{this.storageUint8s.set(t,e*this._BYTES_PER_ELEMENT+8+4+s),s+=t.byteLength}),new Uint32Array(this.buf,this.offset+e*this._BYTES_PER_ELEMENT+8,1)[0]=s;let n=(e+1)%this.capacity;return Atomics.store(this.write_ptr,0,n),!0}_push(t){var e=Atomics.load(this.write_ptr,0);this.checkBuffer(),this.storageUint8s.set(t,e*this._BYTES_PER_ELEMENT+8+4,t.byteLength),new Uint32Array(this.buf,this.offset+e*this._BYTES_PER_ELEMENT+8,1)[0]=t.byteLength;let s=(e+1)%this.capacity;return Atomics.store(this.write_ptr,0,s),!0}addReadPtr(){var t=Atomics.load(this.read_ptr,0);Atomics.store(this.read_ptr,0,(t+1)%this.capacity)}dequeue(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];var e=Atomics.load(this.read_ptr,0);this.checkBuffer();let s,n,r,i=new Uint32Array(this.buf,this.offset+e*this._BYTES_PER_ELEMENT+8,1);if(t){s=this.oneElementBuffer?new Uint8Array(this.oneElementBuffer,0,i[0]):new Uint8Array(i[0]);let t=new Uint8Array(this.storageUint8s.buffer,e*this._BYTES_PER_ELEMENT+8+4+this.storageUint8sByteOffset,s.byteLength);s.set(t,0)}else s=this.storageUint8s.subarray(e*this._BYTES_PER_ELEMENT+8+4,e*this._BYTES_PER_ELEMENT+8+4+i[0]),n=e*this._BYTES_PER_ELEMENT+8+4+this.storageUint8sByteOffset,r=e*this._BYTES_PER_ELEMENT+8+4+i[0]+this.storageUint8sByteOffset;return t&&Atomics.store(this.read_ptr,0,(e+1)%this.capacity),t?s:{bCopyData:t,uint8s:s,begin:n,end:r}}available_read(){var t=Atomics.load(this.read_ptr,0),e=Atomics.load(this.write_ptr,0);return this._available_read(t,e)}available_write(){var t=Atomics.load(this.read_ptr,0),e=Atomics.load(this.write_ptr,0);return this._available_write(t,e)}is_available_write(){var t=Atomics.load(this.read_ptr,0),e=Atomics.load(this.write_ptr,0);return this._is_available_write(t,e)}_available_read(t,e){return(e+this.capacity-t)%this.capacity}_available_write(t,e){return this.usableCapacity-this._available_read(t,e)}_is_available_write(t,e){return this._available_write(t,e)>0}_storage_capacity(){return this.capacity}}class o{constructor(t,e){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:50,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:80;if(!(t instanceof i))throw new Error("RingBuffer required");this.rb=t,this.dataCallback=e,this.interval=null,this.requestID=null,this.timeout_call=s,this.tick_lasted_time=0,this.timeoutMS=n,this.maxCount=r}setDataCallback(t){this.dataCallback=t}consume(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.interval||(this.bCopyData=e,this.interval=setInterval(()=>{let t=performance.now();if(this.timeout_call){if(0!=this.tick_lasted_time){let e=t-this.tick_lasted_time;e>=this.timeoutMS&&this.timeout_call(e,t)}this.tick_lasted_time=t}this._dequeue()},t),console.log("consume interval ".concat(this.interval)))}consumeAll(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.bCopyData=t,this._dequeue()}_dequeue(){let t=Math.min(this.rb.available_read(),this.maxCount);for(this.consoume_count=0;this.consoume_count<t;){this.consoume_count++;let t=this.rb.dequeue(this.bCopyData);this.dataCallback(t),this.bCopyData||this.rb.addReadPtr()}}_consumeForAnimationFrame(){this._dequeue(),this.requestID=requestAnimationFrame(this._consumeForAnimationFrame.bind(this))}consumeUsingRequestAnimationFrame(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.requestID||(this.bCopyData=t,this._consumeForAnimationFrame())}cancelConsume(){console.log("cancelConsume interval ".concat(this.interval," requestID ").concat(this.requestID)),this.tick_lasted_time=0,clearInterval(this.interval),this.requestID&&cancelAnimationFrame(this.requestID),this.interval=null,this.requestID=null}}class a{constructor(){this.timeStampKey="video_timestamp",this.keysList=["video_ssrc","video_width","video_height","rendering_x","rendering_y","rendering_w","rendering_h","rotation","yuv_limited"],this.bCopyData=null,this.begin=null,this.end=null}setOBJ(t){this.obj=t,this.yuvUint8s=t.data}setBuffer(t){!1===t.bCopyData?(this.objUint8s=t.uint8s,this.bCopyData=t.bCopyData,this.begin=t.begin,this.end=t.end):(this.objUint8s=t,this.bCopyData=!0,this.begin=0,this.end=t.byteLength)}buffer2Obj(){let t=new Uint32Array(this.objUint8s.buffer,this.begin,9),e=new DataView(this.objUint8s.buffer,this.begin+40,16),s={};this.keysList.forEach((e,n)=>{s[e]=t[n]}),s[this.timeStampKey]=Number(e.getBigUint64(0,!0));let n,r=Number(e.getBigUint64(8,!0)),i=new Uint8Array(this.objUint8s.buffer,this.begin+40+8+8,r);return n=(this.bCopyData,i),s.data=n,s}obj2buffer(){let t=new Uint8Array(56),e=this.keysList,s=new Uint32Array(t.buffer,0,9),n=new DataView(t.buffer,40,16);return e.forEach((t,e)=>{s[e]=this.obj[t]}),n.setBigUint64(0,BigInt(this.obj[this.timeStampKey]),!0),n.setBigUint64(8,BigInt(this.yuvUint8s.byteLength),!0),[t,this.yuvUint8s]}}},,,,,function(t,e,s){"use strict";var n=s(7),r=s.n(n),i=s(14);function o(t){let e=t||{};this._samples=[],this._interval_id=0,this._lasted_update_time=0,this._lasted_group_time=0,this._enable=!1,this._interval_time=e.interval||3e4,this._customer_callback=e.report_call,this._tag=e.tag||"netreport",this._group_interval=e.group_interval||1e3,this._enable_advanced=e.advanced||!1,this._current_count=0,this._qos_report=new i.b({tag:"jitter",interval:3e4,reportcallback:this._qos_report_timeout.bind(this)}),this._qos_report_samples=[],this._cureen_qos_report=0}o.prototype._qos_report_timeout=function(t,e,s,n){if(this._customer_callback){let r="".concat(t,",").concat(e,",").concat(s,",").concat(n);this._customer_callback(this._tag+"TimeOut",r)}},o.prototype._report=function(){let t=(new Date).getTime(),e="".concat(t,"-").concat(this._samples.length,"-").concat(this._samples),s="".concat(t,"-").concat(this._qos_report_samples.length,"-").concat(this._qos_report_samples);e=e.replaceAll(",","|"),s=s.replaceAll(",","|"),this._customer_callback?(this._customer_callback(this._tag,e),this._enable_advanced&&this._customer_callback(this._tag+"QOS",s)):console.error("tag:".concat(this._tag,",").concat(e))},o.prototype._group=function(){let t=performance.now();if(t>=this._lasted_group_time+1700){let e=Math.round((t-this._lasted_group_time)/1e3)-1;for(let t=0;t<e;t++)this._samples.push(-1)}this._lasted_group_time=t,this._samples.push(this._current_count),this._qos_report_samples.push(this._cureen_qos_report),this._cureen_qos_report=0,this._current_count=0,t>=this._lasted_update_time+this._interval_time&&(this._lasted_update_time=t,this._report(),this._samples=[],this._qos_report_samples=[])},o.prototype.start=function(){this._enable||(this._lasted_update_time=performance.now(),this._lasted_group_time=this._lasted_update_time,this._samples=[],this._current_count=0,this._qos_report_samples=[],this._cureen_qos_report=0,this._interval_id=setInterval(this._group.bind(this),this._group_interval),this._enable=!0)},o.prototype.stop=function(){this._enable&&(clearInterval(this._interval_id),this._interval_id=0,this._enable=!1)},o.prototype.sample=function(t){if(this._enable&&(this._current_count++,this._enable_advanced)){if(i.c.IsQosReport(t))return void this._cureen_qos_report++;if(i.c.IsVideoPkg(t)){let e=i.c.GetQOSTime(t),s=performance.now();if(this._lasted_qos_ts){let t=s-this._lasted_sys_ts-(e-this._lasted_qos_ts);t>30&&this._qos_report.timeoutReport(t,s)}this._lasted_qos_ts=e,this._lasted_sys_ts=s,this._lasted_data=t}}};var a=s(8),h=s(12),c=s(5);s.d(e,"b",(function(){return l})),s.d(e,"a",(function(){return u}));class l{constructor(t,e){this.type=t,this.transportlists=[],this.transfered=!!e,this.onmessage=()=>{}}send(){}isReady(){return!1}}class u{constructor(t,e,s,n){this.id=t,this.type=e,this.datachannel=s,this._recv_statistic=null,this.onmessageFn=null,this.disconnectedFn=null,this.connectedFn=null,this._status=u.UNINIT,this.target_thread=n,this.transfered=!1,this._listener=null,this.transportlists=[],this._send_statistic=null,this.report_monitor_func=()=>{}}isReady(){return this._status===u.CONNECTED}send(t){this.datachannel.send(t),this._send_statistic.sample(!1)}open(){if(this.target_thread)try{return this.target_thread.postMessage({command:a.h,id:this.id,type:this.type,channel:this.datachannel,transportlists:this.transportlists},[this.datachannel]),this.transfered=!0,this.datachannel=null,this._listener=this._mesagelistener.bind(this),void this.target_thread.addEventListener("message",this._listener)}catch(t){this.target_thread=null}this._addEventListener()}close(){let t=this.disconnectedFn;this.transfered&&this.target_thread&&this._listener&&(this.target_thread.removeEventListener("message",this._listener),this._listener=null,this.target_thread.postMessage({command:a.a,id:this.id,type:this.type})),this._status!=u.DISCONNECT&&this._clear(),this._status=u.DISCONNECT,null==t||t()}onmessage(t){this.onmessageFn=t}onopen(t){this.connectedFn=t}onclose(t){this.disconnectedFn=t}onerror(t){this.errorFn=t}_addEventListener(){this.datachannel.onmessage=this._onmessage.bind(this),this.datachannel.onopen=this._onopen.bind(this),this.datachannel.onclose=this._onclose.bind(this),this.datachannel.onclosing=this._onclose.bind(this),this.datachannel.onerror=this._onerror.bind(this),"open"==this.datachannel.readyState&&this._status==u.UNINIT&&this._onopen()}_onmessage(t){this._recv_statistic.sample(!1),this.onmessageFn(t)}_onopen(t){let e=this._status;var s;(this._status=u.CONNECTED,this.transfered||(this._send_statistic||(this._send_statistic=new o({tag:this.type==h.a.VIDEO?"VDCS":"ADCS",report_call:this.report_monitor_func})),this._recv_statistic||(this._recv_statistic=new o({tag:this.type==h.a.VIDEO?"VDCR":"ADCR",report_call:this.report_monitor_func})),this._send_statistic.start(),this._recv_statistic.start()),e!=u.CONNECTED)&&(null===(s=this.connectedFn)||void 0===s||s.call(this))}_onerror(t){var e;null===(e=this.errorFn)||void 0===e||e.call(this,t),this._onclose(t)}_onclose(t){let e=this._status;this._status=u.DISCONNECT;let s=this.disconnectedFn;this._clear(),e!=u.DISCONNECT&&(null==s||s())}_clear(){var t,e;!this.transfered&&this.datachannel&&(this.datachannel.onmessage=null,this.datachannel.onopen=null,this.datachannel.onclose=null,this.datachannel.onclosing=null,this.datachannel.onerror=null),this.onmessageFn=null,this.connectedFn=null,this.disconnectedFn=null,this.errorFn=null;let s=this.datachannel;this.datachannel=null,null===(t=this._send_statistic)||void 0===t||t.stop(),null===(e=this._recv_statistic)||void 0===e||e.stop(),null==s||s.close()}_mesagelistener(t){let e=t.data;if(e&&e.id==this.id)switch(e.cmd){case c.A:this._onclose();break;case c.C:this._onopen();break;case c.B:this._onerror(e.ev);break;case c.H:this.report_monitor_func(e.tag,e.data)}}}r()(u,"UNINIT",0),r()(u,"CONNECTED",1),r()(u,"DISCONNECT",2)},function(t,e,s){"use strict";s.d(e,"d",(function(){return o})),s.d(e,"b",(function(){return a})),s.d(e,"c",(function(){return c})),s.d(e,"e",(function(){return l})),s.d(e,"a",(function(){return u}));var n=s(12),r=s(6),i=s(13);function o(t){return new r.a({sock:new r.d,type:t,local:!1})}function a(t){try{const e="undefined"!=typeof DedicatedWorkerGlobalScope;if(r.a.dataTransportMgr)return;let s=new i.a({type:e?i.a.THREAD_SUB:i.a.THREAD_MAIN,remote:e?self:null});r.a.dataTransportMgr=s,s.monitorlogfn=t,e&&self.addEventListener("message",s._onrecvmainthreadlistener.bind(s))}catch(t){console.error("<<<< InitDataTransportModule",t)}}function h(t){return r.a.dataTransportMgr.getTransportByType(t)}function c(t){if(!r.a.dataTransportMgr)throw new Error("not InitDataTransportModule");r.a.dataTransportMgr.addDataChannel(t)}function l(t){if(!r.a.dataTransportMgr)throw new Error("not InitDataTransportModule");r.a.dataTransportMgr.removeDataChannel(t)}class u{constructor(){this._listener=this._listenerfn.bind(this),this.isSupportVideoShare=!1}addTransportListiner(){var t;t=this._listener,r.a.dataTransportMgr.addTransportListChangeListener(t)}remoteTransportListener(){var t;t=this._listener,r.a.dataTransportMgr.addTransportListChangeListener(t)}_listenerfn(t,e,s){this.connectSession(e)}setVideoShareModel(t){this.isSupportVideoShare=t}connectSession(t){const{type:e}=t;!t.transfered&&t.isReady()&&(e==n.a.VIDEO&&this.connectVideoSession(t),e==n.a.AUDIO&&this.connectAudioSession(t))}disconnectSession(t){const{type:e}=t;t.transfered||(e==n.a.VIDEO&&this.connectVideoSession(t),e==n.a.AUDIO&&this.connectAudioSession(t))}connectVideoSession(t){let e=new r.c,s=h(r.e.VIDEO_ENCODE)||e,n=h(r.e.VIDEO_DECODE)||e,i=h(r.e.SHARR_DECODE)||e,o=(null==t?void 0:t.isReady())?r.b.OPEN:r.b.CLOSED;s.setStatus(o),n.setStatus(o),this.isSupportVideoShare||i.setStatus(o),t.onmessage(t=>{var e=new Uint8Array(t.data);if((104==e[0]||132==e[0])&&0==e[1]||20==e[0]||130==e[0])s.send(e);else{if(!this.isSupportVideoShare&&(133==e[0]||132==e[0]))return void i.send(e);n.send(e)}});const a=e=>{t.send(e)};s.onmessage=a,n.onmessage=a,i.onmessage=a}connectAudioSession(t){let e=new r.c,s=h(r.e.AUDIO_ENCODE)||e,n=h(r.e.AUDIO_DECODE)||e,i=t.isReady()?r.b.OPEN:r.b.CLOSED;s.setStatus(i),n.setStatus(i),t.onmessage(t=>{var e=new Uint8Array(t.data);108==e[0]&&0==e[1]?s.send(e):n.send(e)});const o=e=>{t.send(e)};s.onmessage=o,n.onmessage=o}notifyTransportStatus(t,e){}}},,function(t,e){function s(e){return t.exports=s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,s(e)}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,s){"use strict";s.d(e,"a",(function(){return o}));var n=s(7),r=s.n(n),i=s(5);function o(t){a.instance||(a.instance=new a),a.instance.start(t)}class a{constructor(){this._interval=-1,this.monitorworkers={},this._lasted_timestamp=-1,this.timeoutcallbackfn=(t,e)=>{}}setTimeoutCallback(t){this.timeoutcallbackfn=t}registerWorker(t,e){if(t in this.monitorworkers){let e=this.monitorworkers[t];e.worker.removeEventListener("message",e.listener),delete this.monitorworkers[t]}let s={id:t,worker:e},n=this._recvheartbeat.bind(this,s);s.listener=n,s.lastedtimestamp=Date.now(),s.worker.addEventListener("message",s.listener),this.monitorworkers[t]=s}unRegisterWorker(t){if(!(t in this.monitorworkers))return;let e=this.monitorworkers[t];delete this.monitorworkers[t],e.worker.removeEventListener("message",e.listener)}_recvheartbeat(t,e){let s=e.data;s.cmd===i.Db&&(t.lastedtimestamp=s.timestamp)}start(t){const e="undefined"!=typeof DedicatedWorkerGlobalScope&&t&&t instanceof DedicatedWorkerGlobalScope;if(-1!=this._interval)return;if(e)return void(this._interval=setInterval(()=>{t.postMessage({cmd:i.Db,timestamp:Date.now()})},a.INTREVAL_TIME_MS));const s=Math.max(a.INTREVAL_TIME_MS-1e3,500);this._lasted_timestamp=Date.now(),this._interval=setInterval(()=>{let t=a.instance,e=Object.keys(t.monitorworkers),n=Date.now(),r=this._lasted_timestamp;n<r+s||(this._lasted_timestamp=n,n>r+a.HEART_TIMEOUT_MS?t.timeoutcallbackfn("MAIN",n-r):e.forEach(e=>{var s;let r=t.monitorworkers[e],i=r.lastedtimestamp+(null!==(s=document)&&void 0!==s&&s.hidden?a.MAX_HEART_TIMEOUT_MS:a.HEART_TIMEOUT_MS);n>i&&(t.timeoutcallbackfn(r.id,n-r.lastedtimestamp),r.lastedtimestamp=n)}))},a.INTREVAL_TIME_MS)}close(){try{Object.keys(this.monitorworkers).forEach(t=>{let e=this.monitorworkers[t];delete this.monitorworkers[t],e.worker.removeEventListener("message",e.listener)}),this._interval&&clearInterval(this._interval),this._interval=-1}catch(t){}}}r()(a,"INTREVAL_TIME_MS",3e3),r()(a,"HEART_TIMEOUT_MS",15e3),r()(a,"MAX_HEART_TIMEOUT_MS",3e4),r()(a,"instance",null)},,,,,,,,,function(t,e,s){var n=s(25).default,r=s(36);t.exports=function(t){var e=r(t,"string");return"symbol"===n(e)?e:String(e)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,s){var n=s(25).default;t.exports=function(t,e){if("object"!==n(t)||null===t)return t;var s=t[Symbol.toPrimitive];if(void 0!==s){var r=s.call(t,e||"default");if("object"!==n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)},t.exports.__esModule=!0,t.exports.default=t.exports},,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,s){"use strict";s.r(e);var n=s(22),r=s(8),i=s(5),o=s(23),a=s(26);let h="undefined"!=typeof RTCDataChannel;postMessage([h]),Object(o.b)((function(t,e){if(!c.length)return;f(c[0],t,data)})),Object(a.a)(self);self.onmessage=t=>{let e=t.data;switch(e.command){case r.f:p.setVideoShareModel(e.data);break;case r.h:!function(t,e,s,r){let i=new n.a(t,e,s,null);i.transportlists=r,i.open(),i.onmessage(l),i.onopen(u.bind(null,i)),i.onclose(_.bind(null,i)),i.onerror(d.bind(null,i)),i.report_monitor_func=f.bind(null,i),c.push(i)}(e.id,e.type,e.channel,e.transportlists);break;case r.a:!function(t){let e=c.findIndex(e=>e.id==t);if(-1==e)return;let[s]=c.splice(e,1);s.close(),Object(o.e)(s)}(e.id)}};let c=[];function l(t){}function u(t,e){postMessage({cmd:i.C,id:t.id}),t.isReady()&&(Object(o.c)(t),p.connectSession(t))}function d(t,e){postMessage({cmd:i.B,id:t.id,ev:e}),p.disconnectSession(new n.b(t.type,t.transfered)),Object(o.e)(t)}function _(t,e){postMessage({cmd:i.A,id:t.id}),p.disconnectSession(new n.b(t.type,t.transfered)),Object(o.e)(t)}function f(t,e,s){postMessage({cmd:i.H,id:t.id,tag:e,data:s})}let p=new o.a;p.addTransportListiner()}]); //# sourceMappingURL=https://d1cdksi819e9z7.cloudfront.net/sourcemap/net_thread.min.js-e8033f4192aec793754b.map