@zoom/meetingsdk 3.0.0-rc
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/CHANGELOG.md +54 -0
- package/LICENSE.pdf +0 -0
- package/README.md +182 -0
- package/dist/css/bootstrap.css +5 -0
- package/dist/css/react-select.css +434 -0
- package/dist/fonts/glyphicons-halflings-regular.eot +0 -0
- package/dist/fonts/glyphicons-halflings-regular.svg +229 -0
- package/dist/fonts/glyphicons-halflings-regular.ttf +0 -0
- package/dist/fonts/glyphicons-halflings-regular.woff +0 -0
- package/dist/lib/audio/archival.mp3 +0 -0
- package/dist/lib/audio/incoming-msg-chime.mp3 +0 -0
- package/dist/lib/audio/m-entry.mp3 +0 -0
- package/dist/lib/audio/m-exit.mp3 +0 -0
- package/dist/lib/audio/m-wr.mp3 +0 -0
- package/dist/lib/audio/meeting_is_now_recorded.mp3 +0 -0
- package/dist/lib/audio/raise-hand-chime.mp3 +0 -0
- package/dist/lib/audio/recording_is_now_stopped.mp3 +0 -0
- package/dist/lib/audio/ring.mp3 +0 -0
- 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 +10 -0
- package/dist/lib/av/js_audio_process.min.js +10 -0
- package/dist/lib/av/js_audio_worklet.min.js +2 -0
- package/dist/lib/av/js_audio_worklet_process.min.js +25 -0
- package/dist/lib/av/js_audio_worklet_simd.min.js +25 -0
- package/dist/lib/av/js_media.min.js +2 -0
- package/dist/lib/av/js_sharing_audio_worklet.min.js +2 -0
- package/dist/lib/av/sharing_m.min.js +31 -0
- package/dist/lib/av/sharing_mtsimd.min.js +31 -0
- package/dist/lib/av/sharing_s.min.js +10 -0
- package/dist/lib/av/sharing_simd.min.js +10 -0
- package/dist/lib/av/vb-resource/dualModel.bin +0 -0
- package/dist/lib/av/vb-resource/tf.min.js +18 -0
- package/dist/lib/av/vb-resource/vbPreload.js +1 -0
- package/dist/lib/av/vb-resource/vbPreloadWorker.js +1 -0
- package/dist/lib/av/video.decode.wasm +0 -0
- package/dist/lib/av/video.mt.wasm +0 -0
- package/dist/lib/av/video.mtsimd.wasm +0 -0
- package/dist/lib/av/video.simd.wasm +0 -0
- package/dist/lib/av/video_m.min.js +31 -0
- package/dist/lib/av/video_mtsimd.min.js +31 -0
- package/dist/lib/av/video_s.min.js +10 -0
- package/dist/lib/av/video_share_mtsimd.min.js +31 -0
- package/dist/lib/av/video_simd.min.js +10 -0
- package/dist/lib/av/websipclient.min.js +1 -0
- package/dist/lib/image/SanFrancisco.jpg +0 -0
- package/dist/lib/image/animation-sprite.png +0 -0
- package/dist/lib/image/blur.png +0 -0
- package/dist/lib/image/earth.jpg +0 -0
- package/dist/lib/image/grass.jpg +0 -0
- package/dist/lib/image/mask-circle.png +0 -0
- package/dist/lib/image/mask-heart.png +0 -0
- package/dist/lib/image/mask-rectangle.png +0 -0
- package/dist/lib/image/notification.png +0 -0
- package/dist/lib/lang/de-DE.json +1727 -0
- package/dist/lib/lang/en-US.json +1727 -0
- package/dist/lib/lang/es-ES.json +1727 -0
- package/dist/lib/lang/fr-FR.json +1727 -0
- package/dist/lib/lang/id-ID.json +1727 -0
- package/dist/lib/lang/it-IT.json +1727 -0
- package/dist/lib/lang/jp-JP.json +1727 -0
- package/dist/lib/lang/ko-KO.json +1727 -0
- package/dist/lib/lang/nl-NL.json +1727 -0
- package/dist/lib/lang/pl-PL.json +1727 -0
- package/dist/lib/lang/pt-PT.json +1727 -0
- package/dist/lib/lang/ru-RU.json +1727 -0
- package/dist/lib/lang/tr-TR.json +1727 -0
- package/dist/lib/lang/vi-VN.json +1727 -0
- package/dist/lib/lang/zh-CN.json +1727 -0
- package/dist/lib/lang/zh-TW.json +1727 -0
- package/dist/lib/vendor/lodash.min.js +140 -0
- package/dist/lib/vendor/react-dom.min.js +239 -0
- package/dist/lib/vendor/react.min.js +32 -0
- package/dist/lib/vendor/redux-thunk.min.js +1 -0
- package/dist/lib/vendor/redux.min.js +1 -0
- package/dist/lib/webim.min.js +23 -0
- package/dist/ui/33f06.svg +647 -0
- package/dist/ui/zoomus-websdk-806.umd.min.js +1 -0
- package/dist/ui/zoomus-websdk-MobileReportProblemContent.umd.min.js +2 -0
- package/dist/ui/zoomus-websdk-ReportProblemContent.umd.min.js +2 -0
- package/dist/ui/zoomus-websdk-editor_de-DE.umd.min.js +1 -0
- package/dist/ui/zoomus-websdk-editor_es-ES.umd.min.js +1 -0
- package/dist/ui/zoomus-websdk-editor_fr-FR.umd.min.js +1 -0
- package/dist/ui/zoomus-websdk-editor_id-ID.umd.min.js +1 -0
- package/dist/ui/zoomus-websdk-editor_it-IT.umd.min.js +1 -0
- package/dist/ui/zoomus-websdk-editor_ja-JP.umd.min.js +1 -0
- package/dist/ui/zoomus-websdk-editor_ko-KR.umd.min.js +1 -0
- package/dist/ui/zoomus-websdk-editor_nl-NL.umd.min.js +1 -0
- package/dist/ui/zoomus-websdk-editor_pl-PL.umd.min.js +1 -0
- package/dist/ui/zoomus-websdk-editor_pt-PT.umd.min.js +1 -0
- package/dist/ui/zoomus-websdk-editor_ru-RU.umd.min.js +1 -0
- package/dist/ui/zoomus-websdk-editor_tr-TR.umd.min.js +1 -0
- package/dist/ui/zoomus-websdk-editor_vi-VN.umd.min.js +1 -0
- package/dist/ui/zoomus-websdk-editor_zh-CN.umd.min.js +1 -0
- package/dist/ui/zoomus-websdk-editor_zh-TW.umd.min.js +1 -0
- package/dist/ui/zoomus-websdk-icons.umd.min.js +1 -0
- package/dist/ui/zoomus-websdk-loginview.umd.min.js +1 -0
- package/dist/ui/zoomus-websdk-lottie-web.umd.min.js +1 -0
- package/dist/ui/zoomus-websdk-lottie.umd.min.js +1 -0
- package/dist/ui/zoomus-websdk-main-client.umd.min.js +2 -0
- package/dist/ui/zoomus-websdk-preview.umd.min.js +2 -0
- package/dist/ui/zoomus-websdk-zoommtgMain.umd.min.js +2 -0
- package/dist/zoom-meeting-3.0.0.min.js +2 -0
- package/dist/zoom-meeting-embedded-ES5.min.js +2 -0
- package/dist/zoomus-websdk-embedded.umd.min.js +2 -0
- package/dist/zoomus-websdk.umd.min.js +2 -0
- package/embedded.d.ts +1567 -0
- package/embedded.js +3 -0
- package/index.d.ts +2101 -0
- package/index.js +4 -0
- package/oss_attribution.txt +6432 -0
- package/package.json +53 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("disk-file-writer")):"function"==typeof define&&define.amd?define(["disk-file-writer"],t):"object"==typeof exports?exports.JsMediaSDK_Instance=t(require("disk-file-writer")):e.JsMediaSDK_Instance=t(e["disk-file-writer"])}(window,(function(e){return function(e){var t={};function r(i){if(t[i])return t[i].exports;var a=t[i]={i:i,l:!1,exports:{}};return e[i].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=e,r.c=t,r.d=function(e,t,i){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)r.d(i,a,function(t){return e[t]}.bind(null,a));return i},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=41)}([function(e,t,r){"use strict";var i=r(12),a=r(6),n=r(2),o=r(19),s=r.n(o),u=r(24),d=r.n(u),c=r(16),h=r.n(c),l=r(7),p=r.n(l),f=r(8),m=r.n(f),v=r(14);function g(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,i=h()(e);if(t){var a=h()(this).constructor;r=Reflect.construct(i,arguments,a)}else r=i.apply(this,arguments);return d()(this,r)}}var S=Object(v.a)("sdk.init"),_=function(){function e(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";p()(this,e),this.name=r,this.handler=null,this.wasm=null,this.socket=null,this.defered=new n.a,this.initSuccessPromise=this.defered.promise,this.wasmDefered=new n.a,this.wasmSuccessPromise=this.wasmDefered.promise,this.handlerDefered=new n.a,this.handlerSuccessPromise=this.handlerDefered.promise,this.socketDefered=new n.a,this.socketSuccessPromise=this.socketDefered.promise,Promise.all([this.wasmSuccessPromise,this.handlerSuccessPromise,this.socketSuccessPromise]).then((function(e){var r=e.every((function(e){return!0===e}));t.defered.resolve(r),r||S.error(t.name,{handler:t.handler,wasm:t.wasm,socket:t.socket})}))}return m()(e,[{key:"setHanderSuccess",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.handler=e,this.handlerDefered.resolve(e)}},{key:"setWasmSuccess",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.wasm=e,this.wasmDefered.resolve(e)}},{key:"setSocketSuccess",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.socket=e,this.socketDefered.resolve(e)}},{key:"checkInitSuccess",value:function(){var e=this.handler&&this.wasm&&this.socket;return e&&this.defered.resolve(!0),e}},{key:"isSocketInitSuccess",value:function(){return this.socket}},{key:"waitforInitSuccess",value:function(){return this.initSuccessPromise}}]),e}(),C=function(e){s()(r,e);var t=g(r);function r(e){return p()(this,r),t.call(this,e)}return m()(r)}(_),y=function(e){s()(r,e);var t=g(r);function r(e){return p()(this,r),t.call(this,e)}return m()(r)}(_),b=function(e){s()(r,e);var t=g(r);function r(e){return p()(this,r),t.call(this,e)}return m()(r)}(_),A=r(3),k=Object(v.a)("sdk.variables");function E(){}E.prototype.initDB=function(){var e,t={},r=this;t.init=function(i){if(this.db_name=i.db_name,this.db_version=i.db_version,this.db_store_name=i.db_store_name,indexedDB){try{e=indexedDB.open(this.db_name,this.db_version)}catch(e){return a.a.error("Error opening IndexedDB",e),void(r.indexDbObject=null)}e.onerror=function(e){r.indexDbObject=null},e.onupgradeneeded=function(e){this.db=e.target.result,this.db.createObjectStore(t.db_store_name)},e.onsuccess=function(e){t.db=e.target.result,r.openIndexFlag=!0,r.indexDbObject.select("delay")}}else r.indexDbObject=null},t.put=function(e,r){try{var i=t.db.transaction(t.db_store_name,"readwrite").objectStore(t.db_store_name).put(e,r);i.onsuccess=function(){},i.onerror=function(e){a.a.error("Set Delay failed!",e)}}catch(e){a.a.error("IndexDb put Failed!",e)}},t.delete=function(r){(e=t.db.transaction(t.db_store_name,"readwrite").objectStore(t.db_store_name).delete(r)).onsuccess=function(){k("Delete the key:"+r)}},t.select=function(e){try{var i=t.db.transaction(t.db_store_name,"readwrite").objectStore(t.db_store_name);if(e)var n=i.get(e);else n=i.getAll();n.onsuccess=function(){r.audioDelay=n.result},n.onerror=function(){r.audioDelay=0}}catch(e){a.a.error("IndexDb Select Failed",e)}},t.clear=function(){t.db.transaction(t.db_store_name,"readwrite").objectStore(t.db_store_name).clear().onsuccess=function(){k("Clear the IndexDb Successfully")}},t.close=function(){t.db&&t.db.close()},this.indexDbObject=t,this.indexDbObject.init({db_name:"AEC",db_version:1,db_store_name:"delay"})},E.prototype.Notify_APPUI_SAFE=function(){this._Notify_APPUI&&(k("Notify_APPUI_SAFE",arguments),this._Notify_APPUI.apply(this,arguments))},E.prototype.Notify_APPUI=function(){this._Notify_APPUI&&(k("Notify_APPUI",arguments),this._Notify_APPUI.apply(this,arguments))},E.prototype.queueMessageToRwg=function(e,t){this.rwgMessageList.push({jsEvent:e,message:t})},E.prototype.clearMessageToRwg=function(){var e=this;this.rwgConnectSuccess=!0,this.rwgMessageList.length>0&&(this.rwgAgent||this._Notify_APPUI)&&(this.rwgMessageList.forEach((function(t){var r=t.jsEvent,i=t.message;e.sendMessageToRwg(r,i,!1,!1)})),this.rwgMessageList=[])},E.prototype.destroyQueueMessageToRwg=function(){this.rwgConnectSuccess=!1,this.rwgMessageList=[]},E.prototype.sendMessageToRwg=function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(this.rwgConnectSuccess&&(this.rwgAgent||this._Notify_APPUI)||!r){this.rwgConnectSuccess&&i&&this.clearMessageToRwg();try{this.rwgAgent?this.rwgAgent.sendMessageToRwg(t):this.Notify_APPUI_SAFE(e,t)}catch(e){a.a.error("Error sending message to RWG",e)}}else this.queueMessageToRwg(e,t)},E.prototype.reinit=function(){this.SPECIAL_ID=0,this._Notify_APPUI=null,this.localAudioDecMGR=null,this.localVideoDecMGR=null,this.localAudioEncMGR=null,this.localVideoEncMGR=null,this.localSharingDecMGR=null,this.localMouseDecMGR=null,this.localSharingEncMGR=null,this.localAudioPara=null,this.localVideoPara=null,this.localSharingPara=null,this.Audio_WebSocket_Ip_Address=null,this.Audio_Web_Transport_Ip_Address=null,this.Video_WebSocket_Ip_Address=null,this.Video_Web_Transport_Ip_Address=null,this.Sharing_WebSocket_Ip_Address=null,this.mediaSDKHandle=null,this.audio_pcm_queue=new i.a,this.int16Array=null,this.isInitialFailed=!1,this.isAudioEncodeWASMOK=!1,this.isAudioDecodeWASMOK=!1,this.isVideoEncodeWASMOK=!1,this.isVideoDecodeWASMOK=!1,this.isSharingDecodeWASMOK=!1,this.isSharingEncodeWASMOK=!1,this.audioEncWorkerPath="",this.audioDecWorkerPath="",this.videoDecWorkerPath="",this.videoEncWorkerPath="",this.sharingDecWorkerPath="",this.sharingEncWorkerPath="",this.isAudioEncodePostStart=!1,this.isAudioDecodePostStart=!1,this.isVideoDecodePostStart=!1,this.isVideoEncodePostStart=!1,this.isSharingDecodePostStart=!1,this.isSharingEncodePostStart=!1,this.isAudioEncodeThreadStart=!1,this.isAudioDecodeThreadStart=!1,this.isVideoDecodeThreadStart=!1,this.isSharingDecodeThreadStart=!1,this.isVideoEncodeThreadStart=!1,this.isSharingEncodeThreadStart=!1,this.isAudioPlayWork=!1,this.isVideoPlayWork=!1,this.isSharingPlayWork=!1,this.shareBufferSampleNumb=30,this.audioWasmInfo=null,this.audioWasm=null,this.initialSuccessNumb=0,this.TotalWaitEvent=0,this.audioPostInterval=null,this.sharedBuffer=null,this.decoderinworklet=null,this.decoderinworkletOP=null,this.chromeWideAEC=null,this.shareSystemAudio=!1,this.indexDbObject=null,this.audioDelay=0,this.openIndexFlag=!1,this.audioBufferSize=n.g.browser.isFirefox?30:15,this.monitorEncodeVideo=null,this.monitorDecodeVideo=null,this.monitorEncodeSharing=null,this.monitorDecodeSharing=null,this.monitorEncodeAudio=null,this.monitorDecodeAudio=null,this.monitorVideoCapture=null,this.monitorVideoReadyCaptureWidth=0,this.monitorVideoReadyCaptureHeight=0,this.monitorIntervalHandle=null,this.monitorVideoUserID=null,this.monitorSharingUserID=null,this.monitorSharingEncodeAPPInfo=null,this.monitorVideoDecodeAPPInfo=null,this.monitorVideoEncodeAPPInfo=null,this.monitorCid=null,this.e2eencrypt=!1,this.AudioNode=null,this.SharingAudioNode=null,this.CurrentSSRC=0,this.CurrentSSRCTime=0,this.audioPlayTime=0,this.videoDecResponseText=null,this.videoEncResponseText=null,this.sharingDecodeResponse=null,this.sharingEncodeResponse=null,this.sharingDecInitInstance=new C(A.f.SHARING_DECODE),this.sharingEncInitInstance=new C(A.f.SHARING_ENCODE),this.videoDecInitInstance=new y(A.f.VIDEO_DECODE),this.videoInitInstance=new y(A.f.VIDEO_ENCODE),this.audioDecInitInstance=new b(A.f.AUDIO_DECODE),this.audioEncodeInitInstance=new b(A.f.AUDIO_ENCODE),this.audioDecodeResponse=null,this.audioEncodeResponse=null,this.ivObj={},this.userNodeList=[],this.rwgAgent=null,this.ComputerAudioStatus=A.a.ComputerAudio_Null,this.DesktopAudioStatus=A.a.DesktopAudio_Null,this.initDB(),this.resourceManager=null,this.vbarraybuffer=null,this.vbbin=null,this.vbjson=null,this.tfjsurl=null,this.afnbin=null,this.afnjson=null,this.basebin=null,this.basejson=null,this.interpretationMessage=new i.a,this.workletWasmInitSuccess=!1,this.videoEncodeInitSuccess=null,this.vbPreloadSuccess=null,this.enableAduioBridge=!1,this.audioMode=-1,this.isPreviewMode={audioEncode:!1,audioDecode:!1,videoEncode:!1,videoDecode:!1},this.rwgConnectSuccess=!1,this.rwgMessageList=[],this.localSsrc=0};var w=new E;t.a=w},function(e,t,r){"use strict";r.d(t,"b",(function(){return i})),r.d(t,"rd",(function(){return a})),r.d(t,"bd",(function(){return n})),r.d(t,"od",(function(){return o})),r.d(t,"a",(function(){return s})),r.d(t,"qd",(function(){return u})),r.d(t,"Jd",(function(){return d})),r.d(t,"kc",(function(){return c})),r.d(t,"X",(function(){return h})),r.d(t,"bb",(function(){return l})),r.d(t,"U",(function(){return p})),r.d(t,"ab",(function(){return f})),r.d(t,"V",(function(){return m})),r.d(t,"ac",(function(){return v})),r.d(t,"cc",(function(){return g})),r.d(t,"Db",(function(){return S})),r.d(t,"T",(function(){return _})),r.d(t,"Ue",(function(){return C})),r.d(t,"Wb",(function(){return y})),r.d(t,"Sb",(function(){return b})),r.d(t,"gd",(function(){return A})),r.d(t,"sd",(function(){return k})),r.d(t,"xd",(function(){return E})),r.d(t,"dd",(function(){return w})),r.d(t,"Rd",(function(){return I})),r.d(t,"Q",(function(){return D})),r.d(t,"cd",(function(){return M})),r.d(t,"hd",(function(){return R})),r.d(t,"pd",(function(){return x})),r.d(t,"td",(function(){return P})),r.d(t,"qc",(function(){return T})),r.d(t,"Bc",(function(){return O})),r.d(t,"cb",(function(){return V})),r.d(t,"W",(function(){return N})),r.d(t,"eb",(function(){return L})),r.d(t,"Ac",(function(){return W})),r.d(t,"Zd",(function(){return U})),r.d(t,"Sd",(function(){return F})),r.d(t,"rc",(function(){return B})),r.d(t,"Nd",(function(){return G})),r.d(t,"if",(function(){return H})),r.d(t,"Z",(function(){return j})),r.d(t,"Kc",(function(){return K})),r.d(t,"Yd",(function(){return q})),r.d(t,"Od",(function(){return Q})),r.d(t,"ic",(function(){return z})),r.d(t,"id",(function(){return X})),r.d(t,"Gc",(function(){return J})),r.d(t,"i",(function(){return Y})),r.d(t,"B",(function(){return Z})),r.d(t,"q",(function(){return $})),r.d(t,"p",(function(){return ee})),r.d(t,"o",(function(){return te})),r.d(t,"pe",(function(){return re})),r.d(t,"Md",(function(){return ie})),r.d(t,"Pd",(function(){return ae})),r.d(t,"Fb",(function(){return ne})),r.d(t,"kd",(function(){return oe})),r.d(t,"me",(function(){return se})),r.d(t,"ne",(function(){return ue})),r.d(t,"Ub",(function(){return de})),r.d(t,"Yb",(function(){return ce})),r.d(t,"Ic",(function(){return he})),r.d(t,"dc",(function(){return le})),r.d(t,"Te",(function(){return pe})),r.d(t,"ae",(function(){return fe})),r.d(t,"Qd",(function(){return me})),r.d(t,"Lc",(function(){return ve})),r.d(t,"Yc",(function(){return ge})),r.d(t,"O",(function(){return Se})),r.d(t,"N",(function(){return _e})),r.d(t,"Bb",(function(){return Ce})),r.d(t,"zb",(function(){return ye})),r.d(t,"zd",(function(){return be})),r.d(t,"md",(function(){return Ae})),r.d(t,"Td",(function(){return ke})),r.d(t,"wd",(function(){return Ee})),r.d(t,"ld",(function(){return we})),r.d(t,"de",(function(){return Ie})),r.d(t,"ce",(function(){return De})),r.d(t,"ee",(function(){return Me})),r.d(t,"Cb",(function(){return Re})),r.d(t,"yd",(function(){return xe})),r.d(t,"Y",(function(){return Pe})),r.d(t,"nc",(function(){return Te})),r.d(t,"mc",(function(){return Oe})),r.d(t,"P",(function(){return Ve})),r.d(t,"oc",(function(){return Ne})),r.d(t,"h",(function(){return Le})),r.d(t,"g",(function(){return We})),r.d(t,"Ib",(function(){return Ue})),r.d(t,"uc",(function(){return Fe})),r.d(t,"tc",(function(){return Be})),r.d(t,"Ve",(function(){return Ge})),r.d(t,"m",(function(){return He})),r.d(t,"Hc",(function(){return je})),r.d(t,"nd",(function(){return Ke})),r.d(t,"ec",(function(){return qe})),r.d(t,"Ec",(function(){return Qe})),r.d(t,"F",(function(){return ze})),r.d(t,"D",(function(){return Xe})),r.d(t,"H",(function(){return Je})),r.d(t,"K",(function(){return Ye})),r.d(t,"Be",(function(){return Ze})),r.d(t,"ze",(function(){return $e})),r.d(t,"De",(function(){return et})),r.d(t,"He",(function(){return tt})),r.d(t,"Fe",(function(){return rt})),r.d(t,"Cd",(function(){return it})),r.d(t,"l",(function(){return at})),r.d(t,"Ed",(function(){return nt})),r.d(t,"Gd",(function(){return ot})),r.d(t,"Ad",(function(){return st})),r.d(t,"tb",(function(){return ut})),r.d(t,"Je",(function(){return dt})),r.d(t,"xe",(function(){return ct})),r.d(t,"gc",(function(){return ht})),r.d(t,"Qc",(function(){return lt})),r.d(t,"Ze",(function(){return pt})),r.d(t,"Xe",(function(){return ft})),r.d(t,"Ye",(function(){return mt})),r.d(t,"L",(function(){return vt})),r.d(t,"Ke",(function(){return gt})),r.d(t,"yb",(function(){return St})),r.d(t,"e",(function(){return _t})),r.d(t,"Qe",(function(){return Ct})),r.d(t,"Nc",(function(){return yt})),r.d(t,"hc",(function(){return bt})),r.d(t,"Pc",(function(){return At})),r.d(t,"oe",(function(){return kt})),r.d(t,"le",(function(){return Et})),r.d(t,"ie",(function(){return wt})),r.d(t,"n",(function(){return It})),r.d(t,"Id",(function(){return Dt})),r.d(t,"Le",(function(){return Mt})),r.d(t,"r",(function(){return Rt})),r.d(t,"s",(function(){return xt})),r.d(t,"se",(function(){return Pt})),r.d(t,"re",(function(){return Tt})),r.d(t,"Hd",(function(){return Ot})),r.d(t,"Zc",(function(){return Vt})),r.d(t,"Vc",(function(){return Nt})),r.d(t,"c",(function(){return Lt})),r.d(t,"qb",(function(){return Wt})),r.d(t,"Jb",(function(){return Ut})),r.d(t,"df",(function(){return Ft})),r.d(t,"E",(function(){return Bt})),r.d(t,"C",(function(){return Gt})),r.d(t,"G",(function(){return Ht})),r.d(t,"J",(function(){return jt})),r.d(t,"I",(function(){return Kt})),r.d(t,"Ae",(function(){return qt})),r.d(t,"ye",(function(){return Qt})),r.d(t,"Ce",(function(){return zt})),r.d(t,"Ge",(function(){return Xt})),r.d(t,"Ee",(function(){return Jt})),r.d(t,"Bd",(function(){return Yt})),r.d(t,"M",(function(){return Zt})),r.d(t,"Fd",(function(){return $t})),r.d(t,"Dd",(function(){return er})),r.d(t,"Ie",(function(){return tr})),r.d(t,"jc",(function(){return rr})),r.d(t,"Re",(function(){return ir})),r.d(t,"Rb",(function(){return ar})),r.d(t,"Pb",(function(){return nr})),r.d(t,"Qb",(function(){return or})),r.d(t,"Xd",(function(){return sr})),r.d(t,"rb",(function(){return ur})),r.d(t,"Wc",(function(){return dr})),r.d(t,"ke",(function(){return cr})),r.d(t,"ib",(function(){return hr})),r.d(t,"jd",(function(){return lr})),r.d(t,"vd",(function(){return pr})),r.d(t,"fd",(function(){return fr})),r.d(t,"S",(function(){return mr})),r.d(t,"xc",(function(){return vr})),r.d(t,"fc",(function(){return gr})),r.d(t,"mb",(function(){return Sr})),r.d(t,"ub",(function(){return _r})),r.d(t,"db",(function(){return Cr})),r.d(t,"Oc",(function(){return yr})),r.d(t,"zc",(function(){return br})),r.d(t,"Fc",(function(){return Ar})),r.d(t,"d",(function(){return kr})),r.d(t,"Rc",(function(){return Er})),r.d(t,"Gb",(function(){return wr})),r.d(t,"Tb",(function(){return Ir})),r.d(t,"Vb",(function(){return Dr})),r.d(t,"Xb",(function(){return Mr})),r.d(t,"Zb",(function(){return Rr})),r.d(t,"Kb",(function(){return xr})),r.d(t,"Lb",(function(){return Pr})),r.d(t,"Me",(function(){return Tr})),r.d(t,"y",(function(){return Or})),r.d(t,"ue",(function(){return Vr})),r.d(t,"Ob",(function(){return Nr})),r.d(t,"Mb",(function(){return Lr})),r.d(t,"Nb",(function(){return Wr})),r.d(t,"Vd",(function(){return Ur})),r.d(t,"z",(function(){return Fr})),r.d(t,"we",(function(){return Br})),r.d(t,"A",(function(){return Gr})),r.d(t,"Wd",(function(){return Hr})),r.d(t,"Ud",(function(){return jr})),r.d(t,"ud",(function(){return Kr})),r.d(t,"ed",(function(){return qr})),r.d(t,"R",(function(){return Qr})),r.d(t,"yc",(function(){return zr})),r.d(t,"be",(function(){return Xr})),r.d(t,"vb",(function(){return Jr})),r.d(t,"v",(function(){return Yr})),r.d(t,"wb",(function(){return Zr})),r.d(t,"j",(function(){return $r})),r.d(t,"f",(function(){return ei})),r.d(t,"Pe",(function(){return ti})),r.d(t,"Sc",(function(){return ri})),r.d(t,"Oe",(function(){return ii})),r.d(t,"Ne",(function(){return ai})),r.d(t,"Se",(function(){return ni})),r.d(t,"bc",(function(){return oi})),r.d(t,"ve",(function(){return si})),r.d(t,"pc",(function(){return ui})),r.d(t,"wc",(function(){return di})),r.d(t,"x",(function(){return ci})),r.d(t,"w",(function(){return hi})),r.d(t,"u",(function(){return li})),r.d(t,"Xc",(function(){return pi})),r.d(t,"je",(function(){return fi})),r.d(t,"k",(function(){return mi})),r.d(t,"gf",(function(){return vi})),r.d(t,"hf",(function(){return gi})),r.d(t,"ef",(function(){return Si})),r.d(t,"ff",(function(){return _i})),r.d(t,"Eb",(function(){return Ci})),r.d(t,"af",(function(){return yi})),r.d(t,"bf",(function(){return bi})),r.d(t,"cf",(function(){return Ai})),r.d(t,"vc",(function(){return ki})),r.d(t,"jb",(function(){return Ei})),r.d(t,"nb",(function(){return wi})),r.d(t,"Tc",(function(){return Ii})),r.d(t,"Uc",(function(){return Di})),r.d(t,"ge",(function(){return Mi})),r.d(t,"he",(function(){return Ri})),r.d(t,"Mc",(function(){return xi})),r.d(t,"Kd",(function(){return Pi})),r.d(t,"Ld",(function(){return Ti})),r.d(t,"Hb",(function(){return Oi})),r.d(t,"hb",(function(){return Vi})),r.d(t,"gb",(function(){return Ni})),r.d(t,"pb",(function(){return Li})),r.d(t,"fb",(function(){return Wi})),r.d(t,"ob",(function(){return Ui})),r.d(t,"te",(function(){return Fi})),r.d(t,"Jc",(function(){return Bi})),r.d(t,"sb",(function(){return Gi})),r.d(t,"Cc",(function(){return Hi})),r.d(t,"Dc",(function(){return ji})),r.d(t,"We",(function(){return Ki})),r.d(t,"ad",(function(){return qi})),r.d(t,"t",(function(){return Qi})),r.d(t,"qe",(function(){return zi})),r.d(t,"fe",(function(){return Xi})),r.d(t,"lc",(function(){return Ji})),r.d(t,"jf",(function(){return Yi})),r.d(t,"lb",(function(){return Zi})),r.d(t,"kb",(function(){return $i})),r.d(t,"Ab",(function(){return ea})),r.d(t,"sc",(function(){return ta})),r.d(t,"xb",(function(){return ra}));var i=1,a=2,n=3,o=4,s=5,u=6,d=7,c=8,h=9,l=10,p=11,f=12,m=13,v=15,g=16,S=17,_=18,C=19,y=21,b=22,A=23,k=24,E=25,w=26,I=27,D=28,M=30,R=30.1,x=31,P=31.1,T=32,O=33,V=34,N=36,L=40,W=41,U=43,F=44,B=45,G=46,H=48,j=49,K=50,q=51,Q=52,z=53,X=54,J=55,Y=57,Z=58,$=59,ee=60,te=61,re=62,ie=63,ae=64,ne=65,oe=66,se=70,ue=71,de=72,ce=73,he=74,le=75,pe=77,fe=80,me=81,ve=82,ge=83,Se=84,_e=85,Ce=86,ye=87,be=90,Ae=91,ke=92,Ee=93,we=94,Ie=96,De=97,Me=98,Re=99,xe=101,Pe=100,Te=110,Oe=111,Ve=112,Ne=113,Le=114,We=115,Ue=116,Fe=117,Be=118,Ge=120,He=121,je=122,Ke=123,qe=124,Qe=125,ze=1,Xe=2,Je=3,Ye=4,Ze=7,$e=8,et=9,tt=10,rt=11,it=12,at=14,nt=15,ot=16,st=17,ut=18,dt=19,ct=20,ht=21,lt=3021,pt=22,ft=23,mt=24,vt=26,gt=27,St=30,_t=31,Ct=35,yt=36,bt=37,At=38,kt=39,Et=40,wt=41,It=42,Dt=46,Mt=47,Rt=48,xt=49,Pt=50,Tt=51,Ot=52,Vt=53,Nt=54,Lt=56,Wt=57,Ut=58,Ft=60,Bt=-1,Gt=-2,Ht=-3,jt=-4,Kt=-5,qt=-7,Qt=-8,zt=-9,Xt=-10,Jt=-11,Yt=-12,Zt=-13,$t=-14,er=-15,tr=-16,rr=-26,ir=-27,ar=1.1,nr=1.2,or=1.3,sr=2,ur=3,dr=6,cr=7,hr=8,lr=9,pr=10,fr=11,mr=12,vr=13,gr=14,Sr=15,_r=16,Cr=17,yr=18,br=19,Ar=20,kr=21,Er=23,wr=24,Ir=24,Dr=25,Mr=26,Rr=27,xr=28,Pr=29,Tr=30,Or=31,Vr=32,Nr=-1.1,Lr=-1.2,Wr=-1.3,Ur=-2,Fr=-3,Br=-4,Gr=-6,Hr=-8,jr=-9,Kr=-10,qr=-11,Qr=-12,zr=-14,Xr=-15,Jr=-20,Yr=-21,Zr=-22,$r=-23,ei=-24,ti=-28,ri=-27,ii=-29,ai=-31,ni=-32,oi=-33,si=-34,ui=-35,di=-36,ci=0,hi=1,li=2,pi="SHARING_PARAM_INFO_FROM_SOCKET",fi="VIDEO_DATA_FROM_WORKER",mi="AUDIO_DATA_FROM_WORKER",vi=24321,gi=24322,Si=24322,_i=24323,Ci=24322,yi=4300,bi=4299,Ai=7939,ki={ZOOM_CONNECTION_VIDEO_OFFER_RESPONSE_EVT:"ZOOM_CONNECTION_VIDEO_OFFER_RESPONSE_EVT",ZOOM_CONNECTION_AUDIO_OFFER_RESPONSE_EVT:"ZOOM_CONNECTION_AUDIO_OFFER_RESPONSE_EVT",END_MEDIA:"END_MEDIA",DESTROY:"DESTROY",DC_COMING_MESSAGE:"DC_COMING_MESSAGE",AUDIO_BRIDGE_WS_TOKEN:"AUDIO_BRIDGE_WS_TOKEN"},Ei=67,wi=68,Ii=69,Di=70,Mi=71,Ri=72,xi=73,Pi=75,Ti=76,Oi=78,Vi=105,Ni=106,Li=107,Wi=108,Ui=109,Fi=110,Bi=1,Gi=0,Hi=108,ji=104,Ki=120,qi=121,Qi="AUDIO_QOS_DATA",zi="VIDEO_QOS_DATA",Xi="VIDEOSHARE_QOS_DATA",Ji="NETWORK_QUALITY_CHANGE",Yi={VIDEO_ENCODE:"0",VIDEO_DECODE:"1",AUDIO_ENCODE:"2",AUDIO_DECODE:"3",SHARING_ENCODE:"4",SHARING_DECODE:"5"},Zi=66.5,$i=66.6,ea="ENABLE_REUSE_STREAM",ta="PRESET_MEDIA_CONSTRAINTS",ra="DESTORY_REUSE_STREAM"},function(e,t,r){"use strict";var i,a,n=r(13),o=r.n(n),s=r(5),u=r.n(s),d=r(7),c=r.n(d),h=r(8),l=r.n(h),p=r(4),f=r.n(p),m=function(){};m.prototype={threads:(a=u()(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",function(){var e=u()(f.a.mark((function e(t){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(WebAssembly.validate(t)){e.next=2;break}return e.abrupt("return",!1);case 2:return e.prev=2,e.abrupt("return",((new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),!0));case 6:return e.prev=6,e.t0=e.catch(2),e.abrupt("return",!1);case 9:case"end":return e.stop()}}),e,null,[[2,6]])})));return function(t){return e.apply(this,arguments)}}()(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11])));case 1:case"end":return e.stop()}}),e)}))),function(){return a.apply(this,arguments)}),simd:(i=u()(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11])));case 1:case"end":return e.stop()}}),e)}))),function(){return i.apply(this,arguments)})};var v=new m,g=r(18),S=r(6),_=r(0);r.d(t,"e",(function(){return D})),r.d(t,"d",(function(){return N})),r.d(t,"b",(function(){return F})),r.d(t,"a",(function(){return ae})),r.d(t,"c",(function(){return ne})),r.d(t,"f",(function(){return oe}));var C,y,b,A,k={},E=(y={},b=navigator.userAgent.toLowerCase(),(C=b.match(/rv:([\d.]+)\) like gecko/))||(C=b.match(/msie ([\d\.]+)/))?y.ie=C[1]:(C=b.match(/edge\/([\d\.]+)/))?y.edge=C[1]:(C=b.match(/firefox\/([\d\.]+)/))?y.firefox=C[1]:(C=b.match(/(?:opera|opr).([\d\.]+)/))?y.opera=C[1]:(C=b.match(/chrome\/([\d\.]+)/))?y.chrome=C[1]:(C=b.match(/version\/([\d\.]+).*safari/))&&(y.safari=C[1]),A=y,function(){return A}),w=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:90,t=E();if(t.chrome){var r=parseInt(t.chrome);if(r>=e)return!0}return!1},I=function(e){var t=E();if(t.firefox&&parseInt(t.firefox)>=e)return!0;return!1};var D=new(function(){function e(){c()(this,e),this._isSupportMultiThread=!1,this._isSupportSIMD=!1,this.inProgressPromise={checkSupportMultiThread:null,checkSupportSIMD:null},this._isSupportWebtransport=!1,this._isSupportVirtualBackground=!1}var t,r;return l()(e,[{key:"checkIsSupportMultiThread",value:(r=u()(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.getIsSupportMultiThread()){e.next=2;break}return e.abrupt("return");case 2:if(e.prev=2,!this.inProgressPromise.checkSupportMultiThread){e.next=8;break}return e.next=6,this.inProgressPromise.checkSupportMultiThread;case 6:e.next=14;break;case 8:return this.inProgressPromise.checkSupportMultiThread=v.threads(),e.t0=this,e.next=12,this.inProgressPromise.checkSupportMultiThread;case 12:e.t1=e.sent,e.t0._setIsSupportMultiThread.call(e.t0,e.t1);case 14:e.next=19;break;case 16:e.prev=16,e.t2=e.catch(2),this._setIsSupportMultiThread(!1);case 19:case"end":return e.stop()}}),e,this,[[2,16]])}))),function(){return r.apply(this,arguments)})},{key:"_setIsSupportMultiThread",value:function(e){this._isSupportMultiThread=e}},{key:"getIsSupportMultiThread",value:function(){return this._isSupportMultiThread}},{key:"checkIsSupportSIMD",value:(t=u()(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.getIsSupportSIMD()){e.next=2;break}return e.abrupt("return");case 2:if(e.prev=2,!this.inProgressPromise.checkSupportSIMD){e.next=8;break}return e.next=6,this.inProgressPromise.checkSupportSIMD;case 6:e.next=14;break;case 8:return this.inProgressPromise.checkSupportSIMD=v.simd(),e.t0=this,e.next=12,this.inProgressPromise.checkSupportSIMD;case 12:e.t1=e.sent,e.t0._setIsSupportSIMD.call(e.t0,e.t1);case 14:e.next=19;break;case 16:e.prev=16,e.t2=e.catch(2),this._setIsSupportSIMD(!1);case 19:case"end":return e.stop()}}),e,this,[[2,16]])}))),function(){return t.apply(this,arguments)})},{key:"_setIsSupportSIMD",value:function(e){this._isSupportSIMD=e}},{key:"getIsSupportSIMD",value:function(){return this._isSupportSIMD}},{key:"getIsSupportWebtransport",value:function(){return w(97)&&"function"==typeof WebTransport&&this._isSupportWebtransport}},{key:"setIsSupportWebtransport",value:function(e){this._isSupportWebtransport=!!e}},{key:"getIsSupportVirtualBackground",value:function(){var e=w(91)||I(89);return navigator.hardwareConcurrency&&navigator.hardwareConcurrency>2&&e&&"function"==typeof OffscreenCanvas&&this._isSupportVirtualBackground}},{key:"setIsSupportVirtualBackground",value:function(e){this._isSupportVirtualBackground=!!e}},{key:"getIsRenderSelfVideoInEncodeWorker",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e&&!this.getIsSupportMultiThread()&&this.getIsSupportVirtualBackground()}}]),e}()),M={capacity:void 0,get capacityfor720(){return void 0!==this.capacity&&this.capacity},set capacityfor720(e){this.capacity=e}},R={capacitydeco:void 0,get capacitydecofor1080(){return void 0!==this.capacitydeco&&this.capacitydeco},set capacitydecofor1080(e){this.capacitydeco=e}};function x(e,t,r){var i=e.match(t);return i&&i.length>=r&&parseInt(i[r],10)}function P(){var e=window.navigator,t={browser:null,version:null};if("undefined"==typeof window||!window.navigator)return t.browser="Not a browser.",t;if(e.mozGetUserMedia)t.browser="firefox",t.version=x(e.userAgent,/Firefox\/(\d+)\./,1);else if(e.webkitGetUserMedia)t.browser="chrome",t.version=x(e.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(e.mediaDevices&&e.userAgent.match(/Edge\/(\d+).(\d+)$/))t.browser="edge",t.version=x(e.userAgent,/Edge\/(\d+).(\d+)$/,2);else{if(!window.RTCPeerConnection||!e.userAgent.match(/AppleWebKit\/(\d+)\./))return t.browser="Not a supported browser.",t;t.browser="safari",t.version=x(e.userAgent,/AppleWebKit\/(\d+)\./,1)}return t}var T=P();function O(){var e=navigator.userAgent.match(/CrKey\/([\d.]+)/);if(e){var t=e[1].match(/[0-9]{0,2}[.][0-9]{0,2}/);return t?t[0]:-1}return-1}var V="function"==typeof OffscreenCanvas&&!!new OffscreenCanvas(1,1).getContext("webgl");function N(){return V}function L(){return-1!==navigator.userAgent.indexOf("CrKey")}function W(){return function(){try{var e=navigator.userAgent||navigator.vendor||window.opera;return!!/android/i.test(e)}catch(e){return!1}}()&&!L()}function U(){return"function"==typeof VideoTrackReader&&"function"==typeof VideoFrame}function F(e){return e?e>>10<<10:-1}var B,G,H,j,K,q,Q,z,X,J,Y,Z,$,ee,te,re,ie;t.g={isGoogleNestChrome:function(){return L()},isHighVersionGoolgeNestChrome:function(){return-1!==navigator.userAgent.indexOf("CrKey")&&O()>=1.54},isSupport2DCanvasDrawFrame:function(){return("function"==typeof MediaStreamTrackProcessor||U())&&!L()&&"chrome"==T.browser&&T.version>=90&&-1==navigator.appVersion.indexOf("Mac")},checkLocalP2PConnection:function(){return new Promise(function(){var e=u()(f.a.mark((function e(t,r){var i,a,n,o,s,u,d,c;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=function(e){e&&e.close()},i=function(e){return new Promise((function(t,r){e.onconnectionstatechange=function(r){"connected"===e.connectionState&&t(!0)}}))},n=null,o=null,s=document.createElement("canvas"),e.prev=5,s.width=200,s.height=200,s.getContext("2d"),c=s.captureStream(),"function"==typeof RTCPeerConnection){e.next=13;break}return t(!1),e.abrupt("return");case 13:if(n=new RTCPeerConnection,o=new RTCPeerConnection,n.onicecandidate=function(e){e.candidate&&o.addIceCandidate(new RTCIceCandidate(e.candidate))},o.onicecandidate=function(e){e.candidate&&n.addIceCandidate(new RTCIceCandidate(e.candidate))},Promise.all([i(n),i(o)]).then((function(){t(!0),a(n),a(o)})),"function"==typeof n.addStream){e.next=21;break}return t(!1),e.abrupt("return");case 21:return e.next=23,n.addStream(c);case 23:return e.next=25,n.createOffer();case 25:return u=e.sent,e.next=28,n.setLocalDescription(u);case 28:return e.next=30,o.setRemoteDescription(u);case 30:return e.next=32,o.createAnswer();case 32:return d=e.sent,e.next=35,o.setLocalDescription(d);case 35:return e.next=37,n.setRemoteDescription(d);case 37:setTimeout((function(){t(!1),a(n),a(o)}),200),e.next=44;break;case 40:e.prev=40,e.t0=e.catch(5),S.a.error("Error when trying to check for local RTC peer connection",e.t0),t(!1);case 44:case"end":return e.stop()}}),e,null,[[5,40]])})));return function(t,r){return e.apply(this,arguments)}}())},getDocumentHandle:function(e){return document.getElementById(e)},browserType:T,browser:{isFirefox:"firefox"===T.browser,isChrome:"chrome"===T.browser,isSafari:"safari"===T.browser},isIphoneOrIpadSafari:function(){return this.isIphoneOrIpadBrowser()||this.isIpadOS()},isOpera65:function(){return function(){try{var e=navigator.userAgent.match(/OPR\/(\d+)\./);return!!(e&&Number(e[1])<66)}catch(e){return!1}}()},isAndroidBrowser:function(){return W()},isSupportVideoFrame:function(){return"undefined"!=typeof VideoFrame},isQuestBrowser:function(){return function(){try{return/oculusbrowser/i.test(navigator.userAgent)}catch(e){return!1}}()},isSelfPreviewRenderWithVideo:function(){return!(!this.isIphoneOrIpadSafari()||!this.isSupportVideoFrame())||(!D.getIsSupportMultiThread()&&!D.getIsSupportVirtualBackground()&&this.isSupportVideoFrameOrBitmapCapture()||this.isAndroidBrowser()&&!_.a.rwgAgent)},isIphoneOrIpadBrowser:function(){try{return!!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)}catch(e){return!1}},isIpadOS:function(){return navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&(/iPad/.test(navigator.platform)||/MacIntel/.test(navigator.platform))},isChromeOS:function(){return function(){try{return!!/\bCrOS\b/.test(navigator.userAgent)}catch(e){return!1}}()},isWindowsChrome:function(){var e=navigator.userAgent;return/windows/i.test(e)},isTeslaMode:function(){return/TESLA/.test(navigator.userAgent)},isMac:function(){return navigator.platform.indexOf("Mac")>-1},isWindows:function(){return navigator.platform.indexOf("Win")>-1},isLinux:function(){return navigator.platform.indexOf("Linux")>-1&&!this.isChromeOS()},isSupportChromeWideAEC:function(){var e=_.a.chromeWideAEC&&this.isChromeOS()&&w(116);return(this.isMac()||this.isWindows()||this.isLinux())&&w(111)||e},isSupportOpenMicWhenShareAudio:function(){return this.isSupportChromeWideAEC()&&!_.a.shareSystemAudio},getAudioFeatureFlags:function(){return _.a.enableAudioBridge?4:12},isSupportShareMultiStream:function(){return!0},isSupportVideoLTR:function(){return!0},isSupportAudioBridgeAvsync:function(){return!0},getAudioContextConfigure:function(){var e={};return function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:90,r={},i=navigator.userAgent.toLowerCase();if((e=i.match(/rv:([\d.]+)\) like gecko/))||(e=i.match(/msie ([\d\.]+)/))?r.ie=e[1]:(e=i.match(/edge?\/([\d\.]+)/))?r.edg=e[1]:(e=i.match(/firefox\/([\d\.]+)/))?r.firefox=e[1]:(e=i.match(/(?:opera|opr).([\d\.]+)/))?r.opera=e[1]:(e=i.match(/chrome\/([\d\.]+)/))?r.chrome=e[1]:(e=i.match(/version\/([\d\.]+).*safari/))&&(r.safari=e[1]),r.chrome||r.edg||r.opera){var a=parseInt(r.chrome||r.edg||r.opera);if(a>=t)return!0}return!1}(74)&&(e={sampleRate:48e3,latencyHint:.02}),e},download:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(k[e])return k[e];var r=new Promise((function(r,i){var a={};t&&(a.integrity=t),fetch(e,a).then((function(e){r(e.text())})).catch((function(e){i(e)}))}));return k[e]=r,r},downloadBinary:function(e){if(k[e])return k[e];var t=new Promise((function(t,r){var i=new XMLHttpRequest;i.responseType="arraybuffer",i.addEventListener("load",(function(){t(this.response)}),i),i.onerror=function(e){r(e)},i.open("get",e,!0),i.send()}));return k[e]=t,t},readBlob:function(e){return new Promise((function(t,r){var i=new FileReader;i.onload=function(){t(i.result)},i.readAsText(e)}))},readBlobAsBuffer:function(e){return new Promise((function(t,r){var i=new FileReader;i.onload=function(e){t(e.target.result)},i.readAsArrayBuffer(e)}))},lengthInUtf8Bytes:function(e){var t=encodeURIComponent(e).match(/%[89ABab]/g);return e.length+(t?t.length:0)},isLittleEndian:function(){var e=new ArrayBuffer(2),t=new Uint8Array(e),r=new Uint16Array(e);return t[0]=170,t[1]=187,48042===r[0]},sleep:function(e){return new Promise((function(t,r){setTimeout((function(){t(!0)}),e)}))},isSDKSupportMultiThread:(ie=u()(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,D.checkIsSupportMultiThread();case 2:return e.abrupt("return",D.getIsSupportMultiThread()&&navigator.userAgent&&(-1==navigator.userAgent.indexOf("CrKey")||O()>=1.54));case 3:case"end":return e.stop()}}),e)}))),function(){return ie.apply(this,arguments)}),is32bitChrome:(re=u()(f.a.mark((function e(){var t;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(-1==navigator.userAgent.indexOf("WOW64")){e.next=4;break}return e.abrupt("return",!0);case 4:if(!navigator.userAgentData||!navigator.userAgentData.getHighEntropyValues){e.next=11;break}return e.next=7,navigator.userAgentData.getHighEntropyValues(["wow64"]);case 7:return t=e.sent,e.abrupt("return",t.wow64);case 11:return e.abrupt("return",!1);case 12:case"end":return e.stop()}}),e)}))),function(){return re.apply(this,arguments)}),isAMDGraphic:function(){try{return this.graphicName().includes("amd")}catch(e){return!1}},graphicName:(te=null,function(){try{if(te)return te;var e=new OffscreenCanvas(1,1).getContext("webgl");if(!e)return"";var t=e.getExtension("WEBGL_debug_renderer_info"),r=e.getParameter(t.UNMASKED_RENDERER_WEBGL);return te=r.toLowerCase()}catch(e){return""}}),isGraphicShouldUseHardwareAccelerationDecode:function(){return!(!this.isAMDGraphic()||!this.isChromeOS())||!(this.isAMDGraphic()&&!this.isChromeOS())},VP9MachineDetect:function(){var e=navigator.mediaCapabilities.decodingInfo({type:"webrtc",video:{contentType:"video/vp9",bitrate:1e7,framerate:25,height:1920,width:1080}});return new Promise((function(t,r){e.then((function(e){e.supported||(S.a.log("video/vp9 codec isn't supported in software or hardware"),t(!1)),t(e.powerEfficient)})).catch((function(e){S.a.warn("Error when trying to determine support for VP9 codec",e),t(!1)}))}))},IsSupportVideoDecodeHardwareAcceleration:function(){return u()(f.a.mark((function e(){var t,r;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof VideoDecoder){e.next=19;break}return t=new Uint8Array([1,100,0,31,255,225,0,14,103,100,0,51,172,27,26,17,129,64,22,201,160,16,7,0,5,104,200,66,60,48,0,5,104,82,16,207,12,0,25,104,114,16,143,24,67,17,132,56,140,84,81,8,18,22,41,3,194,98,3,5,32,122,9,140,0,5,104,36,132,51,203,0,5,104,46,132,51,195,0,25,104,54,132,35,198,16,196,97,14,35,21,20,66,4,133,138,64,240,152,128,193,72,30,130,99,0,5,104,62,132,51,203]),r={codec:"avc1.640028",description:t,codedWidth:1280,codedHeight:720,hardwareAcceleration:"prefer-hardware"},e.prev=3,e.next=6,VideoDecoder.isConfigSupported(r);case 6:if(!e.sent.supported){e.next=11;break}return e.abrupt("return",!0);case 11:return e.abrupt("return",!1);case 12:e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(3),e.abrupt("return",!1);case 17:e.next=20;break;case 19:return e.abrupt("return",!1);case 20:case"end":return e.stop()}}),e,null,[[3,14]])})))()},IsSupportVideoEncodeHardwareAcceleration:function(){return u()(f.a.mark((function e(){var t;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof VideoEncoder){e.next=13;break}return t={codec:"avc1.640028",bitrate:15e5,width:1280,height:720,avc:{format:"annexb"},framerate:25,hardwareAcceleration:"no-preference",latencyMode:"realtime",bitrateMode:"constant",scalabilityMode:"L1T2"},e.next=5,VideoEncoder.isConfigSupported(t);case 5:if(!e.sent.supported){e.next=10;break}return e.abrupt("return",!0);case 10:return e.abrupt("return",!1);case 11:e.next=14;break;case 13:return e.abrupt("return",!1);case 14:case"end":return e.stop()}}),e)})))()},AdapterWhiteListCheckForEncoder:function(){if(!N())return-1;try{var e=new OffscreenCanvas(1,1).getContext("webgl"),t=e.getExtension("WEBGL_debug_renderer_info"),r=e.getParameter(t.UNMASKED_VENDOR_WEBGL),i=e.getParameter(t.UNMASKED_RENDERER_WEBGL).toLowerCase(),a=r.includes("ARM"),n=(i.includes("amd"),i.includes("intel"));i.includes("hd graphics"),i.includes("nvidia"),i.includes("geforce");return n?0:a?-1:0}catch(e){return 0}},isChromeVersionHigherThan:w,isFirefoxVersionHigherThan:I,isSDKSupportSIMD:function(){return u()(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("object"===("undefined"==typeof WebAssembly?"undefined":o()(WebAssembly))){e.next=2;break}return e.abrupt("return",!1);case 2:if("chrome"!=T.browser){e.next=11;break}if(!(T.version>=84)){e.next=8;break}return e.next=6,D.checkIsSupportSIMD();case 6:e.next=9;break;case 8:return e.abrupt("return",!1);case 9:e.next=13;break;case 11:return e.next=13,D.checkIsSupportSIMD();case 13:return e.abrupt("return",D.getIsSupportSIMD());case 14:case"end":return e.stop()}}),e)})))()},buffer2stringSplitByComma:function(e){return new Uint8Array(e).join(",")},stringSplitByComma2Buffer:function(e){try{for(var t=e.split(",").map((function(e){return parseInt(e)})),r=new ArrayBuffer(t.length),i=new Uint8Array(r),a=0;a<t.length;a++)i[a]=t[a];return r}catch(e){return null}},removeDuplicates:function(e,t){var r=[];return e.forEach((function(e){for(var i=!1,a=0;a<r.length;a++)if(!t.call(null,r[a],e)){i=!0;break}i||r.push(e)})),r},getBrowserVersion:function(){return function(){var e=navigator.userAgent.toLowerCase();if(e.indexOf("firefox")>0)return e.match(/firefox\/[\d.]+/gi);if(e.indexOf("safari")>0&&e.indexOf("chrome")<0){var t,r="safari/unknow";return r=e.match(/safari\/[\d.]+/gi),t=e.match(/safari\/[\d.]+/gi),r&&(r=[r.toString().replace("version","safari")]),t&&(r=[t.toString().replace("version","safari")]),r}return e.indexOf("chrome")>0?e.match(/chrome\/[\d.]+/gi):"other"}()[0].match(/(\d+)/)[0]},getIOSMajorVersion:function(){if(/iP(hone|od|ad)/.test(navigator.platform)){var e=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);return parseInt(e[1],10)}return null},getMacSafariMajorVersion:function(){if(this.browser.isSafari){var e=navigator.userAgent.match(/Version\/([\d\.]+)/);return e&&e[1]?parseFloat(e[1]):null}return null},isSupportImageCapture:function(){return"function"==typeof ImageCapture&&N()},isSupportOffscreenCanvas:function(){return N()},isSupport2dOffscreenCanvas:function(){return"function"==typeof OffscreenCanvas},isSupportVideoTrackReader:function(){return U()&&N()},isSupportMediaStreamTrackProcessor:function(){return"function"==typeof MediaStreamTrackProcessor&&N()},isSupportVideoFrameOrBitmapCapture:function(){return this.isSupportImageCapture()||this.isSupportVideoTrackReader()||this.isSupportMediaStreamTrackProcessor()},isSupportSharedArrayBuffer:function(){return"undefined"!=typeof SharedArrayBuffer},queryPTZPermisson:function(){return u()(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,navigator.permissions.query({name:"camera",panTiltZoom:!0});case 3:if("granted"!=e.sent.state){e.next=6;break}return e.abrupt("return",!0);case 6:return e.abrupt("return",!1);case 9:return e.prev=9,e.t0=e.catch(0),S.a.error("Error when querying pan-tilt-zoom permission",e.t0),e.abrupt("return",!1);case 13:case"end":return e.stop()}}),e,null,[[0,9]])})))()},isSupportCameraPan:function(){return!!navigator.mediaDevices.getSupportedConstraints().pan},isSupportCameraTilt:function(){return!!navigator.mediaDevices.getSupportedConstraints().tilt},isSupportCameraZoom:function(){return!!navigator.mediaDevices.getSupportedConstraints().zoom},isSupportPTZ:function(){var e=navigator.mediaDevices.getSupportedConstraints();return e.pan&&e.tilt&&e.zoom},get720pcapacity:function(){return M.capacityfor720},set720pcapacity:function(e){M.capacityfor720=e},getsub1080pcapacity:function(){return R.capacitydecofor1080},setsub1080pcapacity:function(e){R.capacitydecofor1080=e},checkAudioAutoPlay:function(){return new Promise((function(e,t){var r=new ArrayBuffer(684),i=new Uint32Array(r);i.set([1179011410,676,1163280727,544501094,16,65539,16e3,64e3,2097156,1635017060,640],0);var a=new Blob([i],{type:"audio/wav"}),n=window.URL.createObjectURL(a),o=new Audio(n);o.addEventListener("canplaythrough",(function(){o.play().then((function(){e(!0)})).catch((function(e){S.a.log("Unable to auto play audio",e),t(e)})).finally((function(){window.URL.revokeObjectURL(n)}))})),o.load&&o.load()}))},isSupportVideoShare:function(){return!0},isSupportVideoShareSend:function(){var e,t=P();return"chrome"==t.browser&&(e=this.getBrowserVersion()),!!this.isSupportSharedArrayBuffer()&&!("chrome"!==t.browser||e&&e<=100||navigator.hardwareConcurrency<=2||this.isTeslaMode()||this.isAndroidBrowser()||this.isIphoneOrIpadBrowser()||this.isGoogleNestChrome())},isSupportVideoShareReceive:function(){return!0},watermark:(Z=new g.a,$=document.createElement("canvas"),ee={enableWaterMark:!1,waterMarkText:"",watermarkOpacity:0,watermarkRepeated:!1,watermarkPosition:void 0},{getWaterMarkData:function(e){var t=e.width,r=e.height;if(!ee.enableWaterMark)return null;var i=t<512||r<288?16:ee.watermarkPosition,a=ee.watermarkRepeated&&t>306&&r>202,n=function(e,t){if(e<640&&e){var r=640/e;e=640,t=Math.round(t*r)}return{width:e,height:t}}(t,r);return t=n.width,r=n.height,a?Z.Get_Repeated_WaterMarkRGBA({canvas:$,name:ee.waterMarkText,width:n.width,height:n.height,opacity:ee.watermarkOpacity,position:i,convertToDataUrl:!0}):Z.Get_WaterMarkRGBA({canvas:$,name:ee.waterMarkText,width:n.width,height:n.height,opacity:ee.watermarkOpacity,position:i,convertToDataUrl:!0})},updateWaterMarkInfo:function(e){Object.assign(ee,e)}}),isSupportAudioDenoise:function(){if("chrome"==P().browser&&this.getBrowserVersion()<=100)return!1;var e=WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]));return!e||e instanceof Promise?(e instanceof Promise&&console.error("WebAssembly.validate is async"),!1):!!this.isSupportSharedArrayBuffer()&&!(navigator.hardwareConcurrency<=2||this.isTeslaMode()||this.isAndroidBrowser()||this.isIphoneOrIpadBrowser()||this.isGoogleNestChrome())},isSupportPlayStereo:function(){return!!(this.browser.isFirefox||this.browser.isSafari||this.isSupportChromeWideAEC())},isSupportMicSendStereo:function(){return!1},isSupportSharingStereo:function(){return!1},videoToMediaStreamManager:(H=document.createElement("canvas"),j=H.getContext("2d"),K=640,q=360,Q=navigator.hardwareConcurrency&&navigator.hardwareConcurrency<4?10:24,z=1e3/("chrome"===T.browser?Q:10),X=null,J=0,Y=null,{_draw:function(){if(B){this.drawCanvas(H,j,K,q);var e=performance.now();if(J){var t=e-J;t>z?this._setFasterTimer():t<.8*z&&this._clearFastTimer()}J=e}},_setFasterTimer:function(){var e=this;X||(X=setInterval((function(){B&&B.currentTime>0&&!B.paused&&!B.ended&&performance.now()-J>=z/2&&e.drawCanvas(H,j,K,q)}),z))},_clearFastTimer:function(){J=0,clearInterval(X),X=null},drawCanvas:function(e,t,r,i){e.width=r,e.height=i;var a=0,n=0;B.videoWidth/B.videoHeight>r/i?a=r/i*(n=B.videoHeight):n=i/r*(a=B.videoWidth),t.drawImage(B,(B.videoWidth-a)/2,(B.videoHeight-n)/2,a,n,0,0,r,i)},startCapture:function(e,t,r){return B=e,t&&r&&t/r==16/9&&(K=t,q=r),Y&&B.removeEventListener("timeupdate",Y),Y=this._draw.bind(this),e.addEventListener("timeupdate",Y),G=H.captureStream(Q)},stopCapture:function(){Y&&B.removeEventListener("timeupdate",Y),this._clearFastTimer(),G&&(G.getVideoTracks().forEach((function(e){return e.stop()})),G=null),B=null},isSupported:function(){return"function"==typeof HTMLCanvasElement.prototype.captureStream}}),audioToMediaStreamMananger:function(){var e=null,t=new(window.AudioContext||window.webkitAudioContext),r=null,i=null,a=null;return{startCapture:function(n){if(a&&n===a)e=a;else{this.destroy(),a=e=n,i=t.createMediaElementSource(e);var o=t.createMediaStreamDestination();i.connect(o),r=o.stream}return"suspended"===t.state&&t.resume(),r},stopCapture:function(){t&&t.suspend(),e=null},destroy:function(){i&&i.disconnect(),r&&(r.getAudioTracks().forEach((function(e){return e.stop()})),r=null),a=null,i=null},isAudioFileStream:function(e){return e===r},isSupported:function(){return"undefined"!=typeof AudioContext&&"function"==typeof AudioContext.prototype.createMediaStreamDestination&&"function"==typeof AudioContext.prototype.createMediaElementSource}}}()};function ae(){var e=this;this.promise=new Promise((function(t,r){e.reject=r,e.resolve=t}))}var ne=function(){function e(t,r){c()(this,e),this.scriptURL=t,this.lateLoadedAssetsHash=r}return l()(e,[{key:"getIntegrity",value:function(){var e=this.scriptURL.split("/").pop().split("?")[0].split("#")[0],t=this.lateLoadedAssetsHash[e];return t||null}}]),e}();function oe(e,t){if(e===t)return!0;if(i(e)&&i(t)){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var r in e)if(!oe(e[r],t[r]))return!1;return!0}function i(e){return"object"===o()(e)&&null!=e}}},function(e,t,r){"use strict";r.d(t,"h",(function(){return o})),r.d(t,"c",(function(){return s})),r.d(t,"b",(function(){return u})),r.d(t,"e",(function(){return d})),r.d(t,"i",(function(){return c})),r.d(t,"f",(function(){return h})),r.d(t,"d",(function(){return l})),r.d(t,"a",(function(){return p})),r.d(t,"g",(function(){return f}));var i,a=r(10),n=r.n(a),o={ZOOM_CONNECTION_COMMAND:0,ZOOM_CONNECTION_AUDIO:1,ZOOM_CONNECTION_VIDEO:2,ZOOM_CONNECTION_SHARING_JPEG:3,ZOOM_CONNECTION_SHARING_VIDEO:4,ZOOM_CONNECTION_MEDIA_LOG:5,ZOOM_CONNECTION_SHARING_REMOTE_CONTROL:6,ZOOM_CONNECTION_UNKNOW:7},s={encode:1,decode:2},u={AUDIO:1,SHARING:2,VIDEO:3},d={UNKNOWN:0,WIN:1,MAC:2,PAD:3,MOBILE:4,CALL_IN:5,LINUX:6,WEB:7,CHROME:8},c={0:"27D10C2BC0312F11BE79BF9AA0668220",1:"D5AC365D95ACF72EE1E8D0FED594C0CD",2:"AEF36FC5C22CE7AAF5DC05913633EDF7",3:"BD3DF97B715748F6B6A5F59271A2D1A0",4:"D0AEDC804599C31391A946904C74595F",5:"65DEAF0AA73F220ED401B90CFFCDFF23"},h={VIDEO_ENCODE:"0",VIDEO_DECODE:"1",AUDIO_ENCODE:"2",AUDIO_DECODE:"3",SHARING_ENCODE:"4",SHARING_DECODE:"5"},l={SET_USER_NODE_LIST:"SET_USER_NODE_LIST"},p={ComputerAudio_Null:0,ComputerAudio_Connecting:1,ComputerAudio_Connected:2,DesktopAudio_Null:0,DesktopAudio_Connecting:1,DesktopAudio_Connected:2},f=(i={},n()(i,h.AUDIO_ENCODE,"audio.encode"),n()(i,h.AUDIO_DECODE,"audio.decode"),n()(i,h.VIDEO_ENCODE,"video.encode"),n()(i,h.VIDEO_DECODE,"video.decode"),n()(i,h.SHARING_ENCODE,"share.encode"),n()(i,h.SHARING_DECODE,"share.decode"),i)},function(e,t,r){var i=r(46)();e.exports=i;try{regeneratorRuntime=i}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=i:Function("r","regeneratorRuntime = r")(i)}},function(e,t){function r(e,t,r,i,a,n,o){try{var s=e[n](o),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(i,a)}e.exports=function(e){return function(){var t=this,i=arguments;return new Promise((function(a,n){var o=e.apply(t,i);function s(e){r(o,a,n,s,u,"next",e)}function u(e){r(o,a,n,s,u,"throw",e)}s(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){"use strict";r.d(t,"b",(function(){return u}));var i=r(7),a=r.n(i),n=r(8),o=r.n(n),s=function(){function e(){a()(this,e),this._highFrequencyLogs={}}return o()(e,[{key:"setInstance",value:function(e){this._instance=e}},{key:"getMessageFromErrorOrEvent",value:function(e,t){var r=e;return t instanceof ErrorEvent?(t.filename&&(r+=" File: ".concat(t.filename)),(t.lineno||t.colno)&&(r+=" Line: ".concat(t.lineno,":").concat(t.colno)),t.message&&(r+=" Message: ".concat(t.message)),t.stack&&(r+="\nStack: ".concat(t.stack))):t instanceof Error?(t.fileName&&(r+=" File: ".concat(t.fileName)),(t.lineNumber||t.columnNumber)&&(r+=" Line: ".concat(t.lineNumber,":").concat(t.columnNumber)),t.message&&(r+=" Message: ".concat(t.message)),t.stack&&(r+=" Stack: ".concat(t.stack)),t.name&&(r+=" Name: ".concat(t.name)),t.constraint&&(r+=" Constraint: ".concat(t.constraint))):t instanceof CloseEvent&&(t.code&&(r+=" Code: ".concat(t.code)),t.reason&&(r+=" Reason: ".concat(t.reason)),r+=" wasClean: ".concat(t.wasClean)),r}},{key:"error",value:function(e){var 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;var r=u(this._highFrequencyLogs[e]);this._instance&&r&&this._instance.error(e)}},{key:"warn",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;e=this.getMessageFromErrorOrEvent(e,t),this._instance&&this._instance.warn(e)}},{key:"log",value:function(e){this._instance&&this._instance.log(e)}}]),e}(),u=function(e){return 0==(e&e-1)},d=new s;t.a=d},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){var i=r(31);function a(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,i(a.key),a)}}e.exports=function(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){"use strict";var i=r(20),a=r.n(i),n=function(){};n.prototype={publish:function(){return a.a.publish.apply(this,arguments)},publishSync:function(){return a.a.publishSync.apply(this,arguments)},trigger:function(){return this.publish.apply(this,arguments)},triggerSync:function(){return this.publishSync.apply(this,arguments)},emit:function(){return this.publish.apply(this,arguments)},subscribe:function(){return a.a.subscribe.apply(this,arguments)},on:function(){return this.subscribe.apply(this,arguments)},unsubscribe:function(){return a.a.unsubscribe.apply(this,arguments)},clearAllSubscriptions:function(){a.a.clearAllSubscriptions()}},t.a=new n},function(e,t,r){var i=r(31);e.exports=function(e,t,r){return(t=i(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){var i=r(51),a=r(52),n=r(30),o=r(53);e.exports=function(e,t){return i(e)||a(e,t)||n(e,t)||o()},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){"use strict";function i(){this.a=[],this.b=0,this.residue=null}i.prototype.getLength=function(){return this.a.length-this.b},i.prototype.isEmpty=function(){return 0==this.a.length},i.prototype.enqueue=function(e){this.a.push(e)},i.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},i.prototype.peek=function(){return 0<this.a.length?this.a[this.b]:void 0},i.prototype.clear=function(){this.a=[],this.b=0},t.a=i},function(e,t){function r(t){return e.exports=r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,r(t)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){"use strict";var i=r(15),a=r.n(i),n=r(13),o="object"===("undefined"==typeof localStorage?"undefined":r.n(n)()(localStorage))&&localStorage.__islogdebug,s=function(e,t){function r(){var e=[];return e.push.apply(e,arguments),e}!0===t&&(o=!0);var i=function(){var t;o&&(t=console).log.apply(t,[e].concat(a()(r(arguments))))};return["log","info","warn","error"].forEach((function(t){i[t]=function(){var i;o&&(i=console)[t].apply(i,[e].concat(a()(r(arguments))))}})),i.isEnable=function(){return o},i};s.isEnable=function(){return o},t.a=s},function(e,t,r){var i=r(42),a=r(43),n=r(30),o=r(44);e.exports=function(e){return i(e)||a(e)||n(e)||o()},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){function r(t){return e.exports=r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,r(t)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){var i=r(22),a=r(27);e.exports=function(e){return"number"==typeof e||a(e)&&"[object Number]"==i(e)}},function(e,t,r){"use strict";var i=r(7),a=r.n(i),n=r(8),o=r.n(n),s=function(){function e(){a()(this,e)}return o()(e,[{key:"_drawWatermarkWithShadow",value:function(e){var t=e.ctx,r=e.textPos,i=e.opacity,a=e.name;t.fillStyle="rgba(0, 0, 0, ".concat(i,")"),t.fillText(a,r.x,r.y),t.fillStyle="rgba(255, 255, 255, ".concat(i,")"),t.fillText(a,r.x+1,r.y+1)}},{key:"_getTransformInfo",value:function(e){var t,r=e.canvas,i=e.position;if(1===i)t={x:r.width/2,y:0,rateRadio:0,maxWidth:r.width};else if(2===i)t={x:r.width/2,y:r.height,rateRadio:0,maxWidth:r.width};else if(4===i)t={x:0,y:r.height/2,rateRadio:Math.PI/2,maxWidth:r.height};else if(8===i)t={x:r.width,y:r.height/2,rateRadio:-Math.PI/2,maxWidth:r.height};else{var a=-21*Math.PI/180;t={x:r.width/2,y:r.height/2,rateRadio:a,maxWidth:Math.min(r.width/Math.cos(a),-r.height/Math.sin(a))}}return t.maxWidth>100&&(t.maxWidth-=50),t}},{key:"_calcTextPos",value:function(e){var t=e.position,r=e.ctx,i=e.name,a=e.textWidth,n=this._getPaddingWidth({ctx:r,position:t,name:i});return 1===t?{x:-a.width/2,y:n}:2===t||4===t||8===t?{x:-a.width/2,y:-n}:{x:-a.width/2,y:r.measureText(i[0]).width/2}}},{key:"_getPaddingWidth",value:function(e){var t=e.ctx,r=e.position,i=e.name;return[1,2,4,8].includes(r)?32:t.measureText(i[0]).width}},{key:"_setBaseLine",value:function(e){var t=e.ctx,r=e.position;t.textBaseline=1===r?"top":2===r||4===r||8===r?"bottom":"middle"}},{key:"Get_WaterMarkRGBA",value:function(e){var t=e.canvas,r=e.name,i=e.width,a=e.height,n=e.opacity,o=void 0===n?.15:n,s=e.position,u=e.convertToDataUrl;if(r&&i&&a){o=o||.15;i*=1,a*=1,t.width=i,t.height=a;var d,c=this._getTransformInfo({canvas:t,position:s}),h=t.getContext("2d");if(h.clearRect(0,0,t.width,t.height),h.translate(c.x,c.y),h.rotate(c.rateRadio),this._setBaseLine({ctx:h,position:s}),h.lineWidth=1,h.imageSmoothingEnabled=!0,1==r.length){var l=c.maxWidth/r.length;h.font=l+"px 'Segoe UI'",d=h.measureText(r)}else{var p=16;for(h.font=p+"px 'Segoe UI'",d=h.measureText(r);d.width<c.maxWidth-2*this._getPaddingWidth({ctx:h,position:s,name:r});)p+=1,h.font=p+"px 'Segoe UI'",d=h.measureText(r);if(d.width>c.maxWidth-2*this._getPaddingWidth({ctx:h,position:s,name:r}))if(p>16)p-=1,h.font=p+"px 'Segoe UI'",d=h.measureText(r);else{for(var f=r;r.length>5&&d.width>c.maxWidth-2*this._getPaddingWidth({ctx:h,position:s,name:r+"..."});)r=r.slice(0,r.length-1),d=h.measureText(r+"...");f!==r&&(r+="...")}}var m,v=this._calcTextPos({position:s,ctx:h,name:r,textWidth:d});if(this._drawWatermarkWithShadow({ctx:h,name:r,opacity:o,textPos:v}),u)m=t.toDataURL();else{var g=h.getImageData(0,0,h.canvas.width,h.canvas.height);m=new Uint8Array(g.data.buffer)}return h.rotate(-c.rateRadio),h.translate(-c.x,-c.y),m}}},{key:"Get_Repeated_WaterMarkRGBA",value:function(e){var t=e.canvas,r=e.name,i=e.width,a=e.height,n=e.opacity,o=void 0===n?.15:n,s=(e.position,e.convertToDataUrl);if(r&&i&&a){o=o||.15;i*=1,a*=1,t.width=i,t.height=a;var u=t.getContext("2d");u.clearRect(0,0,t.width,t.height),u.translate(i/2,a/2),u.rotate(-21*Math.PI/180),u.imageSmoothingEnabled=!0;u.font="".concat(32,"px 'Segoe UI'"),u.textBaseline="top";var d,c=u.measureText(r),h=.37*c.width,l=0,p=-a;do{var f=l%2==0?h-i:-i;do{u.fillStyle="rgba(0, 0, 0, ".concat(o,")"),u.fillText(r,f,p),u.fillStyle="rgba(255, 255, 255, ".concat(o,")"),u.fillText(r,f+1,p+1),f+=c.width+h}while(f<i);p+=32+h,l++}while(p<a);if(s)d=t.toDataURL();else{var m=u.getImageData(0,0,u.canvas.width,u.canvas.height);d=new Uint8Array(m.data.buffer)}return u.rotate(21*Math.PI/180),u.translate(-i/2,-a/2),d}}}]),e}();t.a=s},function(e,t,r){var i=r(26);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&i(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){(function(e){!function(r,i){"use strict";var a={};r.PubSub=a;var n=r.define;!function(e){var t={},r=-1;function i(e){var t;for(t in e)if(e.hasOwnProperty(t))return!0;return!1}function a(e,t,r){try{e(t,r)}catch(e){setTimeout(function(e){return function(){throw e}}(e),0)}}function n(e,t,r){e(t,r)}function o(e,r,i,o){var s,u=t[r],d=o?n:a;if(t.hasOwnProperty(r))for(s in u)u.hasOwnProperty(s)&&d(u[s],e,i)}function s(e,r,a,n){var s=function(e,t,r){return function(){var i=String(e),a=i.lastIndexOf(".");for(o(e,e,t,r);-1!==a;)a=(i=i.substr(0,a)).lastIndexOf("."),o(e,i,t,r)}}(e,r,n);return!!function(e){for(var r=String(e),a=Boolean(t.hasOwnProperty(r)&&i(t[r])),n=r.lastIndexOf(".");!a&&-1!==n;)n=(r=r.substr(0,n)).lastIndexOf("."),a=Boolean(t.hasOwnProperty(r)&&i(t[r]));return a}(e)&&(!0===a?s():setTimeout(s,0),!0)}e.publish=function(t,r){return s(t,r,!1,e.immediateExceptions)},e.publishSync=function(t,r){return s(t,r,!0,e.immediateExceptions)},e.subscribe=function(e,i){if("function"!=typeof i)return!1;t.hasOwnProperty(e)||(t[e]={});var a="uid_"+String(++r);return t[e][a]=i,a},e.subscribeOnce=function(t,r){var i=e.subscribe(t,(function(){e.unsubscribe(i),r.apply(this,arguments)}));return e},e.clearAllSubscriptions=function(){t={}},e.clearSubscriptions=function(e){var r;for(r in t)t.hasOwnProperty(r)&&0===r.indexOf(e)&&delete t[r]},e.unsubscribe=function(r){var i,a,n,o="string"==typeof r&&(t.hasOwnProperty(r)||function(e){var r;for(r in t)if(t.hasOwnProperty(r)&&0===r.indexOf(e))return!0;return!1}(r)),s=!o&&"string"==typeof r,u="function"==typeof r,d=!1;if(!o){for(i in t)if(t.hasOwnProperty(i)){if(a=t[i],s&&a[r]){delete a[r],d=r;break}if(u)for(n in a)a.hasOwnProperty(n)&&a[n]===r&&(delete a[n],d=!0)}return d}e.clearSubscriptions(r)}}(a),"function"==typeof n&&n.amd?n((function(){return a})):(void 0!==e&&e.exports&&(t=e.exports=a),t.PubSub=a,e.exports=t=a)}("object"==typeof window&&window||this)}).call(this,r(54)(e))},function(e,t,r){var i=r(58),a=r(23);e.exports=function(e,t,r){var n=!0,o=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return a(r)&&(n="leading"in r?!!r.leading:n,o="trailing"in r?!!r.trailing:o),i(e,t,{leading:n,maxWait:t,trailing:o})}},function(e,t,r){var i=r(32),a=r(56),n=r(57),o=i?i.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":o&&o in Object(e)?a(e):n(e)}},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t,r){var i=r(13).default,a=r(28);e.exports=function(e,t){if(t&&("object"===i(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return a(e)},e.exports.__esModule=!0,e.exports.default=e.exports},function(t,r){t.exports=e},function(e,t){function r(t,i){return e.exports=r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,r(t,i)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){var i=r(29);e.exports=function(e,t){if(e){if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){var i=r(13).default,a=r(45);e.exports=function(e){var t=a(e,"string");return"symbol"===i(t)?t:String(t)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){var i=r(33).Symbol;e.exports=i},function(e,t,r){var i=r(55),a="object"==typeof self&&self&&self.Object===Object&&self,n=i||a||Function("return this")();e.exports=n},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){var i=r(16),a=r(26),n=r(47),o=r(48);function s(t){var r="function"==typeof Map?new Map:void 0;return e.exports=s=function(e){if(null===e||!n(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(e))return r.get(e);r.set(e,t)}function t(){return o(e,arguments,i(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),a(t,e)},e.exports.__esModule=!0,e.exports.default=e.exports,s(t)}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){var i=r(50);e.exports=function(e,t){if(null==e)return{};var r,a,n=i(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)r=o[a],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){var i=r(22),a=r(23);e.exports=function(e){if(!a(e))return!1;var t=i(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},function(e,t,r){"use strict";(function(e){var i=r(5),a=r.n(i),n=r(4),o=r.n(n),s=r(21),u=r.n(s),d=r(14),c=r(9),h=r(1),l=r(17),p=r.n(l),f=r(39),m=r.n(f),v=r(2),g=r(3),S=Object(d.a)("sdk.remoteControl"),_=0,C=0,y=83,b=82,A=84,k=85,E=87,w=88;function I(e){var t=this;this.dom=e.dom,this.socketURL=e.socketURL,this.meetingID=e.meetingID,this.condID=e.condID,this.blobSocket=null;var r=this._keyMouseEventHandler.bind(this);this.keyMouseEventHandler=function(e){t.keyMouseFilters(e).then((function(e){r(e)}))},this.keyMouseEventHandlerThrottle=u()((function(e){t.keyMouseEventHandler(e)}),1e3/24),this.pasteOnDocument=this._pasteOnDocument.bind(this),this.copyOnDocument=this._copyOnDocument.bind(this),this.cutOnDocument=this._cutOnDocument.bind(this),this.focus=this._focus.bind(this),this.PUBSUB_SHARING_PARAM_INFO_TOKEN=null,this.preventDefault=this._preventDefault.bind(this),this.browserBlurEventHandler=this._browserBlurEventHandler.bind(this),this.positionMap={canvas:{offsetX:0,offsetY:0},src:{x:0,y:0,w:0,h:0,scaleWidth:0,scaleHeight:0},dst:{x:0,y:0,w:0,h:0}},this.blockedKeyboardEventOfPaste=[],this.keydownupMergeRemoveMap={},this.keyMouseEventHandlerFilter_every_keyup_must_have_keydown_before_Map={},this.PASTE_MAX_BYTE_LENGTH=64e3,this.currentMousePositionProps={clientX:0,clientY:0,x2video:0,y2video:0},this.isControllerNow=!0,this.remoteOS=g.e.UNKNOWN,this.localOS=this.getLocalOS(),this._blockedCopyKeyboardList=[],this.maxSleep=500}I.prototype={start:function(){var e=this;return new Promise(function(){var t=a()(o.a.mark((function t(r,i){return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,S("remote control start"),e.modifyDom(),e.bindEvent(),e.subscribeSharingWidthOrHeightChange(),t.next=7,e.connectSocket();case 7:e.sendPostionPDU(),e.socketBlobMessageHandler(),r(!0),t.next=15;break;case 12:t.prev=12,t.t0=t.catch(0),i(t.t0);case 15:case"end":return t.stop()}}),t,null,[[0,12]])})));return function(e,r){return t.apply(this,arguments)}}())},destroy:function(){var e=this;return new Promise((function(t,r){try{S("destroy remote control"),e.unbindEvent(),e.uncheckAndClearKeydownupMergeRemoveMap(),e.destroySocket(),c.a.unsubscribe(e.PUBSUB_SHARING_PARAM_INFO_TOKEN),t(!0)}catch(e){S(e),t(!1)}}))},modifyDom:function(){try{this.dom.setAttribute("tabindex","0"),this.dom.focus()}catch(e){}},_focus:function(){this.dom.focus()},getLocalOS:function(){var t=e.navigator.platform;return/win/i.test(t)?g.e.WIN:/mac/i.test(t)?g.e.MAC:g.e.UNKNOWN},setIsControlerNow:function(e){this.isControllerNow=e},blobSocketCheckAndSend:function(e){this.isControllerNow&&this.blobSocket.send(e)},isKeyboardEvent:function(e){return!!e&&(e.type&&-1!==["keydown","keyup"].indexOf(e.type.toLowerCase()))},isThisKeyIgnoreCase:function(e,t){return e.key&&e.key.toLowerCase()==t.toLowerCase()},_copyOnDocument:function(e){var t=this;return a()(o.a.mark((function r(){var i;return o.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(t.isFocusNow()){r.next=2;break}return r.abrupt("return");case 2:if(i=t._blockedCopyKeyboardList,"done"!=i[i.length-1]){r.next=8;break}return r.abrupt("return");case 8:t._blockedCopyKeyboardList=[],t._blockedCopyKeyboardList.push("done");case 10:S("copyOnDocument",e),t.processMonitorCtrlMetaWithKey("c");case 12:case"end":return r.stop()}}),r)})))()},_cutOnDocument:function(e){var t=this;return a()(o.a.mark((function r(){return o.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(t.isFocusNow()){r.next=2;break}return r.abrupt("return");case 2:S("_cutOnDocument",e),t.processMonitorCtrlMetaWithKey("x");case 4:case"end":return r.stop()}}),r)})))()},processMonitorCtrlMetaWithKey:function(e){var t=this,r=0,i=1,a=2,n=this.remoteOS===g.e.MAC,o={t:"keydown",event_type:1,repeat:!1,alt:!1,shift:!1,capslock:!1,numlock:!0,pduType:k,ctrl:!n,super:n},s=Object.assign({},o,{charCode:0,keyCode:n?91:17,key:n?"Meta":"Control"}),u=Object.assign({},o,{charCode:e.charCodeAt(0),keyCode:e.toUpperCase().charCodeAt(0),key:e}),d=Object.assign({},s,{input_event_type:r}),c=(Object.assign({},s,{input_event_type:a}),Object.assign({},u,{input_event_type:r})),h=(Object.assign({},u,{input_event_type:a}),Object.assign({},s,{t:"keyup",ctrl:!1,super:!1,input_event_type:i})),l=Object.assign({},u,{t:"keyup",ctrl:!1,super:n,input_event_type:i});(n?[d,c,l,h]:[d,c,h,l]).forEach((function(e){t.processEvent(e)}))},isFocusNow:function(){return this.dom===document.activeElement},_pasteOnDocument:function(e){var t=this;return a()(o.a.mark((function r(){var i,a,n,s,u,d,c,h,l,p,f;return o.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(t.isFocusNow()){for(i=(e.clipboardData||window.clipboardData).getData("text"),S("_pasteOnDocument",i),a=[],n=0;n<i.length;n++)for(s=i[n],u=m.a.encode(s),d=0;d<u.length;d++)a.push(u.charCodeAt(d));for(c=new ArrayBuffer(8+a.length),h=new Uint8Array(c),l=new DataView(c,4,4),p=new Uint8Array(c,8),h[0]=E,l.setUint32(0,a.length,!0),f=0;f<a.length;f++)p[f]=a[f];a.length>t.PASTE_MAX_BYTE_LENGTH?(t.triggerPasteTextLengthOverflow(),t.dropAllEventFromBlockedKeyboardEventOfPaste()):(t.blobSocketCheckAndSend(c),t.processMonitorCtrlMetaWithKey("v"))}case 1:case"end":return r.stop()}}),r)})))()},onReturnCopiedText:function(e){!this._onReturnCopiedText_list&&(this._onReturnCopiedText_list=[]),this._onReturnCopiedText_list.push(e)},triggerReturnCopiedText:function(e){this._onReturnCopiedText_list&&this._onReturnCopiedText_list.forEach((function(t){return t(e)}))},onPasteTextLengthOverflow:function(e){!this._onPasteTextLengthOverflow_list&&(this._onPasteTextLengthOverflow_list=[]),this._onPasteTextLengthOverflow_list.push(e)},triggerPasteTextLengthOverflow:function(){this._onPasteTextLengthOverflow_list&&this._onPasteTextLengthOverflow_list.forEach((function(e){return e()}))},dropAllEventFromBlockedKeyboardEventOfPaste:function(){this.blockedKeyboardEventOfPaste=[]},createParamsFromKeyboardEvent:function(e){return{key:e.key,code:e.code,shiftKey:e.shiftKey,altKey:e.altKey,repeat:e.repeat,charCode:e.charCode,keyCode:e.keyCode,which:e.which,ctrlKey:e.ctrlKey,metaKey:e.metaKey}},sendAllEventFromBlockedKeyboardEventOfPaste:function(){for(S("blockedKeyboardEventOfPaste.length",this.blockedKeyboardEventOfPaste.length);this.blockedKeyboardEventOfPaste.length>0;){var e=this.blockedKeyboardEventOfPaste.shift();this._keyMouseEventHandler(e)}},_preventDefault:function(e){if(-1!==["keydown","keyup"].indexOf(e.type))for(var t=["v","c","x"],r=0;r<t.length;r++)if(e.ctrlKey^e.metaKey&&this.isThisKeyIgnoreCase(e,t[r]))return;e.preventDefault()},subscribeSharingWidthOrHeightChange:function(){var e=this;this.PUBSUB_SHARING_PARAM_INFO_TOKEN=c.a.on(h.Xc,(function(t,r){S("subscribeSharingWidthOrHeightChange",r.body),e.positionMap.dst.w=r.body.logicWidth,e.positionMap.dst.h=r.body.logicHeight,e.positionMap.src.w=r.body.logicWidth,e.positionMap.src.h=r.body.logicHeight,e.sendPostionPDU()}))},setDstWidthAndHeight:function(e,t){if(!e||!t)throw new Error("the value of destination sharing video width/height are not correct");this.positionMap.dst.w=e,this.positionMap.dst.h=t},setSrcWidthAndHeight:function(e,t){if(!e||!t)throw new Error("the value of source sharing video width/height are not correct");this.positionMap.src.w=e,this.positionMap.src.h=t},setSrcWidthAndHeightAndSendPDU:function(e,t){if(!e||!t)throw new Error("the value of source sharing video width/height are not correct");this.positionMap.src.w!==e&&this.positionMap.src.h!==t&&(this.setSrcWidthAndHeight(e,t),this.sendPostionPDU())},setSrcOffsetXYAndSendPDU:function(e,t){e=Math.floor(e),t=Math.floor(t),this.positionMap.canvas.offsetX===e&&this.positionMap.canvas.offsetY===t||(this.setSrcOffsetXY(e,t),this.sendPostionPDU())},setSrcScaleWidthAndHeight:function(e,t){if(!e||!t)throw new Error("the value of source sharing video scaleWidth/scaleHeight are not correct");this.positionMap.src.scaleWidth=e,this.positionMap.src.scaleHeight=t},setSrcOffsetXY:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=Math.floor(e),i=Math.floor(t);if(!p()(r)&&!p()(i))throw new Error("the value of source offset x or y is not correct");this.positionMap.canvas.offsetX=r,this.positionMap.canvas.offsetY=i},sendPostionPDU:function(){var e=new ArrayBuffer(36),t=new Uint8Array(e),r=new DataView(e,4),i=new DataView(e,20);t[0]=b,r.setInt32(0,this.positionMap.src.x,!0),r.setInt32(4,this.positionMap.src.y,!0),r.setInt32(8,this.positionMap.src.w,!0),r.setInt32(12,this.positionMap.src.h,!0),i.setInt32(0,this.positionMap.dst.x,!0),i.setInt32(4,this.positionMap.dst.y,!0),i.setInt32(8,this.positionMap.dst.w,!0),i.setInt32(12,this.positionMap.dst.h,!0),S("send position pdu");try{this.blobSocket.send(e)}catch(e){}},unbindEvent:function(){var e=this.dom;e.removeEventListener("click",this.focus),e.removeEventListener("keydown",this.keyMouseEventHandler),e.removeEventListener("keyup",this.keyMouseEventHandler),document.removeEventListener("paste",this.pasteOnDocument),document.removeEventListener("copy",this.copyOnDocument),document.removeEventListener("cut",this.cutOnDocument),e.removeEventListener("contextmenu",this.preventDefault),e.removeEventListener("wheel",this.preventDefault),e.removeEventListener("dblclick",this.preventDefault),e.removeEventListener("keydown",this.preventDefault),e.removeEventListener("keyup",this.preventDefault),e.removeEventListener("dblclick",this.keyMouseEventHandler),e.removeEventListener("mousedown",this.keyMouseEventHandler),e.removeEventListener("mouseup",this.keyMouseEventHandler),e.removeEventListener("mousemove",this.keyMouseEventHandlerThrottle),e.removeEventListener("wheel",this.keyMouseEventHandler),window.removeEventListener("blur",this.browserBlurEventHandler)},bindEvent:function(){var e=this.dom;S("dom",e),e.addEventListener("click",this.focus),e.addEventListener("keydown",this.keyMouseEventHandler),e.addEventListener("keyup",this.keyMouseEventHandler),document.addEventListener("paste",this.pasteOnDocument),document.addEventListener("copy",this.copyOnDocument),document.addEventListener("cut",this.cutOnDocument),e.addEventListener("contextmenu",this.preventDefault),e.addEventListener("wheel",this.preventDefault),e.addEventListener("dblclick",this.preventDefault),e.addEventListener("keydown",this.preventDefault),e.addEventListener("keyup",this.preventDefault),e.addEventListener("dblclick",this.keyMouseEventHandler),e.addEventListener("mousedown",this.keyMouseEventHandler),e.addEventListener("mouseup",this.keyMouseEventHandler),e.addEventListener("mousemove",this.keyMouseEventHandlerThrottle),e.addEventListener("wheel",this.keyMouseEventHandler),window.addEventListener("blur",this.browserBlurEventHandler)},recordCurrentMousePosition:function(e){try{var t=this.positionMap,r=e.clientX,i=e.clientY;Object.assign(this.currentMousePositionProps,{clientX:r,clientY:i,x2video:r-t.canvas.offsetX,y2video:i-t.canvas.offsetY})}catch(e){}},resolvePosition:function(e){var t=e.clientX,r=e.clientY,i=this.positionMap;return t-=i.canvas.offsetX,r-=i.canvas.offsetY,t*=i.dst.w/i.src.scaleWidth,r*=i.dst.h/i.src.scaleHeight,{x:t=Math.floor(t),y:r=Math.floor(r)}},generateBuffer:function(e){if(void 0!==e.key&&!/^[\x00-\x7F]*$/.test(e.key))throw new Error("params.key must only contain ascii character");var t=8;(e=Object.assign({v:0,x:0,y:0,dx:0,dy:0,repeat:0},e)).pduType===A&&(t+=4);var r=new ArrayBuffer(t),i=new Uint8Array(r),a=new DataView(r,4),n=new DataView(r,4);if(i[0]=e.pduType,i[1]=63&e.input_event_type,e.pduType===y)a.setUint16(0,e.x,!0),a.setUint16(2,e.y,!0);else if(e.pduType===A)n.setInt16(0,e.x,!0),n.setInt16(2,e.y,!0),n.setInt16(4,e.dx,!0),n.setInt16(6,e.dy,!0);else if(e.pduType===k){var o=new DataView(r,4),s=new DataView(r,6),u=new Uint8Array(r,2);o.setUint16(0,e.keyCode,!0),s.setUint16(0,e.charCode,!0);var d={shift:1,capslock:2,ctrl:4,alt:8,numlock:16,super:32},c=0;Object.keys(d).forEach((function(t){!0===e[t]&&(c+=d[t])})),u[0]=c,e.repeat&&(i[1]=32|i[1])}return r},processEvent:function(e){this.blobSocket&&this.blobSocketCheckAndSend(this.generateBuffer(e))},debug:function(e){var t={};(e.pduType===k?["t","keyCode","charCode","key"]:["t","x","y","dx","dy","input_event_type"]).forEach((function(r){t[r]=e[r]})),S("debug",JSON.stringify(t))},blockedPasteKeyboard:function(e){var t=this;return new Promise((function(r,i){t.isKeyboardEvent(e)&&t.isPasteEvent(e)?t.blockedKeyboardEventOfPaste.push(e):r(e)}))},isPasteEvent:function(e){var t=this.isThisKeyIgnoreCase(e,"v");return!!(e.ctrlKey^e.metaKey&&t)},isCopyEvent:function(e){var t=this.isThisKeyIgnoreCase(e,"c");return!!(e.ctrlKey^e.metaKey&&t)},isCutEvent:function(e){var t=this.isThisKeyIgnoreCase(e,"x");return!!(e.ctrlKey^e.metaKey&&t)},returnNewEventByTransformCtrlKeyOrCommandKey:function(e){var t=this.createParamsFromKeyboardEvent(e);switch(this.remoteOS){case g.e.WIN:Object.assign(t,{ctrlKey:!0,metaKey:!1});break;case g.e.MAC:Object.assign(t,{ctrlKey:!1,metaKey:!0});break;case g.e.UNKNOWN:}return new e.constructor(e.type,t)},transformCtrlCAndCommandC:function(e){var t=this,r=this;return new Promise((function(i,a){if(t.isKeyboardEvent(e)&&(e.ctrlKey||e.metaKey)&&r.isThisKeyIgnoreCase(e,"c")){r.createParamsFromKeyboardEvent(e);i(r.returnNewEventByTransformCtrlKeyOrCommandKey(e))}else i(e)}))},keyMouseEventHandlerFilter_MatainKeyDownUpMergeMap:function(e){var t=this;return new Promise((function(r,i){try{t.isKeyboardEvent(e)&&e.key&&("keydown"!==e.type||e.repeat||(t.keydownupMergeRemoveMap[e.key]={t:+new Date,e:e}),"keydown"===e.type&&e.repeat&&delete t.keydownupMergeRemoveMap[e.key],"keyup"===e.type&&delete t.keydownupMergeRemoveMap[e.key])}catch(e){S.error(e)}r(e)}))},_browserBlurEventHandler:function(){this._checkAndClearKeydownupMergeRemoveMap(this.maxSleep,!0)},checkAndClearKeydownupMergeRemoveMap:function(){var e=this,t=this;this.checkAndClearKeydownupMergeRemoveMapInterval=setInterval((function(){t._checkAndClearKeydownupMergeRemoveMap(e.maxSleep)}),100)},_checkAndClearKeydownupMergeRemoveMap:function(e,t){var r=this,i=this.keydownupMergeRemoveMap;Object.keys(i).forEach((function(a){var n=i[a];if(+new Date-n.t>=e||t){var o=new n.e.constructor("keyup",n.e);try{r._keyMouseEventHandler(o)}catch(e){}delete r.keydownupMergeRemoveMap[a]}}))},uncheckAndClearKeydownupMergeRemoveMap:function(){this._checkAndClearKeydownupMergeRemoveMap(0),clearInterval(this.checkAndClearKeydownupMergeRemoveMapInterval)},keyMouseFilters:function(e){var t=this;return new Promise((function(t,r){t(e)})).then((function(e){return t.blockedPasteKeyboard(e)})).then((function(e){return t.blockedCopyKeyboard(e)})).then((function(e){return t.blockedCutKeyboard(e)})).then((function(e){return t.keyMouseEventHandlerFilter_MatainKeyDownUpMergeMap(e)})).then((function(e){return t.blockedSomeKeyboardEventNotHaveKeydownBefore(e)})).then((function(e){return t.keyMouseEventHandlerFilter_EVERY_KEYUP_MUST_HAVE_KEYDOWN_BEFORE(e)}))},blockedSingleMetaKey:function(e){var t=this;return new Promise((function(r,i){t.isKeyboardEvent(e)&&e.key&&(/command/i.test(e.key)||/meta/i.test(e.key)||/control/i.test(e.key))&&!e.shiftKey&&!e.altKey&&e.ctrlKey^e.metaKey||r(e)}))},blockedCutKeyboard:function(e){var t=this;return new Promise((function(r,i){t.isKeyboardEvent(e)&&t.isCutEvent(e)||r(e)}))},blockedCopyKeyboard:function(e){var t=this;return new Promise((function(r,i){t.isKeyboardEvent(e)&&t.isCopyEvent(e)?t._blockedCopyKeyboardList.push(e):r(e)}))},blockedSomeKeyboardEventNotHaveKeydownBefore:function(e){var t=this;return new Promise((function(r,i){if(t.isKeyboardEvent(e)&&e.key){var a=!1;if(["x","c","v"].forEach((function(r){t.isThisKeyIgnoreCase(e,r)&&(a=!0)})),"keyup"===e.type&&a)if(!!!t.keyMouseEventHandlerFilter_every_keyup_must_have_keydown_before_Map[e.key])return}r(e)}))},keyMouseEventHandlerFilter_EVERY_KEYUP_MUST_HAVE_KEYDOWN_BEFORE:function(e){var t=this;return new Promise((function(r,i){try{if(t.isKeyboardEvent(e)&&e.key&&("keydown"===e.type&&(t.keyMouseEventHandlerFilter_every_keyup_must_have_keydown_before_Map[e.key]=e),"keyup"===e.type)){var a=!!t.keyMouseEventHandlerFilter_every_keyup_must_have_keydown_before_Map[e.key];delete t.keyMouseEventHandlerFilter_every_keyup_must_have_keydown_before_Map[e.key];var n=!1;if(["meta"].forEach((function(r){t.isThisKeyIgnoreCase(e,r)&&(n=!0)})),!a&&!n){S.warn("keyup trigger, but no keydown before");var o=new e.constructor("keydown",e);t._keyMouseEventHandler(o)}}}catch(e){S.error(e)}r(e)}))},_keyMouseEventHandler:function(e){this.isKeyboardEvent(e)&&S("_keyMouseEventHandler keyboard",e);var t={},r={keydown:0,keyup:1,keychar:2},i={mousemove:0,mousedown:{left:1,right:4,middle:7},mouseup:{left:2,right:5,middle:8},mouseleftdbldown:3,mouserightdbldown:6,wheel:10},a=e.getModifierState?function(t){return e.getModifierState(t)}:function(e,t){return t},n=_,o=e.key&&1===e.key.length;if(-1!==["keydown","keyup"].indexOf(e.type))t.event_type=1,n=k,void 0!==r[e.type]&&(t.input_event_type=r[e.type]);else{if(-1===["mousedown","mouseup","mousemove","wheel","click","dblclick","contextmenu"].indexOf(e.type))return void S.warn("the event type cannot be handled");t.event_type=0,this.recordCurrentMousePosition(e);var s=this.resolvePosition(e);if(Object.assign(t,{x:s.x,y:s.y}),n="wheel"===e.type?A:y,void 0!==i[e.type]&&(t.input_event_type=i[e.type]),-1!==["mousedown","mouseup"].indexOf(e.type)){var u;switch(e.button){case 0:u="left";break;case 1:u="middle";break;case 2:u="right";break;default:u="left"}t.input_event_type=i[e.type][u]}-1!==["dblclick"].indexOf(e.type)&&(t.input_event_type=i.mouseleftdbldown)}if("wheel"===e.type){var d={deltaX:"dx",deltaY:"dy"};Object.keys(d).forEach((function(r){e[r]&&(t[d[r]]=e[r]>0?-100:100)}))}var c=this.ctrlMetaConvert({keyCode:e.keyCode,key:e.key,ctrlKey:e.ctrlKey,metaKey:e.metaKey});Object.assign(t,{t:e.type,pduType:n,keyCode:c.keyCode,charCode:o?e.key.charCodeAt(0):0,key:c.key,repeat:e.repeat,ctrl:c.ctrlKey,alt:e.altKey,super:c.metaKey,shift:e.shiftKey,capslock:a("CapsLock",!1),numlock:a("NumLock",!1)}),this.isKeyboardEvent(e)&&S("processEvent",JSON.stringify(t)),this.processEvent(t)},ctrlMetaConvert:function(e){var t=e.metaKey,r=e.ctrlKey;return(this.remoteOS===g.e.MAC&&this.localOS===g.e.WIN||this.remoteOS===g.e.WIN&&this.localOS===g.e.MAC)&&e.key&&(/Meta/i.test(e.key)?(e.ctrlKey=!0,e.keyCode=17,e.metaKey=r,e.key="Control"):/Control/i.test(e.key)&&(e.metaKey=!0,e.keyCode=91,e.ctrlKey=t,e.key="Meta")),e},isCapslock:function(e){var t=e.keyCode,r=e.key,i=e.shiftKey;return!!/[a-zA-Z]/.test(r)&&(r.charCodeAt(0)!==t?!i:i)},stop:function(){var e=this;return a()(o.a.mark((function t(){return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.blobSocket&&e.blobSocket.close(),e.blobSocket=null;case 2:case"end":return t.stop()}}),t)})))()},connectSocket:function(){var e=this;return a()(o.a.mark((function t(){var r;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.createBlobSocket("".concat(e.socketURL,"/wc/media/").concat(e.meetingID,"?type=r&mode=2&cid=").concat(e.condID));case 2:return(r=t.sent).binaryType="blob",e.blobSocket=r,t.abrupt("return",!0);case 6:case"end":return t.stop()}}),t)})))()},socketBlobMessageHandler:function(){if(this.blobSocket){var e=this;this.blobSocket.addEventListener("message",function(){var t=a()(o.a.mark((function t(r){var i,a,n,s,u,d,c;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=r.data,t.next=3,v.g.readBlobAsBuffer(i,i.size);case 3:if(a=t.sent,n=new Int8Array(a),(s=n[0])!==w||!e.isControllerNow){t.next=14;break}return u=i.slice(8),t.next=10,v.g.readBlob(u);case 10:d=t.sent,c=n[4],S("COPY_TEXT_FROM_RWG",d,c),e.triggerReturnCopiedText({data:d,x:e.currentMousePositionProps.x2video,y:e.currentMousePositionProps.y2video});case 14:s===C&&e.blobSocket.send(a);case 15:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}},destroySocket:function(){try{this.blobSocket.close(),this.blobSocket=null}catch(e){S("destroySocket",e)}},createBlobSocket:function(e){return new Promise((function(t,r){var i=new WebSocket(e);i.addEventListener("open",(function(){})),i.addEventListener("message",(function(e){try{var r=JSON.parse(e.data);0===r.evt&&r.body&&t(i)}catch(e){}})),i.addEventListener("error",(function(e){r(e)})),i.addEventListener("close",(function(){r(new Error("socket close"))}))}))},setRemoteOS:function(e){void 0!==e&&(this.remoteOS=e)}},t.a=I}).call(this,r(34))},function(e,t,r){!function(e){var t,r,i,a=String.fromCharCode;function n(e){for(var t,r,i=[],a=0,n=e.length;a<n;)(t=e.charCodeAt(a++))>=55296&&t<=56319&&a<n?56320==(64512&(r=e.charCodeAt(a++)))?i.push(((1023&t)<<10)+(1023&r)+65536):(i.push(t),a--):i.push(t);return i}function o(e){if(e>=55296&&e<=57343)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value")}function s(e,t){return a(e>>t&63|128)}function u(e){if(0==(4294967168&e))return a(e);var t="";return 0==(4294965248&e)?t=a(e>>6&31|192):0==(4294901760&e)?(o(e),t=a(e>>12&15|224),t+=s(e,6)):0==(4292870144&e)&&(t=a(e>>18&7|240),t+=s(e,12),t+=s(e,6)),t+=a(63&e|128)}function d(){if(i>=r)throw Error("Invalid byte index");var e=255&t[i];if(i++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function c(){var e,a;if(i>r)throw Error("Invalid byte index");if(i==r)return!1;if(e=255&t[i],i++,0==(128&e))return e;if(192==(224&e)){if((a=(31&e)<<6|d())>=128)return a;throw Error("Invalid continuation byte")}if(224==(240&e)){if((a=(15&e)<<12|d()<<6|d())>=2048)return o(a),a;throw Error("Invalid continuation byte")}if(240==(248&e)&&(a=(7&e)<<18|d()<<12|d()<<6|d())>=65536&&a<=1114111)return a;throw Error("Invalid UTF-8 detected")}e.version="3.0.0",e.encode=function(e){for(var t=n(e),r=t.length,i=-1,a="";++i<r;)a+=u(t[i]);return a},e.decode=function(e){t=n(e),r=t.length,i=0;for(var o,s=[];!1!==(o=c());)s.push(o);return function(e){for(var t,r=e.length,i=-1,n="";++i<r;)(t=e[i])>65535&&(n+=a((t-=65536)>>>10&1023|55296),t=56320|1023&t),n+=a(t);return n}(s)}}(t)},function(e,t,r){var i=r(22),a=r(27);e.exports=function(e){return!0===e||!1===e||a(e)&&"[object Boolean]"==i(e)}},function(e,t,r){var i=r(62).default;e.exports=i},function(e,t,r){var i=r(29);e.exports=function(e){if(Array.isArray(e))return i(e)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){var i=r(13).default;e.exports=function(e,t){if("object"!==i(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var a=r.call(e,t||"default");if("object"!==i(a))return a;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,r){var i=r(13).default;function a(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */e.exports=a=function(){return t},e.exports.__esModule=!0,e.exports.default=e.exports;var t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",d=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function h(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{h({},"")}catch(e){h=function(e,t,r){return e[t]=r}}function l(e,t,r,i){var a=t&&t.prototype instanceof m?t:m,n=Object.create(a.prototype),s=new D(i||[]);return o(n,"_invoke",{value:k(e,r,s)}),n}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var f={};function m(){}function v(){}function g(){}var S={};h(S,u,(function(){return this}));var _=Object.getPrototypeOf,C=_&&_(_(M([])));C&&C!==r&&n.call(C,u)&&(S=C);var y=g.prototype=m.prototype=Object.create(S);function b(e){["next","throw","return"].forEach((function(t){h(e,t,(function(e){return this._invoke(t,e)}))}))}function A(e,t){var r;o(this,"_invoke",{value:function(a,o){function s(){return new t((function(r,s){!function r(a,o,s,u){var d=p(e[a],e,o);if("throw"!==d.type){var c=d.arg,h=c.value;return h&&"object"==i(h)&&n.call(h,"__await")?t.resolve(h.__await).then((function(e){r("next",e,s,u)}),(function(e){r("throw",e,s,u)})):t.resolve(h).then((function(e){c.value=e,s(c)}),(function(e){return r("throw",e,s,u)}))}u(d.arg)}(a,o,r,s)}))}return r=r?r.then(s,s):s()}})}function k(e,t,r){var i="suspendedStart";return function(a,n){if("executing"===i)throw new Error("Generator is already running");if("completed"===i){if("throw"===a)throw n;return R()}for(r.method=a,r.arg=n;;){var o=r.delegate;if(o){var s=E(o,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===i)throw i="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i="executing";var u=p(e,t,r);if("normal"===u.type){if(i=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(i="completed",r.method="throw",r.arg=u.arg)}}}function E(e,t){var r=t.method,i=e.iterator[r];if(void 0===i)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,E(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var a=p(i,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,f;var n=a.arg;return n?n.done?(t[e.resultName]=n.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):n:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function I(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function D(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function M(e){if(e){var t=e[u];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:R}}function R(){return{value:void 0,done:!0}}return v.prototype=g,o(y,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:v,configurable:!0}),v.displayName=h(g,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,h(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},t.awrap=function(e){return{__await:e}},b(A.prototype),h(A.prototype,d,(function(){return this})),t.AsyncIterator=A,t.async=function(e,r,i,a,n){void 0===n&&(n=Promise);var o=new A(l(e,r,i,a),n);return t.isGeneratorFunction(r)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},b(y),h(y,c,"Generator"),h(y,u,(function(){return this})),h(y,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var i in t)r.push(i);return r.reverse(),function e(){for(;r.length;){var i=r.pop();if(i in t)return e.value=i,e.done=!1,e}return e.done=!0,e}},t.values=M,D.prototype={constructor:D,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(I),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(r,i){return o.type="throw",o.arg=e,t.next=r,i&&(t.method="next",t.arg=void 0),!!i}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],o=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var s=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(s&&u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,f):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),I(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var i=r.completion;if("throw"===i.type){var a=i.arg;I(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:M(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e){return-1!==Function.toString.call(e).indexOf("[native code]")},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){var i=r(26),a=r(49);function n(t,r,o){return a()?(e.exports=n=Reflect.construct.bind(),e.exports.__esModule=!0,e.exports.default=e.exports):(e.exports=n=function(e,t,r){var a=[null];a.push.apply(a,t);var n=new(Function.bind.apply(e,a));return r&&i(n,r.prototype),n},e.exports.__esModule=!0,e.exports.default=e.exports),n.apply(null,arguments)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e,t){if(null==e)return{};var r,i,a={},n=Object.keys(e);for(i=0;i<n.length;i++)r=n[i],t.indexOf(r)>=0||(a[r]=e[r]);return a},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i,a,n,o,s=[],u=!0,d=!1;try{if(n=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(i=n.call(r)).done)&&(s.push(i.value),s.length!==t);u=!0);}catch(e){d=!0,a=e}finally{try{if(!u&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw a}}return s}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){(function(t){var r="object"==typeof t&&t&&t.Object===Object&&t;e.exports=r}).call(this,r(34))},function(e,t,r){var i=r(32),a=Object.prototype,n=a.hasOwnProperty,o=a.toString,s=i?i.toStringTag:void 0;e.exports=function(e){var t=n.call(e,s),r=e[s];try{e[s]=void 0;var i=!0}catch(e){}var a=o.call(e);return i&&(t?e[s]=r:delete e[s]),a}},function(e,t){var r=Object.prototype.toString;e.exports=function(e){return r.call(e)}},function(e,t,r){var i=r(23),a=r(59),n=r(60),o=Math.max,s=Math.min;e.exports=function(e,t,r){var u,d,c,h,l,p,f=0,m=!1,v=!1,g=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function S(t){var r=u,i=d;return u=d=void 0,f=t,h=e.apply(i,r)}function _(e){return f=e,l=setTimeout(y,t),m?S(e):h}function C(e){var r=e-p;return void 0===p||r>=t||r<0||v&&e-f>=c}function y(){var e=a();if(C(e))return b(e);l=setTimeout(y,function(e){var r=t-(e-p);return v?s(r,c-(e-f)):r}(e))}function b(e){return l=void 0,g&&u?S(e):(u=d=void 0,h)}function A(){var e=a(),r=C(e);if(u=arguments,d=this,p=e,r){if(void 0===l)return _(p);if(v)return l=setTimeout(y,t),S(p)}return void 0===l&&(l=setTimeout(y,t)),h}return t=n(t)||0,i(r)&&(m=!!r.leading,c=(v="maxWait"in r)?o(n(r.maxWait)||0,t):c,g="trailing"in r?!!r.trailing:g),A.cancel=function(){void 0!==l&&clearTimeout(l),f=0,u=p=d=l=void 0},A.flush=function(){return void 0===l?h:b(a())},A}},function(e,t,r){var i=r(33);e.exports=function(){return i.Date.now()}},function(e,t,r){var i=r(23),a=r(61),n=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,u=/^0o[0-7]+$/i,d=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(a(e))return NaN;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(n,"");var r=s.test(e);return r||u.test(e)?d(e.slice(2),r?2:8):o.test(e)?NaN:+e}},function(e,t,r){var i=r(22),a=r(27);e.exports=function(e){return"symbol"==typeof e||a(e)&&"[object Symbol]"==i(e)}},function(e,t,r){"use strict";r.r(t);var i={};r.r(i),r.d(i,"setUserNodeListToWorker",(function(){return ve})),r.d(i,"UpdateAudioPlayStatus",(function(){return ge})),r.d(i,"UpdateVideoPlayStatus",(function(){return Se})),r.d(i,"UpdateSharingPlayStatus",(function(){return Ce})),r.d(i,"preserveMessageController",(function(){return be})),r.d(i,"previewController",(function(){return Ae})),r.d(i,"initVideoEncode",(function(){return ke})),r.d(i,"initVideoDecode",(function(){return we})),r.d(i,"initAudioEncode",(function(){return De})),r.d(i,"initAudioDecode",(function(){return Re})),r.d(i,"initSharingDecode",(function(){return Pe})),r.d(i,"initSharingEncode",(function(){return Oe})),r.d(i,"Sharing_Decode_Post_message",(function(){return Ne})),r.d(i,"Sharing_Encode_Post_message",(function(){return We})),r.d(i,"addAudioMonitorLog",(function(){return Xe})),r.d(i,"setSharingEngineInitProperties",(function(){return at})),r.d(i,"setAudioEngineInitProperties",(function(){return nt})),r.d(i,"setVideoEngineInitProperties",(function(){return ot})),r.d(i,"Set_Audio_WebSocket_Ip_Address",(function(){return st})),r.d(i,"Set_Audio_Web_Transport_Ip_Address",(function(){return ut})),r.d(i,"Set_Video_WebSocket_Ip_Address",(function(){return dt})),r.d(i,"Set_Video_Web_Transport_Ip_Address",(function(){return ct})),r.d(i,"JsAudioEngine_UnInit",(function(){return ht})),r.d(i,"JsVideoEngine_UnInit",(function(){return lt})),r.d(i,"JsSharingEngine_UnInit",(function(){return pt})),r.d(i,"Video_Encode_Frame",(function(){return ft})),r.d(i,"Sharing_Encode_Frame",(function(){return mt})),r.d(i,"Put_Video_Frame_Buffer",(function(){return gt})),r.d(i,"Clear_Decoded_Sharing_Frame",(function(){return St})),r.d(i,"Add_Video_Decode_Thread",(function(){return yt})),r.d(i,"Add_Audio_Decode_Thread",(function(){return Mt})),r.d(i,"Get_SSRC_Latest_Time",(function(){return xt})),r.d(i,"Get_Video_SSRC_Latest_Time",(function(){return Pt})),r.d(i,"Meeting_Fail_Over",(function(){return Tt})),r.d(i,"Modify_Audio_SampleRate",(function(){return Wt})),r.d(i,"Notify_Audio_Thread_Status",(function(){return Ut})),r.d(i,"Notify_Audio_Thread_AEC_Status",(function(){return Ft})),r.d(i,"Notify_Audio_Thread_Msg_Channel",(function(){return Bt})),r.d(i,"Notify_Video_Thread_Msg_Channel",(function(){return Gt})),r.d(i,"Notify_Video_Sharing_Msg_Channel",(function(){return Ht})),r.d(i,"Notify_Audio_Thread_Msg_Channel2",(function(){return jt})),r.d(i,"Notify_Audio_Thread_Msg_Channel3",(function(){return Kt})),r.d(i,"Notify_Audio_Video_Thread_Msg_Channel",(function(){return qt})),r.d(i,"Notify_Video_Encode_Thread",(function(){return Qt})),r.d(i,"Notify_Video_Encode_Thread_Transferable_Data",(function(){return zt})),r.d(i,"Notify_Video_Decode_Thread",(function(){return Xt})),r.d(i,"Notify_Sharing_Video_Encode_Thread_Transferable_Data",(function(){return Jt})),r.d(i,"Notify_Sharing_Encode_Thread_Transferable_Data",(function(){return Yt})),r.d(i,"Notify_Sharing_Video_Decode_Thread",(function(){return Zt})),r.d(i,"Notify_Sharing_Decode_Thread",(function(){return $t})),r.d(i,"Notify_Audio_Thread_CurrentSSRC",(function(){return er})),r.d(i,"Notify_Audio_Encode_Thread",(function(){return tr})),r.d(i,"Notify_Audio_Decode_Thread",(function(){return rr})),r.d(i,"Notify_Audio_Thread_Interpretation_Enable",(function(){return ir})),r.d(i,"Notify_Audio_Thread_CC_Set_Lang",(function(){return ar})),r.d(i,"Notify_Audio_Thread_Interpretation_Set_Lang",(function(){return nr})),r.d(i,"Notify_Audio_Thread_Interpretation_Mute",(function(){return or})),r.d(i,"Notify_Audio_Thread_Interpretation_Set_Interpreter",(function(){return sr})),r.d(i,"Reset_Aec",(function(){return ur})),r.d(i,"Set_Aec_Delay",(function(){return dr})),r.d(i,"Start_Monitor",(function(){return lr})),r.d(i,"Send_Render_Monitor_Log",(function(){return pr})),r.d(i,"Stop_Monitor",(function(){return fr})),r.d(i,"Update_Video_Encrpt",(function(){return mr})),r.d(i,"Update_Sharing_Encrpt",(function(){return vr})),r.d(i,"Update_Sharing_Video_Encode_Status",(function(){return gr})),r.d(i,"Update_Sharing_Encode_Status",(function(){return Sr})),r.d(i,"Notify_Sharing_Video_Encode_Thread",(function(){return _r})),r.d(i,"Notify_Sharing_Encode_Thread",(function(){return Cr})),r.d(i,"Update_Audio_Encrpt",(function(){return yr})),r.d(i,"disableSocketReconnect",(function(){return br})),r.d(i,"closeAllMedia",(function(){return Ar})),r.d(i,"destroyAllWorkers",(function(){return kr})),r.d(i,"pushMessageToWorker",(function(){return Dr})),r.d(i,"isVideoEncodeHandleReady",(function(){return Rr})),r.d(i,"transportSettingCanvas",(function(){return xr})),r.d(i,"initResourceManager",(function(){return Pr})),r.d(i,"prepareVBfile",(function(){return Or})),r.d(i,"transportImageBitMap",(function(){return Vr})),r.d(i,"transportBgImageBitMap",(function(){return Nr})),r.d(i,"transportVBBgImageBitMap",(function(){return Lr})),r.d(i,"transportMaskImageBitMap",(function(){return Wr})),r.d(i,"MirrorSendVideo",(function(){return Ur})),r.d(i,"isSharingNotClearChromeVersion",(function(){return Fr})),r.d(i,"MEDIA_INIT_SUCCESS_CALLBACK_METADATA",(function(){return Br}));var a=r(15),n=r.n(a),o=r(13),s=r.n(o),u=r(5),d=r.n(u),c=r(10),h=r.n(c),l=r(7),p=r.n(l),f=r(8),m=r.n(f),v=r(4),g=r.n(v),S=r(28),_=r.n(S),C=r(19),y=r.n(C),b=r(24),A=r.n(b),k=r(16),E=r.n(k),w=r(35),I=r.n(w),D=r(36),M=r.n(D),R=r(11),x=r.n(R),P=r(1),T=0,O=3,V=0,N=2,L=3,W=r(12);function U(){this.ssrcQueueMap=new Map,U.prototype.AddQueue=function(e){var t=new W.a;return this.ssrcQueueMap.set(e,t),t},U.prototype.DeleteQueue=function(e){this.ssrcQueueMap.delete(e)},U.prototype.GetQueue=function(e){return this.ssrcQueueMap.get(e)},U.prototype.GetQueueData=function(e){return this.ssrcQueueMap.get(e).dequeue()},U.prototype.PutQueueData=function(e,t){this.ssrcQueueMap.get(e).enqueue(t)},U.prototype.GetQueueLength=function(e){var t=this.ssrcQueueMap.get(e);return null!==t?t.getLength():0}}var F=function(){this.frames=0,this.ntp=new W.a};F.prototype={UpdateVideoInfo:function(e){this.frames++,this.ntp.getLength()>30&&this.ntp.dequeue(),this.ntp.enqueue(e)},GetVideoFpsInfo:function(){var e=this.ntp.getLength();if(!(e<5)){for(var t=0,r=0,i=0,a=0,n=0;n<e;n++){var o=this.ntp.dequeue();0==o&&0==i?r++:0!=o?(a=0,0==i&&(i=o),t=o):0!=i&&t!=i&&0==o&&a++}return 0==t||t==i?0:e-r-a-1!=0?(t-i)/(e-r-a-1):0}}};var B=function(){this.ssrcInfoMap=new Map};function G(){this.ssrcQueueMap=new Map,this.ssrcInfo=new B,G.prototype.AddQueue=function(e){var t=new W.a;return this.ssrcQueueMap.set(e,t),t},G.prototype.DeleteQueue=function(e){this.ssrcQueueMap.delete(e)},G.prototype.GetQueue=function(e){return this.ssrcQueueMap.get(e)},G.prototype.ClearQueue=function(){this.ssrcQueueMap.clear()},G.prototype.GetQueueData=function(e){return this.ssrcQueueMap.get(e).dequeue()},G.prototype.PutQueueData=function(e,t){this.ssrcQueueMap.get(e).enqueue(t)},G.prototype.GetQueueLength=function(e){var t=this.ssrcQueueMap.get(e);return t?t.getLength():0},G.prototype.UpdateInfo=function(e,t){this.ssrcInfo.UpdateSSRCInfo(e,t)},G.prototype.GetFpsInfo=function(e){return this.ssrcInfo.GetSSRCFpsInfo(e)}}B.prototype={UpdateSSRCInfo:function(e,t){var r=this.ssrcInfoMap.get(e);r||(r=new F,this.ssrcInfoMap.set(e,r)),r.UpdateVideoInfo(t)},GetSSRCFpsInfo:function(e){var t=this.ssrcInfoMap.get(e);return t?t.GetVideoFpsInfo():0}};var H=function(){function e(){this.map=new Map,this.AudioQueueMGR=new U,this.timemap=new Map}return e.prototype.Add=function(e,t){this.map.set(e,t),this.AudioQueueMGR.AddQueue(e)},e.prototype.Clear=function(){this.map.clear()},e.prototype.Keys=function(){return this.map.keys()},e.prototype.UpdateSSRCTimeMap=function(e){this.timemap=e},e.prototype.GetSSRCTimeMap=function(e){return this.timemap?this.timemap.get(e):null},e}();function j(){this.map=new Map,this.VideoQueueMGR=new G}j.prototype.Add=function(e,t){this.map.set(e,t)},j.prototype.Clear=function(){this.map.clear()},j.prototype.Keys=function(){return this.map.keys()};var K=function(){this.frames=0,this.ntp=new W.a};K.prototype={UpdateSharingInfo:function(e){this.frames++,this.ntp.getLength()>30&&this.ntp.dequeue(),this.ntp.enqueue(e)},GetSharingFpsInfo:function(){var e=this.ntp.getLength();if(!(e<5)){for(var t=0,r=0,i=0,a=0,n=0;n<e;n++){var o=this.ntp.dequeue();0==o&&0==i?r++:0!=o?(a=0,0==i&&(i=o),t=o):0!=i&&t!=i&&0==o&&a++}return 0==t||t==i?0:e-r-a-1!=0?(t-i)/(e-r-a-1):0}}};var q=function(){this.ssrcInfoMap=new Map};function Q(){this.ssrcQueueMap=new Map,this.ssrcInfo=new q,Q.prototype.AddQueue=function(e){var t=new W.a;return this.ssrcQueueMap.set(e,t),t},Q.prototype.DeleteQueue=function(e){this.ssrcQueueMap.delete(e)},Q.prototype.GetQueue=function(e){return this.ssrcQueueMap.get(e)},Q.prototype.ClearQueue=function(){this.ssrcQueueMap.clear()},Q.prototype.GetQueueData=function(e){return this.ssrcQueueMap.get(e).dequeue()},Q.prototype.PutQueueData=function(e,t){this.ssrcQueueMap.get(e).enqueue(t)},Q.prototype.GetQueueLength=function(e){var t=this.ssrcQueueMap.get(e);return t?t.getLength():0},Q.prototype.UpdateInfo=function(e,t){this.ssrcInfo.UpdateSSRCInfo(e,t)},Q.prototype.GetFpsInfo=function(e){return this.ssrcInfo.GetSSRCFpsInfo(e)}}function z(){this.map=new Map,this.sQueue=new W.a,this.SharingQueueMGR=new Q}q.prototype={UpdateSSRCInfo:function(e,t){var r=this.ssrcInfoMap.get(e);r||(r=new K,this.ssrcInfoMap.set(e,r)),r.UpdateSharingInfo(t)},GetSSRCFpsInfo:function(e){var t=this.ssrcInfoMap.get(e);return t?t.GetSharingFpsInfo():0}},z.prototype.Clear=function(){this.map.clear()},z.prototype.Keys=function(){return this.map.keys()},z.prototype.Add=function(e,t){this.map.set(e,t)},z.prototype.Get=function(e){return this.map.get(e)},z.prototype.PutData=function(e){e&&this.sQueue&&this.sQueue.enqueue(e)},z.prototype.GetData=function(){if(this.sQueue)return this.sQueue.dequeue()},z.prototype.ClearBuffer=function(){this.sQueue&&(this.sQueue=new W.a)};var X,J=r(2),Y=r(14),Z=r(6),$=r(9),ee=r(0),te={MWCGLF:"WebGL context failed to be restored",VCFF:"Captured video format is not supported",SHHF:"Initialization of sharing decode WASM failed",SDSF:"Sharing decode WebSocket failed to connect after 10 attempts",SESF:"Initialization of sharing encode WASM failed",SEHF:"Sharing encode WebSocket failed to connect after 10 attempts",ADHF:"Initialization of audio decode WASM failed",ADSF:"Audio decode WebSocket failed to connect after 10 attempts",AEHF:"Initialization of audio encode WASM failed",AESF:"Audio encode WebSocket failed to connect after 10 attempts",VDHF:"Initialization of video decode WASM failed",VDSF:"Video decode WebSocket failed to connect after 10 attempts",VEHF:"Initialization of video encode WASM failed",VESF:"Video encode WebSocket failed to connect after 10 attempts",INITVDCERR:"An error occurred when initializing video WebRTC DataChannel",INITADCERR:"An error occurred when initializing audio WebRTC DataChannel"},re=function(){function e(){this.base_time=null,this.monitor="",this.last_get_monitor_time=0,this.checkIsNecessaryLogMap=new Map,this.highfrequencyerror=new Map}return e.prototype={init:function(){this.base_time||(this.base_time=(new Date).getTime(),this.checkIsNecessaryLogMap=new Map,this.add_monitor("STARTMONITOR"+this.base_time))},add_monitor:function(e,t){if(this.base_time||this.init(),e)try{if(te[e]){var r=te[e];t&&(r="".concat(r,". Additional information: ").concat(t)),Z.a.error(r)}var i=!1;"F"!=e[e.length-1]&&"f"!=e[e.length-1]||(i=!0);var a=(new Date).getTime()-this.base_time;this.monitor?this.monitor=this.monitor+e+"("+Math.ceil(a)+")":this.monitor=e+"("+Math.ceil(a)+")",this.monitor.length>2e3&&(i=!0),i&&this.send_instant_monitor()}catch(e){Z.a.error("Error when adding data to the monitor log",e)}},get_monitor:function(){var e=this.monitor,t=(new Date).getTime();return null!=e&&(e.length>80||t-this.last_get_monitor_time>180)?(this.last_get_monitor_time=t,this.monitor=null,"WCL_M, "+e):""},get_instant_monitor:function(){var e=this.monitor;return this.monitor=null,"WCL_M, "+e},send_instant_monitor:function(){var e=this.get_instant_monitor();e&&ee.a.sendMessageToRwg(P.fc,{evt:4167,seq:1,body:{data:e}})},add_monitor2:function(e){if(this.base_time||this.init(),e){var t=(new Date).getTime()-this.base_time;this.monitor?this.monitor=this.monitor+e+"("+t+")":this.monitor=e+"("+t+")"}},add_monitor3:function(e){(this.base_time||this.init(),e)&&(this.highfrequencyerror[e]?this.highfrequencyerror[e]+=1:this.highfrequencyerror[e]=1,Object(Z.b)(this.highfrequencyerror[e])&&this.add_monitor(e,"Occurred ".concat(this.highfrequencyerror[e]," times")))},checkIsNecessaryExceptionLogAndReturnRepeatTimes:function(e){var t=this,r=!0,i=0;try{return this.checkIsNecessaryLogMap.get(e)&&this.checkIsNecessaryLogMap.get(e)%100!=0&&(r=!1),{isNecessary:r,repeatNumber:void 0===(i=this.checkIsNecessaryLogMap.get(e))?0:i}}catch(e){return{isNecessary:!0,repeatNumber:0}}finally{var a=this.checkIsNecessaryLogMap.get(e)||0;if(this.checkIsNecessaryLogMap.set(e,a+1),this.checkIsNecessaryLogMap.size>200){var n=Array.from(this.checkIsNecessaryLogMap.keys()).slice(0,20);console.log("delete log cache keys",n),n.forEach((function(e){return t.checkIsNecessaryLogMap.delete(e)}))}}}},new e}(),ie=r(3),ae=["name","messageParams","direction"];function ne(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function oe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ne(Object(r),!0).forEach((function(t){h()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ne(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var se=Object(Y.a)("sdk.engine"),ue=J.g.isSupportVideoShareSend()&&J.g.isSupportVideoShareReceive();function de(e,t){return ce.apply(this,arguments)}function ce(){return(ce=d()(g.a.mark((function e(t,r){var i,a,n;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=t,e.next=e.t0===ie.f.VIDEO_ENCODE?3:e.t0===ie.f.VIDEO_DECODE?5:e.t0===ie.f.AUDIO_ENCODE?7:e.t0===ie.f.AUDIO_DECODE?9:e.t0===ie.f.SHARING_DECODE?11:e.t0===ie.f.SHARING_ENCODE?13:15;break;case 3:return i=ee.a.videoEncResponseText,e.abrupt("break",15);case 5:return i=ee.a.videoDecResponseText,e.abrupt("break",15);case 7:return i=ee.a.audioEncodeResponse,e.abrupt("break",15);case 9:return i=ee.a.audioDecodeResponse,e.abrupt("break",15);case 11:return i=ee.a.sharingDecodeResponse,e.abrupt("break",15);case 13:return i=ee.a.sharingEncodeResponse,e.abrupt("break",15);case 15:if(i){e.next=19;break}return e.next=18,le(r.workerJsFileUrl,r.integrityHelper);case 18:i=e.sent;case 19:return a="wasmUrl = '"+r.workerWasmFileUrl+"';","self.__wasmCodeDataEndFlag = 1;",n=/self\.__wasmCodeDataEndFlag\s*=\s*1[;|,]/,e.abrupt("return",i.replace(n,a+"self.__wasmCodeDataEndFlag = 1;"));case 23:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function he(){return(he=d()(g.a.mark((function e(t,r,i,a,n){var o,s,u;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!n||!n.isDestroy){e.next=3;break}return re.add_monitor("ZIDX",a),e.abrupt("return",se("WorkerType:".concat(a,";The relative SDK instance is destroy, don't start relative worker, avoid multiple same workers. ")));case 3:if(o={},ie.i[a]&&Object.assign(o,{name:ie.i[a]}),!1,a==ie.f.AUDIO_ENCODE?window.AEW&&(s=window.AEW):a==ie.f.AUDIO_DECODE&&window.ADW&&(s=window.ADW),s){e.next=23;break}return e.t0=window.URL,e.t1=Blob,e.next=12,de(a,t);case 12:e.t2=e.sent,e.t3=[e.t2],e.t4=new e.t1(e.t3),u=e.t0.createObjectURL.call(e.t0,e.t4),(s=new Worker(u,o)).addEventListener("error",(function(e){Z.a.error("Uncaught exception in worker of type ".concat(a),e)})),s.addEventListener("unhandledrejection",(function(e){Z.a.error("Unhandled Promise rejection in worker of type ".concat(a,": ").concat(e.reason))})),a===ie.f.VIDEO_ENCODE&&s.postMessage({command:"WORKER_BOLB_URL",blobUrl:u}),ee.a.mediaSDKHandle.is32bitbrowser&&(a==ie.f.AUDIO_ENCODE?window.AEW=s:a==ie.f.AUDIO_DECODE&&(window.ADW=s)),e.next=24;break;case 23:a==ie.f.AUDIO_ENCODE?window.AEWF=!0:a==ie.f.AUDIO_DECODE&&(window.ADWF=!0);case 24:r&&r.call(i,s);case 25:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function le(e,t){var r=null;return t&&(r=t.getIntegrity()),J.g.download(e,r)}function pe(e,t,r,i,a){var n=this;return new Promise((function(o,s){!function(e,t,r,i,a){he.apply(this,arguments)}(e,(function(e){var a=ee.a.SPECIAL_ID;t&&(re.add_monitor("WAM"+i),t.Add(a,e)),e.onmessage=function(e){r(e)},o()}),n,i,a)}))}function fe(e,t){var r=t.data;[me].forEach((function(t){try{t.call(null,e,r)}catch(e){Z.a.error("Error from allWorkersListener_AES_IV",e)}}))}function me(e,t){-1!==[ie.f.AUDIO_ENCODE,ie.f.VIDEO_ENCODE,ie.f.SHARING_ENCODE].indexOf(e)&&t.status===P.c&&(se("allWorkersListener_AES_IV",e,t),ee.a.Notify_APPUI_SAFE(P.d,{workerType:e,iv:J.g.buffer2stringSplitByComma(t.data)}))}function ve(e){var t=ee.a.userNodeList||[],r=e.concat(t);ee.a.userNodeList=J.g.removeDuplicates(r,(function(e,t){return e.userid!==t.userid})),[ie.f.AUDIO_ENCODE,ie.f.AUDIO_DECODE,ie.f.VIDEO_ENCODE,ie.f.VIDEO_DECODE,ie.f.SHARING_ENCODE,ie.f.SHARING_DECODE].forEach(function(){var e=d()(g.a.mark((function e(t){var r;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=t,e.next=e.t0===ie.f.AUDIO_ENCODE?3:e.t0===ie.f.AUDIO_DECODE?5:e.t0===ie.f.VIDEO_ENCODE?7:e.t0===ie.f.VIDEO_DECODE?9:e.t0===ie.f.SHARING_ENCODE?11:e.t0===ie.f.SHARING_DECODE?13:15;break;case 3:return r=ee.a.audioEncodeInitInstance,e.abrupt("break",15);case 5:return r=ee.a.audioDecInitInstance,e.abrupt("break",15);case 7:return r=ee.a.videoInitInstance,e.abrupt("break",15);case 9:return r=ee.a.videoDecInitInstance,e.abrupt("break",15);case 11:return r=ee.a.sharingEncInitInstance,e.abrupt("break",15);case 13:return r=ee.a.sharingDecInitInstance,e.abrupt("break",15);case 15:return e.prev=15,e.next=18,r.waitforInitSuccess();case 18:se("setUserNodeListToWorker init success",t),Dr(t,{userNodeList:ee.a.userNodeList},ie.d.SET_USER_NODE_LIST,!1,!0),e.next=25;break;case 22:e.prev=22,e.t1=e.catch(15),Z.a.error("Error when sending user node list to worker",e.t1);case 25:case"end":return e.stop()}}),e,null,[[15,22]])})));return function(t){return e.apply(this,arguments)}}())}function ge(e){ee.a.isAudioPlayWork=e}function Se(e){return _e.apply(this,arguments)}function _e(){return(_e=d()(g.a.mark((function e(t){return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ee.a.isVideoPlayWork=t,e.next=3,Dr(ie.f.VIDEO_DECODE,{isVideoPlayWork:t},"VideoPlayStatus",!1,!0);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ce(e){ee.a.isSharingPlayWork=e}var ye,be=(ye={SDK_TO_WORKER:"SDK_TO_WORKER",SDK_TO_WORKER_WAIT_OK:"SDK_TO_WORKER_WAIT_OK",SDK_TO_APP:"SDK_TO_APP",SDK_TO_SDK:"SDK_TO_SDK"},{nameMap:{INIT_VIDEO_ENCODE_SUCCESS:"INIT_VIDEO_ENCODE_SUCCESS",INIT_VIDEO_DECODE_SUCCESS:"INIT_VIDEO_DECODE_SUCCESS",CREATE_VIDEO_ENCODE_HANDLE_SUCCESS:"CREATE_VIDEO_ENCODE_HANDLE_SUCCESS",CREATE_VIDEO_DECODE_HANDLE_SUCCESS:"CREATE_VIDEO_DECODE_HANDLE_SUCCESS",CREATE_AUDIO_ENCODE_HANDLE_SUCCESS:"CREATE_AUDIO_ENCODE_HANDLE_SUCCESS",CREATE_AUDIO_DECODE_HANDLE_SUCCESS:"CREATE_AUDIO_DECODE_HANDLE_SUCCESS"},map:new Map,direction:ye,clear:function(){this.map.clear()},subscribeMessage:function(e){var t=this.map.get(e);t&&(t.forEach((function(e){var t=e.direction,r=e.messageParams,i=e.handler;if(t===ye.SDK_TO_APP)ee.a.Notify_APPUI.apply(ee.a,n()(r));else if(t===ye.SDK_TO_WORKER_WAIT_OK)Dr.apply(void 0,n()(r));else if(t===ye.SDK_TO_WORKER){var a=x()(r,2),o=a[0],s=a[1],u=Er(o);u&&u.postMessage(s)}else t===ye.SDK_TO_SDK&&i&&i(r)})),this.map.delete(e))},enqueueMessage:function(e){var t=e.name,r=e.messageParams,i=e.direction,a=M()(e,ae);this.map.has(t)||this.map.set(t,[]),this.map.get(t).push(oe({direction:i,messageParams:r||[]},a))}}),Ae={resetAudioEncode:function(e){!e&&ee.a.isPreviewMode.audioEncode&&(ee.a.isAudioEncodePostStart=!1),ee.a.isPreviewMode.audioEncode=!!e},resetAudioDecode:function(e){!e&&ee.a.isPreviewMode.audioDecode&&(ee.a.isAudioDecodePostStart=!1),ee.a.isPreviewMode.audioDecode=!!e},resetVideoEncode:function(e){!e&&ee.a.isPreviewMode.videoEncode&&(ee.a.isVideoEncodePostStart=!1),ee.a.isPreviewMode.videoEncode=!!e},resetVideoDecode:function(e){!e&&ee.a.isPreviewMode.videoDecode&&(ee.a.isVideoDecodePostStart=!1),ee.a.isPreviewMode.videoDecode=!!e}};function ke(e,t){return Ee.apply(this,arguments)}function Ee(){return(Ee=d()(g.a.mark((function e(t,r){var i;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ee.a.localVideoEncMGR||(ee.a.localVideoEncMGR=new j),ee.a.videoEncWorkerPath=t.workerJsFileUrl,e.next=4,le(t.workerJsFileUrl,t.integrityHelper);case 4:return i=e.sent,ee.a.videoEncResponseText=i,e.next=8,Et(0,null,r,t);case 8:return be.subscribeMessage(be.nameMap.CREATE_VIDEO_ENCODE_HANDLE_SUCCESS),e.next=11,At();case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function we(e,t){return Ie.apply(this,arguments)}function Ie(){return(Ie=d()(g.a.mark((function e(t,r){var i;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ee.a.localVideoDecMGR||(ee.a.localVideoDecMGR=new j),ee.a.videoDecWorkerPath=t.workerJsFileUrl,e.next=4,le(t.workerJsFileUrl,t.integrityHelper);case 4:return i=e.sent,ee.a.videoDecResponseText=i,e.next=8,yt(0,null,r,t);case 8:return be.subscribeMessage(be.nameMap.CREATE_VIDEO_DECODE_HANDLE_SUCCESS),e.next=11,_t();case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function De(e,t){return Me.apply(this,arguments)}function Me(){return(Me=d()(g.a.mark((function e(t,r){return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,rt();case 2:return ee.a.localAudioEncMGR||(ee.a.localAudioEncMGR=new H),ee.a.audioEncWorkerPath=t.workerJsFileUrl,e.next=6,le(t.workerJsFileUrl,t.integrityHelper);case 6:return ee.a.audioEncodeResponse=e.sent,e.next=9,Nt(0,r,t);case 9:return be.subscribeMessage(be.nameMap.CREATE_AUDIO_ENCODE_HANDLE_SUCCESS),e.next=12,Ot();case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Re(e,t){return xe.apply(this,arguments)}function xe(){return(xe=d()(g.a.mark((function e(t,r){return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,rt();case 2:return ee.a.localAudioDecMGR||(ee.a.localAudioDecMGR=new H),ee.a.audioDecWorkerPath=t.workerJsFileUrl,e.next=6,le(t.workerJsFileUrl,t.integrityHelper);case 6:return ee.a.audioDecodeResponse=e.sent,"string"==typeof ee.a.audioDecodeResponse?re.add_monitor("DAFL"+ee.a.audioDecodeResponse.length):re.add_monitor("DAFF"),e.next=10,Mt(0,null,r,t);case 10:return be.subscribeMessage(be.nameMap.CREATE_AUDIO_DECODE_HANDLE_SUCCESS),re.add_monitor("ADTS"),e.next=14,It();case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Pe(e,t){return Te.apply(this,arguments)}function Te(){return(Te=d()(g.a.mark((function e(t,r){return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ee.a.localSharingDecMGR||(ee.a.localSharingDecMGR=new z),ee.a.localMouseDecMGR||(ee.a.localMouseDecMGR=new z),ee.a.sharingDecWorkerPath=t.workerJsFileUrl,e.next=5,le(t.workerJsFileUrl,t.integrityHelper);case 5:return ee.a.sharingDecodeResponse=e.sent,e.next=8,et(r,t);case 8:return e.next=10,Ne();case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Oe(e,t){return Ve.apply(this,arguments)}function Ve(){return(Ve=d()(g.a.mark((function e(t,r){return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ee.a.localSharingEncMGR||(ee.a.localSharingEncMGR=new z),ee.a.sharingEncWorkerPath=t.workerJsFileUrl,e.next=4,le(t.workerJsFileUrl,t.integrityHelper);case 4:return ee.a.sharingEncodeResponse=e.sent,e.next=7,Ze(r,t);case 7:return e.next=9,We();case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ne(){return Le.apply(this,arguments)}function Le(){return(Le=d()(g.a.mark((function e(){var t;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ee.a.sharingDecInitInstance.wasmSuccessPromise;case 2:(t=ee.a.localSharingDecMGR.Get(ee.a.SPECIAL_ID))&&!ee.a.isSharingDecodePostStart&&(t.postMessage({command:"startMedia",websocket_ip_address:ee.a.Sharing_WebSocket_Ip_Address,confId:ee.a.localSharingPara.userid,confKey:"",logon:ee.a.localSharingPara.logon,meetingid:ee.a.localSharingPara.meetingid,meetingnumb:ee.a.localSharingPara.meetingnumb,multiThreadNum:1,enableReplaceCanvasWhenContextLost:ee.a.enableReplaceCanvasWhenContextLost}),ee.a.isSharingDecodePostStart=!0);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function We(){return Ue.apply(this,arguments)}function Ue(){return(Ue=d()(g.a.mark((function e(){var t,r;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ee.a.sharingEncInitInstance.wasmSuccessPromise;case 2:(t=ee.a.localSharingEncMGR.Get(ee.a.SPECIAL_ID))&&!ee.a.isSharingEncodePostStart&&(1,re.add_monitor2("STN1"),r=null,ee.a.ivObj&&(r=ee.a.ivObj[ie.f.SHARING_ENCODE],r=J.g.stringSplitByComma2Buffer(r)),t.postMessage({command:"startMedia",encode:!0,websocket_ip_address:ee.a.Sharing_WebSocket_Ip_Address,confId:ee.a.localSharingPara.userid,confKey:"",logon:ee.a.localSharingPara.logon,isChromeOrEdge:J.g.browser.isChrome,meetingid:ee.a.localSharingPara.meetingid,meetingnumb:ee.a.localSharingPara.meetingnumb,multiThreadNum:1,iv:r,uplimit:ee.a.uplimit}),ee.a.isSharingEncodePostStart=!0);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Fe(e){var t=e.data;ee.a.SPECIAL_ID;try{!function(){if(t.status===P.Ad)(function(e){try{var t=e.ssrcFromPDU;if(null==t)return!0;return(4294966272&ee.a.localSharingPara.userid)!=(4294966272&t)}catch(e){return!0}})(t.data)&&vt(t.data);else if(t.status===P.Hd)$.a.publish(P.Xc,{body:{width:t.logicWidth,height:t.logicHeight,logicWidth:t.logicWidth,logicHeight:t.logicHeight}}),ee.a.Notify_APPUI(P.Wc,{body:{width:t.logicWidth,height:t.logicHeight,logicWidth:t.logicWidth,logicHeight:t.logicHeight}});else if(t.status===P.Hb)ee.a.Notify_APPUI(P.Gb,t.ssrc);else if(t.status===P.Zc)re.add_monitor2(t.data);else if(t.status===P.Tc)re.add_monitor("FSF"),ee.a.Notify_APPUI(P.Uc,{ssrc:t.ssrc});else if(t.status===P.Nc)!function(e,t,r,i,a,n,o,s,u,d,c,h,l){if(!ee.a.isSharingPlayWork)return;var p={yuvdata:t,ntptime:r,ssrc:e,width:i,height:a,r_x:n,r_y:o,r_w:s,r_h:u,logic_w:d,logic_h:c,yuv_limited:h,isFromMainSession:l};ee.a.mediaSDKHandle.SharingRenderObj.Put_Sharing_Data_From_Queue(p)}(t.sharing_ssrc,t.data,t.sharing_timestamp,t.sharing_width,t.sharing_height,t.rendering_x,t.rendering_y,t.rendering_w,t.rendering_h,t.logic_w,t.logic_h,t.yuv_limited,t.isFromMainSession);else if(t.status===P.hc)!function(e,t,r,i,a,n,o,s,u,d){if(!ee.a.isSharingPlayWork)return;var c={buffer:t,ntptime:r,ssrc:e,width:i,height:a,r_x:n,r_y:o,mLogic_w:s,mLogic_h:u,sync_id:d};ee.a.mediaSDKHandle.SharingRenderObj.Put_Mouse_Data_Into_Queue(c)}(t.mouse_ssrc,t.data,t.mouse_timestamp,t.mouse_width,t.mouse_height,t.mouse_x,t.mouse_y,t.mLogic_w,t.mLogic_h,t.sync_id);else if(t.status===P.Pc)ee.a.Notify_APPUI(P.Oc,{ssrc:t.ssrc,size:t.size,fps:t.size});else if(t.status===P.fe){var r=oe({encoding:!1},t.data);ee.a.Notify_APPUI_SAFE(P.fe,r)}else if(t.status===P.Cd)re.add_monitor("SDWS"),ee.a.isSharingDecodeWASMOK=!0,ee.a.sharingDecInitInstance.setWasmSuccess();else if(t.status===P.Bd)re.add_monitor("SDWF"),ee.a.sharingDecInitInstance.setWasmSuccess(!1);else if(t.status===P.Gd)re.add_monitor("SDHS"),ee.a.sharingDecInitInstance.setHanderSuccess();else if(t.status===P.Fd)re.add_monitor("SHHF"),ee.a.sharingDecInitInstance.setHanderSuccess(!1);else if(t.status===P.Ed)re.add_monitor("SDSS"),ee.a.sharingDecInitInstance.setSocketSuccess();else if(t.status===P.Dd)re.add_monitor("SDSF"),ee.a.sharingDecInitInstance.isSocketInitSuccess()&&ee.a.Notify_APPUI_SAFE(P.we,null),ee.a.sharingDecInitInstance.setSocketSuccess(!1);else{if(t.status==P.gc)return void hr(t.data);if(t.status===P.yb){var i=ee.a.localSharingDecMGR.map.get(ee.a.SPECIAL_ID);qe(t.url,i)}else if(t.status==P.e)ee.a.monitorSharingDecodeAPPInfo=t,hr(ee.a.monitorSharingDecodeAPPInfo.data),ee.a.monitorSharingDecodeAPPInfo=null;else if(t.status==P.Qe)re.add_monitor("SD"+t.data);else if(61==t.status)Z.a.error("Error from sharing decode worker: ".concat(t.errorMessage),t.errorEvent);else if(t.status==P.jc)ee.a.Notify_APPUI(P.Se,{canvasId:t.canvasId,replaceCanvas:!!t.replaceCanvas});else if(t.status==P.Qc)ee.a.monitorDecodeSharing=t;else if(t.status==P.oe){var a=t.data;$.a.triggerSync(P.je,a)}else"SHARING_DECODE_PTR"==t.status?$.a.triggerSync("SHARING_DECODE_PTR",t):"WFMO"==t.status?Ke(ie.f.SHARING_DECODE):fe(ie.f.SHARING_DECODE,e)}}()}catch(e){se.error(e)}}function Be(e){var t=e.data;ee.a.SPECIAL_ID;try{!function(){if(t.status===P.Ad)vt(t.data);else if(t.status===P.Vc)re.add_monitor("GIDF");else if(t.status===P.Cd)re.add_monitor("SEWS"),ee.a.isSharingEncodeWASMOK=!0,ee.a.sharingEncInitInstance.setWasmSuccess();else if(t.status===P.Bd)re.add_monitor("SEWF"),ee.a.sharingEncInitInstance.setWasmSuccess(!1);else if(t.status===P.Gd)re.add_monitor("SEHS"),ee.a.sharingEncInitInstance.setHanderSuccess();else if(t.status===P.Fd)re.add_monitor("SEHF"),ee.a.sharingEncInitInstance.setHanderSuccess(!1);else if(t.status===P.Ed)re.add_monitor("SESS"),ee.a.sharingEncInitInstance.setSocketSuccess();else if(t.status===P.Dd)re.add_monitor("SEWF"),ee.a.sharingEncInitInstance.isSocketInitSuccess()&&ee.a.Notify_APPUI_SAFE(P.we,null),ee.a.sharingEncInitInstance.setSocketSuccess(!1);else if(t.status==P.Mc)re.add_monitor2("SCFOK");else if(t.status==P.Kd)re.add_monitor("SCFF"+t.format);else if(t.status==P.xe)ee.a.mediaSDKHandle.isSupportVideoTrackReader?(ee.a.mediaSDKHandle.canISendNextSharingFrame=!0,ee.a.mediaSDKHandle.Process_Sharing()):ee.a.mediaSDKHandle.Process_Sharing();else if(t.status==P.df)ee.a.mediaSDKHandle.Process_Sharing();else if(t.status===P.nb)ee.a.Notify_APPUI(P.mb,{width:t.width,height:t.height});else{if(t.status==P.gc)return void hr(t.data);if(t.status==P.yb){var r=ee.a.localSharingEncMGR.map.get(ee.a.SPECIAL_ID);qe(t.url,r)}else if(t.status===P.fe){var i=oe({encoding:!0},t.data);ee.a.Notify_APPUI_SAFE(P.fe,i)}else t.status==P.e?(ee.a.monitorSharingEncodeAPPInfo=t,hr(ee.a.monitorSharingEncodeAPPInfo.data),ee.a.monitorSharingEncodeAPPInfo=null):t.status==P.Qe?re.add_monitor("SE"+t.data):t.status==P.jc?ee.a.Notify_APPUI(P.Se,{canvasId:t.canvasId,replaceCanvas:!!t.replaceCanvas}):61==t.status?Z.a.error("Error from sharing encode worker: ".concat(t.errorMessage),t.errorEvent):t.status==P.We?ee.a.Notify_APPUI(P.Me,{data:t.data}):"WFMO"==t.status?Ke(ie.f.SHARING_ENCODE):fe(ie.f.SHARING_ENCODE,e)}}()}catch(e){se.error(e)}}function Ge(e){var t=e.data,r=(ee.a.SPECIAL_ID,!0);try{!function(){if(t.status===P.ie);else if("NewActiveSpeakerFirstframeCallback"===t.status)ee.a.Notify_APPUI(P.mc,{ssrc:t.ssrc});else if(t.status===P.se)ee.a.Notify_APPUI(P.rb,{width:t.width,height:t.height});else if(t.status===P.oe){var i=t.data;$.a.triggerSync(P.je,i)}else if(t.status===P.Ye){var a=ee.a.mediaSDKHandle.videoDecodeFrameBackSABRingBufferConsumer;a&&a.consumeAll(ee.a.mediaSDKHandle.bVideoDecodeFrameBackSABRingBufferConsumeCopyData)}else if(t.status===P.re)re.add_monitor2(t.data);else if(t.status==P.jc)re.add_monitor("MWGLF"),ee.a.Notify_APPUI(P.Se,{canvasId:t.canvasId,replaceCanvas:!!t.replaceCanvas});else if(t.status==P.Re)re.add_monitor("MWCGLF");else if(t.status===P.le){var n=t.data;$.a.triggerSync(P.je,n)}else if(0===t.status)gt(t.video_ssrc,t.data,t.video_timestamp,t.video_width,t.video_height,t.rendering_x,t.rendering_y,t.rendering_w,t.rendering_h,t.rotation,t.yuv_limited);else if(t.status===P.Be)re.add_monitor("VDWS"),ee.a.isVideoDecodeWASMOK=!0,ee.a.videoDecInitInstance.setWasmSuccess(),ee.a.videoDecInitInstance.setSocketSuccess(),ee.a.isPreviewMode.videoDecode&&ee.a.Notify_APPUI_SAFE(P.uc);else if(t.status===P.tb){var o=t.size;J.g.isGoogleNestChrome()&&(o=o<=2?o:2),ee.a.Notify_APPUI(P.ke,{ssrc:t.ssrc,size:o}),re.add_monitor("VDMS:"+o)}else if(t.status===P.Ae)re.add_monitor("VDWF"),ee.a.videoDecInitInstance.setWasmSuccess(!1);else if(t.status===P.ze)re.add_monitor("VDHS"),ee.a.videoDecInitInstance.setHanderSuccess();else if(t.status===P.ye)re.add_monitor("VDHF"),ee.a.videoDecInitInstance.setHanderSuccess(!1);else if(t.status===P.De)re.add_monitor("VDSS");else if(t.status===P.Ce)re.add_monitor("VDSF"),ee.a.videoDecInitInstance.isSocketInitSuccess()&&ee.a.Notify_APPUI_SAFE(P.we,null),ee.a.videoDecInitInstance.setSocketSuccess(!1);else if(t.status===P.hb)re.add_monitor("VDWPS");else if(t.status===P.gb)re.add_monitor("VDWPCLOSE"),ee.a.sendMessageToRwg(P.Fc,{evt:P.ff,body:{flag:2,type:ie.h.ZOOM_CONNECTION_VIDEO}},!1);else if(t.status===P.fb)re.add_monitor("VDWSCLOSE");else if(t.status===P.pb)re.add_monitor("VDTTP:"+t.type);else if(t.status==P.gc)ee.a.monitorDecodeVideo=t,hr(t.data),r=!1;else if(t.status==P.e)ee.a.monitorVideoDecodeAPPInfo=t,ee.a.sendMessageToRwg(P.fc,{evt:4167,seq:1,body:{data:ee.a.monitorVideoDecodeAPPInfo.data}}),ee.a.monitorVideoDecodeAPPInfo=null;else if(t.status==P.yb){var s=ee.a.localVideoDecMGR.map.get(ee.a.SPECIAL_ID);qe(t.url,s)}else if(t.status==P.Qe)re.add_monitor("VD"+t.data);else if(61==t.status)Z.a.error("Error from video decode worker: ".concat(t.errorMessage),t.errorEvent);else if(t.status===P.lb)ee.a.Notify_APPUI_SAFE(P.lb,t.data);else if(t.status===P.kb)ee.a.Notify_APPUI_SAFE(P.kb,t.data);else if(t.status===P.qe){var u=oe({encoding:!1},t.data);ee.a.Notify_APPUI_SAFE(P.qe,u)}else t.status===P.Jb?re.add_monitor(t.data):"VIDEO_DECODE_PTR"===t.status?$.a.triggerSync("VIDEO_DECODE_PTR",t):"FIRST_VIDEO_FRAME"===t.status?(ee.a.Notify_APPUI_SAFE(P.Ib),re.add_monitor("FVF")):t.status===P.lc?ee.a.Notify_APPUI_SAFE(P.lc,{isUplink:t.isUplink,networkLevel:t.networkLevel,bwLevel:t.bwLevel}):"WFMO"==t.status?Ke(ie.f.VIDEO_DECODE):fe(ie.f.VIDEO_DECODE,e)}()}catch(e){se.error(e)}r&&ue&&Fe(e)}function He(e){var t=e.data,r=(ee.a.SPECIAL_ID,!0);if(t!==P.Ze){try{!function(){if(t.status===P.ie);else if("VBPredictDone"===t.status)re.add_monitor("VBPOK"+t.predictCostTime),ee.a.isPreviewMode.videoEncode&&be.enqueueMessage({name:be.nameMap.INIT_VIDEO_ENCODE_SUCCESS,messageParams:[P.ee,null],direction:be.direction.SDK_TO_APP}),ee.a.Notify_APPUI(P.ee,null);else if("VBPredictAbout3s"===t.status)re.add_monitor("VBP3S"),ee.a.Notify_APPUI(P.de,null);else if("VBPredictAbout10s"===t.status)re.add_monitor("VBP10S"),ee.a.Notify_APPUI(P.ce,null);else if(t.status===P.oe){var i=t.data;$.a.triggerSync(P.je,i)}else if(0===t.status);else if(t.status===P.He||t.status===P.Be)re.add_monitor("VEWS"),ee.a.isVideoEncodeWASMOK=!0,ee.a.videoInitInstance.setWasmSuccess();else if(t.status===P.Ge)re.add_monitor("VEWF"),ee.a.videoInitInstance.setWasmSuccess(!1);else if(t.status===P.Fe||P.ze===t.status)re.add_monitor("VEHS"),ee.a.videoInitInstance.setHanderSuccess();else if(t.status===P.Ee||P.ye===t.status)re.add_monitor("VEHF"),ee.a.videoInitInstance.setHanderSuccess(!1);else if(t.status===P.Je||P.De===t.status)re.add_monitor("VESS"),ee.a.videoInitInstance.setSocketSuccess();else if(t.status===P.Ie||t.status===P.Ce)re.add_monitor("VESF"),ee.a.videoInitInstance.isSocketInitSuccess()&&ee.a.Notify_APPUI_SAFE(P.we,null),ee.a.videoInitInstance.setSocketSuccess(!1);else if(t.status===P.hb)re.add_monitor("VEWPS");else if(t.status===P.gb)re.add_monitor("VEWPCLOSE");else if(t.status===P.fb)re.add_monitor("VEWSCLOSE");else if(t.status===P.pb)re.add_monitor("VETTP:"+t.type);else if(t.status===P.ob)re.add_monitor("VEHORS:"+t.type);else if(t.status===P.xe)ee.a.mediaSDKHandle.Process_Video();else if(t.status===P.jb)ee.a.Notify_APPUI(P.ib,{width:t.width,height:t.height});else if(t.status===P.ge)re.add_monitor("VCRC"+t.width),ee.a.mediaSDKHandle.Change_Video_Capture_Resolution(t.width,t.height);else if(t.status==P.he)re.add_monitor2("VCFOK");else if(t.status==P.Ld)re.add_monitor("VCFF","format: ".concat(t.format));else{if(t.status==P.gc)return r=!1,void hr(t.data);if(t.status==P.e)ee.a.monitorVideoEncodeAPPInfo=t,hr(ee.a.monitorVideoEncodeAPPInfo.data),ee.a.monitorVideoEncodeAPPInfo=null;else if(t.status==P.Qc)ee.a.monitorEncodeSharing=t;else if(t.status===P.yb){var a=ee.a.localVideoEncMGR.map.get(ee.a.SPECIAL_ID);qe(t.url,a)}else if(t.status==P.Qe)re.add_monitor("VE"+t.data);else if(61==t.status)Z.a.error("Error from video encode worker: ".concat(t.errorMessage),t.errorEvent);else if(t.status==P.Id){var n=ee.a.SPECIAL_ID;if(ee.a.localVideoDecMGR)(o=ee.a.localVideoDecMGR.map.get(n))&&o.postMessage({command:"encodedbuffer",wasmMemory:t.wasmMemory})}else if(t.status==P.Le){var o,s=ee.a.SPECIAL_ID;if(ee.a.localVideoDecMGR)(o=ee.a.localVideoDecMGR.map.get(s))&&o.postMessage({command:"encodedimagebitmapwasmptr",data:t.data,wasmMemory:t.wasmMemory});else ee.a.isPreviewMode.videoEncode&&be.enqueueMessage({name:be.nameMap.INIT_VIDEO_DECODE_SUCCESS,messageParams:[ie.f.VIDEO_DECODE,{command:"encodedimagebitmapwasmptr",data:t.data,wasmMemory:t.wasmMemory}],direction:be.direction.SDK_TO_WORKER})}else if(t.status===P.qe){var u=oe({encoding:!0},t.data);ee.a.Notify_APPUI_SAFE(P.qe,u)}else if(t.status===P.fe){var d=oe({encoding:!0},t.data);ee.a.Notify_APPUI_SAFE(P.fe,d)}else t.status==P.jc?ee.a.Notify_APPUI(P.Se,{canvasId:t.canvasId,replaceCanvas:!!t.replaceCanvas}):"VIDEO_ENCODE_PTR"===t.status?$.a.triggerSync("VIDEO_ENCODE_PTR",t):t.status===P.Ke?ee.a.mediaSDKHandle.init_Notify_APPUI(!0,ie.f.VIDEO_ENCODE):t.status==P.te?ee.a.mediaSDKHandle.Change_Sharing_Capture_Resolution(t.mode):t.status===P.lc?ee.a.Notify_APPUI_SAFE(P.lc,{isUplink:t.isUplink,networkLevel:t.networkLevel,bwLevel:t.bwLevel}):"WFMO"==t.status?Ke(ie.f.VIDEO_ENCODE):fe(ie.f.VIDEO_ENCODE,e)}}()}catch(e){se.error(e)}r&&ue&&Be(e)}else{var i=ee.a.mediaSDKHandle.videoEncodeRingbufferConsumer;i&&i.consumeAll()}}function je(e,t){return new WebAssembly.Memory({initial:e,maximum:t,shared:!0})}function Ke(e){var t,r,i=!1,a=J.g.isIphoneOrIpadBrowser()?4096:8192,n=ee.a.mediaSDKHandle.is32bitbrowser||!J.g.isChromeVersionHigherThan(90)||J.g.isChromeOS();(e==ie.f.VIDEO_ENCODE?(r=ee.a.localVideoEncMGR.map.get(0),window.VE?(i=!0,t=window.VE):(ue&&(a=16384),t=je(1024,a),n&&(window.VE=t))):e==ie.f.VIDEO_DECODE?(r=ee.a.localVideoDecMGR.map.get(0),window.VD?(i=!0,t=window.VD):(ue&&(a=16384),t=je(1024,a),n&&(window.VD=t))):e==ie.f.SHARING_ENCODE?(r=ee.a.localSharingEncMGR.map.get(0),window.SE?(i=!0,t=window.SE):(t=je(1024,a),n&&(window.SE=t))):e==ie.f.SHARING_DECODE&&(r=ee.a.localSharingDecMGR.map.get(0),window.SD?(i=!0,t=window.SD):(t=je(1024,a),n&&(window.SD=t))),i)&&new Uint8Array(t.buffer).fill(0);r.postMessage({command:"wasmMemory",data:t})}function qe(e,t){J.g.downloadBinary(e).then((function(e){t.postMessage({command:"DOWNLOAD_WASM_FROM_MAIN_THREAD_OK",data:e})})).catch((function(e){t.postMessage({command:"DOWNLOAD_WASM_FROM_MAIN_THREAD_FAILED",data:e})}))}var Qe,ze,Xe=(Qe={send:null,recv:null},ze=null,{push:function(e){var t=e.log,r=e.isSend;t&&(-1===t.indexOf("SPEECHOUTPUT")&&-1===t.indexOf("SPEECHINPUT")||(r?Qe.send=t:Qe.recv=t,this._clearTImer(),ze=setTimeout((function(){if(Qe.send||Qe.recv){var e=/(WCL_MCM_AUDIO)(.*?)(\d+)(.*?)(\{\[SPEECHOUTPUT\]\})(.*?)(\{\[NETWORK\]\})(.*?)(\{\[END\]\})/.exec(Qe.send||"")||[],t=/(WCL_MCM_AUDIO)(.*?)(\d+)(.*?)(\d+)(.*?)(\{\[SPEECHINPUT\]\})(.*?)(\{\[SEND\]\})(.*?)(\{\[DENOISE\]\})(.*?)(\{\[END\]\})/.exec(Qe.recv||"")||[],r="".concat(e[1]||t[1]).concat(e[2]||t[2]||"").concat(e[3]||t[3]).concat(e[4]||t[6]||""),i=(t[8]||",-1,-1,-1,").trim(),a=(e[6]||",-1,-1,-1,").trim();","===i[i.length-1]&&","===a[0]?i=i.slice(0,i.length-1):","!==i[i.length-1]&&","!==a[0]&&(i+=",");var n="".concat(t[5]||"",",{[SPEECH]}").concat(i).concat(a,"{[NETWORK]}").concat(e[8]||",-1,-1,-1,","{[SEND]}").concat(t[10]||",-1,-1,","{[DENOISE]}").concat(t[12]||",-1,-1,-1","{[END]}"),o="".concat(r).concat(n);ee.a.sendMessageToRwg(P.fc,{evt:4167,seq:1,body:{data:o}})}}),2e3)))},_clearTImer:function(){clearTimeout(ze),ze=null},clear:function(){Qe={send:null,recv:null},this._clearTImer()}});function Je(e){var t=e.data;ee.a.SPECIAL_ID;try{!function(){if(0===t.status)t.time?ee.a.AudioNode&&ee.a.AudioNode.postData("data",{ssrc:ee.a.CurrentSSRC,data:t.data,time:t.time}):ee.a.AudioNode&&ee.a.AudioNode.postData("data",{ssrc:ee.a.CurrentSSRC,data:t.data,time:null});else if(t.status===P.K||t.status===P.F)re.add_monitor("ADWS"),ee.a.isAudioDecodeWASMOK=!0,ee.a.audioDecInitInstance.setWasmSuccess(),ee.a.isPreviewMode.audioDecode&&ee.a.Notify_APPUI_SAFE(P.tc);else if(t.status===P.E)re.add_monitor("ADWF"),ee.a.audioDecInitInstance.setWasmSuccess(!1);else if(t.status===P.D)re.add_monitor("ADHS"),ee.a.audioDecInitInstance.setHanderSuccess();else if(t.status===P.C)re.add_monitor("ADHF"),ee.a.audioDecInitInstance.setHanderSuccess(!1);else if(t.status===P.H)re.add_monitor("ADSS"),ee.a.audioDecInitInstance.setSocketSuccess();else if(t.status===P.G)re.add_monitor("ADSF"),ee.a.audioDecInitInstance.isSocketInitSuccess()&&ee.a.Notify_APPUI_SAFE(P.z,null),ee.a.audioDecInitInstance.setSocketSuccess(!1);else if(t.status===P.hb)re.add_monitor("ADWPS");else if(t.status===P.gb)re.add_monitor("ADWPCLOSE"),ee.a.sendMessageToRwg(P.Fc,{evt:P.ff,body:{flag:2,type:ie.h.ZOOM_CONNECTION_AUDIO}},!1);else if(t.status===P.fb)re.add_monitor("ADWSCLOSE");else if(t.status===P.pb)re.add_monitor("ADTTP:"+t.type);else if(t.status==P.gc)ee.a.monitorDecodeAudio=t;else if(t.status===P.yb){var r=ee.a.localAudioDecMGR.map.get(ee.a.SPECIAL_ID);qe(t.url,r)}else if(t.status==P.Qe)re.add_monitor("AD"+t.data);else if(61==t.status)Z.a.error("Error from audio decode worker: ".concat(t.errorMessage),t.errorEvent);else if(t.status==P.qb)t.at&&ee.a.CurrentSSRCTime!==t.at&&(ee.a.CurrentSSRCTime=t.at,ee.a.audioPlayTime=Date.now()),t.st&&ee.a.mediaSDKHandle.SharingRenderObj&&ee.a.mediaSDKHandle.SharingRenderObj.SetcATimeStamp(t.st);else if("multiCurrentTime"==t.status){if(ee.a.localVideoDecMGR){var i=ee.a.localVideoDecMGR.map.get(ee.a.SPECIAL_ID);i&&i.postMessage({command:"audioDecodeTime",data:t.data,status:1})}}else if(t.status==P.n)$.a.triggerSync(P.k,t.data);else if(t.status===P.r)Xe.push({log:t.data,isSend:!0});else if(t.status===P.t){var a=oe({encoding:!1},t.data);ee.a.Notify_APPUI_SAFE(P.t,a)}else"AUDIO_WASM_INFO"===t.status?ee.a.audioWasmInfo=t.data:fe(ie.f.AUDIO_DECODE,e)}()}catch(e){se.error(e)}}function Ye(e){if(ee.a.localAudioDecMGR||ee.a.isPreviewMode.audioEncode)try{!function(){var t=e.data;if(t.status===P.Xe){var r=ee.a.mediaSDKHandle.audioEncodeRingBufferConsumer;r&&r.consumeAll(!0)}else if(0==t.status){var i=ee.a.SPECIAL_ID,a=ee.a.localAudioDecMGR.map.get(i);a&&a.postMessage({command:"EncodedAudioFrame",data:t.data},[t.data.buffer])}else if(t.status==P.n)$.a.triggerSync(P.k,t.data);else if(t.status===P.K||t.status===P.F)re.add_monitor("AEWS"),ee.a.isAudioEncodeWASMOK=!0,ee.a.audioEncodeInitInstance.setWasmSuccess();else if(t.status===P.J||t.status===P.E)re.add_monitor("AEWF"),ee.a.audioEncodeInitInstance.setWasmSuccess(!1);else if(t.status===P.D)re.add_monitor("AEHS"),ee.a.audioEncodeInitInstance.setHanderSuccess();else if(t.status===P.H)re.add_monitor("AESS"),ee.a.audioEncodeInitInstance.setSocketSuccess();else if(t.status===P.G)re.add_monitor("AESF"),ee.a.audioEncodeInitInstance.isSocketInitSuccess()&&ee.a.Notify_APPUI_SAFE(P.z,null),ee.a.audioEncodeInitInstance.setSocketSuccess(!1);else if(t.status===P.C)re.add_monitor("AEHF"),ee.a.audioEncodeInitInstance.setHanderSuccess(!1);else if(t.status===P.I)ee.a.Notify_APPUI_SAFE(P.I,null);else if(t.status===P.hb)re.add_monitor("AEWPS");else if(t.status===P.gb)re.add_monitor("AEWPCLOSE");else if(t.status===P.fb)re.add_monitor("AEWSCLOSE");else if(t.status===P.pb)re.add_monitor("AETTP:"+t.type);else if(t.status===P.M)ee.a.Notify_APPUI&&ee.a.Notify_APPUI(P.A,null);else if(t.status===P.l)ee.a.indexDbObject.put(t.delay,"delay"),ee.a.openIndexFlag&&ee.a.indexDbObject.select("delay");else if(t.status===P.yb){var n=ee.a.localAudioEncMGR.map.get(ee.a.SPECIAL_ID);qe(t.url,n)}else if(t.status==P.Qe)-1!=t.data.indexOf("WCL_DEVICEINFO")?hr(t.data):re.add_monitor("AE"+t.data);else if(61==t.status)Z.a.error("Error from audio encode worker: ".concat(t.errorMessage),t.errorEvent);else if(t.status==P.j);else if(t.status===P.r)Xe.push({log:t.data,isSend:!1});else if(t.status===P.t){var o=oe({encoding:!0},t.data);ee.a.Notify_APPUI_SAFE(P.t,o)}else t.status===P.L?ee.a.mediaSDKHandle.init_Notify_APPUI(!0,ie.f.AUDIO_ENCODE):"AUDIO_WASM_INFO"===t.status?ee.a.audioWasmInfo=t.data:t.status===P.ad?ee.a.Notify_APPUI_SAFE(P.ad):fe(ie.f.AUDIO_ENCODE,e)}()}catch(e){se.error(e)}}function Ze(e,t){return $e.apply(this,arguments)}function $e(){return($e=d()(g.a.mark((function e(t,r){return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t||!t.isDestroy){e.next=2;break}return e.abrupt("return",se("WorkerType:sharingEnc;The relative SDK instance is destroy, don't start relative worker, avoid multiple same workers. "));case 2:if(ee.a.isSharingEncodeThreadStart){e.next=6;break}return ee.a.isSharingEncodeThreadStart=!0,e.next=6,pe(r,ee.a.localSharingEncMGR,Be,ie.f.SHARING_ENCODE,t);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function et(e,t){return tt.apply(this,arguments)}function tt(){return(tt=d()(g.a.mark((function e(t,r){return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t||!t.isDestroy){e.next=2;break}return e.abrupt("return",se("WorkerType:sharingDec;The relative SDK instance is destroy, don't start relative worker, avoid multiple same workers. "));case 2:if(ee.a.isSharingDecodeThreadStart){e.next=6;break}return ee.a.isSharingDecodeThreadStart=!0,e.next=6,pe(r,ee.a.localSharingDecMGR,Fe,ie.f.SHARING_DECODE,t);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function rt(){return it.apply(this,arguments)}function it(){return(it=d()(g.a.mark((function e(){var t,r,i,a;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=J.g.browser.isSafari&&J.g.getMacSafariMajorVersion()<16,ee.a.sharedBuffer||!J.g.isSupportSharedArrayBuffer()||t||(se("LP2PSP"),r=1,(J.g.browser.isFirefox||48e3===J.g.getAudioContextConfigure().sampleRate)&&(r=48),i=J.g.isSupportMicSendStereo()?2:1,a=J.g.isSupportSharingStereo()?2:1,ee.a.sharedBuffer={inputState:new SharedArrayBuffer(24),inputBuffer:new SharedArrayBuffer(640*r*4*4*i),sharingInputState:new SharedArrayBuffer(24),sharingInputBuffer:new SharedArrayBuffer(640*r*4*4*a),outputState:new SharedArrayBuffer(24),outputBuffer:new SharedArrayBuffer(640*r*4*4*2),rtpBuffer:new SharedArrayBuffer(120008)}),re.add_monitor("INITSAB"+!!ee.a.sharedBuffer),ee.a.decoderinworklet=ee.a.decoderinworkletOP&&ee.a.sharedBuffer;case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function at(e,t){var r;ee.a.localSharingPara?Object.assign(ee.a.localSharingPara,t):ee.a.localSharingPara=t,r=e,ee.a.Sharing_WebSocket_Ip_Address=r}function nt(e,t){ee.a.localAudioPara?Object.assign(ee.a.localAudioPara,t):ee.a.localAudioPara=t,st(e)}function ot(e,t){ee.a.localVideoPara?Object.assign(ee.a.localVideoPara,t):ee.a.localVideoPara=t,dt(e)}function st(e){ee.a.Audio_WebSocket_Ip_Address=e}function ut(e){ee.a.Audio_Web_Transport_Ip_Address=e}function dt(e){ee.a.Video_WebSocket_Ip_Address=e}function ct(e){ee.a.Video_Web_Transport_Ip_Address=e}function ht(){!function(e){if(e=ee.a.SPECIAL_ID,ee.a.localAudioEncMGR){var t=ee.a.localAudioEncMGR.map.get(e);t&&(t.postMessage({command:"closeMedia"}),ee.a.localAudioEncMGR.map.delete(e)),ee.a.isAudioEncodePostStart=!1}}(ee.a.SPECIAL_ID),function(e){if(e=ee.a.SPECIAL_ID,ee.a.localAudioDecMGR){var t=ee.a.localAudioDecMGR.map.get(ee.a.SPECIAL_ID);t&&(t.postMessage({command:"closeMedia"}),ee.a.localAudioDecMGR.map.delete(e)),ee.a.isAudioDecodePostStart=!1}}(ee.a.SPECIAL_ID),ee.a.localAudioDecMGR=null,ee.a.localAudioEncMGR=null}function lt(){!function(e){if(e=ee.a.SPECIAL_ID,ee.a.localVideoDecMGR){var t=ee.a.localVideoDecMGR.map.get(e);t&&(t.postMessage({command:"closeMedia"}),ee.a.localVideoDecMGR.map.delete(e)),ee.a.isVideoDecodePostStart=!1}}(ee.a.SPECIAL_ID),ee.a.localVideoDecMGR=null,ee.a.localVideoEncMGR=null}function pt(){!function(){var e=ee.a.SPECIAL_ID;if(ee.a.localSharingDecMGR){var t=ee.a.localSharingDecMGR.Get(e);t&&(t.postMessage({command:"closeMedia"}),ee.a.localSharingDecMGR=null),ee.a.isSharingDecodeThreadStart=!1}}()}function ft(e,t,r,i,a){if(ee.a.localVideoEncMGR){var n=ee.a.localVideoEncMGR.map.get(e);if(n){var o={command:"encodeVideoFrame",data:t,stride:r,x:i,y:a};n.postMessage(o,[o.data.buffer])}}}function mt(e,t,r,i,a,n){var o,s;(o=ue?ee.a.localVideoEncMGR.map.get(e):ee.a.localSharingEncMGR.map.get(e))&&(t?(s={command:"encodeSharingFrame",data:t,width:a,height:n},o.postMessage(s,[s.data.buffer])):(s={command:"encodeSharingFrame"},o.postMessage(s)))}function vt(e){ee.a.localSharingDecMGR&&("sharingPara"==e.type&&(re.add_monitor("SHPA"),$.a.publish(P.Xc,e.data),ee.a.Notify_APPUI(P.Wc,e.data)),ee.a.isSharingPlayWork&&ee.a.localSharingDecMGR.PutData(e))}function gt(e,t,r,i,a,n,o,s,u,d,c){if(ee.a.isVideoPlayWork){var h={yuvdata:t,ntptime:r,ssrc:e,width:i,height:a,r_x:n,r_y:o,r_w:s,r_h:u,rotation:d,yuv_limited:c};h.ssrc=h.ssrc>>10<<10,ee.a.mediaSDKHandle.VideoRenderObj.Put_Video_Data_Queue(h,15)}}function St(){return ee.a.localSharingDecMGR?ee.a.localSharingDecMGR.SharingQueueMGR.ClearQueue():ee.a.localMouseDecMGR?ee.a.localMouseDecMGR.SharingQueueMGR.ClearQueue():0}function _t(){return Ct.apply(this,arguments)}function Ct(){return(Ct=d()(g.a.mark((function e(){var t,r;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!ee.a.isPreviewMode.videoDecode){e.next=2;break}return e.abrupt("return");case 2:if(ee.a.localVideoDecMGR){e.next=4;break}return e.abrupt("return");case 4:return e.next=6,ee.a.videoDecInitInstance.wasmSuccessPromise;case 6:(t=ee.a.localVideoDecMGR.map.get(ee.a.SPECIAL_ID))&&!ee.a.isVideoDecodePostStart&&(ee.a.isVideoDecodePostStart=!0,r=oe(oe({command:"startMedia",websocket_ip_address:ee.a.Video_WebSocket_Ip_Address+"&mode=5",confId:ee.a.localVideoPara.confId,confKey:"",logon:ee.a.localVideoPara.logon,mtu_size:0,meetingid:ee.a.localVideoPara.meetingid,meetingnumb:ee.a.localVideoPara.meetingnumb,videoencodethreadnumb:1,videodecodethreadnumb:ee.a.localVideoPara.videodecodethreadnumb,isFirefox:ee.a.localVideoPara.isFirefox,isSupportMultiThread:ee.a.localVideoPara.isSupportMultiThread,isSupportVideoTrackReader:ee.a.localVideoPara.isSupportVideoTrackReader,isSupportOffscreenCanvas:ee.a.localVideoPara.isSupportOffscreenCanvas,isenablehw:ee.a.localVideoPara.isenablehw,isEnableVideoDecodeHardWareThread:ee.a.localVideoPara.isEnableVideoDecodeHardWareThread,qoson:ee.a.localVideoPara.qoson,isEnableHardWareThread:ee.a.localVideoPara.isEnableHardWareThread,isTeslaMode:ee.a.localVideoPara.isTeslaMode,enableMultiDecodeVideoWithoutSAB:!!ee.a.enableMultiDecodeVideoWithoutSAB,enableReplaceCanvasWhenContextLost:ee.a.enableReplaceCanvasWhenContextLost},ee.a.Video_Web_Transport_Ip_Address?{webtransportURL:ee.a.Video_Web_Transport_Ip_Address+"&mode=1"}:{}),{},{enableAudioBridge:ee.a.enableAudioBridge}),t.postMessage(r),ee.a.isVideoDecodePostStart=!0);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function yt(e,t,r,i){return bt.apply(this,arguments)}function bt(){return(bt=d()(g.a.mark((function e(t,r,i,a){return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!i||!i.isDestroy){e.next=2;break}return e.abrupt("return",se("WorkerType:videoDec;The relative SDK instance is destroy, don't start relative worker, avoid multiple same workers. "));case 2:if(ee.a.isVideoDecodeThreadStart){e.next=6;break}return ee.a.isVideoDecodeThreadStart=!0,e.next=6,pe(a,ee.a.localVideoDecMGR,Ge,ie.f.VIDEO_DECODE,i);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function At(){return kt.apply(this,arguments)}function kt(){return(kt=d()(g.a.mark((function e(){var t,r,i,a;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ee.a.localVideoEncMGR){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,ee.a.videoInitInstance.wasmSuccessPromise;case 4:(t=ee.a.localVideoEncMGR.map.get(ee.a.SPECIAL_ID))&&!ee.a.isVideoEncodePostStart&&(ee.a.isVideoEncodePostStart=!0,r=0,r="firefox"===J.g.browserType.browser?1080:1070,ee.a.mediaSDKHandle.mtu_size=r,i=null,ee.a.ivObj&&(i=ee.a.ivObj[ie.f.VIDEO_ENCODE],i=J.g.stringSplitByComma2Buffer(i)),a=oe(oe({command:"startMedia",websocket_ip_address:ee.a.Video_WebSocket_Ip_Address+"&mode=2",confId:ee.a.localVideoPara.confId,confKey:"",logon:ee.a.localVideoPara.logon,sendvideo:!0,isChromeOrEdge:J.g.browser.isChrome,mtu_size:r,meetingid:ee.a.localVideoPara.meetingid,meetingnumb:ee.a.localVideoPara.meetingnumb,videoencodethreadnumb:ee.a.localVideoPara.videoencodethreadnumb,iv:i,videodecodethreadnumb:ee.a.localVideoPara.videodecodethreadnumb,isSupportMultiThread:ee.a.localVideoPara.isSupportMultiThread,qoson:ee.a.localVideoPara.qoson,isSupportVirtualBackground:ee.a.localVideoPara.isSupportVirtualBackground,uplimit:ee.a.uplimit,isSupportWebCodecEnocde:ee.a.localVideoPara.isSupportWebCodecEnocde,initWebCodecFlag:ee.a.localVideoPara.initWebCodecFlag,is360penablehw:ee.a.localVideoPara.is360penablehw,enable720p:ee.a.localVideoPara.enable720p,enableReplaceCanvasWhenContextLost:ee.a.enableReplaceCanvasWhenContextLost,isPreviewMode:ee.a.isPreviewMode.videoEncode},ee.a.Video_Web_Transport_Ip_Address?{webtransportURL:ee.a.Video_Web_Transport_Ip_Address+"&mode=2"}:{}),{},{enableAudioBridge:ee.a.enableAudioBridge,platformType:ee.a.localVideoPara.platformType}),t.postMessage(a),ee.a.tfjsurl&&t.postMessage({command:"DOWNLOAD_JSON_FROM_MAIN_THREAD_OK",data:ee.a.tfjsurl,type:"js"}),ee.a.vbbin&&ee.a.vbjson&&t.postMessage({command:"DOWNLOAD_JSON_FROM_MAIN_THREAD_OK",data:{bin:ee.a.vbbin,json:ee.a.vbjson},index:0}),ee.a.afnbin&&ee.a.afnjson&&(t.postMessage({command:"DOWNLOAD_JSON_FROM_MAIN_THREAD_OK",data:{bin:ee.a.afnbin,json:ee.a.afnjson},index:1}),ee.a.basebin&&ee.a.basejson&&t.postMessage({command:"DOWNLOAD_JSON_FROM_MAIN_THREAD_OK",data:{bin:ee.a.basebin,json:ee.a.basejson},index:2})));case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Et(e,t,r,i){return wt.apply(this,arguments)}function wt(){return(wt=d()(g.a.mark((function e(t,r,i,a){return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!i||!i.isDestroy){e.next=2;break}return e.abrupt("return",se("WorkerType:videoEnc;The relative SDK instance is destroy, don't start relative worker, avoid multiple same workers. "));case 2:if(ee.a.localVideoEncMGR){e.next=4;break}return e.abrupt("return");case 4:if(ee.a.isVideoEncodeThreadStart){e.next=8;break}return ee.a.isVideoEncodeThreadStart=!0,e.next=8,pe(a,ee.a.localVideoEncMGR,He,ie.f.VIDEO_ENCODE,i);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function It(){return Dt.apply(this,arguments)}function Dt(){return(Dt=d()(g.a.mark((function e(){var t,r,i;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!ee.a.isPreviewMode.audioDecode){e.next=3;break}return re.add_monitor("ZISA"),e.abrupt("return");case 3:return t=ee.a.localAudioDecMGR.map.get(ee.a.SPECIAL_ID),window.ADWF&&t.postMessage({command:"RIWM"}),r=ee.a.localAudioPara.videodecodethreadnumb>1,e.next=8,ee.a.audioDecInitInstance.wasmSuccessPromise;case 8:if(t&&!ee.a.isAudioDecodePostStart){if(ee.a.isAudioDecodePostStart=!0,i=oe({command:"startMedia",websocket_ip_address:ee.a.Audio_WebSocket_Ip_Address+"&mode=5",sampleRate:ee.a.localAudioPara.sampleRate,userid:ee.a.localAudioPara.userid,logon:ee.a.localAudioPara.logon,decode:1,meetingid:ee.a.localAudioPara.meetingid,meetingnumb:ee.a.localAudioPara.meetingnumb,videodecodethreadnumb:ee.a.localAudioPara.videodecodethreadnumb,isSupportMultiThread:ee.a.localAudioPara.isSupportMultiThread,qoson:ee.a.localAudioPara.qoson,decoderInWorklet:ee.a.decoderinworklet,multiView:r,audioDecodeChannelsNum:J.g.isSupportPlayStereo()?2:1,shouldNotChangeSampleRate:J.g.browser.isFirefox||J.g.browser.isSafari},ee.a.Audio_Web_Transport_Ip_Address?{webtransportURL:ee.a.Audio_Web_Transport_Ip_Address+"&mode=1"}:{}),re.add_monitor("ADSM"),t.postMessage(i),ee.a.sharedBuffer){se("post audioDec sab");try{t.postMessage({command:"sharedBuffer",data:ee.a.sharedBuffer})}catch(e){t.postMessage({command:"sharedBuffer",data:ee.a.sharedBuffer},[ee.a.sharedBuffer])}}}else re.add_monitor("ADSME"+!!t+!!ee.a.isAudioDecodePostStart);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Mt(e,t,r,i){return Rt.apply(this,arguments)}function Rt(){return(Rt=d()(g.a.mark((function e(t,r,i,a){return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(re.add_monitor("AADT"),!i||!i.isDestroy){e.next=4;break}return re.add_monitor("ZID"),e.abrupt("return",se("WorkerType:audioDec;The relative SDK instance is destroy, don't start relative worker, avoid multiple same workers. "));case 4:if(ee.a.isAudioDecodeThreadStart){e.next=8;break}return ee.a.isAudioDecodeThreadStart=!0,e.next=8,pe(a,ee.a.localAudioDecMGR,Je,ie.f.AUDIO_DECODE,i);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function xt(e){if(e>>=10,ee.a.localAudioDecMGR){var t=ee.a.localAudioDecMGR.GetSSRCTimeMap(e);return null===t?0:t}}function Pt(e){return{currentSSRCTime:ee.a.CurrentSSRCTime,audioPlayTime:ee.a.audioPlayTime}}function Tt(e,t){var r=ee.a.SPECIAL_ID,i=ee.a.localVideoDecMGR.map.get(r);i.postMessage({command:"failover",websocket_ip_address:t}),(i=ee.a.localAudioDecMGR.map.get(r)).postMessage({command:"failover",websocket_ip_address:e})}function Ot(){return Vt.apply(this,arguments)}function Vt(){return(Vt=d()(g.a.mark((function e(){var t,r,i;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=ee.a.localAudioEncMGR.map.get(ee.a.SPECIAL_ID),window.AEWF&&t.postMessage({command:"RIWM"}),e.next=4,ee.a.audioEncodeInitInstance.wasmSuccessPromise;case 4:if(t&&!ee.a.isAudioEncodePostStart&&(ee.a.isAudioEncodePostStart=!0,r=null,ee.a.ivObj&&(r=ee.a.ivObj[ie.f.AUDIO_ENCODE],r=J.g.stringSplitByComma2Buffer(r)),i=oe({command:"startMedia",websocket_ip_address:ee.a.Audio_WebSocket_Ip_Address+"&mode=2",sampleRate:ee.a.localAudioPara.sampleRate,userid:ee.a.localAudioPara.userid,encode:1,meetingid:ee.a.localAudioPara.meetingid,meetingnumb:ee.a.localAudioPara.meetingnumb,iv:r,qoson:ee.a.localAudioPara.qoson,shouldNotChangeSampleRate:J.g.browser.isFirefox||J.g.browser.isSafari,isPreviewMode:ee.a.isPreviewMode.audioEncode,audioEncodeChannelsNum:J.g.isSupportMicSendStereo()?2:1},ee.a.Audio_Web_Transport_Ip_Address?{webtransportURL:ee.a.Audio_Web_Transport_Ip_Address+"&mode=2"}:{}),t.postMessage(i),ee.a.sharedBuffer)){se("post audioEnc sab");try{t.postMessage({command:"sharedBuffer",data:ee.a.sharedBuffer})}catch(e){t.postMessage({command:"sharedBuffer",data:ee.a.sharedBuffer},[ee.a.sharedBuffer])}}case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Nt(e,t,r){return Lt.apply(this,arguments)}function Lt(){return(Lt=d()(g.a.mark((function e(t,r,i){return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!r||!r.isDestroy){e.next=2;break}return e.abrupt("return",se("WorkerType:audioEnc;The relative SDK instance is destroy, don't start relative worker, avoid multiple same workers. "));case 2:if(ee.a.isAudioEncodeThreadStart){e.next=6;break}return ee.a.isAudioEncodeThreadStart=!0,e.next=6,pe(i,ee.a.localAudioEncMGR,Ye,ie.f.AUDIO_ENCODE,r);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Wt(e){for(var t,r=ee.a.SPECIAL_ID,i=ee.a.audio_pcm_queue.dequeue();i;)i=ee.a.audio_pcm_queue.dequeue();ee.a.localAudioEncMGR&&(t=ee.a.localAudioEncMGR.map.get(r))&&ee.a.isAudioEncodePostStart&&t.postMessage({command:"modifySampleRate",sampleRate:e}),ee.a.localAudioDecMGR&&(t=ee.a.localAudioDecMGR.map.get(r))&&ee.a.isAudioDecodePostStart&&t.postMessage({command:"modifySampleRate",sampleRate:e})}function Ut(e,t,r){var i;(e=ee.a.SPECIAL_ID,ee.a.localAudioDecMGR)&&((i=ee.a.localAudioDecMGR.map.get(e))&&i.postMessage({command:"mute",bOn:t,fakeLeave:r}));ee.a.localAudioEncMGR&&((i=ee.a.localAudioEncMGR.map.get(e))&&i.postMessage({command:"mute",bOn:t,fakeLeave:r}))}function Ft(e,t){var r;(e=ee.a.SPECIAL_ID,ee.a.localAudioDecMGR)&&((r=ee.a.localAudioDecMGR.map.get(e))&&r.postMessage({command:"AecFlag",flag:t}));ee.a.localAudioEncMGR&&((r=ee.a.localAudioEncMGR.map.get(e))&&r.postMessage({command:"AecFlag",flag:t}))}function Bt(e,t){var r,i=ee.a.SPECIAL_ID;ee.a.localAudioDecMGR&&((r=ee.a.localAudioDecMGR.map.get(i))&&r.postMessage({command:"decodeAudioPort"},[e.port2]));ee.a.localAudioEncMGR&&((r=ee.a.localAudioEncMGR.map.get(i))&&r.postMessage({command:"encodeAudioPort"},[t.port1]))}function Gt(e,t){var r=ee.a.SPECIAL_ID;if(ee.a.localVideoDecMGR){var i=ee.a.localVideoDecMGR.map.get(r);i&&i.postMessage({command:"decodeVideoPort"},[e.port1])}if(ee.a.localVideoEncMGR){var a=ee.a.localVideoEncMGR.map.get(r);a&&a.postMessage({command:"encodeVideoPort"},[t.port2])}}function Ht(e,t){var r=ee.a.SPECIAL_ID;if(ee.a.localVideoDecMGR){var i=ee.a.localVideoDecMGR.map.get(r);i&&i.postMessage({command:"vsport"},[e.port1])}if(ee.a.localVideoEncMGR){var a=ee.a.localSharingDecMGR.map.get(r);a&&a.postMessage({command:"vsport"},[t.port2])}}function jt(e){var t=ee.a.SPECIAL_ID;if(ee.a.localAudioDecMGR){var r=ee.a.localAudioDecMGR.map.get(t);r&&r.postMessage({command:"decodeAudioPort2"},[e.port2])}}function Kt(e){var t=ee.a.SPECIAL_ID;if(ee.a.localAudioEncMGR){var r=ee.a.localAudioEncMGR.map.get(t);r&&r.postMessage({command:"shareAudioDecodeAudioPort2"},[e.port2])}}function qt(e){var t=ee.a.SPECIAL_ID;if(ee.a.localVideoDecMGR){var r=ee.a.localVideoDecMGR.map.get(t);r&&r.postMessage({command:"decodeVideoPortWithAudio",port:e.port1},[e.port1])}}function Qt(e){var t=ee.a.SPECIAL_ID;if(ee.a.localVideoEncMGR){var r=ee.a.localVideoEncMGR.map.get(t);r&&r.postMessage(e)}}function zt(e,t){var r=ee.a.SPECIAL_ID;if(ee.a.localVideoEncMGR){var i=ee.a.localVideoEncMGR.map.get(r);i&&i.postMessage({command:e,data:t},[t])}}function Xt(e){var t=ee.a.SPECIAL_ID;if(ee.a.localVideoDecMGR){var r=ee.a.localVideoDecMGR.map.get(t);r&&r.postMessage(e)}}function Jt(e,t){var r=ee.a.SPECIAL_ID;if(ee.a.localVideoEncMGR){var i=ee.a.localVideoEncMGR.map.get(r);i&&i.postMessage({command:e,data:t},[t])}}function Yt(e,t){var r=ee.a.SPECIAL_ID;if(ee.a.localSharingEncMGR){var i=ee.a.localSharingEncMGR.map.get(r);i&&i.postMessage({command:e,data:t},[t])}}function Zt(e){if(ee.a.localVideoDecMGR){var t=ee.a.localVideoDecMGR.map.get(ee.a.SPECIAL_ID);t&&t.postMessage(e)}}function $t(e){var t=ee.a.SPECIAL_ID;if(ee.a.localSharingDecMGR){var r=ee.a.localSharingDecMGR.map.get(t);r&&r.postMessage(e)}}function er(e){var t=ee.a.SPECIAL_ID;if(ee.a.localAudioDecMGR){var r=ee.a.localAudioDecMGR.map.get(t);r&&r.postMessage({command:"updateCurrentSSRC",SSRC:e})}}function tr(e){var t=ee.a.SPECIAL_ID;if(ee.a.localAudioEncMGR){var r=ee.a.localAudioEncMGR.map.get(t);r&&r.postMessage(e)}}function rr(e){var t=ee.a.SPECIAL_ID;if(ee.a.localAudioDecMGR){var r=ee.a.localAudioDecMGR.map.get(t);r&&r.postMessage(e)}}function ir(e){var t={command:"interpretation_enable",enable:e};tr(t),ee.a.decoderinworklet?ee.a.workletWasmInitSuccess?ee.a.AudioNode.postCMD("interpretation_enable",t):ee.a.interpretationMessage.enqueue(t):rr(t)}function ar(e){tr({command:"cc_set_lang",lang:e})}function nr(e){var t={command:"interpretation_set_lang",lang:e};tr(t),ee.a.decoderinworklet?ee.a.workletWasmInitSuccess?ee.a.AudioNode.postCMD("interpretation_set_lang",t):ee.a.interpretationMessage.enqueue(t):rr(t)}function or(e){var t={command:"interpretation_mute_origin",mute:e};tr(t),ee.a.decoderinworklet?ee.a.workletWasmInitSuccess?ee.a.AudioNode.postCMD("interpretation_mute_origin",t):ee.a.interpretationMessage.enqueue(t):rr(t)}function sr(e){var t={command:"interpretation_set_interpreter",interpreterList:e};tr(t),ee.a.decoderinworklet?ee.a.workletWasmInitSuccess?ee.a.AudioNode.postCMD("interpretation_set_interpreter",t):ee.a.interpretationMessage.enqueue(t):rr(t)}function ur(){var e=ee.a.SPECIAL_ID;if(ee.a.localAudioEncMGR){var t=ee.a.localAudioEncMGR.map.get(e);t&&t.postMessage({command:"resetAec"})}}function dr(){var e=ee.a.SPECIAL_ID,t=20;if(ee.a.audioDelay&&(t=ee.a.audioDelay),ee.a.localAudioEncMGR){var r=ee.a.localAudioEncMGR.map.get(e);r&&r.postMessage({command:"SetAECDelay",delay:t})}}function cr(e){try{if(re&&e){var t=["ERR:",e.message,"f"].join(""),r=re.checkIsNecessaryExceptionLogAndReturnRepeatTimes(t);r.isNecessary?(se("error repeat ".concat(r.repeatNumber),t),re.add_monitor(t+"(repeat:".concat(r.repeatNumber,")"))):se("error but ignore",e.message)}}catch(e){se("_listenWindowErrorEvent error",e)}}function hr(e){ee.a.sendMessageToRwg(P.fc,{evt:4167,seq:1,body:{data:e}})}function lr(){re.init(),window.addEventListener("error",cr),function(){try{re.add_monitor(["BSAGT:",navigator.userAgent].join("")),re.add_monitor("BSLITEND:"+(J.g.isLittleEndian()?1:0)),window.navigator.hardwareConcurrency&&re.add_monitor("OSCPUS:"+window.navigator.hardwareConcurrency)}catch(e){}}(),ee.a.monitorIntervalHandle=setInterval((function(){var e,t=re.get_monitor();(t&&hr(t),null!=ee.a.monitorEncodeVideo||null!=ee.a.monitorDecodeVideo||null!=ee.a.monitorVideoCapture||null!=ee.a.monitorEncodeSharing||null!=ee.a.monitorDecodeSharing||null!=ee.a.monitorSharingEncodeAPPInfo||null!=ee.a.monitorVideoDecodeAPPInfo||null!=ee.a.monitorVideoEncodeAPPInfo)&&(null!=ee.a.monitorVideoCapture&&(e=function(e,t){if(t<=0)return e;for(var r=0;r<t;r++)e+=",";return e}(e="WCL_CAMERA,"+ee.a.monitorVideoUserID+",0,,"+ee.a.monitorVideoCapture+",,"+ee.a.monitorVideoReadyCaptureWidth+","+ee.a.monitorVideoReadyCaptureHeight,3),hr(e+=",{[END]}"),ee.a.monitorVideoCapture=null),null!=ee.a.monitorSharingEncodeAPPInfo&&(hr(ee.a.monitorSharingEncodeAPPInfo.data),ee.a.monitorSharingEncodeAPPInfo=null),null!=ee.a.monitorVideoDecodeAPPInfo&&(hr(ee.a.monitorVideoDecodeAPPInfo.data),ee.a.monitorVideoDecodeAPPInfo=null),null!=ee.a.monitorVideoEncodeAPPInfo&&(hr(ee.a.monitorVideoEncodeAPPInfo.data),ee.a.monitorVideoEncodeAPPInfo=null))}),1e4)}function pr(e){re.add_monitor2(e)}function fr(){window.removeEventListener("error",cr),clearInterval(ee.a.monitorIntervalHandle),re.send_instant_monitor()}function mr(e){var t=ee.a.SPECIAL_ID;if(ee.a.localVideoEncMGR){var r=ee.a.localVideoEncMGR.map.get(t);r&&r.postMessage({command:"ENCRYPT",encrypt:e})}}function vr(e){var t=ee.a.SPECIAL_ID;if(ee.a.localSharingEncMGR){var r=ee.a.localSharingEncMGR.Get(t);r&&r.postMessage({command:"ENCRYPT",encrypt:e})}}function gr(e){if(ee.a.localVideoEncMGR){var t=ee.a.localVideoEncMGR.map.get(ee.a.SPECIAL_ID);t&&t.postMessage(e)}}function Sr(e){if(ee.a.localSharingEncMGR){var t=ee.a.localSharingEncMGR.map.get(ee.a.SPECIAL_ID);t&&t.postMessage(e)}}function _r(e){if(ee.a.localVideoEncMGR){var t=ee.a.localVideoEncMGR.map.get(ee.a.SPECIAL_ID);t&&t.postMessage(e)}}function Cr(e){if(ee.a.localSharingEncMGR){var t=ee.a.localSharingEncMGR.map.get(ee.a.SPECIAL_ID);t&&t.postMessage(e)}}function yr(e){var t=ee.a.SPECIAL_ID;if(ee.a.localAudioEncMGR){var r=ee.a.localAudioEncMGR.map.get(t);r&&r.postMessage({command:"ENCRYPT",encrypt:e})}}function br(){var e=ee.a.SPECIAL_ID;[ee.a.localAudioDecMGR,ee.a.localAudioEncMGR,ee.a.localVideoDecMGR,ee.a.localVideoEncMGR,ee.a.localSharingDecMGR,ee.a.localSharingEncMGR].forEach((function(t){t&&t.map.get(e)&&t.map.get(e).postMessage({command:"SOCKET_RECONNECT",disable:!0})}))}function Ar(){var e=ee.a.SPECIAL_ID;[ee.a.localVideoDecMGR,ee.a.localVideoEncMGR,ee.a.localSharingDecMGR,ee.a.localSharingEncMGR].forEach((function(t){t&&t.map.get(e)&&t.map.get(e).postMessage({command:"closeMedia"})}))}function kr(){var e=ee.a.SPECIAL_ID,t=[ee.a.localVideoDecMGR,ee.a.localVideoEncMGR,ee.a.localSharingDecMGR,ee.a.localSharingEncMGR];t.forEach((function(t){t&&t.map.get(e)&&t.map.get(e).terminate()})),t=[ee.a.localAudioDecMGR,ee.a.localAudioEncMGR],ee.a.mediaSDKHandle.is32bitbrowser?t.forEach((function(t){t&&t.map.get(e)&&t.map.get(e).postMessage({command:"closeMedia"})})):t.forEach((function(t){t&&t.map.get(e)&&t.map.get(e).terminate()}))}function Er(e){var t;switch(e){case ie.f.AUDIO_DECODE:t=ee.a.localAudioDecMGR;break;case ie.f.AUDIO_ENCODE:t=ee.a.localAudioEncMGR;break;case ie.f.VIDEO_DECODE:t=ee.a.localVideoDecMGR;break;case ie.f.VIDEO_ENCODE:t=ee.a.localVideoEncMGR;break;case ie.f.SHARING_DECODE:t=ee.a.localSharingDecMGR;break;case ie.f.SHARING_ENCODE:t=ee.a.localSharingEncMGR}var r=ee.a.SPECIAL_ID;return t&&t.map.get(r)?t.map.get(r):null}function wr(e){return Ir.apply(this,arguments)}function Ir(){return(Ir=d()(g.a.mark((function e(t){return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=t,e.next=e.t0===ie.f.VIDEO_ENCODE?3:e.t0===ie.f.VIDEO_DECODE?6:e.t0===ie.f.AUDIO_ENCODE?9:e.t0===ie.f.AUDIO_DECODE?12:e.t0===ie.f.SHARING_ENCODE?15:e.t0===ie.f.SHARING_DECODE?18:21;break;case 3:return e.next=5,ee.a.videoInitInstance.initSuccessPromise;case 5:return e.abrupt("break",23);case 6:return e.next=8,ee.a.videoDecInitInstance.initSuccessPromise;case 8:return e.abrupt("break",23);case 9:return e.next=11,ee.a.audioEncodeInitInstance.initSuccessPromise;case 11:return e.abrupt("break",23);case 12:return e.next=14,ee.a.audioDecInitInstance.initSuccessPromise;case 14:return e.abrupt("break",23);case 15:return e.next=17,ee.a.sharingEncInitInstance.initSuccessPromise;case 17:return e.abrupt("break",23);case 18:return e.next=20,ee.a.sharingDecInitInstance.initSuccessPromise;case 20:return e.abrupt("break",23);case 21:return Z.a.error("No matched worker type: ".concat(t)),e.abrupt("break",23);case 23:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Dr(e,t){return Mr.apply(this,arguments)}function Mr(){return(Mr=d()(g.a.mark((function e(t,r){var i,a,n,o,s=arguments;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=s.length>2&&void 0!==s[2]?s[2]:"PUSH_MESSAGE_FROM_MAIN_TO_WORKER",a=s.length>3&&void 0!==s[3]&&s[3],!(n=s.length>4&&void 0!==s[4]&&s[4])){e.next=6;break}return e.next=6,wr(t);case 6:if(o=Er(t)){e.next=17;break}if(n){e.next=13;break}return se("worker handle not ready, drop!",t,r,i),e.abrupt("return",!1);case 13:if(se.warn("worker handle not ready, waiting!",t,r,i),o=Er(t)){e.next=17;break}return e.abrupt("return");case 17:return a?o.postMessage({command:i,data:r},[r]):o.postMessage({command:i,data:r}),e.abrupt("return",!0);case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Rr(){return null!==Er(ie.f.VIDEO_ENCODE)}function xr(e,t,r){var i=ee.a.SPECIAL_ID;if(ee.a.localVideoEncMGR){var a=ee.a.localVideoEncMGR.map.get(i);a&&(e?a.postMessage({command:t,canvas:e,rendercanvasID:r},[e]):a.postMessage({command:t,canvas:e,rendercanvasID:r}))}}function Pr(e){var t;return t=new e({storeOptions:{nameSpaceId:"vbFile"}}),new Promise((function(e,r){t.on("ready",(function(){e(t)}))}))}function Tr(e,t,r){return window.crypto.subtle.decrypt({name:"AES-GCM",iv:r},t,e)}function Or(e,t){var r={};(ee.a.resourceManager?Promise.resolve(ee.a.resourceManager):Pr(t)).then((function(t){ee.a.resourceManager=t;for(var i,a,n=function(t){"bin"==e[t].type?ee.a.resourceManager.getFile(e[t].path,{saveRootPath:e[t].path,downloadOptions:{xhrParams:{headers:r,url:e[t].path,encoding:"arraybuffer",method:"GET"}}}).getResult().then((function(r){re.add_monitor("VDBIN"),ee.a.vbarraybuffer=r.data;try{e[t].path.indexOf("dual")>=0&&(i=r.data,a=new Uint8Array(i,0,12),n=new Uint8Array(i,12,32),window.crypto.subtle.importKey("raw",n,"AES-GCM",!0,["encrypt","decrypt"]).then((function(e){var t=a.length+n.length,r=new Uint32Array(i.slice(t,t+4))[0];t+=4;var o=i.slice(t,t+r);t+=r,r=new Uint32Array(i.slice(t,t+4))[0],t+=4;var s=new Uint8Array(i,t,r);t+=r,r=new Uint32Array(i.slice(t,t+4))[0],t+=4;var u=i.slice(t,t+r);t+=r,r=new Uint32Array(i.slice(t,t+4))[0],t+=4;var d=new Uint8Array(i,t,r);ee.a.basebin=o,ee.a.afnbin=u,Tr(d,e,a).then((function(e){ee.a.afnjson=(new TextDecoder).decode(e);var t=ee.a.SPECIAL_ID;if(ee.a.localVideoEncMGR){var r=ee.a.localVideoEncMGR.map.get(t);r&&ee.a.afnbin&&ee.a.afnjson&&r.postMessage({command:"DOWNLOAD_JSON_FROM_MAIN_THREAD_OK",data:{bin:ee.a.afnbin,json:ee.a.afnjson},index:1})}})),Tr(s,e,a).then((function(e){ee.a.basejson=(new TextDecoder).decode(e);var t=ee.a.SPECIAL_ID;if(ee.a.localVideoEncMGR){var r=ee.a.localVideoEncMGR.map.get(t);r&&ee.a.basebin&&ee.a.basejson&&r.postMessage({command:"DOWNLOAD_JSON_FROM_MAIN_THREAD_OK",data:{bin:ee.a.basebin,json:ee.a.basejson},index:2})}}))})))}catch(e){Z.a.error("An error occurred when decrypting the virtual background file",e),re.add_monitor("VBDECRYPTF"),ee.a.Notify_APPUI(P.ve,4)}var i,a,n})).catch((function(e){Z.a.error("An error occurred when trying to obtain the virtual background file",e),re.add_monitor("VBFF"),ee.a.Notify_APPUI(P.ve,4)})):"js"==e[t].type&&(re.add_monitor("VDTF"),ee.a.tfjsurl=e[t].path,i=ee.a.SPECIAL_ID,ee.a.localVideoEncMGR&&(a=ee.a.localVideoEncMGR.map.get(i))&&a.postMessage({command:"DOWNLOAD_JSON_FROM_MAIN_THREAD_OK",data:ee.a.tfjsurl,type:"js"}))},o=0;o<e.length;o++)n(o)}))}function Vr(e){var t=ee.a.SPECIAL_ID;if(ee.a.localVideoEncMGR){var r=ee.a.localVideoEncMGR.map.get(t);r&&(e?r.postMessage({command:"imagebitmap",data:e},[e]):r.postMessage({command:"imagebitmap"}))}}function Nr(e,t){var r=ee.a.SPECIAL_ID;if(ee.a.localVideoEncMGR){var i=ee.a.localVideoEncMGR.map.get(r);i&&(e?i.postMessage({command:"maskandbgimagebitmap",imagename:t,data:e},[e]):i.postMessage({command:"maskandbgimagebitmap",imagename:t,data:e}))}}function Lr(e,t){var r=ee.a.SPECIAL_ID;if(ee.a.localVideoEncMGR){var i=ee.a.localVideoEncMGR.map.get(r);i&&(e?i.postMessage({command:"vbbgimagebitmap",imagename:t,data:e},[e]):i.postMessage({command:"vbbgimagebitmap",imagename:t,data:e}))}}function Wr(e,t,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,n=ee.a.SPECIAL_ID;if(ee.a.localVideoEncMGR){var o=ee.a.localVideoEncMGR.map.get(n);o&&(e?o.postMessage({command:"maskandbgimagebitmap",imagename:t,data:e,maskCoordinate:r,width:i,height:a},[e]):o.postMessage({command:"maskandbgimagebitmap",imagename:t,data:e,maskCoordinate:r,width:i,height:a}))}}function Ur(e){var t=ee.a.SPECIAL_ID;if(ee.a.localVideoDecMGR){var r=ee.a.localVideoDecMGR.map.get(t);r&&r.postMessage(e)}}function Fr(){try{return J.g.browser.isChrome&&-1!==["85","86"].indexOf(J.g.getBrowserVersion())}catch(e){return se(e),!1}}var Br=(X={},h()(X,ie.f.VIDEO_ENCODE,{success:P.Rb,failed:P.Ob,callbackDataValue:ie.c.encode}),h()(X,ie.f.VIDEO_DECODE,{success:P.Rb,failed:P.Ob,callbackDataValue:ie.c.decode}),h()(X,ie.f.AUDIO_ENCODE,{success:P.Pb,failed:P.Mb,callbackDataValue:ie.c.encode}),h()(X,ie.f.AUDIO_DECODE,{success:P.Pb,failed:P.Mb,callbackDataValue:ie.c.decode}),h()(X,ie.f.SHARING_DECODE,{success:P.Qb,failed:P.Nb,callbackDataValue:ie.c.decode}),h()(X,ie.f.SHARING_ENCODE,{success:P.Qb,failed:P.Nb,callbackDataValue:ie.c.encode}),X);function Gr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,i=E()(e);if(t){var a=E()(this).constructor;r=Reflect.construct(i,arguments,a)}else r=i.apply(this,arguments);return A()(this,r)}}var Hr=null;"function"==typeof AudioWorklet&&(Hr=function(e){y()(r,e);var t=Gr(r);function r(e,i,a){var n;return p()(this,r),(n=t.call(this,e,i,a)).port.onmessage=n.handleMessage.bind(_()(n)),n}return m()(r,[{key:"handleMessage",value:function(e){var t=e.data;switch(t.status){case"delay":if(ee.a.localAudioDecMGR)(r=ee.a.localAudioDecMGR.map.get(0))&&r.postMessage({command:"delay"});break;case P.qb:t.at&&(ee.a.CurrentSSRCTime=t.at),t.st&&ee.a.mediaSDKHandle.SharingRenderObj&&ee.a.mediaSDKHandle.SharingRenderObj.SetcATimeStamp(t.st);break;case"AUDIO_MONITOR_LOG":Xe.push({log:t.data,isSend:!0});break;case"MONITOR_LOG":re.add_monitor(t.data);break;case"UPDATE_MULTIVIEW_TIME":var r;if(ee.a.localVideoDecMGR)(r=ee.a.localVideoDecMGR.map.get(0))&&r.postMessage({command:"audioDecodeTime",data:t.data,status:1});break;case"WASM_INIT_SUCCESS":for(re.add_monitor("DIWL"+t.data.audio_handle),ee.a.workletWasmInitSuccess=!0;!ee.a.interpretationMessage.isEmpty();){var i=ee.a.interpretationMessage.dequeue();this.postCMD(i.command,i)}}}},{key:"postData",value:function(e,t){this.port.postMessage({status:e,data:t},[t.data.buffer])}},{key:"postCMD",value:function(e,t){this.port.postMessage({status:e,data:t})}}]),r}(I()(AudioWorkletNode)));var jr=Hr;function Kr(e){this.name="CameraOccupiedError",this.message=e,this.stack=(new Error).stack}Kr.prototype=new Error;var qr=r(37),Qr=r.n(qr),zr=r(38),Xr=r(40),Jr=r.n(Xr),Yr=r(17),Zr=r.n(Yr),$r=r(21),ei=r.n($r);function ti(e){return e[0]<<24|e[1]<<16|e[2]<<8|e[3]}var ri={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]?ti(e.slice(19,23)):ti(e.slice(15,19))},IsVideoPkg:function(e){return 103==e[0]}},ii=function(){function e(t){p()(this,e);var r=t||{};this.last_report_time=0,this.timeout_count=0,this.interval_report_time=r.interval||3e3,this.tag=r.tag||"monitor",this.max_timeout=0,this.min_timeout=2147483647,this.reportcallback=r.reportcallback,this._timeoutid=0}return m()(e,[{key:"_report",value:function(){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}},{key:"timeoutReport",value:function(e,t){if(this.timeout_count++,e>this.max_timeout&&(this.max_timeout=e),e<this.min_timeout&&(this.min_timeout=e),!this._timeoutid){var r=this;this._timeoutid=setTimeout((function(){r._report(),r._timeoutid=0}),this.interval_report_time)}}}]),e}();function ai(e){var 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 ii({tag:"jitter",interval:3e4,reportcallback:this._qos_report_timeout.bind(this)}),this._qos_report_samples=[],this._cureen_qos_report=0}ai.prototype._qos_report_timeout=function(e,t,r,i){if(this._customer_callback){var a="".concat(e,",").concat(t,",").concat(r,",").concat(i);this._customer_callback(this._tag+"TimeOut",a)}},ai.prototype._report=function(){var e=(new Date).getTime(),t="".concat(e,"-").concat(this._samples.length,"-").concat(this._samples),r="".concat(e,"-").concat(this._qos_report_samples.length,"-").concat(this._qos_report_samples);t=t.replaceAll(",","|"),r=r.replaceAll(",","|"),this._customer_callback?(this._customer_callback(this._tag,t),this._enable_advanced&&this._customer_callback(this._tag+"QOS",r)):console.error("tag:".concat(this._tag,",").concat(t))},ai.prototype._group=function(){var e=performance.now();if(e>=this._lasted_group_time+1700)for(var t=Math.round((e-this._lasted_group_time)/1e3)-1,r=0;r<t;r++)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=[])},ai.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)},ai.prototype.stop=function(){this._enable&&(clearInterval(this._interval_id),this._interval_id=0,this._enable=!1)},ai.prototype.sample=function(e){if(this._enable&&(this._current_count++,this._enable_advanced)){if(ri.IsQosReport(e))return void this._cureen_qos_report++;if(ri.IsVideoPkg(e)){var t=ri.GetQOSTime(e),r=performance.now();if(this._lasted_qos_ts){var i=r-this._lasted_sys_ts-(t-this._lasted_qos_ts);i>30&&this._qos_report.timeoutReport(i,r)}this._lasted_qos_ts=t,this._lasted_sys_ts=r,this._lasted_data=e}}};var ni=Object(Y.a)("sdk.rtcUtil"),oi=function(){function e(){var t=this;p()(this,e),this.rtcPeerConnection=null,this.dataChannel=null,this.dataChannelLabel=null,this.messageListener=null,this.rtcPeerConnectionCreatedListener=null,this.reconnectCount=0,this.reconnectMax=10,this.reconnectCountBetweenCloseAndOpenAndSetTo0WhenDCOpen=0,this.connectionID=null,this.pubSubTokenList=[],this.isForceClosed=!1,this.reconnectRTCPeerConnectionThrottle=ei()((function(){t.reconnectRTCPeerConnection()}),2e3),this.timeoutThenCloseInterval=null,this.userid=null,this.connectionType=null,this.dataChannelStatus="",this.delaycloseTimeout=0,this.delaycloseid_=0,this._send_statistic=null,this._recv_statistic=null}var t;return m()(e,[{key:"setUserid",value:function(e){this.userid=e}},{key:"setConnectionType",value:function(e){this.connectionType=e}},{key:"isSupportDataChannel",value:function(){return!!window.RTCDataChannel}},{key:"initConnection",value:(t=d()(g.a.mark((function e(t){var r,i,a,n=this,o=arguments;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=o.length>1&&void 0!==o[1]?o[1]:"ZoomWebclientVideoDataChannel",re.add_monitor("DCCONN"),this.isSupportDataChannel()){e.next=5;break}return re.add_monitor("DCUNSUPPORT"),e.abrupt("return");case 5:return i="ZoomWebclientVideoDataChannel"==r?1:0,a=function(e,t){re.add_monitor("".concat(e,":").concat(t))},this._send_statistic||(this._send_statistic=new ai({tag:i?"VDCS":"ADCS",report_call:a})),this._recv_statistic||(this._recv_statistic=new ai({tag:i?"VDCR":"ADCR",report_call:a})),this.dataChannelLabel=r,this.connectionID=t,this.rtcPeerConnection=new RTCPeerConnection({iceCandidatePoolSize:1}),this.rtcPeerConnection.addEventListener("close",(function(e){ni("rtcPeerConnection.onclose",e),n.clear(),n.close(),n.reconnectRTCPeerConnectionThrottle()})),this.rtcPeerConnection.addEventListener("icecandidate",(function(e){ni("onicecandidate",e)})),this.rtcPeerConnection.addEventListener("iceconnectionstatechange",(function(e){var t=n.rtcPeerConnection;if("failed"!==t.iceConnectionState&&"closed"!==t.iceConnectionState||(ni("".concat(n.dataChannelLabel," iceconnectionstatechange"),t.iceConnectionState),re.add_monitor("ICECONNSTATECHANGE:"+n.dataChannelLabel),t.close(),n.delaycloseid_&&(clearTimeout(n.delaycloseid_),n.delaycloseid_=0)),"disconnected"===t.iceConnectionState&&!n.delaycloseid_){var r=n;n.delaycloseid_=setTimeout((function(){r.delaycloseid_=0,r.rtcPeerConnection&&r.rtcPeerConnection.close()}),r.delaycloseTimeout)}"connected"===t.iceConnectionState&&n.delaycloseid_&&(clearTimeout(n.delaycloseid_),n.delaycloseid_=0)})),this.createDataChannel(),e.next=18,this.rtcPeerConnection.createOffer().then(function(){var e=d()(g.a.mark((function e(r){return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ni("original offer",JSON.stringify(r)),r.sdp=r.sdp.replace(/a=ice-ufrag:.+/g,"a=ice-ufrag:".concat(t)),ni("modified offer",r),e.abrupt("return",n.rtcPeerConnection.setLocalDescription(r));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).then((function(){n.rtcPeerConnectionCreatedListener.call(null,n.rtcPeerConnection)}));case 18:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"close",value:function(){re.add_monitor("RTCPeerConnUtil.CLOSE"),this._recv_statistic.stop(),this._send_statistic.stop();try{try{this.dataChannel&&this.dataChannel.close()}catch(e){Z.a.error("Error when closing RTCDataChannel",e)}this.rtcPeerConnection&&this.rtcPeerConnection.close()}catch(e){Z.a.error("Error when closing RTCPeerConnection",e)}finally{this.dataChannel=null,this.rtcPeerConnection=null}}},{key:"forceClose",value:function(){re.add_monitor("DCFORCECLOSE:"+this.dataChannelLabel),ni("forceClose : "+this.dataChannelLabel),this.isForceClosed=!0,this.clear(),this.close()}},{key:"clear",value:function(){clearInterval(this.timeoutThenCloseInterval),this.messageListener=null,this.pubSubTokenList.forEach((function(e){$.a.unsubscribe(e)})),this.pubSubTokenList=[]}},{key:"onConnectionCreated",value:function(e){this.rtcPeerConnectionCreatedListener=e}},{key:"reconnectRTCPeerConnection",value:function(){var e=this;this.isForceClosed||this.reconnectCount<this.reconnectMax&&this.reconnectCountBetweenCloseAndOpenAndSetTo0WhenDCOpen<this.reconnectMax&&(ni("".concat(this.dataChannelLabel," reconnect reconnectTotalCount : ").concat(this.reconnectCount,"; reconnectCountBetweenCloseAndOpenAndSetTo0WhenDCOpen : ").concat(this.reconnectCountBetweenCloseAndOpenAndSetTo0WhenDCOpen,", reconnectMax : ").concat(this.reconnectMax)),this.reconnectCount+=1,this.reconnectCountBetweenCloseAndOpenAndSetTo0WhenDCOpen+=1,setTimeout((function(){e.initConnection(e.connectionID,e.dataChannelLabel)}),1e3*Math.pow(2,this.reconnectCountBetweenCloseAndOpenAndSetTo0WhenDCOpen)))}},{key:"oneSingleLineLog",value:function(e){setTimeout((function(){re.send_instant_monitor(),re.add_monitor(e),re.send_instant_monitor()}),0)}},{key:"checkEmptyUserIdAndResendMonitor",value:function(e){this.userid||(this.setUserid(e),this.sendDataChannelStatusMonitorLog())}},{key:"sendDataChannelStatusMonitorLog",value:function(){this.userid&&("OPEN"===this.dataChannelStatus?(re.add_monitor("DCOPEN:"+this.dataChannelLabel),this.oneSingleLineLog("".concat("{[WLCCONT]}",",").concat(this.userid,",").concat(this.connectionType,",DCOPEN,").concat("{[WLCCONT]}"))):"CLOSED"===this.dataChannelStatus&&(re.add_monitor("DCCLOSE:"+this.dataChannelLabel),this.oneSingleLineLog("".concat("{[WLCCONT]}",",").concat(this.userid,",").concat(this.connectionType,",DCCLOSE,").concat("{[WLCCONT]}"))))}},{key:"createDataChannel",value:function(){var e=this;if(this.dataChannel)try{this.dataChannel.close()}catch(e){Z.a.error("Error when trying to close existing RTCDataChannel before creating a new one",e)}var t=this.rtcPeerConnection.createDataChannel(this.dataChannelLabel,{ordered:!1,maxRetransmits:0,reliable:!1});t.binaryType="arraybuffer",t.addEventListener("open",(function(t){e._send_statistic.start(),e._recv_statistic.start(),e.reconnectCountBetweenCloseAndOpenAndSetTo0WhenDCOpen=0,clearInterval(e.timeoutThenCloseInterval),e.dataChannelStatus="OPEN",e.sendDataChannelStatusMonitorLog(),ni("dataChannel.onopen",t)})),t.addEventListener("close",(function(t){e._send_statistic.stop(),e._recv_statistic.stop();var r=ie.h.ZOOM_CONNECTION_AUDIO;"ZoomWebclientVideoDataChannel"==e.dataChannelLabel&&(r=ie.h.ZOOM_CONNECTION_VIDEO),ee.a.sendMessageToRwg(P.Fc,{evt:P.ff,body:{flag:1,type:r}},!1),clearInterval(e.timeoutThenCloseInterval),ni("dataChannel.onclose",t),e.dataChannelStatus="CLOSED",e.sendDataChannelStatusMonitorLog(),e.clear(),e.close(),e.reconnectRTCPeerConnectionThrottle()})),t.addEventListener("error",(function(t){Z.a.warn("WebRTC DataChannel ".concat(e.dataChannelLabel," received error"),t),clearInterval(e.timeoutThenCloseInterval),re.add_monitor("DCERROR","".concat(e.dataChannelLabel,": ").concat(t.message,", error detail: ").concat(t.errorDetail)),ni("dataChannel.onerror",t)})),t.addEventListener("message",(function(t){e._recv_statistic.sample(!1),e.messageListener&&e.messageListener.call(null,t.data)})),this.dataChannel=t}},{key:"onMessage",value:function(e){this.messageListener=e}},{key:"waitForAnswerFromRWG",value:function(e){var t=this;return new Promise((function(r,i){var a=$.a.on(e,(function(e,t){r(t)}));t.pubSubTokenList.push(a)}))}},{key:"setRemoteDescription",value:function(e){ni("setRemoteDescription",e),this.rtcPeerConnection.setRemoteDescription(new RTCSessionDescription({type:"answer",sdp:e.sdp}))}},{key:"closeIfTimeout",value:function(){var e=this;clearInterval(this.timeoutThenCloseInterval),this.timeoutThenCloseInterval=setTimeout((function(){ni("closeIfTimeout"),e.close()}),1e4)}},{key:"addIceCandidate",value:function(e){this.rtcPeerConnection.addIceCandidate(new RTCIceCandidate({candidate:e,sdpMLineIndex:0,sdpMid:"0"}))}},{key:"sendVideoData",value:function(e){try{this.dataChannel.send(e),this._send_statistic.sample(!1)}catch(e){Z.a.error("Error when sending video data via WebRTC",e),ni.error("sendVideoData",e)}}},{key:"sendAudioData",value:function(e){try{this.dataChannel.send(e),this._send_statistic.sample(!1)}catch(e){Z.a.error("Error when sending audio data via WebRTC",e)}}},{key:"listenOnDataAndSend",value:function(e){var t=this,r=$.a.on(e,(function(e,r){t.sendVideoData(r)}));this.pubSubTokenList.push(r)}},{key:"consumeRingbuffer",value:function(e){for(;e.available_read()>0;){var t=e.dequeue();this.sendVideoData(t)}requestAnimationFrame(this.consumeRingbuffer.bind(this))}},{key:"listenOnDataAndSendAudio",value:function(e){var t=this,r=$.a.on(e,(function(e,r){t.sendAudioData(r)}));this.pubSubTokenList.push(r)}}]),e}(),si=r(18);function ui(e,t,r,i,a,n){if(this.canvasElement=e,this.contextOptions=i,this.glInitSucceed=0,this.textureindex=t||0,this.texturestride=this.textureindex?3:n?4:6,this.initmask=n||!1,ui.prototype.ROTATION_CLOCK0=0,ui.prototype.ROTATION_CLOCK90=1,ui.prototype.ROTATION_CLOCK180=2,ui.prototype.ROTATION_CLOCK270=3,a?this.contextGL=a.contextgl:this.initContextGL(),this.contextGL){this.webGLContextLostProtect(),a?(this.shaderProgram=a.program,this.waterMarkTextureRef=a.waterMarkTextureRef,this.repeatedWaterMarkTextureRef=a.repeatedWaterMarkTextureRef,this.initTextures(!1),this.vertexPosBuffer=a.vBuffer,this.texturePosBuffer=a.tBuffer):(this.initProgram(),this.initmask?this.initTextures(!1):this.initTextures(!0),this.initBuffers());var o=new ArrayBuffer(4);this.dummpyCursor=new Uint8Array(o),this.dummpyWaterMark=new Uint8Array(o);var s=this.contextGL.getError();this.glInitSucceed=s!=this.contextGL.NO_ERROR&&s!=this.contextGL.CONTEXT_LOST_WEBGL?0:1,this.cursorWidth=0,this.cursorHeight=0,this.hasCursor=0,this.hasWaterMark=0,this.watermarkOpacity=.15,this.watermarkData=null,this.watermarkWidth=0,this.watermarkHeight=0,this.isMultiView=!1,this.hasWholeFrame=0,this.croppingParams={},this.croppingParams.top=0,this.croppingParams.left=0,this.croppingParams.width=0,this.croppingParams.height=0,this.textureWidth=0,this.textureHeight=0,this.canvasWidth=0,this.canvasHeight=0,this.picRotation=-1,this.bgColor=[0,0,0],this.cx=0,this.cy=0,this.cw=0,this.ch=0,this.colorRange=-1,this.videoMode=-1,this.rotation=this.ROTATION_CLOCK0,this.fillMode=0,this.fillModeForResolution=0}}function di(e,t,r,i){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,n=e.contextGL,o=n.canvas.width,s=n.canvas.height;a&&(o=a.width,s=a.height);var u,d,c,h,l=i==e.ROTATION_CLOCK90||i==e.ROTATION_CLOCK270?r:t,p=i==e.ROTATION_CLOCK90||i==e.ROTATION_CLOCK270?t:r,f=l/p*s,m=p/l*o;f>o?(u=0,c=1,h=1-(d=(s-m)/2/s)):(d=0,h=1,c=1-(u=(o-f)/2/o)),u=2*u-1,c=2*c-1,d=1-2*d,h=1-2*h;var v=new Float32Array([c,d,u,d,c,h,u,h,c,d,u,d,c,h,u,h]);n.bindBuffer(n.ARRAY_BUFFER,e.vertexPosBuffer),n.bufferData(n.ARRAY_BUFFER,v,n.DYNAMIC_DRAW)}function ci(e,t,r,i,a){var o=e.contextGL,s=i.top/r,u=i.left/t,d=s+(i.height-1)/r,c=u+i.width/t,h=[u,s,c,s,c,d,u,d];a==e.ROTATION_CLOCK90&&(h.unshift(h[6],h[7]),h=h.slice(0,8)),a==e.ROTATION_CLOCK180&&(h.unshift(h[4],h[5],h[6],h[7]),h=h.slice(0,8)),a==e.ROTATION_CLOCK270&&(h.push(h[0],h[1]),h=h.slice(2));var l=h[0],p=h[1];h[0]=h[2],h[1]=h[3],h[2]=l,h[3]=p;var f=new Float32Array([].concat(n()(h),[1,0,0,0,1,1,0,1]));o.bindBuffer(o.ARRAY_BUFFER,e.texturePosBuffer),o.bufferData(o.ARRAY_BUFFER,f,o.DYNAMIC_DRAW)}ui.prototype.webGLContextLostSimulate=function(){var e="undefined"==typeof window?self:window;e.webGLEXTSimulate=e.webGLEXTSimulate||[],e.webGLEXTSimulate.push(this.contextGL.getExtension("WEBGL_lose_context")),console.log("\n webGLEXTSimulate[0].loseContext()\n webGLEXTSimulate[0].restoreContext()\n ")},ui.prototype.webGLContextLostProtect=function(){var e=this;if(this.contextOptions){var t=this.canvasElement;t.addEventListener("webglcontextlost",(function(t){console.log("webglcontextlost",t),t.preventDefault(),e.contextOptions&&e.contextOptions.webglcontextlostCallback&&e.contextOptions.webglcontextlostCallback(t,e.contextOptions.params)}),{capture:!1,once:!0}),t.addEventListener("webglcontextrestored",(function(t){console.log("webglcontextrestored",t),e.contextOptions&&e.contextOptions.webglcontextrestoredCallback&&e.contextOptions.webglcontextrestoredCallback(t,e.contextOptions.params)}),{capture:!1,once:!0})}},ui.prototype.isWebGL=function(){return this.contextGL},ui.prototype.initContextGL=function(){for(var e=this.canvasElement,t=null,r=["webgl","experimental-webgl","moz-webgl","webkit-3d"],i=0;!t&&i<r.length;){var a=r[i];try{t=this.contextOptions?e.getContext(a,this.contextOptions):e.getContext(a)}catch(e){t=null}t&&"function"==typeof t.getParameter||(t=null),++i}this.contextGL=t},ui.prototype.initProgram=function(){var e=this.contextGL,t=["attribute vec4 vertexPos;","attribute vec4 texturePos;","attribute vec4 masktexturePos;","varying vec2 textureCoord;","varying vec2 masktextureCoord;","void main()","{","gl_Position = vertexPos;","textureCoord = texturePos.xy;","masktextureCoord = masktexturePos.xy;","}"].join("\n"),r=["precision highp float;","varying highp vec2 textureCoord;","varying highp vec2 masktextureCoord;","uniform sampler2D ySampler;","uniform sampler2D uSampler;","uniform sampler2D vSampler;","uniform sampler2D cursorSampler;","uniform sampler2D waterMarkSampler;","uniform sampler2D previewVideoSampler;","uniform sampler2D maskSampler;","uniform vec4 cursorInfo;","uniform int onlyRGBA;","uniform int bgraMode;","uniform int colorRange;","uniform int waterMarkFlag;","uniform int cursorFlag;","uniform int maskFlag;","uniform int yuvmode;","const mat4 YUV2RGB_L = mat4","(","1.1643828125, 0, 1.59602734375, -.87078515625,","1.1643828125, -.39176171875, -.81296875, .52959375,","1.1643828125, 2.017234375, 0, -1.081390625,","0, 0, 0, 1",");","const mat4 YUV2RGB_F = mat4","(","1.0, 0, 1.402, -.701,","1.0, -.34413, -.71414, .529135,","1.0, 1.772, 0, -.886,","0, 0, 0, 1",");","void main(void) {","vec4 c;","if(waterMarkFlag!=1) {","if(onlyRGBA==0){","highp float y = texture2D(ySampler, textureCoord).r;","highp float u;","highp float v;","if(yuvmode==1){","u = texture2D(uSampler, textureCoord).r;","v = texture2D(vSampler, textureCoord).r;","}","else{","u = texture2D(uSampler, textureCoord).r;","v = texture2D(uSampler, textureCoord).a;","}","if (colorRange == 0)","{"," c = vec4(y, u, v, 1) * YUV2RGB_L;","} else {"," c = vec4(y, u, v, 1) * YUV2RGB_F;","}","if(cursorFlag==1)","{","if (cursorInfo.z > 0.0 && textureCoord.x >= cursorInfo.x && textureCoord.y >= cursorInfo.y && "," textureCoord.x < cursorInfo.x+cursorInfo.z && textureCoord.y < cursorInfo.y+cursorInfo.w ){"," vec2 cursorCoord = textureCoord - cursorInfo.xy;"," cursorCoord /= cursorInfo.zw;"," vec4 cursor = texture2D(cursorSampler, cursorCoord);"," c = c*(1.0-cursor.a) + cursor*cursor.a;","}","}","}","else{"," c = texture2D(previewVideoSampler, textureCoord);","if(bgraMode==1)","{"," c = vec4(c.b, c.g, c.r, c.a);","}","}","}","if(waterMarkFlag==1)","{"," c = texture2D(waterMarkSampler, textureCoord);","if(c.r == 0.0 && c.g == 0.0 && c.b == 0.0){"," c.a = 0.0;","}","}","if(maskFlag==1 && waterMarkFlag!=1)","{","vec4 mask = texture2D(maskSampler, masktextureCoord);","if(mask.r != 0.0 || mask.g != 0.0 || mask.b != 0.0){","c = mask* mask.a+ c*(1.0-mask.a);","}","}","if (waterMarkFlag!=1){","c.a = 1.0;","}","gl_FragColor = c;","}"].join("\n"),i=e.createShader(e.VERTEX_SHADER);e.shaderSource(i,t),e.compileShader(i),e.getShaderParameter(i,e.COMPILE_STATUS)||e.isContextLost()||console.log("Vertex shader failed to compile: "+e.getShaderInfoLog(i));var a=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(a,r),e.compileShader(a),e.getShaderParameter(a,e.COMPILE_STATUS)||e.isContextLost()||console.log("Fragment shader failed to compile: "+e.getShaderInfoLog(a));var n=e.createProgram();e.attachShader(n,i),e.attachShader(n,a),e.linkProgram(n),e.getProgramParameter(n,e.LINK_STATUS)||e.isContextLost()||console.log("Program failed to compile: "+e.getProgramInfoLog(n)),e.useProgram(n),this.shaderProgram=n},ui.prototype.initBuffers=function(){var e=this.contextGL,t=this.shaderProgram,r=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,r),e.bufferData(e.ARRAY_BUFFER,new Float32Array([1,1,-1,1,1,-1,-1,-1,1,1,-1,1,1,-1,-1,-1]),e.STATIC_DRAW);var i=e.getAttribLocation(t,"vertexPos");e.enableVertexAttribArray(i),e.vertexAttribPointer(i,2,e.FLOAT,!1,0,0),this.vertexPosBuffer=r;var a=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,a),e.bufferData(e.ARRAY_BUFFER,new Float32Array([1,0,0,0,1,1,0,1,1,0,0,0,1,1,0,1]),e.STATIC_DRAW);var n=e.getAttribLocation(t,"texturePos");if(e.enableVertexAttribArray(n),e.vertexAttribPointer(n,2,e.FLOAT,!1,0,0),this.initmask&&!this.masktexturePosBuffer){var o=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,o),e.bufferData(e.ARRAY_BUFFER,new Float32Array([1,0,0,0,1,1,0,1]),e.STATIC_DRAW);var s=e.getAttribLocation(t,"masktexturePos");e.enableVertexAttribArray(s),e.vertexAttribPointer(s,2,e.FLOAT,!1,0,0),this.masktexturePosBuffer=o}this.texturePosBuffer=a},ui.prototype.initTextures=function(e){var t=this.contextGL,r=this.shaderProgram;t.pixelStorei(t.UNPACK_ALIGNMENT,1);var i=this.initTexture();this.yTextureRef=i;var a=this.initTexture();this.uTextureRef=a;var n=this.initTexture();if(this.vTextureRef=n,e){this.BindTextures(1);var o=this.initTexture(),s=t.getUniformLocation(r,"cursorSampler");t.uniform1i(s,this.textureindex*this.texturestride+3),this.cursorTextureRef=o;var u=this.initTexture(),d=t.getUniformLocation(r,"waterMarkSampler");t.uniform1i(d,4),this.waterMarkTextureRef=u;var c=this.initTexture();this.repeatedWaterMarkTextureRef=c;var h=this.initTexture(),l=t.getUniformLocation(r,"previewVideoSampler");t.uniform1i(l,this.textureindex*this.texturestride+5),this.previewVideoTextureRef=h;var p=t.getUniformLocation(r,"cursorInfo");this.cursorInfoRef=p}if(this.initmask){t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,1);var f=this.initTexture(),m=t.getUniformLocation(r,"maskSampler");t.uniform1i(m,this.textureindex*this.texturestride+6),this.maskTextureRef=f}var v=t.getUniformLocation(r,"colorRange");this.colorRangeRef=v,this.onlyRGBARef=t.getUniformLocation(r,"onlyRGBA"),this.bgraModeRef=t.getUniformLocation(r,"bgraMode"),this.waterMarkFlagRef=t.getUniformLocation(r,"waterMarkFlag"),this.maskFlagRef=t.getUniformLocation(r,"maskFlag"),this.cursorFlagRef=t.getUniformLocation(r,"cursorFlag"),this.yuvmodeRef=t.getUniformLocation(r,"yuvmode")},ui.prototype.BindTextures=function(e){var t=this.contextGL,r=this.shaderProgram;if(t.pixelStorei(t.UNPACK_ALIGNMENT,1),t.activeTexture(t.TEXTURE0+0),t.bindTexture(t.TEXTURE_2D,this.yTextureRef),t.activeTexture(t.TEXTURE0+1),t.bindTexture(t.TEXTURE_2D,this.uTextureRef),t.activeTexture(t.TEXTURE0+2),t.bindTexture(t.TEXTURE_2D,this.vTextureRef),1==e){var i=t.getUniformLocation(r,"ySampler");t.uniform1i(i,0);var a=t.getUniformLocation(r,"uSampler");t.uniform1i(a,1);var n=t.getUniformLocation(r,"vSampler");t.uniform1i(n,2)}else if(this.isRGBAMode(e)){var o=t.getUniformLocation(r,"previewVideoSampler");t.uniform1i(o,0);var s=t.getUniformLocation(r,"ySampler");t.uniform1i(s,0);var u=t.getUniformLocation(r,"uSampler");t.uniform1i(u,0);var d=t.getUniformLocation(r,"vSampler");t.uniform1i(d,0)}else if(2==e){var c=t.getUniformLocation(r,"ySampler");t.uniform1i(c,0);var h=t.getUniformLocation(r,"uSampler");t.uniform1i(h,1);var l=t.getUniformLocation(r,"vSampler");t.uniform1i(l,0)}var p=t.getUniformLocation(r,"previewVideoSampler");t.uniform1i(p,0);var f=t.getUniformLocation(r,"maskSampler");this.initmask?(t.activeTexture(t.TEXTURE0+6),t.bindTexture(t.TEXTURE_2D,this.maskTextureRef),t.uniform1i(f,6)):t.uniform1i(f,0);var m=t.getUniformLocation(r,"cursorSampler");t.uniform1i(m,0);var v=t.getUniformLocation(this.shaderProgram,"waterMarkSampler");t.uniform1i(v,0)},ui.prototype.initTexture=function(){var e=this.contextGL,t=e.createTexture();return e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.bindTexture(e.TEXTURE_2D,null),t},ui.prototype.clearDisplay=function(){var e=this.contextGL;e&&(e.enable(e.BLEND),e.blendFunc(e.ZERO,e.ZERO)),this.render()},ui.prototype.cleanup=function(){var e=this.contextGL;e&&this.glInitSucceed&&(e.deleteProgram(this.program),e.activeTexture(e.TEXTURE0+this.textureindex*this.texturestride),e.bindTexture(e.TEXTURE_2D,null),e.activeTexture(e.TEXTURE1+this.textureindex*this.texturestride),e.bindTexture(e.TEXTURE_2D,null),e.activeTexture(e.TEXTURE2+this.textureindex*this.texturestride),e.bindTexture(e.TEXTURE_2D,null),this.textureindex||this.initmask||(e.activeTexture(e.TEXTURE3+this.textureindex*this.texturestride),e.bindTexture(e.TEXTURE_2D,null),e.activeTexture(e.TEXTURE4+this.textureindex*this.texturestride),e.bindTexture(e.TEXTURE_2D,null),e.activeTexture(this.GetRepeatedWatermarkTextureValue(e)),e.bindTexture(e.TEXTURE_2D,null),e.activeTexture(e.TEXTURE5+this.textureindex*this.texturestride),e.bindTexture(e.TEXTURE_2D,null)),e.bindBuffer(e.ARRAY_BUFFER,null),e.deleteTexture(this.yTextureRef),e.deleteTexture(this.uTextureRef),e.deleteTexture(this.vTextureRef),this.textureindex||this.initmask||(e.deleteTexture(this.cursorTextureRef),e.deleteTexture(this.waterMarkTextureRef),e.deleteTexture(this.repeatedWaterMarkTextureRef),e.deleteTexture(this.previewVideoTextureRef),e.deleteBuffer(this.vertexPosBuffer),e.deleteBuffer(this.texturePosBuffer)),this.maskTextureRef&&e.deleteTexture(this.maskTextureRef),this.masktexturePosBuffer&&e.deleteBuffer(this.masktexturePosBuffer),this.contextGL=null,this.glInitSucceed=0)},ui.prototype.drawNextOutputPicture=function(e,t,r,i){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,n=this.contextGL;n?this.drawNextOuptutPictureGL(e,t,r,i,a):this.drawNextOuptutPictureRGBA(e,t,r,i)},ui.prototype.updateVertexInfoForMultiView=function(e,t,r,i,a){var n,o,s,u,d=this.contextGL;if(this.isUseFillMode({width:r,height:i,rotation:a}))n=0,o=0,s=1,u=1;else{var c=a==this.ROTATION_CLOCK90||a==this.ROTATION_CLOCK270?i:r,h=a==this.ROTATION_CLOCK90||a==this.ROTATION_CLOCK270?r:i,l=c/h*t;l>e?(n=0,s=1,u=1-(o=(t-h/c*e)/2/t)):(o=0,u=1,s=1-(n=(e-l)/2/e))}n=2*n-1,s=2*s-1,o=1-2*o,u=1-2*u;var p=new Float32Array([s,o,n,o,s,u,n,u,1,1,-1,1,1,-1,-1,-1]);d.bindBuffer(d.ARRAY_BUFFER,this.vertexPosBuffer),d.bufferData(d.ARRAY_BUFFER,p,d.DYNAMIC_DRAW)},ui.prototype.updateTextureInfoForMultiView=function(e,t,r,i,a,o,s){var u,d,c,h,l=this.contextGL;if(this.isUseFillMode({width:r.width,height:r.height,rotation:i})){var p=i==this.ROTATION_CLOCK90||i==this.ROTATION_CLOCK270?s/o:o/s,f=r.left||0,m=r.top||0;if(r.width/r.height>p){var v=r.height*p;u=m/t,d=(Math.round((r.width-v)/2)+f)/e,c=u+(r.height-1)/t,h=d+v/e}else{var g=r.width/p;c=(u=(Math.round((r.height-g)/2)+m)/t)+(g-1)/t,h=(d=f/e)+r.width/e}}else u=r.top/t,d=r.left/e,c=u+(r.height-1)/t,h=d+r.width/e;var S=[d,u,h,u,h,c,d,c];i==this.ROTATION_CLOCK90&&(S.unshift(S[6],S[7]),S=S.slice(0,8)),i==this.ROTATION_CLOCK180&&(S.unshift(S[4],S[5],S[6],S[7]),S=S.slice(0,8)),i==this.ROTATION_CLOCK270&&(S.push(S[0],S[1]),S=S.slice(2));var _=S[0],C=S[1];S[0]=S[2],S[1]=S[3],S[2]=_,S[3]=C,a&&(S[0]=1-S[0],S[2]=1-S[2],S[4]=1-S[4],S[6]=1-S[6]);var y=new Float32Array([].concat(n()(S),[1,0,0,0,1,1,0,1]));l.bindBuffer(l.ARRAY_BUFFER,this.texturePosBuffer),l.bufferData(l.ARRAY_BUFFER,y,l.DYNAMIC_DRAW)},ui.prototype.drawNextOuptutPictureGL=function(e,t,r,i,a){var n=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,s=this.contextGL;if(s&&this.glInitSucceed){this.texturePosBuffer;var u=this.yTextureRef,d=this.uTextureRef,c=this.vTextureRef;s.enable(s.BLEND),s.blendFunc(s.SRC_ALPHA,s.ONE_MINUS_SRC_ALPHA),a=a||this.ROTATION_CLOCK0;var h=(r=r||{top:0,left:0,width:e,height:t}).width!=this.croppingParams.width||r.height!=this.croppingParams.height,l=r.top!=this.croppingParams.top||r.left!=this.croppingParams.left,p=s.canvas.width!=this.canvasWidth||s.canvas.height!=this.canvasHeight,f=e!=this.textureWidth||t!=this.textureHeight,m=a!=this.picRotation;(h||p||m)&&di(this,r.width,r.height,a,o),(h||l||f||m)&&ci(this,e,t,r,a);var v=n?0:1;v!=this.colorRange&&(s.uniform1i(this.colorRangeRef,v),this.colorRange=v),o?s.viewport(o.x,o.y,o.width,o.height):s.viewport(0,0,s.canvas.width,s.canvas.height),s.uniform1i(this.onlyRGBARef,0),s.uniform1i(this.yuvmodeRef,1),Object.assign(this.croppingParams,r),this.textureWidth=e,this.textureHeight=t,this.picRotation=a,this.canvasWidth=s.canvas.width,this.canvasHeight=s.canvas.height,s.clearColor(this.bgColor[0],this.bgColor[1],this.bgColor[2],255),s.clear(s.COLOR_BUFFER_BIT);var g=i,S=e*t,_=g.subarray(0,S);s.activeTexture(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,u),s.texImage2D(s.TEXTURE_2D,0,s.LUMINANCE,e,t,0,s.LUMINANCE,s.UNSIGNED_BYTE,_);var C=e/2*t/2,y=g.subarray(S,S+C);s.activeTexture(s.TEXTURE1),s.bindTexture(s.TEXTURE_2D,d),s.texImage2D(s.TEXTURE_2D,0,s.LUMINANCE,e/2,t/2,0,s.LUMINANCE,s.UNSIGNED_BYTE,y);var b=C,A=g.subarray(S+C,S+C+b);s.activeTexture(s.TEXTURE2),s.bindTexture(s.TEXTURE_2D,c),s.texImage2D(s.TEXTURE_2D,0,s.LUMINANCE,e/2,t/2,0,s.LUMINANCE,s.UNSIGNED_BYTE,A),s.activeTexture(s.TEXTURE3),s.bindTexture(s.TEXTURE_2D,this.cursorTextureRef),this.hasCursor?s.uniform1i(this.cursorFlagRef,1):s.texImage2D(s.TEXTURE_2D,0,s.RGBA,1,1,0,s.RGBA,s.UNSIGNED_BYTE,this.dummpyCursor),s.uniform4f(this.cursorInfoRef,this.cx,this.cy,this.cw,this.ch),s.activeTexture(s.TEXTURE5),s.bindTexture(s.TEXTURE_2D,this.previewVideoTextureRef),s.texImage2D(s.TEXTURE_2D,0,s.RGBA,1,1,0,s.RGBA,s.UNSIGNED_BYTE,this.dummpyWaterMark);var k=s.getUniformLocation(this.shaderProgram,"maskSampler");s.uniform1i(k,5),this.render(),this.hasWholeFrame=1}},ui.prototype.updateTextureBlock=function(e,t,r,i,a){var n=this.contextGL;if(n&&this.glInitSucceed){var o=a;if(!(!this.hasWholeFrame||e<=0||t<=0||r<0||i<0||r+e>this.textureWidth||i+t>this.textureHeight)&&a&&a.length==e*t*3/2){var s=this.yTextureRef,u=this.uTextureRef,d=this.vTextureRef,c=e*t,h=o.subarray(0,c);n.activeTexture(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,s),n.texSubImage2D(n.TEXTURE_2D,0,r,i,e,t,n.LUMINANCE,n.UNSIGNED_BYTE,h);var l=e/2*t/2,p=o.subarray(c,c+l);n.activeTexture(n.TEXTURE1),n.bindTexture(n.TEXTURE_2D,u),n.texSubImage2D(n.TEXTURE_2D,0,r/2,i/2,e/2,t/2,n.LUMINANCE,n.UNSIGNED_BYTE,p);var f=l,m=o.subarray(c+l,c+l+f);n.activeTexture(n.TEXTURE2),n.bindTexture(n.TEXTURE_2D,d),n.texSubImage2D(n.TEXTURE_2D,0,r/2,i/2,e/2,t/2,n.LUMINANCE,n.UNSIGNED_BYTE,m)}}},ui.prototype.updateCursor=function(e,t,r){var i=this.contextGL;i&&this.glInitSucceed&&(e<=0||t<=0||!r||r.length!=e*t*4||(i.activeTexture(i.TEXTURE3),i.bindTexture(i.TEXTURE_2D,this.cursorTextureRef),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,e,t,0,i.RGBA,i.UNSIGNED_BYTE,r),this.cursorWidth=e,this.cursorHeight=t,this.hasCursor=1))},ui.prototype.updateWatherMark=function(e,t,r){this.contextGL&&this.glInitSucceed&&(e<=0||t<=0||!r||r.length!=e*t*4||(this.watermarkData=r,this.watermarkWidth=e,this.watermarkHeight=t,this.hasWaterMark=1))},ui.prototype.drawWatermark=function(){var e=this.contextGL;if(this.IsSetWaterMark()&&this.watermarkData&&this.watermarkWidth&&this.watermarkHeight){e.uniform1i(this.waterMarkFlagRef,1),this.IsWatermarkRepeated()?(e.activeTexture(this.GetRepeatedWatermarkTextureValue(e)),e.bindTexture(e.TEXTURE_2D,this.repeatedWaterMarkTextureRef)):(e.activeTexture(e.TEXTURE4),e.bindTexture(e.TEXTURE_2D,this.waterMarkTextureRef)),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,this.watermarkWidth,this.watermarkHeight,0,e.RGBA,e.UNSIGNED_BYTE,this.watermarkData);var t=e.getUniformLocation(this.shaderProgram,"waterMarkSampler");e.uniform1i(t,this.IsWatermarkRepeated()?this.GetRepeatedWatermarkUniformValue():4),e.enable(e.BLEND),e.blendFunc(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA),e.drawArrays(e.TRIANGLE_STRIP,4,4)}},ui.prototype.render=function(){var e=this.contextGL;e&&this.glInitSucceed&&(e.uniform1i(this.waterMarkFlagRef,0),e.drawArrays(e.TRIANGLE_STRIP,0,4),this.drawWatermark())},ui.prototype.draw=function(e,t,r,i,a){var n=this.contextGL;if(n&&this.glInitSucceed&&!(!this.hasWholeFrame||e&&(i<0||a<0))){n.viewport(0,0,n.canvas.width,n.canvas.height);var o=this.yTextureRef,s=this.uTextureRef,u=this.vTextureRef,d=this.cursorTextureRef;if(n.activeTexture(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,o),n.activeTexture(n.TEXTURE1),n.bindTexture(n.TEXTURE_2D,s),n.activeTexture(n.TEXTURE2),n.bindTexture(n.TEXTURE_2D,u),n.activeTexture(n.TEXTURE3),n.bindTexture(n.TEXTURE_2D,d),e&&this.hasCursor){var c=t/this.croppingParams.width,h=r/this.croppingParams.height,l=i/this.croppingParams.width,p=a/this.croppingParams.height;this.cx=c,this.cy=h,this.cw=l,this.ch=p,n.uniform4f(this.cursorInfoRef,c,h,l,p)}else n.uniform4f(this.cursorInfoRef,0,0,0,0);this.render()}},ui.prototype.clear=function(){var e=this.contextGL;e&&this.glInitSucceed&&(e.clearColor(this.bgColor[0],this.bgColor[1],this.bgColor[2],255),e.clear(e.COLOR_BUFFER_BIT),this.hasWholeFrame=0,this.hasCursor=0)},ui.prototype.clearCanvas=function(e){var t=this.contextGL;t&&this.glInitSucceed&&(e?t.clearColor(e.R,e.G,e.B,e.A):t.clearColor(this.bgColor[0],this.bgColor[1],this.bgColor[2],255),t.clear(t.COLOR_BUFFER_BIT))},ui.prototype.drawNextOuptutPictureRGBA=function(e,t,r,i){var a=i,n=this.canvasElement.getContext("2d"),o=n.getImageData(0,0,e,t);o.data.set(a),n.putImageData(o,0,0)},ui.prototype.isRGBAMode=function(e){return-1!==[T,O].indexOf(e)},ui.prototype.UpdateRemoteVideoTextures=function(e,t,r,i,a){var n=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],o=this.contextGL;if(o&&this.glInitSucceed){var s=this.yTextureRef,u=this.uTextureRef,d=this.vTextureRef;o.enable(o.BLEND),o.blendFunc(o.SRC_ALPHA,o.ONE_MINUS_SRC_ALPHA);var c=this.isRGBAMode(this.videoMode);if(e<=0||t<=0||!i||!i.length||i.length!=e*t*3/2&&!c||r&&(r.top<0||r.left<0||r.left+r.width>e||r.top+r.height>t))return!1;var h=n?0:1;if(this.colorRange=h,this.rotation=a,Object.assign(this.croppingParams,r),this.textureWidth=e,this.textureHeight=t,this.canvasWidth=o.canvas.width,this.canvasHeight=o.canvas.height,o.bindTexture(o.TEXTURE_2D,s),!c){var l=i,p=e*t,f=l.subarray(0,p);o.texImage2D(o.TEXTURE_2D,0,o.LUMINANCE,e,t,0,o.LUMINANCE,o.UNSIGNED_BYTE,f);var m=0,v=0;1==this.videoMode?v=m=e/2*t/2:2==this.videoMode&&(m=e*t/2,v=0);var g=l.subarray(p,p+m);if(o.bindTexture(o.TEXTURE_2D,u),v){o.texImage2D(o.TEXTURE_2D,0,o.LUMINANCE,e/2,t/2,0,o.LUMINANCE,o.UNSIGNED_BYTE,g);var S=l.subarray(p+m,p+m+v);o.bindTexture(o.TEXTURE_2D,d),o.texImage2D(o.TEXTURE_2D,0,o.LUMINANCE,e/2,t/2,0,o.LUMINANCE,o.UNSIGNED_BYTE,S)}else o.texImage2D(o.TEXTURE_2D,0,o.LUMINANCE_ALPHA,e/2,t/2,0,o.LUMINANCE_ALPHA,o.UNSIGNED_BYTE,g);return!0}o.texImage2D(o.TEXTURE_2D,0,o.RGBA,e,t,0,o.RGBA,o.UNSIGNED_BYTE,i)}},ui.prototype.UpdateRemoteVideoTexturesImageBitmap=function(e,t,r,i,a){var n=this.contextGL;if(n&&this.glInitSucceed){if(e<=0||t<=0||!r)return;this.textureWidth=e,this.textureHeight=t,Number.isNaN(a)||(this.rotation=a),Object.assign(this.croppingParams,i),n.bindTexture(n.TEXTURE_2D,this.yTextureRef);var o=n.RGBA,s=n.RGBA,u=n.UNSIGNED_BYTE;n.texImage2D(n.TEXTURE_2D,0,o,s,u,r)}},ui.prototype.updateSelfMaskImage=function(e,t,r){var i=this.contextGL;i&&this.glInitSucceed&&(e<=0||t<=0||!r||r.length!=e*t*4||(i.bindTexture(i.TEXTURE_2D,this.maskTextureRef),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,e,t,0,i.RGBA,i.UNSIGNED_BYTE,r)))},ui.prototype.VideoFlip=function(){var e=this.contextGL;e&&this.glInitSucceed&&e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,1)},ui.prototype.DrawRemoteVideo=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.contextGL;if(r&&this.glInitSucceed){var i=this.isRGBAMode(this.videoMode)?1:0;r.uniform1i(this.colorRangeRef,this.colorRange),this.setUniformFlag(i,this.hasCursor,this.videoMode),this.initmask&&r.uniform1i(this.maskFlagRef,1),this.updateTextureInfoForMultiView(this.textureWidth,this.textureHeight,this.croppingParams,this.rotation,t,e.width,e.height),r.viewport(e.x,e.y,e.width,e.height),this.updateVertexInfoForMultiView(e.width,e.height,this.croppingParams.width,this.croppingParams.height,this.rotation),this.BindTextures(this.videoMode),r.enable(r.BLEND),r.blendFunc(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA),this.render()}},ui.prototype.readPixelsSyncRequest=function(e,t,r,i){var a,n=this.contextGL;return this.destination&&this.destination.length==r*i*4||(this.destination=new Uint8Array(r*i*4)),a=this.destination,n.flush(),n.readPixels(e,t,r,i,n.RGBA,n.UNSIGNED_BYTE,a),a},ui.prototype.UpdateSelfVideoTextures=function(e,t,r,i){var a=this.contextGL;a&&this.glInitSucceed&&(e<=0||t<=0||!r||r.length%4!=0||(this.textureWidth=e,this.textureHeight=t,this.rotation=this.ROTATION_CLOCK0,Object.assign(this.croppingParams,i),a.bindTexture(a.TEXTURE_2D,this.yTextureRef),a.texImage2D(a.TEXTURE_2D,0,a.RGBA,e,t,0,a.RGBA,a.UNSIGNED_BYTE,r)))},ui.prototype.DrawSelfVideo=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=this.contextGL;i&&this.glInitSucceed&&(this.setUniformFlag(1,this.hasCursor,this.videoMode),this.updateTextureInfoForMultiView(this.textureWidth,this.textureHeight,this.croppingParams,this.rotation,r,e.width,e.height),i.viewport(e.x,e.y,e.width,e.height),t?(i.enable(i.BLEND),i.blendFunc(i.ZERO,i.ZERO),this.updateVertexInfoForMultiView(e.width,e.height,e.width,e.height,this.ROTATION_CLOCK0)):(i.enable(i.BLEND),i.blendFunc(i.SRC_ALPHA,i.ONE_MINUS_SRC_ALPHA),this.updateVertexInfoForMultiView(e.width,e.height,this.croppingParams.width,this.croppingParams.height,this.rotation)),this.BindTextures(T),this.render())},ui.prototype.IsSetWaterMark=function(){return this.hasWaterMark},ui.prototype.SetWaterMarkFlag=function(e){this.hasWaterMark=e,e||(this.SetWatermarkRepeated(!1),this.SetWatermarkOpacity(),this.SetWatermarkPosition(16))},ui.prototype.setUniformFlag=function(e,t,r){var i=this.contextGL;i&&(i.uniform1i(this.onlyRGBARef,e),i.uniform1i(this.bgraModeRef,e&&r===O?1:0),i.uniform1i(this.cursorFlagRef,t),e||i.uniform1i(this.yuvmodeRef,r))},ui.prototype.SetVideoMode=function(e){this.videoMode=e},ui.prototype.GetVideoMode=function(e){return this.videoMode},ui.prototype.SetWatermarkRepeated=function(e){this.watermarkRepeated=e},ui.prototype.IsWatermarkRepeated=function(){return!!this.watermarkRepeated},ui.prototype.SetWatermarkOpacity=function(e){this.watermarkOpacity=e||.15},ui.prototype.GetWatermarkOpacity=function(){return this.watermarkOpacity},ui.prototype.SetWatermarkPosition=function(e){this.watermarkPosition=e||16},ui.prototype.GetWatermarkPosition=function(){return this.watermarkPosition},ui.prototype.SetMultiView=function(e){return this.isMultiView=e},ui.prototype.GetRepeatedWatermarkUniformValue=function(){return this.isMultiView?30:7},ui.prototype.GetRepeatedWatermarkTextureValue=function(e){return this.isMultiView?e.TEXTURE30:e.TEXTURE7},ui.prototype.setFillMode=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.fillMode=e,this.fillModeForResolution=t},ui.prototype.isUseFillMode=function(e){var t=e.width,r=e.height,i=e.rotation;if(!this.fillMode)return!1;if(!this.fillModeForResolution)return!0;if(!t||!r)return!1;var a=i===this.ROTATION_CLOCK90||i==this.ROTATION_CLOCK270?r/t:t/r;return(Array.isArray(this.fillModeForResolution)?this.fillModeForResolution:[this.fillModeForResolution]).some((function(e){return Math.abs(a-e)<.01}))};var hi=ui;function li(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;postMessage({status:61,errorMessage:e,errorEvent:t})}function pi(e){postMessage({status:35,data:e})}function fi(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];postMessage({status:-26,canvasId:e,replaceCanvas:t})}function mi(e){return e.split("/").pop().split("?")[0].split("#")[0]}var vi=0,gi=!1;try{gi=!1}catch(e){}function Si(e,t,r,i,a,n,o){var s,u,d,c;if(pi("instantiateCachedURL"),a)d=n,c=o;else if(s=self.wasmSuccessEvent,u=self.wasmFailEvent,d=self.databaseName,c=self.databaseDataType,mi(t).includes("audio")){var h={};h.databaseName=d,h.databaseDataType=c,h.dbVersion=e,h.url=t,postMessage({status:"AUDIO_WASM_INFO",data:h})}function l(e,t){return pi("fetch_wasm"),function(e){var t=self;return new Promise((function(r,i){t.addEventListener("message",(function(e){var t=e.data;"DOWNLOAD_WASM_FROM_MAIN_THREAD_OK"===t.command&&(pi("DE"),r(t.data)),"DOWNLOAD_WASM_FROM_MAIN_THREAD_FAILED"===t.command&&i(t.data)})),pi("DS"),postMessage({status:30,url:e})}))}(e)}function p(t){return pi("fetchAndInstantiate"+t),new Promise((function(n,o){try{if(indexedDB&&!gi){var s,u=void 0===IDBTransaction.READ_WRITE?"readwrite":IDBTransaction.READ_WRITE,h=indexedDB.open(d,e);h.onerror=function(e){pi("request error");var i=indexedDB.deleteDatabase(d);i.onerror=function(e){pi("rt error"),console.log("Error deleting database")},i.onsuccess=function(e){pi("rt success"),console.log("Database deleted successfully")},n(!a&&l(t).then((function(e){pi("CS");var t=WebAssembly.instantiate(e,r);return pi("CE"),t})))},h.onsuccess=function(e){if(pi("request success"),!(s=e.target.result).objectStoreNames.contains("file"))return a?void n(!1):void n(l(t).then((function(e){pi("CS");var t=WebAssembly.instantiate(e,r);pi("CE");try{s.objectStoreNames.contains("file")||indexedDB.deleteDatabase(d)}catch(e){}return t})));var o=s.transaction(["file"],u).objectStore("file").get(c);o.onsuccess=function(e){if(pi("getRet success"),o.result&&!i){pi("result ok");var d=e.target.result;if(a)return n(d);pi("CS");var h=WebAssembly.instantiate(d,r);return pi("CE"),n(h)}pi("result null"),n(!a&&l(t).then((function(e){s.transaction(["file"],u).objectStore("file").put(e,c),pi("CS");var t=WebAssembly.instantiate(e,r);return pi("CE"),t})))},o.onerror=function(e){pi("getRet error"),n(!a&&l(t).then((function(e){pi("CS");var t=WebAssembly.instantiate(e,r);return pi("CE"),t})))}},h.onupgradeneeded=function(e){var t;pi("request upgradeneeded"),(t=e.target.result).objectStoreNames.contains("file")&&t.deleteObjectStore("file"),t.createObjectStore("file")}}else{if(pi("indexedDB null"),a)return void n(!1);n(l(t).then((function(e){pi("CS");var t=WebAssembly.instantiate(e,r);return pi("CE"),t})))}}catch(e){if(postMessage({status:48,data:"error"}),a)return void n(!1);n(l(t).then((function(e){pi("CS");var t=WebAssembly.instantiate(e,r);return pi("CE"),t})))}}))}function f(e){!function(e,t){var r=e.exports;Module.asm=r,registerTLSInit(Module.asm._emscripten_tls_init),wasmTable=Module.asm.__indirect_function_table,addOnInit(Module.asm.__wasm_call_ctors),wasmModule=t,ENVIRONMENT_IS_PTHREAD||removeRunDependency("wasm-instantiate")}(e.instance,e.module)}function m(e){var t;t=e.instance,e.module,Module.asm=t.exports,wasmMemory=Module.asm.memory,updateGlobalBufferAndViews(wasmMemory.buffer),wasmTable=Module.asm.__indirect_function_table,addOnInit(Module.asm.__wasm_call_ctors),removeRunDependency("wasm-instantiate")}return a?p(t):p(t).then((function(e){var r=mi(t)||"";vi=0,r.includes("video.mt")?f(e):r.includes("video")?m(e):function(e,t){var r=e.exports;Module.asm=r,wasmTable=Module.asm.__indirect_function_table,addOnInit(Module.asm.__wasm_call_ctors),removeRunDependency("wasm-instantiate")}(e.instance),self.Fetch_WASM_OK=!0,postMessage({status:s})})).catch((function(i){li("Failed to instantiate WASM ".concat(t),i),i&&i instanceof WebAssembly.CompileError&&vi<3?(vi++,Si(e,t,r,!0)):postMessage({status:u})}))}var _i=function(){function e(t){p()(this,e),this.sharedBufferList=t}return m()(e,[{key:"storeFlexible",value:function(e,t){var r=e.byteLength-this.sharedBufferList.bytesPerElement;if(r>0){var i=Math.floor(.1*this.sharedBufferList.bytesPerElement),a=r>i?r:i;if(a+this.sharedBufferList.bytesPerElement>t)return Promise.reject("too big, more than maxBytesPerElement");this.sharedBufferList.increaseBufferSize(a)}return this.store(e)}},{key:"store",value:function(e){var t=this;return this.sharedBufferList.get().then((function(r){try{return t.obj=r,r.uint8s.set(e,0),t.yuvdata=new Uint8Array(r.uint8s.buffer,0,e.byteLength),!0}catch(e){throw e}finally{t.autoRecycle()}}))}},{key:"storeSync",value:function(e){var 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)}},{key:"autoRecycle",value:function(){var e=this;this.autoRecycleInterval=setTimeout((function(){console.log("autoRecycle",e.obj.index),e.recycle()}),5e3)}},{key:"recycle",value:function(){try{this.autoRecycleInterval&&clearInterval(this.autoRecycleInterval),this.sharedBufferList.recycle(this.obj.index)}catch(e){li("Error in YuvWrap.recycle: ".concat(e))}}}]),e}();var Ci=function(){function e(){p()(this,e),this.ssrcInfoMap=new Map,this.timer=null}return m()(e,[{key:"updateSSRCInfo",value:function(e,t){this.ssrcInfoMap.has(e)||this.ssrcInfoMap.set(e,{timeList:[],lastTime:0,fps:0}),this._calculateFPS(e,t),this._removeZeroFPS()}},{key:"_calculateFPS",value:function(e,t){var r=this.ssrcInfoMap.get(e);if(r.timeList.push(t),r.lastTime=t,r.timeList.length>2&&r.timeList.length%5==0){var i=r.timeList[0],a=r.timeList[r.timeList.length-1];if(a-i>=1e3){var n=Math.floor(1e3/((a-i)/(r.timeList.length-1)));r.fps!==n&&(this._notifyFPS(e,n),r.fps=n),r.timeList=[]}}r.timeList.length>30&&(r.timeList=r.timeList.slice(r.timeList.length-30))}},{key:"_removeZeroFPS",value:function(){var e=this;this.ssrcInfoMap.forEach((function(t,r){var i=e.ssrcInfoMap.get(r);i&&Date.now()-i.lastTime>2e3&&(e.ssrcInfoMap.delete(r),e._notifyFPS(r,0))}))}},{key:"_notifyFPS",value:function(e,t){postMessage({status:66.6,data:{ssrc:e,fps:t}})}},{key:"_checkIfNewFrameComing",value:function(){var e=this;this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout((function(){e._removeZeroFPS(),e.timer=null}),2500)}}]),e}();new Map,new Ci;function yi(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return bi(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return bi(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var i=0,a=function(){};return{s:a,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,n=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw n}}}}function bi(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}function Ai(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function ki(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ai(Object(r),!0).forEach((function(t){h()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ai(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ei=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:16/9;if(!e||!t)return null;var n=r||0,o=i||0;if(e/t>a){var s=t*a;return{width:s,height:t,left:Math.round((e-s)/2)+n,top:0+o}}var u=e/a;return{width:e,height:u,left:0+n,top:Math.round((t-u)/2)+o}};function wi(e){this.Notify_APPUI=e.Notify_APPUI,this.isSupportOffscreenCanvas=e.isSupportOffscreenCanvas,this.jsMediaEngine=e.jsMediaEngine,this.threadNumbs=e.videodecodethreadnumb,this.globalTracingLogger=e.globalTracingLogger,this.waterMarkCanvas=null,this.videoRenderLevel=10,this.videoRenderLevelCount=1,this.renderPeriodTotal=100,this.renderPeriodCount=0,this.renderPeriodTotalFps=0,this.renderPeriodFpsCount=0,this.lastRenderAudioTimeStamp=0,this.videoBufEmptyCount=0,this.videoBufCount=0,this.videoRenderMaxLevel=15,this.timestamp=0,this.audioPlayTime=0,this.videoTimestamp=0,this.videoWaterMarkName="",this.isCreateVideoWaterMark=!1,this.isWaterMarkRepeatedEnable=!1,this.waterMarkOpacity=.15,this.currentactive=0,this.currentVideoHeight=0,this.currentVideoWidth=0,this.videoRenderArray=[],this.WaterMarkRGBA=new si.a,this.vMonitorCount=0,this.videoQueue=new G,this.timestart=0,this.rendingFlag=!0,this.rAFID=0,this.rAFIDBack=null,this.prevRequestAnimationTimestap=0,this.retryRequestAnimationStep=2,this.renderMGR=null,this.ssrcDispalyMap=new Map,this.ssrcHaddataMap=new Map,this.selfvideossrc=0,this.localVideoPtr=0,this.sabBuffer=0,this.localvideossrc=0,this.encodedVideoSharedArrayBufferUint8Array=null,this.encodedVideoSharedArrayBufferUint16Array=null,this.encodedVideoSharedArrayWasmMemory=null,this.startCaptureVideo=!1,this.clearColor=new Uint8Array(4),this.videorendercanvas=null,this.keyrender=null,this.renderIndex=0,this.renderMode=0,this.intervalHandle,this.croppingParams={top:0,left:0,height:1,width:1},this.coordinate={x:0,y:0,width:640,height:360},this.isSupportVideoTrackReader=!1,this.bWebglContextLostProtectingMap=new Map,this.ismirror=!1,this.lfTimeStamp=0,this.activeFps=0,this.lastActiveSSRC=0,this.disableOriginalRatio=!1,this.enableReplaceCanvasWhenContextLost=e.enableReplaceCanvasWhenContextLost}wi.prototype.clearUseridRender=function(e,t){var r=e[0],i=r.display;if(i)if(i.SetWaterMarkFlag(0),this.renderMode)i.clearCanvas(t);else{var a=r.ssrc;if(!i||!t)return;this.croppingParams.top=0,this.croppingParams.left=0,this.croppingParams.height=1,this.croppingParams.width=1,this.clearColor[0]=255*t.R,this.clearColor[1]=255*t.G,this.clearColor[2]=255*t.B,this.clearColor[3]=255*t.A,i.UpdateSelfVideoTextures(1,1,this.clearColor,this.croppingParams);var n=this;this.ssrcDispalyMap.forEach((function(e,t){var r,i;n.Get_Logical_SSrc(t)==n.Get_Logical_SSrc(n.selfvideossrc)&&(r=!0),n.Get_Logical_SSrc(t)==n.Get_Logical_SSrc(a)&&(i=!0),e.forEach((function(e){if(e.haddata||i){var t=e.display;n.coordinate.x=e.x,n.coordinate.y=e.y,n.coordinate.width=e.width,n.coordinate.height=e.height,t&&(i?t.DrawSelfVideo(n.coordinate,!0):-1!=t.GetVideoMode()&&(-1==[T,O].indexOf(t.GetVideoMode())&&r?t.DrawSelfVideo(n.coordinate,!1,n.ismirror):r?t.DrawRemoteVideo(n.coordinate,n.ismirror):t.DrawRemoteVideo(n.coordinate)))}}))}))}},wi.prototype.Set_Render_Array_rAF=function(e){if(this.videoRenderArray=e,this.ssrcDispalyMap.clear(),this.ssrcHaddataMap.clear(),this.videoRenderArray.length>0)for(var t=0;t<this.videoRenderArray.length;t++){var r=this.ssrcDispalyMap.get(this.Get_Logical_SSrc(this.videoRenderArray[t].ssrc));r?r.push(this.videoRenderArray[t]):((r=[]).push(this.videoRenderArray[t]),this.ssrcDispalyMap.set(this.Get_Logical_SSrc(this.videoRenderArray[t].ssrc),r),this.ssrcHaddataMap.set(this.Get_Logical_SSrc(this.videoRenderArray[t].ssrc),!1))}},wi.prototype.Set_Render_Array=function(e,t){this.renderMode?this.Set_Render_Array_IntervalMode(e,t):this.Set_Render_Array_rAF(e)},wi.prototype.ClearQueue=function(){this.videoQueue&&this.videoQueue.ClearQueue(),this.currentVideoHeight=0,this.currentVideoWidth=0},wi.prototype.Put_Video_Into_Buffer=function(e){if(this.videoQueue){var t=this.videoQueue.GetQueue(e.ssrc);if(t||(t=this.videoQueue.AddQueue(e.ssrc)),t.enqueue(e),this.videoQueue&&this.videoQueue.ssrcInfo){var r=e.ssrc>>10;this.videoQueue.ssrcInfo.UpdateSSRCInfo(r,e.ntptime)}for(var i=this.videoQueue.GetQueueLength(e.ssrc)-10;i>=0;)i--}},wi.prototype.Update_RemoteVideo_Texture=function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(this.Check_Request_Animation(),r){if(e&&i){var a=this.Get_Logical_SSrc(i),n=this.ssrcDispalyMap.get(a);if(!n)return;var o=this;this.ssrcHaddataMap.set(a,!0);this.croppingParams.top=e.visibleRect?0:e.cropTop,this.croppingParams.left=e.visibleRect?0:e.cropLeft,this.croppingParams.height=e.visibleRect?e.visibleRect.height:e.cropHeight,this.croppingParams.width=e.visibleRect?e.visibleRect.width:e.cropWidth,n&&n.forEach((function(t){t.haddata=!0;var r=t.display;o.coordinate.x=t.x,o.coordinate.y=t.y,o.coordinate.width=t.width,o.coordinate.height=t.height,r&&(r.SetVideoMode(T),o.Should_Update_Watermark(r,t.width,t.height,t.width,t.height)&&o.Update_Display_Watermark(r,t.width,t.height,t.width,t.height),e&&r.UpdateRemoteVideoTexturesImageBitmap(o.croppingParams.width,o.croppingParams.height,e,o.croppingParams,e.rotation))}))}}else{if(e&&e.ssrc){var s,u=this.Get_Logical_SSrc(e.ssrc),d=this.ssrcDispalyMap.get(u);if(!d)return void(e.yuvdataptr&&Module._free(e.yuvdataptr));var c=!1,h=this;this.ssrcHaddataMap.set(u,!0);var l=e;this.croppingParams.top=l.r_y,this.croppingParams.left=l.r_x,this.croppingParams.height=l.r_h,this.croppingParams.width=l.r_w,(s=l).enableMultiDecodeVideoWithoutSAB?s.yuvdata=s.data:s.yuvdata=Module.HEAPU8.subarray(s.yuvdataptr,s.yuvdataptr+s.yuvlength),!s.yuvdata.length||s.yuvdata.length!=s.width*s.height*3/2||this.croppingParams.top<0||this.croppingParams.left<0||this.croppingParams.left+this.croppingParams.width>s.width||this.croppingParams.top+this.croppingParams.height>s.height||d&&d.forEach((function(e){e.haddata=!0;var r=e.display;h.coordinate.x=e.x,h.coordinate.y=e.y,h.coordinate.width=e.width,h.coordinate.height=e.height,r&&(r.SetVideoMode(1),t.Should_Update_Watermark(r,e.width,e.height,e.width,e.height)&&t.Update_Display_Watermark(r,e.width,e.height,e.width,e.height),s&&r.UpdateRemoteVideoTextures(s.width,s.height,h.croppingParams,s.yuvdata,s.rotation,s.yuv_limited,h.coordinate,c))}))}e.yuvdataptr&&Module._free(e.yuvdataptr)}},wi.prototype.Set_Cropping_Mode=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.disableOriginalRatio=!!e},wi.prototype.Update_Cropping_Params=function(){if(this.disableOriginalRatio){var e=Ei(this.croppingParams.width,this.croppingParams.height,this.croppingParams.left,this.croppingParams.top);e&&(this.croppingParams=ki(ki({},this.croppingParams),e))}},wi.prototype.Update_SelfVideo_Texture=function(e,t,r,i){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:T,n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(n?(this.croppingParams.top=n.top,this.croppingParams.left=n.left,this.croppingParams.width=n.width,this.croppingParams.height=n.height):(this.croppingParams.top=0,this.croppingParams.left=0,this.croppingParams.height=t,this.croppingParams.width=e),this.renderMode){for(var o=0;o<this.videoRenderArray.length;o++)if(this.Get_Logical_SSrc(this.videoRenderArray[o].ssrc)==this.Get_Logical_SSrc(i)){this.coordinate.x=this.videoRenderArray[o].x,this.coordinate.y=this.videoRenderArray[o].y,this.coordinate.width=this.videoRenderArray[o].width,this.coordinate.height=this.videoRenderArray[o].height,this.Update_Cropping_Params(),this.videoRenderArray[o].display.SetVideoMode(a);var s=this.videoRenderArray[o],u=s.display,d=s.width,c=s.height;this.Should_Update_Watermark(u,d,c,d,c)&&this.Update_Display_Watermark(u,d,c,d,c),-1!==[T,O].indexOf(a)?(this.videoRenderArray[o].display.UpdateSelfVideoTextures(e,t,r,this.croppingParams),this.videoRenderArray[o].enableMultiDecodeVideoWithoutSAB?this.videoRenderArray[o].firstFrame=!0:this.videoRenderArray[o].display.DrawSelfVideo(this.coordinate,!1,this.ismirror)):(this.videoRenderArray[o].display.UpdateRemoteVideoTextures(e,t,this.croppingParams,r,0,0,this.coordinate,!1),this.videoRenderArray[o].enableMultiDecodeVideoWithoutSAB?this.videoRenderArray[o].firstFrame=!0:this.videoRenderArray[o].display.DrawRemoteVideo(this.coordinate,this.ismirror))}}else if(r&&i){var h=this.ssrcDispalyMap.get(i);this.ssrcHaddataMap.set(i,!0);var l=this;h&&h.forEach((function(i){i.haddata=!0,l.coordinate.x=i.x,l.coordinate.y=i.y,l.coordinate.width=i.width,l.coordinate.height=i.height,l.Update_Cropping_Params();var n=i.display;n&&(n.SetVideoMode(a),l.Should_Update_Watermark(n,i.width,i.height,i.width,i.height)&&l.Update_Display_Watermark(n,i.width,i.height,i.width,i.height),-1!==[T,O].indexOf(a)?n.UpdateSelfVideoTextures(e,t,r,l.croppingParams):n.UpdateRemoteVideoTextures(e,t,l.croppingParams,r,0,!0,l.coordinate,!1))}))}},wi.prototype.Draw_Send_Video_Img=function(e,t,r,i){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:T,n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;this.Update_SelfVideo_Texture(t,r,e,i,a,n)},wi.prototype.setMirrorMyVideoOption=function(e){this.ismirror=e},wi.prototype.Start_Draw=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;return this.rendingFlag=!0,this.renderMode=e,e?t?(this.intervalHandle=setInterval(this.JsMediaSDK_VideoRender_interval.bind(this),t),this.intervalHandle):null:(xi(this),this.Start_Request_Animation_Frame())},wi.prototype.Stop_Draw=function(){this.rendingFlag=!1,this.renderMode?clearInterval(this.intervalHandle):this.Stop_Request_Animation_Frame()},wi.prototype.webGLContextLostProtect=function(e,t){var r=this;this.bWebglContextLostProtectingMap.get(e)||(this.bWebglContextLostProtectingMap.set(e,t),this.renderMode||(e.addEventListener("webglcontextlost",(function(i){console.log("webglcontextlost",t),r.rAFID&&r.Stop_Request_Animation_Frame(),r.enableReplaceCanvasWhenContextLost?(e.contextLostTimer&&(clearTimeout(e.contextLostTimer),e.contextLostTimer=null),e.contextLostTimer=setTimeout((function(){e.contextLostTimer=null,fi(t,!0)}),3e3)):fi(t),i.preventDefault()}),{capture:!1}),e.addEventListener("webglcontextrestored",(function(i){console.log("webglcontextrestored",t),r.enableReplaceCanvasWhenContextLost?e.contextLostTimer&&(clearTimeout(e.contextLostTimer),e.contextLostTimer=null,fi(t,!0)):r.Restored_From_Context_Lost(e,e,t)}),{capture:!1})))},wi.prototype._Replace_Video_Render_Array_From_Context_LOST=function(e){for(var t=e.canvas,r=e.oldCanvas,i=e.newDisplayMap,a=0;a<this.videoRenderArray.length;a++)if(this.videoRenderArray[a].canvas===r||this.videoRenderArray[a].canvas===t){r!==t&&(this.videoRenderArray[a].canvas=t);var n=this.videoRenderArray[a].display.fillMode;this.videoRenderArray[a].display=i?i.get(this.videoRenderArray[a].display.textureindex):this._Create_H264_Canvas({videoRenderArrayIndex:a,canvas:t,canvasId:this.videoRenderArray[a].rendercanvasID}),n&&this.videoRenderArray[a].display&&this.videoRenderArray[a].display.setFillMode(n,this.videoRenderArray[a].display.fillModeForResolution)}},wi.prototype.Restored_From_Context_Lost=function(e,t,r){if(this.renderMode)this._Replace_Video_Render_Array_From_Context_LOST({canvas:e,oldCanvas:t});else{var i=new Map,a=new hi(e,0,void 0,void 0);a.contextGL||function(e){postMessage({status:-27,canvasId:e})}(r),a.SetMultiView(!0),i.set(0,a);for(var n=2;n<=this.threadNumbs;n++){var o=new hi(e,n,void 0,void 0,{program:a.shaderProgram,contextgl:a.contextGL,vBuffer:a.vertexPosBuffer,tBuffer:a.texturePosBuffer,waterMarkTextureRef:a.waterMarkTextureRef,repeatedWaterMarkTextureRef:a.repeatedWaterMarkTextureRef});o.SetMultiView(!0),i.set(n,o)}var s=this.renderMGR.get(t);s[0]=s[0].map((function(e){return i.get(e.textureindex)})),s[1]=s[1].map((function(e){return i.get(e.textureindex)})),t!==e&&(this.renderMGR.delete(t),this.renderMGR.set(e,s)),this.ssrcDispalyMap.forEach((function(r,a){r.forEach((function(r){if(r.haddata=!1,r.canvas===t){t!==e&&(r.canvas=e);var a=r.display;r.display=i.get(a.textureindex)}}))})),this._Replace_Video_Render_Array_From_Context_LOST({canvas:e,oldCanvas:t,newDisplayMap:i}),this.rendingFlag&&this.Start_Request_Animation_Frame()}},wi.prototype.Replace_Canvas=function(e,t){var r=this,i=null;this.bWebglContextLostProtectingMap.forEach((function(e,a){e===t&&(i=a,r.bWebglContextLostProtectingMap.delete(a))})),i&&(this.webGLContextLostProtect(e,t),this.Restored_From_Context_Lost(e,i,t)),this.isSupportOffscreenCanvas&&(this.waterMarkCanvas||this.videorendercanvas)&&(this.waterMarkCanvas=this.videorendercanvas=new OffscreenCanvas(640,360))},wi.prototype.Get_Display=function(e,t){var r;this.renderMGR||(this.renderMGR=new Map),this.webGLContextLostProtect(e,t);var i=this.renderMGR.get(e);if(!i){var a=[];i=[a,[]],this.renderMGR.set(e,i);var n=new hi(e,0,void 0,void 0);n.SetMultiView(!0),a.push(n);for(var o=2;o<=this.threadNumbs;o++){var s=new hi(e,o,void 0,void 0,{program:n.shaderProgram,contextgl:n.contextGL,vBuffer:n.vertexPosBuffer,tBuffer:n.texturePosBuffer,waterMarkTextureRef:n.waterMarkTextureRef,repeatedWaterMarkTextureRef:n.repeatedWaterMarkTextureRef});s.SetMultiView(!0),a.push(s)}}var u=this.renderMGR.get(e),d=u[0],c=u[1];return u&&(d[0]&&(r=d.shift()),c.push(r)),r||this.Log_Error("No Display obtained from VideoRender.Get_Display"),r},wi.prototype.GiveBack_Display=function(e){if(this.renderMGR){var t=e[0];if(t&&t.display){t.display.SetWaterMarkFlag(0),t.display.SetVideoMode(-1);var r=this.renderMGR.get(t.canvas);if(r){var i=r[0],a=r[1];a&&a.some((function(e,r){if(e===t.display)return a.splice(r,1),!0})),i.push(t.display)}}}},wi.prototype.Get_Logical_SSrc=function(e){return e?e>>10<<10:-1},wi.prototype.Set_LocalVideo_Ptr=function(e){e&&(this.localVideoPtr=e)},wi.prototype.Set_LocalVideo_Buffer=function(e){e&&(this.encodedVideoSharedArrayWasmMemory=e,this.sabBuffer=e.buffer,this.encodedVideoSharedArrayBufferUint8Array=new Uint8Array(this.sabBuffer),this.encodedVideoSharedArrayBufferUint16Array=new Uint16Array(this.sabBuffer))},wi.prototype.Set_LocalVideo_SSRC=function(e){e&&(this.localvideossrc=e,this.selfvideossrc=e)},wi.prototype.Draw_LocalVideo=function(){if(this.localVideoPtr&&this.sabBuffer&&this.localvideossrc){this.encodedVideoSharedArrayWasmMemory&&this.encodedVideoSharedArrayWasmMemory.buffer!=this.sabBuffer&&(this.encodedVideoSharedArrayBufferUint8Array=new Uint8Array(this.encodedVideoSharedArrayWasmMemory.buffer),this.encodedVideoSharedArrayBufferUint16Array=new Uint16Array(this.encodedVideoSharedArrayWasmMemory.buffer),this.sabBuffer=this.encodedVideoSharedArrayWasmMemory.buffer);var e=Atomics.load(this.encodedVideoSharedArrayBufferUint8Array,this.localVideoPtr),t=!0;if(e==Atomics.load(this.encodedVideoSharedArrayBufferUint8Array,this.localVideoPtr+1)&&(t=!1),t){var r=0,i=this.encodedVideoSharedArrayBufferUint16Array[this.localVideoPtr/2+(4+8294414*e)/2],a=this.encodedVideoSharedArrayBufferUint16Array[this.localVideoPtr/2+(4+8294414*e+2)/2],n=this.encodedVideoSharedArrayBufferUint16Array[this.localVideoPtr/2+(4+8294414*e+4)/2],o=this.encodedVideoSharedArrayBufferUint16Array[this.localVideoPtr/2+(4+8294414*e+6)/2],s=this.encodedVideoSharedArrayBufferUint16Array[this.localVideoPtr/2+(4+8294414*e+8)/2],u=this.encodedVideoSharedArrayBufferUint16Array[this.localVideoPtr/2+(4+8294414*e+10)/2],d=this.encodedVideoSharedArrayBufferUint16Array[this.localVideoPtr/2+(4+8294414*e+12)/2];r=d&&d!==O?i*a*3/2:i*a*4,this.croppingParams.top=n,this.croppingParams.left=o,this.croppingParams.height=u,this.croppingParams.width=s;var c=this.encodedVideoSharedArrayBufferUint8Array.subarray(this.localVideoPtr+4+8294414*e+4+8,this.localVideoPtr+4+8294414*e+4+8+r);this.Update_SelfVideo_Texture(i,a,c,this.Get_Logical_SSrc(this.localvideossrc),d,this.croppingParams),Atomics.store(this.encodedVideoSharedArrayBufferUint8Array,this.localVideoPtr,(e+1)%10)}}},wi.prototype.Update_LocalVideo=function(e){var t=this.localvideossrc;this.Update_RemoteVideo_Texture(e,!0,t)},wi.prototype.Set_Capture_Video_Flag=function(e){this.startCaptureVideo=e},wi.prototype.Get_Capture_Video_Flag=function(){return this.startCaptureVideo},wi.prototype.JsMediaSDK_VideoRender_interval=function(){if(this.startCaptureVideo&&this.Draw_LocalVideo(),0!=this.videoRenderArray.length)for(var e=0;e<this.videoRenderArray.length;e++){var t=this.videoRenderArray[e],r=t.display,i=t.canvas,a=t.enableMultiDecodeVideoWithoutSAB,n=t.ssrc,o=t.isMyself,s=null;if(this.Get_Logical_SSrc(n)===this.Get_Logical_SSrc(this.currentactive)){var u=Date.now();if(this.jsMediaEngine){var d=this.jsMediaEngine.Get_Video_SSRC_Latest_Time();this.timestamp=d.currentSSRCTime,this.audioPlayTime=d.audioPlayTime}this.calPacingTime(u),u-this.timestart<this.pacingTime||(s=this.Get_Decoded_Video_Frame(this.Get_Logical_SSrc(n)),this.timestart=u)}else s=this.Get_Decoded_Video_Frame(this.Get_Logical_SSrc(n));if(s){this.Get_Logical_SSrc(n)===this.Get_Logical_SSrc(this.currentactive)&&(this.videoTimestamp=s.ntptime);var c=void 0;c=s.yuvdata instanceof _i?s.yuvdata.yuvdata:s.yuvdata,this.croppingParams.top=s.r_y,this.croppingParams.left=s.r_x,this.croppingParams.height=s.r_h,this.croppingParams.width=s.r_w;var h=s.width>s.height&&(1===s.rotation||3===s.rotation)||s.width<s.height&&1!==s.rotation&&3!==s.rotation,l=h?s.height:s.width,p=h?s.width:s.height,f=i.width,m=i.height;this.Should_Update_Watermark(r,l,p,f,m)&&this.Update_Display_Watermark(r,l,p,f,m),this.currentVideoHeight==this.croppingParams.height&&this.currentVideoWidth==this.croppingParams.width||(this.Notify_APPUI?this.Notify_APPUI(P.rb,{width:this.croppingParams.width,height:this.croppingParams.height}):postMessage({status:50,width:this.croppingParams.width,height:this.croppingParams.height}),this.currentVideoHeight=this.croppingParams.height,this.currentVideoWidth=this.croppingParams.width),c.length==s.width*s.height*3/2&&s.r_x>=0&&s.r_y>=0&&s.r_x+s.r_w<=s.width&&s.r_y+s.r_h<=s.height?(8400==this.vMonitorCount&&(this.jsMediaEngine?this.jsMediaEngine.Send_Render_Monitor_Log("VDGLM"):postMessage({status:51,data:"VDGLW"}),this.vMonitorCount=0),this.vMonitorCount++,a?r&&(r.SetVideoMode(1),r.UpdateRemoteVideoTextures(s.width,s.height,this.croppingParams,c,s.rotation,s.yuv_limited),t.firstFrame=!0):(t.display.SetVideoMode(1),t.display.drawNextOuptutPictureGL(s.width,s.height,this.croppingParams,c,s.rotation,s.yuv_limited,t))):this.Log_Error("Invalid YUV data: ".concat(s.r_x," ").concat(s.r_y," ").concat(s.r_w," ").concat(s.r_h," ").concat(s.width," ").concat(s.height)),s.yuvdata instanceof _i&&s.yuvdata.recycle()}if(a&&t.firstFrame){var v={x:t.x,y:t.y,width:t.width,height:t.height};o?r.DrawSelfVideo(v):r.DrawRemoteVideo(v)}}},wi.prototype.Get_Decoded_Video_Frame=function(e){if(this.videoQueue){var t=this.videoQueue.GetQueue(e);return t?t.dequeue():null}},wi.prototype.Set_SSRC_Latest_Time_Stamp=function(e){this.timestamp!==e&&"number"==typeof e&&(this.timestamp=e,this.audioPlayTime=Date.now())},wi.prototype.Get_Decoded_Video_Buffer_Length=function(e){return this.videoQueue?this.videoQueue.GetQueueLength(e):0},wi.prototype.Get_SSRC_VIDEO_FPS=function(e){if(e>>=10,this.videoQueue&&this.videoQueue.ssrcInfo){var t=this.videoQueue.ssrcInfo.GetSSRCFpsInfo(e);if(t)return Math.round(t)}return 0},wi.prototype.Change_Current_SSRC=function(e){this.currentactive=e,this.ClearQueue()},wi.prototype.Set_Render_Array_IntervalMode=function(e,t){if(this.videoRenderArray=e,this.renderMode&&this.videoRenderArray.length>0)for(var r=0;r<this.videoRenderArray.length;r++){var i=this.videoRenderArray[r];t?i.display||(i.enableMultiDecodeVideoWithoutSAB=t,i.display=this.Get_Display(i.canvas,i.canvas.id),i.display&&i.display.setFillMode(i.fillMode,i.fillModeForResolution)):(i.display=this._Create_H264_Canvas({videoRenderArrayIndex:r,canvas:i.canvas,canvasId:i.rendercanvasID}),this.webGLContextLostProtect(i.canvas,i.rendercanvasID))}},wi.prototype._Create_H264_Canvas=function(e){var t=e.videoRenderArrayIndex,r=e.canvas,i=e.canvasId;return new hi(r,0,void 0,{webglcontextlostCallback:this.webglcontextlostCallback.bind(this),webglcontextrestoredCallback:this.webglcontextrestoredCallback.bind(this),params:{videoRenderArrayIndex:t,canvas:r,canvasId:i}})},wi.prototype.webglcontextlostCallback=function(e,t){var r=t.canvas,i=t.canvasId;this.renderMode&&this.enableReplaceCanvasWhenContextLost&&r&&i&&(r.contextLostTimer&&(clearTimeout(r.contextLostTimer),r.contextLostTimer=null),r.contextLostTimer=setTimeout((function(){r.contextLostTimer=null,fi(i,!0)}),3e3))},wi.prototype.webglcontextrestoredCallback=function(e,t){var r=t.videoRenderArrayIndex,i=t.canvas,a=t.canvasId;this.renderMode&&(this.enableReplaceCanvasWhenContextLost&&i&&a?i.contextLostTimer&&(clearTimeout(i.contextLostTimer),i.contextLostTimer=null,fi(a,!0)):this.videoRenderArray[r].display=this._Create_H264_Canvas({videoRenderArrayIndex:r,canvas:i,canvasId:a}))},wi.prototype.ClearQueue=function(){try{var e,t=yi(this.videoQueue.ssrcQueueMap);try{for(t.s();!(e=t.n()).done;)for(var r=x()(e.value,2),i=(r[0],r[1]);!i.isEmpty();){var a=i.dequeue();a.yuvdata&&a.yuvdata instanceof _i&&a.yuvdata.recycle()}}catch(e){t.e(e)}finally{t.f()}}catch(e){this.Log_Error("Exception during VideoRender.ClearQueue",e)}this.videoQueue&&this.videoQueue.ClearQueue(),this.currentVideoHeight=0,this.currentVideoWidth=0},wi.prototype.Set_WaterMark_Info=function(e){var t=e.waterMarkCanvas,r=e.isCreateVideoWaterMark,i=e.videoWaterMarkName,a=e.watermarkOpacity,n=e.watermarkRepeated,o=e.watermarkPosition;this.waterMarkCanvas=t||this.videorendercanvas,this.isCreateVideoWaterMark=r,this.videoWaterMarkName=i,void 0!==n&&(this.isWaterMarkRepeatedEnable=!!n),void 0!==a&&(this.waterMarkOpacity=a),void 0!==o&&(this.watermarkPosition=o)},wi.prototype.Set_WaterMark_Flag=function(e){if(this.videoRenderArray.length>0)for(var t=0;t<this.videoRenderArray.length;t++){this.videoRenderArray[t].display.SetWaterMarkFlag(e?1:0)}},wi.prototype.Should_Watermark_Repeated=function(e,t){return this.isWaterMarkRepeatedEnable&&e>306&&t>202};var Ii=function(e,t){if(e<640&&e){var r=640/e;e=640,t=Math.round(t*r)}return{width:e,height:t}};wi.prototype.Update_Display_Watermark=function(e,t,r,i,a){var n=this.Should_Watermark_Repeated(i,a);this.waterMarkCanvas||this.videorendercanvas||(this.videorendercanvas=this.isSupportOffscreenCanvas?new OffscreenCanvas(640,360):null);var o=i<512||a<288?16:this.watermarkPosition,s=this.waterMarkCanvas||this.videorendercanvas;if(!("function"==typeof OffscreenCanvas&&s instanceof OffscreenCanvas&&OffscreenCanvasRenderingContext2D)||OffscreenCanvasRenderingContext2D.prototype.measureText){var u=Ii(t,r);t=u.width,r=u.height;var d=n?this.WaterMarkRGBA.Get_Repeated_WaterMarkRGBA({canvas:s,name:this.videoWaterMarkName,width:t,height:r,opacity:this.waterMarkOpacity,position:o}):this.WaterMarkRGBA.Get_WaterMarkRGBA({canvas:s,name:this.videoWaterMarkName,width:t,height:r,opacity:this.waterMarkOpacity,position:o});e.updateWatherMark(t,r,d)}},wi.prototype.Should_Update_Watermark=function(e,t,r,i,a){if(!this.isCreateVideoWaterMark)return!1;var n=!1,o=Ii(t,r);o.width===e.watermarkWidth&&o.height===e.watermarkHeight||(n=!0);var s=this.Should_Watermark_Repeated(i,a);e.IsSetWaterMark()||(n=!0),s!==e.IsWatermarkRepeated()&&(n=!0,e.SetWatermarkRepeated(s)),this.waterMarkOpacity&&this.waterMarkOpacity!==e.GetWatermarkOpacity()&&(n=!0,e.SetWatermarkOpacity(this.waterMarkOpacity));var u=t<512||r<288?16:this.watermarkPosition;return u!==e.GetWatermarkPosition()&&(n=!0,e.SetWatermarkPosition(u)),n},wi.prototype.Put_Video_Data_Queue=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30;if(this.videoQueue){var r=this.videoQueue.GetQueue(e.ssrc);if(r||(r=this.videoQueue.AddQueue(e.ssrc)),r.enqueue(e),this.Get_Logical_SSrc(this.currentactive)==this.Get_Logical_SSrc(e.ssrc)&&(this.Get_Logical_SSrc(this.lastActiveSSRC)!=this.Get_Logical_SSrc(e.ssrc)&&(this.lfTimeStamp=0,this.activeFps=0),this.lastActiveSSRC=this.currentactive,this.lfTimeStamp&&(this.activeFps?this.activeFps=500/(e.ntptime-this.lfTimeStamp)+this.activeFps/2:this.activeFps=1e3/(e.ntptime-this.lfTimeStamp)),this.lfTimeStamp=e.ntptime),this.videoQueue&&this.videoQueue.ssrcInfo){var i=e.ssrc>>10;this.videoQueue.ssrcInfo.UpdateSSRCInfo(i,e.ntptime)}for(var a=this.videoQueue.GetQueueLength(e.ssrc),n=a-t;n>=0;){var o=this.Get_Decoded_Video_Frame(e.ssrc);o.yuvdata instanceof _i&&o.yuvdata.recycle(),n--}}else e.yuvdata&&e.yuvdata instanceof _i&&e.yuvdata.recycle()},wi.prototype.Set_VideoTrackReader=function(e){this.isSupportVideoTrackReader=e},wi.prototype.Clear_OffScreenCavas=function(e){if(this.renderMGR&&this.renderMGR.get(e)){var t=this.renderMGR.get(e);if(t){var r=t[0],i=t[1];i.forEach((function(e){e.cleanup()})),r.forEach((function(e){e.cleanup()})),r=[],i=[],this.renderMGR.delete(e)}}e.width=1,e.height=1},wi.prototype.Zoom_Render=function(e){},wi.prototype.Decode_Ssrc=function(e){return this.ssrcDispalyMap.has(this.Get_Logical_SSrc(e))||this.Get_Logical_SSrc(e)==this.Get_Logical_SSrc(this.selfvideossrc)};var Di,Mi="undefined"==typeof window;function Ri(e){var t=Date.now(),r=Di;if(r.rendingFlag){try{r.startCaptureVideo&&r.localVideoPtr&&r.Draw_LocalVideo(),r.ssrcDispalyMap.forEach((function(e,i){var a;if(r.Get_Logical_SSrc(i)==r.Get_Logical_SSrc(r.selfvideossrc)&&(a=!0),r.Get_Logical_SSrc(i)===r.Get_Logical_SSrc(r.currentactive))if(r.calPacingTime(t),t-r.timestart<r.pacingTime);else{r.timestart=t;var n=r.Get_Decoded_Video_Frame(r.Get_Logical_SSrc(i));n&&(r.Update_RemoteVideo_Texture(n),r.videoTimestamp=n.ntptime)}else{var o=r.Get_Decoded_Video_Frame(r.Get_Logical_SSrc(i));o&&r.Update_RemoteVideo_Texture(o)}e.forEach((function(e){if(e.haddata){var t=e.display;r.coordinate.x=e.x,r.coordinate.y=e.y,r.coordinate.width=e.width,r.coordinate.height=e.height,t&&-1!=t.GetVideoMode()&&(a&&-1!==[T,O].indexOf(t.GetVideoMode())?t.DrawSelfVideo(r.coordinate,!1,r.ismirror):a?t.DrawRemoteVideo(r.coordinate,r.ismirror):t.DrawRemoteVideo(r.coordinate))}}))}))}catch(e){r.Log_Error("Exception while rendering video",e)}r.Start_Request_Animation_Frame(e)}else r.rAFID&&r.Stop_Request_Animation_Frame()}function xi(e){return!!e&&(Di=e,!0)}wi.prototype.Check_Request_Animation=function(){if(Mi&&this.rendingFlag&&this.rAFID&&this.prevRequestAnimationTimestap){var e=performance.now()-this.prevRequestAnimationTimestap;e>1e3&&!this.rAFIDBack&&(postMessage({status:MONITOR_MESSAGE,data:"WCL_M,RCIF"}),console.log("Request_Animation_stop"),this.rAFIDBack=setInterval(Ri.bind(null,!0),30)),this.rAFIDBack&&e>=1e3*this.retryRequestAnimationStep&&(this.retryRequestAnimationStep<=32?this.retryRequestAnimationStep*=2:this.retryRequestAnimationStep+=30,this.Start_Request_Animation_Frame(!1,!0))}},wi.prototype.Start_Request_Animation_Frame=function(e,t){if(!e&&this.rAFIDBack&&(console.log("Request_Animation_start"),this.Stop_Request_Animation_Frame_Backup()),!this.rAFIDBack)return t||(this.retryRequestAnimationStep=2),this.prevRequestAnimationTimestap=performance.now(),this.rAFID=requestAnimationFrame(Ri),this.rAFID},wi.prototype.Stop_Request_Animation_Frame_Backup=function(){this.rAFIDBack&&(clearInterval(this.rAFIDBack),this.rAFIDBack=null)},wi.prototype.Stop_Request_Animation_Frame=function(){cancelAnimationFrame(this.rAFID),this.rAFID=0,this.prevRequestAnimationTimestap=0,this.retryRequestAnimationStep=2,this.Stop_Request_Animation_Frame_Backup()},wi.prototype.Log_Error=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.globalTracingLogger?this.globalTracingLogger.error(e,t):li(e,t)},wi.prototype.calPacingTime=function(e){if(this.pacingTime=30,this.activeFps&&this.activeFps>0&&this.activeFps<100&&(this.pacingTime=1e3/this.activeFps),this.timestamp&&this.videoTimestamp){var t=this.timestamp+e-this.audioPlayTime,r=this.videoTimestamp+this.pacingTime-t,i=this.videoQueue.GetQueueLength(this.Get_Logical_SSrc(this.currentactive));r>65&&r<1e4&&i>=1&&(this.pacingTime=1.5*this.pacingTime),r<-65&&(this.pacingTime=1*this.pacingTime/2)}else this.timestamp||(this.pacingTime>150?this.pacingTime=1*this.pacingTime/2:this.pacingTime=this.pacingTime-10)};var Pi=wi;function Ti(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Oi(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Oi(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var i=0,a=function(){};return{s:a,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,n=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw n}}}}function Oi(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}function Vi(e){this.Notify_APPUI=e.Notify_APPUI,this.PubSub=e.PubSub,this.jsMediaEngine=e.jsMediaEngine,this.globalTracingLogger=e.globalTracingLogger,this.currentshareactive=0,this.isFromMainSession=0,this.sharingWidthAndHeightInfo={logicHeight:0,logicWidth:0},this.currentSharingHeight=0,this.currentSharingWidth=0,this.currentSharingLogicHeight=0,this.currentSharingLogicWidth=0,this.isCreateSharingWaterMark=!1,this.sharingWaterMarkName="",this.isWaterMarkRepeatedEnable=!1,this.waterMarkOpacity=.15,this.SharingCanvasSizeInfo=null,this.Cursorx=null,this.Cursory=null,this.CursorWidth=null,this.CursorHeight=null,this.xratio=1,this.yratio=1,this.sharingDisplay=null,this.mouseQueue=new Q,this.sharingQueue=new Q,this.WaterMarkRGBA=new si.a,this.sMonitorCount=0,this.mMonitorCount=0,this.firstFrameForIOS=!1,this.timestart=0,this.asTime=0,this.rAFID=0,this.requestAnimation=!1,this.requestF=this.No_Bindthis_RAF.bind(this),this.cATimeStamp=0,this.lRTimeStamp=0,this.pacingtime=1,this.sharingFps=0,this.lfTimeStamp=0,this.maxQueueLength=0,this.vaTimeDelta=0,this.renderMode=0,this.SharingRenderInterval=0}Vi.prototype.Start_Draw=function(){return this.requestAnimation=!0,this.Start_Request_Animation_Frame()},Vi.prototype.Stop_Draw=function(){return this.requestAnimation=!1,this.lRTimeStamp=0,this.cATimeStamp=0,this.Stop_Request_Animation_Frame()},Vi.prototype.Start_Request_Animation_Frame=function(){return this.rAFID=requestAnimationFrame(this.requestF),this.rAFID},Vi.prototype.Stop_Request_Animation_Frame=function(){this.rAFID&&(cancelAnimationFrame(this.rAFID),this.rAFID=0)},Vi.prototype.No_Bindthis_RAF=function(){var e=performance.now();this.requestAnimation?(this.calPacingTime(e),e-this.timestart>this.pacingtime&&(this.timestart=e,this.JsMediaSDK_SharingRender()),this.Start_Request_Animation_Frame()):this.Stop_Request_Animation_Frame()},Vi.prototype.No_Bindthis_Interval=function(){var e=performance.now();this.calPacingTime(e),e-this.timestart>this.pacingtime&&(this.timestart=e,this.JsMediaSDK_SharingRender())},Vi.prototype.calPacingTime=function(e){this.pacingtime=30,this.sharingFps&&this.sharingFps>0&&this.sharingFps<100&&(this.pacingtime=1e3/this.sharingFps);var t=this.Get_Current_QueueLength();if(this.cATimeStamp&&this.lRTimeStamp){var r=this.cATimeStamp+e-this.asTime;this.vaTimeDelta=this.lRTimeStamp+this.pacingtime-r,this.vaTimeDelta>65&&this.vaTimeDelta<1e4&&t>1&&(this.pacingtime=1.5*this.pacingtime),this.vaTimeDelta<-65&&(this.pacingtime=1*this.pacingtime/2)}else this.cATimeStamp||(this.pacingtime>150||t>20?this.pacingtime=1*this.pacingtime/2:this.pacingtime=this.pacingtime-10)},Vi.prototype.JsMediaSDK_SharingRender=function(){if(this.sharingDisplay){var e=this.Get_Decoded_Sharing_Frame(this.currentshareactive),t=this.Get_Decoded_Mouse_Frame(this.currentshareactive);if(e){var r,i;this.lRTimeStamp=e.ntptime,e.yuvdata instanceof _i?(r=e.yuvdata.yuvdata,i=e.yuvdata):(r=e.yuvdata,i=null),this.sharingWidthAndHeightInfo.logicWidth==e.logic_w&&this.sharingWidthAndHeightInfo.logicHeight==e.logic_h||(this.PubSub?PubSub.publish(P.Xc,{body:{width:e.logic_w,height:e.logic_h,logicWidth:e.logic_w,logicHeight:e.logic_h}}):(postMessage({status:52,logicWidth:e.logic_w,logicHeight:e.logic_h}),this.updateOffscreenCanvasSize(e.logic_w,e.logic_h)),this.sharingWidthAndHeightInfo.logicWidth=e.logic_w,this.sharingWidthAndHeightInfo.logicHeight=e.logic_h);var a=e.logic_h,n=e.logic_w,o=e.r_h,s=e.r_w;this.xratio=s/n,this.yratio=o/a;var u={top:e.r_x,left:e.r_y,height:e.r_h,width:e.r_w};this.currentSharingHeight==e.r_h&&this.currentSharingWidth==e.r_w&&this.currentSharingLogicHeight==e.logic_h&&this.currentSharingLogicWidth==e.logic_w||(this.Notify_APPUI?this.Notify_APPUI(P.Wc,{body:{height:e.logic_h,width:e.logic_w,logicHeight:e.logic_h,logicWidth:e.logic_w}}):(postMessage({status:52,logicWidth:e.logic_w,logicHeight:e.logic_h}),this.updateOffscreenCanvasSize(e.logic_w,e.logic_h)),this.currentSharingHeight=e.r_h,this.currentSharingWidth=e.r_w,this.currentSharingLogicHeight=e.logic_h,this.currentSharingLogicWidth=e.logic_w);var d=this.SharingCanvasSizeInfo?this.SharingCanvasSizeInfo.width:e.r_w,c=this.SharingCanvasSizeInfo?this.SharingCanvasSizeInfo.height:e.r_h;this.Should_Update_Watermark(this.sharingDisplay,d,c)&&this.Update_Display_Watermark(this.sharingDisplay,d,c),3e3==this.sMonitorCount&&(this.jsMediaEngine?this.jsMediaEngine.Send_Render_Monitor_Log("SDIMM"):postMessage({status:53,data:"SDIMW"}),this.sMonitorCount=0),this.sMonitorCount++,this.sharingDisplay.drawNextOuptutPictureGL(e.width,e.height,u,r,null,e.yuv_limited),i&&i.recycle(),e.dataptr&&Module._free(e.dataptr)}t&&(this.Cursorx=t.r_x*this.xratio,this.Cursory=t.r_y*this.yratio,this.CursorWidth=t.width*this.xratio,this.CursorHeight=t.height*this.yratio,this.sharingDisplay.updateCursor(t.width,t.height,t.buffer),3e3==this.mMonitorCount&&(this.jsMediaEngine?this.jsMediaEngine.Send_Render_Monitor_Log("SDSBM"):postMessage({status:53,data:"SDSBW"}),this.mMonitorCount=0),this.mMonitorCount++,this.sharingDisplay.draw(1,this.Cursorx,this.Cursory,this.CursorWidth,this.CursorHeight))}},Vi.prototype.setOnlyAcceptUISize=function(e){this.bOnlyAcceptUISize=e},Vi.prototype.updateOffscreenCanvasSize=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.bOnlyAcceptUISize&&!r)return console.log("drop logic w/h");try{var i=this.sharingDisplay.canvasElement;i&&i instanceof OffscreenCanvas&&(i.width=e,i.height=t)}catch(e){this.Log_Error("Error updating OffscreenCanvas size",e)}},Vi.prototype.Set_Render_WebGL=function(e){this.sharingDisplay=e},Vi.prototype.Change_Current_SSRC=function(e,t){this.currentshareactive=e,this.currentSharingHeight=0,this.currentSharingWidth=0,this.currentSharingLogicHeight=0,this.currentSharingLogicWidth=0,this.isFromMainSession=t,this.firstFrameForIOS=!1,this.ClearQueue()},Vi.prototype.Set_WaterMark_Info=function(e){var t=e.waterMarkCanvas,r=e.isCreateSharingWaterMark,i=e.sharingWaterMarkName,a=e.watermarkOpacity,n=e.watermarkRepeated,o=e.watermarkPosition;r||(this.SharingCanvasSizeInfo=null),this.Replace_WaterMark_Canvas(t),this.isCreateSharingWaterMark=r,this.sharingWaterMarkName=i,void 0!==n&&(this.isWaterMarkRepeatedEnable=!!n),void 0!==a&&(this.waterMarkOpacity=a),void 0!==o&&(this.watermarkPosition=o)},Vi.prototype.Replace_WaterMark_Canvas=function(e){this.waterMarkCanvas=e},Vi.prototype.Set_WaterMark_Flag=function(e){this.sharingDisplay.SetWaterMarkFlag(e?1:0)},Vi.prototype.Should_Watermark_Repeated=function(e,t){return this.isWaterMarkRepeatedEnable&&e>306&&t>202};var Ni=function(e,t){if(e<640&&e){var r=640/e;e=640,t=Math.round(t*r)}return{width:e,height:t}};Vi.prototype.Update_Display_Watermark=function(e,t,r){if(!("function"==typeof OffscreenCanvas&&this.waterMarkCanvas instanceof OffscreenCanvas&&OffscreenCanvasRenderingContext2D)||OffscreenCanvasRenderingContext2D.prototype.measureText){var i=t<512||r<288?16:this.watermarkPosition,a=this.Should_Watermark_Repeated(t,r),n=Ni(t,r);t=n.width,r=n.height;var o=a?this.WaterMarkRGBA.Get_Repeated_WaterMarkRGBA({canvas:this.waterMarkCanvas,name:this.sharingWaterMarkName,width:t,height:r,opacity:this.waterMarkOpacity,position:i}):this.WaterMarkRGBA.Get_WaterMarkRGBA({canvas:this.waterMarkCanvas,name:this.sharingWaterMarkName,width:t,height:r,opacity:this.waterMarkOpacity,position:i});e.updateWatherMark(t,r,o)}},Vi.prototype.Should_Update_Watermark=function(e,t,r){if(!this.isCreateSharingWaterMark)return!1;var i=!1,a=Ni(t,r);a.width===e.watermarkWidth&&a.height===e.watermarkHeight||(i=!0);var n=this.Should_Watermark_Repeated(t,r);e.IsSetWaterMark()||(i=!0),n!==e.IsWatermarkRepeated()&&(i=!0,e.SetWatermarkRepeated(n)),this.waterMarkOpacity&&this.waterMarkOpacity!==e.GetWatermarkOpacity()&&(i=!0,e.SetWatermarkOpacity(this.waterMarkOpacity));var o=t<512||r<288?16:this.watermarkPosition;return o!==e.GetWatermarkPosition()&&(i=!0,e.SetWatermarkPosition(o)),i},Vi.prototype.Update_Sharing_Canvas_Size=function(e){var t=e.width,r=e.height;this.SharingCanvasSizeInfo={width:Math.round(t),height:Math.round(r)}},Vi.prototype.ClearQueue=function(){try{var e,t=Ti(this.sharingQueue.ssrcQueueMap);try{for(t.s();!(e=t.n()).done;)for(var r=x()(e.value,2),i=(r[0],r[1]);!i.isEmpty();){var a=i.dequeue();a.yuvdata&&a.yuvdata instanceof _i&&a.yuvdata.recycle(),a.dataptr&&Module._free(a.dataptr)}}catch(e){t.e(e)}finally{t.f()}}catch(e){this.Log_Error("Exception from SharingRender.ClearQueue",e)}this.sharingQueue&&this.sharingQueue.ClearQueue(),this.mouseQueue&&this.mouseQueue.ClearQueue(),this.currentSharingHeight=0,this.currentSharingWidth=0,this.currentSharingLogicHeight=0,this.currentSharingLogicWidth=0},Vi.prototype.Get_Decoded_Sharing_Frame=function(e){if(this.sharingQueue){var t=this.GetLogicalSSRCPart(e,this.isFromMainSession),r=this.sharingQueue.GetQueue(t);return r?r.dequeue():null}},Vi.prototype.Get_Decoded_Mouse_Frame=function(e){if(this.mouseQueue){var t=this.GetLogicalSSRCPart(e,this.isFromMainSession),r=this.mouseQueue.GetQueue(t);return r?r.dequeue():null}},Vi.prototype.Put_Sharing_Data_From_Queue=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50;if(this.sharingQueue){var r=this.GetLogicalSSRCPart(e.ssrc,e.isFromMainSession);this.firstFrameForIOS||r!=this.currentshareactive>>10||(this.firstFrameForIOS=!0,this.Notify_APPUI?this.Notify_APPUI(P.Gb,this.currentshareactive):postMessage({status:78,ssrc:this.currentshareactive}));var i=this.sharingQueue.GetQueue(r);i||(i=this.sharingQueue.AddQueue(r)),i.enqueue(e),this.lfTimeStamp&&(this.sharingFps?this.sharingFps=500/(e.ntptime-this.lfTimeStamp)+this.sharingFps/2:this.sharingFps=1e3/(e.ntptime-this.lfTimeStamp)),this.sharingFps!=1/0&&this.sharingFps||(this.sharingFps=20),this.lfTimeStamp=e.ntptime;var a=this.sharingQueue.GetQueueLength(r),n=a-t;for(this.maxQueueLength=t;n>=0;){var o=this.Get_Decoded_Sharing_Frame(e.ssrc);o.yuvdata instanceof _i&&o.yuvdata.recycle(),o.dataptr&&Module._free(o.dataptr),n--}}},Vi.prototype.Get_Current_QueueLength=function(){if(this.sharingQueue){var e=this.currentshareactive,t=this.GetLogicalSSRCPart(e,this.isFromMainSession);return this.sharingQueue.GetQueueLength(t)}},Vi.prototype.Put_Mouse_Data_Into_Queue=function(e){if(this.mouseQueue){var t=this.GetLogicalSSRCPart(e.ssrc,e.isFromMainSession),r=this.mouseQueue.GetQueue(t);r||(r=this.mouseQueue.AddQueue(t)),r.enqueue(e);for(var i=this.mouseQueue.GetQueueLength(t)-10;i>=0;)this.Get_Decoded_Mouse_Frame(e.ssrc),i--}},Vi.prototype.GetLogicalSSRCPart=function(e,t){var r=e>>10;return t&&(r|=1<<23),r},Vi.prototype.SetcATimeStamp=function(e){this.cATimeStamp=e,this.asTime=performance.now()},Vi.prototype.Log_Error=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.globalTracingLogger?this.globalTracingLogger.error(e,t):li(e,t)},Vi.prototype.setMode=function(e){this.Stop_Draw2(),this.mode=e},Vi.prototype.Start_Draw2=function(e){var t=this;this.mode?(this.SharingRenderInterval&&(clearInterval(this.SharingRenderInterval),this.SharingRenderInterval=0),this.SharingRenderInterval=setInterval((function(){t.No_Bindthis_Interval()}),20)):this.Start_Draw()},Vi.prototype.Stop_Draw2=function(e){this.mode?this.SharingRenderInterval&&(clearInterval(this.SharingRenderInterval),this.SharingRenderInterval=0):this.Stop_Draw()};var Li=Vi,Wi=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1500,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:t.byteLength,s=arguments.length>6?arguments[6]:void 0;p()(this,e),this.offset=n,this._BYTES_PER_ELEMENT=r,this.capacity=(o-8)/r,this.usableCapacity=this.capacity-1,this.buf=t,this.write_ptr=new Uint32Array(this.buf,n,1),this.read_ptr=new Uint32Array(this.buf,n+4,1),this.storageUint8sByteOffset=n+8,this.storageUint8s=new Uint8Array(this.buf,this.storageUint8sByteOffset,o-8),this.byteLength=o,this.label=i,this.usingOneElementBuffer=a,s&&(this.wasmMemory=s),a&&(this.oneElementBuffer=new ArrayBuffer(r)),this.repushhander=0,this.repushlogcount=0,this.monitorpace=0}return m()(e,[{key:"checkBuffer",value:function(){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))}},{key:"enqueue",value:function(e){return this.available_write()>0&&this.push(e),{rd:Atomics.load(this.read_ptr,0),wr:Atomics.load(this.write_ptr,0)}}},{key:"enqueueSafe",value:function(e){var t=this,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;for(this.dataBuffer||(this.dataBuffer=new W.a);this.dataBuffer.getLength()>0&&this.available_write()>0;){var a=this.dataBuffer.dequeue();a&&this.push(a)}var n=this.dataBuffer.getLength();if(e){if(this.available_write()>0&&0==n)return this.push(e),!0;if(!r)return!1;this.dataBuffer.enqueue(e),++n}if(n>0&&!this.repushhander&&(this.repushhander=setTimeout((function(){t.repushlogcount%10==0&&console.warn("<<< retry consume cache data"),t.repushlogcount++,t.repushhander=0,t.enqueueSafe(null)}),30)),n>=1e3&&(Z.a.error("Cached data in SAB reached critical value, will be cleared"),this.dataBuffer.clear(),i("vqslclear")),n>0&&i){var o=performance.now();(!this.monitorpace||o-this.monitorpace>2e4)&&(this.monitorpace=o,i("vqsl"+n))}return!0}},{key:"push",value:function(e){return e instanceof Array?this._pushArray(e):this._push(e)}},{key:"_pushArray",value:function(e){var t=this,r=Atomics.load(this.write_ptr,0);this.checkBuffer();var i=0;e.forEach((function(e){t.storageUint8s.set(e,r*t._BYTES_PER_ELEMENT+8+4+i),i+=e.byteLength})),new Uint32Array(this.buf,this.offset+r*this._BYTES_PER_ELEMENT+8,1)[0]=i;var a=(r+1)%this.capacity;return Atomics.store(this.write_ptr,0,a),!0}},{key:"_push",value:function(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;var r=(t+1)%this.capacity;return Atomics.store(this.write_ptr,0,r),!0}},{key:"addReadPtr",value:function(){var e=Atomics.load(this.read_ptr,0);Atomics.store(this.read_ptr,0,(e+1)%this.capacity)}},{key:"dequeue",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=Atomics.load(this.read_ptr,0);this.checkBuffer();var r,i,a,n=new Uint32Array(this.buf,this.offset+t*this._BYTES_PER_ELEMENT+8,1);if(e){r=this.oneElementBuffer?new Uint8Array(this.oneElementBuffer,0,n[0]):new Uint8Array(n[0]);var o=new Uint8Array(this.storageUint8s.buffer,t*this._BYTES_PER_ELEMENT+8+4+this.storageUint8sByteOffset,r.byteLength);r.set(o,0)}else r=this.storageUint8s.subarray(t*this._BYTES_PER_ELEMENT+8+4,t*this._BYTES_PER_ELEMENT+8+4+n[0]),i=t*this._BYTES_PER_ELEMENT+8+4+this.storageUint8sByteOffset,a=t*this._BYTES_PER_ELEMENT+8+4+n[0]+this.storageUint8sByteOffset;return e&&Atomics.store(this.read_ptr,0,(t+1)%this.capacity),e?r:{bCopyData:e,uint8s:r,begin:i,end:a}}},{key:"available_read",value:function(){var e=Atomics.load(this.read_ptr,0),t=Atomics.load(this.write_ptr,0);return this._available_read(e,t)}},{key:"available_write",value:function(){var e=Atomics.load(this.read_ptr,0),t=Atomics.load(this.write_ptr,0);return this._available_write(e,t)}},{key:"is_available_write",value:function(){var e=Atomics.load(this.read_ptr,0),t=Atomics.load(this.write_ptr,0);return this._is_available_write(e,t)}},{key:"_available_read",value:function(e,t){return(t+this.capacity-e)%this.capacity}},{key:"_available_write",value:function(e,t){return this.usableCapacity-this._available_read(e,t)}},{key:"_is_available_write",value:function(e,t){return this._available_write(e,t)>0}},{key:"_storage_capacity",value:function(){return this.capacity}}],[{key:"getStorageForCapacity",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:80,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1500,r=8+(e+1)*t;return new SharedArrayBuffer(r)}}]),e}(),Ui=function(){function e(t,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:50,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:80;if(p()(this,e),!(t instanceof Wi))throw new Error("RingBuffer required");this.rb=t,this.dataCallback=r,this.interval=null,this.requestID=null,this.timeout_call=i,this.tick_lasted_time=0,this.timeoutMS=a,this.maxCount=n}return m()(e,[{key:"consume",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.interval||(this.bCopyData=r,this.interval=setInterval((function(){var t=performance.now();if(e.timeout_call){if(0!=e.tick_lasted_time){var r=t-e.tick_lasted_time;r>=e.timeoutMS&&e.timeout_call(r,t)}e.tick_lasted_time=t}e._dequeue()}),t),console.log("consume interval ".concat(this.interval)))}},{key:"consumeAll",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.bCopyData=e,this._dequeue()}},{key:"_dequeue",value:function(){var e=Math.min(this.rb.available_read(),this.maxCount);for(this.consoume_count=0;this.consoume_count<e;){this.consoume_count++;var t=this.rb.dequeue(this.bCopyData);this.dataCallback(t),this.bCopyData||this.rb.addReadPtr()}}},{key:"_consumeForAnimationFrame",value:function(){this._dequeue(),this.requestID=requestAnimationFrame(this._consumeForAnimationFrame.bind(this))}},{key:"consumeUsingRequestAnimationFrame",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.requestID||(this.bCopyData=e,this._consumeForAnimationFrame())}},{key:"cancelConsume",value:function(){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}}]),e}(),Fi=function(){function e(){p()(this,e),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}return m()(e,[{key:"setOBJ",value:function(e){this.obj=e,this.yuvUint8s=e.data}},{key:"setBuffer",value:function(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)}},{key:"buffer2Obj",value:function(){var e=new Uint32Array(this.objUint8s.buffer,this.begin,9),t=new DataView(this.objUint8s.buffer,this.begin+40,16),r={};this.keysList.forEach((function(t,i){r[t]=e[i]})),r[this.timeStampKey]=Number(t.getBigUint64(0,!0));var i,a=Number(t.getBigUint64(8,!0)),n=new Uint8Array(this.objUint8s.buffer,this.begin+40+8+8,a);return i=(this.bCopyData,n),r.data=i,r}},{key:"obj2buffer",value:function(){var e=this,t=new Uint8Array(56),r=this.keysList,i=new Uint32Array(t.buffer,0,9),a=new DataView(t.buffer,40,16);return r.forEach((function(t,r){i[r]=e.obj[t]})),a.setBigUint64(0,BigInt(this.obj[this.timeStampKey]),!0),a.setBigUint64(8,BigInt(this.yuvUint8s.byteLength),!0),[t,this.yuvUint8s]}}]),e}();function Bi(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Gi(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Gi(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var i=0,a=function(){};return{s:a,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,n=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw n}}}}function Gi(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}var Hi,ji,Ki=function(e,t){return re.add_monitor("AB"+e)},qi=J.g.isSupportOffscreenCanvas(),Qi=J.g.getMacSafariMajorVersion(),zi=J.g.browser.isSafari&&Qi&&Qi<16,Xi=(Hi=[],ji=Date.now(),function(e){if(Hi.push(e),Date.now()-ji>14e3){var t=Hi.reduce((function(e,t,r){var i=t.rtt,a=t.ssrcMap,n="";return Object.keys(a).forEach((function(e){var t=a[e],r=t.aveAudioLevel,i=t.audioLevel,o=t.aveJitterBufferDelay,s=t.jitter,u=t.packetsLost,d=t.packetsReceived,c=t.bytesReceived;n+="{".concat(e,"},").concat(i,",").concat(r,",").concat(s,",").concat(o,",").concat(u,",").concat(d,",").concat(c)})),e+"".concat(i||"").concat(n?",".concat(n):"")+(r<Hi.length-1?"||":"")}),"WCL_AB, {[NETWORK]},");ji=Date.now(),ee.a.sendMessageToRwg(P.fc,{evt:4167,seq:1,body:{data:t}}),Hi=[]}}),Ji=function(){var e=[],t=Date.now();return function(r){if(e.push(r),Date.now()-t>14e3){var i=e.reduce((function(t,r,i){var a=r.rtt,n=r.bytesSent;return t+"".concat(a||"",",").concat(void 0===n?"":n)+(i<e.length-1?"||":"")}),"WCL_AB, {[SEND]},");t=Date.now(),ee.a.sendMessageToRwg(P.fc,{evt:4167,seq:1,body:{data:i}}),e=[]}}}(),Yi={bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",sdpSemantics:"unified-plan",iceServers:[],iceTransportPolicy:"all"};var Zi=function(){function e(t,r,i,a,n,o){var s=this;p()(this,e),this.publisherCandidate=[],this.subscriberCandidate=[],this.retry=0,this.retryPublish=0,this.nginxHost=t,this.rwgHost=r,this.conId=i,this.wsUrl=o?"wss://".concat(r,"/ab/signal?rwg=").concat(r,"&cid=").concat(i):"wss://".concat(t,"/ab/signal?rwg=").concat(r,"&cid=").concat(i),this.audioPlayerMap=new Map,this.onError=null,this.isRetrying=!1,this.recvOnly=!!a,this.audioCtx=new(window.AudioContext||window.webkitAudioContext),this.destination=this.audioCtx.createMediaStreamDestination(),this.monitorTimer=null,this.monitorTimerDuration=5e3,this.monitorInfo={subscriber:{},publisher:{}},this.muted=!1,this.audioMuteStatus=new Map,this.ssrcUserIdMap=new Map,this.published=!1,this.joinAudioAfterConnect=!1,this.isJoinAudio=!1,this.isMultiView=!!n,this.normalAudioMap=new Map,this.shareAudioMap=new Map,this.syncTimer=null,zi&&(this.monitorAudio=new Audio),this.hasPaused=!1,this.cleanUserEventListener=function(e){var t=document.body,r=["click","contextmenu","auxclick","dblclick","mousedown","mouseup","touchend","keydown","keyup"];function i(){e()}return r.forEach((function(e){return t.addEventListener(e,i,!1)})),function(){r.forEach((function(e){return t.removeEventListener(e,i)}))}}(this.playAllRemoteAudio.bind(this)),document.addEventListener("visibilitychange",(function(){"visible"===document.visibilityState&&s.hasPaused&&s.isJoinAudio&&s.playAllRemoteAudio()}))}var t,r,i,a;return m()(e,[{key:"playAllRemoteAudio",value:function(){var e=this;if(this.hasPaused&&this.isJoinAudio){J.g.isIphoneOrIpadSafari()&&navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then((function(){return Ki("RECOK")})).catch((function(){return Ki("RECERR")}));var t=Array.from(this.audioPlayerMap.values()).map((function(e){if(e.paused)return e.play()}));Promise.all(t).then((function(){e.hasPaused=!1})).catch((function(t){e.hasPaused=!0,ee.a.Notify_APPUI&&(Ki("REA"),ee.a.Notify_APPUI(P.wc))}))}}},{key:"reconnect",value:(a=d()(g.a.mark((function e(t){return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isRetrying&&!this.isDestroyed){e.next=2;break}return e.abrupt("return");case 2:if(!(this.retry>=3)){e.next=7;break}return this.isRetrying=!1,console.error("audio bridge:::: reconnect by error: ",t),ee.a.Notify_APPUI&&ee.a.Notify_APPUI(P.Pe),e.abrupt("return");case 7:return this.isRetrying=!0,e.next=10,J.g.sleep(3e3);case 10:if(!this.isDestroyed){e.next=12;break}return e.abrupt("return");case 12:return Ki("JOIN"+this.retry),this.retry++,ee.a.Notify_APPUI&&ee.a.Notify_APPUI(P.Oe),this.publisher&&(this.sender&&(this.publisher.removeTrack(this.sender),this.sender=null),this.publisher.close(),this.publisher=null),this.subscriber&&(this.subscriber.close(),this.subscriber=null),e.next=19,this.join(!0);case 19:this.isRetrying=!1;case 20:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"join",value:(i=d()(g.a.mark((function e(t,r){var i,a,n=this,o=arguments;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=o.length>2&&void 0!==o[2]&&o[2],this.stopDestoryOldSignalTimer(),this.isJoinAudio=i,!this.signal){e.next=11;break}return this.isDestroyed=!1,this.signal.isDestroyed=!1,this.signal.isJoinAudio=i,i&&(this.startAVSyncTimer(),this.signal.socket&&1===this.signal.socket.readyState&&this.signal.notify("audiostatus",{status:1})),this.startAudioQualityMonitorTimer(),this.unmuteAllRemoteAudio(),e.abrupt("return");case 11:if(t){e.next=17;break}if(this.joinAudioAfterConnect=i,!this.isRetrying){e.next=17;break}return this.destroySocketAndWebRtcConnect(t),this.isDestroyed=!1,e.abrupt("return");case 17:if(this.destroySocketAndWebRtcConnect(t),this.isDestroyed=!1,Ki("INIT"+",".concat(this.nginxHost)+",".concat(this.rwgHost)+",".concat(this.conId)+",".concat(r)),this.signal=new ea(this.joinAudioAfterConnect),this.joinAudioAfterConnect&&this.startAVSyncTimer(),this.joinAudioAfterConnect=!1,e.prev=23,!r){e.next=28;break}a=r,e.next=33;break;case 28:return ee.a.sendMessageToRwg(P.zc,{evt:P.af},!1),e.next=31,this.waitForTokenFromRWG(P.vc.AUDIO_BRIDGE_WS_TOKEN);case 31:a=e.sent,Ki("TK");case 33:this.signal.init("".concat(this.wsUrl,"&token=").concat(a)),e.next=39;break;case 36:e.prev=36,e.t0=e.catch(23),this.reconnect(e.t0);case 39:this.signal.onopen(function(){var e=d()(g.a.mark((function e(t){return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.startAudioQualityMonitorTimer(),n.isOpen=!0,n.retryPublish=0,!n.audioStream&&!n.recvOnly){e.next=10;break}return n.clearAudioPlayerMap(),n.setAudioStream(n.audioStream),e.next=8,n.publish();case 8:n.retry=0,ee.a.Notify_APPUI&&n.signal.isJoinAudio&&ee.a.Notify_APPUI(P.Ne);case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),this.signal.onclose((function(e){n.signal=null,n.published=!1,n.stopAudioQualityMonitorTimer(),n.stopAVSyncTimer(),e&&n.reconnect(e)})),this.signal.onerror((function(e){n.signal=null,n.published=!1,n.stopAudioQualityMonitorTimer(),n.stopAVSyncTimer(),e&&n.reconnect(e)})),this.signal.on_notify("command",(function(e){var t=(e||{}).data;if(t)try{(JSON.parse(t)||{}).evt===P.cf&&n.destroy(!1)}catch(e){}})),this.signal.UpdateNTP=function(e,t,r,i){512&r?n.shareAudioMap.set(r>>10,{ntptime:e,rtptime:t,abssrc:i}):n.normalAudioMap.set(r>>10,{ntptime:e,rtptime:t,abssrc:i})},this.publisher&&this.sender&&(this.publisher.removeTrack(this.sender),this.sender=null),this.publisher=new RTCPeerConnection(Yi),this.subscriber=new RTCPeerConnection(Yi),this.signal.onOffer=function(){var e=d()(g.a.mark((function e(t){var r;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Ki("RERSDP"),n.updateSsrcUserIdMap(t),e.next=4,n.subscriber.setRemoteDescription(t);case 4:return n.subscriberCandidate.forEach((function(e){return n.subscriber.addIceCandidate(e)})),n.subscriberCandidate=[],e.next=8,n.subscriber.createAnswer();case 8:return r=e.sent,e.next=11,n.subscriber.setLocalDescription(r);case 11:return Ki("RELSDP"),e.next=14,n.rpc("answer",{desc:r});case 14:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.signal.onTrickle=function(){var e=d()(g.a.mark((function e(t,r){return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:0==r?null!=n.subscriber.remoteDescription?(Ki("RERICE"),n.subscriber.addIceCandidate(t)):(Ki("RERICEF"),n.subscriberCandidate.push(t)):1==r?null!=n.publisher.remoteDescription?(Ki("SERICE"),n.publisher.addIceCandidate(t)):(Ki("SERICEF"),n.publisherCandidate.push(t)):console.error("audio bridge:::: onTrickle ERROR!!!! role:",r,", candidate:",t);case 1:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),this.publisher.onicecandidate=function(e){var t=e.candidate;Ki("SELICE"),n.signal.notify("trickle",{candidate:t,role:1})},this.publisher.onconnectionstatechange=function(){Ki("PCSC:"+n.publisher.connectionState),n.publisher&&("disconnected"===n.publisher.connectionState?setTimeout((function(){n.publisher&&"disconnected"===n.publisher.connectionState&&n.publish(!0)}),5e3):"connected"===n.publisher.connectionState&&(n.signal.isRtcConnected=!0,n.publisher.firstConnected||(n.publisher.firstConnected=!0,ee.a.Notify_APPUI(P.g))))},this.subscriber.onicecandidate=function(e){var t=e.candidate;Ki("RELICE"),n.signal.notify("trickle",{candidate:t,role:0})},this.subscriber.ontrack=function(e){Ki("REVT");var t=e.streams[0],r=decodeURIComponent(t.id),i="ab-audio-"+r;e.track.onunmute=function(){var e=n.audioPlayerMap.get(r);e?e.srcObject=t:((e=document.createElement("audio")).addEventListener("playing",(function(){Ki("ASP:"+i)})),e.addEventListener("pause",(function(){Ki("APP:"+i),e.pause(),e.removeAttribute("autoplay"),n.hasPaused=!0})),e.addEventListener("canplay",(function(){Ki("ACP:"+i)})),e.id=i,e.srcObject=t,e.autoplay=!0,e.controls=!1,n.audioPlayerMap.set(r,e),document.documentElement.appendChild(e)),n.isDestroyed&&(e.muted=!0),Ki("REVTP")},e.track.onmute=function(){Ki("REVTM");var e=n.audioPlayerMap.get(r);e&&e.remove(),n.audioPlayerMap.delete(r)}},this.subscriber.onconnectionstatechange=function(){Ki("SCSC:"+n.subscriber.connectionState),n.subscriber&&"connected"===n.subscriber.connectionState&&!n.subscriber.firstConnected&&(n.subscriber.firstConnected=!0,ee.a.Notify_APPUI(P.h))};case 54:case"end":return e.stop()}}),e,this,[[23,36]])}))),function(e,t){return i.apply(this,arguments)})},{key:"leaveAudioWithoutDisconnect",value:function(){this.isJoinAudio=!1,this.signal&&this.signal.isJoinAudio&&(this.signal.isJoinAudio=!1,this.signal.leaveTime=Date.now(),this.signal.notify("audiostatus",{status:0})),this.setAudioStream(null,!0),this.muteAllRemoteAudio(),this.stopAudioQualityMonitorTimer(),this.stopAVSyncTimer()}},{key:"rpc",value:(r=d()(g.a.mark((function e(t){var r,i=arguments;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=i.length>1&&void 0!==i[1]?i[1]:[],e.prev=1,this.signal){e.next=5;break}return console.error("audio bridge:::: RPC ERROR, signal NULL",t,r),e.abrupt("return","");case 5:return e.abrupt("return",this.signal.call(t,r));case 8:return e.prev=8,e.t0=e.catch(1),console.error("audio bridge:::: RPC err",t,r,e.t0),e.abrupt("return","");case 12:case"end":return e.stop()}}),e,this,[[1,8]])}))),function(e){return r.apply(this,arguments)})},{key:"publish",value:(t=d()(g.a.mark((function e(t){var r,i,a,n=this;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.publisher&&this.isOpen){e.next=2;break}return e.abrupt("return");case 2:if(!t){e.next=6;break}if(!(this.retryPublish>=3)){e.next=5;break}return e.abrupt("return");case 5:this.retryPublish++;case 6:if(t){e.next=10;break}if(!this.published){e.next=9;break}return e.abrupt("return");case 9:this.published=!0;case 10:return e.next=12,this.publisher.createOffer({iceRestart:!!t});case 12:return(r=e.sent).sdp=r.sdp.replace("a=fmtp:111 minptime=10;useinbandfec=1","a=fmtp:111 minptime=10;useinbandfec=1;maxaveragebitrate=48000;maxplaybackrate=24000;sprop-maxcapturerate=24000"),e.next=16,this.publisher.setLocalDescription(r);case 16:return this.uid||t||(this.uid=$i()),Ki("SELSDP"),e.next=20,t?this.rpc("offer",{desc:this.publisher.localDescription}):this.rpc("join",{uid:this.uid,offer:this.publisher.localDescription});case 20:if(!(i=e.sent)||2!==i.length){e.next=32;break}if(i[0],"answer"!==(a=i[1]).type){e.next=32;break}return Ki("SERSDP"),e.next=28,this.publisher.setRemoteDescription(a);case 28:this.publisherCandidate.forEach((function(e){return n.publisher.addIceCandidate(e)})),this.publisherCandidate=[],this.setAudioStream(this.audioStream),this.ping();case 32:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"waitForTokenFromRWG",value:function(e){return new Promise((function(t,r){$.a.on(e,(function(e,r){t(r)}))}))}},{key:"ping",value:function(){var e=this;null!=this.signal&&this.signal.notify("ping",{}),this.pingTimeout&&clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout((function(){e.ping()}),15e3)}},{key:"setRecvOnly",value:function(e,t){this.recvOnly=!!e,this.recvOnly?this.setAudioStream(null,!0):t&&this.setAudioStream(t)}},{key:"setAudioStream",value:function(e,t){var r=this;this.recvOnly||t?this.audioStream=this.destination.stream:this.audioStream=e,this.monitorAudio&&(this.monitorAudio.srcObject=this.audioStream,this.monitorAudio.muted=!0,this.monitorAudio.paused&&this.monitorAudio.play());var i=null;i=this.audioStream&&this.audioStream.id!==this.destination.stream.id?"T":"F",this.publisher&&this.audioStream.getTracks().forEach((function(e){r.sender?(Ki("PRAT"+i),r.sender.replaceTrack(e).catch((function(e){Ki("RATE")}))):(Ki("PAAT"+i),r.sender=r.publisher.addTrack(e,r.audioStream))}))}},{key:"mute",value:function(){this.audioStream&&(Ki("SEVTP"),this.muted=!0,this.audioStream.getAudioTracks().forEach((function(e){e.enabled=!1})))}},{key:"unmute",value:function(){this.audioStream&&(Ki("SEVTM"),this.muted=!1,this.audioStream.getAudioTracks().forEach((function(e){e.enabled=!0})))}},{key:"stopIncomingAudio",value:function(e){e?this.muteAllRemoteAudio():this.unmuteAllRemoteAudio()}},{key:"muteAllRemoteAudio",value:function(){var e,t=Bi(this.audioPlayerMap);try{for(t.s();!(e=t.n()).done;){var r=x()(e.value,2);r[0];r[1].muted=!0}}catch(e){t.e(e)}finally{t.f()}}},{key:"unmuteAllRemoteAudio",value:function(){var e,t=Bi(this.audioPlayerMap);try{for(t.s();!(e=t.n()).done;){var r=x()(e.value,2);r[0];r[1].muted=!1}}catch(e){t.e(e)}finally{t.f()}this.playAllRemoteAudio()}},{key:"setSpeechVolumeLevel",value:function(e,t){var r,i=Bi(this.audioPlayerMap);try{for(i.s();!(r=i.n()).done;){var a=x()(r.value,2),n=a[0],o=a[1],s=Number(n.split("+")[0]||"0"),u=Number.isNaN(s)||!s?null:s>>10<<10;if(u&&u===e>>10<<10){var d=Math.min(Math.max(0,t),100)/100;o.volume=d;break}}}catch(e){i.e(e)}finally{i.f()}}},{key:"changeSpeaker",value:function(e){var t,r=Bi(this.audioPlayerMap);try{for(r.s();!(t=r.n()).done;){var i=x()(t.value,2);i[0];i[1].setSinkId(e).catch((function(e){Z.a.error("Error when setting sink of audio player",e)}))}}catch(e){r.e(e)}finally{r.f()}}},{key:"updateSsrcUserIdMap",value:function(e){var t=this;if(e){var r=e.sdp,i=(void 0===r?"":r).match(/a=ssrc:(.+) cname:(.+)/g);i&&i.forEach((function(e){var r=e.match(/a=ssrc:(.+) cname:(.+)/);if(r&&r[1]&&r[2]){var i=Number(r[2].split("+")[0]||"0"),a=Number.isNaN(i)||!i?null:i>>10<<10,n=Number(r[1]);t.ssrcUserIdMap.set(n,a)}}))}}},{key:"updateUserMuteUnmuteStatus",value:function(e){var t=this,r=e.update,i=e.remove;r&&r.length>0&&r.forEach((function(e){var r=e.userId,i=e.muted;r&&t.audioMuteStatus.set(r>>10<<10,!!i)})),i&&i.length>0&&i.forEach((function(e){var r=e.userId;r&&t.audioMuteStatus.set(r>>10<<10,!0)}))}},{key:"isUserMuted",value:function(e){var t=this.ssrcUserIdMap.get(e);if(!t)return!1;var r=this.audioMuteStatus.get(t);return void 0!==r&&!!r}},{key:"clearAudioPlayerMap",value:function(){this.muteAllRemoteAudio();var e,t=Bi(this.audioPlayerMap);try{for(t.s();!(e=t.n()).done;){var r=x()(e.value,2);r[0];r[1].remove()}}catch(e){t.e(e)}finally{t.f()}this.audioPlayerMap.clear(),this.audioMuteStatus.clear()}},{key:"destroySocketAndWebRtcConnect",value:function(e){this.published=!1,this.pingTimeout&&(clearTimeout(this.pingTimeout),this.pingTimeout=null);try{this.sender&&(this.publisher.removeTrack(this.sender),this.sender=null)}catch(e){}this.publisher&&(this.publisher.close(),this.publisher=null),this.subscriber&&(this.subscriber.close(),this.subscriber=null),this.isOpen=!1,e||(this.retry=0),this.retryPublish=0,this.signal&&(this.signal.isDestroyed=!0,this.signal.destroy(),this.signal=null),this.ssrcUserIdMap.clear()}},{key:"stopDestoryOldSignalTimer",value:function(){this.destroyOldSignalTimer&&(clearTimeout(this.destroyOldSignalTimer),this.destroyOldSignalTimer=null)}},{key:"startDestoryOldSignalTimer",value:function(){var e=this;this.stopDestoryOldSignalTimer(),this.destroyOldSignalTimer=setTimeout((function(){e.stopDestoryOldSignalTimer(),e.destroySocketAndWebRtcConnect()}),15e3)}},{key:"destroy",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];Ki("DS"),this.cleanUserEventListener(),this.isDestroyed=!0,this.signal&&(this.signal.isDestroyed=!0),this.stopAudioQualityMonitorTimer(),this.stopAVSyncTimer(),this.stopDestoryOldSignalTimer(),e?(this.muteAllRemoteAudio(),this.setAudioStream(null,!0),this.startDestoryOldSignalTimer()):(this.clearAudioPlayerMap(),this.destroySocketAndWebRtcConnect(),this.audioCtx&&(this.audioCtx.close(),this.audioCtx=null,this.destination=null,this.recvOnly=!1))}},{key:"startAudioQualityMonitorTimer",value:function(){var e=this;this.stopAudioQualityMonitorTimer(),this.monitorTimer=setInterval((function(){e.publisher&&e.publisher.getStats().then((function(t){if(t){var r={},i=!1,a=e.monitorInfo.publisher;t.forEach((function(t){var n=t.totalRoundTripTime,o=t.responsesReceived,s=t.bytesSent,u=t.timestamp,d=t.localCandidateId,c=t.remoteCandidateId,h=t.type,l=t.state,p=t.nominated;if("candidate-pair"===h&&"succeeded"===l&&p){if(a.prevStatInfo&&a.localCandidateId===d&&a.remoteCandidateId===c){var f=a.prevStatInfo;i=!0,Object.assign(r,{rtt:Math.floor(1e3*(o===f.responsesReceived?0:(n-f.totalRoundTripTime)/(o-f.responsesReceived))),bytesSent:e.muted?0:Math.floor((s-f.bytesSent)/(u-f.timestamp)*1e3)})}else a.localCandidateId=d,a.remoteCandidateId=c,a.prevStatInfo={};Object.assign(a.prevStatInfo,{totalRoundTripTime:n,responsesReceived:o,bytesSent:s,timestamp:u})}})),t.forEach((function(e){var t=e.id,r=e.type;if("local-candidate"===r&&t===a.localCandidateId){var i=e.ip,n=e.port,o=e.networkType;a.localCA&&a.localCA.ip===i&&a.localCA.port===n&&a.localCA.networkType===o||(a.localCA={ip:i,port:n,networkType:o},Ki("SELCA"+",".concat(i)+",".concat(n)+",".concat(o)))}else if("remote-candidate"===r&&t===a.remoteCandidateId){var s=e.ip,u=e.port;a.remoteCA&&a.remoteCA.ip===s&&a.remoteCA.port===u||(a.remoteCA={ip:s,port:u},Ki("SERCA"+",".concat(s)+",".concat(u)))}})),i&&Ji(r)}})),e.subscriber&&e.subscriber.getStats().then((function(t){if(t){var r=e.monitorInfo.subscriber,i={ssrcMap:{}},a=!1;t.forEach((function(e){var t=e.totalRoundTripTime,n=e.responsesReceived,o=e.localCandidateId,s=e.remoteCandidateId,u=e.type,d=e.state,c=e.nominated;if("candidate-pair"===u&&"succeeded"===d&&c){if(r.prevStatInfo&&r.localCandidateId===o&&r.remoteCandidateId===s){var h=r.prevStatInfo;a=!0,Object.assign(i,{rtt:Math.floor(1e3*(n===h.responsesReceived?0:(t-h.totalRoundTripTime)/(n-h.responsesReceived)))})}else r.localCandidateId=o,r.remoteCandidateId=s,r.prevStatInfo={},r.ssrcMap={};Object.assign(r.prevStatInfo,{totalRoundTripTime:t,responsesReceived:n})}})),t.forEach((function(t){var n=t.id,o=t.type;if("local-candidate"===o&&n===r.localCandidateId){var s=t.ip,u=t.port,d=t.networkType;r.localCA&&r.localCA.ip===s&&r.localCA.port===u&&r.localCA.networkType===d||(r.localCA={ip:s,port:u,networkType:d},Ki("RELCA"+",".concat(s)+",".concat(u)+",".concat(d)))}else if("remote-candidate"===t.type&&n===r.remoteCandidateId){var c=t.ip,h=t.port;r.remoteCA&&r.remoteCA.ip===c&&r.remoteCA.port===h||(r.remoteCA={ip:c,port:h},Ki("RERCA"+",".concat(c)+",".concat(h)))}else if("inbound-rtp"===o){var l=t.totalAudioEnergy,p=t.timestamp,f=t.jitterBufferDelay,m=t.jitterBufferEmittedCount,v=t.ssrc,g=t.jitter,S=t.audioLevel,_=t.packetsLost,C=t.packetsReceived,y=t.bytesReceived;r.ssrcMap||(r.ssrcMap={});var b=r.ssrcMap[v];if(b){var A=e.ssrcUserIdMap.get(v);if(A){a=!0;var k=Math.sqrt((l-b.totalAudioEnergy)/(p-b.timestamp)).toFixed(4),E=-1;"number"==typeof S&&(E=S.toFixed(4));var w=Math.floor(1e3*(m===b.jitterBufferEmittedCount?0:(f-b.jitterBufferDelay)/(m-b.jitterBufferEmittedCount)));i.ssrcMap["".concat(v,"-").concat(A)]=Object.assign(i.ssrcMap["".concat(v,"-").concat(A)]||{},{aveAudioLevel:k<1e-4?0:k,audioLevel:E<1e-4?0:E,aveJitterBufferDelay:w,jitter:g,packetsLost:_-b.packetsLost,packetsReceived:Math.floor((C-b.packetsReceived)/(p-b.timestamp)*1e3),bytesReceived:Math.floor((y-b.bytesReceived)/(p-b.timestamp)*1e3)})}}else b=r.ssrcMap[v]={};e.isUserMuted(v)||!e.ssrcUserIdMap.has(v)?r.ssrcMap[v]=null:Object.assign(b,{totalAudioEnergy:l,timestamp:p,jitterBufferDelay:f,jitterBufferEmittedCount:m,packetsLost:_,packetsReceived:C,bytesReceived:y})}})),a&&Xi(i)}}))}),this.monitorTimerDuration)}},{key:"stopAudioQualityMonitorTimer",value:function(){this.monitorTimer&&(clearInterval(this.monitorTimer),this.monitorTimer=null,this.monitorInfo={subscriber:{},publisher:{}})}},{key:"publishStream",value:function(e){var t=this;return this.setAudioStream(e),new Promise((function(e,r){t.published?e(!0):t.publish().then((function(){e(!1)}))}))}},{key:"stopAVSyncTimer",value:function(){this.syncTimer&&(clearInterval(this.syncTimer),this.syncTimer=null)}},{key:"syncSingleView",value:function(e,t){var r=0;if(t){var i=parseInt(t).toString(2),a=i.substring(0,32),n=i.substring(32,64);r=1e3*(a=parseInt(a,2))+232.8*(n=parseInt(n,2))/1e9}qi?Xt({command:"audioDecodeTime",status:0,data:r}):e?ee.a.mediaSDKHandle.SharingRenderObj&&ee.a.mediaSDKHandle.SharingRenderObj.SetcATimeStamp(r):ee.a.CurrentSSRCTime!=r&&(ee.a.CurrentSSRCTime=r,ee.a.audioPlayTime=Date.now())}},{key:"startAVSyncTimer",value:function(){var e=this;this.stopAVSyncTimer(),this.syncTimer=setInterval((function(){if(e.subscriber){var t=0;e.subscriber.getReceivers().forEach((function(r){r.getSynchronizationSources().forEach((function(r){t++;var i=e.ssrcUserIdMap.get(r.source),a=null,n=!1;if((a=e.shareAudioMap.get(i>>10))&&a.abssrc===r.source?n=!0:a=e.normalAudioMap.get(i>>10),a){var o=a.ntptime,s=a.rtptime,u=o+(r.rtpTimestamp-s)*Math.pow(2,32)/48e3;e.isMultiView||i>>10!=ee.a.CurrentSSRC>>10&&!n||r.source===a.abssrc&&e.syncSingleView(n,u)}}))})),0===t&&(e.syncSingleView(!1,0),e.syncSingleView(!0,0))}}),500)}}]),e}();function $i(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}))}function ea(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.onOffer,this.isRtcConnected=!1,this.isDestroyed=!1,this.isJoinAudio=t,this.leaveTime=0,this.onopen=function(e){this._onopen=e},this.onclose=function(e){this._onclose=e},this.onerror=function(e){this._onerror=e},this.init=function(e){var t=this;this.socket=window.audioBridgeSignal=new WebSocket(e),this._notifyhandlers={},this.socket.addEventListener("open",(function(){Ki("WSO"),t.isJoinAudio&&t.notify("audiostatus",{status:1}),t._onopen&&t._onopen()})),this.socket.addEventListener("error",(function(e){Z.a.error("Audio Bridge WebSocket received error",e),Ki("WSE"),t._onerror&&t._onerror(!t.isDestroyed&&!t.isJoinAudio&&Date.now()-t.leaveTime>=15e3?e||!0:null),t.isDestroyed||(t.isJoinAudio||Date.now()-t.leaveTime<15e3)&&ee.a.Notify_APPUI&&ee.a.Notify_APPUI(P.pc)})),this.socket.addEventListener("close",(function(e){Z.a.error("Audio Bridge WebSocket close",e),Ki("WSC"),t._onclose&&t._onclose(!t.isDestroyed&&!t.isJoinAudio&&Date.now()-t.leaveTime>=15e3?e||!0:null),t.isDestroyed||(t.isJoinAudio||Date.now()-t.leaveTime<15e3)&&ee.a.Notify_APPUI&&ee.a.Notify_APPUI(P.pc)})),this.socket.addEventListener("message",function(){var e=d()(g.a.mark((function e(r){var i,a;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("close"!==r.data){e.next=3;break}return ee.a.Notify_APPUI&&ee.a.Notify_APPUI(P.pc),e.abrupt("return");case 3:"offer"===(i=JSON.parse(r.data)).method?t.onOffer&&t.onOffer(i.params):"trickle"===i.method?t.onTrickle&&t.onTrickle(i.params.candidate,i.params.role):"rtcpsr"===i.method?t.UpdateNTP(i.params.ntptime,i.params.rtptime,i.params.ssrc,i.params.abssrc):(a=t._notifyhandlers[i.method])&&a(i.params);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())},this.on_notify=function(e,t){this._notifyhandlers[e]=t},this.notify=function(e,t){this.socket&&this.socket.readyState===WebSocket.OPEN?this.socket.send(JSON.stringify({method:e,params:t})):console.error("websocket is not open",this.socket.readyState)},this.call=function(){var e=d()(g.a.mark((function e(t,r){var i,a=this;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=$i(),!this.socket||this.socket.readyState!==WebSocket.OPEN){e.next=5;break}this.socket.send(JSON.stringify({method:t,params:r,id:i})),e.next=7;break;case 5:return console.error("audio bridge:::: websocket is not open",this.socket.readyState),e.abrupt("return");case 7:return e.abrupt("return",new Promise((function(e,t){a.socket.addEventListener("message",(function t(r){var n=JSON.parse(r.data);n.id===i&&(n.error?e(n):e(n.result),a.socket.removeEventListener("message",t))}))})));case 8:case"end":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}(),this.destroy=function(){e.socket&&e.socket.close&&e.socket.close()}}function ta(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return ra(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ra(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var i=0,a=function(){};return{s:a,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,n=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw n}}}}function ra(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}var ia=11,aa=function(){function e(){p()(this,e)}var t,r;return m()(e,null,[{key:"init",value:(r=d()(g.a.mark((function e(t,r){var i;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(window.navigator.hid&&window.navigator.hid.requestDevice){e.next=2;break}return e.abrupt("return",!1);case 2:return i=this.webHid=new na((function(e){switch(e.eventName){case"ondevicehookswitch":ee.a.Notify_APPUI_SAFE(P.Lb,"on"===e.hookStatus);break;case"ondevicemuteswitch":ee.a.Notify_APPUI_SAFE(P.Kb,e.isMute)}})),e.next=5,i.open({label:t,muted:r,hookStatus:"off"});case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"sendReport",value:function(e,t){switch(e){case"hookswitch":this.webHid.sendDeviceReport({command:t?"offHook":"onHook"});break;case"mute":this.webHid.sendDeviceReport({command:t?"muteOn":"muteOff"})}}},{key:"destroy",value:(t=d()(g.a.mark((function e(){return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.webHid.close();case 2:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),na=function(){function e(t){p()(this,e),this.deviceUsage={mute:{usageId:524297,usageName:"Mute"},offHook:{usageId:524311,usageName:"Off Hook"},ring:{usageId:524312,usageName:"Ring"},hookSwitch:{usageId:720928,usageName:"Hook Switch"},phoneMute:{usageId:720943,usageName:"Phone Mute"}},this.deviceCommand={outputReport:{mute:{reportId:0,usageOffset:-1},offHook:{reportId:0,usageOffset:-1},ring:{reportId:0,itemIndex:-1}},inputReport:{hookSwitch:{reportId:0,usageOffset:-1,isAbsolute:!1},phoneMute:{reportId:0,usageOffset:-1,isAbsolute:!1}}},this.device=null,this.inputReportRetFunc=t}var t,r,i,a;return m()(e,[{key:"getHexByte",value:function(e){for(var t=Number(e).toString(16);t.length<2;)t="0"+t;return t}},{key:"getHexByteStr",value:function(e){for(var t="",r=0;r<e.byteLength;++r)t+=this.getHexByte(e.getUint8(r))+" ";return t}},{key:"parseDeviceDescriptors",value:function(){try{if(this.outputEventGenerators=new Map,!this.device||!this.device.collections)return;var e=this.device.collections.find((function(e){return e.usagePage===ia}));if(!e||0===Object.keys(e).length)return;if(e.inputReports&&!this.parseInputReports(e.inputReports))return!1;if(e.outputReports)return!!this.parseOutputReports(e.outputReports)}catch(e){console.error("parseDeviceDescriptors error:"+JSON.stringify(e,null," "))}}},{key:"parseInputReports",value:function(e){var t=this;return e.forEach((function(e){if(e.items.length&&void 0!==e.reportId){var r=0;e.items.forEach((function(i){void 0!==i.usages&&void 0!==i.reportSize&&void 0!==i.reportCount&&void 0!==i.isAbsolute&&(i.usages.forEach((function(a,n){switch(a){case t.deviceUsage.hookSwitch.usageId:t.deviceCommand.inputReport.hookSwitch={reportId:e.reportId,usageOffset:r+n*i.reportSize,isAbsolute:i.isAbsolute};break;case t.deviceUsage.phoneMute.usageId:t.deviceCommand.inputReport.phoneMute={reportId:e.reportId,usageOffset:r+n*i.reportSize,isAbsolute:i.isAbsolute}}})),r+=i.reportCount*i.reportSize)}))}})),0!==this.deviceCommand.inputReport.phoneMute.reportData&&0!==this.deviceCommand.inputReport.hookSwitch}},{key:"parseOutputReports",value:function(e){var t,r,i,a=this;for(var n in e.forEach((function(e){if(e.items.length&&void 0!==e.reportId){var t=0,r=new Map;e.items.forEach((function(i){void 0!==i.usages&&void 0!==i.reportSize&&void 0!==i.reportCount&&(i.usages.forEach((function(n,o){switch(n){case a.deviceUsage.mute.usageId:a.deviceCommand.outputReport.mute={reportId:e.reportId,usageOffset:t+o*i.reportSize},r.set(n,t+o*i.reportSize);break;case a.deviceUsage.offHook.usageId:a.deviceCommand.outputReport.offHook={reportId:e.reportId,usageOffset:t+o*i.reportSize},r.set(n,t+o*i.reportSize);break;case a.deviceUsage.ring.usageId:a.deviceCommand.outputReport.ring={reportId:e.reportId,usageOffset:t+o*i.reportSize},r.set(n,t+o*i.reportSize)}})),t+=i.reportCount*i.reportSize)}));var i,n=t,o=ta(r);try{var s=function(){var e=x()(i.value,2),t=e[0],r=e[1];a.outputEventGenerators[t]=function(e){var t=new Uint8Array(n/8);if(r>=0&&e){var i=Math.trunc(r/8),a=r%8;t[i]=1<<a}return t}};for(o.s();!(i=o.n()).done;)s()}catch(e){o.e(e)}finally{o.f()}}})),this.outputEventGenerators){var o=this.getHexByte(n);o="0x0"+o,this.deviceUsage.mute.usageId===Number(o)?t=this.outputEventGenerators[this.deviceUsage.mute.usageId]:this.deviceUsage.offHook.usageId===Number(o)?i=this.outputEventGenerators[this.deviceUsage.offHook.usageId]:this.deviceUsage.ring.usageId===Number(o)&&(r=this.outputEventGenerators[this.deviceUsage.ring.usageId])}return!!(t||r||i)}},{key:"open",value:(a=d()(g.a.mark((function e(t){var r,i;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,navigator.hid.getDevices();case 2:if((r=e.sent).length&&(this.device=r.find((function(e){return t.label.includes(e.productName)}))),this.device){e.next=9;break}return e.next=7,navigator.hid.requestDevice({filters:[{usagePage:ia}]});case 7:(i=e.sent).length&&(this.device=i[0]);case 9:if(this.device){e.next=11;break}return e.abrupt("return",!1);case 11:if(e.prev=11,!this.device.opened){e.next=15;break}return e.next=15,this.device.close();case 15:return e.next=17,this.device.open();case 17:if(this.parseDeviceDescriptors()){e.next=19;break}return e.abrupt("return",!1);case 19:return e.next=21,this.handleInputReport.bind(this);case 21:return this.device.oninputreport=e.sent,this.resetState({muted:t.muted,hookStatus:t.hookStatus}),e.abrupt("return",!0);case 26:e.prev=26,e.t0=e.catch(11),console.error("error content:"+e.t0);case 29:case"end":return e.stop()}}),e,this,[[11,26]])}))),function(e){return a.apply(this,arguments)})},{key:"close",value:(i=d()(g.a.mark((function e(){return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,this.resetState({muted:!1,hookStatus:"on"}),this.device){e.next=4;break}return e.abrupt("return");case 4:if(!this.device||!this.device.opened){e.next=7;break}return e.next=7,this.device.close();case 7:this.device.oninputreport=null,this.device=null,e.next=14;break;case 11:e.prev=11,e.t0=e.catch(0),console.error(e.t0);case 14:case"end":return e.stop()}}),e,this,[[0,11]])}))),function(){return i.apply(this,arguments)})},{key:"resetState",value:function(e){var t=e.muted,r=e.hookStatus;this.device&&this.device.opened&&(this.device.hookStatus=r,this.device.muted=t,this.device.ring=!1,this.sendDeviceReport({command:"off"===r?"offHook":"onHook"}),this.sendDeviceReport({command:t?"muteOn":"muteOff"}))}},{key:"sendDeviceReport",value:(r=d()(g.a.mark((function e(t){var r,i,a,n,o,s,u,d,c,h,l,p,f,m,v,S,_,C,y,b,A,k,E,w,I,D;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&t.command&&this.device&&this.device.opened){e.next=2;break}return e.abrupt("return");case 2:if("muteOn"!==t.command&&"muteOff"!==t.command){e.next=7;break}if(this.outputEventGenerators[this.deviceUsage.mute.usageId]){e.next=5;break}return e.abrupt("return");case 5:e.next=15;break;case 7:if("onHook"!==t.command&&"offHook"!==t.command){e.next=12;break}if(this.outputEventGenerators[this.deviceUsage.offHook.usageId]){e.next=10;break}return e.abrupt("return");case 10:e.next=15;break;case 12:if("onRing"!==t.command&&"offRing"!==t.command){e.next=15;break}if(this.outputEventGenerators[this.deviceUsage.ring.usageId]){e.next=15;break}return e.abrupt("return");case 15:r=0,l=null,e.t0=t.command,e.next="muteOn"===e.t0||"muteOff"===e.t0?20:"onHook"===e.t0||"offHook"===e.t0?22:"onRing"===e.t0||"offRing"===e.t0?24:26;break;case 20:return r=this.deviceCommand.outputReport.mute.reportId,e.abrupt("break",27);case 22:return r=this.deviceCommand.outputReport.offHook.reportId,e.abrupt("break",27);case 24:return r=this.deviceCommand.outputReport.ring.reportId,e.abrupt("break",27);case 26:return e.abrupt("return");case 27:if(0!=r){e.next=29;break}return e.abrupt("return");case 29:if(a=this.device.muted,"off"!==this.device.hookStatus){e.next=34;break}i=!0,e.next=39;break;case 34:if("on"!==this.device.hookStatus){e.next=38;break}i=!1,e.next=39;break;case 38:return e.abrupt("return");case 39:n=this.device.ring,e.t1=t.command,e.next="muteOn"===e.t1?43:"muteOff"===e.t1?45:"onHook"===e.t1?47:"offHook"===e.t1?49:"onRing"===e.t1?51:"offRing"===e.t1?53:55;break;case 43:return s=!0,e.abrupt("break",56);case 45:return s=!1,e.abrupt("break",56);case 47:return o=!1,e.abrupt("break",56);case 49:return o=!0,e.abrupt("break",56);case 51:return u=!0,e.abrupt("break",56);case 53:return u=!1,e.abrupt("break",56);case 55:return e.abrupt("return");case 56:if(this.outputEventGenerators[this.deviceUsage.mute.usageId]&&(c=void 0===s?this.outputEventGenerators[this.deviceUsage.mute.usageId](a):this.outputEventGenerators[this.deviceUsage.mute.usageId](s)),this.outputEventGenerators[this.deviceUsage.offHook.usageId]&&(d=void 0===o?this.outputEventGenerators[this.deviceUsage.offHook.usageId](i):this.outputEventGenerators[this.deviceUsage.offHook.usageId](o)),this.outputEventGenerators[this.deviceUsage.ring.usageId]&&(h=void 0===u?this.outputEventGenerators[this.deviceUsage.ring.usageId](n):this.outputEventGenerators[this.deviceUsage.ring.usageId](u)),r===this.deviceCommand.outputReport.mute.reportId)if(null===l)l=new Uint8Array(c);else{p=ta(c.entries());try{for(p.s();!(f=p.n()).done;)m=x()(f.value,2),v=m[0],S=m[1],l[v]|=S}catch(e){p.e(e)}finally{p.f()}}if(r===this.deviceCommand.outputReport.offHook.reportId)if(null===l)l=new Uint8Array(d);else{_=ta(d.entries());try{for(_.s();!(C=_.n()).done;)y=x()(C.value,2),b=y[0],A=y[1],l[b]|=A}catch(e){_.e(e)}finally{_.f()}}if(r===this.deviceCommand.outputReport.ring.reportId)if(null===l)l=new Uint8Array(h);else{k=ta(h.entries());try{for(k.s();!(E=k.n()).done;)w=x()(E.value,2),I=w[0],D=w[1],l[I]|=D}catch(e){k.e(e)}finally{k.f()}}return e.next=64,this.device.sendReport(r,l);case 64:e.t2=t.command,e.next="muteOn"===e.t2?67:"muteOff"===e.t2?69:"onHook"===e.t2?71:"offHook"===e.t2?73:"onRing"===e.t2?75:"offRing"===e.t2?77:79;break;case 67:return this.device.muted=!0,e.abrupt("break",80);case 69:return this.device.muted=!1,e.abrupt("break",80);case 71:return this.device.hookStatus="on",e.abrupt("break",80);case 73:return this.device.hookStatus="off",e.abrupt("break",80);case 75:return this.device.ring=!0,e.abrupt("break",80);case 77:return this.device.ring=!1,e.abrupt("break",80);case 79:return e.abrupt("break",80);case 80:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"sendReplyReport",value:(t=d()(g.a.mark((function e(t,r,i){var a,n,o,s,u,d,c,h,l,p;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=0,this.deviceCommand.outputReport.offHook.reportId===this.deviceCommand.outputReport.mute.reportId||t===this.deviceCommand.inputReport.hookSwitch.reportId?a=this.deviceCommand.outputReport.offHook.reportId:t===this.deviceCommand.inputReport.phoneMute.reportId&&(a=this.deviceCommand.outputReport.mute.reportId),this.device&&this.device.opened){e.next=4;break}return e.abrupt("return");case 4:if(0!==a&&void 0!==r&&void 0!==i){e.next=6;break}return e.abrupt("return");case 6:if(this.deviceCommand.outputReport.offHook.reportId===this.deviceCommand.outputReport.mute.reportId){o=this.outputEventGenerators[this.deviceUsage.mute.usageId](i),s=this.outputEventGenerators[this.deviceUsage.offHook.usageId](r),n=new Uint8Array(s),d=ta(o.entries());try{for(d.s();!(c=d.n()).done;)h=x()(c.value,2),l=h[0],p=h[1],n[l]|=p}catch(e){d.e(e)}finally{d.f()}}else a===this.deviceCommand.outputReport.offHook.reportId?(s=this.outputEventGenerators[this.deviceUsage.offHook.usageId](r),n=new Uint8Array(s)):a===this.deviceCommand.outputReport.mute.reportId?(o=this.outputEventGenerators[this.deviceUsage.mute.usageId](i),n=new Uint8Array(o)):a===this.deviceCommand.outputReport.ring.reportId&&(u=this.outputEventGenerators[this.deviceUsage.mute.usageId](i),n=new Uint8Array(u));return e.next=9,this.device.sendReport(a,n);case 9:case"end":return e.stop()}}),e,this)}))),function(e,r,i){return t.apply(this,arguments)})},{key:"handleInputReport",value:function(e){try{var t=e.data,r=e.device,i=e.reportId;if(0===i)return;var a=this.deviceCommand.inputReport;if(i!==a.hookSwitch.reportId&&i!==a.phoneMute.reportId)return;var n=!1,o=!1,s=new Uint8Array(t.buffer);if(i===a.hookSwitch.reportId){var u=a.hookSwitch,d=Math.trunc(u.usageOffset/8),c=u.usageOffset%8,h=0!=(t.getUint8(d)&1<<c);a.hookSwitch.isAbsolute?"on"===this.device.hookStatus&&h?(this.device.hookStatus="off",n=!0):"off"!==this.device.hookStatus||h||(this.device.hookStatus="on",n=!0):h&&(this.device.hookStatus="off"===this.device.hookStatus?"on":"off",n=!0)}this.device.muted;if(i===a.phoneMute.reportId){var l=a.phoneMute,p=Math.trunc(l.usageOffset/8),f=l.usageOffset%8,m=0!=(t.getUint8(p)&1<<f);a.phoneMute.isAbsolute?this.device.muted!=m&&(this.device.muted=m,o=!0):m&&(this.device.muted=!this.device.muted,o=!0)}var v={productName:r.productName,reportId:this.getHexByte(i),reportData:s};if(n&&(v.eventName="ondevicehookswitch",v.hookStatus=this.device.hookStatus),o&&(v.eventName="ondevicemuteswitch",v.isMute=this.device.muted),this.inputReportRetFunc&&this.inputReportRetFunc(v),n||o){var g;if("off"===this.device.hookStatus)g=!0;else{if("on"!==this.device.hookStatus)return;g=!1}this.sendReplyReport(i,g,this.device.muted)}}catch(e){console.error(e)}}}]),e}();function oa(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return sa(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return sa(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var i=0,a=function(){};return{s:a,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,n=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw n}}}}function sa(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}function ua(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}var da=function(){function e(t){p()(this,e),this.options=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ua(Object(r),!0).forEach((function(t){h()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ua(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({analyserFrequent:50},t||{}),this.asnTime=performance.now(),this.audioStream=null,this.analyserNodeBufferDataArray=null,this.audioCtx=new(window.AudioContext||window.webkitAudioContext),this.destinationNode=new MediaStreamAudioDestinationNode(this.audioCtx),this.initAnalyserNode()}return m()(e,[{key:"initAnalyserNode",value:function(){this.analyserNode=this.audioCtx.createAnalyser(),this.analyserNode.connect(this.destinationNode),this.analyserNode.fftSize=1024}},{key:"setAudioStream",value:function(e){this.audioStream=e}},{key:"start",value:function(){var e=this;return this.getAnalyzingStatus()&&this.stop(),this.getDestroyedStatus()?Promise.reject(new Error("instance is destroyed already")):new Promise((function(t){e.setAnalyzingStatus(!0),e.sourceNode=e.audioCtx.createMediaStreamSource(e.audioStream),e.sourceNode.connect(e.analyserNode),e.resumeAudioCtx(),e.setAnalyzeInterval(),t(!0)}))}},{key:"stop",value:function(){this.setAnalyzingStatus(!1),this.clearAnalyzeInterval()}},{key:"destroy",value:function(){var e=this;this.stop(),this.analyserNode.disconnect(this.destinationNode),this.setDestroyedStatus(!0),this.audioCtx.suspend().finally((function(){return e.audioCtx.close()})),this.audioStream=null,this.analyserNodeBufferDataArray=null}},{key:"analyserNodeIntervalCallback",value:function(){if(this.analyserNodeBufferDataArray){this.analyserNode.getByteFrequencyData(this.analyserNodeBufferDataArray);var e,t=0,r=oa(this.analyserNodeBufferDataArray);try{for(r.s();!(e=r.n()).done;){t+=e.value}}catch(e){r.e(e)}finally{r.f()}var i=t/this.analyserNodeBufferDataArray.length;if(i>0){var a=performance.now();a-this.asnTime>1e3&&(this.asnTime=a,this.options.analyserCallback(i))}}}},{key:"setAnalyzeInterval",value:function(){this.clearAnalyzeInterval();var e=this.analyserNode.frequencyBinCount;this.analyserNodeBufferDataArray=new Uint8Array(e),this.analyserNodeTimer=window.setInterval(this.analyserNodeIntervalCallback.bind(this),this.options.analyserFrequent)}},{key:"clearAnalyzeInterval",value:function(){this.analyserNodeTimer&&(window.clearInterval(this.analyserNodeTimer),this.analyserNodeTimer=null,this.analyserNodeBufferDataArray=null)}},{key:"getAnalyzingStatus",value:function(){return!!this.isAnalyzing}},{key:"setAnalyzingStatus",value:function(e){this.isAnalyzing=!!e}},{key:"getDestroyedStatus",value:function(){return!!this.isDestroyed}},{key:"setDestroyedStatus",value:function(e){this.isDestroyed=!!e}},{key:"resumeAudioCtx",value:function(){"running"!==this.audioCtx.state&&this.audioCtx.resume()}}]),e}(),ca=["headset","pods","buds","opencomm","arctis","mpow","hyperx cloud","zone wired","aeropex by aftershokz","plt focus","xiberia","pxc 550","tk-hs001","lifechat lx","cisco 56"],ha=[["wh-","wf-","wi-"],["1000x","ch","xb","sp","h9","c2","c5","c6","c1","h8","c4","c3"]],la={jabra:["evolve","pro 900","pro 920","pro 93","pro 94","talk","biz","engage","elite","uc voice","link 180","link 2","link 860","link 850","link 400","blueparrott"],plantronics:["savi","blackwire","c5","c3","c4","c6","c7","bt","audio","da","encorepro","hw111n","gamecom","apu","voyager"],logitech:["h570","h820","h650","pro x"],sennheiser:["sc","mb","pc","sd","dect","g4me1","audio"],sony:["wh","wf","mdr"],bose:["qc","quiet","soundlink","soundsport","on-ear","nc"],beats:["fit","flex","power","solo","studio","mivi"],razer:["kraken","blackshark","barracuda","nari","hammerhead","opus"],yealink:["uh","wh","yh","cp"],soundcore:["life","liberty","spirit","strike"],addasound:["sr","epic"],jbl:["tune","quantum","live","wave","t450bt","c200","everest","c310"],epos:["impact","pc 8 usb","h3","adapt"],jlab:["go","bt","epic","studio"]};var pa,fa=function(e){if("string"!=typeof e)return console.error("should be string"),!1;for(var t=e.toLowerCase(),r=0;r<ca.length;r++){var i=ca[r];if(t.includes(i))return!0}for(var a=Object.keys(la),n=0;n<a.length;n++){var o=a[n];if(t.includes(o))for(var s=la[o],u=0;u<s.length;u++)if(t.includes(s[u]))return!0}for(var d=ha[0],c=ha[1],h=!1,l=0;l<d.length;l++)if(t.includes(d[l])){h=!0;break}if(h)for(var p=0;p<c.length;p++)if(t.includes(c[p]))return!0;return!1},ma=r(25),va=r.n(ma),ga=(pa={},h()(pa,ie.f.AUDIO_ENCODE,"audioEncodeInitInstance"),h()(pa,ie.f.AUDIO_DECODE,"audioDecInitInstance"),h()(pa,ie.f.VIDEO_ENCODE,"videoInitInstance"),h()(pa,ie.f.VIDEO_DECODE,"videoDecInitInstance"),h()(pa,ie.f.SHARING_ENCODE,"sharingEncInitInstance"),h()(pa,ie.f.SHARING_DECODE,"sharingDecInitInstance"),pa);function Sa(){return _a.apply(this,arguments)}function _a(){return(_a=d()(g.a.mark((function e(){var t;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new ma.FileWriter({maxDaysToKeepFile:1,fileSizeQuota:10485760}),e.abrupt("return",new Promise((function(e){t.on("initOK",(function(){e(t)}))})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Ca=function(){function e(){p()(this,e),this.logWriterMap=window.logWriterMap=new Map,this.inited=!1}var t;return m()(e,[{key:"init",value:(t=d()(g.a.mark((function e(){var t=this;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.inited){e.next=2;break}return e.abrupt("return");case 2:this.inited=!0,Object.values(ie.f).forEach(function(){var e=d()(g.a.mark((function e(r){var i,a;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Sa();case 2:return i=e.sent,t.logWriterMap.set(r,i),e.next=6,ee.a[ga[r]].waitforInitSuccess();case 6:a=i.createMessagePort(),Dr(r,a,"local_log_port",!0,!0),i.startWriteNormalLogFile({filenamePrefix:ie.g[r],filenameExtension:".log",timestamp:!1,newLine:!1}),i.on("startWriteNormalLogFileReady",(function(){Dr(r,null,"local_log_ready",!1,!0)}));case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 4:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"saveLogFileByWorkerType",value:function(e){var t=this.logWriterMap.get(e);t&&t.saveLog()}},{key:"saveAllLogFiles",value:function(){va.a.selectSaveDir().then((function(){Object.values(ie.f).forEach((function(e){va.a.saveLog({filenamePrefix:ie.g[e],filenameExtension:".log"})}))}))}}]),e}();function ya(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return ba(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ba(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var i=0,a=function(){};return{s:a,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,n=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw n}}}}function ba(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}function Aa(e,t){var r;if(e.size!==t.size)return!1;var i,a=ya(e);try{for(a.s();!(i=a.n()).done;){var n=x()(i.value,2),o=n[0],s=n[1];if((r=t.get(o))!==s||void 0===r&&!t.has(o))return!1}}catch(e){a.e(e)}finally{a.f()}return!0}function ka(){this.audioInputDeviceList=new Map,this.audioOutputDeviceList=new Map,this.videoInputDeviceList=new Map,this.micId=null,this.speakerId=null,this.cameraId=null,this.startTime=Date.now(),this.userId=0,this.videoWidth=0,this.videoHeight=0,this.isAudioBridge=!1,this.isUpdatingDevice=!1,this.denoiseSwitch=!1}ka.prototype.notifyDenoiseSetting=function(){J.g.isSupportAudioDenoise()&&this.micId&&!this.isAudioBridge&&tr({command:"audio_denoise_switch",switch:this.denoiseSwitch,isHeadSet:Ea.isHeadSet()})},ka.prototype.updateDeviceList=function(e){var t=this;this.isUpdatingDevice=!0;var r=new Map,i=new Map,a=new Map;navigator.mediaDevices.enumerateDevices().then((function(n){n.forEach((function(e){"audioinput"==e.kind?r.set(e.deviceId,e.label.replace(/\([\w,\d]+:[\w,\d]+\)/i,"").trim()):"audiooutput"==e.kind?i.set(e.deviceId,e.label.replace(/\([\w,\d]+:[\w,\d]+\)/i,"").trim()):"videoinput"==e.kind&&a.set(e.deviceId,e.label.replace(/\([\w,\d]+:[\w,\d]+\)/i,"").trim())})),t.isUpdatingDevice=!1,e||Aa(t.audioInputDeviceList,r)||!r.has(t.micId)||(t.audioInputDeviceList=r,t.notifyDenoiseSetting(),t.sendMicDevice(0,!0)),e||Aa(t.audioOutputDeviceList,i)||!i.has(t.speakerId)||(t.audioOutputDeviceList=i,t.sendSpeakerDevice(0,!0)),e||Aa(t.videoInputDeviceList,a)||!a.has(t.cameraId)||(t.videoInputDeviceList=a,t.sendCameraInfo(0,!0,-1,-1,15,-1)),t.audioInputDeviceList=r,t.audioOutputDeviceList=i,t.videoInputDeviceList=a,t.sendAllDevice()}))},ka.prototype.changeDenoiseSwitch=function(e){this.denoiseSwitch=e,this.notifyDenoiseSetting()},ka.prototype.setIsAudioBridge=function(e){this.isAudioBridge=e},ka.prototype.setUserId=function(e){"number"!=typeof e||Number.isNaN(e)||(this.userId=e)},ka.prototype.setMicId=function(e){if(e){if(e!=this.micId)return this.micId=e,this.isUpdatingDevice||this.notifyDenoiseSetting(),!0}else this.micId="default";return!1},ka.prototype.setSpeakerId=function(e){this.speakerId=e&&""!=e?e:"default"},ka.prototype.setVideoResolution=function(e,t){this.videoWidth=e,this.videoHeight=t},ka.prototype.setCameraId=function(e){this.cameraId=e||"default"},ka.prototype.getMicLabel=function(){return this.audioInputDeviceList.get(this.micId)||"default"},ka.prototype.getSpeakerLabel=function(){return this.audioOutputDeviceList.get(this.speakerId)||"default"},ka.prototype.getCameraLabel=function(){return this.videoInputDeviceList.get(this.cameraId)||"default"},ka.prototype.isHeadSet=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=null;return t=e?this.getMicLabel():this.getSpeakerLabel(),fa(t)},ka.prototype.getIndex=function(e){return"default"==e?-1:"communications"==e?J.g.isMac()?0:-2:0},ka.prototype.sendAllDevice=function(){var e=this;this.isUpdatingDevice||(this.audioInputDeviceList.forEach((function(t,r){e.sendDeviceInfo(-1,1,e.getIndex(t),t,r,!0)})),this.audioOutputDeviceList.forEach((function(t,r){e.sendDeviceInfo(-1,0,e.getIndex(t),t,r,!0)})))},ka.prototype.sendMicDevice=function(e,t){this.isUpdatingDevice||this.sendDeviceInfo(e,1,this.getIndex(this.micId),this.micId,this.getMicLabel(),t,this.isHeadSet())},ka.prototype.sendSpeakerDevice=function(e,t){this.isUpdatingDevice||this.sendDeviceInfo(e,0,this.getIndex(this.speakerId),this.speakerId,this.getSpeakerLabel(),t,this.isHeadSet(!1))},ka.prototype.sendDeviceInfo=function(e,t,r,i,a,n,o){if(this.userId){var s=null,u=Date.now()-this.startTime;s=-1==e?"WCL_AUDIOD-ALL,"+this.userId+","+t+","+r+","+a+","+i+","+n+","+e+",7,"+u+",1":"WCL_AUDIOD,"+this.userId+","+t+","+r+","+a+","+i+","+n+","+e+",7,"+u+",1,"+(n?1:0)+","+o,ee.a.sendMessageToRwg(P.fc,{evt:4167,seq:1,body:{data:s}})}},ka.prototype.sendCameraInfo=function(e,t,r,i,a,n){if(this.userId&&!this.isUpdatingDevice){var o;o="WCL_CAMERA,"+this.userId+",0,"+this.getCameraLabel()+","+t+","+e+","+r+","+this.videoWidth+","+this.videoHeight+","+i+","+a+","+n,ee.a.sendMessageToRwg(P.fc,{evt:4167,seq:1,body:{data:o}})}};var Ea=new ka,wa=Ea;function Ia(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function Da(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ia(Object(r),!0).forEach((function(t){h()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ia(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ma=new(function(){function e(){p()(this,e),this._isReuseStreamEnabled=!1,this._isStreamInReuseMap=new Map,this.presetedConstraints={audioConstraints:null,videoConstraints:null,audioTimer:null,videoTimer:null},this._deprecatedStream={audio:[],video:[]},this._captureVideoDeferred=null,this.audioConstraints=null,this.audioStream=null,this.isCaptureAudioInProgress=!1,this.videoConstraints=null,this.videoStream=null,this.videoStreamTrack=null,this.captureVideoTimer=null,this.checkVideoStreamActiveTimer=null,this.isCaptureVideoInProgress=!1,this.currentVideoResolution={width:0,height:0},this.streamProcessAbility={isSupportMediaStreamTrackProcessor:J.g.isSupportMediaStreamTrackProcessor(),isSupportVideoTrackReader:J.g.isSupportVideoTrackReader(),isSupportImageCapture:J.g.isSupportImageCapture()},this.mediaStreamTrackProcessor=null,this.reableStream=null,this.videoTrackReader=null,this.videoImageCapture=null,this.videoImageCaptureLocked=!1,this.isAppleGraphic=!1}var t,r,i;return m()(e,[{key:"enableReuseStream",value:function(e){this._isReuseStreamEnabled=!!e}},{key:"_updateStreamInReuse",value:function(e,t){t?this._isStreamInReuseMap.set(e,!0):this._isStreamInReuseMap.delete(e)}},{key:"_isStreamInReuse",value:function(e){return!!this._isStreamInReuseMap.get(e)}},{key:"presetConstraints",value:function(e){var t=e.audioConstraints,r=e.videoConstraints;t&&(this.presetedConstraints.audioConstraints=this._getAudioConstraints(t)),r&&(this.presetedConstraints.videoConstraints=this._getVideoConstraints(r))}},{key:"_clearPresetConstraints",value:function(){this.presetedConstraints.audioConstraints=null,this.presetedConstraints.videoConstraints=null}},{key:"_getPresetAudioConstraints",value:function(){var e=this.presetedConstraints.audioConstraints;return this._clearPresetConstraints(),!(!e||this.audioStream||this.isCaptureAudioInProgress)&&e}},{key:"_getPresetVideoConstraints",value:function(){var e=this.presetedConstraints.videoConstraints;return this._clearPresetConstraints(),!(!e||this.videoStream||this.isCaptureVideoInProgress)&&e}},{key:"_pushDeprecatedStream",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.audioStream,r=e.videoStream;t&&this._deprecatedStream.audio.push(t),r&&this._deprecatedStream.video.push(r)}},{key:"_destoryDeprecatedStream",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.audio,i=t.video;r&&(this._deprecatedStream.audio.forEach((function(t){try{e._destoryStream(t)}catch(e){}})),this._deprecatedStream.audio=[]),i&&(this._deprecatedStream.video.forEach((function(t){try{e._destoryStream(t)}catch(e){}})),this._deprecatedStream.video=[])}},{key:"setStreamProcessAbility",value:function(e){var t=e.isSupportMediaStreamTrackProcessor,r=e.isSupportVideoTrackReader,i=e.isSupportImageCapture;this.streamProcessAbility=Da(Da(Da(Da({},this.streamProcessAbility),void 0!==t?{isSupportMediaStreamTrackProcessor:t}:{}),void 0!==r?{isSupportVideoTrackReader:r}:{}),void 0!==i?{isSupportImageCapture:i}:{})}},{key:"_isFileInputAudioSource",value:function(e){return e&&(e.audio instanceof HTMLVideoElement||e.audio instanceof HTMLAudioElement)}},{key:"_getAudioConstraints",value:function(e){var t=e.audioSource,r=e.isSupportBrowserAec,i=e.disableAudioAGC,a=e.disableNoiseSuppression;if(t instanceof HTMLVideoElement||t instanceof HTMLAudioElement)return{audio:t};return r&&!J.g.isGoogleNestChrome()?{deviceId:t?{exact:t}:void 0,autoGainControl:!i,noiseSuppression:!a,latency:0,echoCancellation:!0}:{deviceId:t?{exact:t}:void 0,autoGainControl:!i,noiseSuppression:!a,latency:0,echoCancellation:r}}},{key:"_isSameAudioConstraintsAsPrev",value:function(e){return!this._isFileInputAudioSource(e)&&(!(!this.audioConstraints||!Object(J.f)(this.audioConstraints,e))&&(!!this.audioStream&&!!this._isStreamHasAudio(this.audioStream)))}},{key:"_destoryStream",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.audioOnly,i=t.videoOnly;if(e&&!J.g.audioToMediaStreamMananger.isAudioFileStream(e)){(r?e.getAudioTracks():i?e.getVideoTracks():e.getTracks()).forEach((function(e){e.stop()}))}}},{key:"_isStreamHasAudio",value:function(e){var t=e.getAudioTracks();return t&&t.length>0}},{key:"_isStreamHasVideo",value:function(e){var t=e.getVideoTracks();return t&&t.length>0}},{key:"destoryAudioMediaStream",value:function(){this.audioStream?(this._isFileInputAudioSource(this.audioConstraints)&&J.g.audioToMediaStreamMananger.stopCapture(),this._isReuseStreamEnabled?this._updateStreamInReuse(this.audioStream,!0):(this._updateStreamInReuse(this.audioStream,!1),this._destoryStream(this.audioStream),this.audioStream=null,this.audioConstraints=null,this._destoryDeprecatedStream({audio:!0}))):this._destoryDeprecatedStream({audio:!0}),this.enableReuseStream(!1)}},{key:"shouldCaptureAudio",value:function(){return!this.audioStream||this._isStreamInReuse(this.audioStream)}},{key:"muteUnmuteAudioMediaStream",value:function(e){this.audioStream&&(this.audioStream.getAudioTracks()||[]).forEach((function(t){t.enabled=!e}))}},{key:"_storeAudioStream",value:function(e,t,r){e&&(Ra("audio stream is ok"),this.destoryAudioMediaStream(),this.audioStream=e,this.audioConstraints=t,r&&this._setPresetAudioStreamAutoStopTimer())}},{key:"_setPresetAudioStreamAutoStopTimer",value:function(){var e=this;this._clearPresetAudioStreamAutoStopTimer(),this.presetedConstraints.audioTimer=setTimeout((function(){e.destoryAudioMediaStream()}),1e4)}},{key:"_clearPresetAudioStreamAutoStopTimer",value:function(){this.presetedConstraints.audioTimer&&(clearTimeout(this.presetedConstraints.audioTimer),this.presetedConstraints.audioTimer=null)}},{key:"_handleAudioCaptureSuccess",value:function(e,t,r,i){this._clearPresetAudioStreamAutoStopTimer(),i||this._storeAudioStream(e,t),this._updateStreamInReuse(e,!1);var a=e.getAudioTracks()[0];a?(re.add_monitor("ATRS:"+a.readyState),re.add_monitor("ATMS:"+a.muted),a.onended=function(){re.add_monitor("ATRS:"+a.readyState),ee.a.Notify_APPUI_SAFE(P.y)},a.onmute=function(){ee.a.Notify_APPUI_SAFE(P.y),re.add_monitor("ATMS:"+a.muted)},a.onunmute=function(){re.add_monitor("ATMS:"+a.muted)}):re.add_monitor("TN"),r(e)}},{key:"_genAudioStream",value:function(e){try{var t=e.getAudioTracks();return 0===t.length?null:new MediaStream(t)}catch(t){return console.warn(t),Z.a.warn("_genAudioStream",t),this._destoryStream(e,{videoOnly:!0}),e}}},{key:"_genVideoStream",value:function(e){try{var t=e.getVideoTracks();return 0===t.length?null:new MediaStream(t)}catch(t){return console.warn(t),Z.a.warn("_genVideoStream",t),this._destoryStream(e,{audioOnly:!0}),e}}},{key:"_splitAudioStream",value:function(e,t,r,i){var a=t.audio,n=t.video;if(n&&this._isStreamHasVideo(e)){var o=this._genAudioStream(e),s=this._genVideoStream(e);return o?this._handleAudioCaptureSuccess(o,a,r):i(new Error("audio stream do not contains audio track ")),void(s&&(this.videoStream?this._pushDeprecatedStream({videoStream:s}):(this._updateStreamInReuse(s,!0),this._storeVideoStream(s,n,!0))))}this._handleAudioCaptureSuccess(e,a,r)}},{key:"_captureFileInputAudioStream",value:(i=d()(g.a.mark((function e(t){var r,i,a;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.audio,e.prev=1,e.next=4,new Promise((function(e,t){r.currentTime>0&&!r.paused&&!r.ended&&e(!0),r.addEventListener("timeupdate",(function t(){e(!0),r.removeEventListener("timeupdate",t)})),setTimeout((function(){return t(!1)}),1e4)}));case 4:if(e.sent){e.next=7;break}throw new Error("audio file playing failed");case 7:return i=J.g.audioToMediaStreamMananger.startCapture(r),e.abrupt("return",i);case 11:throw e.prev=11,e.t0=e.catch(1),console.error(e.t0),(a=new Error("capture stream from file input souce failed")).name="FileInputSouceError",a;case 17:case"end":return e.stop()}}),e,null,[[1,11]])}))),function(e){return i.apply(this,arguments)})},{key:"startCaptureAudio",value:function(e){var t=this,r=e.audioConstraints,i=e.successHandler,a=e.errorHandler;this.enableReuseStream(!1);var n=!!r&&this._getAudioConstraints(r),o=this._isFileInputAudioSource(n),s=this._isSameAudioConstraintsAsPrev(n),u=this._getPresetVideoConstraints();if(this._clearPresetAudioStreamAutoStopTimer(),s){var d=this.audioStream.getAudioTracks()[0].getSettings();return wa.setMicId(d.deviceId),wa.sendMicDevice(0,!0),void this._handleAudioCaptureSuccess(this.audioStream,n,i,!0)}this.destoryAudioMediaStream();var c={audio:n,video:o?null:u};this.isCaptureAudioInProgress=!0;var h=Date.now();J.g.isIphoneOrIpadSafari()&&(this._captureVideoDeferred=new J.a),(o?this._captureFileInputAudioStream(n):navigator.mediaDevices.getUserMedia(c)).then((function(e){if(!o){var r=e.getAudioTracks()[0].getSettings();wa.setMicId(r.deviceId),wa.sendMicDevice(Date.now()-h,!0)}t._splitAudioStream(e,c,i,a)})).catch((function(e){o||wa.sendMicDevice(Date.now()-h,!1),a(e)})).finally((function(){t.isCaptureAudioInProgress=!1,t._captureVideoDeferred&&t._captureVideoDeferred.resolve()}))}},{key:"_isFileInputVideoSource",value:function(e){return e&&e.video instanceof HTMLVideoElement}},{key:"isUsingFileInputVideoSource",value:function(){return this._isFileInputVideoSource(this.videoConstraints)}},{key:"_getFileInputSourceSize",value:function(e,t){var r=[90,180,360,720];return t||(t=360),t>720&&(t=720),t<90&&(t=90),-1===r.indexOf(t)&&r.some((function(e,i){return e>t&&(t=(e+r[i-1])/2<t?e:r[i-1],!0)})),{width:16/9*t,height:t}}},{key:"_getVideoConstraints",value:function(e){var t=e.videoSource,r=e.usingFacingMode,i=e.width,a=e.height,n=e.pan,o=e.tilt,s=e.zoom,u=e.fps;if(t instanceof HTMLVideoElement)return Da({video:t},i&&a?this._getFileInputSourceSize(i,a):{});var d=!1,c=u||24;c>30&&(c=30),c<1&&(c=24),navigator.hardwareConcurrency&&navigator.hardwareConcurrency<4&&c>10&&(c=10);var h=c;if(this.videoCaptureValue&&(t=this.videoCaptureValue.VideoSelectValue),r)d=!t||{facingMode:{exact:t}};else if(J.g.browser.isSafari)d=!t||{deviceId:{exact:t}};else{var l=this.currentVideoResolution,p=l.width,f=l.height,m=0!=p&&0!=f;d={width:m?p:i||640,height:m?f:a||360,deviceId:t?{exact:t}:void 0,frameRate:h,pan:n,tilt:o,zoom:s},ee.a.monitorVideoReadyCaptureWidth=d.width,ee.a.monitorVideoReadyCaptureHeight=d.height}return d}},{key:"_updateVideoConstraints",value:function(e){return this.videoStreamTrack?this.videoStreamTrack.applyConstraints(e).catch((function(e){Z.a.error("Applying video constraints failed",e)})):Promise.reject(new Error("video stream not exist! update video constraints failed"))}},{key:"changeVideoResolution",value:function(e,t,r){var i=this;return this.videoStreamTrack?(re.add_monitor("CCWidth"+e),this._updateVideoConstraints({width:e,height:t,frameRate:r}).then((function(){i.currentVideoResolution={width:e,height:t}}))):Promise.reject(new Error("video stream not exist! change video resolution failed"))}},{key:"_isSameVideoConstraintsAsPrev",value:function(e){return!this._isFileInputVideoSource(e)&&(!(!this.videoConstraints||!Object(J.f)(this.videoConstraints,e))&&(!!this.videoStream&&!!this._isStreamHasVideo(this.videoStream)))}},{key:"_clearCaptureVideoTimer",value:function(){this.captureVideoTimer&&(clearTimeout(this.captureVideoTimer),this.captureVideoTimer=null)}},{key:"destoryVideoMediaStream",value:function(){this.videoStream?(this._isFileInputVideoSource(this.videoConstraints)&&J.g.videoToMediaStreamManager.stopCapture(),this._isReuseStreamEnabled?this._updateStreamInReuse(this.videoStream,!0):(this._updateStreamInReuse(this.videoStream,!1),this._destoryStream(this.videoStream),this.videoStream=null,this.videoStreamTrack=null,this.videoConstraints=null,this._destoryDeprecatedStream({video:!0}))):this._destoryDeprecatedStream({video:!0}),this._isReuseStreamEnabled||this._clearCaptureVideoTimer(),this.enableReuseStream(!1),this.destoryVideoProcessor(),this._clearCheckVideoStreamActiveTimer()}},{key:"shouldCaptureVideo",value:function(){return!this.videoStream||this._isStreamInReuse(this.videoStream)}},{key:"_clearCheckVideoStreamActiveTimer",value:function(){this.checkVideoStreamActiveTimer&&(clearTimeout(this.checkVideoStreamActiveTimer),this.checkVideoStreamActiveTimer=null)}},{key:"checkVideoStreamActive",value:function(){var e=this;return new Promise((function(t,r){e._clearCheckVideoStreamActiveTimer(),e.checkVideoStreamActiveTimer=setTimeout((function(){e.videoStream?!1===e.videoStream.active?r(new Kr("VideoMediaStram.active equals false")):t(!0):r(!1)}),1e3)}))}},{key:"destoryVideoProcessor",value:function(){if(this.videoTrackReader){try{this.videoTrackReader.stop()}catch(e){}this.videoTrackReader=null}if(this.mediaStreamTrackProcessor){if(this.mediaStreamTrackProcessor=null,Qt({command:"releaseStream"}),this.reableStream&&this.reableStream.close)try{this.reableStream.close()}catch(e){}this.reableStream=null}this.videoImageCapture=null,this.unLockImageCapture()}},{key:"lockImageCapture",value:function(){this.videoImageCaptureLocked=!0}},{key:"unLockImageCapture",value:function(){this.videoImageCaptureLocked=!1}},{key:"isImageCaptureLocked",value:function(){return this.videoImageCaptureLocked}},{key:"_createVideoProcessor",value:function(){this.videoStreamTrack?this.streamProcessAbility.isSupportMediaStreamTrackProcessor?(this.mediaStreamTrackProcessor=new MediaStreamTrackProcessor(this.videoStreamTrack),this.reableStream=this.mediaStreamTrackProcessor.readable,Qt({command:"releaseStream"}),zt("frameStream",this.reableStream),re.add_monitor("VCTP")):this.streamProcessAbility.isSupportVideoTrackReader?(this.videoTrackReader=new VideoTrackReader(this.videoStreamTrack),re.add_monitor("VCTR")):this.streamProcessAbility.isSupportImageCapture&&(this.videoImageCapture=new ImageCapture(this.videoStreamTrack),re.add_monitor("VCIC")):Z.a.error("Video stream track does not exist - cannot create video processor")}},{key:"_storeVideoStream",value:function(e,t,r){e&&(Ra("video stream is ok"),this.destoryVideoMediaStream(),this.videoStream=e,this.videoStreamTrack=this.videoStream.getVideoTracks()[0],this.videoConstraints=t,r&&this._setPresetVideoStreamAutoStopTimer())}},{key:"_setPresetVideoStreamAutoStopTimer",value:function(){var e=this;this._clearPresetVideoStreamAutoStopTimer(),this.presetedConstraints.videoTimer=setTimeout((function(){e.destoryVideoMediaStream()}),1e4)}},{key:"_clearPresetVideoStreamAutoStopTimer",value:function(){this.presetedConstraints.videoTimer&&(clearTimeout(this.presetedConstraints.videoTimer),this.presetedConstraints.videoTimer=null)}},{key:"_handleVideoCaptureSuccess",value:function(e,t,r,i){this._clearPresetVideoStreamAutoStopTimer(),i||this._storeVideoStream(e,t),this._createVideoProcessor(),this._updateStreamInReuse(e,!1),r(e)}},{key:"getVideoCapabilities",value:function(){if(this.videoStream&&(this.videoStreamTrack||(this.videoStreamTrack=this.videoStream.getVideoTracks()[0]),this.videoStreamTrack)){if(this.videoStreamTrack.getCapabilities)return this.videoStreamTrack.getCapabilities()||{};if(this.videoStreamTrack.getSettings)return this.videoStreamTrack.getSettings()||{}}return{}}},{key:"_splitVideoStream",value:function(e,t,r,i){var a=t.audio,n=t.video;if(a&&this._isStreamHasAudio(e)){var o=this._genVideoStream(e),s=this._genAudioStream(e);return o?this._handleVideoCaptureSuccess(o,n,r):i(new Error("video stream do not contains video track ")),void(s&&(this.audioStream?this._pushDeprecatedStream({audioStream:s}):(this._updateStreamInReuse(s,!0),this._storeAudioStream(s,a,!0))))}this._handleVideoCaptureSuccess(e,n,r)}},{key:"_captureFileInputVideoStream",value:(r=d()(g.a.mark((function e(t){var r,i,a,n,o,s;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.video,e.prev=1,e.next=4,new Promise((function(e,t){r.currentTime>0&&!r.paused&&!r.ended&&e(!0),r.addEventListener("timeupdate",(function t(){e(!0),r.removeEventListener("timeupdate",t)})),setTimeout((function(){return t(!1)}),1e4)}));case 4:if(e.sent){e.next=7;break}throw new Error("video file playing failed");case 7:return t.width&&t.height||(i=_getFileInputSourceSize(r.videoWidth,r.videoHeight),a=i.width,n=i.height,t.width=a,t.height=n),o=J.g.videoToMediaStreamManager.startCapture(r,t.width,t.height),e.abrupt("return",o);case 12:throw e.prev=12,e.t0=e.catch(1),console.error(e.t0),(s=new Error("capture stream from file input souce failed")).name="FileInputSouceError",s;case 18:case"end":return e.stop()}}),e,null,[[1,12]])}))),function(e){return r.apply(this,arguments)})},{key:"startCaptureVideo",value:(t=d()(g.a.mark((function e(t){var r,i,a,n,o,s,u,d,c,h,l,p,f,m;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.videoConstraints,i=t.timeout,a=t.successHandler,n=t.errorHandler,!this._captureVideoDeferred){e.next=4;break}return e.next=4,this._captureVideoDeferred.promise;case 4:if(this.enableReuseStream(!1),o=!!r&&this._getVideoConstraints(r),s=this._isFileInputVideoSource(o),u=this._isSameVideoConstraintsAsPrev(o),d=this._getPresetAudioConstraints(),this._clearPresetVideoStreamAutoStopTimer(),!u){e.next=13;break}return this._handleVideoCaptureSuccess(this.videoStream,o,a,!0),e.abrupt("return");case 13:if(this.destoryVideoMediaStream(),Ra("try to getusermedia",c={audio:s?null:d,video:o}),e.prev=16,this.isCaptureVideoInProgress=!0,h=!1,this._clearCaptureVideoTimer(),i&&(this.captureVideoTimer=setTimeout((function(){if(!l){h=!0;var e=new Error("GetUserMedia timeout");n(e)}}),i)),p=Date.now(),!s){e.next=28;break}return e.next=25,this._captureFileInputVideoStream(o);case 25:l=e.sent,e.next=40;break;case 28:return c.video&&c.video.deviceId&&c.video.deviceId.exact?wa.setCameraId(c.video.deviceId.exact):wa.setCameraId("default"),e.prev=29,e.next=32,navigator.mediaDevices.getUserMedia(c);case 32:l=e.sent,e.next=40;break;case 35:return e.prev=35,e.t0=e.catch(29),e.next=39,navigator.mediaDevices.getUserMedia(Object.assign({},c,{video:!0}));case 39:l=e.sent;case 40:if(this._clearCaptureVideoTimer(),!l){e.next=49;break}if(!h){e.next=46;break}return this._destoryStream(l),s||wa.sendCameraInfo(Date.now()-p,!1,-1,-1,-1,-1),e.abrupt("return");case 46:s||(f=l.getVideoTracks()[0],(m=f.getSettings())&&wa.setVideoResolution(m.width,m.height),wa.sendCameraInfo(Date.now()-p,!0,-1,-1,-1,-1)),e.next=51;break;case 49:return s||wa.sendCameraInfo(Date.now()-p,!1,-1,-1,-1,-1),e.abrupt("return");case 51:this._splitVideoStream(l,c,a,n),e.next=57;break;case 54:e.prev=54,e.t1=e.catch(16),n(e.t1);case 57:return e.prev=57,this.isCaptureVideoInProgress=!1,e.finish(57);case 60:case"end":return e.stop()}}),e,this,[[16,54,57,60],[29,35]])}))),function(e){return t.apply(this,arguments)})},{key:"playVideoStream",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.playsinline;if(e){e.setAttribute("muted",""),r&&e.setAttribute("playsinline","");try{e.srcObject=this.videoStream}catch(t){e.src=URL.createObjectURL(this.videoStream)}var i=e.play();return i?i.then((function(){})).catch((function(e){throw Z.a.error("Automatic playback failed",e),e})):Promise.resolve(void 0)}return Promise.reject(new Error("video dom node not provided!"))}},{key:"destoryReuseStream",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.audio,r=e.video;this.enableReuseStream(!1),t&&this.destoryAudioMediaStream(),r&&this.destoryVideoMediaStream()}}]),e}()),Ra=Object(Y.a)("sdk"),xa=!1;wa.updateDeviceList(!0);var Pa=!1;try{Pa=!1}catch(e){}var Ta=0,Oa=function(e){switch(window.orientation){case 0:Ta=1;break;case 90:Ta=2;break;case 180:Ta=3;break;case-90:default:Ta=0}};function Va(){return J.g.isGoogleNestChrome()||J.g.isIphoneOrIpadSafari()}!function(){try{var e,t,r;null!==(e=screen)&&void 0!==e&&e.orientation,null===(t=window)||void 0===t||t.removeEventListener("orientationchange",Oa),null===(r=window)||void 0===r||r.addEventListener("orientationchange",Oa),Oa()}catch(e){}}();var Na,La,Wa,Ua,Fa,Ba,Ga,Ha=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Ra("sdkProps",t);try{re.add_monitor("JSBN:".concat(e.buildNumber,",").concat(e.fixVersion)),Ra("JSBN:".concat(e.buildNumber))}catch(e){Ra(e)}if(this.lateLoadedAssetsHash={},t.globalTracingLogger&&Z.a.setInstance(t.globalTracingLogger),this.isSupportThread="object"===("undefined"==typeof WebAssembly?"undefined":s()(WebAssembly))&&"function"==typeof Worker,!this.isSupportThread)throw new Error("Webassemly or worker is not supported on this browser");var r=ee.a.sharedBuffer;ee.a.reinit(),r&&(ee.a.sharedBuffer=r),this.localLog=null,Pa&&(this.localLog=new Ca,this.localLog.init()),xa||(xa=!0,navigator.mediaDevices.addEventListener("devicechange",wa.updateDeviceList.bind(wa,!1))),this.audioCtx=new(window.AudioContext||window.webkitAudioContext),this.sharingAudioCtx=new(window.AudioContext||window.webkitAudioContext),this.webrtcAudioNode=null,this.sharingWebrtcAudioNode=null,this.videoRenderArray=[],this.videoCaptureValue=null,this.audioRenderArray=[],this.audioCapture=null,this.deviceInfo=new Map,this.display=[],this.sampleRate=this.audioCtx.sampleRate,this.videoRenderIntervalHandle=null,this.audioDomNode=null,this.audioSpeakerValue=null,this.audionoderecordbuffersize=2048,this.lastresidual=null,this.currentactive=0,this.audioPlay=!1,this.sharingInterval=null,this.sharingIntervalTime=100,this.sharingDisplay=null,this.currentshareactive=0,this.videorenderinterval=30,this.waterMarkCanvas=null,this.videoCaptureHiddenCanvas=null,this.videoCaptureHiddenCanvasCtx=null,this.isSetCursor=!1,this.logon=!1,this.canvas=null,this.firstSetDelay=!0,this.isSelfViewWithVideo=!1,this.isSupportOffscreenCanvas=J.g.isSupportOffscreenCanvas(),this.isSupportImageCapture=J.g.isSupportImageCapture(),this.isSharingSupportImageCapture=this.isSupportImageCapture,this.isSupportVideoTrackReader=J.g.isSupportVideoTrackReader(),this.isSupportSharingTrackReader=this.isSupportVideoTrackReader,this.isSupportVideoShare=J.g.isSupportVideoShareReceive()&&J.g.isSupportVideoShareSend(),this.isSupportMediaStreamTrackProcessor=J.g.isSupportMediaStreamTrackProcessor(),this.isSupportVideoFrameOrBitmapCapture=J.g.isSupportVideoFrameOrBitmapCapture(),this.isMultipleCanvasForMultipleView=0,this.canISendNextSharingFrame=!0,this.isCaputureNodeConnect=!1,this.isSharingCaptureNodeConnect=!1,this.audioWorkletJsPath=null,this.isSupportChromeWideAEC=J.g.isSupportChromeWideAEC(),this.isSupport2DCanvasDrawFrame=J.g.isSupport2DCanvasDrawFrame(),this.MaskImage=null,this.BgImage=null,this.bgCanvas=null,this.bgCanvasctx=null,this.isCurrentInMaskStatus=!1,this.maskCoordinate={dx:0,dy:0,dWidth:0,dHeight:0},this.VideoMaskSettingCanvas=null,this.VideoMaskSettingCanvasctx=null,this.PrevVideoMaskSettingCanvas=null,this.VideoMaskCanvasFillMode=0,this.isMaskSettingOn=!1,this.isMaskSettingStarted=!1,this.MaskData=null,this.MaskSettingVideo=null,this.ReadyCapureWidth=640,this.ReadyCapureHeight=360,this.bgImageCroppingParams={sx:0,sy:0,sw:0,sh:0},this.VideoVBSettingCanvas=null,this.isVBSettingOn=!1,this.sMonitorCaptureFrameCount=0,this.vMonitorCaptureFrameCount=0,this.videoCaptureInterval=0,this.isStartVideoCapture=!1,this.videoCaptureWidth=0,this.videoCaptureHeight=0,this.videoCaptureContext=null,this.isCreateVideoWaterMark=!1,this.videoWaterMarkName="",this.sharingWaterMarkName="",this.isCreateSharingWaterMark=!1,this.isStartDesktopSharing=!1,this.desktopSharingValue=null,this.desktopCaptureContext=null,this.desktopSharingMediaStram=null,this.desktopSharingCaptureWidth=0,this.desktopSharingCaptureHeight=0,this.desktopSharingSend=!1,this.isdesktopCaptureLoadedmetadata=!1,this.captureVideoOutputCanvasDomList=[],this.captureVideoOutPutVideoDom=null,this.shareTrack=null,this.isVideoCaptureLoadedmetadata=!1,this.VALUE_CACHE_FOR_START_CAPTURE_VIDEO={},this.vMonitorCount=0,this.sMonitorCount=0,this.mMonitorCount=0,this.sharingTrackReader,this.sharingMediaStreamTrackProcessor,this.sharingFrameStream,this.isSendVideoOfflineCanvas=!1,ee.a.mediaSDKHandle=this,this._preloadMeetingParam=null,this.is32bitbrowser=!1,this.flipSend=!0,this.mtu_size=0,this.sharingImageCapture=null,this.sharingRenderCanvas=null,this.VideoRenderObj=null,this.SharingRenderObj=null,this.rtcConnectionA=null,this.rtcConnectionB=null,this.isLocalP2PSupportedPromise=J.g.checkLocalP2PConnection(),this.isSupportBrowserAec=!0,this.sharingWidthAndHeightInfo={ctiveNodeID:0,height:0,logicHeight:0,logicWidth:0,width:0},this.remoteControl=null,this.isMirrorMyVideo=!1,this.isCanvasScaled=!1,this.isInitVideoDataChannel=!1,this.isInitAudioDataChannel=!1,this.rtcPeerConnectionList=[],this.isDestroy=!1,this.rwgAgentMessageListenerWrapper=this.rwgAgentMessageListener.bind(this),this.bVideoDecodeWorker2MainSABPostSuccessDeferred=new J.a,this.bVideoDecodeFrameBackSABRingBufferConsumeCopyData=!1,this.bVideoDecodeUsingSAB=J.g.isSupportSharedArrayBuffer(),this.bVideoEncodeUsingSAB=J.g.isSupportSharedArrayBuffer(),this.bAudioEncodeUsingSAB=J.g.isSupportSharedArrayBuffer(),this.bAudioDecodeUsingSAB=J.g.isSupportSharedArrayBuffer(),this.audioEncodeRingBufferConsumer=null,this.audioDecodeRingBuffer=null,this.videoEncodeRingbufferConsumer=null,this.videoDecodeFrameBackSABRingBufferConsumer=null,this.bVideoEncodeMainThreadConsumerIntervalEnable=Va(),this.bAudioEncodeMainThreadConsumerIntervalEnable=J.g.isGoogleNestChrome(),this.isSupportOffscreenCanvasForVideoDecode=J.g.isSupportOffscreenCanvas(),this.bAudioDatachannelOpen=null,this.isMultiView=!1,this.webrtcaudiodom=null,t.ivObj&&(ee.a.ivObj=t.ivObj),this.WebSipClient=null,this.lastRealRect={left:0,top:0,width:0,height:0},this.videodecodehardwareflag=null,this.videoencodehardwareflag=null,this.isEnableVideoDecodeHardWareThread=!1,this.hardwareflag=null,this.isEnableHardWareThread=!1,this.isTeslaMode=!1,this.useAudioBridge=!1,this.audioBridge=null,this.replaceCanvasMap={},this.hidAvalible=!1,this.enableHID=!1,this.audioInputLevel=null,this.captureAudioMuted=!1,this.setvideokk=!1,this.isStartWhiteboardSharing=!1,this.sharingDecodeRingBuffer=null,this.ZoomMonitor=re.add_monitor.bind(re),this.isLandScape=!1,this.captureSize=null,this.platformType=V};Ha.buildNumber=4083,Ha.version="15.0.4083",Ha.util=J.g,Ha.fixVersion="Web-Media-5.16.5.3",Ha.prototype={JsMediaSDK_Log:function(e){Z.a.error("Error in JsMediaSDK",e)},JsMediaSDK_PreLoad:function(e,t,r){var i=r||{},a=i.isTeslaMode,n=i.enableMultiDecodeVideoWithoutSAB,o=i.enableReplaceCanvasWhenContextLost,s=i.enableVirtualBackgroundWithoutSAB,u=i.enableDecoderInWorklet,d=i.enableAudioBridge;ee.a.decoderinworkletOP=!0,ee.a.chromeWideAEC=u,ee.a.enableMultiDecodeVideoWithoutSAB=n,ee.a.enableReplaceCanvasWhenContextLost=o,ee.a.enableVirtualBackgroundWithoutSAB=s,ee.a.enableAudioBridge=d,this.isTeslaMode=!!a;var c={audioWorkletPath:e.audioWorkletPath,audioWorkletSIMDPath:e.audioWorkletSIMDPath,audioWorkletProcessPath:e.audioWorkletProcessPath,sharingAudioWorkletPath:e.sharingAudioWorkletPath};this.setPropsBeforeInit({callback:t,audioWorkletPath:c}),this._preloadMeetingParam=e,lr(),re.add_monitor("JSPLD"),r&&r.file&&r.resourceManager&&Or(r.file,r.resourceManager)},recordSharingParamInfo:function(){var e=this;$.a.on(P.Xc,(function(t,r){Object.assign(e.sharingWidthAndHeightInfo,r.body)}))},setCallback:function(e){if(!Qr()(e))throw new Error("callback must be function");ee.a._Notify_APPUI=e},setPropsBeforeInit:function(e){e.callback&&this.setCallback(e.callback),e.audioWorkletPath&&(this.audioWorkletJsPath=e.audioWorkletPath),e.e2eEncrypt?ee.a.e2eencrypt=!0:ee.a.e2eencrypt=!1,this._setWebtransportEnable({enable:e.enableWebtransport,webtransportPort:e.webtransportPort}),e.bandwidth?e.bandwidth.uplimit>=800?ee.a.uplimit=1e3*(e.bandwidth.uplimit-120):ee.a.uplimit=0:ee.a.uplimit||(ee.a.uplimit=0)},setRWGAgent:function(e){ee.a.rwgAgent=e,this.addEventListenerForRWGAgent(e)},updateQosSubscription:function(e,t,r){var i=!0;this.isSupportVideoShare&&(t==ie.f.SHARING_DECODE&&(t=ie.f.VIDEO_DECODE,i=!1),t==ie.f.SHARING_ENCODE&&(t=ie.f.VIDEO_ENCODE,i=!1)),Dr(t,{enable:e,workerType:t,pollingInterval:r,isVideo:i},"QosMonitoring",!1)},addEventListenerForRWGAgent:function(e){e.on("message",this.rwgAgentMessageListenerWrapper)},rwgAgentMessageListener:function(e){if("string"==typeof e.data){var t=JSON.parse(e.data);if(!this.isDestroy)switch(t.evt){case P.Eb:this.setRTCPeerConnectionDatachannelAnswer(t)}}},setRTCPeerConnectionDatachannelAnswer:function(e){if(e.evt===P.hf||e.evt===P.ef){if(Ra("rwg answer",e),!e.answer)return;switch(e.answer.type){case ie.h.ZOOM_CONNECTION_VIDEO:$.a.trigger(P.vc.ZOOM_CONNECTION_VIDEO_OFFER_RESPONSE_EVT,e);break;case ie.h.ZOOM_CONNECTION_AUDIO:$.a.trigger(P.vc.ZOOM_CONNECTION_AUDIO_OFFER_RESPONSE_EVT,e)}}},initVideoDataChannel:function(e,t){var r=this;return d()(g.a.mark((function i(){var a,n;return g.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(!r.isInitVideoDataChannel){i.next=3;break}return t&&(a=r.rtcPeerConnectionList.find((function(e){return e.connectionType===ie.b.VIDEO})))&&a.checkEmptyUserIdAndResendMonitor(t),i.abrupt("return");case 3:r.isInitVideoDataChannel=!0,re.add_monitor("INITVDC"),Ra("initVideoDataChannel",e),n=new oi,J.g.browser.isFirefox&&(n.delaycloseTimeout=15e3),n.setUserid(t),n.setConnectionType(ie.b.VIDEO),Ra("rtc",n),n.onConnectionCreated(function(){var e=d()(g.a.mark((function e(t){var i,a,o;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.localDescription,Ra("localDesc",i),ee.a.sendMessageToRwg(P.Fc,{evt:P.gf,offer:{sdp:i.sdp,type:ie.h.ZOOM_CONNECTION_VIDEO}},!1),e.next=5,n.waitForAnswerFromRWG(P.vc.ZOOM_CONNECTION_VIDEO_OFFER_RESPONSE_EVT);case 5:a=e.sent,Ra("jsEvent.PUBSUB_EVT.ZOOM_CONNECTION_VIDEO_OFFER_RESPONSE_EVT",a),n.setRemoteDescription(a.answer),n.closeIfTimeout(),o=a.answer.sdp.match(/a=candidate:.+/)[0],Ra("received candidate",o),o=o.replace(/^a=/,""),n.addIceCandidate(o),n.listenOnDataAndSend(P.je),n.onMessage((function(e){var t=new Uint8Array(e);t[0]!=P.Dc&&132!=t[0]||(1&t[1])!=P.sb?r.isSupportVideoShare||133!=t[0]&&132!=t[0]?r.videoDecodeRingBuffer?r.videoDecodeRingBuffer.enqueueSafe(t,!0,r.ZoomMonitor):Dr(ie.f.VIDEO_DECODE,e,void 0,!0):r.sharingDecodeRingBuffer?r.sharingDecodeRingBuffer.enqueueSafe(t,!0,null):Dr(ie.f.SHARING_DECODE,e,void 0,!0):Dr(ie.f.VIDEO_ENCODE,e,void 0,!0)})),n.dataChannel.addEventListener("open",(function(){Dr(ie.f.VIDEO_DECODE,{isDataChannelOpen:!0},"UPDATE_DATACHANNEL_STATUS",!1,!0),Dr(ie.f.VIDEO_ENCODE,{isDataChannelOpen:!0},"UPDATE_DATACHANNEL_STATUS",!1,!0),r.isSupportVideoShare||Dr(ie.f.SHARING_DECODE,{isDataChannelOpen:!0},"UPDATE_DATACHANNEL_STATUS",!1,!0)})),n.dataChannel.addEventListener("close",(function(){Dr(ie.f.VIDEO_DECODE,{isDataChannelOpen:!1},"UPDATE_DATACHANNEL_STATUS"),Dr(ie.f.VIDEO_ENCODE,{isDataChannelOpen:!1},"UPDATE_DATACHANNEL_STATUS"),r.isSupportVideoShare||Dr(ie.f.SHARING_DECODE,{isDataChannelOpen:!1},"UPDATE_DATACHANNEL_STATUS",!1,!0)}));case 17:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),n.initConnection(e).catch((function(e){Ra.warn("initConnection",e),re.add_monitor("INITVDCERR",e.message)})),r.rtcPeerConnectionList.push(n),r.videoDataChannel=n;case 15:case"end":return i.stop()}}),i)})))()},initAudioDataChannel:function(e,t){var r=this;return d()(g.a.mark((function i(){var a,n;return g.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(!r.isInitAudioDataChannel){i.next=3;break}return t&&(a=r.rtcPeerConnectionList.find((function(e){return e.connectionType===ie.b.AUDIO})))&&a.checkEmptyUserIdAndResendMonitor(t),i.abrupt("return");case 3:r.isInitAudioDataChannel=!0,re.add_monitor("INITADC"),Ra("initAudioDataChannel",e),n=new oi,J.g.browser.isFirefox&&(n.delaycloseTimeout=15e3),n.setUserid(t),n.setConnectionType(ie.b.AUDIO),Ra("rtc",n),n.onConnectionCreated(function(){var e=d()(g.a.mark((function e(t){var i,a,o;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.localDescription,Ra("localDesc",i),ee.a.sendMessageToRwg(P.Fc,{evt:P.gf,offer:{sdp:i.sdp,type:ie.h.ZOOM_CONNECTION_AUDIO}},!1),e.next=5,n.waitForAnswerFromRWG(P.vc.ZOOM_CONNECTION_AUDIO_OFFER_RESPONSE_EVT);case 5:a=e.sent,Ra("answer",a),n.setRemoteDescription(a.answer),n.closeIfTimeout(),o=a.answer.sdp.match(/a=candidate:.+/)[0],Ra("received candidate",o),o=o.replace(/^a=/,""),n.addIceCandidate(o),n.listenOnDataAndSendAudio(P.k),n.onMessage((function(e){var t=new Uint8Array(e);if(t[0]==P.Cc&&t[1]==P.sb)Dr(ie.f.AUDIO_ENCODE,e,void 0,!0);else{var i=!(r.audioDecodeRingBuffer&&ee.a.sharedBuffer);i||r.audioDecodeRingBuffer.enqueue(t),Dr(ie.f.AUDIO_DECODE,!i||e,void 0,i)}})),n.dataChannel.addEventListener("open",(function(){r.bAudioDatachannelOpen=!0,Dr(ie.f.AUDIO_DECODE,{isDataChannelOpen:!0},"UPDATE_DATACHANNEL_STATUS",!1,!0),Dr(ie.f.AUDIO_ENCODE,{isDataChannelOpen:!0},"UPDATE_DATACHANNEL_STATUS",!1,!0)})),n.dataChannel.addEventListener("close",(function(){r.bAudioDatachannelOpen=!1,Dr(ie.f.AUDIO_DECODE,{isDataChannelOpen:!1},"UPDATE_DATACHANNEL_STATUS"),Dr(ie.f.AUDIO_ENCODE,{isDataChannelOpen:!1},"UPDATE_DATACHANNEL_STATUS")}));case 17:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),n.initConnection(e,"ZoomWebclientAudioDataChannel").catch((function(e){Ra.warn("initConnection",e),re.add_monitor("INITADCERR",e.message)})),r.rtcPeerConnectionList.push(n),r.audioDataChannel=n;case 15:case"end":return i.stop()}}),i)})))()},init_Notify_APPUI:function(e,t){var r=Br[t],i=e?r.success:r.fail;ee.a.Notify_APPUI(i,r.callbackDataValue)},_setWebtransportEnable:function(e){var t=e.enable,r=e.webtransportPort;t?(J.e.setIsSupportWebtransport(!0),ee.a.webtransportPort=r||8802):J.e.setIsSupportWebtransport(!1)},_previewInitWebtransport:function(e){var t=e.conId,r=e.meetingNumber,i=e.rwgHost,a=e.webtransportPort,n=e.workType;if(this._setWebtransportEnable({enable:!0,webtransportPort:a}),J.e.getIsSupportWebtransport()){var o=n===ie.f.AUDIO_ENCODE,s=n===ie.f.AUDIO_DECODE,u=n===ie.f.VIDEO_ENCODE,d=n===ie.f.VIDEO_DECODE,c=o||s,h=c?"a":"v",l=o||u?2:1,p="https://".concat(i,":").concat(ee.a.webtransportPort,"/wc/media/").concat(r,"?type=").concat(h,"&cid=").concat(t),f="".concat(p,"&mode=").concat(l);c?ut(p):ct(p);var m=ee.a.SPECIAL_ID,v="",g=null;o?(v="localAudioEncMGR",g=be.nameMap.CREATE_AUDIO_ENCODE_HANDLE_SUCCESS):s?(v="localAudioDecMGR",g=be.nameMap.CREATE_AUDIO_DECODE_HANDLE_SUCCESS):u?(v="localVideoEncMGR",g=be.nameMap.CREATE_VIDEO_ENCODE_HANDLE_SUCCESS):d&&(v="localVideoDecMGR",g=be.nameMap.CREATE_VIDEO_DECODE_HANDLE_SUCCESS);var S=ee.a[v]&&ee.a[v].map.get(m);S?S.postMessage({command:"OPEN_MEDIA_WEBTRANSPORT",webtransportURL:f}):be.enqueueMessage({name:g,handler:function(){(S=ee.a[v].map.get(m)).postMessage({command:"OPEN_MEDIA_WEBTRANSPORT",webtransportURL:f})},direction:be.direction.SDK_TO_SDK})}},_previewInitMediaWebsocket:function(e){var t=e.websocketUrl,r=e.workType,i=ee.a.SPECIAL_ID,a=r===ie.f.AUDIO_ENCODE,n=r===ie.f.AUDIO_DECODE,o=r===ie.f.VIDEO_ENCODE,s=r===ie.f.VIDEO_DECODE;a||n?st(t):dt(t);var u="",d=null,c=0;a?(c=2,u="localAudioEncMGR",d=be.nameMap.CREATE_AUDIO_ENCODE_HANDLE_SUCCESS):n?(c=5,u="localAudioDecMGR",d=be.nameMap.CREATE_AUDIO_DECODE_HANDLE_SUCCESS):o?(c=2,u="localVideoEncMGR",d=be.nameMap.CREATE_VIDEO_ENCODE_HANDLE_SUCCESS):s&&(c=5,u="localVideoDecMGR",d=be.nameMap.CREATE_VIDEO_DECODE_HANDLE_SUCCESS);var h=ee.a[u]&&ee.a[u].map.get(i);h?h.postMessage({command:"OPEN_MEDIA_WEBSOCKET",websocket_ip_address:"".concat(t,"&mode=").concat(c)}):be.enqueueMessage({name:d,handler:function(){(h=ee.a[u].map.get(i)).postMessage({command:"OPEN_MEDIA_WEBSOCKET",websocket_ip_address:"".concat(t,"&mode=").concat(c)})},direction:be.direction.SDK_TO_SDK})},previewInit:function(e){var t=this;return d()(g.a.mark((function r(){var i,a,n,o,s,u,d,c,h,l,p,f,m,v,S,_,C,y,b,A,k,E,w,I,D,M,R,x,P,T,O,V,N,L,W,U,F,B,G,H,j,K,q,Q,z,X,Y,Z,$,te,re;return g.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(i=e.videoDecode,a=e.videoDataChannel,n=e.videoEncodeMediaWss,o=e.videoDecodeMediaWss,s=e.videoEncodeWebtransport,u=e.videoDecodeWebtransport,d=e.audioDecode,c=e.audioDataChannel,h=e.audioBridge,l=e.audioEncodeMediaWss,p=e.audioDecodeMediaWss,f=e.audioEncodeWebtransport,m=e.audioDecodeWebtransport,!i){r.next=18;break}return v=(i||{}).urlParameters,r.next=5,J.g.isSDKSupportMultiThread();case 5:if(r.t0=r.sent,!r.t0){r.next=8;break}r.t0=!J.g.isSelfPreviewRenderWithVideo()||J.g.isAndroidBrowser();case 8:return S=r.t0,r.next=11,J.g.isSDKSupportSIMD();case 11:_=r.sent,C=_&&S,y={},t.isSupportVideoShare?(y.workerJsFileUrl=v.vsmiworkerpath,y.workerWasmFileUrl=v.videoMSIMDWasm):C?(y.workerJsFileUrl=v.videoMSIMDWorkerPath,y.workerWasmFileUrl=v.videoMSIMDWasm):S?(y.workerJsFileUrl=v.videoMtWorkerPath,y.workerWasmFileUrl=v.videoMtWasm):_?(y.workerJsFileUrl=v.videoSIMDWorkerPath,y.workerWasmFileUrl=v.videoSIMDWasm):(y.workerJsFileUrl=v.videoWorkerPath,y.workerWasmFileUrl=v.videoWasm),y.integrityHelper=new J.c(y.workerJsFileUrl,t.lateLoadedAssetsHash),Ae.resetVideoDecode(!0),we(y,t);case 18:if(a&&(b=a.conId,A=a.userid,t.initVideoDataChannel(b,A),ee.a.monitorCid=b),n&&(k=n.websocketUrl,t._previewInitMediaWebsocket({websocketUrl:k,workType:ie.f.VIDEO_ENCODE})),o&&(E=o.websocketUrl,t._previewInitMediaWebsocket({websocketUrl:E,workType:ie.f.VIDEO_DECODE})),s&&(w=s.conId,I=s.meetingNumber,D=s.rwgHost,M=s.webtransportPort,t._previewInitWebtransport({conId:w,meetingNumber:I,rwgHost:D,webtransportPort:M,workType:ie.f.VIDEO_ENCODE})),u&&(R=u.conId,x=u.meetingNumber,P=u.rwgHost,T=u.webtransportPort,t._previewInitWebtransport({conId:R,meetingNumber:x,rwgHost:P,webtransportPort:T,workType:ie.f.VIDEO_DECODE})),!d){r.next=33;break}return O=(d||{}).urlParameters,V={},r.next=28,J.g.isSDKSupportSIMD();case 28:r.sent?(V.workerJsFileUrl=O.audioSIMDWorkletPath,V.workerWasmFileUrl=O.audioSIMDWasm):(V.workerJsFileUrl=O.audioWorkerPath,V.workerWasmFileUrl=O.audioWasm),V.integrityHelper=new J.c(V.workerJsFileUrl,t.lateLoadedAssetsHash),Ae.resetAudioDecode(!0),Re(V,t);case 33:if(c&&(N=c.conId,L=c.userid,t.initAudioDataChannel(N,L),ee.a.monitorCid=N),!h){r.next=41;break}return t.useAudioBridge=!0,W=h.nginxHost,U=h.rwgHost,F=h.cid,B=h.abToken,G=h.isCapturingAudio,H=h.isJoinAudio,j=h.supportLocalAB,t.audioBridge?t.audioBridge.leaveAudioWithoutDisconnect():t.audioBridge=new Zi(W,U,F,!G,t.isMultiView,j),G&&t.audioBridge.setRecvOnly(!1,Ma.audioStream),r.next=41,t.audioBridge.join(!1,B,H);case 41:l&&(K=l.websocketUrl,t._previewInitMediaWebsocket({websocketUrl:K,workType:ie.f.AUDIO_ENCODE})),p&&(q=p.websocketUrl,t._previewInitMediaWebsocket({websocketUrl:q,workType:ie.f.AUDIO_DECODE})),f&&(Q=f.conId,z=f.meetingNumber,X=f.rwgHost,Y=f.webtransportPort,t._previewInitWebtransport({conId:Q,meetingNumber:z,rwgHost:X,webtransportPort:Y,workType:ie.f.AUDIO_ENCODE})),m&&(Z=m.conId,$=m.meetingNumber,te=m.rwgHost,re=m.webtransportPort,t._previewInitWebtransport({conId:Z,meetingNumber:$,rwgHost:te,webtransportPort:re,workType:ie.f.AUDIO_DECODE}));case 45:case"end":return r.stop()}}),r)})))()},previewUnInitRtcConnection:function(){try{this.isInitAudioDataChannel=!1,this.isInitVideoDataChannel=!1,this.rtcPeerConnectionList.forEach((function(e){e&&(e.forceClose(),e=null)})),this.rtcPeerConnectionList=[]}catch(e){Ra.error("clear rtcPeerConnectionList err",e)}this.audioBridge&&(this.audioBridge.destroy(!1),this.audioBridge=null);var e=ee.a.SPECIAL_ID;[ee.a.localVideoEncMGR&&ee.a.localVideoEncMGR.map.get(e),ee.a.localVideoDecMGR&&ee.a.localVideoDecMGR.map.get(e),ee.a.localAudioEncMGR&&ee.a.localAudioEncMGR.map.get(e),ee.a.localAudioDecMGR&&ee.a.localAudioDecMGR.map.get(e)].forEach((function(e){e&&(e.postMessage({command:"CLOSE_MEDIA_WEBSOCKET"}),e.postMessage({command:"CLOSE_MEDIA_WEBTRANSPORT"}))}))},initVideoEncode:function(e,t,r){var i=arguments,a=this;return d()(g.a.mark((function n(){var o,s,u,d,c,h,l,p,f,m,v,S,_,C,y,b,A,k,E,w,I,D,M,R,x,P,T,O;return g.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return o=i.length>3&&void 0!==i[3]&&i[3],s=i.length>4?i[4]:void 0,u=i.length>5?i[5]:void 0,d=i.length>6?i[6]:void 0,c=i.length>7?i[7]:void 0,h=!(i.length>8&&void 0!==i[8])||i[8],l=i.length>9?i[9]:void 0,p=i.length>10?i[10]:void 0,f=i.length>11&&void 0!==i[11]&&i[11],m=i.length>12?i[12]:void 0,a.isSupportImageCapture=!c&&a.isSupportImageCapture,Ma.setStreamProcessAbility({isSupportImageCapture:a.isSupportImageCapture}),a.isSupportVideoFrameOrBitmapCapture=a.isSupportImageCapture||a.isSupportVideoTrackReader||a.isSupportMediaStreamTrackProcessor,Ra("initVideoEncode"),re.add_monitor("INITVE"),wa.setUserId(r),Ae.resetVideoEncode(m),n.next=19,J.g.is32bitChrome();case 19:return a.is32bitbrowser=n.sent,n.next=22,J.g.isSDKSupportMultiThread();case 22:if(n.t0=n.sent,!n.t0){n.next=25;break}n.t0=!J.g.isSelfPreviewRenderWithVideo()||J.g.isAndroidBrowser()||J.g.isIphoneOrIpadSafari()&&J.g.isSupportVideoFrame();case 25:return v=n.t0,J.e.setIsSupportVirtualBackground(!a.isTeslaMode&&!J.g.isGoogleNestChrome()&&!J.g.isAndroidBrowser()&&!c&&(v||ee.a.enableVirtualBackgroundWithoutSAB)),S=J.e.getIsSupportVirtualBackground(),n.next=30,J.g.isSDKSupportSIMD();case 30:if(_=n.sent,C=_&&v,y={},b=!1,A=J.g.graphicName(),k=!!A&&A.includes("amd"),a.isAppleGraphic=!!A&&((A.includes("apple m1")||A.includes("apple m2"))&&!J.g.isChromeVersionHigherThan(116)),n.t2=J.g.isIphoneOrIpadBrowser()||J.g.isIpadOS()||navigator.hardwareConcurrency&&navigator.hardwareConcurrency>7,n.t2){n.next=51;break}return n.next=41,J.g.VP9MachineDetect();case 41:if(n.t5=n.sent,!n.t5){n.next=44;break}n.t5=k;case 44:if(n.t4=n.t5,!n.t4){n.next=47;break}n.t4=navigator.hardwareConcurrency;case 47:if(n.t3=n.t4,!n.t3){n.next=50;break}n.t3=navigator.hardwareConcurrency>=4;case 50:n.t2=n.t3;case 51:if(n.t1=n.t2,!n.t1){n.next=54;break}n.t1=l;case 54:if(!n.t1){n.next=56;break}b=!0;case 56:if(J.g.isIphoneOrIpadSafari()&&!J.g.isSupportVideoFrame()&&(b=!1),re.add_monitor("isMT: "+v),re.add_monitor("isenbaleHD: "+l),re.add_monitor("ENABLE720:"+b),re.add_monitor("ISVSV:"+a.isSupportVideoShare),re.add_monitor("graphicname: "+A),E=p,!(v&&(l||f)&&a.isSupportMediaStreamTrackProcessor&&J.g.isChromeVersionHigherThan(95))||J.g.isGoogleNestChrome()||0!==J.g.AdapterWhiteListCheckForEncoder()){n.next=73;break}if(n.t6=!0,!n.t6){n.next=69;break}return n.next=68,J.g.IsSupportVideoEncodeHardwareAcceleration();case 68:n.t6=n.sent;case 69:a.videoencodehardwareflag=n.t6,p=a.videoencodehardwareflag,n.next=75;break;case 73:a.videoencodehardwareflag=!1,p=!1;case 75:return a.isSupportVideoShare?(y.workerJsFileUrl=e.vsmiworkerpath,y.workerWasmFileUrl=e.videoMSIMDWasm):C?(y.workerJsFileUrl=e.videoMSIMDWorkerPath,y.workerWasmFileUrl=e.videoMSIMDWasm):v?(y.workerJsFileUrl=e.videoMtWorkerPath,y.workerWasmFileUrl=e.videoMtWasm):_?(y.workerJsFileUrl=e.videoSIMDWorkerPath,y.workerWasmFileUrl=e.videoSIMDWasm):(y.workerJsFileUrl=e.videoWorkerPath,y.workerWasmFileUrl=e.videoWasm),y.integrityHelper=new J.c(y.workerJsFileUrl,a.lateLoadedAssetsHash),m||(w=new URL(t).searchParams.get("cid"),I=new URL(t).host,J.e.getIsSupportWebtransport()&&ct("https://".concat(I,":").concat(ee.a.webtransportPort,"/wc/media/").concat(u,"?type=v&cid=").concat(w)),a.previewInit({videoDataChannel:{conId:w,userid:r}})),D=1,M=!1,R=!1,(x=S&&v)&&p?(D=3,M=!0,R=!!E):x||p?(D=2,p&&(M=!0,R=!!E)):(a.isSupportVideoShare||v)&&(D=2),P=M&&R&&b,J.g.set720pcapacity(P),re.add_monitor("CAPTURE720:"+P),re.add_monitor("VETNum:"+D),J.g.isAndroidBrowser()?a.platformType=N:J.g.isIphoneOrIpadBrowser()&&(a.platformType=L),R=R&&!a.isAppleGraphic,T={log:o,confId:r,meetingid:s,meetingnumb:u,videodecodethreadnumb:d,isSupportMultiThread:v,videoencodethreadnumb:D,qoson:h,isSupportVirtualBackground:S,isSupportWebCodecEnocde:M,initWebCodecFlag:R,is360penablehw:f,enable720p:b,platformType:a.platformType},n.t7=console,n.next=93,J.g.VP9MachineDetect();case 93:return n.t8=n.sent,n.t9=J.g.isAMDGraphic(),n.t10=J.g.isGraphicShouldUseHardwareAccelerationDecode(),n.t11="isenbaleHD:"+l+" enable720p?:",n.t12=b,n.t13=P,n.t7.log.call(n.t7,"VP9?:",n.t8,"AMD?:",n.t9,"AMDdecodecheck:",n.t10,n.t11,n.t12,"capacityfor720:",n.t13),ot(t,T),O=new ii({interval:1e4,tag:"WCL_M,VERB",reportcallback:function(e,t,r,i){re.add_monitor("".concat(e,",").concat(t,",").concat(r,",").concat(i))}}),n.next=104,ke(y,a);case 104:if(!m){n.next=106;break}return n.abrupt("return");case 106:return n.next=108,ee.a.videoInitInstance.initSuccessPromise.then((function(e){if(e&&a.bVideoEncodeUsingSAB)if(v)$.a.on("VIDEO_ENCODE_PTR",(function(e,t){var r=new Wi(t.data.buffer,void 0,void 0,!0,t.offset,t.length,t.data);a.videoEncodeRingbufferConsumer=new Ui(r,a.consumeVideoEncodeRingbuffer.bind(a),O.timeoutReport.bind(O)),a.bVideoEncodeMainThreadConsumerIntervalEnable&&a.videoEncodeRingbufferConsumer&&a.videoEncodeRingbufferConsumer.consume(20)})),Dr(ie.f.VIDEO_ENCODE,{bVideoEncodeMainThreadConsumerIntervalEnable:a.bVideoEncodeMainThreadConsumerIntervalEnable},"VIDEO_ENCODE_SAB",!1,!0);else{var t=Wi.getStorageForCapacity(),r=new Wi(t,void 0,void 0,!0);a.videoEncodeRingbufferConsumer=new Ui(r,a.consumeVideoEncodeRingbuffer.bind(a),O.timeoutReport.bind(O)),a.bVideoEncodeMainThreadConsumerIntervalEnable&&a.videoEncodeRingbufferConsumer&&a.videoEncodeRingbufferConsumer.consume(20),Dr(ie.f.VIDEO_ENCODE,{buffer:t,bVideoEncodeMainThreadConsumerIntervalEnable:a.bVideoEncodeMainThreadConsumerIntervalEnable},"VIDEO_ENCODE_SAB",!1,!0)}return e})).then((function(e){return a.init_Notify_APPUI(e,ie.f.VIDEO_ENCODE),be.subscribeMessage(be.nameMap.INIT_VIDEO_ENCODE_SUCCESS),e}));case 108:return n.abrupt("return",n.sent);case 109:case"end":return n.stop()}}),n)})))()},initVideoDecode:function(e,t,r){var i=arguments,a=this;return d()(g.a.mark((function n(){var o,s,u,c,h,l,p,f,m,v,S,_,C,y,b,A;return g.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return o=i.length>3&&void 0!==i[3]&&i[3],s=i.length>4?i[4]:void 0,u=i.length>5?i[5]:void 0,c=i.length>6?i[6]:void 0,h=i.length>7&&void 0!==i[7]&&i[7],l=!(i.length>8&&void 0!==i[8])||i[8],Ae.resetVideoDecode(!1),Ra("initVideoDecode"),re.add_monitor("INITVD"),c>1&&Object(J.d)()&&(a.isMultiView=!0),n.next=12,J.g.is32bitChrome();case 12:return a.is32bitbrowser=n.sent,n.next=15,J.g.isSDKSupportMultiThread();case 15:if(n.t0=n.sent,!n.t0){n.next=18;break}n.t0=!J.g.isSelfPreviewRenderWithVideo()||J.g.isAndroidBrowser()||J.g.isIphoneOrIpadSafari()&&J.g.isSupportVideoFrame();case 18:return p=n.t0,n.next=21,J.g.isSDKSupportSIMD();case 21:if(f=n.sent,m=f&&p,v={},a.isEnableVideoDecodeHardWareThread=J.g.isChromeVersionHigherThan(95),!h||!a.isEnableVideoDecodeHardWareThread){n.next=30;break}return n.next=28,J.g.IsSupportVideoDecodeHardwareAcceleration();case 28:a.videodecodehardwareflag=n.sent,h=a.videodecodehardwareflag;case 30:return re.add_monitor("SupportWebCodecDecode:".concat(h)),a.isSupportVideoShare?(v.workerJsFileUrl=e.vsmiworkerpath,v.workerWasmFileUrl=e.videoMSIMDWasm):m?(v.workerJsFileUrl=e.videoMSIMDWorkerPath,v.workerWasmFileUrl=e.videoMSIMDWasm):p?(v.workerJsFileUrl=e.videoMtWorkerPath,v.workerWasmFileUrl=e.videoMtWasm):f?(v.workerJsFileUrl=e.videoSIMDWorkerPath,v.workerWasmFileUrl=e.videoSIMDWasm):(v.workerJsFileUrl=e.videoWorkerPath,v.workerWasmFileUrl=e.videoWasm),v.integrityHelper=new J.c(v.workerJsFileUrl,a.lateLoadedAssetsHash),S=new URL(t).searchParams.get("cid"),_=new URL(t).host,J.e.getIsSupportWebtransport()&&ct("https://".concat(_,":").concat(ee.a.webtransportPort,"/wc/media/").concat(u,"?type=v&cid=").concat(S)),a.previewInit({videoDataChannel:{conId:S,userid:r}}),C=h&&a.isEnableVideoDecodeHardWareThread&&c>1&&navigator.hardwareConcurrency&&navigator.hardwareConcurrency>=4,J.g.setsub1080pcapacity(C),y=a.platformType,J.g.isAndroidBrowser()?y=N:J.g.isIphoneOrIpadBrowser()&&(y=L),b={log:o,confId:r,meetingid:s,meetingnumb:u,videodecodethreadnumb:c,isFirefox:J.g.browser.isFirefox,isSupportMultiThread:p,isSupportVideoTrackReader:a.isSupportVideoTrackReader,isSupportOffscreenCanvas:a.isSupportOffscreenCanvas,isenablehw:h,isEnableVideoDecodeHardWareThread:a.isEnableVideoDecodeHardWareThread,qoson:l,isEnableHardWareThread:a.isEnableHardWareThread,isTeslaMode:a.isTeslaMode,platformType:y},ot(t,b),15e5,a.bVideoDecodeUsingSAB&&(p?$.a.on("VIDEO_DECODE_PTR",(function(e,t){a.videoDecodeRingBuffer=new Wi(t.data.buffer,void 0,void 0,void 0,t.offset,t.length,t.data)})):(A=Wi.getStorageForCapacity(),a.videoDecodeRingBuffer=new Wi(A))),n.next=47,we(v,a);case 47:return n.next=49,ee.a.videoDecInitInstance.initSuccessPromise.then(function(){var e=d()(g.a.mark((function e(t){var r,i;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t||!a.bVideoDecodeUsingSAB){e.next=6;break}return e.next=3,Dr(ie.f.VIDEO_DECODE,p?null:A,"VIDEO_DECODE_SAB_FROM_DATACHANNEL",!1,!0);case 3:(r=e.sent)||(a.videoDecodeRingBuffer=null),Ra("videoDatachannelSAB",r);case 6:e.next=12;break;case 9:i=e.sent,a.bVideoDecodeWorker2MainSABPostSuccessDeferred.resolve(i),Ra("videoDecodeFrameBackSAB",i);case 12:return e.abrupt("return",t);case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).then((function(e){return a.init_Notify_APPUI(e,ie.f.VIDEO_DECODE),be.subscribeMessage(be.nameMap.INIT_VIDEO_DECODE_SUCCESS),e}));case 49:return n.abrupt("return",n.sent);case 50:case"end":return n.stop()}}),n)})))()},initAudioEncode:function(e,t,r){var i=arguments,a=this;return d()(g.a.mark((function n(){var o,s,u,d,c,h,l,p,f,m,v,S;return g.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return o=i.length>3&&void 0!==i[3]&&i[3],s=i.length>4?i[4]:void 0,u=i.length>5?i[5]:void 0,d=i.length>6?i[6]:void 0,c=!(i.length>7&&void 0!==i[7])||i[7],h=i.length>8?i[8]:void 0,Ra("initAudioEncode"),re.add_monitor("INITAE"),wa.setUserId(r),Ae.resetAudioEncode(h),n.next=12,J.g.is32bitChrome();case 12:return a.is32bitbrowser=n.sent,l={},n.next=16,J.g.isSDKSupportSIMD();case 16:return n.sent?(l.workerJsFileUrl=e.audioSIMDWorkletPath,l.workerWasmFileUrl=e.audioSIMDWasm):(l.workerJsFileUrl=e.audioWorkerPath,l.workerWasmFileUrl=e.audioWasm),l.integrityHelper=new J.c(l.workerJsFileUrl,a.lateLoadedAssetsHash),h||(p=new URL(t).searchParams.get("cid"),f=new URL(t).host,J.e.getIsSupportWebtransport()&&ut("https://".concat(f,":").concat(ee.a.webtransportPort,"/wc/media/").concat(u,"?type=a&cid=").concat(p)),a.previewInit({audioDataChannel:{conId:p,userid:r}})),a.audioCtx||(a.audioCtx=new(window.AudioContext||window.webkitAudioContext)),m={sampleRate:a.audioCtx.sampleRate,userid:r,log:o,meetingid:s,meetingnumb:u,videodecodethreadnumb:d,qoson:c},nt(t,m),S=1500,a.bAudioEncodeUsingSAB&&!h&&(v=Wi.getStorageForCapacity(100,S),a.audioEncodeRingBufferConsumer=new Ui(new Wi(v,S,void 0,!0),a.audioEncodeRingBufferConsumerCallback.bind(a))),n.next=27,De(l,a);case 27:if(!h){n.next=29;break}return n.abrupt("return");case 29:return n.next=31,ee.a.audioEncodeInitInstance.initSuccessPromise.then((function(e){return e&&null!==a.bAudioDatachannelOpen&&Dr(ie.f.AUDIO_ENCODE,{isDataChannelOpen:a.bAudioDatachannelOpen},"UPDATE_DATACHANNEL_STATUS"),e&&v&&Dr(ie.f.AUDIO_ENCODE,{buffer:v,bytesPerEle:S,bAudioEncodeMainThreadConsumerIntervalEnable:a.bAudioEncodeMainThreadConsumerIntervalEnable},"audioEncodeSAB",!1,!0),e})).then((function(e){return a.init_Notify_APPUI(e,ie.f.AUDIO_ENCODE),e}));case 31:return n.abrupt("return",n.sent);case 32:case"end":return n.stop()}}),n)})))()},initAudioDecode:function(e,t,r){var i=arguments,a=this;return d()(g.a.mark((function n(){var o,s,u,c,h,l,p,f,m,v,S,_;return g.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return o=i.length>3&&void 0!==i[3]&&i[3],s=i.length>4?i[4]:void 0,u=i.length>5?i[5]:void 0,c=i.length>6?i[6]:void 0,h=!(i.length>7&&void 0!==i[7])||i[7],Ae.resetAudioDecode(!1),Ra("initAudioDecode"),wa.setUserId(r),re.add_monitor("INITAD"),n.next=11,J.g.is32bitChrome();case 11:return a.is32bitbrowser=n.sent,l=new URL(t).searchParams.get("cid"),p=new URL(t).host,(f={}).workerJsFileUrl=e.audioWorkerPath,f.workerWasmFileUrl=e.audioWasm,J.e.getIsSupportWebtransport()&&ut("https://".concat(p,":").concat(ee.a.webtransportPort,"/wc/media/").concat(u,"?type=a&cid=").concat(l)),a.previewInit({audioDataChannel:{conId:l,userid:r}}),v=1500,a.bAudioDecodeUsingSAB&&(m=Wi.getStorageForCapacity(100,v),a.audioDecodeRingBuffer=new Wi(m,v)),n.next=23,J.g.isSDKSupportMultiThread();case 23:return S=n.sent,n.next=26,J.g.isSDKSupportSIMD();case 26:return n.sent?(f.workerJsFileUrl=e.audioSIMDWorkletPath,f.workerWasmFileUrl=e.audioSIMDWasm):(f.workerJsFileUrl=e.audioWorkerPath,f.workerWasmFileUrl=e.audioWasm),f.integrityHelper=new J.c(f.workerJsFileUrl,a.lateLoadedAssetsHash),a.audioCtx||(a.audioCtx=new(window.AudioContext||window.webkitAudioContext)),_={sampleRate:a.audioCtx.sampleRate,userid:r,log:o,meetingid:s,meetingnumb:u,videodecodethreadnumb:c,isSupportMultiThread:S,qoson:h},nt(t,_),n.next=34,Re(f,a);case 34:return n.next=36,ee.a.audioDecInitInstance.initSuccessPromise.then(function(){var e=d()(g.a.mark((function e(t){return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(re.add_monitor("ADIP"+!!t),!t||!m){e.next=6;break}return e.next=4,Dr(ie.f.AUDIO_DECODE,{buffer:m,bytesPerEle:v},"audioDecodeSAB",!1,!0);case 4:e.sent||(a.audioDecodeRingBuffer=null);case 6:return t&&null!==a.bAudioDatachannelOpen&&Dr(ie.f.AUDIO_DECODE,{isDataChannelOpen:a.bAudioDatachannelOpen},"UPDATE_DATACHANNEL_STATUS"),e.abrupt("return",t);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).then((function(e){return a.init_Notify_APPUI(e,ie.f.AUDIO_DECODE),e}));case 36:return n.abrupt("return",n.sent);case 37:case"end":return n.stop()}}),n)})))()},initSharingDecode:function(e,t,r){var i=arguments,a=this;return d()(g.a.mark((function n(){var o,s,u,d,c,h;return g.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(o=i.length>3&&void 0!==i[3]&&i[3],s=i.length>4?i[4]:void 0,u=i.length>5?i[5]:void 0,i.length>6?i[6]:void 0,re.add_monitor("INITSD"),a.recordSharingParamInfo(),Ra("initSharingDecode"),!a.isSupportVideoShare){n.next=11;break}return n.next=10,ee.a.sharingDecInitInstance.socketSuccessPromise.then((function(e){return a.init_Notify_APPUI(e,ie.f.SHARING_DECODE),e}));case 10:return n.abrupt("return",n.sent);case 11:return ee.a.monitorCid=new URL(t).searchParams.get("cid"),n.next=14,J.g.is32bitChrome();case 14:return a.is32bitbrowser=n.sent,n.next=17,J.g.isSDKSupportMultiThread();case 17:return d=n.sent,n.next=20,J.g.isSDKSupportSIMD();case 20:return c=n.sent,h={},c&&d?(h.workerJsFileUrl=e.sharingMSIMDWorkerPath,h.workerWasmFileUrl=e.videoMSIMDWasm):d?(h.workerJsFileUrl=e.sharingMtWorkerPath,h.workerWasmFileUrl=e.videoMtWasm):c?(h.workerJsFileUrl=e.sharingSIMDWorkerPath,h.workerWasmFileUrl=e.videoSIMDWasm):(h.workerJsFileUrl=e.sharingWorkerPath,h.workerWasmFileUrl=e.videoWasm),h.integrityHelper=new J.c(h.workerJsFileUrl,a.lateLoadedAssetsHash),at(t,{log:o,userid:r,meetingid:s,meetingnumb:u,isSupportMultiThread:d}),a.isSupportVideoShare||$.a.on("SHARING_DECODE_PTR",(function(e,t){a.sharingDecodeRingBuffer=new Wi(t.data.buffer,void 0,void 0,void 0,t.offset,t.length,t.data)})),n.next=30,Pe(h,a);case 30:return n.next=32,ee.a.sharingDecInitInstance.initSuccessPromise.then((function(e){return a.init_Notify_APPUI(e,ie.f.SHARING_DECODE),e}));case 32:return n.abrupt("return",n.sent);case 33:case"end":return n.stop()}}),n)})))()},initSharingEncode:function(e,t,r){var i=arguments,a=this;return d()(g.a.mark((function n(){var o,s,u,d,c,h;return g.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(o=i.length>3&&void 0!==i[3]&&i[3],s=i.length>4?i[4]:void 0,u=i.length>5?i[5]:void 0,i.length>6?i[6]:void 0,Ra("initSharingEncode"),!a.isSupportVideoShare){n.next=9;break}return n.next=8,ee.a.sharingEncInitInstance.socketSuccessPromise.then((function(e){return a.init_Notify_APPUI(e,ie.f.SHARING_ENCODE),e}));case 8:return n.abrupt("return",n.sent);case 9:return re.add_monitor("INITSE"),n.next=12,J.g.is32bitChrome();case 12:return a.is32bitbrowser=n.sent,n.next=15,J.g.isSDKSupportMultiThread();case 15:return d=n.sent,n.next=18,J.g.isSDKSupportSIMD();case 18:return c=n.sent,h={},c&&d?(h.workerJsFileUrl=e.sharingMSIMDWorkerPath,h.workerWasmFileUrl=e.videoMSIMDWasm):d?(h.workerJsFileUrl=e.sharingMtWorkerPath,h.workerWasmFileUrl=e.videoMtWasm):c?(h.workerJsFileUrl=e.sharingSIMDWorkerPath,h.workerWasmFileUrl=e.videoSIMDWasm):(h.workerJsFileUrl=e.sharingWorkerPath,h.workerWasmFileUrl=e.videoWasm),h.integrityHelper=new J.c(h.workerJsFileUrl,a.lateLoadedAssetsHash),ee.a.monitorCid=new URL(t).searchParams.get("cid"),at(t,{log:o,userid:r,meetingid:s,meetingnumb:u,isSupportMultiThread:d}),n.next=28,Oe(h,a);case 28:return n.next=30,ee.a.sharingEncInitInstance.initSuccessPromise.then((function(e){return a.init_Notify_APPUI(e,ie.f.SHARING_ENCODE),e}));case 30:return n.abrupt("return",n.sent);case 31:case"end":return n.stop()}}),n)})))()},JsMediaSDK_UnInit:function(){fr(),ht(),lt(),pt(),this.videoRenderArray.length&&this.videoRenderArray.forEach((function(e){e.display&&(e.display.cleanup(),e.display=null)})),ee.a._Notify_APPUI=null},StartAudioMediaCapture:function(){Ma.startCaptureAudio({audioConstraints:this.audioCapture?{audioSource:this.audioCapture?this.audioCapture.AudioSelectValue:null,isSupportBrowserAec:this.isSupportBrowserAec,disableAudioAGC:this.disableAudioAGC,disableNoiseSuppression:this.disableNoiseSuppression}:null,successHandler:this.handleAudioCapture.bind(this),errorHandler:this.handleAudioError.bind(this)})},StartDesktopMediaCapture:(Ga=d()(g.a.mark((function e(){var t,r,i,a,n,o,u,d,c,h,l,p,f,m;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.desktopSharingValue.sourceId){e.next=14;break}return t=this.desktopSharingValue.sourceId,e.prev=3,e.next=6,navigator.mediaDevices.getUserMedia({audio:!1,video:{mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:t}}});case 6:r=e.sent,this.handleDesktopCapture(r),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(3),this.handleCaptureError(e.t0);case 13:return e.abrupt("return");case 14:if(i=this.handleDesktopCapture.bind(this),a=this.handleCaptureError.bind(this),!this.desktopSharingValue.share2ndCamera){e.next=22;break}return n=this.desktopSharingValue.share2ndCameraParams||{},o=n.VideoSelectValue?{exact:n.VideoSelectValue}:void 0,u={deviceId:o,width:n.width||640,height:n.height||360},navigator.mediaDevices.getUserMedia({video:u,audio:!1}).then(i,a),e.abrupt("return");case 22:d=this.desktopSharingValue.videoParams,c=navigator.mediaDevices.getSupportedConstraints&&navigator.mediaDevices.getSupportedConstraints(),h=c&&!!c.displaySurface&&d&&d.displaySurface,navigator.mediaDevices.getDisplayMedia&&(l=!(!J.g.isSupportSharedArrayBuffer()||!this.desktopSharingValue.showShareAudioOption)&&{autoGainControl:!1,noiseSuppression:!1,echoCancellation:!J.g.isSupportSharingStereo()},p=this.desktopSharingValue.videoParams||!0,h&&("object"===s()(p)?p.displaySurface=d.displaySurface:"boolean"==typeof p&&(p={displaySurface:d.displaySurface})),f=this.desktopSharingValue.otherParams,m=Da({video:p,audio:l},f),navigator.mediaDevices.getDisplayMedia(m).then(i,a));case 26:case"end":return e.stop()}}),e,this,[[3,10]])}))),function(){return Ga.apply(this,arguments)}),StartVideoMediaCapture:(Ba=d()(g.a.mark((function e(){var t,r=this;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=this.videoCaptureValue,Ma.startCaptureVideo({videoConstraints:this.videoCaptureValue?{videoSource:this.videoCaptureValue.VideoSelectValue,usingFacingMode:this.videoCaptureValue.usingFacingMode,width:this.videoCaptureValue.width,height:this.videoCaptureValue.height,pan:this.videoCaptureValue.pan,tilt:this.videoCaptureValue.tilt,zoom:this.videoCaptureValue.zoom,fps:this.videoCaptureValue.fps}:null,timeout:this.videoCaptureValue?this.videoCaptureValue.timeout:null,successHandler:function(){var e=d()(g.a.mark((function e(i){var a,n,o,s;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r.videoCaptureValue=t,Ma.videoConstraints&&(a=Ma.videoConstraints,n=a.width,o=a.height,n&&o&&(r.videoCaptureWidth=n,r.videoCaptureHeight=o)),e.prev=2,e.next=5,r.handleVideoCapture(i);case 5:e.sent&&(re.add_monitor("VCMS"),ee.a.monitorVideoCapture=!0,(s=i.getVideoTracks()[0]).onended=function(){ee.a.Notify_APPUI_SAFE(P.ue),re.add_monitor("VTRS:"+s.readyState)},s.onmute=function(){ee.a.Notify_APPUI_SAFE(P.ue),re.add_monitor("VTMS:"+s.muted)}),e.next=13;break;case 9:e.prev=9,e.t0=e.catch(2),console.log(e.t0),r.handleVideoError(e.t0);case 13:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(t){return e.apply(this,arguments)}}(),errorHandler:function(e){console.log(e),r.handleVideoError(e)}});case 2:case"end":return e.stop()}}),e,this)}))),function(){return Ba.apply(this,arguments)}),Start_Audio_Play:function(){this.audioPlay=!0,ee.a.AudioNode&&ee.a.AudioNode.postCMD("startPlayAudio",null),ge(!0)},Stop_Audio_Play:function(){ge(!1),ee.a.AudioNode&&ee.a.AudioNode.postCMD("stopPlayAudio",null)},Remove_Audio_Play:function(){ge(!1),this.audioPlay=!1,ee.a.AudioNode&&ee.a.AudioNode.postCMD("stopPlayAudio",null)},Meeting_Fail_Over:function(e,t){Tt(e,t)},Start_Desktop_Audio_Capture:function(){var e=this.desktopSharingMediaStram.getAudioTracks();if(this.desktopSharingMediaStram&&e){var t=this.sharingAudioCtx.createMediaStreamSource(this.desktopSharingMediaStram);return this.sharingWebrtcAudioNode=t,void(this.isSharingCaptureNodeConnect||(this.sharingWebrtcAudioNode.connect(ee.a.SharingAudioNode),ee.a.SharingAudioNode.postCMD("StartCaptureAudio",null),this.isSharingCaptureNodeConnect=!0))}},Start_Audio_Capture:function(){if(Ma.shouldCaptureAudio())this.StartAudioMediaCapture();else{if(this.audioInputLevel)return this.audioInputLevel.setAudioStream(Ma.audioStream),this.captureAudioMuted||this.audioInputLevel.start(),void(ee.a.ComputerAudioStatus===ie.a.ComputerAudio_Connecting&&(ee.a.ComputerAudioStatus=ie.a.ComputerAudio_Connected,ee.a.Notify_APPUI(P.Tb,null)));if(this.audioBridge)return void this.audioBridge.publishStream(Ma.audioStream).then((function(e){ee.a.ComputerAudioStatus===ie.a.ComputerAudio_Connecting&&(ee.a.ComputerAudioStatus=ie.a.ComputerAudio_Connected,ee.a.Notify_APPUI(P.Tb,null))}));if(ee.a.AudioNode){this.webrtcAudioNode&&(this.webrtcAudioNode.disconnect(ee.a.AudioNode),this.webrtcAudioNode=null);var e=this.audioCtx.createMediaStreamSource(Ma.audioStream);this.webrtcAudioNode=e,this.webrtcAudioNode.connect(ee.a.AudioNode),ee.a.AudioNode.postCMD("StartCaptureAudio",null),this.isCaputureNodeConnect=!0}ee.a.ComputerAudioStatus===ie.a.ComputerAudio_Connecting&&(ee.a.ComputerAudioStatus=ie.a.ComputerAudio_Connected,ee.a.Notify_APPUI(P.Tb,null))}},Stop_Audio_Capture:function(){Ut(ee.a.SPECIAL_ID,P.x)},Start_Video_Capture:function(){if(!Ma.shouldCaptureVideo()){var e=this;return new Promise((function(t,r){var i=function t(){var r,i;e.isSupportVideoFrameOrBitmapCapture?(r=e.videoCaptureWidth,i=e.videoCaptureHeight):(e.isVideoCaptureLoadedmetadata=!0,r=e.videoCaptureValue.videoCtrl.videoWidth,i=e.videoCaptureValue.videoCtrl.videoHeight,e.videoCaptureWidth=r,e.videoCaptureHeight=i,e.captureVideoOutputCanvasDomList.forEach((function(e){e.width=r,e.height=i})),e.videoCaptureValue.videoCtrl.removeEventListener("loadedmetadata",t)),Qt({command:"startVideoEncode",width:e.videoCaptureWidth,height:e.videoCaptureHeight,fps:e.videoCaptureValue.fps,ssid:e.videoCaptureValue.ssid,mtu_size:e.mtu_size,isSupportImageCapture:e.isSupportImageCapture,isSupportVideoTrackReader:e.isSupportVideoTrackReader,isSupportMediaStreamTrackProcessor:e.isSupportMediaStreamTrackProcessor,isSupport2DCanvasDrawFrame:e.isSupport2DCanvasDrawFrame,disableOriginalRatio:!!e.videoCaptureValue.disableOriginalRatio}),Xt({command:"startVideoEncode",ssid:e.videoCaptureValue.ssid,disableOriginalRatio:!!e.videoCaptureValue.disableOriginalRatio}),e.isSupportVideoShare||Cr({command:"startVideoEncode"}),Qt({command:"updateVideoPara",width:e.videoCaptureWidth,height:e.videoCaptureHeight,fps:e.GetVideoCaptureFps()}),e.lastRealRect.left=0,e.lastRealRect.top=0,e.lastRealRect.width=e.videoCaptureWidth,e.lastRealRect.height=e.videoCaptureHeight,ee.a.monitorVideoUserID=e.videoCaptureValue.ssid,ee.a.Notify_APPUI(P.ib,{width:r,height:i})};if(e.isSupportVideoFrameOrBitmapCapture){i();try{e.videoCaptureValue.videoCtrl.srcObject=Ma.videoStream}catch(e){}if(J.g.isGoogleNestChrome()&&!J.g.isHighVersionGoolgeNestChrome()||J.g.isSelfPreviewRenderWithVideo()&&J.g.isSupportVideoFrameOrBitmapCapture()){var a=e.videoCaptureValue.videoCtrl.play();void 0!==a&&a.then((function(){})).catch((function(e){Z.a.error("Automatic playback failed",e)}))}t(!0);var n=Ma.getVideoCapabilities(),o=n.deviceId,s=n.pan,u=void 0===s?null:s,d=n.tilt,c=void 0===d?null:d,h=n.zoom,l=void 0===h?null:h;ee.a.Notify_APPUI(P.jd,{currentDeviceID:o,PTZRange:{pan:u,tilt:c,zoom:l}})}else{e.videoCaptureValue.videoCtrl.addEventListener("loadedmetadata",i),Ma.checkVideoStreamActive().then(t).catch(r),Ma.playVideoStream(e.videoCaptureValue.videoCtrl,{playsinline:!0});var p=Ma.getVideoCapabilities(),f=p.deviceId,m=p.pan,v=void 0===m?null:m,g=p.tilt,S=void 0===g?null:g,_=p.zoom,C=void 0===_?null:_;ee.a.Notify_APPUI(P.jd,{currentDeviceID:f,PTZRange:{pan:v,tilt:S,zoom:C}})}}))}this.StartVideoMediaCapture()},Stop_Video_Capture:function(){Qt({command:"stopVideoEncode"}),Xt({command:"stopVideoEncode"}),Cr({command:"stopVideoEncode"}),this.isStartVideoCapture=!1,this.isVideoCaptureLoadedmetadata=!1,this.videoCaptureValue&&this.videoCaptureValue.videoCtrl&&!this.isMaskSettingOn&&!this.isVBSettingOn&&(this.videoCaptureValue.videoCtrl.pause(),this.videoCaptureValue.videoCtrl.srcObject&&(this.videoCaptureValue.videoCtrl.srcObject=null),this.videoCaptureValue.videoCtrl.src&&(this.videoCaptureValue.videoCtrl.src=null)),Ma._clearCheckVideoStreamActiveTimer(),this.isMaskSettingOn||this.isVBSettingOn||this.isStartVideoCapture||(Ma.destoryVideoMediaStream(),this.videoCaptureValue=null),clearInterval(this.videoCaptureInterval),this.videoCaptureInterval=0},Remove_Video_Capture:function(){clearInterval(this.videoCaptureInterval),this.videoCaptureInterval=0,Ma.destoryVideoMediaStream(),this.videoCaptureValue=null,this.videoCaptureValue.videoCtrl&&this.videoCaptureValue.videoCtrl.pause()},Change_Video_Capture_Resolution:function(e,t){var r=this,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!J.g.isIpadOS()){var a=!1;(!(J.g.isIphoneOrIpadBrowser()||J.g.isIpadOS()||J.g.isAndroidBrowser())||(a=!0,i||(this.captureSize={width:e,height:t}),this.isLandScape||i))&&(this.videoCaptureHiddenCanvas&&J.g.isMac()&&J.g.browser.isFirefox||(Ma.changeVideoResolution(e,t,this.videoCaptureValue&&this.videoCaptureValue.fps?this.videoCaptureValue.fps:24).then((function(){a||(r.ReadyCapureWidth=e,r.ReadyCapureHeight=t,r.videoCaptureWidth=e,r.videoCaptureHeight=t,ee.a.Notify_APPUI(P.ib,{width:e,height:t}),Qt({command:"updateVideoPara",width:e,height:t,fps:r.videoCaptureValue&&r.videoCaptureValue.fps?r.videoCaptureValue.fps:24}))})),!Ma.videoStreamTrack||this.isSupportVideoTrackReader||this.isSupportMediaStreamTrackProcessor||this.Process_Video()))}},Start_Whiteboard_Sharing:(Fa=d()(g.a.mark((function e(){var t,r,i,a;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=this.desktopSharingValue.canvas,this.whiteboardCanvas=i,this.isdesktopCaptureLoadedmetadata=!0,t=i.width,r=i.height,this.desktopSharingCaptureWidth=t,this.desktopSharingCaptureHeight=r,this.desktopCaptureContext=i.getContext("2d"),ee.a.monitorSharingUserID=this.desktopSharingValue.ssid,Qt(a={command:"startSharingEncode",width:t,height:r,fps:8,ssid:this.desktopSharingValue.ssid,isSupportVideoTrackReader:!1,isSupportMediaStreamTrackProcessor:!1,isWhiteboardSharing:!0}),this.isSupportVideoShare||Cr(a);case 13:case"end":return e.stop()}}),e,this)}))),function(){return Fa.apply(this,arguments)}),Change_Sharing_Capture_Resolution:function(e){var t;this.shareTrack&&(console.log("change sharing capture resolution to",e),t=1==e?{video:!0,frameRate:5}:{width:1280,height:720,frameRate:24},this.shareTrack.applyConstraints(t))},Start_Desktop_Sharing:function(){if(this.desktopSharingMediaStram){var e=this;return new Promise((function(t,r){var i=function(){var t=d()(g.a.mark((function t(r){var a,n,o,s,u,d,c;return g.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.isSupportSharingTrackReader&&!e.isSupportMediaStreamTrackProcessor){t.next=10;break}o=e.desktopSharingMediaStram.getVideoTracks()[0],e.isSupportMediaStreamTrackProcessor?(e.sharingMediaStreamTrackProcessor=new MediaStreamTrackProcessor(o),e.sharingFrameStream=e.sharingMediaStreamTrackProcessor.readable,e.isSupportVideoShare?Jt("sharingframeStream",e.sharingFrameStream):Yt("frameStream",e.sharingFrameStream),re.add_monitor("SCTP")):e.isSupportSharingTrackReader&&(e.sharingTrackReader=new VideoTrackReader(o),re.add_monitor("SCTPR")),a=e.desktopSharingValue.video.videoWidth,n=e.desktopSharingValue.video.videoHeight,e.desktopSharingCaptureWidth=a,e.desktopSharingCaptureHeight=n,e.desktopSharingValue.video.removeEventListener("loadedmetadata",i),t.next=33;break;case 10:if(!e.isSharingSupportImageCapture){t.next=24;break}return o=e.desktopSharingMediaStram.getVideoTracks()[0],e.sharingImageCapture=new ImageCapture(o),re.add_monitor("SCIC"),t.next=16,e.sharingImageCapture.grabFrame();case 16:s=t.sent,e.desktopSharingCaptureWidth=s.width,e.desktopSharingCaptureHeight=s.height,a=s.width,n=s.height;try{e.replaceCanvasMap.sharingPreviewCanvasId=e.desktopSharingValue.rendercanvasID,e.sharingOffscreenCanvas=e.desktopSharingValue.canvas.transferControlToOffscreen(),u=ee.a.SPECIAL_ID,ee.a.localSharingEncMGR&&(d=ee.a.localSharingEncMGR.map.get(u))&&(c={command:"newSharingPara",rendercanvasID:e.replaceCanvasMap.sharingPreviewCanvasId,data:e.sharingOffscreenCanvas,width:a,height:n,flipSend:e.flipSend,is32bitbrowser:e.is32bitbrowser},d.postMessage(c,[c.data]))}catch(t){u=ee.a.SPECIAL_ID,ee.a.localSharingEncMGR&&(d=ee.a.localSharingEncMGR.map.get(u))&&(c={command:"newSharingPara",flipSend:e.flipSend,is32bitbrowser:e.is32bitbrowser},d.postMessage(c))}t.next=33;break;case 24:e.isdesktopCaptureLoadedmetadata=!0,a=e.desktopSharingValue.video.videoWidth,n=e.desktopSharingValue.video.videoHeight,e.desktopSharingValue.canvas.width=a,e.desktopSharingValue.canvas.height=n,e.desktopSharingCaptureWidth=a,e.desktopSharingCaptureHeight=n,e.desktopCaptureContext=e.desktopSharingValue.canvas.getContext("2d"),e.desktopSharingValue.video.removeEventListener("loadedmetadata",i);case 33:ee.a.monitorSharingUserID=e.desktopSharingValue.ssid,e.isSupportVideoShare?_r({command:"startSharingEncode",width:a,height:n,fps:8,ssid:e.desktopSharingValue.ssid,isSupportVideoTrackReader:e.isSupportSharingTrackReader,isSupportMediaStreamTrackProcessor:e.isSupportMediaStreamTrackProcessor}):Cr({command:"startSharingEncode",width:a,height:n,fps:8,ssid:e.desktopSharingValue.ssid,isSupportVideoTrackReader:e.isSupportSharingTrackReader,isSupportMediaStreamTrackProcessor:e.isSupportMediaStreamTrackProcessor}),ee.a.Notify_APPUI(P.mb,{width:a,height:n}),Qt({command:"startsharingencode"});case 37:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();if(e.isSupportSharingTrackReader||e.isSupportMediaStreamTrackProcessor)e.desktopSharingValue.video.addEventListener("loadedmetadata",i);else{if(e.isSharingSupportImageCapture)return i(),e.desktopSharingValue.video.srcObject=e.desktopSharingMediaStram,e.desktopSharingValue.video.muted=!0,void t(!0);e.desktopSharingValue.video.addEventListener("loadedmetadata",i),e.desktopSharingValue.video.setAttribute("playsinline",""),e.desktopSharingValue.video.muted=!0}try{e.desktopSharingValue.video.srcObject=e.desktopSharingMediaStram,e.desktopSharingValue.video.muted=!0}catch(t){e.desktopSharingValue.video.src=URL.createObjectURL(e.desktopSharingMediaStram)}e.desktopSharingValue.video.play(),t(!0)}))}this.StartDesktopMediaCapture()},SharingFrameOutputCallback:function(e){var t,r,i,a=this;if(null!=e.format&&null!=e.planes)if(t=e.planes[0].stride,r=e.planes[0].rows,t==a.desktopSharingCaptureWidth&&r==a.desktopSharingCaptureHeight||(ee.a.Notify_APPUI(P.mb,{width:t,height:r}),a.desktopSharingCaptureWidth=t,a.desktopSharingCaptureHeight=r),1e3==a.sMonitorCaptureFrameCount&&(re.add_monitor2("SCFOK"),a.sMonitorCaptureFrameCount=0),a.sMonitorCaptureFrameCount++,a.canISendNextSharingFrame){a.canISendNextSharingFrame=!1;var n=ee.a.SPECIAL_ID;if(ee.a.localSharingEncMGR){var o=ee.a.localSharingEncMGR.map.get(n);if(o){var s={command:"encodeSharingFrame",isSupportVideoTrackReader:a.isSupportSharingTrackReader,data:e};o.postMessage(s)}J.g.browserType.version>=90&&("close"in e?e.close():e.destroy())}}else"close"in e?e.close():e.destroy();else a.canISendNextSharingFrame?(a.canISendNextSharingFrame=!1,e.createImageBitmap().then((function(n){t=(i=n).width,r=i.height,"close"in e?e.close():e.destroy(),t==a.desktopSharingCaptureWidth&&r==a.desktopSharingCaptureHeight||(ee.a.Notify_APPUI(P.mb,{width:t,height:r}),a.desktopSharingCaptureWidth=t,a.desktopSharingCaptureHeight=r);var o=ee.a.SPECIAL_ID;if(ee.a.localSharingEncMGR){var s=ee.a.localSharingEncMGR.map.get(o);s&&s.postMessage({command:"encodeSharingFrame",isImageFromSharingFrame:!0,data:i},[i])}})).catch((function(e){Z.a.error("Converting sharing frame to image bitmap failed",e)}))):"close"in e?e.close():e.destroy()},Process_Sharing:(Ua=d()(g.a.mark((function e(){var t,r,i,a,n,o,s,u,d;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.desktopSharingValue&&this.desktopSharingSend){e.next=2;break}return e.abrupt("return");case 2:if(this.isStartWhiteboardSharing||!this.isSupportSharingTrackReader){e.next=14;break}return e.prev=4,e.next=7,this.sharingTrackReader.start(this.SharingFrameOutputCallback.bind(this));case 7:e.next=11;break;case 9:e.prev=9,e.t0=e.catch(4);case 11:return e.abrupt("return");case 14:if(this.isStartWhiteboardSharing||!this.isSharingSupportImageCapture){e.next=35;break}return e.prev=15,e.next=18,this.sharingImageCapture.grabFrame();case 18:a=e.sent,t=a.width,r=a.height,1e3==this.sMonitorCaptureFrameCount&&(re.add_monitor2("SCFOK"),this.sMonitorCaptureFrameCount=0),this.sMonitorCaptureFrameCount++,n=ee.a.SPECIAL_ID,ee.a.localSharingEncMGR&&(o=ee.a.localSharingEncMGR.map.get(n))&&(s={command:"encodeSharingFrame",data:a,isImage:!0},o.postMessage(s,[s.data])),e.next=33;break;case 27:e.prev=27,e.t1=e.catch(15),Z.a.error("An error occurred when trying to encode a sharing frame using the ImageCapture API",e.t1),re.add_monitor3("SICF"),n=ee.a.SPECIAL_ID,ee.a.localSharingEncMGR&&(o=ee.a.localSharingEncMGR.map.get(n))&&(s={command:"encodeSharingFrame"},o.postMessage(s));case 33:e.next=36;break;case 35:this.isStartWhiteboardSharing?(i=this.whiteboardCanvas,t=i.width,r=i.height):(i=this.desktopSharingValue.video,t=i.videoWidth,r=i.videoHeight);case 36:t==this.desktopSharingCaptureWidth&&r==this.desktopSharingCaptureHeight||(ee.a.Notify_APPUI(P.mb,{width:t,height:r}),this.desktopSharingCaptureWidth=t,this.desktopSharingCaptureHeight=r);try{this.isdesktopCaptureLoadedmetadata&&i&&(this.isStartDesktopSharing||(this.desktopSharingValue.canvas.width=t,this.desktopSharingValue.canvas.height=r),u=this.desktopCaptureContext,!this.is32bitbrowser||this.flipSend?(this.isStartWhiteboardSharing||u.drawImage(i,0,0,t,r,0,0,t,r),d=u.getImageData(0,0,t,r),1e3==this.sMonitorCaptureFrameCount&&(re.add_monitor2("SCFOK"),this.sMonitorCaptureFrameCount=0),this.sMonitorCaptureFrameCount++,mt(ee.a.SPECIAL_ID,d.data,d.data.length,0,t,r),this.flipSend=!1):(this.flipSend=!0,mt(ee.a.SPECIAL_ID,null,0,0,0,0)))}catch(e){Z.a.error("An error occurred when trying to encode a sharing frame",e),re.add_monitor3("GIDF"),setTimeout((function(){mt(ee.a.SPECIAL_ID,null,0,0,0,0)}),1e3)}case 38:case"end":return e.stop()}}),e,this,[[4,9],[15,27]])}))),function(){return Ua.apply(this,arguments)}),VideoFrameOutputCallback:function(e){var t,r,i,a,n=this;if(null!=e.format&&null!=e.planes){i=n.videoCaptureWidth,a=n.videoCaptureHeight,t=e.cropWidth,r=e.cropHeight,t===i&&r===a||(Ra("video width/height changed old => begin",i,a,t,r),ee.a.Notify_APPUI(P.ib,{width:t,height:r}),Qt({command:"updateVideoPara",width:t,height:r,fps:n.GetVideoCaptureFps()}),n.videoCaptureWidth=t,n.videoCaptureHeight=r),3e3==n.vMonitorCaptureFrameCount&&(re.add_monitor2("VCFOK"),n.vMonitorCaptureFrameCount=0),n.vMonitorCaptureFrameCount++;var o=ee.a.SPECIAL_ID;if(ee.a.localVideoEncMGR){var s=ee.a.localVideoEncMGR.map.get(o);s&&e&&s.postMessage({command:"yuvVideoFrame",data:e}),J.g.browserType.version>=90&&("close"in e?e.close():e.destroy())}}else{var u;e.createImageBitmap().then((function(o){u=o,"close"in e?e.close():e.destroy(),i=n.videoCaptureWidth,a=n.videoCaptureHeight,t=u.width,r=u.height,t===i&&r===a||(Ra("video width/height changed old => begin",i,a,t,r),ee.a.Notify_APPUI(P.ib,{width:t,height:r}),Qt({command:"updateVideoPara",width:t,height:r,fps:n.GetVideoCaptureFps()}),n.videoCaptureWidth=t,n.videoCaptureHeight=r);var s=ee.a.SPECIAL_ID;if(ee.a.localVideoEncMGR){var d=ee.a.localVideoEncMGR.map.get(s);d&&d.postMessage({command:"ImageBitmapFromVideoFrame",data:u},[u])}})).catch((function(e){Z.a.error("Converting video frame to image bitmap failed",e)}))}},Update_Mask_Texture:function(e,t,r){if(this.bgCanvas&&this.bgCanvasctx||(this.bgCanvas=document.createElement("canvas"),this.bgCanvasctx=this.bgCanvas.getContext("2d")),this.bgCanvas.width=t,this.bgCanvas.height=r,this.bgCanvasctx.clearRect(0,0,t,r),this.MaskImage&&this.BgImage&&"blur"!==this.BgImage){if(e.dWidth>0&&e.dHeight>0&&this.VideoMaskSettingCanvas.width>0&&this.VideoMaskSettingCanvas.height>0&&t>0&&r>0){var i=e.dx/(this.VideoMaskSettingCanvas.width/t),a=e.dy/(this.VideoMaskSettingCanvas.height/r),n=e.dWidth/(this.VideoMaskSettingCanvas.width/t),o=e.dHeight/(this.VideoMaskSettingCanvas.height/r);this.bgCanvasctx.drawImage(this.MaskImage,i,a,n,o)}var s,u,d,c;this.bgCanvasctx.globalCompositeOperation="source-out",this.Crop_Mask_Bg_16V9(),s=this.bgImageCroppingParams.sx,u=this.bgImageCroppingParams.sy,d=this.bgImageCroppingParams.sw,c=this.bgImageCroppingParams.sh,this.bgCanvasctx.drawImage(this.BgImage,s,u,d,c,0,0,t,r)}},Crop_Mask_Bg_16V9:function(){var e,t,r,i=0,a=this.BgImage.naturalWidth,n=this.BgImage.naturalHeight;16/9*n>=a?(r=a,e=0,t=(n-(i=a/(16/9)))/2):(i=n,e=(a-(r=n*(16/9)))/2,t=0),this.bgImageCroppingParams.sx=e,this.bgImageCroppingParams.sy=t,this.bgImageCroppingParams.sw=r,this.bgImageCroppingParams.sh=i},Draw_Mask_Frame:function(){if(this.VideoMaskSettingCanvas){this.VideoMaskSettingCanvasctx||(this.VideoMaskSettingCanvasctx=this.VideoMaskSettingCanvas.getContext("2d"));var e,t,r=this.VideoMaskCanvasFillMode?Ei(this.videoCaptureHiddenCanvas.width,this.videoCaptureHiddenCanvas.height,void 0,void 0,this.VideoMaskSettingCanvas.width/this.VideoMaskSettingCanvas.height):this.videoCaptureValue&&this.videoCaptureValue.disableOriginalRatio?Ei(this.videoCaptureHiddenCanvas.width,this.videoCaptureHiddenCanvas.height):null;if(this.isMirrorMyVideo)this.isCanvasScaled||(this.VideoMaskSettingCanvasctx.scale(-1,1),this.isCanvasScaled=!0),this.VideoMaskSettingCanvasctx.clearRect(0-this.VideoMaskSettingCanvas.width,0,this.VideoMaskSettingCanvas.width,this.VideoMaskSettingCanvas.height),(e=this.VideoMaskSettingCanvasctx).drawImage.apply(e,[this.videoCaptureHiddenCanvas].concat(n()(r?[r.left,r.top,r.width,r.height]:[]),[0-this.VideoMaskSettingCanvas.width,0,this.VideoMaskSettingCanvas.width,this.VideoMaskSettingCanvas.height]));else this.isCanvasScaled&&(this.VideoMaskSettingCanvasctx.setTransform(1,0,0,1,0,0),this.isCanvasScaled=!1),this.VideoMaskSettingCanvasctx.clearRect(0,0,this.VideoMaskSettingCanvas.width,this.VideoMaskSettingCanvas.height),(t=this.VideoMaskSettingCanvasctx).drawImage.apply(t,[this.videoCaptureHiddenCanvas].concat(n()(r?[r.left,r.top,r.width,r.height]:[]),[0,0,this.VideoMaskSettingCanvas.width,this.VideoMaskSettingCanvas.height]))}},GetVideoCaptureFps:function(){return this.videoCaptureValue&&this.videoCaptureValue.fps?this.videoCaptureValue.fps:24},Process_Video:(Wa=d()(g.a.mark((function e(){var t,r,i,a,n,o,s,u,d,c,h,l,p,f,m,v,S,_,C;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isSupportMediaStreamTrackProcessor){e.next=2;break}return e.abrupt("return");case 2:if(!this.isSupportVideoTrackReader){e.next=11;break}return e.prev=3,e.next=6,Ma.videoTrackReader.start(this.VideoFrameOutputCallback.bind(this));case 6:e.next=10;break;case 8:e.prev=8,e.t0=e.catch(3);case 10:return e.abrupt("return");case 11:if(!this.isSupportImageCapture){e.next=17;break}if(!Ma.isImageCaptureLocked()){e.next=16;break}return e.abrupt("return");case 16:Ma.lockImageCapture();case 17:if(this.videoCaptureValue&&this.isStartVideoCapture||this.isMaskSettingOn||this.isVBSettingOn){e.next=20;break}return Ma.unLockImageCapture(),e.abrupt("return");case 20:if(t=this,a=this.videoCaptureWidth,n=this.videoCaptureHeight,!this.isSupportImageCapture){e.next=41;break}return e.prev=24,e.next=27,Ma.videoImageCapture.grabFrame();case 27:s=e.sent,r=s.width,i=s.height,r&&i&&(r!==a||i!==n)&&(Ra("video width/height changed old => begin",a,n,r,i),ee.a.Notify_APPUI(P.ib,{width:r,height:i}),Qt({command:"updateVideoPara",width:r,height:i,fps:this.GetVideoCaptureFps()}),3e3==this.vMonitorCaptureFrameCount&&(re.add_monitor2("VCFOK"),this.vMonitorCaptureFrameCount=0),this.vMonitorCaptureFrameCount++,this.videoCaptureWidth=r,this.videoCaptureHeight=i),Vr(s),e.next=39;break;case 34:e.prev=34,e.t1=e.catch(24),Z.a.error("An error occurred when trying to encode a video frame using the ImageCapture API",e.t1),re.add_monitor3("VICF"),Vr(null);case 39:return Ma.unLockImageCapture(),e.abrupt("return");case 41:if(u=Ma.isUsingFileInputVideoSource(),this.isStartVideoCapture?o=this.videoCaptureValue.videoCtrl:(this.isMaskSettingOn||this.isVBSettingOn)&&(o=this.MaskSettingVideo),!((this.isVideoCaptureLoadedmetadata||this.isMaskSettingOn||this.isVBSettingOn)&&o&&o.readyState>=2)){e.next=59;break}if((o.paused||o.ended)&&o.play(),!this.isSelfViewWithVideo||this.platformType!=L||!o.srcObject){e.next=51;break}return d=new VideoFrame(o,{timestamp:0}),c=ee.a.SPECIAL_ID,(h=ee.a.localVideoEncMGR.map.get(c))?h.postMessage({command:"yuvVideoFrame",data:d,rotation:Ta},[d]):d.close(),e.abrupt("return");case 51:r=o.videoWidth?o.videoWidth:640,i=o.videoHeight?o.videoHeight:360,r&&i&&(r!==a||i!==n)&&(Ra("video width/height changed old => begin",a,n,r,i),ee.a.Notify_APPUI(P.ib,{width:r,height:i}),this.videoCaptureWidth=r,this.videoCaptureHeight=i,Qt({command:"updateVideoPara",width:r,height:i,fps:t.GetVideoCaptureFps()})),(!(!t.isMaskSettingOn||t.videoCaptureValue&&t.videoCaptureValue.disableOriginalRatio)||t.MaskImage&&t.BgImage)&&t.isCurrentInMaskStatus?(v=r/i*t.ReadyCapureHeight,S=i/r*t.ReadyCapureWidth,v>t.ReadyCapureWidth?(l=0,p=(t.ReadyCapureHeight-S)/2):(l=(t.ReadyCapureWidth-v)/2,p=0),f=t.ReadyCapureWidth-2*l,m=t.ReadyCapureHeight-2*p,t.videoCaptureHiddenCanvas.width=t.ReadyCapureWidth,t.videoCaptureHiddenCanvas.height=t.ReadyCapureHeight):(f=r,m=i,l=0,p=0,t.videoCaptureHiddenCanvas.width=r,t.videoCaptureHiddenCanvas.height=i),u?J.g.videoToMediaStreamManager.drawCanvas(t.videoCaptureHiddenCanvas,t.videoCaptureHiddenCanvasCtx,t.videoCaptureHiddenCanvas.width,t.videoCaptureHiddenCanvas.height):t.videoCaptureHiddenCanvasCtx.drawImage(o,0,0,r,i,l,p,f,m),t.isCurrentInMaskStatus&&(t.bgCanvas?t.videoCaptureHiddenCanvasCtx.drawImage(t.bgCanvas,0,0,t.videoCaptureHiddenCanvas.width,t.videoCaptureHiddenCanvas.height):t.Update_Mask_Texture(this.maskCoordinate,t.videoCaptureHiddenCanvas.width,t.videoCaptureHiddenCanvas.height),t.VideoMaskSettingCanvas&&t.Draw_Mask_Frame()),(t.isStartVideoCapture||t.isVBSettingOn)&&(_=t.videoCaptureHiddenCanvasCtx.getImageData(0,0,t.videoCaptureHiddenCanvas.width,t.videoCaptureHiddenCanvas.height),C=_.data,t.lastRealRect.width==t.videoCaptureHiddenCanvas.width&&t.lastRealRect.height==t.videoCaptureHiddenCanvas.height||(t.lastRealRect.left=0,t.lastRealRect.top=0,t.lastRealRect.width=t.videoCaptureHiddenCanvas.width,t.lastRealRect.height=t.videoCaptureHiddenCanvas.height,Qt({command:"updateVideoPara",width:t.lastRealRect.width,height:t.lastRealRect.height,fps:t.GetVideoCaptureFps()})),t.videoCaptureValue&&t.VideoRenderObj&&!t.isMultiView&&(_.data instanceof Uint8ClampedArray&&(C=new Uint8Array(_.data.buffer)),t.videoCaptureValue&&void 0!==t.videoCaptureValue.disableOriginalRatio&&t.VideoRenderObj.Set_Cropping_Mode(!!t.videoCaptureValue.disableOriginalRatio),t.VideoRenderObj.Draw_Send_Video_Img(C,t.videoCaptureHiddenCanvas.width,t.videoCaptureHiddenCanvas.height,t.videoCaptureValue.ssid,T,t.lastRealRect)),3e3==t.vMonitorCaptureFrameCount&&(re.add_monitor2("VCFOK"),t.vMonitorCaptureFrameCount=0),t.vMonitorCaptureFrameCount++,ft(ee.a.SPECIAL_ID,C,t.videoCaptureHiddenCanvas.width,t.lastRealRect.left,t.lastRealRect.top)),t.videoCaptureHiddenCanvasCtx.clearRect(0,0,t.videoCaptureHiddenCanvas.width,t.videoCaptureHiddenCanvas.height);case 59:case"end":return e.stop()}}),e,this,[[3,8],[24,34]])}))),function(){return Wa.apply(this,arguments)}),Remove_Sharing_Audio_Capture:function(){if(tr({command:"changeAudioShare",isStart:!1}),ee.a.ComputerAudioStatus==ie.a.ComputerAudio_Null&&Xe.clear(),this.sharingWebrtcAudioNode&&ee.a.SharingAudioNode){try{this.sharingWebrtcAudioNode.disconnect(ee.a.SharingAudioNode)}catch(e){this.JsMediaSDK_Log(e)}this.sharingWebrtcAudioNode=null}},Remove_Audio_Capture:function(e){if(Ut(ee.a.SPECIAL_ID,P.u,e),ee.a.DesktopAudioStatus==ie.a.DesktopAudio_Null&&Xe.clear(),this.firstSetDelay=!0,this.webrtcAudioNode&&ee.a.AudioNode){try{this.webrtcAudioNode.disconnect(ee.a.AudioNode)}catch(e){this.JsMediaSDK_Log(e)}this.webrtcAudioNode=null}},Start_Video_Play:function(){this.videoRenderIntervalHandle||(this.videoRenderIntervalHandle=this.JsMediaSDK_VideoRenderInterval(this.videorenderinterval))},Stop_Video_Play:function(){(this.UpdateVideoPlayStatus(!1),this.VideoRenderObj&&(this.VideoRenderObj.ClearQueue(),this.VideoRenderObj.Set_WaterMark_Info({waterMarkCanvas:this.waterMarkCanvas,isCreateVideoWaterMark:this.isCreateVideoWaterMark,videoWaterMarkName:this.videoWaterMarkName})),this.videoRenderIntervalHandle)&&(this.VideoRenderObj.Stop_Draw.bind(this.VideoRenderObj)(),this.videoRenderIntervalHandle=null)},Remove_Video_Play:function(){this.UpdateVideoPlayStatus(!1),this.videoRenderIntervalHandle&&(clearInterval(this.videoRenderIntervalHandle),this.videoRenderIntervalHandle=null),Xt({command:"removeVideoPlay"})},UpdateVideoPlayStatus:function(e){Se(e)},EndMedia:function(){try{ee.a.rwgAgent&&ee.a.rwgAgent.off("message",this.rwgAgentMessageListenerWrapper)}catch(e){Ra.error("rwgAgent.off error",e)}try{this.rtcPeerConnectionList.forEach((function(e){e&&(e.forceClose(),e=null)})),this.rtcPeerConnectionList=[]}catch(e){Ra.error("clear rtcPeerConnectionList err",e)}try{Ma.destoryAudioMediaStream(),this.Remove_Audio_Play(),this.Remove_Audio_Capture(),this.Remove_Sharing_Audio_Capture(),this.Remove_Video_Play(),this.audioCtx&&(this.audioCtx.close(),this.audioCtx=null),this.sharingAudioCtx&&(this.sharingAudioCtx.close(),this.sharingAudioCtx=null),this.audioDomNode&&(this.audioDomNode=null),Ma.destoryVideoMediaStream(),this.EndSharingMediaStream(),this.CloseBoringPeerConnection()}catch(e){Ra("endMedia",e)}try{br()}catch(e){Ra("endMedia",e)}try{this.remoteControl&&this.remoteControl.destroy()}catch(e){Ra("endMedia",e)}},EndDesktopAudioMediaStream:function(){if(this.desktopSharingMediaStram){var e=this.desktopSharingMediaStram.getAudioTracks();e.length&&e.forEach((function(e){e.stop()}))}},EndSharingMediaStream:function(){this.desktopSharingMediaStram&&(this.desktopSharingMediaStram.getTracks().forEach((function(e){e.stop()})),this.desktopSharingMediaStram=null,window.WebQrscanner&&WebQrscanner.qrScanner.stop())},StopSharingCapture:function(){this.EndSharingMediaStream(),this.desktopSharingSend=!1,this.isStartDesktopSharing&&Qt({command:"stopsharingencode"}),this.isStartDesktopSharing=!1,this.desktopSharingMediaStram=null,window.WebQrscanner&&WebQrscanner.qrScanner.stop(),this.desktopSharingValue=null},CloseBoringPeerConnection:function(){try{this.rtcConnectionB&&(this.rtcConnectionB.close(),this.rtcConnectionB=null),this.rtcConnectionA&&(this.rtcConnectionA.close(),this.rtcConnectionA=null)}catch(e){Ra(e)}},UnMuteAudio:function(){Ut(ee.a.SPECIAL_ID,P.w),this.enableHID&&this.hidAvalible&&aa.sendReport("mute",!1)},MuteAudio:function(){this.Stop_Audio_Capture(),this.enableHID&&this.hidAvalible&&aa.sendReport("mute",!0)},selectComputerAudioSpeaker:function(e,t){var r="default"==e?"":e,i=null;J.g.isSupportChromeWideAEC()&&!this.audioDomNode?this.audioCtx&&(i=this.audioCtx):this.audioDomNode&&(i=this.audioDomNode),i&&i.setSinkId(r).then((function(){wa.sendSpeakerDevice(Date.now()-t,!0)})).catch((function(e){Z.a.error("An error occurred when trying to set the audio output device",e),re.add_monitor("AODF"),wa.sendSpeakerDevice(Date.now()-t,!1),ee.a.Notify_APPUI(P.v,null)}))},handleDesktopCapture:function(e){this.desktopSharingMediaStram=e;var t=this;this.desktopSharingMediaStram.getVideoTracks()[0].onended=function(){re.add_monitor("SSBB"),ee.a.Notify_APPUI(P.be,null),t.StopSharingCapture()},this.desktopSharingMediaStram.getAudioTracks().length?("Tab audio"!=this.desktopSharingMediaStram.getAudioTracks()[0].label&&(ee.a.shareSystemAudio=!0),ee.a.Notify_APPUI(P.Rc,null)):ee.a.Notify_APPUI(P.Sc,null),this.shareTrack=this.desktopSharingMediaStram.getVideoTracks()[0],this.Start_Desktop_Sharing(),ee.a.Notify_APPUI(P.ub,null)},handleCaptureError:function(e){this.handleGetDisplayMediaError("An error occurred when trying to capture sharing",e),this.StopSharingCapture(),re.add_monitor("SCCF"),"Permission denied by system"===e.message?ee.a.Notify_APPUI(P.wb,null):ee.a.Notify_APPUI(P.vb,null)},handleAudioCapture:function(){return this.audioBridge&&!this.audioInputLevel?(this.audioBridge.publishStream(Ma.audioStream).then((function(e){ee.a.ComputerAudioStatus===ie.a.ComputerAudio_Connecting&&(ee.a.ComputerAudioStatus=ie.a.ComputerAudio_Connected,ee.a.Notify_APPUI(P.Tb,null))})),void ee.a.Notify_APPUI(P.Xd,null)):this.audioCtx||this.audioInputLevel?(ee.a.Notify_APPUI(P.Xd,null),void this.Start_Audio_Capture()):(ee.a.ComputerAudioStatus=ie.a.ComputerAudio_Null,ee.a.Notify_APPUI(P.Tb,null),void Ma.destoryAudioMediaStream())},handleVideoCapture:function(e){var t=this;return new Promise(function(){var r=d()(g.a.mark((function r(i,a){var n,o;return g.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(e){r.next=2;break}return r.abrupt("return",a(new Error("no stream")));case 2:if(t.videoCaptureWidth?t.videoCaptureWidth=t.videoCaptureWidth:t.videoCaptureWidth=640,t.videoCaptureHeight?t.videoCaptureHeight=t.videoCaptureHeight:t.videoCaptureHeight=360,!t.isStartVideoCapture){r.next=19;break}return r.prev=5,r.next=8,t.Start_Video_Capture();case 8:n=r.sent,i(n),r.next=16;break;case 12:r.prev=12,r.t0=r.catch(5),Ra("Start_Video_Capture",r.t0),a(new Error("media stream is ok, but start video capture fail"));case 16:t.isMaskSettingOn&&t.MaskSettingVideo&&Ma.playVideoStream(t.MaskSettingVideo),r.next=34;break;case 19:if(!t.isMaskSettingOn&&!t.isVBSettingOn){r.next=33;break}return r.prev=20,r.next=23,t.startMaskOrVBSettingVideoCapture(e);case 23:o=r.sent,i(o),r.next=31;break;case 27:r.prev=27,r.t1=r.catch(20),Ra("startMaskOrVBSettingVideoCapture",r.t1),a(new Error("media stream is ok, but start setting video capture fail"));case 31:r.next=34;break;case 33:Ma.destoryVideoMediaStream();case 34:case"end":return r.stop()}}),r,null,[[5,12],[20,27]])})));return function(e,t){return r.apply(this,arguments)}}())},startMaskOrVBSettingVideoCapture:function(e){var t=this;return new Promise((function(e,r){try{if(t.isVBSettingOn)if(t.MaskSettingVideo){var i=Ma.playVideoStream(t.MaskSettingVideo,{playsinline:J.g.browser.isSafari});i&&i.then((function(){ee.a.Notify_APPUI(P.ld,null)})).catch((function(e){r(new Error("media stream is ok, but video.play() fail")),re.add_monitor("VBVPF")}))}else ee.a.Notify_APPUI(P.ld,null);else if(t.isMaskSettingOn)if(t.MaskSettingVideo){var a=Ma.playVideoStream(t.MaskSettingVideo,{playsinline:J.g.browser.isSafari});a&&a.then((function(){ee.a.Notify_APPUI(P.kd,null)})).catch((function(e){r(new Error("media stream is ok, but video.play() fail")),Z.a.error("An error occurred when trying to play video in Background Setting tab",e),re.add_monitor("MVPF")}))}else ee.a.Notify_APPUI(P.kd,null);if(t.isSupportVideoShare){var n=new MessageChannel;Gt(n,n)}Qt({command:"startvideointerval",width:t.videoCaptureValue.width,height:t.videoCaptureValue.height,ssid:t.videoCaptureValue.ssid,mtu_size:t.mtu_size,fps:t.videoCaptureValue.fps,isSupportImageCapture:t.isSupportImageCapture,isSupportVideoTrackReader:t.isSupportVideoTrackReader,isSupportMediaStreamTrackProcessor:t.isSupportMediaStreamTrackProcessor,isSupport2DCanvasDrawFrame:t.isSupport2DCanvasDrawFrame,isVBSettingOn:t.isVBSettingOn,isMaskSettingOn:t.isMaskSettingOn}),e(!0)}catch(e){Z.a.error("Starting mask or virtual background failed",e),r(e)}}))},handleGetDisplayMediaError:function(e,t){var r={AbortError:"error",InvalidStateError:"error",NotAllowedError:"warn",NotFoundError:"warn",NotReadableError:"warn",OverconstrainedError:"warn",TypeError:"error"}[t.name]||"error";Z.a[r](e,t)},handleGetUserMediaError:function(e,t){var r={NotAllowedError:"warn",NotFoundError:"warn",NotReadableError:"warn",OverconstrainedError:"warn",SecurityError:"warn",SourceUnavailableError:"warn",PermissionDeniedError:"warn",AbortError:"error",TypeError:"error"}[t.name]||"error";Z.a[r](e,t)},handleAudioError:function(e){this.handleGetUserMediaError("Error occurred when trying to capture audio",e),re.add_monitor("HADF"),ee.a.Notify_APPUI(P.Vd,e),ee.a.ComputerAudioStatus===ie.a.ComputerAudio_Connecting&&(ee.a.ComputerAudioStatus=ie.a.ComputerAudio_Null,ee.a.Notify_APPUI(P.Tb,null))},handleVideoError:function(e){ee.a.monitorVideoCapture=!1,Ra("handleVideoError",e);e instanceof Kr||e.name&&-1!==["NotReadableError","SourceUnavailableError"].indexOf(e.name)?(re.add_monitor("COCPEF"),ee.a.Notify_APPUI(P.Ud,e)):(re.add_monitor("HVDF"),ee.a.Notify_APPUI(P.Wd,e)),this.handleGetUserMediaError("Error occurred when trying to capture video",e),this.Stop_Video_Capture()},chromeAecWorkAround:(La=d()(g.a.mark((function e(t){var r,i,a,n,o,s,u,d,c,h;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(re.add_monitor("ASCAEC"),!this.rtcConnectionA&&!this.rtcConnectionB){e.next=3;break}return e.abrupt("return",!1);case 3:return r=null,i=null,a=new MediaStream,n={offerVideo:!0,offerAudio:!0,offerToReceiveAudio:!1,offerToReceiveVideo:!1},r=new RTCPeerConnection,i=new RTCPeerConnection,r.onicecandidate=function(e){return e.candidate&&i.addIceCandidate(new RTCIceCandidate(e.candidate))},i.onicecandidate=function(e){return e.candidate&&r.addIceCandidate(new RTCIceCandidate(e.candidate))},i.ontrack=function(e){e.streams[0].getTracks().forEach((function(e){a.addTrack(e)}))},r.addStream(t),e.next=15,r.createOffer(n);case 15:return o=e.sent,u=!1,d=null,c=null,h=J.g.getBrowserVersion(),e.prev=20,c=o.sdp,d=h>=104?(d=o.sdp.replace("SAVPF 111","SAVPF 100 111")).replace("a=rtpmap:111 opus/48000/2","a=rtpmap:100 L16/48000\na=rtpmap:111 opus/48000/2"):(d=o.sdp.replace("SAVPF 111","SAVPF 10 111")).replace("a=rtpmap:111 opus/48000/2","a=rtpmap:10 L16/48000\na=rtpmap:111 opus/48000/2"),o.sdp=d,e.next=26,r.setLocalDescription(o);case 26:return e.next=28,i.setRemoteDescription(o);case 28:e.next=38;break;case 30:return e.prev=30,e.t0=e.catch(20),u=!0,o.sdp=c,e.next=36,r.setLocalDescription(o);case 36:return e.next=38,i.setRemoteDescription(o);case 38:return e.next=40,i.createAnswer();case 40:return s=e.sent,u||(h>=104?(s.sdp=s.sdp.replace("SAVPF 111","SAVPF 100 111"),s.sdp=s.sdp.replace("a=rtpmap:111 opus/48000/2","a=rtpmap:100 L16/48000\na=rtpmap:111 opus/48000/2")):(s.sdp=s.sdp.replace("SAVPF 111","SAVPF 10 111"),s.sdp=s.sdp.replace("a=rtpmap:111 opus/48000/2","a=rtpmap:10 L16/48000\na=rtpmap:111 opus/48000/2"))),e.next=44,i.setLocalDescription(s);case 44:return e.next=46,r.setRemoteDescription(s);case 46:return this.rtcConnectionA=r,this.rtcConnectionB=i,e.abrupt("return",a);case 49:case"end":return e.stop()}}),e,this,[[20,30]])}))),function(e){return La.apply(this,arguments)}),switchCanvasForVideoCapture:function(e){var t=[].concat(e),r=t[0];if(this.captureVideoOutputCanvasDomList=t,this.videoCaptureValue.canvasCtrl=r,!this.isSupportVideoFrameOrBitmapCapture){var i=this.videoCaptureValue.videoCtrl.videoWidth,a=this.videoCaptureValue.videoCtrl.videoHeight;t.forEach((function(e){e.width=i,e.height=a})),this.videoCaptureValue.canvasCtrl.width=i,this.videoCaptureValue.canvasCtrl.height=a,this.videoCaptureContext=r.getContext("2d")}},videoDecodeFrameBackSABRingBufferConsumeCallback:function(e){var t=new Fi;t.setBuffer(e);var r=t.buffer2Obj();gt(r.video_ssrc,r.data,r.video_timestamp,r.video_width,r.video_height,r.rendering_x,r.rendering_y,r.rendering_w,r.rendering_h,r.rotation,r.yuv_limited),this.VideoRenderObj.JsMediaSDK_VideoRender.bind(this.VideoRenderObj)()},consumeVideoEncodeRingbuffer:function(e){this.videoDataChannel&&this.videoDataChannel.sendVideoData(e)},audioEncodeRingBufferConsumerCallback:function(e){this.audioDataChannel&&this.audioDataChannel.sendAudioData(e)},CheckCurrentActiveSSRC:function(e){this.currentactive!=e&&(this.currentactive=e,ee.a.CurrentSSRC=this.currentactive,ee.a.decoderinworklet?ee.a.AudioNode&&ee.a.AudioNode.postCMD("currentSSRC",ee.a.CurrentSSRC):er(ee.a.CurrentSSRC))},createVideoElement:function(){this.MaskSettingVideo||(this.videoCaptureValue&&this.videoCaptureValue.videoCtrl?this.MaskSettingVideo=this.videoCaptureValue.videoCtrl:(this.MaskSettingVideo=document.createElement("video"),J.g.browser.isSafari&&(this.MaskSettingVideo.setAttribute("style","position:fixed;top:-10000px;left:-10000px;"),document.body.appendChild(this.MaskSettingVideo))))},Notify_MeidaSDK:(Na=d()(g.a.mark((function e(t,r){var a,n,o,s,u,d,c,h,l,p,f,m,v,S,_,C,y,b,A,k,E,w,I,D,M,R,x,T,O,V,N,L,W,U,F,B,G,H,j,K,q,Q,z,X,Y,te,ae,ne,oe,se,ue,de,ce,he,le,pe,fe,me,ge,_e,ye,be,Ae,ke,Ee,we,Ie,De,Me,Re,xe,Pe,Te,Oe,Ve,Ne,Le,We,Ue,Fe,Be,Ge,He,je,Ke,qe,Qe,ze,Xe,Je,Ye,Ze,$e,et,tt,rt,it,at,nt,ot,st,ut,dt,ct=this;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Ra(t,r),a=0,re.add_monitor2("B"+t),e.t0=t,e.next=e.t0===P.md?6:e.t0===P.Td?48:e.t0===P.wd?65:e.t0===P.pe?71:e.t0===P.Od?129:e.t0===P.Md?132:e.t0===P.Pd?157:e.t0===P.Fb?192:e.t0===P.dc?201:e.t0===P.nc?205:e.t0===P.P?207:e.t0===P.b?209:e.t0===P.Nd?249:e.t0===P.if?253:e.t0===P.rd?256:e.t0===P.xd?262:e.t0===P.bd?264:e.t0===P.od?273:e.t0===P.a?276:e.t0===P.qd?278:e.t0===P.rc?280:e.t0===P.Jd?283:e.t0===P.kc?294:e.t0===P.gd?305:e.t0===P.sd?312:e.t0===P.Sd?320:e.t0===P.X?334:e.t0===P.bb?335:e.t0===P.U?336:e.t0===P.m?346:e.t0===P.ab?348:e.t0===P.Z?357:e.t0===P.V?363:e.t0===P.W?367:e.t0===P.ac?370:e.t0===P.cc?372:e.t0===P.Db?374:e.t0===P.T?378:e.t0===P.Ue?392:e.t0===P.Wb?394:e.t0===P.Sb?431:e.t0===P.Ub?608:e.t0===P.Yb?658:e.t0===P.dd?673:e.t0===P.Q?685:e.t0===P.Rd?687:e.t0===P.Ac?689:e.t0===P.cd?691:e.t0===P.pd?706:e.t0===P.qc?718:e.t0===P.Bc?727:e.t0===P.id?737:e.t0===P.hd?742:e.t0===P.td?755:e.t0===P.cb?764:e.t0===P.eb?770:e.t0===P.Zd?785:e.t0===P.B?793:e.t0===P.q?795:e.t0===P.p?797:e.t0===P.o?799:e.t0===P.me?801:e.t0===P.ne?812:"update_videohd_value"===e.t0?814:e.t0===P.Ic?817:e.t0===P.ae?819:e.t0===P.Qd?823:e.t0===P.Lc?827:e.t0===P.Yc?829:e.t0===P.O?831:e.t0===P.zd?833:e.t0===P.i?836:e.t0===P.N?838:e.t0===P.Bb?840:e.t0===P.zb?842:e.t0===P.Te?844:e.t0===P.Y?853:e.t0===P.Cb?870:e.t0===P.yd?872:e.t0===P.Kc?874:e.t0===P.Yd?877:e.t0===P.ic?879:e.t0===P.oc?881:e.t0===P.Ab?883:e.t0===P.sc?885:e.t0===P.xb?887:e.t0===P.Ve?889:e.t0===P.nd?892:e.t0===P.Hc?894:e.t0===P.ec?898:e.t0===P.Ec?903:905;break;case 6:if(o=0,s=0,(n=this).isVBSettingOn=!0,n.isCurrentInMaskStatus=!1,o=r.width?r.width:640,s=r.height?r.height:360,n.videoCaptureWidth?n.videoCaptureWidth=n.videoCaptureWidth:n.videoCaptureWidth=o,n.videoCaptureHeight?n.videoCaptureHeight=n.videoCaptureHeight:n.videoCaptureHeight=s,Qt({command:"StartVBSetting"}),!r.bgdom){e.next=28;break}if("blur"!=r.bgdom){e.next=21;break}Qt({command:"vbbgimagebitmap",data:r.bgdom}),e.next=28;break;case 21:if((u=document.getElementById(r.bgdom))&&u.naturalWidth&&u.naturalHeight){e.next=26;break}return re.add_monitor("VBGF"),ee.a.Notify_APPUI(P.ve,2),e.abrupt("return");case 26:n.BgImage=u,createImageBitmap(u).then((function(e){Lr(e,"BgImage")})).catch((function(e){re.add_monitor("VBCF"),ee.a.Notify_APPUI(P.ve,2)}));case 28:if(!r.canvas){e.next=35;break}if(n.VideoVBSettingCanvas=document.getElementById(r.canvas),!(!n.VideoVBSettingCanvas||n.VideoVBSettingCanvas.width<=0||n.VideoVBSettingCanvas.height<=0)){e.next=34;break}return re.add_monitor("VBCAF"),ee.a.Notify_APPUI(P.ve,3),e.abrupt("return");case 34:try{xr(n.VideoVBSettingCanvas.transferControlToOffscreen(),"VBOfflineCanvas",r.canvas)}catch(e){xr(null,"VBOfflineCanvas",r.canvas)}case 35:if(n.isSupportVideoFrameOrBitmapCapture||(n.createVideoElement(),n.videoCaptureHiddenCanvas||(n.videoCaptureHiddenCanvas=J.g.isSupport2dOffscreenCanvas()?new OffscreenCanvas(640,360):document.createElement("canvas"),n.videoCaptureHiddenCanvasCtx=n.videoCaptureHiddenCanvas.getContext("2d"))),!Ma.shouldCaptureVideo()){e.next=46;break}if(Rr()){e.next=41;break}return Ra.warn("not isVideoEncodeHandleReady so return"),re.add_monitor("not isVideoEncodeHandleReady so return"),e.abrupt("return");case 41:n.videoCaptureValue?n.videoCaptureValue=Object.assign(n.videoCaptureValue,r):n.videoCaptureValue=r,n.videoCaptureValue.ssid&&(ee.a.localSsrc=n.videoCaptureValue.ssid),n.StartVideoMediaCapture(),e.next=47;break;case 46:n.MaskSettingVideo&&Ma.playVideoStream(n.MaskSettingVideo);case 47:return e.abrupt("break",906);case 48:if(!r.bgdom){e.next=62;break}if("blur"!=r.bgdom){e.next=53;break}Qt({command:"vbbgimagebitmap",data:r.bgdom}),e.next=60;break;case 53:if((d=document.getElementById(r.bgdom))&&d.width&&d.height){e.next=58;break}return re.add_monitor("VBGF"),ee.a.Notify_APPUI(P.ve,2),e.abrupt("return");case 58:this.BgImage=d,createImageBitmap(d).then((function(e){Lr(e,"BgImage")})).catch((function(e){re.add_monitor("VBCF"),ee.a.Notify_APPUI(P.ve,2)}));case 60:e.next=64;break;case 62:this.BgImage=null,Lr(null,"BgImage");case 64:return e.abrupt("break",906);case 65:return this.isVBSettingOn=!1,r.isSwitch&&this.isSupportVideoFrameOrBitmapCapture&&(this.isMaskSettingOn=!0,Qt({command:"StartMaskSetting",isSwitch:r.isSwitch})),Qt({command:"finishVBSetting"}),this.isStartVideoCapture||this.isMaskSettingOn||this.Stop_Video_Capture(),this.MaskSettingVideo&&this.MaskSettingVideo.pause(),e.abrupt("break",906);case 71:if(!this.isMaskSettingStarted){e.next=73;break}return e.abrupt("return");case 73:if(this.isMaskSettingStarted=!0,o=0,s=0,(c=this).isCurrentInMaskStatus=!0,c.isMaskSettingOn=!0,o=r.width?r.width:640,s=r.height?r.height:360,c.ReadyCapureWidth=o,c.ReadyCapureHeight=s,c.videoCaptureWidth?c.videoCaptureWidth=c.videoCaptureWidth:c.videoCaptureWidth=o,c.videoCaptureHeight?c.videoCaptureHeight=c.videoCaptureHeight:c.videoCaptureHeight=s,!r.maskdom){e.next=96;break}if((h=document.getElementById(r.maskdom))&&h.width&&h.height){e.next=90;break}return ee.a.Notify_APPUI(P.bc,1),e.abrupt("return");case 90:c.MaskImage=h,c.maskCoordinate.dx=r.dx?r.dx:c.maskCoordinate.dx,c.maskCoordinate.dy=r.dy?r.dy:c.maskCoordinate.dy,c.maskCoordinate.dWidth=r.dWidth?r.dWidth:c.maskCoordinate.dWidth,c.maskCoordinate.dHeight=r.dHeight?r.dHeight:c.maskCoordinate.dHeight,c.isSupportVideoFrameOrBitmapCapture&&createImageBitmap(h).then((function(e){Wr(e,"MaskImage",c.maskCoordinate,c.videoCaptureWidth,c.videoCaptureHeight)})).catch((function(e){ee.a.Notify_APPUI(P.bc,1)}));case 96:if(!r.bgdom){e.next=104;break}if((l=document.getElementById(r.bgdom))&&l.naturalWidth&&l.naturalHeight){e.next=102;break}return re.add_monitor("VMGF"),ee.a.Notify_APPUI(P.bc,2),e.abrupt("return");case 102:c.BgImage=l,c.isSupportVideoFrameOrBitmapCapture&&createImageBitmap(l).then((function(e){Nr(e,"BgImage")})).catch((function(e){re.add_monitor("VMCF"),ee.a.Notify_APPUI(P.bc,2)}));case 104:if(!r.canvas){e.next=111;break}if(c.VideoMaskSettingCanvas=document.getElementById(r.canvas),c.PrevVideoMaskSettingCanvas=c.VideoMaskSettingCanvas,c.replaceCanvasMap.videoMaskSettingCanvasId=r.canvas,!(!c.VideoMaskSettingCanvas||c.VideoMaskSettingCanvas.width<=0||c.VideoMaskSettingCanvas.height<=0)){e.next=111;break}return ee.a.Notify_APPUI(P.bc,3),e.abrupt("return");case 111:if(c.isSupportVideoFrameOrBitmapCapture||c.createVideoElement(),this.VideoMaskCanvasFillMode=r.fillMode?1:0,c.isSupportVideoFrameOrBitmapCapture&&Qt({command:"StartMaskSetting",fillMode:this.VideoMaskCanvasFillMode}),Ma.shouldCaptureVideo()){e.next=119;break}c.MaskSettingVideo&&Ma.playVideoStream(c.MaskSettingVideo),c.isMaskSettingOn&&ee.a.Notify_APPUI(P.kd,null),e.next=127;break;case 119:if(c.videoCaptureHiddenCanvas||c.isSupportVideoFrameOrBitmapCapture||(c.videoCaptureHiddenCanvas=J.g.isSupport2dOffscreenCanvas()?new OffscreenCanvas(640,360):document.createElement("canvas"),c.videoCaptureHiddenCanvasCtx=c.videoCaptureHiddenCanvas.getContext("2d")),Rr()){e.next=124;break}return Ra.warn("not isVideoEncodeHandleReady so return"),re.add_monitor("not isVideoEncodeHandleReady so return"),e.abrupt("return");case 124:c.videoCaptureValue?c.videoCaptureValue=Object.assign(c.videoCaptureValue,r):c.videoCaptureValue=r,c.videoCaptureValue.ssid&&(ee.a.localSsrc=c.videoCaptureValue.ssid),c.StartVideoMediaCapture();case 127:if(c.isSupportVideoFrameOrBitmapCapture||J.g.isSupportVideoFrameOrBitmapCapture()&&J.g.isSelfPreviewRenderWithVideo())try{xr(c.VideoMaskSettingCanvas.transferControlToOffscreen(),"MaskOfflineCanvas",c.replaceCanvasMap.videoMaskSettingCanvasId)}catch(e){xr(null,"MaskOfflineCanvas",c.replaceCanvasMap.videoMaskSettingCanvasId)}else c.Update_Mask_Texture(c.maskCoordinate,c.videoCaptureWidth,c.videoCaptureHeight);return e.abrupt("break",906);case 129:return p=r.canvas,this.isSupportImageCapture||J.g.isSupportImageCapture()&&J.g.isSelfPreviewRenderWithVideo()?(f=ee.a.SPECIAL_ID,ee.a.localVideoEncMGR&&(m=ee.a.localVideoEncMGR.map.get(f))&&(v={command:"update_mask_canvas_size",rendercanvasID:p,width:r.width,height:r.height},m.postMessage(v))):(r.canvas=document.getElementById(p),r.canvas&&(r.canvas.width=r.width,r.canvas.height=r.height)),e.abrupt("break",906);case 132:if(!this.isSupportVideoFrameOrBitmapCapture){e.next=146;break}if(!r.bgdom){e.next=142;break}if((S=document.getElementById(r.bgdom))&&S.width&&S.height){e.next=138;break}return ee.a.Notify_APPUI(P.bc,2),e.abrupt("return");case 138:this.BgImage=S,createImageBitmap(S).then((function(e){Nr(e,"BgImage")})).catch((function(e){ee.a.Notify_APPUI(P.bc,2)})),e.next=144;break;case 142:this.BgImage=null,Nr(null,"BgImage");case 144:e.next=156;break;case 146:if(!r.bgdom){e.next=154;break}if((_=document.getElementById(r.bgdom))&&_.width&&_.height){e.next=151;break}return ee.a.Notify_APPUI(P.bc,2),e.abrupt("return");case 151:this.BgImage=_,e.next=155;break;case 154:this.BgImage=null;case 155:this.Update_Mask_Texture(this.maskCoordinate,this.videoCaptureWidth,this.videoCaptureHeight);case 156:return e.abrupt("break",906);case 157:if(this.maskCoordinate.dx=r.dx,this.maskCoordinate.dy=r.dy,this.maskCoordinate.dWidth=r.dWidth,this.maskCoordinate.dHeight=r.dHeight,!this.isSupportVideoFrameOrBitmapCapture){e.next=181;break}if(!r.maskdom){e.next=174;break}if((C=document.getElementById(r.maskdom))&&C.width&&C.height){e.next=167;break}return ee.a.Notify_APPUI(P.bc,1),e.abrupt("return");case 167:this.MaskImage=C,y=this.maskCoordinate,b=this.videoCaptureWidth,A=this.videoCaptureHeight,createImageBitmap(C).then((function(e){Wr(e,"MaskImage",y,b,A)})).catch((function(e){ee.a.Notify_APPUI(P.bc,1)})),e.next=179;break;case 174:this.MaskImage=null,k=this.maskCoordinate,E=this.videoCaptureWidth,w=this.videoCaptureHeight,Wr(null,"MaskImage",k,E,w);case 179:e.next=191;break;case 181:if(!r.maskdom){e.next=189;break}if((I=document.getElementById(r.maskdom))&&I.width&&I.height){e.next=186;break}return ee.a.Notify_APPUI(P.bc,1),e.abrupt("return");case 186:this.MaskImage=I,e.next=190;break;case 189:this.MaskImage=null;case 190:this.Update_Mask_Texture(this.maskCoordinate,this.videoCaptureWidth,this.videoCaptureHeight);case 191:return e.abrupt("break",906);case 192:return this.isMaskSettingStarted=!1,this.isMaskSettingOn=!1,r.isSwitch&&(this.isVBSettingOn=!0,Qt({command:"StartVBSetting",isSwitch:r.isSwitch})),this.MaskSettingVideo&&this.MaskSettingVideo.pause(),this.VideoMaskSettingCanvas&&(this.VideoMaskSettingCanvasctx&&(this.VideoMaskSettingCanvasctx.setTransform(1,0,0,1,0,0),this.VideoMaskSettingCanvasctx.clearRect(0,0,this.VideoMaskSettingCanvas.width,this.VideoMaskSettingCanvas.height),this.VideoMaskSettingCanvasctx=null),this.VideoMaskSettingCanvas=null),this.isCanvasScaled=!1,Qt({command:"finishMaskSetting"}),this.isStartVideoCapture||this.isVBSettingOn||this.Stop_Video_Capture(),e.abrupt("break",906);case 201:return this.isMirrorMyVideo=r.isMirrorMyVideo,Qt({command:"mirrorMyVideo",isMirrorMyVideo:this.isMirrorMyVideo}),this.isSupportOffscreenCanvas?(this.VideoRenderObj&&this.VideoRenderObj.setMirrorMyVideoOption(this.isMirrorMyVideo),Xt({command:"mirrorMyVideo",isMirrorMyVideo:this.isMirrorMyVideo,isSupportOffscreenCanvas:this.isSupportOffscreenCanvas})):(this.VideoRenderObj||(this.VideoRenderObj=new Pi(Object.assign({},Da({Notify_APPUI:ee.a.Notify_APPUI.bind(ee.a),isSupportOffscreenCanvas:!1,jsMediaEngine:i,globalTracingLogger:Z.a},ee.a.enableMultiDecodeVideoWithoutSAB?{videodecodethreadnumb:4}:{})))),this.VideoRenderObj.setMirrorMyVideoOption(this.isMirrorMyVideo)),e.abrupt("break",906);case 205:return Xt({command:"newActiveSpeakerSsrc",ssrc:r.ssrc}),e.abrupt("break",906);case 207:return Xt({command:"cancelNewActiveSpeakerSsrcBefreCallback",ssrc:r.ssrc,haddata:r.haddata}),e.abrupt("break",906);case 209:if(r.ssrc=r.userId,r.canvas=document.getElementById(r.canvas),r.x=Math.floor(r.x),r.y=Math.floor(r.y),r.width=Math.floor(r.width),r.height=Math.floor(r.height),this.isCreateVideoWaterMark=r.enableWaterMark,this.videoWaterMarkName=this.isCreateVideoWaterMark?r.waterMarkText:"",this.isMultiView||r.isMyself||this.CheckCurrentActiveSSRC(r.ssrc),!(this.isMultiView||this.isSupportVideoFrameOrBitmapCapture||ee.a.enableVirtualBackgroundWithoutSAB)){e.next=229;break}D=J.e.getIsRenderSelfVideoInEncodeWorker(ee.a.localSsrc&&Object(J.b)(r.ssrc)===Object(J.b)(ee.a.localSsrc)),M=D?ee.a.localVideoEncMGR:ee.a.localVideoDecMGR,R=ee.a.SPECIAL_ID,x=r.canvas.id,this.replaceCanvasMap.videoDecodeCanvasIds||(this.replaceCanvasMap.videoDecodeCanvasIds=[]),this.replaceCanvasMap.videoEncodeCanvasIds||(this.replaceCanvasMap.videoEncodeCanvasIds=[]),D?-1===this.replaceCanvasMap.videoEncodeCanvasIds.indexOf(x)&&this.replaceCanvasMap.videoEncodeCanvasIds.push(x):-1===this.replaceCanvasMap.videoDecodeCanvasIds.indexOf(x)&&this.replaceCanvasMap.videoDecodeCanvasIds.push(x);try{M&&(T=r.canvas.transferControlToOffscreen(),(O=M.map.get(R))&&(V={command:"renderOfflineCanvas",ssrc:r.ssrc,rendercanvasID:x,canvas:T,isCreateVideoWaterMark:this.isCreateVideoWaterMark,videoWaterMarkName:this.videoWaterMarkName,waterMarkText:r.waterMarkText,watermarkOpacity:r.watermarkOpacity,watermarkRepeated:r.watermarkRepeated,watermarkPosition:r.watermarkPosition,x:r.x,y:r.y,width:r.width,height:r.height,zone:r.zone,fillMode:r.fillMode,fillModeForResolution:r.fillModeForResolution},O.postMessage(V,[T])))}catch(e){M&&(N=M.map.get(R))&&(L={command:"renderOfflineCanvas",rendercanvasID:x,ssrc:r.ssrc,videoWaterMarkName:this.videoWaterMarkName,isCreateVideoWaterMark:this.isCreateVideoWaterMark,waterMarkText:r.waterMarkText,watermarkOpacity:r.watermarkOpacity,watermarkRepeated:r.watermarkRepeated,watermarkPosition:r.watermarkPosition,x:r.x,y:r.y,width:r.width,height:r.height,zone:r.zone,fillMode:r.fillMode,fillModeForResolution:r.fillModeForResolution},N.postMessage(L))}e.next=246;break;case 229:if(r.isMyself||Xt({command:"RenderInMain"}),!this.videoRenderArray.length){e.next=238;break}a=0;case 232:if(!(a<this.videoRenderArray.length)){e.next=238;break}if(this.videoRenderArray[a].ssrc!=r.ssrc||this.videoRenderArray[a].zone!=r.zone){e.next=235;break}return e.abrupt("return");case 235:a++,e.next=232;break;case 238:this.videoRenderArray.push(r),this.VideoRenderObj||(this.VideoRenderObj=new Pi(Object.assign({},Da(Da({Notify_APPUI:ee.a.Notify_APPUI.bind(ee.a),isSupportOffscreenCanvas:!1,jsMediaEngine:i},ee.a.enableMultiDecodeVideoWithoutSAB?{videodecodethreadnumb:4}:{}),{},{globalTracingLogger:Z.a})))),r.canvasList&&r.canvasList.forEach((function(e){ct.videoRenderArray.push(Object.assign({},r,{canvas:e}))})),Ra("Start_Video_Play"),this.Start_Video_Play(),this.VideoRenderObj.Set_Render_Array(this.videoRenderArray,ee.a.enableMultiDecodeVideoWithoutSAB),this.isCreateVideoWaterMark&&!this.waterMarkCanvas&&(this.waterMarkCanvas=document.createElement("canvas")),this.VideoRenderObj.Set_WaterMark_Info({waterMarkCanvas:this.waterMarkCanvas,isCreateVideoWaterMark:this.isCreateVideoWaterMark,videoWaterMarkName:this.videoWaterMarkName,watermarkOpacity:r.watermarkOpacity,watermarkRepeated:r.watermarkRepeated,watermarkPosition:r.watermarkPosition});case 246:return e.next=248,Se(!0);case 248:return e.abrupt("break",906);case 249:return W=r.canvas,this.isMultiView||this.isSupportVideoFrameOrBitmapCapture||ee.a.enableVirtualBackgroundWithoutSAB?(f=ee.a.SPECIAL_ID,U=null,ee.a.localVideoEncMGR&&ee.a.enableVirtualBackgroundWithoutSAB&&(U=ee.a.localVideoEncMGR.map.get(f)),ee.a.localVideoDecMGR&&(m=ee.a.localVideoDecMGR.map.get(f))&&(v={command:"update_canvas_size",rendercanvasID:W,width:r.width,height:r.height},m.postMessage(v),U&&U.postMessage(v))):(r.canvas=document.getElementById(W),r.canvas&&(r.canvas.width=r.width,r.canvas.height=r.height)),this.UpdateVideoPlayStatus(!0),e.abrupt("break",906);case 253:if((this.isMultiView||this.isSupportVideoFrameOrBitmapCapture||ee.a.enableVirtualBackgroundWithoutSAB)&&(F=J.e.getIsRenderSelfVideoInEncodeWorker(ee.a.localSsrc&&Object(J.b)(r.userId)===Object(J.b)(ee.a.localSsrc)),B=ee.a.SPECIAL_ID,m=null,F&&ee.a.localVideoEncMGR?m=ee.a.localVideoEncMGR.map.get(B):ee.a.localVideoDecMGR&&(m=ee.a.localVideoDecMGR.map.get(B)),m&&(v={command:"zoomrender",ssrc:r.userId,x:r.x,y:r.y,width:r.width,height:r.height,canvas:r.canvas,zone:r.zone,RGBA:r.RGBA},m.postMessage(v))),this.videoRenderArray.length)for(a=0;a<this.videoRenderArray.length;a++)this.videoRenderArray[a].ssrc==r.userId&&this.videoRenderArray[a].zone==r.zone&&(this.videoRenderArray[a].x=r.x,this.videoRenderArray[a].y=r.y,this.videoRenderArray[a].width=r.width,this.videoRenderArray[a].height=r.height);return e.abrupt("break",906);case 256:if(this.videoWaterMarkName="",this.isCreateVideoWaterMark=!1,r.ssrc=r.userId,(this.isMultiView||this.isSupportVideoFrameOrBitmapCapture||ee.a.enableVirtualBackgroundWithoutSAB)&&(J.e.getIsRenderSelfVideoInEncodeWorker(ee.a.localSsrc&&Object(J.b)(r.ssrc)===Object(J.b)(ee.a.localSsrc))?Qt:Xt)({command:"stopVideoRender",ssrc:r.ssrc,canvas:r.canvas,RGBA:r.RGBA,doNotClean:r.doNotClean,x:r.x,y:r.y,zone:r.zone}),this.videoRenderArray.length)for(a=0;a<this.videoRenderArray.length;a++)this.videoRenderArray[a].ssrc==r.ssrc&&this.videoRenderArray[a].zone==r.zone&&(G=this.videoRenderArray.splice(a,1),r.doNotClean||this.VideoRenderObj.clearUseridRender(G,r.RGBA),ee.a.enableMultiDecodeVideoWithoutSAB&&this.VideoRenderObj.GiveBack_Display(G),this.VideoRenderObj.Set_Render_Array(this.videoRenderArray,ee.a.enableMultiDecodeVideoWithoutSAB),0==this.videoRenderArray.length&&(Xt({command:"stopVideoRender",MFlag:!0}),this.Stop_Video_Play()));return e.abrupt("break",906);case 262:return J.g.isSelfPreviewRenderWithVideo()?(this.videoCaptureValue.videoCtrl&&!this.videoCaptureValue.videoCtrl.paused&&this.videoCaptureValue.videoCtrl.pause(),this.videoCaptureValue.videoCtrl.srcObject&&(this.videoCaptureValue.videoCtrl.srcObject=null),this.videoCaptureValue.videoCtrl.src&&(this.videoCaptureValue.videoCtrl.src=null),H=r instanceof Array?r[0]:r,j=J.g.getDocumentHandle(H),this.videoCaptureValue.videoCtrl=j,this.captureVideoOutPutVideoDom=j,Ma.playVideoStream(this.videoCaptureValue.videoCtrl,{playsinline:J.g.isIphoneOrIpadSafari()})):(K=[],r instanceof Array?K=r:K.push(r),q=this.videoCaptureValue.canvasCtrlList,Q=q.filter((function(e){return-1!==K.indexOf(e.k)})).map((function(e){return e.dom})),this.switchCanvasForVideoCapture(Q)),e.abrupt("break",906);case 264:if(mr(ee.a.e2eencrypt),this.isSupportVideoShare&&Gt(z=new MessageChannel,z),this.videoCaptureHiddenCanvas||this.isSupportVideoFrameOrBitmapCapture||(this.videoCaptureHiddenCanvas=J.g.isSupport2dOffscreenCanvas()?new OffscreenCanvas(640,360):document.createElement("canvas"),this.videoCaptureHiddenCanvasCtx=this.videoCaptureHiddenCanvas.getContext("2d")),Rr()){e.next=271;break}return Ra.warn("not isVideoEncodeHandleReady so return"),re.add_monitor("not isVideoEncodeHandleReady so return"),e.abrupt("return");case 271:return this.isStartVideoCapture?Ra.warn("video capture is already started, do not call again."):(this.VALUE_CACHE_FOR_START_CAPTURE_VIDEO=Object.assign({},r),this.isStartVideoCapture=!0,this.bVideoEncodeMainThreadConsumerIntervalEnable&&this.videoEncodeRingbufferConsumer&&this.videoEncodeRingbufferConsumer.consume(20),this.isSupportVideoTrackReader||this.isSupportMediaStreamTrackProcessor?(r.canvas instanceof Array?r.canvas[0]:r.canvas,J.g.isGoogleNestChrome()&&!J.g.isHighVersionGoolgeNestChrome()||J.g.isSelfPreviewRenderWithVideo()&&J.g.isSupportVideoFrameOrBitmapCapture()?r.videoCtrl=document.getElementById(r.video):this.MaskSettingVideo?r.videoCtrl=this.MaskSettingVideo:r.videoCtrl=document.createElement("video")):(r.canvasCtrlList=[],r.canvasCtrl=this.videoCaptureHiddenCanvas,J.g.isSelfPreviewRenderWithVideo()&&r.video?(r.videoCtrl=document.getElementById(r.video),this.isSelfViewWithVideo=!0):J.g.browser.isSafari?this.MaskSettingVideo?r.videoCtrl=this.MaskSettingVideo:((X=document.createElement("video")).setAttribute("style","position:fixed;top:-10000px;left:-10000px;"),document.body.appendChild(X),r.videoCtrl=X):this.MaskSettingVideo?r.videoCtrl=this.MaskSettingVideo:r.videoCtrl=document.createElement("video")),this.ReadyCapureWidth=r.width?r.width:640,this.ReadyCapureHeight=r.width?r.height:360,this.captureVideoOutPutVideoDom=r.videoCtrl,this.videoCaptureValue=r,this.videoCaptureValue.ssid&&(ee.a.localSsrc=this.videoCaptureValue.ssid),this.Start_Video_Capture()),e.abrupt("break",906);case 273:return Y=this,e.abrupt("return",new Promise((function(e,t){try{if(Ma.isCaptureVideoInProgress)return ee.a.Notify_APPUI(P.ud,null),t(new Error("Too many calls : the device is opening camera now, cannot stop video capture"));Y.isStartVideoCapture&&Y.Stop_Video_Capture(),ee.a.Notify_APPUI(P.vd,null),e(!0)}catch(e){ee.a.Notify_APPUI(P.ud,null),t(e)}})));case 276:return 0==this.audioRenderArray.length&&(this.audioRenderArray.push(r),this.Start_Audio_Play()),e.abrupt("break",906);case 278:if(this.audioRenderArray.length>0)for(this.Stop_Audio_Play(),a=0;a<this.audioRenderArray.length;a++)this.audioRenderArray[a].ssrc==r.ssrc&&this.audioRenderArray.splice(a,1);return e.abrupt("break",906);case 280:return e.next=282,Dr(ie.f.AUDIO_DECODE,{bPause:r.bPause},"PAUSE_OR_RESUME_AUDIO_DECODE",!1,!0);case 282:return e.abrupt("break",906);case 283:if(this.captureAudioMuted=!1,this.audioInputLevel&&this.audioInputLevel.start(),this.useAudioBridge&&this.audioBridge&&this.audioBridge.unmute(),!r.issiphone){e.next=292;break}if(!this.WebSipClient){e.next=290;break}return this.WebSipClient.unmute(),e.abrupt("return");case 290:e.next=293;break;case 292:this.UnMuteAudio();case 293:return e.abrupt("break",906);case 294:if(this.captureAudioMuted=!0,this.audioInputLevel&&this.audioInputLevel.stop(),this.useAudioBridge&&this.audioBridge&&this.audioBridge.mute(),!r.issiphone){e.next=303;break}if(!this.WebSipClient){e.next=301;break}return this.WebSipClient.mute(),e.abrupt("return");case 301:e.next=304;break;case 303:this.MuteAudio();case 304:return e.abrupt("break",906);case 305:if(this.isSupportVideoShare?Zt({command:"startSharingRender"}):$t({command:"startSharingRender"}),this.currentshareactive=r.ssrc,null==this.currentshareactive&&re.add_monitor2("SSRC"),this.isCreateSharingWaterMark=r.enableWaterMark,this.sharingWaterMarkName=this.isCreateSharingWaterMark?r.waterMarkText:"",this.isSupportOffscreenCanvas)try{f=ee.a.SPECIAL_ID,this.replaceCanvasMap.sharingMainCanvasId=r.canvas.id,m=null,this.isSupportVideoShare?ee.a.localVideoDecMGR&&(m=ee.a.localVideoDecMGR.map.get(f)):ee.a.localSharingDecMGR&&(m=ee.a.localSharingDecMGR.map.get(f)),m&&(this.sharingRenderCanvas=r.canvas.transferControlToOffscreen(),v={command:"sharingRenderCanvas",canvas:this.sharingRenderCanvas,rendercanvasID:this.replaceCanvasMap.sharingMainCanvasId,ssrc:this.currentshareactive,isCreateSharingWaterMark:this.isCreateSharingWaterMark,sharingWaterMarkName:this.sharingWaterMarkName,watermarkOpacity:r.watermarkOpacity,watermarkRepeated:r.watermarkRepeated,isFromMainSession:r.isFromMainSession,watermarkPosition:r.watermarkPosition},m.postMessage(v,[v.canvas]))}catch(e){f=ee.a.SPECIAL_ID,m=null,this.isSupportVideoShare?ee.a.localVideoDecMGR&&(m=ee.a.localVideoDecMGR.map.get(f)):ee.a.localSharingDecMGR&&(m=ee.a.localSharingDecMGR.map.get(f)),m&&(v={command:"sharingRenderCanvas",rendercanvasID:this.replaceCanvasMap.sharingMainCanvasId,ssrc:this.currentshareactive,isCreateSharingWaterMark:this.isCreateSharingWaterMark,sharingWaterMarkName:this.sharingWaterMarkName,watermarkOpacity:r.watermarkOpacity,watermarkRepeated:r.watermarkRepeated,isFromMainSession:r.isFromMainSession,watermarkPosition:r.watermarkPosition},m.postMessage(v))}else this.SharingRenderObj||(this.SharingRenderObj=new Li(Object.assign({},{Notify_APPUI:ee.a.Notify_APPUI.bind(ee.a),PubSub:$.a,jsMediaEngine:i,globalTracingLogger:Z.a}))),this.sharingDisplay=new hi(r.canvas,0,void 0,{preserveDrawingBuffer:!1}),this.SharingRenderObj.Set_Render_WebGL(this.sharingDisplay),this.SharingRenderObj.Change_Current_SSRC(this.currentshareactive,r.isFromMainSession),this.isCreateSharingWaterMark&&!this.waterMarkCanvas&&(this.waterMarkCanvas=document.createElement("canvas")),this.SharingRenderObj.Set_WaterMark_Info({waterMarkCanvas:this.waterMarkCanvas,isCreateSharingWaterMark:this.isCreateSharingWaterMark,sharingWaterMarkName:this.sharingWaterMarkName,watermarkOpacity:r.watermarkOpacity,watermarkRepeated:r.watermarkRepeated,watermarkPosition:r.watermarkPosition}),this.sharingInterval||(this.sharingInterval=this.JsMediaSDK_SharingRenderInterval(this.sharingIntervalTime,r.isVideoShare)),Ce(!0);return e.abrupt("break",906);case 312:return Ce(!1),this.isSupportVideoShare?Zt({command:"stopSharingRender"}):$t({command:"stopSharingRender"}),this.isCreateSharingWaterMark=!1,this.sharingWaterMarkName="",this.sharingInterval&&(clearInterval(this.sharingInterval),this.sharingInterval=0),this.sharingDisplay&&(this.sharingDisplay.clear(),this.sharingDisplay.cleanup(),this.sharingDisplay=null),this.SharingRenderObj&&(this.SharingRenderObj.ClearQueue(),this.SharingRenderObj.Set_WaterMark_Info({waterMarkCanvas:this.waterMarkCanvas,isCreateSharingWaterMark:this.isCreateSharingWaterMark,sharingWaterMarkName:this.sharingWaterMarkName})),e.abrupt("break",906);case 320:if(te=r.width,ae=r.height,Ra("UPDATE_SHARING_DECODE_PARAM",r),this.SharingRenderObj?this.SharingRenderObj.Update_Sharing_Canvas_Size({width:te,height:ae}):this.isSupportVideoShare?Zt({command:"UPDATE_SHARING_CANVAS_SIZE",width:te,height:ae}):$t({command:"UPDATE_SHARING_CANVAS_SIZE",width:te,height:ae}),!Fr()){e.next=325;break}return e.abrupt("return",Ra("isSharingNotClearChromeVersion",Fr()));case 325:if(ee.a.rwgAgent){e.next=327;break}return e.abrupt("break",906);case 327:if(!this.isSupportVideoShare){e.next=331;break}Zt({command:"SET_OFFSCREENCANVAS_WIDTH_HEIGHT",data:{width:te,height:ae}}),e.next=333;break;case 331:return e.next=333,Dr(ie.f.SHARING_DECODE,{width:te,height:ae},"SET_OFFSCREENCANVAS_WIDTH_HEIGHT",!1,!0);case 333:case 334:case 335:return e.abrupt("break",906);case 336:if(r.AudioSelectValue){e.next=338;break}return e.abrupt("return");case 338:if(ne=Date.now(),wa.setSpeakerId(r.AudioSelectValue),!this.useAudioBridge||!this.audioBridge){e.next=344;break}return this.audioBridge.changeSpeaker(r.AudioSelectValue),wa.sendSpeakerDevice(Date.now()-ne,!0),e.abrupt("return");case 344:return this.selectComputerAudioSpeaker(r.AudioSelectValue,ne),e.abrupt("break",906);case 346:return wa.changeDenoiseSwitch(r.switch),e.abrupt("break",906);case 348:if(ue=Object.assign({},this.VALUE_CACHE_FOR_START_CAPTURE_VIDEO,r),!this.isSupportVideoTrackReader&&!this.isSupportMediaStreamTrackProcessor){if(ue.canvasCtrlList=[],ue.canvas instanceof Array)for(a=0;a<ue.canvas.length;a++)ue.canvasCtrlList.push({k:ue.canvas[a],dom:J.g.getDocumentHandle(ue.canvas[a])});else ue.canvasCtrlList.push({k:ue.canvas,dom:J.g.getDocumentHandle(ue.canvas)});ue.canvasCtrl=ue.canvasCtrlList[0].dom}return ue.videoCtrl=this.captureVideoOutPutVideoDom,Ma.destoryVideoMediaStream(),this.videoCaptureValue=ue,null!==(oe=this.videoCaptureValue.videoCtrl)&&void 0!==oe&&oe.srcObject&&(this.videoCaptureValue.videoCtrl.srcObject=null),null!==(se=this.videoCaptureValue.videoCtrl)&&void 0!==se&&se.src&&(this.videoCaptureValue.videoCtrl.src=null),this.StartVideoMediaCapture(),e.abrupt("break",906);case 357:return r.canvas&&(r.rendercanvasID=r.canvas),de=Object.assign({},this.desktopSharingValue,r),this.EndSharingMediaStream(),this.desktopSharingValue=de,this.StartDesktopMediaCapture(),e.abrupt("break",906);case 363:return this.currentactive!=r.ssrc&&(this.currentactive=r.ssrc,ee.a.CurrentSSRC=this.currentactive),er(ee.a.CurrentSSRC),this.isSupportOffscreenCanvasForVideoDecode?(f=ee.a.SPECIAL_ID,ee.a.localVideoDecMGR&&(m=ee.a.localVideoDecMGR.map.get(f))&&(v={command:"CHANGE_CURRENT_ACTIVE_SSRC",ssrc:r.ssrc},m.postMessage(v))):(this.VideoRenderObj||(this.VideoRenderObj=new Pi(Object.assign({},Da(Da({Notify_APPUI:ee.a.Notify_APPUI.bind(ee.a),isSupportOffscreenCanvas:!1,jsMediaEngine:i},ee.a.enableMultiDecodeVideoWithoutSAB?{videodecodethreadnumb:4}:{}),{},{globalTracingLogger:Z.a})))),this.VideoRenderObj.Change_Current_SSRC(this.currentactive)),e.abrupt("break",906);case 367:return this.currentshareactive!=r.ssrc&&(this.currentshareactive=r.ssrc),this.isSupportOffscreenCanvas?this.isSupportVideoShare?Zt({command:"CHANGE_CURRENT_SHARING_ACTIVE_SSRC",ssrc:r.ssrc,isFromMainSession:r.isFromMainSession}):(f=ee.a.SPECIAL_ID,ee.a.localSharingDecMGR&&(m=ee.a.localSharingDecMGR.map.get(f))&&(v={command:"CHANGE_CURRENT_SHARING_ACTIVE_SSRC",ssrc:r.ssrc,isFromMainSession:r.isFromMainSession},m.postMessage(v))):(this.SharingRenderObj||(this.SharingRenderObj=new Li(Object.assign({},{Notify_APPUI:ee.a.Notify_APPUI.bind(ee.a),PubSub:$.a,jsMediaEngine:i,globalTracingLogger:Z.a}))),this.SharingRenderObj.Change_Current_SSRC(this.currentshareactive,r.isFromMainSession)),e.abrupt("break",906);case 370:return this.Stop_Audio_Play(),e.abrupt("break",906);case 372:return this.Meeting_Fail_Over(r.audio_websocket_address,r.video_websocket_address),e.abrupt("break",906);case 374:return Ra("jsEvent.END_MEDIA"),$.a.trigger(P.vc.END_MEDIA),this.destroy().catch((function(e){return Ra.error(e)})),e.abrupt("break",906);case 378:if(!(this.audioCapture&&r&&this.audioCtx)){e.next=390;break}if(!this.enableHID){e.next=388;break}if(!this.hidAvalible){e.next=384;break}return e.next=383,aa.destroy();case 383:this.hidAvalible=!1;case 384:if(!r.microphoneLabel){e.next=388;break}return e.next=387,aa.init(r.microphoneLabel,r.defaultMuted);case 387:this.hidAvalible=e.sent;case 388:Ma.destoryAudioMediaStream();try{this.isCaputureNodeConnect=!1,this.audioCapture=r,this.audioCtx.sampleRate!=this.sampleRate&&(this.sampleRate=this.audioCtx.sampleRate,Wt(this.sampleRate)),this.Start_Audio_Capture(),ur()}catch(e){this.JsMediaSDK_Log(e)}case 390:return e.abrupt("return");case 392:return r&&(Ut(ee.a.SPECIAL_ID,P.w),Ma.destoryAudioMediaStream(),this.Remove_Audio_Capture(),this.audioCapture=r,this.Start_Audio_Capture(),ur()),e.abrupt("break",906);case 394:if(Ma.destoryAudioMediaStream(),this.captureAudioMuted=!1,!this.hidAvalible){e.next=400;break}return e.next=399,aa.destroy();case 399:this.hidAvalible=!1;case 400:if(ee.a.ComputerAudioStatus=ie.a.ComputerAudio_Null,!this.audioInputLevel){e.next=406;break}return this.audioInputLevel.destroy(),this.audioInputLevel=null,ee.a.Notify_APPUI(P.Xb,null),e.abrupt("return");case 406:if(!this.useAudioBridge||!this.audioBridge){e.next=410;break}return this.audioBridge.leaveAudioWithoutDisconnect(),ee.a.Notify_APPUI(P.Xb,null),e.abrupt("return");case 410:if(!(r&&r.issiphone&&this.webrtcaudiodom&&this.WebSipClient)){e.next=414;break}return this.webrtcaudiodom.muted=!0,this.WebSipClient.mute(),e.abrupt("return");case 414:if(ee.a.ComputerAudioStatus!==ie.a.ComputerAudio_Connecting){e.next=417;break}return ee.a.Notify_APPUI(P.Xb,null),e.abrupt("return");case 417:this.audioEncodeRingBufferConsumer&&this.audioEncodeRingBufferConsumer.cancelConsume(),this.Remove_Audio_Capture(),this.Remove_Audio_Play(),this.CloseBoringPeerConnection();try{ee.a.AudioNode&&(ee.a.AudioNode.disconnect(),ee.a.AudioNode.postCMD("stopWorklet",!0),ee.a.AudioNode.port=null)}catch(e){Ra("AudioNode.port",e)}return ee.a.AudioNode=null,ee.a.workletWasmInitSuccess=!1,this.audioCtx&&(this.audioCtx.close(),this.isCaputureNodeConnect=!1),this.audioCtx=null,this.audioCapture=null,this.audioPlay=!1,this.audioDomNode=null,ee.a.Notify_APPUI(P.Xb,null),e.abrupt("break",906);case 431:if(this.enableHID=r.CaptureAudioInfo.enableHID,!this.enableHID){e.next=437;break}if(!r.CaptureAudioInfo.microphoneLabel){e.next=437;break}return e.next=436,aa.init(r.CaptureAudioInfo.microphoneLabel,r.CaptureAudioInfo.defaultMuted);case 436:this.hidAvalible=e.sent;case 437:if(ee.a.ComputerAudioStatus=ie.a.ComputerAudio_Connecting,e.prev=438,!r.checkAutoplay){e.next=442;break}return e.next=442,J.g.checkAudioAutoPlay();case 442:e.next=450;break;case 444:return e.prev=444,e.t1=e.catch(438),Ra.error("audio auto play",e.t1),ee.a.ComputerAudioStatus=ie.a.ComputerAudio_Null,ee.a.Notify_APPUI(P.Tb,null),e.abrupt("return",ee.a.Notify_APPUI(P.f,e.t1));case 450:if(this.audioInputLevel&&(this.audioInputLevel.destroy(),this.audioInputLevel=null),!r.isPreviewMode){e.next=454;break}return r.CaptureAudio?(this.audioCapture=r.CaptureAudioInfo,this.audioInputLevel=new da({analyserCallback:function(){ee.a.Notify_APPUI_SAFE(P.s)}}),Ma.shouldCaptureAudio()||ee.a.Notify_APPUI(P.Xd,null),this.Start_Audio_Capture()):(ee.a.ComputerAudioStatus=ie.a.ComputerAudio_Connected,ee.a.Notify_APPUI(P.Tb,null)),e.abrupt("return");case 454:if(this.useAudioBridge=r.useAudioBridge&&r.audioBridge,!this.useAudioBridge){e.next=465;break}return wa.setUserId(r.CaptureAudioInfo.ssrc),wa.setIsAudioBridge(!0),ce=r.audioBridge,he=ce.nginxHost,le=ce.rwgHost,pe=ce.cid,fe=ce.abToken,me=ce.supportLocalAB,e.next=461,this.previewInit({audioBridge:{nginxHost:he,rwgHost:le,cid:pe,abToken:fe,isCapturingAudio:r.CaptureAudio,isJoinAudio:!0,supportLocalAB:me}});case 461:return r.CaptureAudio?(this.audioCapture=r.CaptureAudioInfo,this.Start_Audio_Capture()):(ee.a.ComputerAudioStatus=ie.a.ComputerAudio_Connected,ee.a.Notify_APPUI(P.Tb,null)),r.speakerInfo&&r.speakerInfo.defaultDeviceId&&wa.setSpeakerId(r.speakerInfo.defaultDeviceId),wa.sendSpeakerDevice(0,!0),e.abrupt("return");case 465:if(!r.issiphone){e.next=495;break}if(!this.WebSipClient){e.next=475;break}return e.prev=467,e.next=470,this.WebSipClient.clear();case 470:this.WebSipClient=null,e.next=475;break;case 473:e.prev=473,e.t2=e.catch(467);case 475:ge=r.sip.sipServer,_e=r.sip.meetingnumber,ye=r.sip.participantId;try{be=r.sip.sipNumberList[0].number.replace(" ","")}catch(e){be="+10000"}return Ae=r.sip.audio,this.webrtcaudiodom=Ae,this.WebSipClient=new WebSipClient(ge,_e,ye,be,"sip:zoom.wcl.sip@zoom.us",Ae),e.prev=483,e.next=486,this.WebSipClient.connect();case 486:return e.next=488,this.WebSipClient.call();case 488:e.next=494;break;case 490:e.prev=490,e.t3=e.catch(483),Z.a.error("Error connecting to SIP audio",e.t3),e.t3.name&&-1!=e.t3.name.indexOf("NotAllowedError")&&ee.a.Notify_APPUI(P.Vd,null);case 494:return e.abrupt("return");case 495:if(e.prev=495,this.bAudioEncodeMainThreadConsumerIntervalEnable&&this.audioEncodeRingBufferConsumer&&this.audioEncodeRingBufferConsumer.consume(),this.Remove_Audio_Play(),this.Remove_Audio_Capture(),this.CloseBoringPeerConnection(),Ut(ee.a.SPECIAL_ID,P.w),this.audioCtx&&(this.audioCtx.close(),this.isCaputureNodeConnect=!1),ke=J.g.getAudioContextConfigure(),this.audioCtx=new(window.AudioContext||window.webkitAudioContext)(ke),this.audioCtx.sampleRate!=this.sampleRate&&(this.sampleRate=this.audioCtx.sampleRate,Wt(this.sampleRate)),this.disableAudioAGC=r.disableAudioAGC,this.disableNoiseSuppression=r.disableNoiseSuppression,this.disableBrowserAec=r.disableBrowserAec,this.bAudioDecodeUsingSAB&&re.add_monitor("ASSAB"),"suspended"===this.audioCtx.state&&this.audioCtx.resume(),Y=this,Ee=null,ee.a.decoderinworklet){e.next=516;break}Ee=this.audioWorkletJsPath.audioWorkletPath,e.next=520;break;case 516:return e.next=518,J.g.isSDKSupportSIMD();case 518:we=e.sent,Ee=we?this.audioWorkletJsPath.audioWorkletSIMDPath:this.audioWorkletJsPath.audioWorkletProcessPath;case 520:return e.next=522,this.audioCtx.audioWorklet.addModule(Ee);case 522:if(ee.a.AudioNode=new jr(Y.audioCtx,"zoomAudioWorklet",J.g.browser.isSafari&&ee.a.sharedBuffer?{processorOptions:{sharedBuffer:ee.a.sharedBuffer,userAgent:navigator.userAgent,audioDecodeChannelsNum:J.g.isSupportPlayStereo()?2:1,audioEncodeChannelsNum:J.g.isSupportMicSendStereo()?2:1},numberOfOutputs:1,outputChannelCount:[2]}:{processorOptions:{audioDecodeChannelsNum:J.g.isSupportPlayStereo()?2:1,audioEncodeChannelsNum:J.g.isSupportMicSendStereo()?2:1},numberOfOutputs:1,outputChannelCount:[2]}),ee.a.AudioNode.onprocessorerror=function(e){Z.a.error("Exception thrown in AudioWorkletProcessor",e)},J.g.browser.isSafari&&!ee.a.sharedBuffer&&ee.a.AudioNode.postCMD("diableSharedArrayBuffer"),ee.a.decoderinworklet||ee.a.AudioNode.postCMD("disableDecoderinworklet"),ee.a.decoderinworklet&&(this.isMultiView?ee.a.AudioNode.postCMD("multiView",!0):ee.a.CurrentSSRC&&ee.a.AudioNode.postCMD("currentSSRC",ee.a.CurrentSSRC),ee.a.AudioNode.postCMD("initData",{userid:ee.a.localAudioPara.userid,meetingnumb:ee.a.localAudioPara.meetingnumb,meetingid:ee.a.localAudioPara.meetingid,qoson:ee.a.localAudioPara.qoson}),Si((Ie=ee.a.audioWasmInfo).dbVersion,Ie.url,void 0,!1,!0,Ie.databaseName,Ie.databaseDataType).then((function(e){e?ee.a.AudioNode.postCMD("audiowasm",e):J.g.downloadBinary(Ie.url).then((function(e){ee.a.AudioNode.postCMD("audiowasm",e)}))}))),De=J.g.isSupportChromeWideAEC()&&!ee.a.shareSystemAudio,!J.g.browser.isChrome||J.g.isAndroidBrowser()||J.g.isQuestBrowser()){e.next=561;break}if(!this.disableBrowserAec){e.next=533;break}this.isSupportBrowserAec=!1,e.next=539;break;case 533:if(e.t4=De,e.t4){e.next=538;break}return e.next=537,this.isLocalP2PSupportedPromise;case 537:e.t4=e.sent;case 538:this.isSupportBrowserAec=e.t4;case 539:if(ee.a.sharedBuffer&&ee.a.AudioNode.postCMD("sharedBuffer",ee.a.sharedBuffer),J.g.isGoogleNestChrome()){e.next=553;break}if(this.disableBrowserAec){e.next=553;break}if(!this.isSupportBrowserAec){e.next=552;break}if(De){e.next=550;break}return Re=Y.audioCtx.createMediaStreamDestination(),ee.a.AudioNode.connect(Re),Me=Re.stream,e.next=549,Y.chromeAecWorkAround(Re.stream);case 549:Me=e.sent;case 550:e.next=553;break;case 552:Ft(ee.a.SPECIAL_ID,!1);case 553:xe=null,xe=r.speakerInfo&&r.speakerInfo.defaultDeviceId?r.speakerInfo.defaultDeviceId:"",wa.setSpeakerId(xe),Pe=Date.now(),De?ee.a.AudioNode.connect(Y.audioCtx.destination):(Y.audioDomNode||(Y.audioDomNode=new Audio),Y.audioDomNode.srcObject=Me,Y.audioDomNode.play()),Y.selectComputerAudioSpeaker(xe,Pe),e.next=587;break;case 561:if(ee.a.sharedBuffer&&ee.a.AudioNode.postCMD("sharedBuffer",J.g.browser.isSafari?null:ee.a.sharedBuffer),!J.g.isAndroidBrowser()&&!J.g.isQuestBrowser()){e.next=586;break}if(Te=Y.audioCtx.createMediaStreamDestination(),ee.a.AudioNode.connect(Te),!this.disableBrowserAec){e.next=569;break}this.isSupportBrowserAec=!1,e.next=572;break;case 569:return e.next=571,this.isLocalP2PSupportedPromise;case 571:this.isSupportBrowserAec=e.sent;case 572:if(Oe=Te.stream,this.disableBrowserAec){e.next=581;break}if(!this.isSupportBrowserAec){e.next=580;break}return e.next=577,Y.chromeAecWorkAround(Te.stream);case 577:Oe=e.sent,e.next=581;break;case 580:Ft(ee.a.SPECIAL_ID,!1);case 581:Y.audioDomNode||(Y.audioDomNode=new Audio),Y.audioDomNode.srcObject=Oe,Y.audioDomNode.play(),e.next=587;break;case 586:J.g.browser.isFirefox&&J.g.isFirefoxVersionHigherThan(116)?(Ve=Y.audioCtx.createMediaStreamDestination(),ee.a.AudioNode.connect(Ve),Ne=Ve.stream,Y.audioDomNode||(Y.audioDomNode=new Audio),Y.audioDomNode.srcObject=Ne,Le=null,We=Date.now(),Le=r.speakerInfo&&r.speakerInfo.defaultDeviceId?r.speakerInfo.defaultDeviceId:"",wa.setSpeakerId(Le),this.selectComputerAudioSpeaker(Le,We),Y.audioDomNode.play()):(ee.a.AudioNode.connect(Y.audioCtx.destination),wa.setSpeakerId("default"),wa.sendSpeakerDevice(0,!0));case 587:rr({command:"stop_audio_incoming",stopPlayAudio:!1}),tr({command:"startAudioEncode",ssid:r.CaptureAudioInfo.ssrc,audioMode:ee.a.audioMode}),yr(ee.a.e2eencrypt),Ue=new MessageChannel,Fe=new MessageChannel,ee.a.AudioNode.port.postMessage({status:"encodeAudioPort"},[Fe.port2]),ee.a.AudioNode.port.postMessage({status:"decodeAudioPort"},[Ue.port1]),ee.a.AudioNode.port.postMessage({status:"sampleRate",data:Y.audioCtx.sampleRate}),Bt(Ue,Fe),Y.Start_Audio_Play(),this.isSupportOffscreenCanvasForVideoDecode&&(qt(Be=new MessageChannel),ee.a.decoderinworklet?ee.a.AudioNode.port.postMessage({status:"decodeVideoPort"},[Be.port2]):jt(Be),!this.isSupportVideoShare&&Y.isSupportOffscreenCanvas&&Ht(Ge=new MessageChannel,Ge)),r.CaptureAudio?(Y.audioCapture=r.CaptureAudioInfo,r.denoiseSwitch&&wa.changeDenoiseSwitch(r.denoiseSwitch),Y.Start_Audio_Capture(),this.firstSetDelay&&(this.firstSetDelay=!1,ur(),dr())):(ee.a.ComputerAudioStatus=ie.a.ComputerAudio_Connected,ee.a.Notify_APPUI(P.Tb,null)),e.next=607;break;case 601:e.prev=601,e.t5=e.catch(495),ee.a.ComputerAudioStatus=ie.a.ComputerAudio_Null,ee.a.Notify_APPUI(P.Tb,null),Ra.error(e.t5),this.JsMediaSDK_Log(e.t5);case 607:return e.abrupt("break",906);case 608:if(ee.a.DesktopAudioStatus===ie.a.DesktopAudio_Null){e.next=611;break}return ee.a.Notify_APPUI(P.Vb,null),e.abrupt("return");case 611:if(e.t6=J.g.isSupportChromeWideAEC()&&ee.a.ComputerAudioStatus!=ie.a.ComputerAudio_Null&&!this.audioDomNode&&ee.a.shareSystemAudio,!e.t6){e.next=616;break}return e.next=615,this.isLocalP2PSupportedPromise;case 615:e.t6=e.sent;case 616:if(!e.t6){e.next=630;break}return ee.a.AudioNode.disconnect(),He=this.audioCtx.createMediaStreamDestination(),ee.a.AudioNode.connect(He),je=He.stream,e.next=623,this.chromeAecWorkAround(He.stream);case 623:je=e.sent,this.audioDomNode||(this.audioDomNode=new Audio),this.audioDomNode.srcObject=je,Ke=wa.speakerId,qe=Date.now(),this.audioDomNode.setSinkId(Ke).then((function(){wa.sendSpeakerDevice(Date.now()-qe,!0)})).catch((function(e){re.add_monitor("AODF"),wa.sendSpeakerDevice(Date.now()-qe,!1),ee.a.Notify_APPUI(P.v,null)})),this.audioDomNode.play();case 630:return ee.a.DesktopAudioStatus=ie.a.DesktopAudio_Connecting,e.prev=631,this.bAudioEncodeMainThreadConsumerIntervalEnable&&this.audioEncodeRingBufferConsumer&&this.audioEncodeRingBufferConsumer.consume(),tr({command:"mute",bOn:P.w,sharing:!0}),this.sharingAudioCtx&&(this.sharingAudioCtx.close(),this.isSharingCaptureNodeConnect=!1),Qe=J.g.getAudioContextConfigure(),this.sharingAudioCtx=new(window.AudioContext||window.webkitAudioContext)(Qe),Y=this,ze=this.audioWorkletJsPath.sharingAudioWorkletPath,e.next=641,this.sharingAudioCtx.audioWorklet.addModule(ze);case 641:ee.a.SharingAudioNode=new jr(Y.sharingAudioCtx,"zoomSharingAudioWorklet",{processorOptions:{sharingEncodeChannelsNum:J.g.isSupportSharingStereo()?2:1}}),ee.a.sharedBuffer&&ee.a.SharingAudioNode.postCMD("sharedBuffer",ee.a.sharedBuffer),Xe=new MessageChannel,ee.a.SharingAudioNode.port.postMessage({status:"encodeAudioPort"},[Xe.port1]),Kt(Xe),tr({command:"startAudioEncode",ssid:r.CaptureAudioInfo.ssrc,samplerate:this.sharingAudioCtx.sampleRate,isSharing:!0,audioMode:ee.a.audioMode,sharingEncodeChannelsNum:J.g.isSupportSharingStereo()?2:1}),yr(ee.a.e2eencrypt),Y.Start_Desktop_Audio_Capture(),e.next=655;break;case 651:e.prev=651,e.t7=e.catch(631),Ra.error(e.t7),this.JsMediaSDK_Log(e.t7);case 655:return ee.a.DesktopAudioStatus=ie.a.DesktopAudio_Connected,ee.a.Notify_APPUI(P.Vb,null),e.abrupt("break",906);case 658:if(ee.a.DesktopAudioStatus===ie.a.DesktopAudio_Connected){e.next=661;break}return ee.a.Notify_APPUI(P.Zb,null),e.abrupt("return");case 661:J.g.isSupportChromeWideAEC()&&this.audioDomNode&&(ee.a.AudioNode.disconnect(),this.CloseBoringPeerConnection(),this.audioDomNode=null,Je="default"==wa.speakerId?"":wa.speakerId,ee.a.AudioNode.connect(this.audioCtx.destination),Ye=Date.now(),this.audioCtx.setSinkId(Je).then((function(){wa.sendSpeakerDevice(Date.now()-Ye,!0)})).catch((function(e){re.add_monitor("AODF"),wa.sendSpeakerDevice(Date.now()-Ye,!1),ee.a.Notify_APPUI(P.v,null)}))),Ze=!1,r&&r.isPause&&(Ze=!0),this.audioEncodeRingBufferConsumer&&this.audioEncodeRingBufferConsumer.cancelConsume(),this.Remove_Sharing_Audio_Capture(),Ze||this.EndDesktopAudioMediaStream();try{ee.a.SharingAudioNode&&(ee.a.SharingAudioNode.postCMD("stopWorklet",!0),ee.a.SharingAudioNode.port=null,ee.a.SharingAudioNode.disconnect(),ee.a.SharingAudioNode=null)}catch(e){Ra("SharingAudioNode.port",e)}return this.sharingAudioCtx&&(this.sharingAudioCtx.close(),this.isSharingCaptureNodeConnect=!1),this.sharingAudioCtx=null,ee.a.DesktopAudioStatus=ie.a.DesktopAudio_Null,ee.a.Notify_APPUI(P.Zb,null),e.abrupt("break",906);case 673:return Ra("sdk start remote control 1"),$e=this.sharingWidthAndHeightInfo,et=new zr.a(Object.assign({dom:document},r)),this.remoteControl=et,Ra("sharingInfo",$e),et.setDstWidthAndHeight($e.logicWidth,$e.logicHeight),et.setSrcWidthAndHeight($e.logicWidth,$e.logicHeight),et.setSrcScaleWidthAndHeight(r.scaleWidth,r.scaleHeight),et.setSrcOffsetXY(r.srcOffsetX,r.srcOffsetY),et.setRemoteOS(r.os),e.abrupt("return",et.start().then((function(e){return ee.a.Notify_APPUI(e?P.fd:P.ed),e&&(et.onPasteTextLengthOverflow((function(){ee.a.Notify_APPUI(P.yc)})),et.onReturnCopiedText((function(e){Ra(e),ee.a.Notify_APPUI(P.xc,e)}))),e})).catch((function(e){return Ra(e),ee.a.Notify_APPUI(P.ed),Z.a.error("An error occurred when trying to start remote control",e),re.add_monitor("RMCTF"),Promise.reject(e)})));case 685:return e.abrupt("return",this.remoteControl.destroy().then((function(e){return ee.a.Notify_APPUI(e?P.S:P.R),e})));case 687:return this.remoteControl&&(r.scaleWidth&&r.scaleHeight&&this.remoteControl.setSrcScaleWidthAndHeight(r.scaleWidth,r.scaleHeight),(Zr()(r.srcOffsetX)||Zr()(r.srcOffsetY))&&this.remoteControl.setSrcOffsetXYAndSendPDU(r.srcOffsetX,r.srcOffsetY),Jr()(r.isControllerNow)&&this.remoteControl.setIsControlerNow(r.isControllerNow),Zr()(r.os)&&this.remoteControl.setRemoteOS(r.os)),e.abrupt("break",906);case 689:return this.remoteControl&&this.remoteControl.sendPostionPDU(),e.abrupt("break",906);case 691:if(this.flipSend=!0,this.canISendNextSharingFrame=!0,r.mode?this.isSharingSupportImageCapture=J.g.isSupportImageCapture():this.isSharingSupportImageCapture=!1,this.isStartDesktopSharing){e.next=704;break}vr(ee.a.e2eencrypt),this.isStartDesktopSharing=!0,this.desktopSharingSend=!0,r.canvas&&(r.rendercanvasID=r.canvas),this.isSupportSharingTrackReader||this.isSupportMediaStreamTrackProcessor?r.video=J.g.getDocumentHandle(r.canvas):(r.video=J.g.getDocumentHandle(r.video),r.canvas=J.g.getDocumentHandle(r.canvas)),this.desktopSharingValue=r,this.Start_Desktop_Sharing(),e.next=705;break;case 704:return e.abrupt("return");case 705:return e.abrupt("break",906);case 706:if(this.flipSend=!0,this.canISendNextSharingFrame=!0,ee.a.shareSystemAudio=!1,this.sharingTrackReader)try{this.sharingTrackReader.stop()}catch(e){}if(!this.isStartDesktopSharing){e.next=716;break}this.desktopSharingSend=!1,this.StopSharingCapture(),this.isSupportVideoShare?gr({command:"stopsharing"}):Sr({command:"stopsharing"}),e.next=717;break;case 716:return e.abrupt("return");case 717:return e.abrupt("break",906);case 718:if(this.flipSend=!0,this.canISendNextSharingFrame=!1,!this.isStartDesktopSharing){e.next=725;break}this.desktopSharingSend=!1,this.isSupportVideoShare?gr({command:"pause"}):Sr({command:"pause"}),e.next=726;break;case 725:return e.abrupt("return");case 726:return e.abrupt("break",906);case 727:if(this.flipSend=!0,this.canISendNextSharingFrame=!0,!this.isStartDesktopSharing){e.next=735;break}this.desktopSharingSend=!0,this.isSupportMediaStreamTrackProcessor||this.isSupportSharingTrackReader||this.Process_Sharing(),this.isSupportVideoShare?gr({command:"resume"}):Sr({command:"resume"}),e.next=736;break;case 735:return e.abrupt("return");case 736:return e.abrupt("break",906);case 737:if(window.WebQrscanner){e.next=740;break}return console.error("qrScanner not loaded"),e.abrupt("return");case 740:return r.enable&&this.desktopSharingMediaStram?WebQrscanner.qrScanner.start(this.desktopSharingValue.video,(function(e){ee.a.Notify_APPUI_SAFE(P.Gc,e)})):WebQrscanner.qrScanner.stop(),e.abrupt("break",906);case 742:if(this.isStartWhiteboardSharing=!0,r.canvas&&(r.rendercanvasID=r.canvas),this.isStartDesktopSharing){e.next=753;break}vr(ee.a.e2eencrypt),r.video=r.canvas=J.g.getDocumentHandle(r.canvas),this.isStartDesktopSharing=!0,this.desktopSharingSend=!0,this.desktopSharingValue=r,this.Start_Whiteboard_Sharing(),e.next=754;break;case 753:return e.abrupt("return");case 754:return e.abrupt("break",906);case 755:if(this.isStartWhiteboardSharing=!1,!this.isStartDesktopSharing){e.next=762;break}this.desktopSharingSend=!1,this.isStartDesktopSharing=!1,Sr({command:"stopsharing"}),e.next=763;break;case 762:return e.abrupt("return");case 763:return e.abrupt("break",906);case 764:return(tt=document.createElement("img")).src="chrome-extension://kgjfgplpablkjnlkjmjdecgdpfankdle/images/trash.png",tt.onload=function(){ee.a.Notify_APPUI(P.db,!0)},tt.onerror=function(){ee.a.Notify_APPUI(P.db,!1)},e.abrupt("break",906);case 770:if(r.evt!==P.hf&&r.evt!==P.ef){e.next=783;break}if(Ra("rwg answer from ui",r),r.answer){e.next=774;break}return e.abrupt("return");case 774:e.t8=r.answer.type,e.next=e.t8===ie.h.ZOOM_CONNECTION_VIDEO?777:e.t8===ie.h.ZOOM_CONNECTION_AUDIO?779:781;break;case 777:return $.a.trigger(P.vc.ZOOM_CONNECTION_VIDEO_OFFER_RESPONSE_EVT,r),e.abrupt("break",781);case 779:return $.a.trigger(P.vc.ZOOM_CONNECTION_AUDIO_OFFER_RESPONSE_EVT,r),e.abrupt("break",781);case 781:e.next=784;break;case 783:r.evt===P.bf&&r.body&&r.body.token&&$.a.trigger(P.vc.AUDIO_BRIDGE_WS_TOKEN,r.body.token);case 784:return e.abrupt("break",906);case 785:if(ve(r.userList),this.setvideokk||!r.encryptKey){e.next=792;break}return this.setvideokk=!0,e.next=790,Dr(ie.f.VIDEO_DECODE,{KK:r.encryptKey},"MAIN_KK",!1,!0);case 790:return e.next=792,Dr(ie.f.VIDEO_ENCODE,{KK:r.encryptKey},"MAIN_KK",!1,!0);case 792:return e.abrupt("break",906);case 793:return or(r.mute),e.abrupt("break",906);case 795:return nr(r.lang),e.abrupt("break",906);case 797:return sr(r.interpreterList),e.abrupt("break",906);case 799:return ir(r.enable),e.abrupt("break",906);case 801:if(!r.enable||!this.isEnableVideoDecodeHardWareThread){e.next=810;break}if(null===this.videodecodehardwareflag){e.next=806;break}r.enable=this.videodecodehardwareflag,e.next=810;break;case 806:return e.next=808,J.g.IsSupportVideoDecodeHardwareAcceleration();case 808:this.videodecodehardwareflag=e.sent,r.enable=this.videodecodehardwareflag;case 810:return Xt({command:"hwstatus",enable:r.enable}),e.abrupt("break",906);case 812:return r.enable&&this.videoencodehardwareflag&&!this.isAppleGraphic?r.enable=!0:r.enable=!1,Qt({command:"hwstatus",enable:r.enable}),e.abrupt("break",906);case 814:return re.add_monitor("NoVideoHD"),!r.videohd&&this.videoencodehardwareflag&&(J.g.set720pcapacity(!1),re.add_monitor("CAPTURE720:"+!1),Qt({command:"videohd",videohd:r.videohd})),e.abrupt("break",906);case 817:return rr({command:"setShareVolumeLevel",userid:r.userid,shareVolume:r.shareVolume,isFromMainSession:r.isFromMainSession}),e.abrupt("break",906);case 819:return r.mediaActionType==P.jf.SHARING_DECODE&&(this.isSupportVideoShare?Zt({command:"USER_NODE_LIST_IN_MAIN_SESSION",data:r}):$t({command:"USER_NODE_LIST_IN_MAIN_SESSION",data:r})),r.mediaActionType==P.jf.SHARING_ENCODE&&(this.isSupportVideoShare?_r({command:"USER_NODE_LIST_IN_MAIN_SESSION",data:r}):Cr({command:"USER_NODE_LIST_IN_MAIN_SESSION",data:r})),r.mediaActionType==P.jf.AUDIO_DECODE&&Dr(ie.f.AUDIO_DECODE,r,"USER_NODE_LIST_IN_MAIN_SESSION",!1,!0),e.abrupt("break",906);case 823:return r.mediaActionType==P.jf.SHARING_DECODE&&(this.isSupportVideoShare?Zt({command:"UPDATE_MEDIA_PARAMS",data:r}):$t({command:"UPDATE_MEDIA_PARAMS",data:r})),r.mediaActionType==P.jf.SHARING_ENCODE&&(this.isSupportVideoShare?_r({command:"UPDATE_MEDIA_PARAMS",data:r}):Cr({command:"UPDATE_MEDIA_PARAMS",data:r})),r.mediaActionType==P.jf.AUDIO_DECODE&&rr({command:"UPDATE_MEDIA_PARAMS",data:r}),e.abrupt("break",906);case 827:return this.isSupportVideoShare?Zt({command:"SHARING_ADD_REV_CHANNEL_TYPE",data:r}):$t({command:"SHARING_ADD_REV_CHANNEL_TYPE",data:r}),e.abrupt("break",906);case 829:return this.isSupportVideoShare?Zt({command:"SHARING_REMOVE_REV_CHANNEL_TYPE",data:r}):$t({command:"SHARING_REMOVE_REV_CHANNEL_TYPE",data:r}),e.abrupt("break",906);case 831:return this.isSupportVideoShare?Zt({command:"BUILD_MS_CHANNEL_IN_BO",data:r}):$t({command:"BUILD_MS_CHANNEL_IN_BO",data:r}),e.abrupt("break",906);case 833:return(rt=r.type)?rt===ie.b.VIDEO?this.SWITCH_VIDEO_WATER_MARK(r):rt===ie.b.SHARING&&this.SWITCH_SHARING_WATER_MARK(r):(this.SWITCH_VIDEO_WATER_MARK(r),this.SWITCH_SHARING_WATER_MARK(r)),e.abrupt("break",906);case 836:return ar(r.lang),e.abrupt("break",906);case 838:return rr({command:"BUILD_MA_CHANNEL_IN_BO",data:r}),e.abrupt("break",906);case 840:return tr({command:"ENABLE_SHARE_TO_BO",data:r.enable}),e.abrupt("break",906);case 842:return tr({command:"ENABLE_BROADCAST_TO_BO",data:r.enable}),e.abrupt("break",906);case 844:if(it=document.getElementById(r.canvasId)){e.next=847;break}return e.abrupt("return");case 847:if(at=null,nt=this.replaceCanvasMap.videoDecodeCanvasIds&&-1!==this.replaceCanvasMap.videoDecodeCanvasIds.indexOf(r.canvasId),ot=this.replaceCanvasMap.videoEncodeCanvasIds&&-1!==this.replaceCanvasMap.videoEncodeCanvasIds.indexOf(r.canvasId),r.canvasId===this.replaceCanvasMap.videoMaskSettingCanvasId?at=ee.a.localVideoEncMGR:r.canvasId===this.replaceCanvasMap.sharingMainCanvasId?at=ee.a.localSharingDecMGR:r.canvasId===this.replaceCanvasMap.sharingPreviewCanvasId?at=ee.a.localSharingEncMGR:(ot||nt)&&(at=ot?ee.a.localVideoEncMGR:ee.a.localVideoDecMGR,this.lazyReplaceEncodeCanvasTimer&&(clearTimeout(this.lazyReplaceEncodeCanvasTimer),this.lazyReplaceEncodeCanvasTimer=null),this.lazyReplaceEncodeCanvasTimer=setTimeout((function(){var e=ee.a.localVideoEncMGR;if(e){var t=e.map.get(ee.a.SPECIAL_ID);t&&t.postMessage({command:"WEBGL_LOST_REPLACE_CANVAS"})}var r=ee.a.localSharingEncMGR;if(r){var i=r.map.get(ee.a.SPECIAL_ID);i&&i.postMessage({command:"WEBGL_LOST_REPLACE_CANVAS"})}if(ct.videoCaptureHiddenCanvas){var a=ct.videoCaptureHiddenCanvas,n=a.width,o=a.height;J.g.isSupport2dOffscreenCanvas()?ct.videoCaptureHiddenCanvas=new OffscreenCanvas(n,o):(ct.videoCaptureHiddenCanvas=document.createElement("canvas"),ct.videoCaptureHiddenCanvas.width=n,ct.videoCaptureHiddenCanvas.height=o),ct.videoCaptureHiddenCanvasCtx=ct.videoCaptureHiddenCanvas.getContext("2d")}if(ct.bgCanvas){var s=ct.bgCanvas,u=s.width,d=s.height;ct.bgCanvas=document.createElement("canvas"),ct.bgCanvas.width=u,ct.bgCanvas.height=d,ct.bgCanvasctx=ct.bgCanvas.getContext("2d"),!ct.VideoMaskSettingCanvas&&ct.PrevVideoMaskSettingCanvas?(ct.VideoMaskSettingCanvas=ct.PrevVideoMaskSettingCanvas,ct.Update_Mask_Texture(ct.maskCoordinate,ct.videoCaptureHiddenCanvas.width,ct.videoCaptureHiddenCanvas.height),ct.VideoMaskSettingCanvas=null):ct.Update_Mask_Texture(ct.maskCoordinate,ct.videoCaptureHiddenCanvas.width,ct.videoCaptureHiddenCanvas.height)}}),500)),at)try{st=it.transferControlToOffscreen(),(ut=at.map.get(ee.a.SPECIAL_ID))&&ut.postMessage({command:"WEBGL_LOST_REPLACE_CANVAS",data:{canvasId:r.canvasId,canvas:st}},[st])}catch(e){}return e.abrupt("break",906);case 853:if(this.enableHID=r.enable,!r.enable){e.next=865;break}if(!this.hidAvalible){e.next=859;break}return e.next=858,aa.destroy();case 858:this.hidAvalible=!1;case 859:if(!r.microphoneLabel){e.next=863;break}return e.next=862,aa.init(r.microphoneLabel,r.defaultMuted);case 862:this.hidAvalible=e.sent;case 863:e.next=869;break;case 865:if(!this.hidAvalible){e.next=869;break}return e.next=868,aa.destroy();case 868:this.hidAvalible=!1;case 869:return e.abrupt("break",906);case 870:return Xt({command:"ENABLE_VIDEO_OBSERVER",data:r.enable,enablefps:!r.fpsdisbale}),e.abrupt("break",906);case 872:return Qt({command:"SWITCH_SHARING_TYPE",data:r.mode}),e.abrupt("break",906);case 874:return this.useAudioBridge&&this.audioBridge&&this.audioBridge.setSpeechVolumeLevel(r.userId,r.volume),r.issiphone||(ee.a.decoderinworklet?ee.a.AudioNode&&ee.a.AudioNode.postCMD("setSpeechVolumeLevel",{userid:r.userId>>10,volume:r.volume}):rr({command:"setSpeechVolumeLevel",userid:r.userId>>10,volume:r.volume})),e.abrupt("break",906);case 877:return this.audioBridge&&this.audioBridge.updateUserMuteUnmuteStatus(r),e.abrupt("break",906);case 879:return Ma._updateVideoConstraints({advanced:[r]}),e.abrupt("break",906);case 881:return ee.a.clearMessageToRwg(),e.abrupt("break",906);case 883:return Ma.enableReuseStream(r.enable),e.abrupt("break",906);case 885:return Ma.presetConstraints(r||{}),e.abrupt("break",906);case 887:return Ma.destoryReuseStream({audio:r&&r.audio,video:r&&r.video}),e.abrupt("break",906);case 889:return dt={command:"WHITEBOARD_JOIN_MESSAGE",data:r.message,nodeId:r.nodeId,encryptKey:r.encryptKey,sn:r.sn,dcsId:r.dcsId,EncodedSn:r.EncodedSn},this.isSupportVideoShare?_r(dt):Cr(dt),e.abrupt("break",906);case 892:return this.audioBridge?this.audioBridge.stopIncomingAudio(r):ee.a.decoderinworklet?rr({command:"stop_audio_incoming",stopPlayAudio:r}):ee.a.AudioNode&&ee.a.AudioNode.postCMD("stop_audio_incoming",r),e.abrupt("break",906);case 894:return re.add_monitor("AUDIO_CODEC_MODE"+r.mode),ee.a.audioMode=r.mode,tr({command:"audioMode",mode:r.mode}),e.abrupt("break",906);case 898:if(this.isLandScape=r.isLandScape,Ma.videoStreamTrack){e.next=901;break}return e.abrupt("return");case 901:return this.isLandScape&&this.captureSize&&this.Change_Video_Capture_Resolution(this.captureSize.width,this.captureSize.height),e.abrupt("break",906);case 903:return this.localLog&&this.localLog.saveAllLogFiles(),e.abrupt("break",906);case 905:Ra("CAN NOT HANDLE THE EVENT!");case 906:case"end":return e.stop()}}),e,this,[[438,444],[467,473],[483,490],[495,601],[631,651]])}))),function(e,t){return Na.apply(this,arguments)}),SWITCH_VIDEO_WATER_MARK:function(e){var t=e.enableWaterMark,r=e.waterMarkText,i=void 0===r?"":r,a=e.watermarkOpacity,n=e.watermarkRepeated,o=e.watermarkPosition;this.isCreateVideoWaterMark=!!t,this.videoWaterMarkName=this.isCreateVideoWaterMark?i:"",this.VideoRenderObj?(t?this.isCreateVideoWaterMark&&!this.waterMarkCanvas&&(this.waterMarkCanvas=document.createElement("canvas")):this.VideoRenderObj.Set_WaterMark_Flag(t),this.VideoRenderObj.Set_WaterMark_Info({waterMarkCanvas:this.waterMarkCanvas,isCreateVideoWaterMark:this.isCreateVideoWaterMark,videoWaterMarkName:this.videoWaterMarkName,watermarkOpacity:a,watermarkRepeated:n,watermarkPosition:o})):Xt({command:"SWITCH_WATER_MARK_FLAG",isCreateVideoWaterMark:this.isCreateVideoWaterMark,videoWaterMarkName:this.videoWaterMarkName,watermarkOpacity:a,watermarkRepeated:n,watermarkPosition:o}),J.g.watermark.updateWaterMarkInfo(e)},SWITCH_SHARING_WATER_MARK:function(e){var t=e.enableWaterMark,r=e.waterMarkText,i=void 0===r?"":r,a=e.watermarkOpacity,n=e.watermarkRepeated,o=e.watermarkPosition;this.isCreateSharingWaterMark=!!t,this.sharingWaterMarkName=this.isCreateSharingWaterMark?i:"",this.SharingRenderObj?(t?this.isCreateSharingWaterMark&&!this.waterMarkCanvas&&(this.waterMarkCanvas=document.createElement("canvas")):this.SharingRenderObj.Set_WaterMark_Flag(t),this.SharingRenderObj.Set_WaterMark_Info({waterMarkCanvas:this.waterMarkCanvas,isCreateSharingWaterMark:this.isCreateSharingWaterMark,sharingWaterMarkName:this.sharingWaterMarkName,watermarkOpacity:a,watermarkRepeated:n,watermarkPosition:o})):this.isSupportVideoShare?Zt({command:"SWITCH_SHARING_WATER_MARK_FLAG",isCreateSharingWaterMark:this.isCreateSharingWaterMark,sharingWaterMarkName:this.sharingWaterMarkName,watermarkOpacity:a,watermarkRepeated:n,watermarkPosition:o}):$t({command:"SWITCH_WATER_MARK_FLAG",isCreateSharingWaterMark:this.isCreateSharingWaterMark,sharingWaterMarkName:this.sharingWaterMarkName,watermarkOpacity:a,watermarkRepeated:n,watermarkPosition:o})},JsMediaSDK_VideoRenderInterval:function(e){return this.VideoRenderObj.Start_Draw.bind(this.VideoRenderObj)(P.Jc,e)},JsMediaSDK_SharingRenderInterval:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.SharingRenderObj.No_Bindthis_Interval.bind(this.SharingRenderObj),i=setInterval(r,t?20:e);return i},getShareStreamInfo:function(){if(!this.desktopSharingMediaStram)return null;var e=this.desktopSharingMediaStram.getVideoTracks();return e.length&&e[0].getSettings&&e[0].getSettings()||null},destroy:function(){var e=this;return d()(g.a.mark((function t(){return g.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(Ra("destroy"),e.isDestroy=!0,e.EndSharingMediaStream(),Ar(),e.audioInputLevel&&(e.audioInputLevel.destroy(),e.audioInputLevel=null),e.bVideoEncodeMainThreadConsumerIntervalEnable&&e.videoEncodeRingbufferConsumer&&e.videoEncodeRingbufferConsumer.cancelConsume(),!e.WebSipClient){t.next=15;break}return t.prev=7,t.next=10,e.WebSipClient.clear();case 10:e.WebSipClient=null,t.next=15;break;case 13:t.prev=13,t.t0=t.catch(7);case 15:if(e.audioBridge&&(e.audioBridge.destroy(!1),e.audioBridge=null),!e.hidAvalible){t.next=19;break}return t.next=19,aa.destroy();case 19:e.EndMedia(),fr(),kr(),$.a.clearAllSubscriptions(),be.clear(),ee.a.destroyQueueMessageToRwg();case 25:case"end":return t.stop()}}),t,null,[[7,13]])})))()}};t.default=Ha}])}));
|
|
2
|
+
//# sourceMappingURL=https://d1cdksi819e9z7.cloudfront.net/sourcemap/js_media.min.js-448c692d743a2bd5fd37.map
|