@zoom/meetingsdk 3.13.0 → 3.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -8
- package/dist/lib/av/annoter.min.js +1 -1
- package/dist/lib/av/audio.encode.wasm +0 -0
- package/dist/lib/av/audio.simd.wasm +0 -0
- package/dist/lib/av/audio_simd.min.js +1 -1
- package/dist/lib/av/js_audio_process.min.js +1 -1
- package/dist/lib/av/js_media.min.js +2 -2
- package/dist/lib/av/net_thread.min.js +1 -1
- package/dist/lib/av/pako.min.js +1 -1
- package/dist/lib/av/sharing_m.min.js +2 -2
- package/dist/lib/av/sharing_mtsimd.min.js +2 -2
- package/dist/lib/av/sharing_s.min.js +2 -2
- package/dist/lib/av/sharing_simd.min.js +2 -2
- package/dist/lib/av/video.decode.wasm +0 -0
- package/dist/lib/av/video.mt.wasm +0 -0
- package/dist/lib/av/video.mtsimd.js +1 -1
- package/dist/lib/av/video.mtsimd.wasm +0 -0
- package/dist/lib/av/video.simd.js +1 -1
- package/dist/lib/av/video.simd.wasm +0 -0
- package/dist/lib/av/video_m.min.js +2 -2
- package/dist/lib/av/video_mtsimd.min.js +2 -2
- package/dist/lib/av/video_s.min.js +2 -2
- package/dist/lib/av/video_share_mtsimd.min.js +3 -3
- package/dist/lib/av/video_simd.min.js +2 -2
- package/dist/lib/av/wmsc.min.js +1 -1
- package/dist/ui/zoomus-websdk-zoommtgMain.umd.min.js +1 -1
- package/dist/{zoom-meeting-3.13.0.min.js → zoom-meeting-3.13.1.min.js} +2 -2
- package/dist/zoom-meeting-embedded-ES5.min.js +2 -2
- package/dist/zoomus-websdk-embedded.umd.min.js +3 -3
- package/dist/zoomus-websdk.umd.min.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
!function(e){var t={};function n(s){if(t[s])return t[s].exports;var r=t[s]={i:s,l:!1,exports:{}};return e[s].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,s){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(n.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(s,r,function(t){return e[t]}.bind(null,r));return s},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=59)}([,,,function(e,t,n){"use strict";var s=n(5),r=n(16);new Error;const i=new Map;function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"|";return e?e.toString().replaceAll(/[,,]/g,t):""}let o=null,u=null;function c(e,t){var n,s;if(!function(e){const t=performance.now();return(!i.has(e)||t-i.get(e)>5e3)&&(i.set(e,t),!0)}(e))return;let c;try{c=a("object"==typeof t?JSON.stringify(t):t)}catch(e){c=a(t)}null===(n=u)||void 0===n||n("NEM-".concat(e,"-").concat(c)),r.a.error("NotifyUIError,event=".concat(e,",data=").concat(c)),null===(s=o)||void 0===s||s(e,t)}var l=n(15);function h(){return self.GROWABLE_HEAP_I8?self.GROWABLE_HEAP_I8():Module.HEAP8}function d(){return self.GROWABLE_HEAP_U8?self.GROWABLE_HEAP_U8():Module.HEAPU8}function f(){return self.GROWABLE_HEAP_U16?self.GROWABLE_HEAP_U16():Module.HEAPU16}function _(){return self.GROWABLE_HEAP_U32?self.GROWABLE_HEAP_U32():Module.HEAPU32}function p(){return self.GROWABLE_HEAP_F32?self.GROWABLE_HEAP_F32():Module.HEAPF32}async function m(e,t){try{const n=await new Promise((e,t)=>{const n=s=>{let r=s.data;"DOWNLOAD_WASM_FROM_MAIN_THREAD_OK"===r.command?(v("DE"),self.removeEventListener("message",n),e(r.data)):"DOWNLOAD_WASM_FROM_MAIN_THREAD_FAILED"===r.command&&(self.removeEventListener("message",n),t(new Error("Failed to download WASM file: ".concat(wasmUrl," from main thread"))))};self.addEventListener("message",n),v("DS"),postMessage({status:s.E,url:wasmUrl})});let r=await WebAssembly.instantiate(n,e);r.instance?(self.wasmModuleToShare=r.module,t(r.instance)):(self.wasmModuleToShare=n,t(r))}catch(e){v("IF"),g("E:H Failed to download and instantiate WASM file: ".concat(wasmUrl),e)}}n.d(t,"d",(function(){return h})),n.d(t,"g",(function(){return d})),n.d(t,"e",(function(){return f})),n.d(t,"f",(function(){return _})),n.d(t,"c",(function(){return p})),n.d(t,"q",(function(){return m})),n.d(t,"i",(function(){return E})),n.d(t,"u",(function(){return g})),n.d(t,"t",(function(){return A})),n.d(t,"o",(function(){return v})),n.d(t,"n",(function(){return S})),n.d(t,"v",(function(){return y})),n.d(t,"w",(function(){return T})),n.d(t,"p",(function(){return w})),n.d(t,"s",(function(){return D})),n.d(t,"k",(function(){return I})),n.d(t,"m",(function(){return C})),n.d(t,"r",(function(){return R})),n.d(t,"l",(function(){return U})),n.d(t,"x",(function(){return x})),n.d(t,"b",(function(){return F})),n.d(t,"h",(function(){return W})),n.d(t,"y",(function(){return q})),n.d(t,"a",(function(){return j})),n.d(t,"j",(function(){return V}));const b="function"!=typeof importScripts;function E(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;b?r.a.error(e,t):g(e,t)}function g(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;var n,r,i,a;(t instanceof Error||t instanceof ErrorEvent)&&(e+=" Message: "+(null===(n=t)||void 0===n?void 0:n.message)+" Stack: "+(null!==(r=null===(i=t)||void 0===i||null===(i=i.error)||void 0===i?void 0:i.stack)&&void 0!==r?r:null===(a=t)||void 0===a?void 0:a.stack),t=null);postMessage({status:s.G,errorMessage:e,errorEvent:t})}function A(e){postMessage({status:s.G,errorMessage:e,level:"low"})}function v(e){postMessage({status:s.zb,data:e})}function S(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t)return t.postMessage({status:s.f,data:e});postMessage({status:s.f,data:e})}function y(e){postMessage({status:s.M,canvasId:e,replaceCanvas:!1})}function T(e){postMessage({status:s.N,canvasId:e})}function w(e){b?c(l.k,e):postMessage({status:s.Bb,where:e})}function M(){let e=this;this.promise=new Promise((function(t,n){e.reject=n,e.resolve=t}))}function D(e){let t;try{if(t=null==e?void 0:e.getContext("2d",{willReadFrequently:!0}),!t)throw new Error("getContext return null for willReadFrequently, canvas:".concat(e))}catch(n){t=null==e?void 0:e.getContext("2d")}return t||g("get2DContextFromCanvas return null"),t}class I{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15e5;this.uint8Map={},this.availableIndex=[],this.capacity=e,this.bytesPerElement=t,this.avaiableIndexMap={},this.deferedList=[];for(let n=0;n<e;n++)this.uint8Map[n]=new Uint8Array(t),this.availableIndex.push(n),this.avaiableIndexMap[n]=!0}increaseBufferSize(e){let t=this.bytesPerElement+e;this.bytesPerElement=t;for(let e=0;e<this.capacity;e++){let n=this.uint8Map[e],s=new Uint8Array(t);s.set(n,0),this.uint8Map[e]=s}}getCapacity(){return this.capacity}get(){if(this.availableIndex.length>0){let e=this.availableIndex.shift();return this.avaiableIndexMap[e]=!1,new Promise((t,n)=>{t({index:e,uint8s:this.uint8Map[e]})})}{let e=new M;return this.deferedList.push(e),e.promise}}getSync(){if(this.availableIndex.length>0){let e=this.availableIndex.shift();return this.avaiableIndexMap[e]=!1,{index:e,uint8s:this.uint8Map[e]}}return null}recycle(e){if(!0!==this.avaiableIndexMap[e]&&(this.avaiableIndexMap[e]=!0,this.availableIndex.push(e),this.deferedList.length>0)){this.deferedList.shift().resolve(this.get())}}}class C{constructor(e){this.sharedBufferList=e}storeFlexible(e,t){let n=e.byteLength-this.sharedBufferList.bytesPerElement;if(n>0){let e=Math.floor(.1*this.sharedBufferList.bytesPerElement),s=n>e?n:e;if(s+this.sharedBufferList.bytesPerElement>t)return Promise.reject("too big, more than maxBytesPerElement");this.sharedBufferList.increaseBufferSize(s)}return this.store(e)}store(e){return this.sharedBufferList.get().then(t=>{try{return this.obj=t,t.uint8s.set(e,0),this.yuvdata=new Uint8Array(t.uint8s.buffer,0,e.byteLength),!0}catch(e){throw e}finally{this.autoRecycle()}})}storeSync(e){let t=this.sharedBufferList.getSync();return null!==t&&(this.obj=t,t.uint8s.set(e,0),this.yuvdata=new Uint8Array(t.uint8s.buffer,0,e.byteLength),!0)}autoRecycle(){this.autoRecycleInterval=setTimeout(()=>{console.log("autoRecycle",this.obj.index),this.recycle()},5e3)}recycle(){try{this.autoRecycleInterval&&clearInterval(this.autoRecycleInterval),this.sharedBufferList.recycle(this.obj.index)}catch(e){g("Error in YuvWrap.recycle: ".concat(e))}}}function O(e,t){t>=e.groupSize||(e.openStatusArray[t]?console.warn("group web transport index ".concat(t,", status reopene")):(e.openStatusArray[t]=!0,e.openedCount+=1,e.openedCount>1||e.params.onopen(e)))}function k(e,t){t>=e.groupSize||(e.openStatusArray[t]?(e.openStatusArray[t]=!1,e.openedCount>0&&(e.openedCount-=1,0==e.openedCount&&e.params.onclose(e))):console.warn("group web transport index ".concat(t,", not open")))}const L=["","MOZ_","OP_","WEBKIT_"];function R(e,t){for(var n=0;n<L.length;++n){var s=L[n]+t,r=e.getExtension(s);if(r)return r}}class U{constructor(e){this.params=e,this.label=this.params.label||"",this.id=this.params.id||0,this.groupSize=e.groupSize,this.openedCount=0,this.sendIndex=0,this.transportArray=[],this.openStatusArray=[];for(let e=0;e<this.groupSize;e++)this.transportArray.push(null),this.openStatusArray.push(!1)}async connect(){for(let e=0;e<this.groupSize;e++){let t=this.params.url;e>0&&(t+="&index="+e);let n={url:t,label:this.params.label,id:this.id,onmessage:this.params.onmessage,onopen:O,onclose:k,group:this,index:e},s=new N(n);await s.connect(),this.transportArray[e]=s}}send(e){if(!(this.openedCount<=0))for(let t=0;t<this.groupSize;t++){this.sendIndex+=1;let t=this.sendIndex%this.groupSize;if(this.transportArray[t]&&this.openStatusArray[t]){this.transportArray[t].send(e);break}}}forceClose(){for(let e=0;e<this.groupSize;e++)this.transportArray[e]&&this.transportArray[e].forceClose()}}class N{constructor(e){this.params=e,this.label=this.params.label||"",this.id=this.params.id||0,this.successfulConnectedCount=0,this.connectIndex=0,this.heartbeat=new Uint8Array([104,101,97,114,116,98,101,97,116]),this.transport=null,this.transport_ready=!1,this.isDestroyed=!1,this.inReading=!1,this.heartbeatStarted=!1,this.reader=null}async connect(){this.reconnect()}async reconnect(){if(this.isReconnectNow||this.isTimerExist||this.isDestroyed)return;this.isReconnectNow=!0,this.isTimerExist=!0;let e=Math.pow(2,this.connectIndex)-1;this.connectIndex+=1,setTimeout(async()=>{if(this.isDestroyed)return;this.isTimerExist=!1;let{url:e}=this.params,t=new WebTransport(e);this.transport=t,t.closed.then(()=>{this.reader=null,this.transport_ready=!1,this.params.onclose&&this.params.onclose(this.params.group,this.params.index)}).catch(e=>{this.reader=null,this.transport_ready=!1,this.params.onerror&&this.params.onerror(e),this.params.onclose(this.params.group,this.params.index),this.connectIndex<8&&this.reconnect()});try{if(this.isReconnectNow=!1,await t.ready,this.isDestroyed)return void this.close();this.transport_ready=!0,this.successfulConnectedCount++,t.datagrams.incomingMaxAge=1e3,t.datagrams.outgoingMaxAge=100,t.datagrams.incomingHighWaterMark=800,t.datagrams.outgoingHighWaterMark=800,this.writer=t.datagrams.writable.getWriter(),this.reader=t.datagrams.readable.getReader(),await this.writer.ready,this.params.onopen(this.params.group,this.params.index)}catch(e){return this.params.onerror&&this.params.onerror(e),void this.close()}this.startHeartbeat(),this.read()},1e3*e)}send(e){this.transport_ready&&this.writer.write(e)}async sendAwaitReady(e){this.transport_ready&&await this.writer.ready,this.transport_ready&&await this.writer.write(e)}async startHeartbeat(){if(!this.heartbeatStarted)for(this.heartbeatStarted=!0;;)try{await this.sleep(3e3),await this.sendAwaitReady(this.heartbeat)}catch(e){}}sleep(e){return new Promise(t=>setTimeout(t,e))}localTime(){let e=new Date;return"local time : "+e.getDate()+"/"+(e.getMonth()+1)+"/"+e.getFullYear()+" @ "+e.getHours()+":"+e.getMinutes()+":"+e.getSeconds()+" "}close(){try{this.transport_ready=!1,this.transport&&this.transport.close()}catch(e){}}forceClose(){this.isDestroyed||(this.isDestroyed=!0,this.close())}async read(){if(!this.inReading){for(this.inReading=!0;this.reader;)try{const{value:e,done:t}=await this.reader.read();if(t)break;this.params.onmessage(e)}catch(e){break}this.inReading=!1}}}const P=new Map,B=[90,180,360,720,1080],H=new class{constructor(){this.ssrcInfoMap=new Map,this.timer=null}updateSSRCInfo(e,t){this.ssrcInfoMap.has(e)||this.ssrcInfoMap.set(e,{firstTime:0,lastTime:0,frames:0,fps:0}),this._calculateFPS(e,t),this._removeZeroFPS()}_calculateFPS(e,t){const n=this.ssrcInfoMap.get(e);if(0===n.frames?n.firstTime=t:n.lastTime=t,n.frames+=1,n.frames>2&&n.frames%5==0&&n.lastTime-n.firstTime>=1e3){const t=Math.floor(1e3/((n.lastTime-n.firstTime)/(n.frames-1)));n.fps!==t&&(this._notifyFPS(e,t),n.fps=t),n.firstTime=n.lastTime,n.frames=1}}_removeZeroFPS(){let e=Date.now();this.ssrcInfoMap.forEach((t,n)=>{const s=this.ssrcInfoMap.get(n);s&&e-s.lastTime>2e3&&(this.ssrcInfoMap.delete(n),this._notifyFPS(n,0))})}_notifyFPS(e,t){postMessage({status:s.u,data:{ssrc:e,fps:t}})}_checkIfNewFrameComing(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout(()=>{this._removeZeroFPS(),this.timer=null},2500)}};function x(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const{r_w:r,r_h:i,rotation:a,ssrc:o}=e;let u=1==a||3==a,c=u?i:r,l=u?r:i;const h=o>>10<<10,d=B.reduce((e,t)=>Math.abs(e-l)>Math.abs(t-l)?t:e,B[0]),f=B.findIndex(e=>e===d);if(!P.get(h)||P.get(h).width!==c||P.get(h).height!==l){const e={width:c,height:l,ssrc:h,quality:f};P.set(h,e),n?n(e):postMessage({status:s.v,data:e})}t&&H.updateSSRCInfo(h,Date.now())}function F(e,t){return e&&t?Math.abs(e/t-4/3)<.01?2:Math.abs(e/t-16/9)<.01?3:1:1}function W(e,t,n,s,r){if(!r&&!s||1==e)return!1;let i=s&&t>=640,a=r&&t>=1280;return 2!=e||640==t&&480==n?i||a:((i||a)&&E("ratio is 4:3 but wencodec not supported width: ".concat(t,", height: ").concat(n)),!1)}function q(e,t){e?e.send(t):g("websocket is null",new Error("message type ".concat(t[0])))}function j(e){return e&&"undefined"!=typeof atob?Uint8Array.from(atob(e),e=>e.charCodeAt(0)):null}function V(e,t){return t&&(!e||e.websocketaddress!=t)}},function(e,t,n){"use strict";n.d(t,"y",(function(){return s})),n.d(t,"Y",(function(){return r})),n.d(t,"L",(function(){return i})),n.d(t,"K",(function(){return a})),n.d(t,"J",(function(){return o})),n.d(t,"v",(function(){return u})),n.d(t,"q",(function(){return c})),n.d(t,"r",(function(){return l})),n.d(t,"w",(function(){return h})),n.d(t,"x",(function(){return d})),n.d(t,"u",(function(){return f})),n.d(t,"X",(function(){return _})),n.d(t,"P",(function(){return p})),n.d(t,"Q",(function(){return m})),n.d(t,"O",(function(){return b})),n.d(t,"M",(function(){return E})),n.d(t,"s",(function(){return g})),n.d(t,"k",(function(){return A})),n.d(t,"n",(function(){return v})),n.d(t,"l",(function(){return S})),n.d(t,"m",(function(){return y})),n.d(t,"db",(function(){return T})),n.d(t,"B",(function(){return w})),n.d(t,"C",(function(){return M})),n.d(t,"W",(function(){return D})),n.d(t,"ab",(function(){return I})),n.d(t,"V",(function(){return C})),n.d(t,"Z",(function(){return O})),n.d(t,"N",(function(){return k})),n.d(t,"h",(function(){return L})),n.d(t,"g",(function(){return R})),n.d(t,"f",(function(){return U})),n.d(t,"A",(function(){return N})),n.d(t,"z",(function(){return P})),n.d(t,"S",(function(){return B})),n.d(t,"R",(function(){return H})),n.d(t,"e",(function(){return x})),n.d(t,"o",(function(){return F})),n.d(t,"T",(function(){return W})),n.d(t,"U",(function(){return q})),n.d(t,"G",(function(){return j})),n.d(t,"E",(function(){return V})),n.d(t,"H",(function(){return Y})),n.d(t,"I",(function(){return z})),n.d(t,"F",(function(){return G})),n.d(t,"bb",(function(){return Z})),n.d(t,"c",(function(){return K})),n.d(t,"b",(function(){return X})),n.d(t,"cb",(function(){return Q})),n.d(t,"d",(function(){return J})),n.d(t,"t",(function(){return $})),n.d(t,"D",(function(){return ee})),n.d(t,"p",(function(){return te})),n.d(t,"a",(function(){return ne})),n.d(t,"j",(function(){return se})),n.d(t,"i",(function(){return re}));const s=1e3,r=5,i=43,a=44,o=45,u=0,c=1,l=146,h=2,d=7,f=9,_=17,p=10,m=11,b=12,E=102,g=107,A=0,v=1,S=2,y=3,T=65,w=0,M=1,D=-1,I=0,C=1,O=2,k=3,L=1,R=2,U=3,N={SESSION_TYPE_CONF:0,SESSION_TYPE_AUDIO:1,SESSION_TYPE_DESKSHARE:2,SESSION_TYPE_VIDEO:3,SESSION_TYPE_CHAT:4,SESSION_TYPE_TELEPHONE:5,SESSION_TYPE_ZC_PING:6,SESSION_TYPE_TOTAL_CNT:7},P={CONNECT_TYPE_UDP:0,CONNECT_TYPE_TCP:1},B=24,H=20,x=15,F=10,W=8294400,q=5,j=0,V=1,Y=2,z=15,G=5,Z=400,K=7,X=8,Q={DESKTOP:0,MOBILE:1,ANDROID:2,IPHONE:3},J={DESKTOP_SOURCE:0,UAC_SOURCE:1},$={SHARE_REMOTE_CONTROL_UAC_MOUSE:144,SHARE_REMOTE_CONTROL_UAC_JPEG_FRAME:145},ee=1,te=25,ne=1,se=(new Map([["useinbandfec",{value:1,operater:"add"}],["maxaveragebitrate",{value:48e3,operater:"add"}],["maxplaybackrate",{value:24e3,operater:"add"}],["sprop-maxcapturerate",{value:24e3,operater:"add"}],["sprop-stereo",{value:1,operater:"sub"}],["stereo",{value:1,operater:"sub"}]]),new Map([["useinbandfec",{value:1,operater:"sub"}],["maxaveragebitrate",{value:96e3,operater:"add"}],["maxplaybackrate",{value:48e3,operater:"add"}],["sprop-maxcapturerate",{value:48e3,operater:"add"}],["sprop-stereo",{value:1,operater:"add"}],["stereo",{value:1,operater:"add"}]]),new Map([["useinbandfec",{value:1,operater:"sub"}],["maxaveragebitrate",{value:96e3,operater:"add"}],["maxplaybackrate",{value:48e3,operater:"add"}],["sprop-maxcapturerate",{value:48e3,operater:"add"}],["sprop-stereo",{value:1,operater:"add"}],["stereo",{value:1,operater:"add"}]]),new Map([["useinbandfec",{value:1,operater:"sub"}],["maxaveragebitrate",{value:128e3,operater:"add"}],["maxplaybackrate",{value:48e3,operater:"add"}],["sprop-maxcapturerate",{value:48e3,operater:"add"}],["sprop-stereo",{value:1,operater:"add"}],["stereo",{value:1,operater:"add"}]]),new Map([["useinbandfec",{value:1,operater:"sub"}],["maxaveragebitrate",{value:128e3,operater:"add"}],["maxplaybackrate",{value:48e3,operater:"add"}],["sprop-maxcapturerate",{value:48e3,operater:"add"}],["sprop-stereo",{value:1,operater:"add"}],["stereo",{value:1,operater:"add"}]]),new Map([["useinbandfec",{value:1,operater:"sub"}],["maxaveragebitrate",{value:"96000",operater:"add"}],["maxplaybackrate",{value:"48000",operater:"add"}],["sprop-maxcapturerate",{value:"48000",operater:"add"}]]),new Map([["useinbandfec",{value:1,operater:"add"}],["maxaveragebitrate",{value:64e3,operater:"add"}],["maxplaybackrate",{value:24e3,operater:"add"}],["sprop-maxcapturerate",{value:24e3,operater:"add"}],["sprop-stereo",{value:1,operater:"sub"}],["stereo",{value:1,operater:"sub"}]]),{VIDEO:0,SHARE:1}),re={PAUSE:0,RESUME:1,STOP:2}},function(e,t,n){"use strict";n.d(t,"j",(function(){return s})),n.d(t,"h",(function(){return r})),n.d(t,"l",(function(){return i})),n.d(t,"sb",(function(){return a})),n.d(t,"qb",(function(){return o})),n.d(t,"ub",(function(){return u})),n.d(t,"Z",(function(){return c})),n.d(t,"d",(function(){return l})),n.d(t,"bb",(function(){return h})),n.d(t,"db",(function(){return d})),n.d(t,"D",(function(){return f})),n.d(t,"ob",(function(){return _})),n.d(t,"H",(function(){return p})),n.d(t,"Eb",(function(){return m})),n.d(t,"n",(function(){return b})),n.d(t,"vb",(function(){return E})),n.d(t,"E",(function(){return g})),n.d(t,"b",(function(){return A})),n.d(t,"zb",(function(){return v})),n.d(t,"S",(function(){return S})),n.d(t,"I",(function(){return y})),n.d(t,"T",(function(){return T})),n.d(t,"xb",(function(){return w})),n.d(t,"f",(function(){return M})),n.d(t,"nb",(function(){return D})),n.d(t,"mb",(function(){return I})),n.d(t,"eb",(function(){return C})),n.d(t,"X",(function(){return O})),n.d(t,"V",(function(){return k})),n.d(t,"a",(function(){return L})),n.d(t,"z",(function(){return R})),n.d(t,"Fb",(function(){return U})),n.d(t,"G",(function(){return N})),n.d(t,"wb",(function(){return P})),n.d(t,"v",(function(){return B})),n.d(t,"u",(function(){return H})),n.d(t,"t",(function(){return x})),n.d(t,"w",(function(){return F})),n.d(t,"U",(function(){return W})),n.d(t,"jb",(function(){return q})),n.d(t,"kb",(function(){return j})),n.d(t,"R",(function(){return V})),n.d(t,"hb",(function(){return Y})),n.d(t,"ib",(function(){return z})),n.d(t,"F",(function(){return G})),n.d(t,"r",(function(){return Z})),n.d(t,"q",(function(){return K})),n.d(t,"y",(function(){return X})),n.d(t,"p",(function(){return Q})),n.d(t,"x",(function(){return J})),n.d(t,"Cb",(function(){return $})),n.d(t,"O",(function(){return ee})),n.d(t,"P",(function(){return te})),n.d(t,"Ab",(function(){return ne})),n.d(t,"C",(function(){return se})),n.d(t,"B",(function(){return re})),n.d(t,"A",(function(){return ie})),n.d(t,"K",(function(){return ae})),n.d(t,"J",(function(){return oe})),n.d(t,"L",(function(){return ue})),n.d(t,"o",(function(){return ce})),n.d(t,"s",(function(){return le})),n.d(t,"gb",(function(){return he})),n.d(t,"fb",(function(){return de})),n.d(t,"Db",(function(){return fe})),n.d(t,"Q",(function(){return _e})),n.d(t,"i",(function(){return pe})),n.d(t,"g",(function(){return me})),n.d(t,"k",(function(){return be})),n.d(t,"m",(function(){return Ee})),n.d(t,"rb",(function(){return ge})),n.d(t,"pb",(function(){return Ae})),n.d(t,"tb",(function(){return ve})),n.d(t,"Y",(function(){return Se})),n.d(t,"cb",(function(){return ye})),n.d(t,"ab",(function(){return Te})),n.d(t,"c",(function(){return we})),n.d(t,"M",(function(){return Me})),n.d(t,"Bb",(function(){return De})),n.d(t,"N",(function(){return Ie})),n.d(t,"yb",(function(){return Ce})),n.d(t,"W",(function(){return Oe})),n.d(t,"lb",(function(){return ke})),n.d(t,"e",(function(){return Le}));const s=1,r=2,i=3,a=7,o=8,u=9,c=12,l=14,h=15,d=16,f=18,_=20,p=21,m=24,b=26,E=27,g=30,A=31,v=35,S=36,y=37,T=38,w=47,M=48,D=50,I=51,C=52,O=53,k=54,L=56,R=57,U=60,N=61,P=62,B=66.5,H=66.6,x=67,F=68,W=69,q=71,j=72,V=73,Y=75,z=76,G=78,Z=105,K=106,X=107,Q=108,J=109,$=120,ee=121,te=122,ne=123,se=124,re=125,ie=126,ae=127,oe=128,ue=129,ce=132,le=133,he=135,de=136,fe=137,_e=151,pe=-1,me=-2,be=-3,Ee=-5,ge=-7,Ae=-8,ve=-9,Se=-12,ye=-14,Te=-15,we=-23,Me=-26,De=-27,Ie=-28,Ce=-35,Oe=-129,ke=-130,Le=-131},function(e,t,n){"use strict";n.d(t,"e",(function(){return l})),n.d(t,"b",(function(){return d})),n.d(t,"d",(function(){return f})),n.d(t,"a",(function(){return _})),n.d(t,"c",(function(){return p}));var s=n(7),r=n.n(s),i=n(14),a=n(17),o=n(5),u=n(10),c=n(13);const l={AUDIO_DECODE:1,AUDIO_ENCODE:2,VIDEO_DECODE:4,VIDEO_ENCODE:8,SHARR_DECODE:16,SHARR_ENCODE:32},h=e=>{0};class d{constructor(){this.onmessage=h,this.status=d.CLOSED,this.onopen=h,this.onclose=h,this.onwer=null}send(e){}delete(){this.onmessage=h,this.onopen=h,this.onclose=h,this.close()}sendVideo(e,t){}sendWasm(e){}open(){this.status=d.OPEN,this.onopen()}close(){this.status=d.CLOSED,this.onclose()}}r()(d,"OPEN",1),r()(d,"CLOSED",2);class f extends d{constructor(){super({}),this.sab={},this.port=null,this.onmessage=h,this.sender=h,this.videoSender=h,this.reciver=h,this.wasmSender=h}send(e){this.sender(e)}sendVideo(e,t){this.videoSender(e,t)}sendWasm(e){this.wasmSender(e)}delete(){try{var e,t;this.onmessage=h,this.sender=h,this.videoSender=h,this.reciver=h,this.wasmSender=h;let{consumer:n}=(null===(e=this.sab)||void 0===e?void 0:e.reciver)||{};null==n||n.setDataCallback(h),null==n||n.cancelConsume(),this.sab={},this.port&&(this.port.onmessage=h),null===(t=this.port)||void 0===t||t.close()}catch(e){}}open(){this.status!=d.OPEN||this.onopen()}close(){this.status=d.CLOSED,this.delete(),this.onclose()}_onmessage(e){let{cmd:t,data:n}=e.data;switch(t){case o.J:this.reciver();break;case o.K:this.onmessage(n,0);break;case o.L:this.status=n,this.status==d.OPEN?this.onopen():this.onclose()}}createSendAndReceive(){if(!this.port)return;let{sender:e,reciver:t}=this.sab,{sabqueue:n,interval:s}=e||{};n?s?(this.sender=e=>{n.enqueue(e)},this.wasmSender=e=>{n.enqueue(e)},this.videoSender=(e,t)=>{if(!n.enqueueSafe([e,t],!1)){let s=new Uint8Array(t.length+e.length);s.set(e,0),s.set(t,e.length),n.enqueueSafe(s)}}):(this.sender=e=>{n.enqueue(e),this.port.postMessage({cmd:o.J})},this.wasmSender=e=>{n.enqueue(e),this.port.postMessage({cmd:o.J})},this.videoSender=(e,t)=>{if(!n.enqueueSafe([e,t],!1)){let s=new Uint8Array(t.length+e.length);s.set(e,0),s.set(t,e.length),n.enqueueSafe(s)}this.port.postMessage({cmd:o.J})}):(this.sender=e=>{this.port.postMessage({cmd:o.K,data:e},[e.buffer])},this.wasmSender=e=>{let t=new Uint8Array(e.length);t.set(e,0),this.port.postMessage({cmd:o.K,data:t},[t.buffer])},this.videoSender=(e,t)=>{let n=new Uint8Array(t.length+e.length);n.set(e,0),n.set(t,e.length),this.port.postMessage({cmd:o.K,data:n},[n.buffer])});let{sabqueue:r,consumer:u,useCopy:c,interval:l,offset:h}=t||{};if(u&&(u.cancelConsume(),u=null),r){const e=c?e=>{this.onmessage(e,0)}:h?e=>{this.onmessage(e.uint8s,e.begin)}:e=>{this.onmessage(e.uint8s,0)};let n=null,s=_.dataTransportMgr.monitorlogfn;if(l&&s){var d;let e=new i.b({tag:"WCL_M,VDRB"+(null===(d=this.onwer)||void 0===d?void 0:d.type),interval:1e4,reportcallback:m});n=e.timeoutReport.bind(e)}u=new a.a(r,e,n),t.consumer=u,l?u.consume(l,c):this.reciver=()=>{u.consumeAll(c)}}}setMsgPort(e){e!=this.port&&(this.port&&(this.port.onmessage=h,this.port.close(),this.port=null),this.port=e,this.port&&(this._listeners||(this._listeners=this._onmessage.bind(this)),this.port.onmessage=this._listeners,this.createSendAndReceive()))}setSabBuffer(e,t){if(null!=e&&e.sab){let{sab:t,useCopy:n,interval:s,offset:r,length:i,useOneElement:o}=e,u=new a.b(r>0?t.buffer:t,void 0,void 0,!!o,r,i,r>0?t:null);this.sab.sender={sabqueue:u,interval:s,useCopy:n,offset:r}}if(null!=t&&t.sab){var n;let{sab:e,useCopy:s,interval:r,offset:i,length:o,useOneElement:u}=t,c=new a.b(i>0?e.buffer:e,void 0,void 0,!!u,i,o,i>0?e:null),{consumer:l}=(null===(n=this.sab)||void 0===n?void 0:n.reciver)||{};l&&(l.cancelConsume(),this.sab.reciver.consumer=null,this.sab.reciver.sabqueue=null),this.sab.reciver={sabqueue:c,interval:r,useCopy:s,offset:i}}this.createSendAndReceive()}setStatus(e){this.port?this.status!=e&&(this.status=e,this.port.postMessage({cmd:o.L,data:e})):console.error("MsgQueueSocket not initialized")}}class _{constructor(e){this.onmessage=h,this.onopen=h,this.onclose=h,this.connect_type=e.connect_type||_.UDP,this.type=e.type,this.id=e.id||Math.floor(performance.now())<<10|e.type,this.sock=e.sock||new d,this.mgr=e.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=e.remote,this.sabInfo=null,this.portInfo=null,this.target_thread=u.b.NO_THREAD,this.local=!!e.local,this._create()}_create(){let e=_.dataTransportMgr;e.transportlists.push(this),!this.local&&e&&e.mainThread&&e.type==c.a.THREAD_SUB&&e.createRemoteTransport(this,e.mainThread)}_close(){let e=_.dataTransportMgr,t=e.transportlists.indexOf(this);-1!=t&&e.transportlists.splice(t,1),!this.local&&e&&e.mainThread&&e.type==c.a.THREAD_SUB&&e.closeRemoteTransport(this,e.mainThread)}_onmessage(e,t){this.onmessage(e,t)}_onclose(){this.onclose()}_onopen(){this.onopen()}isReady(){return!0}send(e){this.sock.send(e)}sendVideo(e,t){this.sock.sendVideo(e,t)}sendWasmData(e){this.sock.sendWasm(e)}setSocket(e){let t=this.sock;this.sock=e,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)),t&&t.delete()}open(){this.sock.open()}close(){this._close(),this.sock.close()}setMsgPort(e){if(!(this.sock instanceof f))throw new Error("tansport sock is not a MsgQueueSocket");this.sock.setMsgPort(e)}setSabBuffer(e,t){if(!(this.sock instanceof f))throw new Error("tansport sock is not a MsgQueueSocket");this.sock.setSabBuffer(e,t)}setStatus(e){this.sock instanceof f&&this.sock.setStatus(e)}}r()(_,"UDP",0),r()(_,"TCP",1),r()(_,"RLB_UDP",2),r()(_,"dataTransportMgr",null);class p{constructor(e){this.sock=null,this.onmessage=h}isReady(){return!1}send(){h()}setStatus(e){0}}function m(e,t,n,s){var r;null===(r=c.a.monitorlogfn)||void 0===r||r.call(c.a,e,"".concat(t,",").concat(n,",").concat(s))}},function(e,t,n){var s=n(35);e.exports=function(e,t,n){return(t=s(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";n.d(t,"q",(function(){return s})),n.d(t,"b",(function(){return r})),n.d(t,"c",(function(){return i})),n.d(t,"d",(function(){return a})),n.d(t,"i",(function(){return o})),n.d(t,"j",(function(){return u})),n.d(t,"l",(function(){return c})),n.d(t,"r",(function(){return l})),n.d(t,"s",(function(){return h})),n.d(t,"t",(function(){return d})),n.d(t,"m",(function(){return f})),n.d(t,"o",(function(){return _})),n.d(t,"e",(function(){return p})),n.d(t,"n",(function(){return m})),n.d(t,"p",(function(){return b})),n.d(t,"g",(function(){return E})),n.d(t,"h",(function(){return g})),n.d(t,"a",(function(){return A})),n.d(t,"f",(function(){return v})),n.d(t,"k",(function(){return S}));const s=1,r=2,i=3,a=4,o=5,u=6,c=7,l=8,h=9,d=10,f=11,_=129,p=130,m=131,b=132,E=133,g=134,A=135,v=136,S=137},,function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return a}));var s=n(7),r=n.n(s);class i{constructor(){this.onmessage=()=>{}}addEventListener(){}close(){}}class a{constructor(e){this.transportMap={},this.netthreadworker=null,this.type=e.type,this.mgr=e,this.transportlistsChnagelinster=[]}addEventListener(e){-1==this.transportlistsChnagelinster.indexOf(e)&&this.transportlistsChnagelinster.push(e)}removeEventListener(e){let t=this.transportlistsChnagelinster.indexOf(e);-1!=t&&this.transportlistsChnagelinster.splice(t,1)}addTransport(e,t){e.id in this.transportMap||(this.transportMap[e.id]=e,this.transportlistsChnagelinster.forEach(n=>{n(e,t,1)}))}removeTransport(e){var t;let n=e.id;n in this.transportMap&&(delete this.transportMap[n],null===(t=e.sock)||void 0===t||t.close(),this.transportlistsChnagelinster.forEach(t=>{t(e,e.channel,0)}))}getTransportByType(e){for(let t in this.transportMap){let n=this.transportMap[t],s=n.target_thread==a.SELF_THREAD;if(n.type==e&&s)return n}return null}}r()(a,"NO_THREAD",0),r()(a,"SELF_THREAD",1)},function(e,t,n){"use strict";function s(){this.a=[],this.b=0,this.residue=null}s.prototype.getLength=function(){return this.a.length-this.b},s.prototype.isEmpty=function(){return 0==this.a.length},s.prototype.enqueue=function(e){this.a.push(e)},s.prototype.dequeue=function(){if(0!=this.a.length){var e=this.a[this.b];return 2*++this.b>=this.a.length&&(this.a=this.a.slice(this.b),this.b=0),e}return null},s.prototype.peek=function(){return 0<this.a.length?this.a[this.b]:void 0},s.prototype.clear=function(){this.a=[],this.b=0},t.a=s},function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return r})),n.d(t,"c",(function(){return i}));const s={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 e={};for(const t in r)e[r[t]]="WCL_"+t})(),{[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(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return l}));var s=n(7),r=n.n(s),i=n(5),a=n(10),o=n(6),u=n(22);function c(e,t,n){if(!e)return;let s=o.a.dataTransportMgr;s.type===l.THREAD_MAIN?(s.setSabBuffer(e,t,n),e.remote.postMessage({cmd:i.gb,transportId:e.id,sender:n,reciver:t})):(e.setSabBuffer(t,n),s.mainThread.postMessage({cmd:i.gb,transportId:e.id,sender:n,reciver:t}))}class l{constructor(e){let t=e||{};this.type=t.type||l.THREAD_MAIN,this.refs={},this.transportlists=[],this.mainThread=t.remote,this.subthreadlistner=null,this.channellists=[],this.mediadatachannel=new a.b(this)}_onrecvmainthreadlistener(e){let{cmd:t,transportId:n,data:s}=e.data,r=this.transportlists.find(e=>e.id===n);if(r||t==i.s)switch(t){case i.s:this.addRemoteTransport(e.data,null);break;case i.fb:r.setMsgPort(s||new a.a);break;case i.gb:r.setSabBuffer(e.data.sender,e.data.reciver);break;case i.o:r.remote=null,this.removeTransport(r)}}_onrecvsubthreadlistener(e,t){let{cmd:n,transportId:s,transportType:r}=t.data,a=this.transportlists.find(e=>e.id===s);switch(n){case i.s:this.addRemoteTransport(t.data,e);break;case i.gb:this.setSabBufferInfo(a,t.data.sender,t.data.reciver);break;case i.o:a.remote=null,this.removeTransport(a)}}createRemoteTransport(e,t){let n={cmd:i.s,transportType:e.type,transportId:e.id};e.portInfo?(n.port=e.portInfo,t.postMessage(n,[e.portInfo])):t.postMessage(n)}closeRemoteTransport(e,t){t.postMessage({cmd:i.o,transportType:e.type,transportId:e.id})}setRemoteTransportSABBUffer(e,t){var n,s,r,a;(null!==(n=e.sabInfo)&&void 0!==n&&n.sender||null!==(s=e.sabInfo)&&void 0!==s&&s.reciver)&&t.postMessage({cmd:i.gb,transportId:e.id,sender:null===(r=e.sabInfo)||void 0===r?void 0:r.sender,reciver:null===(a=e.sabInfo)||void 0===a?void 0:a.reciver})}addRemoteTransport(e,t){let{transportId:n,port:s,transportType:r}=e;let i=this.createMsgSocketTransport(r);i.id=n,i.remote=t,i.portInfo=s,s?i.setMsgPort(i.portInfo):this.bindMessageChannel(i),this.addTransport(i)}addTransport(e){let t=this.getChannelByTransportType(e.type);if(!t)return;let n=t.target_thread||a.b.SELF_THREAD;e.target_thread=n,this.bindTransPortForChannel(e,t)}removeTransport(e){let t=this.transportlists.indexOf(e);-1!=t&&(this.transportlists.splice(t,1),e.remote&&this.closeRemoteTransport(e,e.remote),e.target_thread!=a.b.NO_THREAD&&this.unbindTransPortForChannel(e))}createMsgSocketTransport(e){let t=null;return t=new o.a({mgr:this,sock:new o.d,type:e,local:!0}),t}bindMessageChannel(e){if(this.type!=l.THREAD_MAIN)return void console.error("error this call only in main thread");let t=new MessageChannel;e.portInfo=t.port1,e.remote.postMessage({cmd:i.fb,transportId:e.id,data:t.port2},[t.port2])}setSabBufferInfo(e,t,n){this.type==l.THREAD_MAIN?(e.sabInfo||(e.sabInfo={}),n&&(n.useCopy=!0),t&&(t.useCopy=!0),e.sabInfo={sender:t,reciver:n},e.target_thread!=a.b.NO_THREAD&&(e.target_thread!=a.b.SELF_THREAD?this.setRemoteTransportSABBUffer(e,e.target_thread):e.setSabBuffer(t,n))):console.error("<<<<< setSabBufferInfo in sub thread")}addDataChannel(e){if(e instanceof u.a){try{this.checkTransport(e)}catch(e){console.error("addDataChannel error",e)}this.channellists.push(e)}else console.error("channel must be a DataChannelWrapper")}removeDataChannel(e){if(!(e instanceof u.a))return void console.error("channel must be a DataChannelWrapper");let t=this.channellists.indexOf(e);-1!==t&&this.channellists.splice(t,1)}removeTransportByRemote(e){let t=[];for(let n=0;n<this.channellists.length;n++){let s=this.channellists[n];s.remote===e&&t.push(s)}for(let e=0;e<t.length;e++)this.removeTransport(t[e])}reinit(){let e=[...this.transportlists];for(let t=0;t<e.length;t++)this.removeTransport(e[t])}getTransportByType(e){return this.mediadatachannel.getTransportByType(e)}addTransportListChangeListener(e){this.mediadatachannel.addEventListener(e)}remoteTransportListChangeListener(e){this.mediadatachannel.removeEventListener(e)}checkTransport(e){this.transportlists.forEach(t=>{if(!e.transportlists.includes(t.type))return;let n=e.target_thread||a.b.SELF_THREAD;n==t.target_thread||(this.type==l.THREAD_MAIN&&t.target_thread!=a.b.NO_THREAD&&t.target_thread!=n&&(this.unbindTransPortForChannel(t),this.bindMessageChannel(t)),t.target_thread=n,this.bindTransPortForChannel(t,e))})}bindTransPortForChannel(e,t){e.channel=t;let n=e.target_thread;if(n!=a.b.SELF_THREAD)this.createRemoteTransport(e,n),this.setRemoteTransportSABBUffer(e,n);else{var s,r,i,o;if(e.portInfo&&e.setMsgPort(e.portInfo),null!==(s=e.sabInfo)&&void 0!==s&&s.sender||null!==(r=e.sabInfo)&&void 0!==r&&r.reciver)e.setSabBuffer(null===(i=e.sabInfo)||void 0===i?void 0:i.sender,null===(o=e.sabInfo)||void 0===o?void 0:o.reciver);this.mediadatachannel.addTransport(e,t)}}unbindTransPortForChannel(e){e.target_thread!=a.b.SELF_THREAD?this.type==l.THREAD_MAIN&&this.closeRemoteTransport(e,e.target_thread):this.mediadatachannel.removeTransport(e)}getChannelByTransportType(e){for(let t=0;t<this.channellists.length;t++){let n=this.channellists[t];if(n.isReady()&&n.transportlists.includes(e))return n}return null}}r()(l,"THREAD_MAIN",1),r()(l,"THREAD_SUB",2)},function(e,t,n){"use strict";function s(e){return e[0]<<24|e[1]<<16|e[2]<<8|e[3]}n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return r})),n.d(t,"a",(function(){return a}));const r={IsQosReport:function(e){return 21==e[4]&&0==e[13]},GetQOSSeq:function(e){!function(e){e[0],e[1]}(e.slice(17,19))},GetQOSTime:function(e){return 104==e[0]||16!=e[4]&&1!=e[5]?s(e.slice(19,23)):s(e.slice(15,19))},IsVideoPkg:function(e){return 103==e[0]}};class i{constructor(e){let t=e||{};this.last_report_time=0,this.timeout_count=0,this.interval_report_time=t.interval||3e3,this.tag=t.tag||"monitor",this.max_timeout=0,this.min_timeout=2147483647,this.reportcallback=t.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(e,t){if(this.timeout_count++,e>this.max_timeout&&(this.max_timeout=e),e<this.min_timeout&&(this.min_timeout=e),this._timeoutid)return;let n=this;this._timeoutid=setTimeout(()=>{n._report(),n._timeoutid=0},this.interval_report_time)}}class a extends class{constructor(e){this._tag=e.tag||"MONITOR",this._base_time=0,this._interval_id=-1,this._timeout=Math.max(1e3,e.timeout||0),this._callback=e.callback}_report(){let e=Date.now(),t=this.getSamples(e);t||(t=[]);let n="".concat(this._base_time,":").concat(e-this._base_time,":").concat(t.join("|"));this._callback&&this._callback(this._tag,n)}getSamples(e){}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(e){super(e),this._count=0}onStart(){this._count=0}sample(){this._count++}getSamples(e){return[this._count]}}},function(e,t,n){"use strict";n.d(t,"c",(function(){return s})),n.d(t,"f",(function(){return r})),n.d(t,"e",(function(){return i})),n.d(t,"a",(function(){return a})),n.d(t,"k",(function(){return o})),n.d(t,"g",(function(){return u})),n.d(t,"h",(function(){return c})),n.d(t,"b",(function(){return l})),n.d(t,"j",(function(){return h})),n.d(t,"i",(function(){return d})),n.d(t,"l",(function(){return f})),n.d(t,"d",(function(){return _}));const s=3,r=6,i=34,a=38,o=-51,u="SHARING_PARAM_INFO_FROM_SOCKET",c=121,l="AUDIO_QOS_DATA",h="VIDEO_QOS_DATA",d="VIDEOSHARE_QOS_DATA",f={VIDEO_ENCODE:"0",VIDEO_DECODE:"1",AUDIO_ENCODE:"2",AUDIO_DECODE:"3",SHARING_ENCODE:"4",SHARING_DECODE:"5"},_="EXPOSE_VB_FRAME"},function(e,t,n){"use strict";const s=e=>0==(e&e-1);let r=new class{constructor(){this._highFrequencyLogs={},this.fixVersion=""}setInstance(e,t){this._instance=e,this.fixVersion=t}getMessageFromErrorOrEvent(e,t){let n=e;return t instanceof ErrorEvent?(t.filename&&(n+=" File: ".concat(t.filename)),(t.lineno||t.colno)&&(n+=" Line: ".concat(t.lineno,":").concat(t.colno)),t.message&&(n+=" Message: ".concat(t.message)),t.error&&(n+="\nStack: ".concat(t.error.stack))):t instanceof Error?(t.fileName&&(n+=" File: ".concat(t.fileName)),(t.lineNumber||t.columnNumber)&&(n+=" Line: ".concat(t.lineNumber,":").concat(t.columnNumber)),t.message&&(n+=" Message: ".concat(t.message)),t.stack&&(n+=" Stack: ".concat(t.stack)),t.name&&(n+=" Name: ".concat(t.name)),t.constraint&&(n+=" Constraint: ".concat(t.constraint))):t instanceof CloseEvent?(t.code&&(n+=" Code: ".concat(t.code)),t.reason&&(n+=" Reason: ".concat(t.reason)),n+=" wasClean: ".concat(t.wasClean)):t instanceof DOMException?(t.message&&(n+=" Message: ".concat(t.message)),t.name&&(n+=" Name: ".concat(t.name))):n+=t?t.toString():"",n}error(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;e=this.getMessageFromErrorOrEvent(e,t),this._highFrequencyLogs[e]?this._highFrequencyLogs[e]+=1:this._highFrequencyLogs[e]=1;const n=s(this._highFrequencyLogs[e]);this._instance&&n&&this._instance.error(e,[this.fixVersion])}severityerror(e,t){this._instance&&this._instance.error(JSON.stringify(e),t)}directReport(e,t){var n,s;this._instance&&(t||(t=["MEDIASDK_INFO"]),null===(n=(s=this._instance).directReport)||void 0===n||n.call(s,{msg:e},t))}warn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;e=this.getMessageFromErrorOrEvent(e,t),this._instance&&this._instance.warn(e)}log(e){this._instance&&this._instance.log(e)}clearHighFrequencyLogs(){this._highFrequencyLogs={}}};t.a=r},function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return a})),n.d(t,"c",(function(){return o}));var s=n(11),r=n(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(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1500,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",s=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]:e.byteLength,a=arguments.length>6?arguments[6]:void 0;this.offset=r,this._BYTES_PER_ELEMENT=t,this.capacity=(i-8)/t,this.usableCapacity=this.capacity-1,this.buf=e,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=n,this.usingOneElementBuffer=s,a&&(this.wasmMemory=a),s&&(this.oneElementBuffer=new ArrayBuffer(t)),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(e){return this.available_write()>0&&this.push(e),{rd:Atomics.load(this.read_ptr,0),wr:Atomics.load(this.write_ptr,0)}}enqueueSafe(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;for(this.dataBuffer||(this.dataBuffer=new s.a);this.dataBuffer.getLength()>0&&this.available_write()>0;){let e=this.dataBuffer.dequeue();e&&this.push(e)}let i=this.dataBuffer.getLength();if(e){if(this.available_write()>0&&0==i)return this.push(e),!0;if(!t)return!1;this.dataBuffer.enqueue(e),++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(),n&&n("vqslclear")),i>0&&n){let e=performance.now();(!this.monitorpace||e-this.monitorpace>2e4)&&(this.monitorpace=e,n&&n("vqsl"+i))}return!0}push(e){return e instanceof Array?this._pushArray(e):this._push(e)}_pushArray(e){var t=Atomics.load(this.write_ptr,0);this.checkBuffer();let n=0;e.forEach(e=>{this.storageUint8s.set(e,t*this._BYTES_PER_ELEMENT+8+4+n),n+=e.byteLength}),new Uint32Array(this.buf,this.offset+t*this._BYTES_PER_ELEMENT+8,1)[0]=n;let s=(t+1)%this.capacity;return Atomics.store(this.write_ptr,0,s),!0}_push(e){var t=Atomics.load(this.write_ptr,0);this.checkBuffer(),this.storageUint8s.set(e,t*this._BYTES_PER_ELEMENT+8+4,e.byteLength),new Uint32Array(this.buf,this.offset+t*this._BYTES_PER_ELEMENT+8,1)[0]=e.byteLength;let n=(t+1)%this.capacity;return Atomics.store(this.write_ptr,0,n),!0}addReadPtr(){var e=Atomics.load(this.read_ptr,0);Atomics.store(this.read_ptr,0,(e+1)%this.capacity)}dequeue(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];var t=Atomics.load(this.read_ptr,0);this.checkBuffer();let n,s,r,i=new Uint32Array(this.buf,this.offset+t*this._BYTES_PER_ELEMENT+8,1);if(e){n=this.oneElementBuffer?new Uint8Array(this.oneElementBuffer,0,i[0]):new Uint8Array(i[0]);let e=new Uint8Array(this.storageUint8s.buffer,t*this._BYTES_PER_ELEMENT+8+4+this.storageUint8sByteOffset,n.byteLength);n.set(e,0)}else n=this.storageUint8s.subarray(t*this._BYTES_PER_ELEMENT+8+4,t*this._BYTES_PER_ELEMENT+8+4+i[0]),s=t*this._BYTES_PER_ELEMENT+8+4+this.storageUint8sByteOffset,r=t*this._BYTES_PER_ELEMENT+8+4+i[0]+this.storageUint8sByteOffset;return e&&Atomics.store(this.read_ptr,0,(t+1)%this.capacity),e?n:{bCopyData:e,uint8s:n,begin:s,end:r}}available_read(){var e=Atomics.load(this.read_ptr,0),t=Atomics.load(this.write_ptr,0);return this._available_read(e,t)}available_write(){var e=Atomics.load(this.read_ptr,0),t=Atomics.load(this.write_ptr,0);return this._available_write(e,t)}is_available_write(){var e=Atomics.load(this.read_ptr,0),t=Atomics.load(this.write_ptr,0);return this._is_available_write(e,t)}_available_read(e,t){return(t+this.capacity-e)%this.capacity}_available_write(e,t){return this.usableCapacity-this._available_read(e,t)}_is_available_write(e,t){return this._available_write(e,t)>0}_storage_capacity(){return this.capacity}}class a{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:50,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:80;if(!(e instanceof i))throw new Error("RingBuffer required");this.rb=e,this.dataCallback=t,this.interval=null,this.requestID=null,this.timeout_call=n,this.tick_lasted_time=0,this.timeoutMS=s,this.maxCount=r}setDataCallback(e){this.dataCallback=e}consume(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.interval||(this.bCopyData=t,this.interval=setInterval(()=>{let e=performance.now();if(this.timeout_call){if(0!=this.tick_lasted_time){let t=e-this.tick_lasted_time;t>=this.timeoutMS&&this.timeout_call(t,e)}this.tick_lasted_time=e}this._dequeue()},e),console.log("consume interval ".concat(this.interval)))}consumeAll(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.bCopyData=e,this._dequeue()}_dequeue(){let e=Math.min(this.rb.available_read(),this.maxCount);for(this.consoume_count=0;this.consoume_count<e;){this.consoume_count++;let e=this.rb.dequeue(this.bCopyData);this.dataCallback(e),this.bCopyData||this.rb.addReadPtr()}}_consumeForAnimationFrame(){this._dequeue(),this.requestID=requestAnimationFrame(this._consumeForAnimationFrame.bind(this))}consumeUsingRequestAnimationFrame(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.requestID||(this.bCopyData=e,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 o{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(e){this.obj=e,this.yuvUint8s=e.data}setBuffer(e){!1===e.bCopyData?(this.objUint8s=e.uint8s,this.bCopyData=e.bCopyData,this.begin=e.begin,this.end=e.end):(this.objUint8s=e,this.bCopyData=!0,this.begin=0,this.end=e.byteLength)}buffer2Obj(){let e=new Uint32Array(this.objUint8s.buffer,this.begin,9),t=new DataView(this.objUint8s.buffer,this.begin+40,16),n={};this.keysList.forEach((t,s)=>{n[t]=e[s]}),n[this.timeStampKey]=Number(t.getBigUint64(0,!0));let s,r=Number(t.getBigUint64(8,!0)),i=new Uint8Array(this.objUint8s.buffer,this.begin+40+8+8,r);return s=(this.bCopyData,i),n.data=s,n}obj2buffer(){let e=new Uint8Array(56),t=this.keysList,n=new Uint32Array(e.buffer,0,9),s=new DataView(e.buffer,40,16);return t.forEach((e,t)=>{n[t]=this.obj[e]}),s.setBigUint64(0,BigInt(this.obj[this.timeStampKey]),!0),s.setBigUint64(8,BigInt(this.yuvUint8s.byteLength),!0),[e,this.yuvUint8s]}}},,,,,function(e,t,n){"use strict";var s=n(7),r=n.n(s),i=n(14);function a(e){let t=e||{};this._samples=[],this._interval_id=0,this._lasted_update_time=0,this._lasted_group_time=0,this._enable=!1,this._interval_time=t.interval||3e4,this._customer_callback=t.report_call,this._tag=t.tag||"netreport",this._group_interval=t.group_interval||1e3,this._enable_advanced=t.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}a.prototype._qos_report_timeout=function(e,t,n,s){if(this._customer_callback){let r="".concat(e,",").concat(t,",").concat(n,",").concat(s);this._customer_callback(this._tag+"TimeOut",r)}},a.prototype._report=function(){let e=(new Date).getTime(),t="".concat(e,"-").concat(this._samples.length,"-").concat(this._samples),n="".concat(e,"-").concat(this._qos_report_samples.length,"-").concat(this._qos_report_samples);t=t.replaceAll(",","|"),n=n.replaceAll(",","|"),this._customer_callback?(this._customer_callback(this._tag,t),this._enable_advanced&&this._customer_callback(this._tag+"QOS",n)):console.error("tag:".concat(this._tag,",").concat(t))},a.prototype._group=function(){let e=performance.now();if(e>=this._lasted_group_time+1700){let t=Math.round((e-this._lasted_group_time)/1e3)-1;for(let e=0;e<t;e++)this._samples.push(-1)}this._lasted_group_time=e,this._samples.push(this._current_count),this._qos_report_samples.push(this._cureen_qos_report),this._cureen_qos_report=0,this._current_count=0,e>=this._lasted_update_time+this._interval_time&&(this._lasted_update_time=e,this._report(),this._samples=[],this._qos_report_samples=[])},a.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)},a.prototype.stop=function(){this._enable&&(clearInterval(this._interval_id),this._interval_id=0,this._enable=!1)},a.prototype.sample=function(e){if(this._enable&&(this._current_count++,this._enable_advanced)){if(i.c.IsQosReport(e))return void this._cureen_qos_report++;if(i.c.IsVideoPkg(e)){let t=i.c.GetQOSTime(e),n=performance.now();if(this._lasted_qos_ts){let e=n-this._lasted_sys_ts-(t-this._lasted_qos_ts);e>30&&this._qos_report.timeoutReport(e,n)}this._lasted_qos_ts=t,this._lasted_sys_ts=n,this._lasted_data=e}}};var o=n(8),u=n(12),c=n(5);n.d(t,"b",(function(){return l})),n.d(t,"a",(function(){return h}));class l{constructor(e,t){this.type=e,this.transportlists=[],this.transfered=!!t,this.onmessage=()=>{}}send(){}isReady(){return!1}}class h{constructor(e,t,n,s){this.id=e,this.type=t,this.datachannel=n,this._recv_statistic=null,this.onmessageFn=null,this.disconnectedFn=null,this.connectedFn=null,this._status=h.UNINIT,this.target_thread=s,this.transfered=!1,this._listener=null,this.transportlists=[],this._send_statistic=null,this.report_monitor_func=()=>{}}isReady(){return this._status===h.CONNECTED}send(e){this.datachannel.send(e),this._send_statistic.sample(!1)}open(){if(this.target_thread)try{return this.target_thread.postMessage({command:o.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(e){this.target_thread=null}this._addEventListener()}close(){let e=this.disconnectedFn;this.transfered&&this.target_thread&&this._listener&&(this.target_thread.removeEventListener("message",this._listener),this._listener=null,this.target_thread.postMessage({command:o.a,id:this.id,type:this.type})),this._status!=h.DISCONNECT&&this._clear(),this._status=h.DISCONNECT,null==e||e()}onmessage(e){this.onmessageFn=e}onopen(e){this.connectedFn=e}onclose(e){this.disconnectedFn=e}onerror(e){this.errorFn=e}_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==h.UNINIT&&this._onopen()}_onmessage(e){this._recv_statistic.sample(!1),this.onmessageFn(e)}_onopen(e){let t=this._status;var n;(this._status=h.CONNECTED,this.transfered||(this._send_statistic||(this._send_statistic=new a({tag:this.type==u.a.VIDEO?"VDCS":"ADCS",report_call:this.report_monitor_func})),this._recv_statistic||(this._recv_statistic=new a({tag:this.type==u.a.VIDEO?"VDCR":"ADCR",report_call:this.report_monitor_func})),this._send_statistic.start(),this._recv_statistic.start()),t!=h.CONNECTED)&&(null===(n=this.connectedFn)||void 0===n||n.call(this))}_onerror(e){var t;null===(t=this.errorFn)||void 0===t||t.call(this,e),this._onclose(e)}_onclose(e){let t=this._status;this._status=h.DISCONNECT;let n=this.disconnectedFn;this._clear(),t!=h.DISCONNECT&&(null==n||n())}_clear(){var e,t;!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 n=this.datachannel;this.datachannel=null,null===(e=this._send_statistic)||void 0===e||e.stop(),null===(t=this._recv_statistic)||void 0===t||t.stop(),null==n||n.close()}_mesagelistener(e){let t=e.data;if(t&&t.id==this.id)switch(t.cmd){case c.A:this._onclose();break;case c.C:this._onopen();break;case c.B:this._onerror(t.ev);break;case c.H:this.report_monitor_func(t.tag,t.data)}}}r()(h,"UNINIT",0),r()(h,"CONNECTED",1),r()(h,"DISCONNECT",2)},function(e,t,n){"use strict";n.d(t,"d",(function(){return a})),n.d(t,"b",(function(){return o})),n.d(t,"c",(function(){return c})),n.d(t,"e",(function(){return l})),n.d(t,"a",(function(){return h}));var s=n(12),r=n(6),i=n(13);function a(e){return new r.a({sock:new r.d,type:e,local:!1})}function o(e){try{const t="undefined"!=typeof DedicatedWorkerGlobalScope;if(r.a.dataTransportMgr)return;let n=new i.a({type:t?i.a.THREAD_SUB:i.a.THREAD_MAIN,remote:t?self:null});r.a.dataTransportMgr=n,n.monitorlogfn=e,t&&self.addEventListener("message",n._onrecvmainthreadlistener.bind(n))}catch(e){console.error("<<<< InitDataTransportModule",e)}}function u(e){return r.a.dataTransportMgr.getTransportByType(e)}function c(e){if(!r.a.dataTransportMgr)throw new Error("not InitDataTransportModule");r.a.dataTransportMgr.addDataChannel(e)}function l(e){if(!r.a.dataTransportMgr)throw new Error("not InitDataTransportModule");r.a.dataTransportMgr.removeDataChannel(e)}class h{constructor(){this._listener=this._listenerfn.bind(this),this.isSupportVideoShare=!1}addTransportListiner(){var e;e=this._listener,r.a.dataTransportMgr.addTransportListChangeListener(e)}remoteTransportListener(){var e;e=this._listener,r.a.dataTransportMgr.addTransportListChangeListener(e)}_listenerfn(e,t,n){this.connectSession(t)}setVideoShareModel(e){this.isSupportVideoShare=e}connectSession(e){const{type:t}=e;!e.transfered&&e.isReady()&&(t==s.a.VIDEO&&this.connectVideoSession(e),t==s.a.AUDIO&&this.connectAudioSession(e))}disconnectSession(e){const{type:t}=e;e.transfered||(t==s.a.VIDEO&&this.connectVideoSession(e),t==s.a.AUDIO&&this.connectAudioSession(e))}connectVideoSession(e){let t=new r.c,n=u(r.e.VIDEO_ENCODE)||t,s=u(r.e.VIDEO_DECODE)||t,i=u(r.e.SHARR_DECODE)||t,a=(null==e?void 0:e.isReady())?r.b.OPEN:r.b.CLOSED;n.setStatus(a),s.setStatus(a),this.isSupportVideoShare||i.setStatus(a),e.onmessage(e=>{var t=new Uint8Array(e.data);if((104==t[0]||132==t[0])&&0==t[1]||20==t[0]||130==t[0])n.send(t);else{if(!this.isSupportVideoShare&&(133==t[0]||132==t[0]))return void i.send(t);s.send(t)}});const o=t=>{e.send(t)};n.onmessage=o,s.onmessage=o,i.onmessage=o}connectAudioSession(e){let t=new r.c,n=u(r.e.AUDIO_ENCODE)||t,s=u(r.e.AUDIO_DECODE)||t,i=e.isReady()?r.b.OPEN:r.b.CLOSED;n.setStatus(i),s.setStatus(i),e.onmessage(e=>{var t=new Uint8Array(e.data);108==t[0]&&0==t[1]?n.send(t):s.send(t)});const a=t=>{e.send(t)};n.onmessage=a,s.onmessage=a}notifyTransportStatus(e,t){}}},,function(e,t){function n(t){return e.exports=n="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.exports.__esModule=!0,e.exports.default=e.exports,n(t)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var s=n(7),r=n.n(s),i=n(5);function a(e){o.instance||(o.instance=new o),o.instance.start(e)}class o{constructor(){this._interval=-1,this.monitorworkers={},this._lasted_timestamp=-1,this.timeoutcallbackfn=(e,t)=>{}}setTimeoutCallback(e){this.timeoutcallbackfn=e}registerWorker(e,t){if(e in this.monitorworkers){let t=this.monitorworkers[e];t.worker.removeEventListener("message",t.listener),delete this.monitorworkers[e]}let n={id:e,worker:t},s=this._recvheartbeat.bind(this,n);n.listener=s,n.lastedtimestamp=Date.now(),n.worker.addEventListener("message",n.listener),this.monitorworkers[e]=n}unRegisterWorker(e){if(!(e in this.monitorworkers))return;let t=this.monitorworkers[e];delete this.monitorworkers[e],t.worker.removeEventListener("message",t.listener)}_recvheartbeat(e,t){let n=t.data;n.cmd===i.Db&&(e.lastedtimestamp=n.timestamp)}start(e){const t="undefined"!=typeof DedicatedWorkerGlobalScope&&e&&e instanceof DedicatedWorkerGlobalScope;if(-1!=this._interval)return;if(t)return void(this._interval=setInterval(()=>{e.postMessage({cmd:i.Db,timestamp:Date.now()})},o.INTREVAL_TIME_MS));const n=Math.max(o.INTREVAL_TIME_MS-1e3,500);this._lasted_timestamp=Date.now(),this._interval=setInterval(()=>{let e=o.instance,t=Object.keys(e.monitorworkers),s=Date.now(),r=this._lasted_timestamp;s<r+n||(this._lasted_timestamp=s,s>r+o.HEART_TIMEOUT_MS?e.timeoutcallbackfn("MAIN",s-r):t.forEach(t=>{var n;let r=e.monitorworkers[t],i=r.lastedtimestamp+(null!==(n=document)&&void 0!==n&&n.hidden?o.MAX_HEART_TIMEOUT_MS:o.HEART_TIMEOUT_MS);s>i&&(e.timeoutcallbackfn(r.id,s-r.lastedtimestamp),r.lastedtimestamp=s)}))},o.INTREVAL_TIME_MS)}close(){try{Object.keys(this.monitorworkers).forEach(e=>{let t=this.monitorworkers[e];delete this.monitorworkers[e],t.worker.removeEventListener("message",t.listener)}),this._interval&&clearInterval(this._interval),this._interval=-1}catch(e){}}}r()(o,"INTREVAL_TIME_MS",3e3),r()(o,"HEART_TIMEOUT_MS",15e3),r()(o,"MAX_HEART_TIMEOUT_MS",3e4),r()(o,"instance",null)},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));class s{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.checkInterval=0,this.hasRTPPackets=!1,this.callBackEvent=e,this.subforme=!1,this.lastsubformetime=0,this.videoType=t,this.paused=!1}startCheck(){this.checkInterval&&(clearInterval(this.checkInterval),this.hasRTPPackets=!1,this.subforme=!1,this.paused=!1),this.checkInterval=setInterval(()=>{if((this.videoType&&this.subforme||!this.videoType)&&!this.hasRTPPackets&&!this.paused){performance.now()-this.lastsubformetime>2e4&&postMessage({status:this.callBackEvent,videoType:this.videoType,subforme:this.subforme,hasRTPPackets:this.hasRTPPackets})}this.hasRTPPackets=!1},3e4)}stopCheck(){this.checkInterval&&clearInterval(this.checkInterval),this.checkSharingInterval=0,this.subforme=!1,this.paused=!1}setRtpPackets(){this.hasRTPPackets=!0}setSubForMe(e){let t=e>=0;this.subforme!==t&&(this.subforme=t,this.lastsubformetime=performance.now())}setPaused(e){e||(this.lastsubformetime=performance.now()),this.paused=e,this.hasRTPPackets=!1}}},,,function(e,t,n){"use strict";n(12);var s=n(7),r=n.n(s);const i=e=>btoa(String.fromCharCode(...new Uint8Array(e)));class a{constructor(e){r()(this,"process",async()=>{if(this.processList.length){const e=this.processList.splice(0,30),t=await this.encryptData(this.mergeBuffer(e));this.writeLog(i(t)),this.writeLog(this.EOL)}requestAnimationFrame(this.process)}),this.textEncoder=new TextEncoder,this.textDecoder=new TextDecoder,this.EOL=this.textEncoder.encode("\n"),this.processList=[],this.writeLog=e,this.key=null,this.initEncryptPromise=this.initEncrypt()}addLogData(e,t){if(!e||!t)return;const n=this.textEncoder.encode(e);this.processList.push(n),this.processList.push(t),this.processList.push(this.EOL)}async initEncrypt(){this.key=await crypto.subtle.generateKey({name:"AES-GCM",length:256},!0,["encrypt","decrypt"]),this.iv=crypto.getRandomValues(new Uint8Array(12));const e=new Uint8Array(await crypto.subtle.exportKey("raw",this.key)),t=new Uint8Array([0]);this.writeLog("v"),this.writeLog(this.EOL),this.writeLog(i(t.buffer)),this.writeLog(this.EOL);const n=[e,this.iv];this.writeLog("h"),this.writeLog(this.EOL),this.writeLog(i(this.mergeBuffer(n).buffer)),this.writeLog(this.EOL),this.startProcess()}mergeBuffer(e){const t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t);let s=0;for(const t of e)n.set(t,s),s+=t.length;return n}async encryptData(e){await this.initEncryptPromise;return await crypto.subtle.encrypt({name:"AES-GCM",iv:this.iv},this.key,e)}startProcess(){requestAnimationFrame(this.process)}}var o=n(3);n.d(t,"a",(function(){return l}));class u{constructor(e){this.port=null,this.cache=[],this.stopCache=!1,e&&(this.logProcesser=new a(this.writeLog.bind(this)))}readyForLog(){}sendLog(e){}writeLog(e){this.readyForLog()?(this.stopCache||(this.cache.forEach(e=>this.sendLog(e)),this.clearCache()),this.sendLog(e)):this.stopCache||this.cache.push(e)}clearCache(){this.stopCache=!0,this.cache=[]}getTime(){const e=new Date;return e.getHours()+":"+e.getMinutes()+":"+e.getSeconds()+":"+e.getMilliseconds()}getLogData(e,t,n){if(t){var s=new Uint8Array(n?t+1:t),r=Object(o.d)().subarray(e+0,e+t);return s.set(r,0,t),n&&(s[t]=10),s}return e.data}writeWasmLog(e,t){const n=this.getTime(),s=this.getLogData(e,t);this.logProcesser?this.logProcesser.addLogData(n,s):(this.writeLog(n),this.writeLog(s),this.writeLog("\n"))}}class c extends u{constructor(){super(!0),this.port=null,this.ready=!1}init(){let e=0;const t=n=>{"local_log_port"===n.data.command?this.port||(this.port=n.data.data):"local_log_ready"===n.data.command&&(this.ready=!0,self.removeEventListener("message",t),clearTimeout(e),this.stopCache||(this.cache.forEach(e=>this.sendLog(e)),this.clearCache()))};self.addEventListener("message",t),e=setTimeout(()=>{self.removeEventListener("message",t),this.clearCache()},6e4)}readyForLog(){return!!this.port&&this.ready}sendLog(e){this.port.postMessage(e)}}function l(){let e=!1;try{e=!1}catch(e){}return e?new c:null}},,,,,function(e,t,n){var s=n(25).default,r=n(36);e.exports=function(e){var t=r(e,"string");return"symbol"===s(t)?t:String(t)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){var s=n(25).default;e.exports=function(e,t){if("object"!==s(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.r(t);var s=n(3),r=n(4),i=n(5),a=n(12),o=n(15),u=n(30);n(16);function c(e,t){let n=0,s=0;for(let r=0;r<e.length;r+=t){s+=e[r]*e[r];let t=Math.abs(e[r]);t>n&&(n=t)}return n=n>1?1:n,{sumRms:s/e.length/t,absMax:n}}const l={WORKLET:1,ENCODE:2,DECODE:3,WORKLET_APM_ONLY:4},h={MUTE:0,UNMUTE:1,LEAVED:2,MUTE_APM_ONLY:3,UNMUTE_APM_ONLY:4};let d,f,_,p,m,b,E,g,A,v,S=0,y=!0;var T=0;var w=!1;var M=null;var D=!1;var I={WASMTYPE:l,AUDIO_STATE:h,onWasmModuleReady:function(e){if(!e)return console.warn("[AudioWASMAdapter] Module undefined");_=e.cwrap("_Heartbeat","number",["number"]),p=e.cwrap("_MuteUnmuteState","number",["number","number"]),m=e.cwrap("_Switch_Original_Sound","number",["number","boolean","boolean","boolean","boolean"]),b=e.cwrap("_Deliver_Recorded_Data","number",["number","number","number","number","number","number"]),E=e.cwrap("_Switch_Denoise","number",["number","number","number","number"]),g=e.cwrap("_Audio_Init","number",["number","string","string","number","number","boolean","boolean","boolean","number","boolean"]),A=e.cwrap("_Switch_High_Bitrate","number",["number","number"]),v=e.cwrap("_Set_All_Speech_Volume_Level","number",["number"])},setAudioInstanceAndType:function(e,t,n){d=e,t&&(S=t),n&&(f=n)},muteUnmuteState:function(e){if(null!=Object.values(h).find(t=>t==e))return d?void(S!=l.WORKLET_APM_ONLY&&(p(d,e),Object(s.o)("muteUnmuteState: "+e))):Object(s.o)("muteUnmuteState: -1")},switchOriginalSound:function(e,t,n,s){d&&m(d,e,t,n,s)},deliverRecordedData:function(e,t,n,s){d&&b(d,e,t,0,n,s)},switchDenoise:function(e,t){d&&(w=e,E(d,!!e,3,!!t))},audioInit:function(e,t,n,s,r,i,a,o,u,c){return g(e,t,n,s,r,i,a,o,u,c)},setDecoder:function(e){M=e},needCalculateDenoiseOutput:function(){D=!0},switchHighBitrate:function(e){d&&A(d,e)},disableJitterLog:function(){y=!1},setAllSpeechVolume:function(e){d&&v(d,e)},onMonitorLogWASM:function(e,t){if(t<=0)return;const n=Module.HEAPU8.subarray(e,e+t),r=String.fromCharCode.apply(null,n);r&&(!y&&r.includes("JITTER")||(S==l.ENCODE||S==l.DECODE?Object(s.n)(r):S==l.WORKLET?f&&f.port&&Object(s.n)(r,f.port):S==l.WORKLET_APM_ONLY&&f.port&&f.port.postMessage({status:"SPEECH_LOG",data:{log:r}})))},onMuteSpeechWarningWASM:function(){postMessage({status:o.h})},onAudioLevelWASM:function(e,t,n){var s;S!=l.ENCODE&&S!=l.WORKLET_APM_ONLY||1==e&&(0===t&&0===T||(T=t,S===l.ENCODE?postMessage({status:o.a,value:t}):null!==(s=f)&&void 0!==s&&s.port&&f.port.postMessage({status:o.a,data:t})))},onAPMProcessedPCMWASM:function(e,t,n,s){if(!w)return;let r=Module.HEAPF32.subarray(e/4,e/4+t);if(M){if(D){D=!1;let{sumRms:e}=c(r,2),t=function(e){let t=0;return t=e>.1995?15:e>.0794?14:e>.0316?13:e>.0126?12:e>.005?11:e>.002?10:e>79433e-8?9:e>31623e-8?8:e>12589e-8?7:e>50119e-9?6:e>19953e-9?5:e>79433e-10?4:e>31623e-10?3:e>12589e-10?2:e>5.0119e-7?1:0,t}(e);f.port&&f.port.postMessage({status:"AUDIO_LEVEL_R16_DENOISE",level:t})}M.push([r])}}};class C{constructor(){this.cacheSize=0,this.sameCacheSizeCounter=0}shouldSendCacheSize(e){return e===this.cacheSize&&this.sameCacheSizeCounter++,(this.cacheSize!==e||200===this.sameCacheSizeCounter)&&(this.sameCacheSizeCounter=0,this.cacheSize=e,!0)}}class O{constructor(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;if(this.STATE_READ_READY=0,this.STATE_READ_INDEX=1,this.STATE_WRITE_READY=2,this.STATE_WRITE_INDEX=3,this.STATE_DATA_COUNT=4,this.STATE_CACHE_SIZE=5,this.STATY_READY_NO=0,this.STATY_READY_YES=1,this.sabState=new Uint32Array(e),this.sabBuffer=new Float32Array(t),this.perFrameLength=n,this.writeChannelNumb=s,this.bufferLen=this.sabBuffer.length,this.supportSpecialOptimization=this.bufferLen%n==0,this.bufferIndex=null,this.supportSpecialOptimization){let e=this.bufferLen/n;this.bufferIndex=[];for(let t=0;t<e;t++)this.bufferIndex.push(this.sabBuffer.subarray(t*n,t*n+n))}this.placeBuffer=new Float32Array(this.perFrameLength),this.QUANTUM_SIZE=128,this.CACHE_SIZE_MAX_VALUE=Math.floor(Math.floor(this.bufferLen/this.QUANTUM_SIZE)/2),this.CACHE_SIZE_MIN_VALUE=6,this.CACHE_SIZE_MAX_VALUE<this.CACHE_SIZE_MIN_VALUE&&(this.CACHE_SIZE_MAX_VALUE=this.CACHE_SIZE_MIN_VALUE),this.setCacheSize(this.CACHE_SIZE_MIN_VALUE),this._counter=0,this.onCacheSizeChange=null,this.cacheSizeController=new C}getCacheSize(){return Atomics.load(this.sabState,this.STATE_CACHE_SIZE)}setCacheSize(e){e>this.CACHE_SIZE_MAX_VALUE&&(e=this.CACHE_SIZE_MAX_VALUE),e<this.CACHE_SIZE_MIN_VALUE&&(e=this.CACHE_SIZE_MIN_VALUE),this.onCacheSizeChange&&this.cacheSizeController.shouldSendCacheSize(e)&&this.onCacheSizeChange(e),Atomics.store(this.sabState,this.STATE_CACHE_SIZE,e)}setQuantumSize(e){this.QUANTUM_SIZE=e,this.CACHE_SIZE_MAX_VALUE=Math.floor(Math.floor(this.bufferLen/this.QUANTUM_SIZE)/2),this.CACHE_SIZE_MAX_VALUE<this.CACHE_SIZE_MIN_VALUE&&(this.CACHE_SIZE_MAX_VALUE=this.CACHE_SIZE_MIN_VALUE)}isNeedMoreData(){let e=Atomics.load(this.sabState,this.STATE_CACHE_SIZE);return Atomics.load(this.sabState,this.STATE_DATA_COUNT)<e*this.QUANTUM_SIZE}shouldAdjustCacheBuffer(){this._counter>0&&this.setCacheSize(this.getCacheSize()+1)}clear(){this.sabState&&(this.sabState[this.STATE_READ_READY]=0,this.sabState[this.STATE_READ_INDEX]=0,this.sabState[this.STATE_WRITE_READY]=0,this.sabState[this.STATE_WRITE_INDEX]=0,this.sabState[this.STATE_DATA_COUNT]=0),this._counter=0}setWriteReady(){this.sabState[this.STATE_WRITE_READY]=this.STATY_READY_YES}isReady(){return this.sabState[this.STATE_WRITE_READY]&&this.sabState[this.STATE_READ_READY]}getDataCount(){return Atomics.load(this.sabState,this.STATE_DATA_COUNT)}write(e){if(void 0===e[0]||e[0].length*this.writeChannelNumb!==this.perFrameLength)return;let t=this.sabState[this.STATE_READ_READY];return this.sabState[this.STATE_WRITE_READY]||(this.sabState[this.STATE_WRITE_READY]=this.STATY_READY_YES,this.sabState[this.STATE_WRITE_INDEX]=0),t?this.supportSpecialOptimization?this.writeSpecial(e):this.writeNormal(e):void 0}writeNormal(e){let t=this.sabState[this.STATE_WRITE_INDEX];for(let n=0;n<this.writeChannelNumb;n++)for(let s=0;e[n]&&s<e[n].length;s++)this.sabBuffer[(t+s*this.writeChannelNumb+n)%this.bufferLen]=e[n][s];t+=this.perFrameLength,t>=this.bufferLen&&(t-=this.bufferLen),this.sabState[this.STATE_WRITE_INDEX]=t,Atomics.add(this.sabState,this.STATE_DATA_COUNT,this.perFrameLength)}writeSpecial(e){let t=this.sabState[this.STATE_WRITE_INDEX];for(let n=0;n<this.writeChannelNumb;n++)for(let s=0;e[n]&&s<e[n].length;s++)this.bufferIndex[t][s*this.writeChannelNumb+n]=e[n][s];t=(t+1)%this.bufferIndex.length,this.sabState[this.STATE_WRITE_INDEX]=t,Atomics.add(this.sabState,this.STATE_DATA_COUNT,this.perFrameLength)}read(){let e=this.sabState[this.STATE_READ_READY],t=this.sabState[this.STATE_WRITE_READY];if(e||(this.sabState[this.STATE_READ_READY]=this.STATY_READY_YES,this.sabState[this.STATE_READ_INDEX]=0),!t)return null;let n=this.supportSpecialOptimization?this.readSpecial():this.readNormal();return null===n?this.shouldAdjustCacheBuffer():this._counter++,n}readNormal(){let e=this.sabState[this.STATE_READ_INDEX],t=Atomics.load(this.sabState,this.STATE_DATA_COUNT);if(t<this.perFrameLength)return null;if(t>this.bufferLen){let n=Math.ceil((t-this.bufferLen)/this.perFrameLength)+1;e=(n*this.perFrameLength+e)%this.bufferLen,Atomics.sub(this.sabState,this.STATE_DATA_COUNT,n*this.perFrameLength)}let n=null;if(this.bufferLen-e>=this.perFrameLength)n=this.sabBuffer.subarray(e,e+this.perFrameLength);else{let t=this.sabBuffer.subarray(e),s=this.sabBuffer.subarray(0,this.perFrameLength-t.length);n=this.placeBuffer,n.set(t),n.set(s,t.length)}return e+=this.perFrameLength,e>=this.bufferLen&&(e-=this.bufferLen),this.sabState[this.STATE_READ_INDEX]=e,Atomics.sub(this.sabState,this.STATE_DATA_COUNT,this.perFrameLength),n}readSpecial(){let e=this.sabState[this.STATE_READ_INDEX],t=Atomics.load(this.sabState,this.STATE_DATA_COUNT);if(t<this.perFrameLength)return null;if(t>this.bufferLen){let n=Math.ceil((t-this.bufferLen)/this.perFrameLength)+1;e=(n+e)%this.bufferIndex.length,Atomics.sub(this.sabState,this.STATE_DATA_COUNT,n*this.perFrameLength)}let n=this.bufferIndex[e];return e=(e+1)%this.bufferIndex.length,this.sabState[this.STATE_READ_INDEX]=e,Atomics.sub(this.sabState,this.STATE_DATA_COUNT,this.perFrameLength),n}}var k=n(8),L=n(11),R=n(27),U=n(13),N=n(23),P=n(6),B=n(26);function H(e,t,n){mn&&mn.writeWasmLog(t,n,!0)}function x(e,t){self.fsHandler&&self.fsHandler.handleViperNetworkTrace(e,t)}n.d(t,"Get_ExternalRecord",(function(){return H})),n.d(t,"Viper_NetworkTrace",(function(){return x})),n.d(t,"Channel_Agent",(function(){return st})),n.d(t,"responseAudioQosData",(function(){return rt})),n.d(t,"network_quality_callback",(function(){return it})),n.d(t,"Open_Audio_WebSocket_Connect",(function(){return at})),n.d(t,"audio_websocket_on_open",(function(){return ct})),n.d(t,"audio_websocket_on_message",(function(){return gt})),n.d(t,"audio_websocket_on_close",(function(){return At})),n.d(t,"audio_websocket_on_error",(function(){return vt})),n.d(t,"frame_aec_callback",(function(){return St})),n.d(t,"frame_callback_SAB",(function(){return Mt})),n.d(t,"LOG_OUT_WEBRTC",(function(){return Dt})),n.d(t,"update_play_time",(function(){return It})),n.d(t,"calMilliSeconds",(function(){return Ct})),n.d(t,"frame_callback",(function(){return Ot})),n.d(t,"wcl_trace_log",(function(){return kt})),n.d(t,"media_data_transport_type_monitor",(function(){return Rt})),n.d(t,"audio_encode_frame_callback",(function(){return Ut})),n.d(t,"send_data_to_rwg",(function(){return Nt})),n.d(t,"sampleRateLog",(function(){return Pt})),n.d(t,"Get_Mixed_Audio_Interval",(function(){return sn})),n.d(t,"Get_Mixed_Audio_Interval_SAB",(function(){return rn})),n.d(t,"Encode_Audio_Data",(function(){return an})),n.d(t,"Encode_Audio_Data_SAB",(function(){return on})),n.d(t,"send_data",(function(){return un})),n.d(t,"LOG_OUT",(function(){return cn})),n.d(t,"put_aec_data",(function(){return ln})),n.d(t,"TURN_DOWN_VOLUME",(function(){return hn})),n.d(t,"SAVE_IV",(function(){return dn})),n.d(t,"getWasmMemory",(function(){return fn})),n.d(t,"freeWasmMemory",(function(){return _n})),n.d(t,"pump_rtp_data",(function(){return pn})),self.AudioWasmAdapter=I,self.wasmSuccessEvent=i.j,self.wasmFailEvent=i.i,self.downloadAndInstantiateWebAssembly=s.q,self.addEventListener("unhandledrejection",e=>{Object(s.u)("Unhandled rejection in audio worker: ".concat(JSON.stringify(e.reason)),e.reason instanceof Error?e.reason:null)}),self.addEventListener("error",e=>{Object(s.u)("Unhandled exception in audio worker",e)});const F="undefined"!=typeof SharedArrayBuffer;var W,q,j,V,Y,z,G,Z,K,X,Q,J,$,ee,te;let ne;var se,re,ie,ae,oe,ue,ce,le,he,de,fe,_e,pe,me,be,Ee,ge,Ae=!1,ve=null,Se=null;self.onWasmModuleReady=()=>{W=Module.cwrap("_Audio_Init","number",["number","string","string","number","number","boolean","boolean","boolean","number","boolean"]),q=Module.cwrap("_Audio_UnInit","number",["number"]),j=Module.cwrap("_Audio_Try_Analysis","number",["number","number","array","number"]),V=Module.cwrap("_Get_Mixed_Audio","number",["number","number","number","number","number"]),Y=Module.cwrap("_Put_Pre_Aec_Data","number",["number","array","number","number","number","number"]),z=Module.cwrap("_Put_Pre_Aec_Data","number",["number","number","number","number","number","number"]),G=Module.cwrap("_Get_Aec_Delay","number",["number"]),Z=Module.cwrap("_ReSet_Aec","number",["number"]),K=Module.cwrap("_Audio_Set_Data_Encryption","number",["number","number"]),X=Module.cwrap("_Add_Cooker_info","number",["number","number","number","number"]),$=Module.cwrap("_Get_Audio_Meat_Weight","number",["number"]),Q=Module.cwrap("_Remove_Cooker_Info","number",["number","number"]),J=Module.cwrap("_Change_Aec_Flag","number",["number","boolean"]),ee=Module.cwrap("_Change_Connect_Type","number",["number","number"]),te=Module.cwrap("_Interpretation_Configure","number",["number","number","number","number"]),ne=Module.cwrap("_Request_Audio_Qos_Data","number",["number"]),se=Module._malloc(40),Module.HEAPU32.subarray(se/4,se/4+10),re=Module.cwrap("_Start_Audio_Share","number",["number","number","number"]),ie=Module.cwrap("_InsertShareData","number",["number","number","number","number","number","number"]),ue=Module.cwrap("_Set_Share_Volume_Level","number",["number","number","number"]),ce=Module.cwrap("_Set_Speech_Volume_Level","number",["number","number","number"]),le=Module.cwrap("_Cc_Set_Lang","number",["number","number"]),he=Module._malloc(4),Module.HEAPU32.subarray(he/4,he/4+1),de=Module.cwrap("_Set_Audio_Encryption_Key_Directly","number",["number","number","number","number"]),fe=Module.cwrap("_Add_Roster_Info_Directly","number",["number","number","number","number"]),_e=Module.cwrap("_Enable_Share_To_Bo","number",["number","boolean"]),pe=Module.cwrap("_Enable_Broadcast_To_Bo","number",["number","boolean"]),me=Module.cwrap("_Set_Audio_Pipe_To_Bo","number",["number","number"]),be=Module.cwrap("_Smooth_Send_For_Qos","number",["number"]),ge=Module.cwrap("_request_nack_t_periodically_for_qos","number",["number"]),Ke=Module.cwrap("_Enable_Pipe_OUT_RTP","number",["number","number"]),Qe=Module.cwrap("_setMultiViewFlag","number",["number","boolean"]),I.onWasmModuleReady(Module)};var ye,Te,we,Me,De,Ie,Ce,Oe=null,ke=null,Le=null,Re=null,Ue=null,Ne=!1,Pe=!1,Be=!1,He=!1,xe=null,Fe=!1,We=!1,qe=!1,je=0,Ve=!1,Ye=!0;self.isPreviewMode=!1;var ze=!1,Ge=null,Ze=!1,Ke=null,Xe=!1,Qe=null,Je=1,$e=1,et=1,tt=null;function nt(){return Jt==I.AUDIO_STATE.UNMUTE||ae}function st(){function e(e){let t=null,n=r.db,i=null,a=e.onmessage,o=e.onopen,u=e.onclose;e.onmessage=n=>{t=(new Date).getTime(),a.call(e,n)},e.onopen=s=>{t=(new Date).getTime(),function(){if(i)return;i=setInterval(()=>{var s;(new Date).getTime()-t>=1e3*n&&(clearInterval(i),i=null,null===(s=e.socket)||void 0===s||s.close())},1e3)}(),o.call(e,s,e)},e.onclose=t=>{try{clearInterval(i)}catch(e){Object(s.u)("WebSocket closed",e)}u.call(e,t,e)}}this.socket=null,this.onopen=null,this.onmessage=null,this.onerror=null,this.onclose=null,this.websocketaddress=null,this.startwebsocketreconnecttime=null,this.reconnect=null,this.connectIndex=0,this.activeclosewebsocket=!1,this.init=function(t,n,s,r,i){this.websocketaddress=t,this.onopen=n,this.onmessage=s,this.onerror=r,this.onclose=i,e(this)},this.connect=function(e,t,n,r,a){var o=this;Object(s.o)("SB"),o.init(e,t,n,r,a),o.reconnect=function(){if(o.isReconnectNow||o.isTimerExist)return;o.isReconnectNow=!0,o.isTimerExist=!0;let e=0;o.startwebsocketreconnecttime&&((new Date).getTime()/1e3-o.startwebsocketreconnecttime<3?e=5:o.connectIndex=0);let t=Math.max(Math.min(Math.pow(2,o.connectIndex)-1,31),e);o.connectIndex++,setTimeout(()=>{o.activeclosewebsocket||(o.isTimerExist=!1,o.startwebsocketreconnecttime=null,o.socket=new WebSocket(this.websocketaddress),o.socket.binaryType="arraybuffer",o.socket.onopen=function(e){o.isReconnectNow=!1,Object(s.o)("SE"),o.startwebsocketreconnecttime=(new Date).getTime()/1e3,o.onopen(e)},o.socket.onmessage=function(e){o.onmessage(e)},o.socket.onerror=function(e){Object(s.o)("SERR"),o.socket.close()},o.socket.onclose=function(e){Object(s.o)("SCLOSE"),o.isReconnectNow=!1,o.onclose(e),o.activeclosewebsocket||(o.connectIndex<10?o.reconnect():(postMessage({status:i.k}),Object(s.u)("NetWork is Bad, Don't to reconnect the serer!")))})},1e3*t)},o.reconnect()},this.send=function(e){1===this.socket.readyState&&this.socket.send(e)},this.close=function(){try{var e;this.activeclosewebsocket=!0,null===(e=this.socket)||void 0===e||e.close()}catch(e){console.warn("force close",e)}}}function rt(e,t,n,s,r,i,a){const u={sample_rate:e,rtt:t,jitter:n,avg_loss:s,max_loss:r,bandwidth:i,rate:a};postMessage({status:o.b,data:u})}function it(e,t,n){postMessage({status:i.P,isUplink:0===e,networkLevel:t,bwLevel:n})}function at(e,t,n,r,i,a){if(Object(s.o)("WSURL:".concat(isPreviewMode&&!a,":").concat(e)),!isPreviewMode||a){var o=new st;return o.connect(e,t,n,r,i),o}}let ot=null;async function ut(e,t){isPreviewMode&&!t||(ot=new s.l(e),await ot.connect())}function ct(){let e;for(ze=!0;Ge&&(e=Ge.dequeue());)Nt(e.data,e.data.length,e.c,!0);postMessage({status:i.l})}function lt(){let e=Be||He;if(Oe&&e!=We){let t=e?1:0,n=Be?1:0,r=He?1:0;Object(s.o)("AQOS-S-"+t+"-"+n+"-"+r),ee(Oe,e?0:2)}We=e}function ht(e){let{url:t}=e.params;xe=e,He=!0,t.includes("mode=2")&<(),postMessage({status:i.r})}function dt(e){let{url:t}=e.params;He=!1,xe=null,t.includes("mode=2")&<(),postMessage({status:i.q})}let ft=new Map;self.seqMap=ft,self.seqList=[];class _t{constructor(){this.channel=null,this.audioHandle=null}open(e){const{wsUrl:t}=e;this.channel=at(t,this._onOpen.bind(this),this._onMessage.bind(this),this._onError.bind(this),this._onClose.bind(this))}createHandle(e){let{userId:t,meetingNumber:n,meetingId:s}=e;this.audioHandle=W(t,n,s,0,0,Ye,!1,!0,1)}enableBOPipeOutRtp(){Ke(this.audioHandle,1)}pipeTo(e){e&&this.audioHandle?me(this.audioHandle,e):console.warn(new Error("audio handle not ready when pipe audio to bo"))}_onOpen(e){}_onError(e){}_onClose(e){}_onMessage(e){if(!e||!e.data)return;let t=new Uint8Array(e.data);0!==t.length&&(t[0]===r.v?this.channel&&1===this.channel.socket.readyState&&this.channel.send(t):t[0]!==r.M&&this.decode(t))}close(){this.channel.close(),this.channel=null}setAudioEncryptionKey(e,t){const n=fn(e);de(this.audioHandle,n,e.length,t),_n(n)}updateRosterInfo(e){const{add:t,remove:n}=e;t&&t.forEach(e=>{const{sn:t,userid:n}=e,s=fn(t);fe(this.audioHandle,n,s,t.length),_n(s)})}decode(e){this.audioHandle&&e[0]!==r.q&&j(this.audioHandle,0,e,e.length)}isShareToBoAudio(e){return 0===e[2]&&0===e[3]&&![r.M,r.v,r.u,r.r].includes(e[0])}}var pt=new _t;function mt(e,t){pt.isShareToBoAudio(e)?pt.decode(e):Fe&&e[0]===r.q||(j(Oe,0,e,e.length),Rt())}function bt(e){null!==Oe&&mt(e)}const Et=(()=>{let e;return{updateKey:t=>{t&&(e=t),Oe&&e&&mt(e)}}})();function gt(e){let t=new Uint8Array(e.data);if(102==t[0]){if(Ae)return;Ae=!0,ve=new Uint8Array(t)}null!==Oe?mt(t):t[0]==r.M?Et.updateKey(t):t[0]==r.r&&(tt=t)}function At(e){ze=!1,postMessage({status:i.p})}function vt(e){}function St(e,t,n,s){var r=new Uint8Array(2*s),i=Module.HEAP8.subarray(e+0,e+2*s);r.set(i,0,2*s),ln({data:r,channels:n,sampleHZ:t})}let yt=null,Tt=null;var wt=function(e,t){this._BYTES_PER_ELEMENT=t,this.capacity=(e.byteLength-8)/t,this.usableCapacity=this.capacity-1,this.buf=e,this.write_ptr=new Uint32Array(this.buf,0,1),this.read_ptr=new Uint32Array(this.buf,4,1),this.storageUint8s=new Uint8Array(this.buf,8,e.byteLength-8),this.cache_buffer=[]};function Mt(e,t,n,s,r,i,a,o){Tt===e&&yt.length==t*a||(yt=Module.HEAPF32.subarray(e/4,e/4+t*a),Tt=e),Gt.write([yt])}function Dt(e,t,n,s){self.fsHandler&&self.fsHandler.handleFile(e,t,n,s)}function It(e,t){if(!t)return;var n=new Uint8Array(t),s=Module.HEAP8.subarray(e+0,e+t);n.set(s);let r,a=new Uint32Array(n.buffer),o=null,u=null,c=0,l=0;for(let e=0;e<n.length/16;e++){let t=a[4*e];512&t?(o=a.subarray(4*e,4*e+4),l=Ct(o)):t>>10==en>>10&&(r=t,u=a.subarray(4*e,4*e+4),c=Ct(u))}(c||l)&&(Ht?Ht.postMessage({status:2,data:c,sdata:l,ssrc:r}):postMessage({status:i.z,at:c,st:l}))}function Ct(e){let t=e[1];return 4294967296*e[2]+t}function Ot(e,t,n,s,r,i,a,o){if(F&&zt)return Mt(e,t,0,0,0,0,a);var u=Module.HEAP8.subarray(e+0,e+4*t*a),c=new Uint8Array(4*t*a);c.set(u,0,4*t*a);var l=new Float32Array(c.buffer);if(Wt&&Jt===I.AUDIO_STATE.UNMUTE){var h=new Uint8Array(4*t*a);h.set(u,0,4*t*a);var d=new Float32Array(h.buffer),f={status:0,data:d},_=[d.buffer];Wt.postMessage(f,_)}let p,m;p={status:0,data:l,channels:a,sampleHz:i},m=[p.data.buffer],Bt&&Bt.postMessage(p,m)}function kt(e,t){mn&&mn.writeWasmLog(e,t,!0)}wt.prototype.clear=function(){this.write_ptr&&Atomics.store(this.write_ptr,0,0),this.read_ptr&&Atomics.store(this.read_ptr,0,0),this.cache_buffer=[]},wt.prototype.enqueueMergeData=function(e,t){for(;this.cache_buffer.length>0&&this.available_write()>0;){let e=this.cache_buffer.shift();this.push(e)}if(e&&t){if(this.cache_buffer.length>0){let n=new Uint8Array(e.length+t.length);n.set(e,0,e.length),n.set(t,e.length,t.length),this.cache_buffer.push(n)}else if(this.available_write()>0)this.pushMergeData(e,t);else{let n=new Uint8Array(e.length+t.length);n.set(e,0,e.length),n.set(t,e.length,t.length),this.cache_buffer.push(n)}this.cache_buffer.length>255&&(this.cache_buffer=[])}},wt.prototype.pushMergeData=function(e,t){let n=Atomics.load(this.write_ptr,0);try{this.storageUint8s.set(e,n*this._BYTES_PER_ELEMENT+4,e.byteLength),this.storageUint8s.set(t,n*this._BYTES_PER_ELEMENT+4+e.byteLength,t.byteLength),new Uint32Array(this.buf,n*this._BYTES_PER_ELEMENT+8,1)[0]=e.byteLength+t.byteLength;let s=(n+1)%this.capacity;Atomics.store(this.write_ptr,0,s)}catch(e){throw Object(s.u)("Error in Producer.pushMergeData: ".concat(n," ").concat(this.buf),e),e}},wt.prototype.enqueue=function(e){for(;this.cache_buffer.length>0&&this.available_write()>0;){let e=this.cache_buffer.shift();this.push(e)}if(e){if(this.cache_buffer.length>0){let t=new Uint8Array(e.length);t.set(e,0,e.length),this.cache_buffer.push(t)}else if(this.available_write()>0)this.push(e);else{let t=new Uint8Array(e.length);t.set(e,0,e.length),this.cache_buffer.push(t)}this.cache_buffer.length>255&&(this.cache_buffer=[])}},wt.prototype.push=function(e){let t=Atomics.load(this.write_ptr,0);try{this.storageUint8s.set(e,t*this._BYTES_PER_ELEMENT+4,e.byteLength),new Uint32Array(this.buf,t*this._BYTES_PER_ELEMENT+8,1)[0]=e.byteLength;let n=(t+1)%this.capacity;Atomics.store(this.write_ptr,0,n)}catch(e){throw Object(s.u)("Error in Producer.push: ".concat(t," ").concat(this.buf),e),e}},wt.prototype.available_write=function(){var e=Atomics.load(this.read_ptr,0),t=Atomics.load(this.write_ptr,0);return this._available_write(e,t)},wt.prototype._available_write=function(e,t){return this.usableCapacity-this._available_read(e,t)},wt.prototype._available_read=function(e,t){return(t+this.capacity-e)%this.capacity};var Lt=0;function Rt(){He&&1!==Lt?(Lt=1,postMessage({status:i.y,type:Lt})):Be&&!He&&2!==Lt?(Lt=2,postMessage({status:i.y,type:Lt})):Be||He||3===Lt||(Lt=3,postMessage({status:i.y,type:Lt}))}function Ut(e,t,n,s){Nt(e,t,n,!1,s!=Oe&&Oe)}function Nt(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];var o;if(i)o=e;else if(ze)o=Module.HEAP8.subarray(e+0,e+t);else{o=new Uint8Array(t);var u=Module.HEAP8.subarray(e+0,e+t);o.set(u,0,t)}if(Se&&o[0]===r.s&&Se.setRtpPackets(),a&&(o[2]=128),!ze)return Ge||(Ge=new L.a),void Ge.enqueue({data:o,c:n});if(n&&(nt()||!qe)&&He&&xe)return Rt(),void xe.send(o);if(!n||!nt()&&qe||!Be)null===ke||!ke.socket||1!==ke.socket.readyState||(!nt()||We)&&n&&qe||(Rt(),ke.send(o),o.length<12&&Object(s.u)("Audio encode data length is too short"));else if(Rt(),i)Tn.send(o);else{new Uint8Array(t).set(o,0,t),Tn.sendWasmData(o)}}function Pt(){}var Bt,Ht,xt,Ft,Wt,qt,jt,Vt,Yt=null,zt=null,Gt=null,Zt=null,Kt=null,Xt=null,Qt=null,Jt=-1,$t=0,en=0,tn=0,nn=!1;function sn(){if(Oe)return F&&zt?rn():void(Bt&&V(Oe,Le/100,0,Le,$e))}function rn(){var e;if(null===(e=Tn)||void 0===e||e.sock.reciver(),Gt&&Gt.isReady())for(;Gt.isNeedMoreData();)V(Oe,Le/100,0,Le,$e)}function an(e){if(F&&zt)return on();xt&&e&&(isPreviewMode||(Module.HEAPF32.subarray(qt/4,qt/4+Le/100*Je).set(e),I.deliverRecordedData(qt,Le/100,Le,Je)))}function on(e){if(Zt){let e=null;for(;null!==(e=Zt.read());)isPreviewMode||(Module.HEAPF32.subarray(qt/4,qt/4+Le/100*Je).set(e),I.deliverRecordedData(qt,Le/100,Le,Je))}if(Qt){let e=null;for(;null!=(e=Qt.read());)isPreviewMode||(Module.HEAPF32.subarray(jt/4,jt/4+Le/100*$e).set(e),z(Oe,jt,Le,$e,Le/100,1))}if(Xt&&ae){let e=null;for(;null!==(e=Xt.read());)Module.HEAPF32.subarray(Vt/4,Vt/4+oe/100*et).set(e),ie(Oe,Vt,oe,et,oe/100,0)}}function un(e,t){var n=new Uint8Array(t),s=Module.HEAP8.subarray(e+0,e+t);n.set(s,0,t),ke&&1===ke.socket.readyState&&ke.send(n)}function cn(e,t){mn&&mn.writeWasmLog(e,t)}function ln(e){if(-1!=Jt&&2!=Jt&&zt&&Yt&&null!=e&&!(e.data.length>960)){var t=new Uint16Array(zt);if(Yt.lock(),t[2]<30){for(var n=3,s=t[2];s>0;)s--,n+=t[n+1],n+=2;if(e){var r=new Uint16Array(e.data.buffer);t[2]++,t[n]=e.sampleHZ,t[n+1]=r.length,n+=2,t.set(r,n)}}else console.log("too many data in sharebuffer!"),t[2]=0;Yt.unlock()}}function hn(){postMessage({status:i.c})}function dn(e,t){ye||(ye=setInterval((function(){Oe&&$(Oe)}),6e4));let n=new Uint8Array(t),s=Module.HEAP8.subarray(e+0,e+t);n.set(s,0,t),(Me=new Uint8Array(n.length)).set(n,0),postMessage({status:i.a,data:n},[n.buffer])}function fn(e){if(!e)return 0;let t=Module._malloc(e.length);return Module.HEAPU8.subarray(t,t+e.length).set(e,0,e.length),t}function _n(e){e&&Module._free(e)}function pn(e,t,n,s){let r=null,i=null;e&&t&&(r=Module.HEAPU8.subarray(e,e+t)),n&&s&&(i=Module.HEAPU8.subarray(n,n+s)),Kt&&(r&&i?Xe||Kt.enqueueMergeData(r,i):i&&Kt.enqueue(i))}var mn=Object(u.a)();let bn;var En=0;function gn(){return!An}self.addEventListener("message",(function(e){var t,n=e.data;switch(n.command){case k.q:try{if(Object(s.o)("STARTMEDIA:".concat(function(e){let t=e.userid,n=e.isPreviewMode?1:0;return n|=gn()?2:0,"".concat(t,":").concat(n)}(n))),isPreviewMode=!!n.isPreviewMode,function(e){let t=e._id;En=t;let n=Je;e.audioEncodeChannelsNum&&(n=e.audioEncodeChannelsNum);let s=$e;e.audioDecodeChannelsNum&&(s=e.audioDecodeChannelsNum);let r=e.sampleRate;F&&!e.shouldNotChangeSampleRate&&(r=48e3),Ce=e.meetingid,Ie=e.meetingnumb+"",Ve=!0,Te=e.userid;let a=r/100;qt&&r==Le&&Je==n||(Je=n,_n(qt),qt=Module._malloc(4*a*Je),Module.HEAPF32.subarray(qt/4,qt/4+a*Je)),jt&&r==Le&&$e==s||($e=s,_n(jt),jt=Module._malloc(4*a*$e),Module.HEAPF32.subarray(jt/4,jt/4+a*$e)),Le=r,(qe=!!e.encode)?(De=!0,Ue=!0,Se=new R.a(i.e)):Re=!0,Ze=!!e.decoderInWorklet}(n),function(e){Sn||(mn&&mn.init({workerType:e.encode?a.b.AUDIO_ENCODE:a.b.AUDIO_DECODE}),Sn=!0)}(n),isPreviewMode){!function(e){postMessage({status:i.n}),postMessage({status:i.h}),yn(e)}(n);break}gn()||(An=!1,Object(s.o)("RSTHOLD")),yn(n),qe||(Object(s.o)("HB"),vn(n.userid,0,0)),postMessage({status:qe||Oe?i.h:i.g})}catch(e){postMessage({status:i.g}),Object(s.u)("Error in startMedia",e)}break;case k.i:ke&&(ke.close(),ke=null),ke=at(n.websocket_ip_address,ct,gt,vt,At,!0);break;case k.c:ke&&(ke.close(),ke=null);break;case k.j:{let e=n._id;ot&&(ot.forceClose(),ot=null);let t=1;n.webtransportURL.includes("mode=2")&&(t=0),ut({url:n.webtransportURL,label:"audio",id:e,onmessage:bt,onopen:ht,onclose:dt,groupSize:t},!0);break}case k.d:{let e=n._id;ot&&ot.id==e&&(ot.forceClose(),ot=null);break}case"EncodedAudioFrame":ke&&1===ke.socket.readyState&&ke.send(n.data);break;case k.b:{let e=n._id;if(e<En){Object(s.u)("close media cmd old session id ".concat(e," , current session id ").concat(En));break}ot&&ot.id==e&&(ot.forceClose(),ot=null,xe=null)}if(An=!1,ke&&ke.close(),Ue&&$t>4e3&&Oe){var o=G(Oe);console.log("Store Delay: "+o),o>0&&postMessage({status:i.d,delay:o})}Re=null,Ue=null,Ee&&(clearInterval(Ee),Ee=null),Oe=null,qt&&Module._free(qt),qt=void 0,null,jt&&Module._free(jt),jt=void 0,null,ke=null,Module.HEAP8.fill(0),calledRun=void 0,ABORT=!1,dependenciesFulfilled=function e(){calledRun||run(),calledRun||(dependenciesFulfilled=e)},Ae=!1,ve=null,we=void 0,self.isPreviewMode=!1,Me=void 0,ze=!1,Ge=null,We=!1,He=!1,Be=!1,xe&&(xe.forceClose(),xe=null),yt=null,Tt=null,Gt=null,Zt=null,Kt=null,Xt=null,zt=null,Ht&&Ht.close(),xt&&xt.close(),tn=0,Jt=-1,Xe=!1,Ne=!1,Pe=!1,ye&&(clearInterval(ye),ye=null),en=0,Lt=0,$t=0,0,Yt=null,Fe=!1,ae=!1,pt=new _t,function(){try{let e=Tn;Tn=null,Be=!1,wn={},null==e||e.close()}catch(e){console.error("<<<< CloseDataTransport ",e)}}();break;case"delay":0;break;case"failover":ke&&(ke.close(),ke=at(n.websocket_ip_address,ct,gt,vt,At));break;case"sharedBuffer":if(F){const e=n.data;(zt=e)&&(qe?((Zt=new O(zt.inputState,zt.inputBuffer,Le/100*Je)).clear(),zt.echoState&&zt.echoBuffer&&(Qt=new O(zt.echoState,zt.echoBuffer,Le/100*$e)).clear()):(Gt=new O(zt.outputState,zt.outputBuffer,Le/100*$e),Kt=new wt(zt.rtpBuffer,1200),Gt.clear(),Kt.clear()),$t=21)}break;case"modifySampleRate":if(Le===n.sampleRate)break;qt&&Module._free(qt),qt=Module._malloc(4*n.sampleRate/100*Je),Module.HEAPF32.subarray(qt/4,qt/4+n.sampleRate/100*Je),jt&&Module._free(jt),jt=Module._malloc(4*n.sampleRate/100*$e),Module.HEAPF32.subarray(jt/4,jt/4+Le/100*$e),Le=n.sampleRate,zt&&(qe?((Zt=new O(zt.inputState,zt.inputBuffer,Le/100*Je)).clear(),zt.echoState&&zt.echoBuffer&&(Qt=new O(zt.echoState,zt.echoBuffer,Le/100*$e)).clear()):(Gt=new O(zt.outputState,zt.outputBuffer,Le/100*$e)).clear());break;case"mute":var u,c;n.sharing||(Jt=n.bOn,I.muteUnmuteState(Jt),nn&&(Jt===I.AUDIO_STATE.UNMUTE?null===(u=Se)||void 0===u||u.startCheck():null===(c=Se)||void 0===c||c.stopCheck())),Jt!=I.AUDIO_STATE.UNMUTE&&!n.sharing||Ne?Jt==I.AUDIO_STATE.LEAVED?(Bt&&!n.fakeLeave&&(Bt.close(),Bt=null),Re&&(Gt&&Gt.clear(),Kt&&Kt.clear()),Ue&&(Zt&&Zt.clear(),clearInterval(ye),ye=null),ae||(Ee&&(clearInterval(Ee),Ee=0),Ne=!1)):Jt===I.AUDIO_STATE.MUTE&&Zt&&Zt.clear():(Ne=!0,Re&&(Gt&&(Gt.clear(),Gt.setWriteReady()),Kt&&Kt.clear()),Ue&&(Oe&&!De&&$(Oe),De=!1,Zt&&Zt.clear()));break;case"audio_denoise_switch":I.switchDenoise(n.switch?1:0,n.isHeadSet);break;case"original_sound_switch":I.switchOriginalSound(n.enable,n.highfidelity,!1,n.stereo);break;case"resetAec":Oe&&Z(Oe),$t=0,F&&zt&&($t=21);break;case"decodeAudioPort":Bt&&Bt.close(),(Bt=e.ports[0]).onmessage=function(e){const{status:t,cacheSize:n,isSAB:i}=e.data;switch(t){case"delay":0;break;case r.h:sn();break;case r.f:Object(s.o)("".concat(i?"ACSS":"ACS").concat(n||""));break;case"workletMessage":"error"===e.data.data.level&&Object(s.u)("Error from Audio Worklet"+e.data.data.message,e.data.data.data)}};break;case"encodeAudioPort":xt&&xt.close(),(xt=e.ports[0]).onmessage=function(e){if(Oe||isPreviewMode)switch(e.data.command){case r.g:Oe&&an(e.data.buffer)}};break;case"shareAudioDecodeAudioPort2":Ft&&Ft.close(),(Ft=e.ports[0]).onmessage=function(e){if(Oe||isPreviewMode)switch(e.data.command){case r.g:Oe&&an(e.data.buffer)}};break;case"audioWorkerPort":Wt&&(Wt.close(),Wt=null),(Wt=e.ports[0]).onmessage=function(e){switch(e.data.status){case 0:Oe&&Jt===I.AUDIO_STATE.UNMUTE&&Y&&(Module.HEAPF32.subarray(jt/4,jt/4+Le/100*$e).set(e.data.data),z(Oe,jt,Le,$e,Le/100,1))}};break;case"updateCurrentSSRC":en=n.SSRC;break;case"ENCRYPT":Pe=n.encrypt,Oe&&K(Oe,Pe?1:0);break;case"SOCKET_RECONNECT":self.IS_DISABLE_SOCKET_RECONNECT=!0===n.disable;break;case k.o:{let e=n.data.userNodeList;e&&e.forEach(e=>{let t=parseInt(e.userid);if(e.bremove)return void(Oe&&Q(Oe,t));let n=e.sn;if(16!=n.length&&32!=n.length)return;let s=fn(n);if(Oe){let e=!1;qe&&Te!=t||(e=!0),e&&X(Oe,t,s,n.length)}qe&&Te==t&&(we=n),_n(s)});break}case"decodeAudioPort2":Ht&&Ht.close(),Ht=e.ports[0];break;case"startAudioEncode":if(Ve&&n.ssid&&!isPreviewMode){Object(s.o)("HB"),Ve=!1;let e,t=Me;e=t?t.length:0;let r=0;if(r=fn(t),(Oe=W(n.ssid,Ie,Ce,r,e,Ye,qe,!0,1))?I.setAudioInstanceAndType(Oe,I.WASMTYPE.ENCODE):Object(s.u)("audio_handle not exist when encoding"),Oe&&tt&&mt(tt),I.muteUnmuteState(Jt),Oe&&ee(Oe,Be||He?0:2),_n(r),ve&&j(Oe,0,ve,ve.length),we){let e=fn(we);X(Oe,Te,e,we.length),_n(e)}}if(!Oe)return Object(s.u)("Error when init audio encode handle, start_handle_init: "+Ve+"ssrc: "+n.ssid+", isPreview:"+isPreviewMode),void postMessage({status:i.m});Ee||(Ee=setInterval(()=>{Oe&&be(Oe)},10)),n.isSharing?(ae=!0,et=n.sharingEncodeChannelsNum,oe=n.samplerate,Vt=Module._malloc(4*oe/100*et),Module.HEAPF32.subarray(Vt/4,Vt/4+oe/100*et),zt&&(Xt=new O(zt.sharingInputState,zt.sharingInputBuffer,oe/100*et)).clear(),re(Oe,ae,2==et)):Zt&&Zt.clear();break;case"AecFlag":Ye=n.flag,Oe&&J(Oe,Ye);break;case"audioDecodeSAB":{let e=n.data.buffer,t=n.data.offset,s=n.data.length;wn.reciver={sab:e,offset:t,length:s,interval:0,useCopy:!1,useOneElement:!1},Object(U.b)(Tn,null,wn.reciver);break}case"audioEncodeSAB":{let e=n.data.buffer,t=n.data.offset,s=n.data.length,r=n.data.bAudioEncodeMainThreadConsumerIntervalEnable;wn.sender={sab:e,offset:t,length:s,interval:r?10:0,useCopy:!1,useOneElement:!1,disableAuto:!0},Object(U.b)(Tn,wn.sender,null);break}case"PAUSE_OR_RESUME_AUDIO_DECODE":{let{bPause:e}=n.data;Fe=e;break}case"cc_set_lang":Module.HEAPU32.subarray(he/4,he/4+1)[0]=n.lang,Oe&&le(Oe,he);break;case"interpretation_enable":Module.HEAPU32.subarray(se/4,se/4+10)[0]=n.enable?1:0,Oe&&te(Oe,r.k,se,1);break;case"interpretation_set_lang":Module.HEAPU32.subarray(se/4,se/4+10)[0]=n.lang,Oe&&te(Oe,r.n,se,1);break;case"interpretation_mute_origin":Module.HEAPU32.subarray(se/4,se/4+10)[0]=n.mute?1:0,Oe&&te(Oe,r.l,se,1);break;case"interpretation_set_interpreter":{let e=Module.HEAPU32.subarray(se/4,se/4+10),t=se;n.interpreterList.length>=10&&(Object(s.u)("Interpreter list is larger than ".concat(9)),t=Module._malloc(4*n.interpreterList.length),e=Module.HEAPU32.subarray(t/4,t/4+n.interpreterList.length));for(let t=0;t<n.interpreterList.length;t++)e[t]=n.interpreterList[t];Oe&&te(Oe,r.m,t,n.interpreterList.length),n.interpreterList.length>=10&&Module._free(t);break}case"changeAudioShare":if(!Oe)return;ae=n.isStart,re(Oe,ae,!1),ae||Jt!=I.AUDIO_STATE.LEAVED||(Ee&&(clearInterval(Ee),Ee=0),Ne=!1,Xt&&Xt.clear());break;case k.m:{const e=()=>{Oe&&ne(Oe)};bn&&clearInterval(bn),n.data.enable&&(bn=setInterval(e,n.data.pollingInterval||r.y));break}case"setShareVolumeLevel":if(!Oe)return;ue(n.isFromMainSession?pt.audioHandle:Oe,n.userid,n.shareVolume);break;case"setSpeechVolumeLevel":if(!Oe)return;ce(Oe,n.userid,n.volume);break;case"BUILD_MA_CHANNEL_IN_BO":pt.open({wsUrl:n.data});break;case k.s:{let e=n.data;if(e.isFromMainSession){const{encryptKey:t,encryptType:n,userId:s,meetingNumber:r,confId:i}=e.updateParams;pt.createHandle({userId:s,meetingNumber:r+"",meetingId:i}),Oe&&pt.pipeTo(Oe),pt.setAudioEncryptionKey(t,n),Ze&&(I.disableJitterLog(),pt.enableBOPipeOutRtp())}break}case k.t:{let e=n.data;e.isFromMainSession&&pt.updateRosterInfo(e.body);break}case"ENABLE_SHARE_TO_BO":if(!Oe)return;_e(Oe,n.data);break;case"ENABLE_BROADCAST_TO_BO":if(!Oe)return;pe(Oe,n.data);break;case"stop_audio_incoming":Kt&&Kt.clear(),Xe=n.stopPlayAudio;break;case"highBitrate":Oe&&I.switchHighBitrate(n.highBitrate);break;case"RIWM":createWasm(),_free=Module._free=function(){return(_free=Module._free=Module.asm.free).apply(null,arguments)},___wasm_call_ctors=Module.___wasm_call_ctors=function(){return(___wasm_call_ctors=Module.___wasm_call_ctors=Module.asm.__wasm_call_ctors).apply(null,arguments)},stackSave=Module.stackSave=function(){return(stackSave=Module.stackSave=Module.asm.stackSave).apply(null,arguments)},stackRestore=Module.stackRestore=function(){return(stackRestore=Module.stackRestore=Module.asm.stackRestore).apply(null,arguments)},stackAlloc=Module.stackAlloc=function(){return(stackAlloc=Module.stackAlloc=Module.asm.stackAlloc).apply(null,arguments)},Module.zoomf={},run();break;case k.e:{let e=n.data||{},r=!!e.hold;Object(s.o)("HOLD:".concat(r,":").concat(e.userid,":").concat(e.reinit)),r?function(e){if(An)return;if(Te&&e.userid&&e.userid>>10!=Te>>10)return void Object(s.o)("HOLDINVALID");if(An=!0,null==Oe)return;let t=Oe;Oe=null,I.setAudioInstanceAndType(Oe,qe?I.WASMTYPE.ENCODE:I.WASMTYPE.DECODE),q(t)}(e):(t=e,An&&(An=!1,Ve=!0,t.reinit&&(Te=t.userid,qe||vn(Te,0,0),postMessage({status:qe||Oe?i.h:i.g}))));break}case k.n:I.setAllSpeechVolume(n.volume);break;case k.p:var l,h,d;(nn=n.value)?Jt===I.AUDIO_STATE.UNMUTE?null===(l=Se)||void 0===l||l.startCheck():null===(h=Se)||void 0===h||h.stopCheck():null===(d=Se)||void 0===d||d.stopCheck()}}));var An=!1;function vn(e,t,n){Oe&&je==e?Object(s.o)("AHNN"):(Oe&&(q(Oe),Oe=null,console.error("<<<<< pre audiouserid ".concat(je," now ").concat(e))),Oe=W(e,Ie,Ce,t,n,Ye,qe,!0,1),je=e,Oe&&!isPreviewMode?I.setAudioInstanceAndType(Oe,I.WASMTYPE.DECODE):Oe||Object(s.u)("audio_handle not exist when decoding"),Et.updateKey(),Ze&&(I.disableJitterLog(),Ke(Oe,1)),Qe(Oe,!1))}var Sn=!1;function yn(e){if(ot&&ot.id!=En&&(ot.forceClose(),ot=null),e.webtransportURL&&!ot){let t=1;e.webtransportURL.includes("mode=2")&&(t=0),ut({url:e.webtransportURL,label:"audio",id:En,onmessage:bt,onopen:ht,onclose:dt,groupSize:t})}Object(s.j)(ke,e.websocket_ip_address)&&(ke&&(ke.close(),ke=null,Object(s.u)("audio websocket cid changed")),ke=at(e.websocket_ip_address,ct,gt,vt,At)),function(){if(Tn)return;(Tn=Object(N.d)(qe?P.e.AUDIO_ENCODE:P.e.AUDIO_DECODE)).onmessage=Mn,Tn.onopen=()=>{Be=!0,lt()},Tn.onclose=()=>{Be=!1,lt()},(wn.sender||wn.reciver)&&Object(U.b)(Tn,wn.sender,wn.reciver)}()}var Tn=null,wn={};function Mn(e,t){Oe&&(qe||tn++%3!=0||ge(Oe),mt(new Uint8Array(e)))}Object(N.b)(),Object(B.a)(self)},,,,,,,function(e,t,n){"use strict";n.r(t);var s=n(52);Object.keys(s).forEach(e=>self[e]=s[e])}]);
|
|
2
|
-
//# sourceMappingURL=https://d1cdksi819e9z7.cloudfront.net/sourcemap/js_audio_process.min.js-
|
|
2
|
+
//# sourceMappingURL=https://d1cdksi819e9z7.cloudfront.net/sourcemap/js_audio_process.min.js-e8033f4192aec793754b.map
|
|
3
3
|
self.__wasmCodeDataEndFlag = 1;
|
|
4
4
|
var Module=typeof Module!=="undefined"?Module:{};
|
|
5
5
|
Module["locateFile"] = function(filename){
|