@zoom/meetingsdk
Version:
Zoom MeetingSDK-Web Client
1 lines • 3.07 MB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).ReactWidgets=t(e.React,e.ReactDOM)}(this,function(e,t){"use strict";function n(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var o=n(e),i=n(t);function r(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t);if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,o)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach(function(t){r(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function l(e,t){if(null==e)return{};var n,o,i=function(e,t){if(null==e)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(-1!==t.indexOf(o))continue;n[o]=e[o]}return n}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o<r.length;o++)n=r[o],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var c="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function d(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var u,p={};var _=function(){if(u)return p;u=1;var e=t;return p.createRoot=e.createRoot,p.hydrateRoot=e.hydrateRoot,p}();const m=Symbol("store"),h=Symbol("getState"),g=Symbol("dispatch"),f=Symbol("additionFeatures"),v=Symbol("mediaContext");let b="";b="zoom.us";let w="";w="applications.zoom.us";const y="6.0.2",S=`https://dmogdx0jrul3u.cloudfront.net/${y}/lib/av`,C=`https://source.zoom.us/${y}/lib/av`,k=`https://jssdk.zoomus.cn/${y}/lib/av`,E=()=>b,A=()=>`https://${w}/sdkhelper/auth?sdkToken=`;function T(e,t){const n=t.match(e);return n&&n.length>0&&n[1]||""}function I(e,t){const n=t.match(e);return n&&n.length>1&&n[2]||""}const x=/version\/(\d+(\.?_?\d+)+)/i,R=[{test:[/opera/i],describe:e=>["Opera(Legacy)",T(x,e)||T(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e)]},{test:[/opr\/|opios/i],describe:e=>["Opera",T(/(?:opr|opios)[\s/](\S+)/i,e)||T(x,e)]},{test:[/SamsungBrowser/i],describe:e=>["Samsung Internet for Android",T(x,e)||T(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e)]},{test:[/micromessenger/i],describe:e=>["WeChat",T(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||T(x,e)]},{test:[/qqbrowser/i],describe:e=>[/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser",T(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||T(x,e)]},{test:[/msie|trident/i],describe:e=>["Internet Explorer",T(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e)]},{test:[/\sedg\//i],describe:e=>["Microsoft Edge",T(/\sedg\/(\d+(\.?_?\d+)+)/i,e)]},{test:[/edg([ea]|ios)/i],describe:e=>["Microsoft Edge(Legacy)",I(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e)]},{test:[/firefox|iceweasel|fxios/i],describe:e=>["Firefox",T(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e)]},{test:[/electron/i],describe:e=>["Electron",T(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e)]},{test:[/chromium/i],describe:e=>["Chromium",T(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||T(x,e)]},{test:[/chrome|crios|crmo/i],describe:e=>["Chrome",T(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e)]},{test:e=>!/like android/i.test(e)&&/android/i.test(e),describe:e=>["Android Browser",T(x,e)]},{test:[/safari|applewebkit/i],describe:e=>["Safari",T(x,e)]}],O=[{test:e=>{const t=e.match(/OpenHarmony (\d+\.?\d*)/);return(null==t?void 0:t.length)&&Number(t[1])>=5},describe:e=>["HarmonyOS",T(/OpenHarmony (\d+\.?\d*)/i,e)]},{test:[/windows /i],describe:e=>["Windows",T(/Windows ((NT|XP)( \d\d?.\d)?)/i,e)]},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:e=>["iOS",I(/(Version\/)(\d[\d.]+)/,e)]},{test:[/macintosh/i],describe:e=>["macOS",T(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,".")]},{test:[/(ipod|iphone|ipad)/i],describe:e=>["iOS",T(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".")]},{test:e=>!/like android/i.test(e)&&/android/i.test(e),describe:e=>["Android",T(/android[\s/-](\d+(\.\d+)*)/i,e)]},{test:[/linux/i],describe:()=>["Linux"]},{test:[/CrOS/],describe:()=>["Chrome OS"]}],P=new class{constructor(){this._browser=void 0,this._os=void 0,this._browserVersion=void 0,this._osVersion=void 0,this._clientHintsData=void 0,this._mediaFeatureOptions=void 0,"userAgentData"in navigator&&navigator.userAgentData.getHighEntropyValues(["architecture","bitness","formFactor","model","platformVersion","wow64"]).then(e=>{this._clientHintsData=e,this._os&&this._osVersion&&this._clientHintsData.platform&&this._clientHintsData.platformVersion&&(this._os=this._clientHintsData.platform,this._osVersion=this._clientHintsData.platformVersion)}).catch(e=>{console.warn(e)})}_getBrowserVersion(){var e;if(null!==(e=this._clientHintsData)&&void 0!==e&&null!==(e=e.brands)&&void 0!==e&&e.length){const e=this._clientHintsData.brands.filter(e=>!/(Chromium|Not.*Brand)/i.test(e.brand))[0];e&&(this._browser=e.brand);const t=this._clientHintsData.brands.find(e=>{var t;return"chromium"===(null===(t=e.brand)||void 0===t?void 0:t.toLowerCase())});t?(this._browserVersion=t.version,this._browser||(this._browser=t.brand)):this._browserVersion=e.version}else{const e=navigator.userAgent,t=R.find(t=>"function"==typeof t.test?t.test(e):t.test.some(t=>t.test(e)));if(t){const n=t.describe(e);this._browser=n[0],this._browserVersion=n[1],this.isIOSMobile&&(this._browser="ios-safari")}else this._browser="unknown",this._browserVersion="0"}}_getOSVersion(){var e,t;if(null!==(e=this._clientHintsData)&&void 0!==e&&e.platform&&null!==(t=this._clientHintsData)&&void 0!==t&&t.platformVersion)this._os=this._clientHintsData.platform,this._osVersion=this._clientHintsData.platformVersion;else{const e=navigator.userAgent,t=O.find(t=>"function"==typeof t.test?t.test(e):t.test.some(t=>t.test(e)));if(t){const n=t.describe(e);this._os=n[0],this._osVersion=n[1]}else this._os="unknown",this._osVersion="0"}}get browser(){return this._browser||this._getBrowserVersion(),this._browser}get browserVersion(){return this._browserVersion||this._getBrowserVersion(),this._browserVersion}get os(){return this._os||this._getOSVersion(),this._os}get osVersion(){return this._osVersion||this._getOSVersion(),this._osVersion}get isIE(){return"Internet Explorer"===this.browser}get isLegacyEdge(){return"Microsoft Edge(Legacy)"===this.browser}get isLegacyOpera(){return"Opera(Legacy)"===this.browser}get isFirefox(){return"Firefox"===this.browser}get isSafari(){return"Safari"===this.browser}get isChrome(){var e,t;if(null!==(e=this._clientHintsData)&&void 0!==e&&null!==(e=e.brands)&&void 0!==e&&e.length)return null===(t=this._clientHintsData)||void 0===t?void 0:t.brands.some(e=>{var t;return"chromium"===(null===(t=e.brand)||void 0===t?void 0:t.toLocaleLowerCase())});const{userAgent:n}=navigator;return!this.isLegacyOpera&&!this.isLegacyEdge&&/chrome/i.test(n)&&/webkit/i.test(n)}get isLegacyChrome(){var e;return this.isChrome&&"function"!=typeof(null===(e=navigator.mediaDevices)||void 0===e?void 0:e.getDisplayMedia)}get isMacOS(){return"macOS"===this.os}get isIPad(){var e;return/iPad/i.test(navigator.userAgent)||this.isMacOS&&(null===(e=navigator)||void 0===e?void 0:e.maxTouchPoints)>2}get isHarmonyOS(){return"HarmonyOS"===this.os}get isIOSMobile(){return"iOS"===this.os||this.isIPad}get architecture(){var e,t;return null!==(e=null===(t=this._clientHintsData)||void 0===t?void 0:t.architecture)&&void 0!==e?e:""}get isArm(){return this.architecture?"arm"===this.architecture:/arm/i.test(navigator.userAgent)}get isChromeOS(){return"Chrome OS"===this.os}get isAndroidBrowser(){var e;return"android"===(null===(e=this.os)||void 0===e?void 0:e.toLowerCase())}get isArmChromeOS(){return this.isArm&&this.isChromeOS}get isAndroidOrIOSBrowser(){return this.isAndroidBrowser||this.isIOSMobile}get isSupportEssentialAudioAndVideoAbility(){return"object"==typeof WebAssembly&&"function"==typeof Worker}get isSupportAudioWorklet(){return"function"==typeof AudioWorklet}get isSupportImageCapture(){return"ImageCapture"in window}get isSupportMediaStreamTrackProcessor(){var e;return this._mediaFeatureOptions?!(null===(e=window.JsMediaSDK_Instance)||void 0===e||null===(e=e.util)||void 0===e||!e.isSupportMediaStreamTrackProcessor(this._mediaFeatureOptions)):"MediaStreamTrackProcessor"in window}get isSupportOffscreenCanvas(){var e;return null===(e=window.JsMediaSDK_Instance)||void 0===e||null===(e=e.util)||void 0===e?void 0:e.isSupportOffscreenCanvas()}get gpu(){var e;return this.isSupportOffscreenCanvas?null===(e=window.JsMediaSDK_Instance)||void 0===e||null===(e=e.util)||void 0===e||null===(e=e.getGpuInfo())||void 0===e?void 0:e.renderInfo:""}get bitness(){var e,t;return null!==(e=null===(t=this._clientHintsData)||void 0===t?void 0:t.bitness)&&void 0!==e?e:""}get model(){var e,t;return null!==(e=null===(t=this._clientHintsData)||void 0===t?void 0:t.model)&&void 0!==e?e:""}get wow64(){var e;if("windows"===this.os.toLowerCase())return null===(e=this._clientHintsData)||void 0===e?void 0:e.wow64}get isSupportSendScreenSharing(){return"getDisplayMedia"in navigator.mediaDevices&&"function"==typeof navigator.mediaDevices.getDisplayMedia}get isSupportSharedArrayBuffer(){return"function"==typeof SharedArrayBuffer}get is32bitChrome(){var e;return!(null===(e=window.JsMediaSDK_Instance)||void 0===e||null===(e=e.util)||void 0===e||!e.is32bitBrowser())}get isSwiftShader(){var e;return!(null===(e=window.JsMediaSDK_Instance)||void 0===e||null===(e=e.util)||void 0===e||!e.isUsingSwiftShader())}set mediaFeatureOptions(e){this._mediaFeatureOptions=e}get isWeakRefSupported(){return"undefined"!=typeof WeakRef}get isSupportESModule(){return"noModule"in document.createElement("script")}};function M(){var e;const{isAndroidBrowser:t,isIOSMobile:n,osVersion:o,browserVersion:i,isChrome:r,isFirefox:a,isSafari:s}=P;var l,c;if(n)return Number(null===(l=o.match(/^\d+/))||void 0===l?void 0:l[0])>=15;if(t)return Number(null===(c=o.match(/^\d+/))||void 0===c?void 0:c[0])>=10;const d=Number(null===(e=i.match(/^\d+/))||void 0===e?void 0:e[0]);return!!(r&&d>=69)||!!(s&&d>14)||!!(a&&d>=76)}function j(){const{isSupportAudioWorklet:e,isSupportEssentialAudioAndVideoAbility:t,isAndroidOrIOSBrowser:n,isSupportSendScreenSharing:o}=P,i=void 0!==navigator.mediaDevices&&(t&&e||n),r=t&&void 0!==navigator.mediaDevices&&void 0!==navigator.mediaCapabilities,a="function"==typeof"".replaceAll;return{audio:a&&i,video:a&&r,screen:a&&t&&o}}class D{constructor(e){this.instant=void 0,this.context=void 0,this.script=void 0,this.mic=void 0,this.instant=0,this.context=e,this.mic=null,this.script=e.createScriptProcessor(2048,1,1),this.script.onaudioprocess=e=>{const t=e.inputBuffer.getChannelData(0);let n,o=0;for(n=0;n<t.length;++n)o+=t[n]*t[n];this.instant=Math.sqrt(o/t.length)}}connectToSource(e){console.log("InputMicDetector is listening");try{var t;this.mic=this.context.createMediaStreamSource(e),this.mic.connect(this.script),null===(t=this.script)||void 0===t||t.connect(this.context.destination)}catch(e){console.error(e)}}stop(){var e,t;console.log("Audio Previewer stopped"),null===(e=this.mic)||void 0===e||e.disconnect(),this.mic=null,null===(t=this.script)||void 0===t||t.disconnect(),this.script=null}getMicVolume(){return this.instant}}const N="https://st1.zoom.us/web_client/4qu8baa/audio/ring.mp3";class L{constructor(){this.sampleAudio=void 0,this.audioCtx=void 0,this.destinationNode=void 0,this.audioPlayer=void 0,this.analyzserInterval=void 0,this.analyserNode=void 0,this.analyserNodeBufferDataArray=void 0,this.analyserCallback=void 0,this.sourceNode=void 0,this.mAudioStream=void 0,this.mSourceNode=void 0,this.mediaRecorder=void 0,this.isRecording=void 0,this.recorderChunks=[],this.recorderObjUrl=void 0,this.recorderPlayer=void 0,this.maximumRecordingTimer=void 0,this.shouldPlayAfterRecording=!0,this.isRunning=!1}testSpeaker(e){var t;if("function"!=typeof AudioContext||"function"!=typeof MediaStreamAudioDestinationNode||!AudioContext.prototype.decodeAudioData)return void console.warn("Cannot test the speaker due to the browser capability");const{speakerId:n,sampleAudioUrl:o=N,onAnalyseFrequency:i}=e||{};if(this.isRunning)return void console.warn("A tester is running,please stop it first");this.isRunning=!0,this.initAudioContext(),((null===(t=this.sampleAudio)||void 0===t?void 0:t.url)===o&&this.sampleAudio.data?Promise.resolve(this.sampleAudio.data):window.fetch(o).then(e=>e.arrayBuffer()).then(e=>this.audioCtx.decodeAudioData(e)).then(e=>(this.sampleAudio={url:o,data:e},e))).then(e=>{var t,o,r;this.sourceNode=this.audioCtx.createBufferSource(),this.sourceNode.buffer=e,this.sourceNode.loop=!0,n&&null!==(t=this.audioPlayer)&&void 0!==t&&t.setSinkId&&this.audioPlayer.setSinkId(n),i?"function"==typeof AudioContext.prototype.createAnalyser?(this.analyzserInterval&&window.clearInterval(this.analyzserInterval),this.analyserCallback=i,this.initAnalyserNode(),this.analyserNode&&this.sourceNode.connect(this.analyserNode)):(this.sourceNode.connect(this.destinationNode),console.warn("Cannot analyze the stream due to the browser capability")):(this.analyserCallback=void 0,this.sourceNode.connect(this.destinationNode)),this.sourceNode.start(0),"running"!==(null===(o=this.audioCtx)||void 0===o?void 0:o.state)&&(null===(r=this.audioCtx)||void 0===r||r.resume()),this.audioPlayer&&(this.audioPlayer.muted=!1,this.audioPlayer.currentTime=0,this.audioPlayer.play())});const r=()=>{this.isRunning=!1,this.audioPlayer&&(this.audioPlayer.currentTime=0,this.audioPlayer.pause()),this.analyserNode&&this.analyzserInterval&&(window.clearInterval(this.analyzserInterval),this.analyzserInterval=void 0,this.analyserNodeBufferDataArray=void 0),this.sourceNode&&(this.sourceNode.stop(0),this.sourceNode.disconnect(),this.sourceNode.buffer=null,this.sourceNode=void 0)};return{stop:r,destroy:()=>{var e;r(),this.analyserNode&&this.destinationNode&&(this.analyserNode.disconnect(this.destinationNode),this.analyserNode=void 0),null===(e=this.audioCtx)||void 0===e||e.close(),this.audioCtx=void 0}}}testMicrophone(e){var t;if("function"!=typeof AudioContext||"function"!=typeof MediaStreamAudioDestinationNode||"function"!=typeof AudioContext.prototype.createMediaStreamSource||"function"!=typeof(null===(t=navigator.mediaDevices)||void 0===t?void 0:t.getUserMedia))return void console.warn("Cannot test the microphone due to the browser capability");const{microphoneId:n,speakerId:o,recordAndPlay:i,maxRecordDuration:r,onAnalyseFrequency:a,onStartRecording:s,onStopRecording:l,onStartPlayRecording:c,onStopPlayRecording:d}=e||{};if(this.isRunning)return void console.warn("A tester is running,please stop it first");this.isRunning=!0,this.initAudioContext();const u=()=>{i&&this.mediaRecorder&&this.isRecording&&(this.shouldPlayAfterRecording=!0,"inactive"!==this.mediaRecorder.state&&this.mediaRecorder.stop())};window.navigator.mediaDevices.getUserMedia({audio:!n||{deviceId:{exact:n}}}).then(e=>{var t,n,p,_;this.mAudioStream=e,this.mSourceNode=null===(t=this.audioCtx)||void 0===t?void 0:t.createMediaStreamSource(e),this.audioPlayer.muted=!0,a?(this.analyzserInterval&&window.clearInterval(this.analyzserInterval),this.analyserCallback=a,this.initAnalyserNode(),this.analyserNode&&(null===(p=this.mSourceNode)||void 0===p||p.connect(this.analyserNode))):this.analyserCallback=void 0,i&&("function"==typeof MediaRecorder?(this.recorderObjUrl&&window.URL.revokeObjectURL(this.recorderObjUrl),this.mediaRecorder=new MediaRecorder(this.mAudioStream),this.mediaRecorder.ondataavailable=e=>{e.data&&this.recorderChunks.push(e.data)},this.mediaRecorder.onstop=()=>{if(this.isRecording=!1,this.maximumRecordingTimer&&(window.clearTimeout(this.maximumRecordingTimer),this.maximumRecordingTimer=void 0),null==l||l(),this.recorderChunks.length>0){var e;const t=new Blob(this.recorderChunks,{type:(null===(e=this.recorderChunks[0])||void 0===e?void 0:e.type)||"audio/ogg; codecs=opus"});this.recorderObjUrl=window.URL.createObjectURL(t),this.shouldPlayAfterRecording&&this.playRecording(this.recorderObjUrl,o,c,d).catch(e=>{this.analyzserInterval&&(window.clearInterval(this.analyzserInterval),this.analyzserInterval=void 0,this.analyserNodeBufferDataArray=void 0),console.warn(e)}),this.recorderChunks=[],this.mediaRecorder&&(this.mediaRecorder.ondataavailable=null,this.mediaRecorder.onstop=null,this.mediaRecorder=void 0)}},this.mediaRecorder.start(),this.isRecording=!0,null==s||s(),this.maximumRecordingTimer=window.setTimeout(()=>{u()},r||1e4)):console.warn("Cannot record the sound due to the browser capability")),"running"!==(null===(n=this.audioCtx)||void 0===n?void 0:n.state)&&(null===(_=this.audioCtx)||void 0===_||_.resume()),this.audioPlayer&&(this.audioPlayer.currentTime=0,this.audioPlayer.play())});const p=()=>{this.isRunning=!1,this.maximumRecordingTimer&&(window.clearTimeout(this.maximumRecordingTimer),this.maximumRecordingTimer=void 0),this.audioPlayer&&(this.audioPlayer.currentTime=0,this.audioPlayer.pause()),this.analyserNode&&this.analyzserInterval&&(window.clearInterval(this.analyzserInterval),this.analyzserInterval=void 0,this.analyserNodeBufferDataArray=void 0),this.mSourceNode&&(a&&this.analyserNode&&this.mSourceNode.disconnect(this.analyserNode),this.mSourceNode=void 0),this.mAudioStream&&(this.mAudioStream.getAudioTracks().forEach(e=>{e.stop()}),this.mAudioStream=void 0),this.mediaRecorder&&(this.shouldPlayAfterRecording=!1,this.mediaRecorder.ondataavailable=null,this.mediaRecorder.onstop=null,"inactive"!==this.mediaRecorder.state&&this.mediaRecorder.stop(),this.isRecording=!1,this.mediaRecorder=void 0,this.recorderChunks=[]),this.recorderPlayer&&(this.recorderPlayer.currentTime=0,this.recorderPlayer.pause())};return{stop:p,stopRecording:u,destroy:()=>{var e;p(),this.analyserNode&&this.destinationNode&&(this.analyserNode.disconnect(this.destinationNode),this.analyserNode=void 0),null===(e=this.audioCtx)||void 0===e||e.close(),this.audioCtx=void 0}}}initAudioContext(){this.audioCtx&&this.audioPlayer||(this.audioCtx=new AudioContext,this.destinationNode=new MediaStreamAudioDestinationNode(this.audioCtx),this.audioPlayer=new Audio,this.audioPlayer.loop=!0,this.audioPlayer.srcObject=this.destinationNode.stream)}initAnalyserNode(){if(!this.audioCtx)return;this.analyserNode||(this.analyserNode=this.audioCtx.createAnalyser(),this.analyserNode.connect(this.destinationNode),this.analyserNode.fftSize=1024);const e=this.analyserNode.frequencyBinCount;this.analyserNodeBufferDataArray=new Uint8Array(e),this.analyzserInterval=window.setInterval(this.audioAnalyserCallback.bind(this),20)}audioAnalyserCallback(){if(this.analyserNodeBufferDataArray&&this.analyserNode&&this.analyserCallback){this.analyserNode.getByteFrequencyData(this.analyserNodeBufferDataArray);let e=0;for(const t of this.analyserNodeBufferDataArray)e+=t;const t=e/this.analyserNodeBufferDataArray.length;this.analyserCallback(t)}}playRecording(e,t,n,o){this.recorderPlayer=new Audio,this.recorderPlayer.src=e,this.recorderPlayer.currentTime=0,this.recorderPlayer.setSinkId&&t&&this.recorderPlayer.setSinkId(t);const i=()=>{null==o||o(),this.recorderPlayer&&(this.recorderPlayer.onpause=null,this.recorderPlayer.onended=null,this.recorderPlayer=void 0,this.isRunning=!1)};return new Promise((e,t)=>{this.recorderPlayer&&(this.recorderPlayer.onpause=()=>{e(!0)},this.recorderPlayer.onended=()=>{e(!0)},this.recorderPlayer.onerror=t,null==n||n(),this.recorderPlayer.play().catch(t))}).finally(()=>{window.URL.revokeObjectURL(e),i()})}}const z="AudioNotStartedError";class V{constructor(e=""){this.audioContext=void 0,this.inputMicDetector=void 0,this.isMicUnmuted=void 0,this.isAudioStarted=void 0,this.audioStream=void 0,this.deviceId=void 0,this.tester=void 0,this.audioContext=null,this.inputMicDetector=null,this.isMicUnmuted=!1,this.isAudioStarted=!1,this.audioStream=null,this.deviceId=e,this.tester=new L}async start(){if(this.audioStream||this.isAudioStarted)throw new Error("AudioAlreadyStartedError");try{const e=await navigator.mediaDevices.getUserMedia(this.getAudioConstraints());this.audioStream=e,this.isAudioStarted=!0}catch(e){throw e}}async unmute(){if(!this.audioStream||!this.isAudioStarted)throw new Error(z);if(this.isMicUnmuted)throw new Error("AudioAlreadyUnmutedError");return this.toggleMicIsMuted(!0)}async mute(){if(!this.audioStream||!this.isAudioStarted)throw new Error(z);if(!this.isMicUnmuted)throw new Error("AudioAlreadyMutedError");return this.toggleMicIsMuted(!1)}getCurrentVolume(){return this.inputMicDetector?this.inputMicDetector.getMicVolume():0}async stop(){if(!this.audioStream||!this.isAudioStarted)throw new Error(z);this.audioStream.getAudioTracks().forEach(e=>e.stop()),this.audioStream=null,this.isAudioStarted=!1}async toggleMicIsMuted(e){if(e){if(!this.audioContext){const e=window.AudioContext||window.webkitAudioContext;this.audioContext=new e}this.inputMicDetector=new D(this.audioContext),this.inputMicDetector.connectToSource(this.audioStream)}else this.inputMicDetector&&this.inputMicDetector.stop(),this.inputMicDetector=null;this.isMicUnmuted=e}getAudioConstraints(){return{audio:""===this.deviceId||{deviceId:{exact:this.deviceId}},video:!1}}testSpeaker(e){return this.tester.testSpeaker(e)}testMicrophone(e){return this.tester.testMicrophone(e)}}let B=function(e){return e[e.InitSuccess=1]="InitSuccess",e[e.InitSuccessVideo=1.1]="InitSuccessVideo",e[e.InitSuccessAudio=1.2]="InitSuccessAudio",e[e.InitSuccessSharing=1.3]="InitSuccessSharing",e[e.UserGrantCaptureAudio=2]="UserGrantCaptureAudio",e[e.CurrentVideoResolution=3]="CurrentVideoResolution",e[e.JpegDecThreadOk=4]="JpegDecThreadOk",e[e.JpegData=5]="JpegData",e[e.SharingPara=6]="SharingPara",e[e.VideoDecodeMaxSize=7]="VideoDecodeMaxSize",e[e.CurrentCaptureVideoWidthHeight=8]="CurrentCaptureVideoWidthHeight",e[e.StartVideoCaptureSuccess=9]="StartVideoCaptureSuccess",e[e.StopVideoCaptureSuccess=10]="StopVideoCaptureSuccess",e[e.StartRemoteControlSuccess=11]="StartRemoteControlSuccess",e[e.CancelRemoteControlSuccess=12]="CancelRemoteControlSuccess",e[e.RemoteControlCopiedTextNotify=13]="RemoteControlCopiedTextNotify",e[e.MonitorLog=14]="MonitorLog",e[e.CurrentDesktopSharingWidthHeight=15]="CurrentDesktopSharingWidthHeight",e[e.DesktopSharingCaptureSuccess=16]="DesktopSharingCaptureSuccess",e[e.CheckChromeSharingExtensionResponse=17]="CheckChromeSharingExtensionResponse",e[e.SharingDecodeMaxSize=18]="SharingDecodeMaxSize",e[e.DataChannelOffer=19]="DataChannelOffer",e[e.AesGcmIvResponse=21]="AesGcmIvResponse",e[e.SharingDesktopStreamHaveAudio=23]="SharingDesktopStreamHaveAudio",e[e.JoinComputerAudioComplete=24]="JoinComputerAudioComplete",e[e.JoinSharingAudioComplete=25]="JoinSharingAudioComplete",e[e.LeaveComputerAudioComplete=26]="LeaveComputerAudioComplete",e[e.LeaveSharingAudioComplete=27]="LeaveSharingAudioComplete",e[e.HidStatusMute=28]="HidStatusMute",e[e.WhiteboardSuccess=30]="WhiteboardSuccess",e[e.AudioStreamFailed=31]="AudioStreamFailed",e[e.VideoStreamFailed=32]="VideoStreamFailed",e[e.AudioSpeakerSetSuccess=33]="AudioSpeakerSetSuccess",e[e.AudiobridgeSetCcLangSuccess=36]="AudiobridgeSetCcLangSuccess",e[e.AudioLevelIndicator=38]="AudioLevelIndicator",e[e.SyncRendererTypeResponse=39]="SyncRendererTypeResponse",e[e.SendRemoteControlQrCode=55]="SendRemoteControlQrCode",e[e.StartVideoStreamInMaskSettingSuccess=66]="StartVideoStreamInMaskSettingSuccess",e[e.CurrentDecodeVideoQuality=66.5]="CurrentDecodeVideoQuality",e[e.CurrentDecodeVideoFps=66.6]="CurrentDecodeVideoFps",e[e.SharingFirstDecodeFrameReceivedSsrc=70]="SharingFirstDecodeFrameReceivedSsrc",e[e.StartVideoStreamInVbSettingSuccess=94]="StartVideoStreamInVbSettingSuccess",e[e.VbModelPreloading_3S=96]="VbModelPreloading_3S",e[e.VbModelPreloading_10S=97]="VbModelPreloading_10S",e[e.VbModelPreloadingOk=98]="VbModelPreloadingOk",e[e.NewActiveSpeakerFirstFrameCallback=111]="NewActiveSpeakerFirstFrameCallback",e[e.AudioBridgeFirstRecvData=114]="AudioBridgeFirstRecvData",e[e.AudioBridgeCanSendData=115]="AudioBridgeCanSendData",e[e.SpeakingWhenMute=121]="SpeakingWhenMute",e[e.StartAnnotationSuccess=158]="StartAnnotationSuccess",e[e.DeviceChangeEvent=159]="DeviceChangeEvent",e[e.RecaptureAudio=160]="RecaptureAudio",e[e.AudioAiInterpretationChannelList=168]="AudioAiInterpretationChannelList",e[e.AudioAiInterpretationRecvFirstFrame=171]="AudioAiInterpretationRecvFirstFrame",e[e.MediaStatsLog=209]="MediaStatsLog",e[e.InitFailed=-1]="InitFailed",e[e.InitFailedVideo=-1.1]="InitFailedVideo",e[e.InitFailedAudio=-1.2]="InitFailedAudio",e[e.InitFailedSharing=-1.3]="InitFailedSharing",e[e.AudioCaptureFailed=-2]="AudioCaptureFailed",e[e.AudioWebsocketBroken=-3]="AudioWebsocketBroken",e[e.VideoWebsocketBroken=-4]="VideoWebsocketBroken",e[e.SharingDecThreadFailed=-5]="SharingDecThreadFailed",e[e.AudioZeroData=-6]="AudioZeroData",e[e.AudioCtxSamplerate=-7]="AudioCtxSamplerate",e[e.UserForbiddedCaptureVideo=-8]="UserForbiddedCaptureVideo",e[e.UserCameraIsTakenByOtherPrograms=-9]="UserCameraIsTakenByOtherPrograms",e[e.StopVideoCaptureFailed=-10]="StopVideoCaptureFailed",e[e.StartRemoteControlFailed=-11]="StartRemoteControlFailed",e[e.CancelRemoteControlFailed=-12]="CancelRemoteControlFailed",e[e.RemoteControlPasteTextLengthOverflow=-14]="RemoteControlPasteTextLengthOverflow",e[e.UserStopDesktopSharing=-15]="UserStopDesktopSharing",e[e.UserCancelPermissionRequest=-16]="UserCancelPermissionRequest",e[e.DesktopSharingChromeExtensionUninstalled=-17]="DesktopSharingChromeExtensionUninstalled",e[e.DesktopSharingPermissionDenied=-18]="DesktopSharingPermissionDenied",e[e.DesktopSharingTimeOut=-19]="DesktopSharingTimeOut",e[e.DesktopSharingError=-20]="DesktopSharingError",e[e.AudioSpeakerSetError=-21]="AudioSpeakerSetError",e[e.DesktopSharingSystemError=-22]="DesktopSharingSystemError",e[e.SharingDesktopStreamHaveNoAudio=-27]="SharingDesktopStreamHaveNoAudio",e[e.AudioBridgeSocketConnectionError=-28]="AudioBridgeSocketConnectionError",e[e.AudioBridgeReconnectStart=-29]="AudioBridgeReconnectStart",e[e.AudioBridgeReconnectEnd=-31]="AudioBridgeReconnectEnd",e[e.WebglLostInMultiView=-32]="WebglLostInMultiView",e[e.MaskSettingParaError=-33]="MaskSettingParaError",e[e.VbSettingParaError=-34]="VbSettingParaError",e[e.NotifyUIFailover=-35]="NotifyUIFailover",e[e.AudiobridgeSetCcLangFailure=-39]="AudiobridgeSetCcLangFailure",e[e.NotifyUIWMSCFailover=-42]="NotifyUIWMSCFailover",e[e.NotifyUIWMSCWSSDisconnected=-43]="NotifyUIWMSCWSSDisconnected",e[e.RecoverWebrtcAudio=-44]="RecoverWebrtcAudio",e[e.WebglContextInvalid=-51]="WebglContextInvalid",e[e.WasmMemoryFail=-52]="WasmMemoryFail",e[e.WorkletProcessExceptions=-53]="WorkletProcessExceptions",e[e.NotSupportExternalCanvasInVTagRenderer=-55]="NotSupportExternalCanvasInVTagRenderer",e[e.HealthCheckFailed=-129]="HealthCheckFailed",e[e.StartAnnotationFailed=-130]="StartAnnotationFailed",e.AudioQosData="AUDIO_QOS_DATA",e.VideoQosData="VIDEO_QOS_DATA",e.ShareQosData="VIDEOSHARE_QOS_DATA",e.CommonQosData="COMMON_QOS_DATA",e.NetworkQualityChange="NETWORK_QUALITY_CHANGE",e.NetworkQualityChangeAudio="NETWORK_QUALITY_CHANGE_AUDIO",e.NetworkQualityChangeSharing="NETWORK_QUALITY_CHANGE_SHARING",e.AudioStreamMuted="AUDIO_STREAM_MUTED",e.AudioStreamUnmuted="AUDIO_STREAM_UNMUTED",e.AnnotationRedoStatus="ANNO_REDO_STATUS",e.AnnotationUndoStatus="ANNO_UNDO_STATUS",e.AnnoViewerRequestDraw="ANNO_VIEWER_REQUEST_DRAW",e.VideoStreamMuted="VIDEO_STREAM_MUTED",e.VideoStreamUnmuted="VIDEO_STREAM_UNMUTED",e}({}),U=function(e){return e[e.EncodeSuccess=1]="EncodeSuccess",e[e.DecodeSuccess=2]="DecodeSuccess",e[e.EncodeFailed=-1]="EncodeFailed",e[e.DecodeFailed=-2]="DecodeFailed",e}({}),H=function(e){return e.Spotlight="Spotlight",e.Unmute="Unmute",e.AllowToTalk="Allow to talk",e}({}),F=function(e){return e.Inherited="inherited",e.Active="active",e.PassiveByMuteOne="passive(mute one)",e.PassiveByMuteAll="passive(mute all)",e.SharingAudio="sharing audio",e}({}),W=function(e){return e.Inherited="inherited",e.Active="active",e.Passive="passive",e.SharingAudio="sharing audio",e}({}),q=function(e){return e.Active="active",e.Failover="failover",e.EndedBySystem="audio stream is ended by system",e.Pstn="pstn",e.MicrophoneError="microphone error",e}({}),$=function(e){return e.Join="join",e.Leave="leave",e.Muted="muted",e.Unmuted="unmuted",e}({}),G=function(e){return e[e.Calling=1]="Calling",e[e.Ringing=2]="Ringing",e[e.Accepted=3]="Accepted",e[e.Busy=4]="Busy",e[e.NotAvailable=5]="NotAvailable",e[e.HangUp=6]="HangUp",e[e.Fail=7]="Fail",e[e.Success=8]="Success",e[e.Timeout=9]="Timeout",e[e.Canceling=10]="Canceling",e[e.Canceled=11]="Canceled",e[e.CancelFailed=12]="CancelFailed",e[e.NoAnswer=13]="NoAnswer",e[e.BlockNoHost=14]="BlockNoHost",e[e.BlockHighRate=15]="BlockHighRate",e[e.BlockTooFrequent=16]="BlockTooFrequent",e}({});const K=(()=>{const e=new ArrayBuffer(684),t=new Uint32Array(e);return t.set([1179011410,676,1163280727,544501094,16,65539,16e3,64e3,2097156,1635017060,640],0),new Blob([t],{type:"audio/wav"})})(),Q=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]),Z=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]);let J=function(e){return e[e.HostGrab=0]="HostGrab",e[e.OnlyHost=1]="OnlyHost",e[e.AnyoneGrab=2]="AnyoneGrab",e[e.MultipleShare=3]="MultipleShare",e}({}),Y=function(e){return e.Sharing="sharing",e.Paused="paused",e.End="ended",e}({}),X=function(e){return e[e.Video_90P=0]="Video_90P",e[e.Video_180P=1]="Video_180P",e[e.Video_360P=2]="Video_360P",e[e.Video_720P=3]="Video_720P",e[e.Video_1080P=4]="Video_1080P",e}({}),ee=function(e){return e.Active="Active",e.Inactive="Inactive",e}({}),te=function(e){return e.Muted="Muted",e.Unmuted="Unmuted",e}({}),ne=function(e){return e.Started="Started",e.Stopped="Stopped",e.Failed="Failed",e}({}),oe=function(e){return e.Approved="Approved",e.Rejected="Rejected",e}({}),ie=function(e){return e.PrivilegeChange="PrivilegeChange",e.StopScreenCapture="StopScreenCapture",e.ShareFromMainSession="ShareFromMainSession",e.StopCameraCapture="StopCameraCapture",e}({}),re=function(e){return e[e.ImageNotMatch=2]="ImageNotMatch",e[e.CanvasNotMatch=3]="CanvasNotMatch",e[e.VBModelNotMatch=4]="VBModelNotMatch",e}({});const ae="blur";let se=function(e){return e[e.NotConnect=0]="NotConnect",e[e.Connecting=1]="Connecting",e[e.ConnectSuccess=2]="ConnectSuccess",e[e.ConnectFail=3]="ConnectFail",e}({}),le=function(e){return e.User="user",e.Environment="environment",e.Left="left",e.Right="right",e}({});const ce=Object.values(le),de=1e3,ue="__ZOOM_SDK_SHARING_VIDEO__",pe="__ZOOM_SDK_ANNOTATION_CANVAS_@__",_e="__ZOOM_SDK_VIDEO_ZONE__",me="__ZOOM_SDK_MEDIA_PLAYBACK_SOURCE_VIDEO__",he="__ZOOM_SDK_DYMMY_VIDEO_PLAYER_CANVAS_ID__",ge="__ZOOM_SDK_DUMMY_HIDDEN_SELF_VIEW_VIDEO_ID__",fe={data:{sample_rate:0,rtt:0,jitter:0,avg_loss:0,max_loss:0,rate:0,bandwidth:0}},ve={data:{sample_rate:0,rtt:0,jitter:0,avg_loss:0,max_loss:0,width:0,height:0,fps:0,rate:0,bandwidth:0}};let be=function(e){return e[e.Request=11]="Request",e[e.Decline=12]="Decline",e[e.Approve=13]="Approve",e[e.GiveUp=14]="GiveUp",e[e.StartControl=15]="StartControl",e[e.ContinueControl=16]="ContinueControl",e[e.StopControl=17]="StopControl",e[e.SwitchCamera=20]="SwitchCamera",e}({}),we=function(e){return e[e.Bk=0]="Bk",e[e.Center=1]="Center",e[e.ZoomIn=2]="ZoomIn",e[e.ZoomOut=3]="ZoomOut",e[e.Left=4]="Left",e[e.Right=5]="Right",e[e.Up=6]="Up",e[e.Down=7]="Down",e[e.SwitchCamera=8]="SwitchCamera",e}({}),ye=function(e){return e[e.Pan=192]="Pan",e[e.Tilt=48]="Tilt",e[e.Zoom=12]="Zoom",e[e.Focus=3]="Focus",e}({}),Se=function(e){return e[e.ZoomIn=2]="ZoomIn",e[e.ZoomOut=3]="ZoomOut",e[e.Left=4]="Left",e[e.Right=5]="Right",e[e.Up=6]="Up",e[e.Down=7]="Down",e[e.SwitchCamera=8]="SwitchCamera",e}({}),Ce=function(e){return e[e.None=0]="None",e[e.ApproveAnother=3]="ApproveAnother",e[e.Stop=5]="Stop",e}({}),ke=function(e){return e[e.Null=0]="Null",e[e.Normal=1]="Normal",e[e.VideoMode=2]="VideoMode",e[e.CameraMode=3]="CameraMode",e}({}),Ee=function(e){return e[e.Null=0]="Null",e[e.VirtualBackground=1]="VirtualBackground",e[e.Mask=2]="Mask",e[e.VideoProcessor=3]="VideoProcessor",e}({}),Ae=function(e){return e.Computer="computer",e.Phone="phone",e}({}),Te=function(e){return e[e.Decline=0]="Decline",e[e.Approve=1]="Approve",e[e.CacheClean=2]="CacheClean",e}({}),Ie=function(e){return e.Unknown="unknown",e.Uninstalled="uninstalled",e.Installed="installed",e}({}),xe=function(e){return e.Unlaunched="unlaunched",e.Launched="launched",e}({}),Re=function(e){return e.Started="started",e.Ended="ended",e}({}),Oe=function(e){return e[e.Max=30]="Max",e[e.Min=10]="Min",e[e.Default=24]="Default",e}({}),Pe=function(e){return e[e.Loading=1]="Loading",e[e.Done=2]="Done",e}({}),Me=function(e){return e.Browser="Browser",e.Zoom="Zoom",e}({}),je=function(e){return e.Denoise="backgroundNoiseSuppression",e.OriginalSound="originalSound",e}({}),De=function(e){return e[e.Undefined=0]="Undefined",e[e.WebGL=1]="WebGL",e[e.WebGPU=2]="WebGPU",e[e.WebGL2=3]="WebGL2",e}({});!function(e){e[e.H323=1]="H323",e[e.SIP=2]="SIP"}({});let Ne=function(e){return e[e.Success=0]="Success",e[e.Ringing=1]="Ringing",e[e.Timeout=2]="Timeout",e[e.Busy=101]="Busy",e[e.Fail=104]="Fail",e}({}),Le=function(e){return e[e.Exception=-1]="Exception",e[e.PermissionReset=-2]="PermissionReset",e[e.LostAccess=-3]="LostAccess",e}({}),ze=function(e){return e[e.AudioConnectionFailed=101]="AudioConnectionFailed",e[e.AudioStreamEnded=102]="AudioStreamEnded",e[e.MicrophonePermissionReset=103]="MicrophonePermissionReset",e[e.AudioStreamFailed=104]="AudioStreamFailed",e[e.MicrophoneMuted=105]="MicrophoneMuted",e[e.AudioStreamMuted=106]="AudioStreamMuted",e[e.AudioPlaybackInterrupted=107]="AudioPlaybackInterrupted",e[e.VideoConnectionFailed=201]="VideoConnectionFailed",e[e.VideoStreamEnded=202]="VideoStreamEnded",e[e.CameraPermissionReset=203]="CameraPermissionReset",e[e.WebGlContextInvalid=204]="WebGlContextInvalid",e[e.WasmOutOfMemory=205]="WasmOutOfMemory",e[e.VideoStreamFailed=206]="VideoStreamFailed",e[e.VideoStreamMuted=207]="VideoStreamMuted",e[e.SharingStreamFailed=301]="SharingStreamFailed",e}({}),Ve=function(e){return e[e.NoFallback=0]="NoFallback",e[e.FallbackToWasm=1]="FallbackToWasm",e}({}),Be=function(e){return e[e.WebRTCAudio=1]="WebRTCAudio",e[e.WebRTCVideo=2]="WebRTCVideo",e[e.WebRTCAudio2=4]="WebRTCAudio2",e}({}),Ue=function(e){return e[e.WebRTCAudio=1]="WebRTCAudio",e[e.WebRTCAudio2=2]="WebRTCAudio2",e}({}),He=function(e){return e[e.BROWSER_NOT_SUPPORTED=-3]="BROWSER_NOT_SUPPORTED",e[e.DEVICE_UNSUPPORTED=-4]="DEVICE_UNSUPPORTED",e[e.OTHER_ERROR=-7]="OTHER_ERROR",e[e.DEVICE_UNVERIFIED=-8]="DEVICE_UNVERIFIED",e[e.FEATURE_DISABLED=-9]="FEATURE_DISABLED",e[e.FORCE_SAME_AV_STRATEGY=-10]="FORCE_SAME_AV_STRATEGY",e}({});const Fe={[He.BROWSER_NOT_SUPPORTED]:"Your browser does not support WebRTC Video.",[He.DEVICE_UNSUPPORTED]:"WebRTC video cannot currently run on this environment. We are evaluating support for it in the future.",[He.OTHER_ERROR]:"An error occurred with WebRTC video.",[He.DEVICE_UNVERIFIED]:"WebRTC video has not been verified in this environment. We are evaluating it for future support.",[He.FEATURE_DISABLED]:"We disabled WebRTC video for this environment.",[He.FORCE_SAME_AV_STRATEGY]:"The same AV strategy is forced."};let We=function(e){return e[e.SELECT_MOUSE=0]="SELECT_MOUSE",e[e.SELECT_TOOL=1]="SELECT_TOOL",e[e.SELECT_ERASER=2]="SELECT_ERASER",e[e.UNDO=3]="UNDO",e[e.REDO=4]="REDO",e[e.CLEAR=5]="CLEAR",e[e.CLOSE_TOOL_BAR=6]="CLOSE_TOOL_BAR",e[e.UPDATE_PARAMS=7]="UPDATE_PARAMS",e[e.PAUSE_ANNOTATION=8]="PAUSE_ANNOTATION",e[e.SHOW_ANNOTATOR_NAME=9]="SHOW_ANNOTATOR_NAME",e[e.ANNOTATOR_ID_TO_NAME=10]="ANNOTATOR_ID_TO_NAME",e[e.ANNO_CANVAS_SIZE_UPDATE=11]="ANNO_CANVAS_SIZE_UPDATE",e[e.STAMP=12]="STAMP",e[e.SPOTLIGHT=13]="SPOTLIGHT",e[e.TEXTBOX=14]="TEXTBOX",e[e.SELECT_OBJ=15]="SELECT_OBJ",e[e.UPDATE_REMOTE_POSITION_INFO=16]="UPDATE_REMOTE_POSITION_INFO",e[e.UPDATE_VANISHING_TOOL_TIME=17]="UPDATE_VANISHING_TOOL_TIME",e}({}),qe=function(e){return e[e.Mine=0]="Mine",e[e.Viewer=1]="Viewer",e[e.All=2]="All",e}({}),$e=function(e){return e[e.None=0]="None",e[e.Pen=1]="Pen",e[e.Highlighter=2]="Highlighter",e[e.Spotlight=3]="Spotlight",e[e.Arrow=4]="Arrow",e[e.Eraser=7]="Eraser",e[e.Line=11]="Line",e[e.Arrow1=12]="Arrow1",e[e.Rectangle=14]="Rectangle",e[e.RectangleSemiFill=15]="RectangleSemiFill",e[e.Ellipse=18]="Ellipse",e[e.EllipseSemiFill=19]="EllipseSemiFill",e[e.DoubleArrow=20]="DoubleArrow",e[e.RectangleFill=21]="RectangleFill",e[e.EllipseFill=23]="EllipseFill",e[e.Diamond=24]="Diamond",e[e.StampArrow=25]="StampArrow",e[e.StampCheck=26]="StampCheck",e[e.StampX=27]="StampX",e[e.StampStar=31]="StampStar",e[e.StampHeart=32]="StampHeart",e[e.StampQuestionMark=33]="StampQuestionMark",e[e.VanishingPen=36]="VanishingPen",e[e.DiamondSemiFill=37]="DiamondSemiFill",e[e.DiamondFill=38]="DiamondFill",e[e.VanishingArrow=43]="VanishingArrow",e[e.VanishingDoubleArrow=44]="VanishingDoubleArrow",e[e.VanishingDiamond=45]="VanishingDiamond",e[e.VanishingEllipse=46]="VanishingEllipse",e[e.VanishingRectangle=47]="VanishingRectangle",e}({}),Ge=function(e){return e[e.White=4294967295]="White",e[e.Red=4294908185]="Red",e[e.Yellow=4294958642]="Yellow",e[e.Green=4286760838]="Green",e[e.Blue=4281240831]="Blue",e[e.LightPurple=4290017791]="LightPurple",e[e.Pink=4294916295]="Pink",e[e.Orange=4294937088]="Orange",e[e.LimeTreeGreen=4283029022]="LimeTreeGreen",e[e.IceBlue=4283554027]="IceBlue",e[e.DarkGrey=4278190080]="DarkGrey",e[e.DarkRed=4286513152]="DarkRed",e[e.Brown=4286006280]="Brown",e[e.DarkGreen=4278940200]="DarkGreen",e[e.DarkBlue=4279521219]="DarkBlue",e}({});!function(e){e[e.Nominal=0]="Nominal",e[e.Fair=1]="Fair",e[e.Serious=2]="Serious",e[e.Critical=3]="Critical"}({});let Ke=function(e){return e.FrontCamera="frontCam",e.RearCamera="rearCam",e}({}),Qe=function(e){return e[e.Success=0]="Success",e[e.Failed=1]="Failed",e}({});const Ze=152,Je=[{name:"audio_simd.min.js",category:"audio",type:"worker",tag:"simd",alias:"audioSIMDWorkletPath"},{name:"audio.simd.wasm",category:"audio",type:"wasm",tag:"simd",alias:"audioSIMDWasm"},{name:"js_audio_process.min.js",category:"audio",type:"worker",tag:"",alias:"audioWorkerPath"},{name:"audio.encode.wasm",category:"audio",type:"wasm",tag:"",alias:"audioWasm"},{name:"js_audio_worklet.min.js",category:"audio",type:"worklet",tag:"",alias:"audioWorkletPath"},{name:"js_audio_worklet_simd.min.js",category:"audio",type:"worklet",tag:"simd",alias:"audioWorkletSIMDPath"},{name:"js_audio_worklet_process.min.js",category:"audio",type:"worklet",tag:"",alias:"audioWorkletProcessPath"},{name:"js_sharing_audio_worklet.min.js",category:"audio",type:"worklet",tag:"",alias:"sharingAudioWorkletPath"},{name:"js_audio_level_worklet_process.min.js",category:"audio",type:"worklet",tag:"",alias:"audioLevelWorkletPath"},{name:"video_mtsimd.min.js",category:"video",type:"worker",tag:"simd,thread",alias:"videoMSIMDWorkerPath"},{name:"video.mtsimd.wasm",category:"video",type:"wasm",tag:"simd,thread,videoShare",alias:"videoMSIMDWasm"},{name:"video_m.min.js",category:"video",type:"worker",tag:"thread",alias:"videoMtWorkerPath"},{name:"video.mt.wasm",category:"video",type:"wasm",tag:"thread",alias:"videoMtWasm"},{name:"video_simd.min.js",category:"video",type:"worker",tag:"simd",alias:"videoSIMDWorkerPath"},{name:"video.simd.wasm",category:"video",type:"wasm",tag:"simd",alias:"videoSIMDWasm"},{name:"video_s.min.js",category:"video",type:"worker",tag:"",alias:"videoWorkerPath"},{name:"video.decode.wasm",category:"video",type:"wasm",tag:"",alias:"videoWasm"},{name:"video_share_mtsimd.min.js",category:"video",type:"worker",tag:"videoShare",alias:"vsmiworkerpath"},{name:"sharing_mtsimd.min.js",category:"sharing",type:"worker",tag:"simd,thread",alias:"sharingMSIMDWorkerPath"},{name:"sharing_m.min.js",category:"sharing",type:"worker",tag:"thread",alias:"sharingMtWorkerPath"},{name:"sharing_simd.min.js",category:"sharing",type:"worker",tag:"simd",alias:"sharingSIMDWorkerPath"},{name:"sharing_s.min.js",category:"sharing",type:"worker",tag:"",alias:"sharingWorkerPath"},{name:"net_thread.min.js",category:"common",type:"worker",tag:"thread",alias:"netThreadPath"}];class Ye{constructor(){this.assetsPath=void 0,this.instance=void 0,this.callbackList=void 0,this.mediaWorkersPath=void 0,this.mediaOptions=void 0,this.inProgress=void 0,this.callbackList=[]}static getInstance(){return void 0===this.agentInstance&&(this.agentInstance=new Ye),this.agentInstance}static getMaxCountRender(e,t,n){var o;const i=n?{disableRenderLimits:!0}:t;return null===(o=window.JsMediaSDK_Instance)||void 0===o?void 0:o.util.getMaxCountRender(e,i)}static initVideoPlayer(e){var t;return null===(t=window.JsMediaSDK_Instance)||void 0===t?void 0:t.initVideoPlayer(e)}static isSupportVirtualBackground(){var e;return!(null===(e=window.JsMediaSDK_Instance)||void 0===e||!e.util.isSupportVirtualBackground())}static isSupportSending720P(){var e;return!(null===(e=window.JsMediaSDK_Instance)||void 0===e||null===(e=e.util)||void 0===e||!e.get720pcapacity())}init(e,t,n){var o,i,r,a;!this.instance&&window.JsMediaSDK_Instance&&(this.instance=new window.JsMediaSDK_Instance({...null!=t?t:{},mediaSDKConfig:{mediaSDKCDNPath:e}})),this.onMediaSDKCallback=this.onMediaSDKCallback.bind(this),this.mediaOptions=t,null===(o=this.instance)||void 0===o||o.setProps({callback:this.onMediaSDKCallback,isPreviewMode:!0,meetingParams:{cid:"",userId:0,rwgHost:"",nginxHost:"",abToken:"",confId:"",e2eEncrypt:!0,enableWebtransport:!1,webtransportPort:0,rwgToMediaSDKConfig:{},webrtcMode:0},mediaParams:{videoDecodeThreadNum:null!==(i=Ye.getMaxCountRender(!1,null===(r=this.mediaOptions)||void 0===r?void 0:r.enableMultiDecodeVideoWithoutSAB,n))&&void 0!==i?i:1,rendererType:1,isEnableHD:!0,isEnableDecodingHW:!0,isEnableEncodingHW:!0}}),null===(a=this.instance)||void 0===a||a.initVideoEncode(),this.inProgress=!0}onMediaSDKCallback(e,t){this.callbackList.length>0&&this.callbackList.forEach(n=>n(e,t))}registerCallback(e){this.callbackList.push(e)}unregisterCallback(e){this.callbackList=this.callbackList.filter(t=>t!==e)}async destroy(){var e;this.callbackList=[],await(null===(e=this.instance)||void 0===e?void 0:e.destroy()),this.instance=null,this.inProgress=!1}disconnect(){var e,t;null===(e=this.instance)||void 0===e||e.Notify_MeidaSDK(17,{}),null===(t=this.instance)||void 0===t||t.JsMediaSDK_UnInit()}startVirtualBackgroundSetting(e){var t;const{imageId:n,cameraDeviceId:o,ssid:i,...r}=e;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(91,{bgdom:n,VideoSelectValue:"default"===o?null:o,ssid:0,usingFacingMode:["user","environment"].includes(o),...r})}updateVirtualBackgroundImage(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(92,{bgdom:e})}stopVirtualBackgroundSetting(e=!1){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(93,{isSwitch:e})}startMaskSetting(e,t,n,o,i,r,a,s,l){var c;null===(c=this.instance)||void 0===c||c.Notify_MeidaSDK(62,{canvas:e,maskdom:null,bgdom:null,dx:0,dy:0,dWidth:170,dHeight:170,width:1280,height:720,ssid:0,originWidth:379,originHeight:213,VideoSelectValue:"default"===i?null:i,usingFacingMode:["user","environment"].includes(i)})}stopMaskSetting(e=!1){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(65,{isSwitch:e})}}Ye.agentInstance=void 0;const Xe="INVALID_OPERATION",et="INTERNAL_ERROR",tt="OPERATION_TIMEOUT",nt="INSUFFICIENT_PRIVILEGES",ot="IMPROPER_MEETING_STATE",it="INVALID_PARAMETERS",rt="OPERATION_LOCKED",at="FEATURE_MISS",st="OPERATION_CANCELLED";var lt=function(e,t){return lt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},lt(e,t)};function ct(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}lt(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var dt=function(){return dt=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},dt.apply(this,arguments)};function ut(e,t){var n,o,i,r,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(i=2&r[0]?o.return:r[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,r[1])).done)return i;switch(o=0,i&&(r=[2&r[0],i.value]),r[0]){case 0:case 1:i=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,o=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!i||r[1]>i[0]&&r[1]<i[3])){a.label=r[1];break}if(6===r[0]&&a.label<i[1]){a.label=i[1],i=r;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(r);break}i[2]&&a.ops.pop(),a.trys.pop();continue}r=t.call(e,a)}catch(e){r=[6,e],o=0}finally{n=i=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}}function pt(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],o=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function _t(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,i,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(e){i={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a}function mt(e,t){for(var n=0,o=t.length,i=e.length;n<o;n++,i++)e[i]=t[n];return e}function ht(e){return this instanceof ht?(this.v=e,this):new ht(e)}function gt(e){return"function"==typeof e}function ft(e){var t=e(function(e){Error.call(e),e.stack=(new Error).stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var vt=ft(function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map(function(e,t){return t+1+") "+e.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}});function bt(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var wt=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}var t;return e.prototype.unsubscribe=function(){var e,t,n,o,i;if(!this.closed){this.closed=!0;var r=this._parentage;if(r)if(this._parentage=null,Array.isArray(r))try{for(var a=pt(r),s=a.next();!s.done;s=a.next())s.value.remove(this)}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}else r.remove(this);var l=this.initialTeardown;if(gt(l))try{l()}catch(e){i=e instanceof vt?e.errors:[e]}var c=this._finalizers;if(c){this._finalizers=null;try{for(var d=pt(c),u=d.next();!u.done;u=d.next()){var p=u.value;try{Ct(p)}catch(e){i=null!=i?i:[],e instanceof vt?i=mt(mt([],_t(i)),_t(e.errors)):i.push(e)}}}catch(e){n={error:e}}finally{try{u&&!u.done&&(o=d.return)&&o.call(d)}finally{if(n)throw n.error}}}if(i)throw new vt(i)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)Ct(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&bt(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&bt(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}(),yt=wt.EMPTY;function St(e){return e instanceof wt||e&&"closed"in e&>(e.remove)&>(e.add)&>(e.unsubscribe)}function Ct(e){gt(e)?e():e.unsubscribe()}var kt=void 0;function Et(e){!function(e,t){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];setTimeout.apply(void 0,mt([e,t],_t(n)))}(function(){throw e})}function At(){}function Tt(e){e()}var It=function(e){function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,St(t)&&t.add(n)):n.destination=Pt,n}return ct(t,e),t.create=function(e,t,n){return new Rt(e,t,n)},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.e