diff --git a/CHANGELOG.md b/CHANGELOG.md index d042467..e037c82 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,38 @@ ## CHANGELOG +## v1.3.0 + +* The `role_type` attribute in the JWT token is required. See [SDK Authorization](https://marketplace.zoom.us/docs/sdk/video/auth) for details. + +### Added +* Virtual background support, and APIs + * APIs include: `isSupportVirtualBackground`, `previewVirtualBackground`, `updateVirtualBackgroundImage`, `stopPreviewVirtualBackground`, and `virtualBackground` option in `startVideo` method + * See API reference for more details +* Audio and video statistic information. + * Subscribe to audio and video data via `subscribeAudioStatisticData` and `subscribeVideoStatisticData` + * Data will be sent every second via the `audio-statistic-data-change` and `video-statistic-data-change` events +* Support for sharing audio only while screen sharing a Chrome tab +* Support for sharing “Content from 2nd Camera” (e.g. a document camera, or the integrated camera on your laptop) + * New `ScreenShareOption` option for the `startShareScreen` method + * New secondaryCamera-related method: `switchSharingSecondaryCamera` + * See [here](https://support.zoom.us/hc/en-us/articles/201362153-Sharing-your-screen-or-desktop-on-Zoom) for more details on functionality, and the API reference for usage + +### Enhanced +* Datacenter selection algorithm for reduced latency and improved in-meeting performance + * Improvements include geo-fencing and greater prioritization of geographically-close servers +* QoS for in-meeting video streams (e.g. participant videos) + +### Fixed +* Occasional conflicts when starting 720p videos with virtual background +* Issue where the start audio with `speakerOnly` option on iOS mobile browser could lead to users not hearing audio +* Video rendering issue on Android mobile browsers + ## v1.2.7 + ### Fixed: * Issue where two-or-more videos could not be properly, simultaneously shown on Firefox and Safari ## v1.2.5 + ### Added: * Support for audio on iOS Safari * Support for multiple videos (3 others + 1 self) on Chromium browsers without SharedArrayBuffer. Set the value of `enforceMultipleVideos` to `true` in the `init` method to enable this feature diff --git a/README.md b/README.md index 128dbd0..c16c738 100644 --- a/README.md +++ b/README.md @@ -1,154 +1,80 @@ -# Zoom Video SDK +# Zoom Video SDK for Web Use of this SDK is subject to our [Terms of Use](https://zoom.us/docs/en-us/zoom_api_license_and_tou.html). -Add Video, Audio, Screen Share, and Chat features to your web applications with the [Zoom Video SDK](https://marketplace.zoom.us/docs/sdk/video/introduction). +The [Zoom Video SDK](https://marketplace.zoom.us/docs/sdk/video/web) enables you to build custom video experiences with Zoom's core technology through a highly optimized WebAssembly module. ## Installation In your frontend project, install the Video SDK: -`$ npm install @zoom/videosdk --save` +```bash +$ npm install @zoom/videosdk --save +``` ## Usage -In the component file where you want to use the Video SDK, import `ZoomVideo`. +![Zoom Video SDK](https://marketplace.zoom.us/docs/images/sdk/vsdk-example.gif) -```js -import ZoomVideo from '@zoom/videosdk'; -``` +> The Video SDK provides video, audio, screen sharing, chat, data streams, and more, as a service. You can build with all of these features, or pick and choose. The Video SDK also comes with a full set of server side [APIs](https://marketplace.zoom.us/docs/api-reference/video-sdk/methods) and [Webhooks](https://marketplace.zoom.us/docs/api-reference/video-sdk/events). -Create the Zoom Video Client, and initialize the dependencies. +In the component file where you want to use the Video SDK, import `ZoomVideo` and create the client. ```js -const client = ZoomVideo.createClient() +import ZoomVideo from '@zoom/videosdk' -client.init('en-US', `http://localhost:9999/node_modules/@zoom/videosdk/dist/lib/`); +const client = ZoomVideo.createClient() ``` -NOTE: The following directory in node_modules must be accessible in your url path: - -- `node_modules/@zoom/videosdk/dist/lib` - - For example, you could place the `lib` directory in your projects public assets directory, or use webpack's copy plugin to copy it to the public directory when starting the server up. You can test it by navigating to one of the included files: http://localhost:9999/assets/lib/webim.min.js - -Set the config variables (reference below): +Then init the SDK and declare the `stream` which we will define later: ```js -// setup your signature endpoint here: https://github.com/zoom/videosdk-sample-signature-node.js -const signatureEndpoint = 'http://localhost:4000' -const sessionName = 'VideoSDK-Test' -const userName = 'VideoSDK' -const sessionPasscode = '1234ABC' -let stream; -``` +client.init('en-US', `CDN`) +let stream +``` -Config variables reference: +Now we will start or join the session. Here are the required parameters for the `client.join()` function. -| Variable | Description | +| Parameter | Parameter Description | | -----------------------|-------------| -| signatureEndpoint | Required, the endpoint url that returns a signature. [Get a signature endpoint here.](https://github.com/zoom/videosdk-sample-signature-node.js) | -| sessionName | Required, the name of your session. | -| userName | Required, the name of the user joining your session. | -| sessionPasscode | Required, the passcode for your session. | -| stream | Required, the stream variable that you define after your session is joined. | +| topic | Required, a session name of your choice or the name of the session you are joining. | +| token | Required, your [Video SDK JWT](https://marketplace.zoom.us/docs/sdk/video/auth). | +| userName | Required, a name for the participant. | +| password | Required, a session passcode of your choice or the passcode of the session you are joining. | - -Generate the session signature to authenticate, [instructions here](https://github.com/zoom/videosdk-sample-signature-node.js). +Then start or join the session and define the stream, which will be used for [core features](#core-features). ```js -const signature = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9eyJhcHBfa2V5IjoiVklERU9fU0RLX0tFWV9IRVJFIiwiaWF0IjoxNjIzNDQyNTYzLCJleHAiOjE2MjM0NDk3NjMsInRwYyI6IlZpZGVvU0RLLVRlc3QiLCJwd2QiOiIxMjM0QUJDIn0=' -``` - -Then join the session. - -```js -client.join(sessionName, signature, userName, sessionPasscode).then((data) => { - console.log(data); +client.join(topic, token, userName, password).then(() => { + stream = client.getMediaStream() }).catch((error) => { - console.log(error); -}); - -// Using "await" syntactical sugar: -try { - const data = await client.join(sessionName, signature, userName, sessionPasscode); - console.log(data); -} catch (error) { - console.error(error); -} -``` - -Define the stream variable in the `connection-change` event listener to use the Video, Audio, Screen Share, and Chat APIs. - -```js -client.on("connection-change", (payload) => { - stream = client.getMediaStream(); + console.log(error) }) ``` -Alternatively, retrieve the mediaStream object after having successfully joined the meeting -```js -try { - const data = await client.join(sessionName, signature, userName, sessionPasscode); - stream = zmClient.getMediaStream(); -} catch (error) { - console.error(error); -} -``` - -Add the following HTML for the user interface (if using a framework like React, do the framework's equivalent). The start button will turn on your video and display it on the canvas in your web page. -```html - - +Now that we are in a session, we can start using core features like `stream.startVideo()`. - -``` +### Core Features: -Then, in your component file, connect the buttons to the Video SDK start and stop video functions. +- [Video](https://marketplace.zoom.us/docs/sdk/video/web/essential/video) +- [Audio](https://marketplace.zoom.us/docs/sdk/video/web/essential/audio) +- [Chat](https://marketplace.zoom.us/docs/sdk/video/web/essential/chat) +- [Call Out](https://marketplace.zoom.us/docs/sdk/video/web/advanced/call-out) +- [Screen Share](https://marketplace.zoom.us/docs/sdk/video/web/essential/screen-share) +- [Cloud Recording](https://marketplace.zoom.us/docs/sdk/video/web/essential/recording) +- [Command Channel](https://marketplace.zoom.us/docs/sdk/video/web/advanced/command-channel) +- [Audio Video Preview](https://marketplace.zoom.us/docs/sdk/video/web/essential/test) +- [Subsessions](https://marketplace.zoom.us/docs/sdk/video/web/advanced/breakout-rooms) -```js -// Try to use the same aspect ratio as your webcam, and match it with the canvas -// If you cannot, the SDK will add black bars to maintain correct aspect ratio -const canvas = document.querySelector('#my-video') -const canvasWidth = 640; -const canvasHeight = 360; -const xOffset = 0; -const yOffset = 0; -const videoQuality = 2; // equivalent to 360p; refer to the API reference for more info - -async function startVideo() { - if (!stream.isCapturingVideo()) { - try { - await stream.startVideo(); - - const session = client.getSessionInfo(); - stream.renderVideo(canvas, session.userId, canvasWidth, canvasHeight, xOffset, yOffset, videoQuality); - } catch (error) { - console.log(error); - } - } -} - -async function stopVideo() { - if (stream.isCapturingVideo()) { - try { - await stream.stopVideo(); - - const session = client.getSessionInfo(); - stream.stopRenderVideo(canvas, session.userId); - } catch (error) { - console.log(error); - } - } -} -``` +For the full list of features and event listeners, as well as additional guides, see our [Video SDK docs](https://marketplace.zoom.us/docs/sdk/video/web). -For the full list of features and event listeners including [Audio](https://marketplace.zoom.us/docs/sdk/video/web/essential/audio), [Screen Sharing](https://marketplace.zoom.us/docs/sdk/video/web/essential/screen-share), and [Chat](https://marketplace.zoom.us/docs/sdk/video/web/essential/chat), as well as additional guides, please see our [Video SDK docs](https://marketplace.zoom.us/docs/sdk/video/web). +## Sample Apps -## Sample App +Checkout the Video SDK sample apps: -Checkout the Zoom [Web Video SDK Sample App](https://github.com/zoom/sample-app-videosdk), and the [Simple Signature Setup Sample App](https://github.com/zoom/videosdk-sample-signature-node.js). +- [Web](https://github.com/zoom/sample-app-videosdk) +- [Signature Generator](https://github.com/zoom/videosdk-sample-signature-node.js) ## Need help? diff --git a/dist/index.esm.js b/dist/index.esm.js index 819f8ff..876268a 100644 --- a/dist/index.esm.js +++ b/dist/index.esm.js @@ -1 +1 @@ -function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function t(t){for(var r=1;r=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function l(e,t,r,n,o){var i={};return Object.keys(n).forEach((function(e){i[e]=n[e]})),i.enumerable=!!i.enumerable,i.configurable=!!i.configurable,("value"in i||i.initializer)&&(i.writable=!0),i=r.slice().reverse().reduce((function(r,n){return n(e,t,r)||r}),i),o&&void 0!==i.initializer&&(i.value=i.initializer?i.initializer.call(o):void 0,i.initializer=void 0),void 0===i.initializer&&(Object.defineProperty(e,t,i),i=null),i}function p(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function f(e){for(var t=1;t0?e.prototype.schedule.call(this,t,r):(this.delay=r,this.state=t,this.scheduler.flush(this),this)},t.prototype.execute=function(t,r){return r>0||this.closed?e.prototype.execute.call(this,t,r):this._execute(t,r)},t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!==n&&n>0||null===n&&this.delay>0?e.prototype.requestAsyncId.call(this,t,r,n):t.flush(this)},t}(Y),Q=function(){function e(t,r){void 0===r&&(r=e.now),this.SchedulerAction=t,this.now=r}return e.prototype.schedule=function(e,t,r){return void 0===t&&(t=0),new this.SchedulerAction(this,e).schedule(r,t)},e.now=function(){return Date.now()},e}(),X=function(e){function t(r,n){void 0===n&&(n=Q.now);var o=e.call(this,r,(function(){return t.delegate&&t.delegate!==o?t.delegate.now():n()}))||this;return o.actions=[],o.active=!1,o.scheduled=void 0,o}return A(t,e),t.prototype.schedule=function(r,n,o){return void 0===n&&(n=0),t.delegate&&t.delegate!==this?t.delegate.schedule(r,n,o):e.prototype.schedule.call(this,r,n,o)},t.prototype.flush=function(e){var t=this.actions;if(this.active)t.push(e);else{var r;this.active=!0;do{if(r=e.execute(e.state,e.delay))break}while(e=t.shift());if(this.active=!1,r){for(;e=t.shift();)e.unsubscribe();throw r}}},t}(Q),$=new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return A(t,e),t}(X))(Z),ee=new F((function(e){return e.complete()}));function te(e){return e?function(e){return new F((function(t){return e.schedule((function(){return t.complete()}))}))}(e):ee}function re(e){return e&&"function"==typeof e.schedule}var ne,oe=function(e){return function(t){for(var r=0,n=e.length;r0?e.prototype.requestAsyncId.call(this,t,r,n):(t.actions.push(this),t.scheduled||(t.scheduled=function(e){var t=ve++;return me[t]=!0,_e.then((function(){return ye(t)&&e()})),t}(t.flush.bind(t,null))))},t.prototype.recycleAsyncId=function(t,r,n){if(void 0===n&&(n=0),null!==n&&n>0||null===n&&this.delay>0)return e.prototype.recycleAsyncId.call(this,t,r,n);0===t.actions.length&&(function(e){ye(e)}(r),t.scheduled=void 0)},t}(Y),Ee=new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return A(t,e),t.prototype.flush=function(e){this.active=!0,this.scheduled=void 0;var t,r=this.actions,n=-1,o=r.length;e=e||r.shift();do{if(t=e.execute(e.state,e.delay))break}while(++n0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},t}(He);function We(e){return void 0===e&&(e=Number.POSITIVE_INFINITY),Fe(j,e)}function Ke(){return We(1)}function qe(){for(var e=[],t=0;t1?n.next(Array.prototype.slice.call(arguments)):n.next(e)}),n,r)}))}function Ze(e,t,r){return r?Ze(e,t).pipe(Oe((function(e){return R(e)?r.apply(void 0,e):r(e)}))):new F((function(r){var n,o=function(){for(var e=[],t=0;t=0}function Xe(e){var t=e.subscriber,r=e.counter,n=e.period;t.next(r),this.schedule({subscriber:t,counter:r+1,period:n},n)}function $e(){for(var e=[],t=0;t1&&"number"==typeof e[e.length-1]&&(r=e.pop())):"number"==typeof o&&(r=e.pop()),null===n&&1===e.length&&e[0]instanceof F?e[0]:We(r)(se(e,n))}function et(e,t){function r(){return!r.pred.apply(r.thisArg,arguments)}return r.pred=e,r.thisArg=t,r}function tt(e,t){return function(r){return r.lift(new rt(e,t))}}var rt=function(){function e(e,t){this.predicate=e,this.thisArg=t}return e.prototype.call=function(e,t){return t.subscribe(new nt(e,this.predicate,this.thisArg))},e}(),nt=function(e){function t(t,r,n){var o=e.call(this,t)||this;return o.predicate=r,o.thisArg=n,o.count=0,o}return A(t,e),t.prototype._next=function(e){var t;try{t=this.predicate.call(this.thisArg,e,this.count++)}catch(e){return void this.destination.error(e)}t&&this.destination.next(e)},t}(U);function ot(e,t,r){return[tt(t,r)(new F(Ue(e))),tt(et(t,r))(new F(Ue(e)))]}function it(){for(var e=[],t=0;t0&&r[0].time-n.now()<=0;)r.shift().notification.observe(o);if(r.length>0){var i=Math.max(0,r[0].time-n.now());this.schedule(e,i)}else this.unsubscribe(),t.active=!1},t.prototype._schedule=function(e){this.active=!0,this.destination.add(e.schedule(t.dispatch,this.delay,{source:this,destination:this.destination,scheduler:e}))},t.prototype.scheduleNotification=function(e){if(!0!==this.errored){var t=this.scheduler,r=new mt(t.now()+this.delay,e);this.queue.push(r),!1===this.active&&this._schedule(t)}},t.prototype._next=function(e){this.scheduleNotification(de.createNext(e))},t.prototype._error=function(e){this.errored=!0,this.queue=[],this.destination.error(e),this.unsubscribe()},t.prototype._complete=function(){this.scheduleNotification(de.createComplete()),this.unsubscribe()},t}(U),mt=function(e,t){this.time=e,this.notification=t};function yt(e){return function(t){return 0===e?te():t.lift(new gt(e))}}var gt=function(){function e(e){if(this.total=e,this.total<0)throw new Ce}return e.prototype.call=function(e,t){return t.subscribe(new Et(e,this.total))},e}(),Et=function(e){function t(t,r){var n=e.call(this,t)||this;return n.total=r,n.count=0,n}return A(t,e),t.prototype._next=function(e){var t=this.total,r=++this.count;r<=t&&(this.destination.next(e),r===t&&(this.destination.complete(),this.unsubscribe()))},t}(U);function St(e){return function(t){return t.lift(new bt(e))}}var bt=function(){function e(e){this.value=e}return e.prototype.call=function(e,t){return t.subscribe(new At(e,this.value))},e}(),At=function(e){function t(t,r){var n=e.call(this,t)||this;return n.value=r,n}return A(t,e),t.prototype._next=function(e){this.destination.next(this.value)},t}(U);function It(e,t,r){return void 0===r&&(r=Number.POSITIVE_INFINITY),"function"==typeof t?Fe((function(){return e}),t,r):("number"==typeof t&&(r=t),Fe((function(){return e}),r))}var Ct=function(){function e(e){this.predicate=e}return e.prototype.call=function(e,t){return t.subscribe(new Tt(e,this.predicate))},e}(),Tt=function(e){function t(t,r){var n=e.call(this,t)||this;return n.predicate=r,n.skipping=!0,n.index=0,n}return A(t,e),t.prototype._next=function(e){var t=this.destination;this.skipping&&this.tryCallPredicate(e),this.skipping||t.next(e)},t.prototype.tryCallPredicate=function(e){try{var t=this.predicate(e,this.index++);this.skipping=Boolean(t)}catch(e){this.destination.error(e)}},t}(U);function Ot(){for(var e=[],t=0;t0){var o=n.indexOf(r);-1!==o&&n.splice(o,1)}},t.prototype.notifyComplete=function(){},t.prototype._next=function(e){if(0===this.toRespond.length){var t=[e].concat(this.values);this.project?this._tryProject(t):this.destination.next(t)}},t.prototype._tryProject=function(e){var t;try{t=this.project.apply(this,e)}catch(e){return void this.destination.error(e)}this.destination.next(t)},t}(De),Wt=function(e,t){return e===t||"function"==typeof t&&e===t.toString()},Kt=function(){for(var e=arguments.length,t=Array(e),r=0;r=t.length?r(new rr(a,h,new tr(void 0,e[h]))):ir(e[h],t[h],r,n,a,h,s);for(;h=0?(ir(e[o],t[o],r,n,a,o,s),v=nr(v,c)):ir(e[o],void 0,r,n,a,o,s)})),v.forEach((function(e){ir(void 0,t[e],r,n,a,e,s)}))}s.length=s.length-1}else e!==t&&("number"===u&&isNaN(e)&&isNaN(t)||r(new $t(a,e,t)))}function sr(e,t,r,n){return n=n||[],ir(e,t,(function(e){e&&n.push(e)}),r),n.length?n:void 0}function ar(e,t,r){if(e&&t&&r&&r.kind){for(var n=e,o=-1,i=r.path?r.path.length-1:0;++o1?r-1:0),o=1;o1?t-1:0),n=1;n2?r-2:0),s=2;se,SET_RWG_SERVERS_LIST:e=>e,SET_RWG_RETRY_COUNT:e=>e,SET_XMPP_SOCKET_STATUS:e=>e,SET_IS_XMPP_SDK_LOADED:e=>e,SET_MAIN_SESSION_SOCKET_STATUS:e=>e,SET_CMD_CHANNEL_SOCKET_STATUS:e=>e,RESET_SOCKET:()=>({})}),ln=fr("CONNECT_TO_MEDIA_STREAM"),pn=fr("RECEIVE_PAYLOAD_FROM_MEDIA_SDK"),{setAudioEncodeStatus:hn,setAudioDecodeStatus:fn,setVideoEncodeStatus:vn,setVideoDecodeStatus:_n,setSharingEncodeStatus:mn,setSharingDecodeStatus:yn,setMediaConstraints:gn,setMediaEncryptKey:En,resetMedia:Sn}=Ur("SET_AUDIO_ENCODE_STATUS","SET_AUDIO_DECODE_STATUS","SET_VIDEO_ENCODE_STATUS","SET_VIDEO_DECODE_STATUS","SET_SHARING_ENCODE_STATUS","SET_SHARING_DECODE_STATUS","SET_MEDIA_CONSTRAINTS","SET_MEDIA_ENCRYPT_KEY","RESET_MEDIA");function bn(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),o=2;o{const t=e(...r);if(!t)throw new TypeError('combineEpics: one of the provided Epics "'.concat(e.name||"","\" does not return a stream. Double check you're not missing a return statement!"));return t.pipe(dt((e,t)=>(setTimeout(()=>{throw e},0),t)))}))};try{Object.defineProperty(n,"name",{value:"combineEpics(".concat(t.map(e=>e.name||"").join(", "),")")})}catch(e){}return n}function In(){for(var e=arguments.length,t=new Array(e),r=0;rObject.values(e));return An(...n)}function Cn(e,t){return e.pipe(Kt("".concat(zr)),tt(e=>e.payload.evt===t))}function Tn(e,t){return e.pipe(Kt("".concat(Yr)),tt(e=>e.payload.event===t))}function On(e,t){return e.pipe(Kt("".concat(tn)),tt(e=>e.payload.evt===t))}function wn(e,t){return e.pipe(Kt("".concat(zr),"".concat(en)),tt(e=>e.payload.evt===t))}function Rn(e,t){return e.pipe(Kt("".concat(pn)),tt(e=>Array.isArray(t)?t.indexOf(e.payload.type)>-1:e.payload.type===t))}var Dn="undefined"!=typeof window&&window,Nn="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,Pn="undefined"!=typeof global&&global,Mn=Dn||Pn||Nn;function kn(e,t){return void 0===t&&(t=null),new Fn({method:"GET",url:e,headers:t})}function Un(e,t,r){return new Fn({method:"POST",url:e,body:t,headers:r})}function Ln(e,t){return new Fn({method:"DELETE",url:e,headers:t})}function Vn(e,t,r){return new Fn({method:"PUT",url:e,body:t,headers:r})}function jn(e,t,r){return new Fn({method:"PATCH",url:e,body:t,headers:r})}!function(){if(!Mn)throw new Error("RxJS could not find any global context (window, self, global)")}();var Hn=Oe((function(e,t){return e.response}));function xn(e,t){return Hn(new Fn({method:"GET",url:e,responseType:"json",headers:t}))}var Fn=function(e){function t(t){var r=e.call(this)||this,n={async:!0,createXHR:function(){return this.crossDomain?function(){if(Mn.XMLHttpRequest)return new Mn.XMLHttpRequest;if(Mn.XDomainRequest)return new Mn.XDomainRequest;throw new Error("CORS is not supported by your browser")}():function(){if(Mn.XMLHttpRequest)return new Mn.XMLHttpRequest;var e=void 0;try{for(var t=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],r=0;r<3;r++)try{if(e=t[r],new Mn.ActiveXObject(e))break}catch(e){}return new Mn.ActiveXObject(e)}catch(e){throw new Error("XMLHttpRequest is not supported by your browser")}}()},crossDomain:!0,withCredentials:!1,headers:{},method:"GET",responseType:"json",timeout:0};if("string"==typeof t)n.url=t;else for(var o in t)t.hasOwnProperty(o)&&(n[o]=t[o]);return r.request=n,r}var r;return A(t,e),t.prototype._subscribe=function(e){return new Bn(e,this.request)},t.create=((r=function(e){return new t(e)}).get=kn,r.post=Un,r.delete=Ln,r.put=Vn,r.patch=jn,r.getJSON=xn,r),t}(F),Bn=function(e){function t(t,r){var n=e.call(this,t)||this;n.request=r,n.done=!1;var o=r.headers=r.headers||{};return r.crossDomain||n.getHeader(o,"X-Requested-With")||(o["X-Requested-With"]="XMLHttpRequest"),n.getHeader(o,"Content-Type")||Mn.FormData&&r.body instanceof Mn.FormData||void 0===r.body||(o["Content-Type"]="application/x-www-form-urlencoded; charset=UTF-8"),r.body=n.serializeBody(r.body,n.getHeader(r.headers,"Content-Type")),n.send(),n}return A(t,e),t.prototype.next=function(e){this.done=!0;var t,r=this.xhr,n=this.request,o=this.destination;try{t=new Gn(e,r,n)}catch(e){return o.error(e)}o.next(t)},t.prototype.send=function(){var e=this.request,t=this.request,r=t.user,n=t.method,o=t.url,i=t.async,s=t.password,a=t.headers,c=t.body;try{var u=this.xhr=e.createXHR();this.setupEvents(u,e),r?u.open(n,o,i,r,s):u.open(n,o,i),i&&(u.timeout=e.timeout,u.responseType=e.responseType),"withCredentials"in u&&(u.withCredentials=!!e.withCredentials),this.setHeaders(u,a),c?u.send(c):u.send()}catch(e){this.error(e)}},t.prototype.serializeBody=function(e,t){if(!e||"string"==typeof e)return e;if(Mn.FormData&&e instanceof Mn.FormData)return e;if(t){var r=t.indexOf(";");-1!==r&&(t=t.substring(0,r))}switch(t){case"application/x-www-form-urlencoded":return Object.keys(e).map((function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])})).join("&");case"application/json":return JSON.stringify(e);default:return e}},t.prototype.setHeaders=function(e,t){for(var r in t)t.hasOwnProperty(r)&&e.setRequestHeader(r,t[r])},t.prototype.getHeader=function(e,t){for(var r in e)if(r.toLowerCase()===t.toLowerCase())return e[r]},t.prototype.setupEvents=function(e,t){var r,n,o=t.progressSubscriber;function i(e){var t,r=i,n=r.subscriber,o=r.progressSubscriber,s=r.request;o&&o.error(e);try{t=new qn(this,s)}catch(e){t=e}n.error(t)}(e.ontimeout=i,i.request=t,i.subscriber=this,i.progressSubscriber=o,e.upload&&"withCredentials"in e)&&(o&&(r=function(e){r.progressSubscriber.next(e)},Mn.XDomainRequest?e.onprogress=r:e.upload.onprogress=r,r.progressSubscriber=o),n=function(e){var t,r=n,o=r.progressSubscriber,i=r.subscriber,s=r.request;o&&o.error(e);try{t=new Wn("ajax error",this,s)}catch(e){t=e}i.error(t)},e.onerror=n,n.request=t,n.subscriber=this,n.progressSubscriber=o);function s(e){}function a(e){var t=a,r=t.subscriber,n=t.progressSubscriber,o=t.request;if(4===this.readyState){var i=1223===this.status?204:this.status,s="text"===this.responseType?this.response||this.responseText:this.response;if(0===i&&(i=s?200:0),i<400)n&&n.complete(),r.next(e),r.complete();else{n&&n.error(e);var c=void 0;try{c=new Wn("ajax error "+i,this,o)}catch(e){c=e}r.error(c)}}}e.onreadystatechange=s,s.subscriber=this,s.progressSubscriber=o,s.request=t,e.onload=a,a.subscriber=this,a.progressSubscriber=o,a.request=t},t.prototype.unsubscribe=function(){var t=this.done,r=this.xhr;!t&&r&&4!==r.readyState&&"function"==typeof r.abort&&r.abort(),e.prototype.unsubscribe.call(this)},t}(U),Gn=function(e,t,r){this.originalEvent=e,this.xhr=t,this.request=r,this.status=t.status,this.responseType=t.responseType||r.responseType,this.response=Kn(this.responseType,t)},Wn=function(){function e(e,t,r){return Error.call(this),this.message=e,this.name="AjaxError",this.xhr=t,this.request=r,this.status=t.status,this.responseType=t.responseType||r.responseType,this.response=Kn(this.responseType,t),this}return e.prototype=Object.create(Error.prototype),e}();function Kn(e,t){switch(e){case"json":return function(e){return"response"in e?e.responseType?e.response:JSON.parse(e.response||e.responseText||"null"):JSON.parse(e.responseText||"null")}(t);case"xml":return t.responseXML;case"text":default:return"response"in t?t.response:t.responseText}}var qn=function(e,t){return Wn.call(this,"ajax timeout",e,t),this.name="AjaxTimeoutError",this},zn=Fn.create;const Jn={default:{"apac.errorcodes_success":"Successfully joined the meeting.","apac.errorcodes_fail":"Fail to join the meeting.","apac.errorcodes_not_init":"Meeting not initialized.","apac.errorcodes_register":"This webinar requires registration.","apac.errorcodes_email_require":"Email is missing to attend webinar.","apac.errorcodes_not_exist":"Meeting does not exist.","apac.errorcodes_not_host":"You are not the meeting host.","apac.errorcodes_wrong_pass":"Meeting Passcode wrong.","apac.errorcodes_not_start":"Meeting has not started","apac.errorcodes_re_connect":"Meeting is reconnecting.","apac.errorcodes_be_removed":"Be removed.","apac.errorcodes_disconnect":"Meeting has been disconnected.","apac.errorcodes_denied_register_with_panelist":"Denied register use panelist email.","apac.errorcodes_web_has_in_progress":"Already has other meetings in progress.","apac.errorcodes_web_require_email":"User email is required.","apac.errorcodes_web_not_support_webinar_pac":"Not support webinar and personal audio conference","apac.errorcodes_web_host_not_exit":"The meeting host does not exist.","apac.errorcodes_web_not_support_webclient":"Not support start or join meeting from web.","apac.errorcodes_web_should_support_webinar_with_latest_version":"The current sdk version doesn't support webinar, please upgrade to the latest version.","apac.errorcodes_web_invalid_id":"Invalid meeting ID.","apac.errorcodes_web_not_support_registration_webinar":"Not support registration webinar","apac.errorcodes_web_not_support_tsp":"Not support start or join meeting from web, when you chose TSP as his audio in a meeting.","apac.errorcodes_web_not_allow_start_webinar_from_web":"Not allow to start webinar from web.","apac.errorcodes_pac_api_wrong":"The accounts API Key is not valid.","apac.errorcodes_pac_signature_expired":"The signature has expired.","apac.errorcodes_pac_mn_wrong":"The meeting number is wrong.","apac.errorcodes_pac_mn_not_fount":"The meeting number is not found.","apac.errorcodes_pac_role_error":"Incorrect role.","apac.errorcodes_pac_host_not_found":"The meeting host is not found.","apac.errorcodes_pac_api_disabled":"The accounts API Key is deactivated.","apac.errorcodes_pac_cant_host_other_mn":"Cannot not host another meeting concurrently.","apac.errorcodes_pac_invalid_signature":"Signature is invalid.","apac.errorcodes_pac_no_permission":"No permission.","apac.errorcodes_need_use_zoom_desktop_or_mobile":"Unable join from browser, please join using the Zoom desktop client or mobile app.","apac.errorcodes_rwc_empty":"Could not get a response from the web server.","apac.errorcodes_rwc_error":"Could not connect to Web Server error.","apac.errorcodes_frequent_call":"You have reached the API limit for this call.","apac.errorcodes_frequent_join":"You be limit by zoom, need to check recaptcha.","apac.errorcodes_offline":"The service is temporarily offline.","apac.errorcodes_wasm_fail":"Download wasm files error, please check your network and firewall.","apac.errorcodes_denied_email":"Email is blocked by Administrator.","apac.errorcodes_tk_expired":"Token has expired.","apac.invalid_parameter":"Invalid Parameter","apac.errorcodes_login_required":"Require login","apac.errorcodes_upgrade":"Your sdk version needs to be {0} or higher to join the meeting"},"de-DE":{"apac.errorcodes_web_has_in_progress":"Hat bereits andere laufende Meetings.","apac.errorcodes_web_require_email":"E-Mail-Adresse von Benutzer erforderlich.","apac.errorcodes_web_not_support_webinar_pac":"Unterstützen Webinar und persönliche Audiokonferenz nicht","apac.errorcodes_web_host_not_exit":"Der Meeting-Host ist nicht vorhanden.","apac.errorcodes_web_not_support_webclient":"Start nicht unterstützt bzw. starten Sie das Meeting aus dem Web.","apac.errorcodes_web_should_support_webinar_with_latest_version":"Ihre aktuelle SDK-Version unterstützt keine Webinare. Aktualisieren Sie bitte auf die neueste Version.","apac.errorcodes_web_invalid_id":"Ungültige Meeting-ID.","apac.errorcodes_web_not_support_registration_webinar":"Registrierung für Webinar wird nicht unterstützt","apac.errorcodes_web_not_support_tsp":"Sie unterstützen nicht den Start oder die Teilnahme an einem Meeting aus dem Web, wenn Sie den Telefonieanbieter als seinen Audiobeitrag in einem Meeting gewählt haben.","apac.errorcodes_web_not_allow_start_webinar_from_web":"Das Starten eines Webinars vom Internet aus ist nicht zulässig.","apac.errorcodes_need_use_zoom_desktop_or_mobile":"Unfähig beitreten aus Browser, verbinden Sie bitte den Zoom-Desktop-Client oder mobile App."},"es-ES":{"apac.errorcodes_web_has_in_progress":"Ya posee otras reuniones en curso.","apac.errorcodes_web_require_email":"Se requiere correo electrónico del usuario.","apac.errorcodes_web_not_support_webinar_pac":"No soporta seminario web o conferencia de audio personal","apac.errorcodes_web_host_not_exit":"El anfitrión de la reunión no existe.","apac.errorcodes_web_not_support_webclient":"No se puede iniciar ni entrar a una reunión desde la web.","apac.errorcodes_web_should_support_webinar_with_latest_version":"La versión actual de sdk no es compatible con el seminario web, actualice a la última versión.","apac.errorcodes_web_invalid_id":"ID de reunión no válida.","apac.errorcodes_web_not_support_registration_webinar":"Seminario web que no es compatible con la inscripción","apac.errorcodes_web_not_support_tsp":"Cuando eligió el proveedor de servicios telefónicos como audio en una reunión, no se puede iniciar o unirse una reunión desde el sitio web.","apac.errorcodes_web_not_allow_start_webinar_from_web":"No se permite comenzar un seminario web desde la web.","apac.errorcodes_need_use_zoom_desktop_or_mobile":"No puede unirse desde el navegador, por favor unirse usando el cliente de escritorio Zoom o aplicación móvil."},"fr-FR":{"apac.errorcodes_web_has_in_progress":"Il a déjà d’autres réunions en cours.","apac.errorcodes_web_require_email":"Le courriel de l’utilisateur est requis.","apac.errorcodes_web_not_support_webinar_pac":"Ne prend pas en charge le webinaire ni la conférence audio personnelle","apac.errorcodes_web_host_not_exit":"L’animateur de la réunion n’existe pas.","apac.errorcodes_web_not_support_webclient":"Ne supporte pas démarrer ou rejoindre une réunion à partir du web.","apac.errorcodes_web_should_support_webinar_with_latest_version":"La version actuelle du SDK ne prend pas en charge le webinaire, veuillez passer à la dernière version.","apac.errorcodes_web_invalid_id":"Nº de réunion non valide.","apac.errorcodes_web_not_support_registration_webinar":"Ne prend pas en charge le webinaire d’inscription","apac.errorcodes_web_not_support_tsp":"Ne peut pas démarrer ou rejoindre la réunion depuis Internet, lorsque vous sélectionnez le fournisseur de service en téléphonie comma sa sortie audio dans une réunion.","apac.errorcodes_web_not_allow_start_webinar_from_web":"Ne pas permettre de démarrer des webinaires à partir du Web.","apac.errorcodes_need_use_zoom_desktop_or_mobile":"Impossible de rejoindre le navigateur, s'il vous plaît rejoindre en utilisant le client de bureau Zoom ou une application mobile."},"jp-JP":{"apac.errorcodes_web_has_in_progress":"すでに他のミーティングが始まっています。","apac.errorcodes_web_require_email":"ユーザーメールは必要です。","apac.errorcodes_web_not_support_webinar_pac":"ウェビナーとパーソナル音声会議がサポートされていません","apac.errorcodes_web_host_not_exit":"このミーティングのホストは存在しません。","apac.errorcodes_web_not_support_webclient":"ウェブからのミーティング開始/参加はサポートされません。","apac.errorcodes_web_should_support_webinar_with_latest_version":"現在のSDKバージョンはウェビナーをサポートしていません。最新バージョンにアップグレードしてください。","apac.errorcodes_web_invalid_id":"無効なミーティングIDです。","apac.errorcodes_web_not_support_registration_webinar":"登録ウェビナー非対応","apac.errorcodes_web_not_support_tsp":"ミーティングのオーディオにテレフォニーサービスプロバイダを選択した場合、ウェブからミーティングを開始したり、ミーティングに参加したりできません。","apac.errorcodes_web_not_allow_start_webinar_from_web":"ウェビナーをウェブから開始できません。","apac.errorcodes_need_use_zoom_desktop_or_mobile":"できませんが、ブラウザから参加し、ズームデスクトップクライアントやモバイルアプリを使用して参加してください。"},"pt-PT":{"apac.errorcodes_web_has_in_progress":"Já há outras reuniões em andamento.","apac.errorcodes_web_require_email":"O e-mail do usuário é obrigatório.","apac.errorcodes_web_not_support_webinar_pac":"Não há suporte para webinar e audioconferência pessoal","apac.errorcodes_web_host_not_exit":"O anfitrião da reunião não existe.","apac.errorcodes_web_not_support_webclient":"Não há suporte para iniciar ou entrar na reunião pela web.","apac.errorcodes_web_should_support_webinar_with_latest_version":"A versão sdk atual não oferece suporte para webinar. Atualize para a versão mais recente.","apac.errorcodes_web_invalid_id":"ID da reunião inválido.","apac.errorcodes_web_not_support_registration_webinar":"O registro do webinar não é compatível","apac.errorcodes_web_not_support_tsp":"Não é compatível iniciar ou ingressar na reunião pela web ao escolher o áudio do provedor de serviços de telefonia em uma reunião.","apac.errorcodes_web_not_allow_start_webinar_from_web":"Não é permitido iniciar o webinar na web.","apac.errorcodes_need_use_zoom_desktop_or_mobile":"Incapaz juntar-se a partir do navegador, por favor, junte-se usando o cliente de desktop Zoom ou aplicativo móvel."},"ru-RU":{"apac.errorcodes_web_has_in_progress":"Уже участвует в других конференциях.","apac.errorcodes_web_require_email":"Требуется почта пользователя.","apac.errorcodes_web_not_support_webinar_pac":"Не поддерживает веб-семинар и персональную аудиоконференцию","apac.errorcodes_web_host_not_exit":"Организатор конференции не существует.","apac.errorcodes_web_not_support_webclient":"Запуск или вход в конференцию через сеть не поддерживается.","apac.errorcodes_web_should_support_webinar_with_latest_version":"Текущая версия пакета SDK не поддерживает вебинары. Выполните обновление до последней версии.","apac.errorcodes_web_invalid_id":"Неверный идентификатор конференции.","apac.errorcodes_web_not_support_registration_webinar":"Регистрация на вебинар не поддерживается","apac.errorcodes_web_not_support_tsp":"Если для аудиоконференции используется поставщик службы телефонии, такую конференцию невозможно начать или подключиться к ней через браузер.","apac.errorcodes_web_not_allow_start_webinar_from_web":"Запуск веб-семинара через Интернет запрещен.","apac.errorcodes_need_use_zoom_desktop_or_mobile":"Невозможно присоединиться из браузера, пожалуйста, присоединяйтесь с помощью настольного клиента Увеличить или мобильное приложение."},"zh-CN":{"apac.errorcodes_web_has_in_progress":"已经有另一场会议正在进行。","apac.errorcodes_web_require_email":"必须提供用户电子邮件地址。","apac.errorcodes_web_not_support_webinar_pac":"非支持的网络研讨会和个人音频会议","apac.errorcodes_web_host_not_exit":"会议主持人不存在。","apac.errorcodes_web_not_support_webclient":"不支持从 Web 开始或加入会议。","apac.errorcodes_web_should_support_webinar_with_latest_version":"当前 sdk 版本不支持网络研讨会,请升级到最新版本。","apac.errorcodes_web_invalid_id":"无效的会议ID。","apac.errorcodes_web_not_support_registration_webinar":"不支持注册网络研讨会","apac.errorcodes_web_not_support_tsp":"如果选择电话语音服务提供商作为会议音频,则不支持通过网络开始或加入会议。","apac.errorcodes_web_not_allow_start_webinar_from_web":"不允许通过网络开始网络研讨会","apac.errorcodes_need_use_zoom_desktop_or_mobile":"从浏览器无法加入,请加入使用缩放桌面客户端或移动应用程序。"},"zh-TW":{"apac.errorcodes_web_has_in_progress":"已有其他會議正在進行中。","apac.errorcodes_web_require_email":"必須提供使用者電子郵件地址。","apac.errorcodes_web_not_support_webinar_pac":"不支援網路研討會和個人音訊會議","apac.errorcodes_web_host_not_exit":"會議主持人不存在。","apac.errorcodes_web_not_support_webclient":"不支援從 Web 開始或加入會議。","apac.errorcodes_web_should_support_webinar_with_latest_version":"目前的 SDK 版本不支援網路研討會,請升級至最新版本。","apac.errorcodes_web_invalid_id":"無效的會議 ID 。","apac.errorcodes_web_not_support_registration_webinar":"不支援註冊網路研討會","apac.errorcodes_web_not_support_tsp":"當您選擇電話語音服務供應商做為會議語音使用時,不支援經由網頁召開或加入會議。","apac.errorcodes_web_not_allow_start_webinar_from_web":"不允許從 Web 開始網路研討會。","apac.errorcodes_need_use_zoom_desktop_or_mobile":"從瀏覽器無法加入,請加入使用縮放桌面客戶端或移動應用程序。"},"ko-KO":{"apac.errorcodes_web_has_in_progress":"이미 다른 회의가 진행 중입니다.","apac.errorcodes_web_require_email":"사용자 이메일이 필요합니다.","apac.errorcodes_web_not_support_webinar_pac":"웨비나 및 개인 오디오 전화 회의를 지원하지 않음","apac.errorcodes_web_host_not_exit":"회의 호스트가 없습니다.","apac.errorcodes_web_not_support_webclient":"웹에서 회의를 시작하거나 참여하는 것은 지원하지 않습니다.","apac.errorcodes_web_should_support_webinar_with_latest_version":"현재 SDK 버전은 웨비나를 지원하지 않습니다. 최신 버전으로 업그레이드하십시오.","apac.errorcodes_web_invalid_id":"회의 ID가 잘못되었습니다.","apac.errorcodes_web_not_support_registration_webinar":"등록 웨비나를 지원하지 않음","apac.errorcodes_web_not_support_tsp":"회의에서 Telephony Service Provider를 오디오로 선택한 경우 웹에서 회의를 시작하거나 회의에 참가할 수 없습니다.","apac.errorcodes_web_not_allow_start_webinar_from_web":"웹에서 웨비나를 시작할 수 없습니다.","apac.errorcodes_need_use_zoom_desktop_or_mobile":"수 없습니다 브라우저에서 조인 줌 데스크톱 클라이언트 또는 모바일 앱을 사용하여 가입하시기 바랍니다."},"vi-VN":{"apac.errorcodes_web_has_in_progress":"Đã có cuộc họp khác đang diễn ra.","apac.errorcodes_web_require_email":"Email người dùng là bắt buộc.","apac.errorcodes_web_not_support_webinar_pac":"Không hỗ trợ hội thảovideo và hội nghị âm thanh cá nhân","apac.errorcodes_web_host_not_exit":"Người chủ trì cuộc họp không tồn tại.","apac.errorcodes_web_not_support_webclient":"Không hỗ trợ bắt đầu hoặc vào cuộc họp từ web.","apac.errorcodes_web_should_support_webinar_with_latest_version":"Phiên bản sdk hiện tại không hỗ trợ hội thảo trực tuyến, hãy nâng cấp lên phiên bản mới nhất.","apac.errorcodes_web_invalid_id":"ID cuộc họp không hợp lệ.","apac.errorcodes_web_not_support_registration_webinar":"Không hỗ trợ đăng ký hội thảo trực tuyến","apac.errorcodes_web_not_support_tsp":"Không hỗ trợ bắt đầu hoặc vào cuộc họp từ web, khi bạn chọn Nhà cung cấp dịch vụ điện thoại làm nguồn âm thanh trong cuộc họp.","apac.errorcodes_web_not_allow_start_webinar_from_web":"Không cho phép bắt đầu hội thảo trực tuyến từ web.","apac.errorcodes_need_use_zoom_desktop_or_mobile":"Không thể tham gia từ trình duyệt, hãy tham gia bằng cách sử dụng client desktop Phóng to hoặc ứng dụng di động."},"it-IT":{"apac.errorcodes_web_has_in_progress":"Sta partecipando a un’altra riunione in corso.","apac.errorcodes_web_require_email":"È richiesta l’email dell’utente.","apac.errorcodes_web_not_support_webinar_pac":"Non supporta webinar e conferenza audio personale","apac.errorcodes_web_host_not_exit":"L’ospite della riunione non esiste.","apac.errorcodes_web_not_support_webclient":"Non supporta l’avvio o la partecipazione alla riunione dal Web.","apac.errorcodes_web_should_support_webinar_with_latest_version":"La versione sdk corrente non supporta i webinar. Effettua l’aggiornamento alla versione più recente.","apac.errorcodes_web_invalid_id":"ID riunione non valido.","apac.errorcodes_web_not_support_registration_webinar":"Non supporta webinar con iscrizione","apac.errorcodes_web_not_support_tsp":"In caso che hai selezionato il fornitore di servizio telefonico come l’audio in riunione, non supporta l’avvio o la partecipazione alla riunione dal Web.","apac.errorcodes_web_not_allow_start_webinar_from_web":"Non è consentito avviare il webinar dal Web.","apac.errorcodes_need_use_zoom_desktop_or_mobile":"Impossibile unirsi dal browser, si prega di unirsi con il client desktop Zoom o app mobile."}},Yn=Jn.default;let Zn,Qn,Xn;function $n(e,t){return t in Yn?Yn[t]:e}!function(e){e[e.CONF_SUCCESS=0]="CONF_SUCCESS",e[e.CONF_FAIL_MEETING_OVER=6]="CONF_FAIL_MEETING_OVER",e[e.CONF_FAIL_CONF_USER_FULL=9]="CONF_FAIL_CONF_USER_FULL",e[e.CONF_FAIL_CONFLOCKED=12]="CONF_FAIL_CONFLOCKED",e[e.CONF_FAIL_WEBINAR_DENIED_EMAIL=3033]="CONF_FAIL_WEBINAR_DENIED_EMAIL",e[e.CONF_FAIL_MEETING_HAS_CLOSED=103003]="CONF_FAIL_MEETING_HAS_CLOSED",e[e.CONF_FAIL_HAS_BEEN_REMOVED=103039]="CONF_FAIL_HAS_BEEN_REMOVED",e[e.CONF_RESULT_MMR_IB_REJECT=103043]="CONF_RESULT_MMR_IB_REJECT",e[e.CONF_FAIL_RESULT_MMR_CONF_PARTICIPANT_EXISTS=103044]="CONF_FAIL_RESULT_MMR_CONF_PARTICIPANT_EXISTS"}(Zn||(Zn={})),function(e){e[e.LEAVEREASON_RECONNECT=5]="LEAVEREASON_RECONNECT",e[e.LEAVEREASON_KICKEDBYHOST=7]="LEAVEREASON_KICKEDBYHOST",e[e.LEAVEREASON_ENDBYHOST=8]="LEAVEREASON_ENDBYHOST",e[e.LEAVEREASON_ENDBYHOSTSTARTANOTHERMEETING=9]="LEAVEREASON_ENDBYHOSTSTARTANOTHERMEETING",e[e.LEAVEREASON_NORMAL=1]="LEAVEREASON_NORMAL"}(Qn||(Qn={})),function(e){e[e.LEAVESUBREASON_WAITINGROOMFAILOVER=1]="LEAVESUBREASON_WAITINGROOMFAILOVER"}(Xn||(Xn={}));const eo={ANOTHER_MEETING_RUNNING:3e3,ERROR_NOT_EXIST:3001,ERROR_NOT_HOST:3003,WRONG_MEETING_PASSWORD:3004,EMAIL_REQUIRED:3005,MEETING_NOT_START:3008,BE_REMOVED:3009,ERROR_WEBINAR_ENFORCE_LOGIN:3034,NEED_REAL_NAME:3082,REGISTER_REQUIRED:3099,SSO_LOGIN_WINDOW:6024,ZOOM_LOGIN_WINDOW:3051,ZOOM_SPECIFIC_LOGIN_WINDOW:3052,LOGIN_REQUIRED:3100,RE_CONNECTING:4e3,DISCONNECT:4001,INVALID_PARAMETER:4003,DENIED_REGISTER_WITH_PANELIST:3032,SERVICE_OFFLINE:403,RWC_EMPTY:3621,RWC_ERROR:3622,FREQUENT_CALL:3633,FREQUENT_JOIN:3634,WASM_FAIL:3635,COMMON_ERROR:200,COMMON_SUCCESS:0,UPGRADE:1e3},to={SUCCESS:"apac.errorcodes_success",FAIL:"apac.errorcodes_fail",MEETING_NOT_INIT:"apac.errorcodes_not_init",REGISTER_REQUIRED:"apac.errorcodes_register",LOGIN_REQUIRED:"apac.errorcodes_login_required",SSO_LOGIN_WINDOW:"apac.errorcodes_login_required",ZOOM_LOGIN_WINDOW:"apac.errorcodes_login_required",ZOOM_SPECIFIC_LOGIN_WINDOW:"apac.errorcodes_login_required",EMAIL_REQUIRED:"apac.errorcodes_email_require",ERROR_NOT_EXIST:"apac.errorcodes_not_exist",ERROR_NOT_HOST:"apac.errorcodes_not_host",WRONG_MEETING_PASSWORD:"apac.errorcodes_wrong_pass",ANOTHER_MEETING_RUNNING:"apac.errorcodes_meeting_has_in_progress",MEETING_NOT_START:"apac.errorcodes_not_start",INVALID_PARAMETER:"apac.invalid_parameter",RE_CONNECTING:"apac.errorcodes_re_connect",BE_REMOVED:"apac.errorcodes_be_removed",ERROR_WEBINAR_ENFORCE_LOGIN:"apac.errorcodes_webinar_enforce_login",DISCONNECT:"apac.errorcodes_disconnect",DENIED_REGISTER_WITH_PANELIST:"apac.errorcodes_denied_register_with_panelist",RWC_EMPTY:"apac.errorcodes_rwc_empty",RWC_ERROR:"apac.errorcodes_rwc_error",FREQUENT_CALL:"apac.errorcodes_frequent_call",FREQUENT_JOIN:"apac.errorcodes_frequent_join",WASM_FAIL:"apac.errorcodes_wasm_fail",UPGRADE:"apac.errorcodes_upgrade"},ro={3e3:{"apac.errorcodes_web_has_in_progress":3e3,"apac.errorcodes_web_require_email":3005,"apac.errorcodes_web_not_support_webinar_pac":3701,"apac.errorcodes_web_host_not_exit":3702,"apac.errorcodes_web_not_support_webclient":3603,"apac.errorcodes_web_should_support_webinar_with_latest_version":3604,"apac.errorcodes_web_invalid_id":3703,"apac.errorcodes_web_not_support_registration_webinar":3606,"apac.errorcodes_web_not_support_tsp":3608,"apac.errorcodes_web_not_allow_start_webinar_from_web":3609,"apac.errorcodes_need_use_zoom_desktop_or_mobile":3611},3001:{"apac.errorcodes_not_exist":3610},200:{"apac.errorcodes_pac_api_wrong":3704,"apac.errorcodes_pac_signature_expired":3705,"apac.errorcodes_pac_mn_wrong":3706,"apac.errorcodes_pac_mn_not_fount":3707,"apac.errorcodes_pac_role_error":3708,"apac.errorcodes_pac_host_not_found":3709,"apac.errorcodes_pac_api_disabled":3710,"apac.errorcodes_pac_cant_host_other_mn":3711,"apac.errorcodes_pac_invalid_signature":3712,"apac.errorcodes_pac_no_permission":3713},3099:{"apac.errorcodes_register":3099},3100:{"apac.errorcodes_login_required":3100},3003:{"apac.errorcodes_not_host":3003},3004:{"apac.errorcodes_wrong_pass":3004},3008:{"apac.errorcodes_not_start":3008},3009:{"apac.errorcodes_be_removed":3009},3501:{"apac.errorcodes_login_required":3082},3502:{"apac.errorcodes_login_required":3082},3032:{"apac.errorcodes_denied_register_with_panelist":3100},3033:{"apac.errorcodes_denied_email":3620},3059:{"apac.errorcodes_not_support_simulive":3630},3082:{"apac.errorcodes_real_name":3082},403:{"apac.errorcodes_offline":403},404:{"apac.errorcodes_offline":403},4003:{"apac.invalid_parameter":4003},124:{"apac.errorcodes_tk_expired":3610},3136:{"apac.errorcodes_require_host":3709}},no={3004:{"apac.errorcodes_pac_mn_wrong":3714},3005:{"apac.errorcodes_web_has_in_progress":3e3},3008:{"apac.errorcodes_not_start":3008},3033:{"apac.errorcodes_denied_email":3620},1005:{"apac.errorcodes_denied_email":3620},103039:{"apac.errorcodes_be_removed":3009},6:{"meeting ended":4004},9:{"meeting is at capacity":4005},12:{"meeting locked":4006},103043:{"reject for information barriers":4007},103044:{"participant exist":4008}};function oo(e,t){return Object.keys(e).find(r=>e[r]===t)}let io;function so(e,t){const{key:r,value:n}=function(e,t){let r=!1;if(-1===e)return{key:"apac.errorcodes_offline",value:403};if(3e3===e){const n=["en-US","de-DE","es-ES","en-US","fr-FR","jp-JP","pt-PT","ru-RU","zh-CN","zh-TW","ko_KO","vi-VN","it-IT"];let o={};if(io)o=io;else{const e=Object.keys(ro[3e3]);n.forEach(t=>{const r=function(e){return"en-US"===e&&(e="default"),Jn[e]||Jn.default}(t);o[t]={},e.forEach(e=>{o[t][e]=r[e]})}),io=o}return n.forEach(n=>{if(r)return;const i=oo(o[n],t);i&&(r={key:i,value:ro[e][i]})}),r||(r={key:"apac.errorcodes_fail",value:200}),r}if(200===e){const n=oo({"apac.errorcodes_pac_api_wrong":"The api key is wrong.","apac.errorcodes_pac_signature_expired":"The signature has expired.","apac.errorcodes_pac_mn_wrong":"The meeting number is wrong.","apac.errorcodes_pac_mn_not_fount":"The meeting number is not found.","apac.errorcodes_pac_role_error":"The role is not applicable.","apac.errorcodes_pac_host_not_found":"The meeting host is not found.","apac.errorcodes_pac_api_disabled":"The account don't enable API.","apac.errorcodes_pac_cant_host_other_mn":"Can not be host in other account's meeting.","apac.errorcodes_pac_invalid_signature":"Invalid signature.","apac.errorcodes_pac_no_permission":"No permission"},t);return r=n?{key:n,value:ro[e][n]}:{key:"apac.errorcodes_fail",value:200},r}if(void 0!==ro[e]){const t=ro[e],n=Object.keys(t)[0];r={key:n,value:t[n]}}if(r)return r;const n=oo(eo,e),o=to[n];return o?{key:o,value:e}:{key:"apac.errorcodes_fail",value:200}}(e,t),o=$n(r,r);return r!==o?{reason:o,errorCode:n}:{reason:Yn[r],errorCode:n}}function ao(e){let t=!1;const r="number"==typeof e?e:e.body.res;if(void 0!==no[r]){const e=no[r],n=Object.keys(e)[0];t={key:n,value:e[n]}}if(t){const{key:r,value:n}=t,o=$n(r,r);return r!==o?Object.assign({},e,{reason:o,errorCode:n}):Object.assign({},e,{reason:Yn[r],errorCode:n})}const n=so(r);return Object.assign({},e,{reason:n.reason,errorCode:n.errorCode})}var co="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function uo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function lo(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},r.exports),r.exports}var po=lo((function(e,t){!function(t,r){e.exports=function(t){var r,n=(t=t||{}).Base64,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=function(e){for(var t={},r=0,n=e.length;r>>6)+s(128|63&t):s(224|t>>>12&15)+s(128|t>>>6&63)+s(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return s(240|t>>>18&7)+s(128|t>>>12&63)+s(128|t>>>6&63)+s(128|63&t)},c=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,u=function(e){return e.replace(c,a)},d=function(e){var t=[0,2,1][e.length%3],r=e.charCodeAt(0)<<16|(e.length>1?e.charCodeAt(1):0)<<8|(e.length>2?e.charCodeAt(2):0);return[o.charAt(r>>>18),o.charAt(r>>>12&63),t>=2?"=":o.charAt(r>>>6&63),t>=1?"=":o.charAt(63&r)].join("")},l=t.btoa&&"function"==typeof t.btoa?function(e){return t.btoa(e)}:function(e){if(e.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return e.replace(/[\s\S]{1,3}/g,d)},p=function(e){return l(u(String(e)))},h=function(e){return e.replace(/[+\/]/g,(function(e){return"+"==e?"-":"_"})).replace(/=/g,"")},f=function(e,t){return t?h(p(e)):p(e)};t.Uint8Array&&(r=function(e,t){for(var r="",n=0,i=e.length;n>>18)+o.charAt(u>>>12&63)+(void 0!==a?o.charAt(u>>>6&63):"=")+(void 0!==c?o.charAt(63&u):"=")}return t?h(r):r});var v,_=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,m=function(e){switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return s(55296+(t>>>10))+s(56320+(1023&t));case 3:return s((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return s((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},y=function(e){return e.replace(_,m)},g=function(e){var t=e.length,r=t%4,n=(t>0?i[e.charAt(0)]<<18:0)|(t>1?i[e.charAt(1)]<<12:0)|(t>2?i[e.charAt(2)]<<6:0)|(t>3?i[e.charAt(3)]:0),o=[s(n>>>16),s(n>>>8&255),s(255&n)];return o.length-=[0,0,2,1][r],o.join("")},E=t.atob&&"function"==typeof t.atob?function(e){return t.atob(e)}:function(e){return e.replace(/\S{1,4}/g,g)},S=function(e){return E(String(e).replace(/[^A-Za-z0-9\+\/]/g,""))},b=function(e){return String(e).replace(/[-_]/g,(function(e){return"-"==e?"+":"/"})).replace(/[^A-Za-z0-9\+\/]/g,"")},A=function(e){return function(e){return y(E(e))}(b(e))};t.Uint8Array&&(v=function(e){return Uint8Array.from(S(b(e)),(function(e){return e.charCodeAt(0)}))});if(t.Base64={VERSION:"2.6.4",atob:S,btoa:l,fromBase64:A,toBase64:f,utob:u,encode:f,encodeURI:function(e){return f(e,!0)},btou:y,decode:A,noConflict:function(){var e=t.Base64;return t.Base64=n,e},fromUint8Array:r,toUint8Array:v},"function"==typeof Object.defineProperty){var I=function(e){return{value:e,enumerable:!1,writable:!0,configurable:!0}};t.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",I((function(){return A(this)}))),Object.defineProperty(String.prototype,"toBase64",I((function(e){return f(this,e)}))),Object.defineProperty(String.prototype,"toBase64URI",I((function(){return f(this,!0)})))}}return t.Meteor&&(Base64=t.Base64),e.exports&&(e.exports.Base64=t.Base64),{Base64:t.Base64}}(t)}("undefined"!=typeof self?self:"undefined"!=typeof window?window:co)}));function ho(e){return po.Base64.encode(e,!0)}function fo(e){return po.Base64.decode(e)}const vo={"-":"+",_:"/",".":"="};function _o(e){const t=e.replace(/[-_.]/g,e=>vo[e]);return Uint8Array.from(atob(t),e=>e.charCodeAt(0))}const mo=(e,t)=>Object.keys(e).find(r=>e[r]===t)||0,yo=(e,t)=>{const r=e.split(".").map(e=>Number(e)).slice(0,3),n=t.split(".").map(e=>Number(e)).slice(0,3);let o=0;for(let e=0;e<3;e++){const t=ei){o=1;break}}return o},go=["bLock","bHoldUponEntry","viewOnly","listenOnlyPhone","bAllowRaiseHand","bAllowAttendeeRename","bBroadcast","bAllowPlayChimeForEnterOrExit","bIbDisableShare","bIbDisableChat","encryptKey","bNoHostTimeOut","bAllowShowCount","bHasAST","bHasRMC"],Eo={bChime:"bAllowPlayChimeForEnterOrExit",bHasAST:"hasAst",bHasRMC:"hasRmc",topic:e=>({meetingTopic:fo(e)})},So=fr("GET_MEETING_INFO"),bo=fr("GET_INSTANT_MEETING_INFO"),Ao=(fr("LOGON_ZOOM_DOMAIN"),fr("VERIFY_ZOOM_RECAPTCHA"),fr("LOGON_THIRD_PARTY_DOMAIN"),fr("PING_RWC_SERVER")),Io=fr("MEETING_FAILOVER"),Co=fr("LEAVE_MEETING"),To=fr("END_MEETING"),Oo=(fr("REGISTER_WEBINAR"),fr("TRIGGER_IDLE_CHECK")),{setMeetingInfo:wo,setWindownOpen:Ro,setAppidSignature:Do,setZtk:No,setZsk:Po,setTkMtkguid:Mo,setPingRwcTimestamp:ko,setInMeetingInfo:Uo,setMeetingAttribute:Lo,resetMeeting:Vo,setIsHost:jo,setIsCohost:Ho,setMeetingIsOnHold:xo,setIsMeetingReset:Fo,setAudioVideoBeforeOnHold:Bo,setCurrentUserAudioBeforeReset:Go,setIsCurrentUserMutedBeforeReset:Wo,setMeetingStatus:Ko,setMeetingRegion:qo,setIsCurrentUserStartVideoBeforeReset:zo,setJoinMeetingTimeStamp:Jo,setIsEnableQos:Yo,setActiveAppInfo:Zo,setMeetingIdleStartTime:Qo,setSessionIdleTimeoutMinutes:Xo,setIsAudioBridgeEnabled:$o}=Ur({SET_MEETING_INFO:e=>e,SET_WINDOWN_OPEN:e=>e,SET_APPID_SIGNATURE:e=>e,SET_ZTK:e=>e,SET_ZSK:e=>e,SET_TK_MTKGUID:e=>e,SET_PING_RWC_TIMESTAMP:e=>e,SET_IN_MEETING_INFO:e=>e,SET_MEETING_ATTRIBUTE:e=>{if(go.some(t=>e&&void 0!==e[t])){let t=e;return Object.keys(Eo).some(t=>void 0!==e[t])&&(t=Object.keys(e).reduce((t,r)=>{const n=Eo[r];return"function"==typeof n?Object.assign(t,n(e[r])):"string"==typeof n?t[n]=e[r]:(t[r],e[r]),t},{})),t}return{}},SET_IS_HOST:e=>e&&e.bHost,SET_IS_COHOST:e=>e&&e.bCoHost,RESET_MEETING:e=>e,SET_MEETING_IS_ON_HOLD:e=>e,SET_IS_MEETING_RESET:e=>e,SET_AUDIO_VIDEO_BEFORE_ON_HOLD:e=>e,SET_CURRENT_USER_AUDIO_BEFORE_RESET:e=>e,SET_IS_CURRENT_USER_MUTED_BEFORE_RESET:e=>e,SET_MEETING_STATUS:e=>e,SET_MEETING_REGION:e=>e,SET_IS_CURRENT_USER_START_VIDEO_BEFORE_RESET:e=>e,SET_JOIN_MEETING_TIME_STAMP:e=>e,SET_IS_ENABLE_QOS:e=>e,SET_ACTIVE_APP_INFO:e=>e,SET_MEETING_IDLE_START_TIME:e=>e,SET_SESSION_IDLE_TIMEOUT_MINUTES:e=>e,SET_IS_AUDIO_BRIDGE_ENABLED:e=>e});function ei(e,t,r){const n=document.createElement("script");n.type="text/javascript",n.readyState?n.onreadystatechange=()=>{"loaded"!==n.readyState&&"complete"!==n.readyState||(n.onreadystatechange=null,t())}:(n.onload=()=>{t()},n.onerror=()=>{r()}),n.src=e,"function"==typeof document.body.append?document.getElementsByTagName("head")[0].append(n):document.getElementsByTagName("head")[0].appendChild(n)}let ti,ri,ni,oi,ii,si,ai,ci;!function(e){e[e.None=0]="None",e[e.Hand=1]="Hand",e[e.Yes=2]="Yes",e[e.No=3]="No",e[e.Fast=4]="Fast",e[e.Slow=5]="Slow",e[e.Bad=6]="Bad",e[e.Good=7]="Good",e[e.Clap=8]="Clap",e[e.Coffee=9]="Coffee",e[e.Clock=10]="Clock",e[e.Emoji=11]="Emoji"}(ti||(ti={})),function(e){e.LoginSuccess="zoomLoginSuccess",e.LoginFail="zoomLoginFail",e.CaptchaSuccess="captchaSuccess",e.CaptchaFail="captchaFail",e.SSOLoginSuccess="ssoLoginSuccess",e.SSOLoginFail="ssoLoginFail",e.JoinSuccess="joinSuccess",e.RegisterSuccess="registerSuccess"}(ri||(ri={})),function(e){e.Failover="failover",e.OnHold="on hold",e.Promote="promote",e.Depromote="depromote",e.JoinBreakoutRoom="join breakout room",e.MoveToBreakoutRoom="move to breakout room",e.BackToMeeting="back to meeting"}(ni||(ni={})),function(e){e.CDN="CDN",e.Global="Global",e.CN="CN"}(oi||(oi={})),function(e){e.Connected="Connected",e.Reconnecting="Reconnecting",e.Closed="Closed",e.Fail="Fail"}(ii||(ii={})),function(e){e.Loading="loading",e.Success="success",e.Fail="fail"}(si||(si={})),function(e){e[e.AudioBridgeEnable=1]="AudioBridgeEnable"}(ai||(ai={})),function(e){e.LocalStorage="LocalStorage",e.SessionStorage="SessionStorage",e.Memory="Memory"}(ci||(ci={}));const ui=ho("{}");class di{constructor(e){this.sessionStorageKey=void 0,this.localStorageKey=void 0,this.sessionCache=void 0,this.localCache=void 0,this.memoryCache=void 0,this.sessionStorageKey=ho("zoom-storage-".concat(e)),this.localStorageKey=ho("zoom-local-storage"),this.memoryCache={},this.sessionCache=JSON.parse(fo(sessionStorage.getItem(this.sessionStorageKey)||ui)),this.localCache=JSON.parse(fo(localStorage.getItem(this.localStorageKey)||ui))}static init(e){this.instance=new di(e)}static get(e){if(void 0===this.instance)throw new Error("read before initial");return this.instance.getValue(e).value}static set(e,t,r){if(void 0===this.instance)throw new Error("set before initial");return this.instance.setValue(e,t,r)}static remove(e){if(void 0===this.instance)throw new Error("remove before initial");return this.instance.removeValue(e)}static clearSession(){if(void 0===this.instance)throw new Error("clear before initial");return this.instance.memoryCache={},this.instance.sessionCache={},this.instance.localCache={},sessionStorage.removeItem(this.instance.sessionStorageKey)}getValue(e){return this.sessionCache.hasOwnProperty(e)?{value:this.sessionCache[e],type:ci.SessionStorage}:this.localCache.hasOwnProperty(e)?{value:this.localCache[e],type:ci.LocalStorage}:{value:this.memoryCache[e],type:ci.Memory}}setValue(e,t,r){if(!e)throw new Error("key is null");switch(r){case ci.SessionStorage:{const r=this.sessionCache[e];let n=t;return"function"==typeof t&&(n=t(r)),r!==n&&(this.sessionCache[e]=n,this.flushValue(ci.SessionStorage)),n}case ci.LocalStorage:{const r=this.localCache[e];let n=t;return"function"==typeof t&&(n=t(r)),r!==n&&(this.localCache[e]=n,this.flushValue(ci.LocalStorage)),n}case ci.Memory:{const r=this.memoryCache[e];let n=t;return"function"==typeof t&&(n=t(r)),this.memoryCache[e]=n,n}default:return null}}removeValue(e){const{type:t}=this.getValue(e);switch(t){case ci.SessionStorage:delete this.sessionCache[e],this.flushValue(ci.SessionStorage);break;case ci.LocalStorage:delete this.localCache[e],this.flushValue(ci.LocalStorage);break;case ci.Memory:delete this.memoryCache[e]}}flushValue(e){e===ci.SessionStorage?sessionStorage.setItem(this.sessionStorageKey,ho(JSON.stringify(this.sessionCache))):e===ci.LocalStorage&&localStorage.setItem(this.localStorageKey,ho(JSON.stringify(this.localCache)))}}function li(){const e=navigator.userAgent;let t,r=e.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];return/trident/i.test(r[1])?(t=/\brv[ :]+(\d+)/g.exec(e)||[],"IE ".concat(t[1]||"")):"Chrome"===r[1]&&(t=e.match(/\b(OPR|Edge)\/(\d+)/),t&&t.length)?t.slice(1).join(" ").replace("OPR","Opera"):(r=r[2]?[r[1],r[2]]:[navigator.appName,navigator.appVersion,"-?"],(t=e.match(/version\/(\d+)/i))&&r.splice(1,1,t[1]),yi()&&(r[0]="ios-safari"),r.join(""))}function pi(){const e=navigator.userAgent.toLowerCase();return!/opera|opr\/[\d]+/.test(e)&&/(msie|trident)/.test(e)}function hi(){return"object"==typeof WebAssembly&&"function"==typeof Worker}di.instance=void 0;const fi=()=>"function"==typeof AudioWorklet,vi=()=>pi(),_i=()=>!pi()&&!hi(),mi=()=>{const{userAgent:e}=navigator;return!/opera|opr\/[\d]+/i.test(navigator.userAgent)&&!/edge\/(\d+)/i.test(navigator.userAgent)&&/chrome/i.test(e)&&/webkit/i.test(e)},yi=()=>{const{userAgent:e}=navigator,t=/ipad/i.test(e)||/iphone/i.test(e)||/macintosh/i.test(e),r=/webkit/i.test(e),n=/mobile/i.test(e);return t&&r&&(n||(()=>{const e=navigator.userAgent.toLowerCase();let t=0,r=0;return window.screen.width-1||e.indexOf("macintosh")>-1&&{1024:768,1112:834,1194:834,1366:1024}[r]===t})())},gi=()=>/arm/i.test(navigator.userAgent),Ei=()=>/\bCrOS\b/.test(navigator.userAgent),Si=()=>{var e;return!(null===(e=navigator)||void 0===e||!e.hardwareConcurrency)&&"function"==typeof window.OffscreenCanvas&&"function"==typeof window.requestAnimationFrame&&"function"==typeof window.SharedArrayBuffer};function bi(){return"function"==typeof window.MediaStreamTrackProcessor}function Ai(){return"function"==typeof window.OffscreenCanvas}const Ii=e=>Si()?Ei()&&gi()||Ei()&&!gi()?navigator.hardwareConcurrency>=4?9:4:9:e&&bi()&&Ai()?4:1;function Ci(){return/android/i.test(navigator.userAgent)}let Ti,Oi;!function(e){e.VIDEO_ENCODE="0",e.VIDEO_DECODE="1",e.AUDIO_ENCODE="2",e.AUDIO_DECODE="3",e.SHARING_ENCODE="4",e.SHARING_DECODE="5"}(Ti||(Ti={})),function(e){e[e.NONE=0]="NONE",e[e.AES_256=1]="AES_256",e[e.AES_GCM=2]="AES_GCM"}(Oi||(Oi={}));const wi=Object.freeze({RWG_CHAT:{gcmType:1,sessionType:"RWG_CHAT"},XMPP_CHAT:{gcmType:1,sessionType:"XMPP_CHAT"},CC_MESSAGE:{gcmType:3,sessionType:"CC_MESSAGE"},BO_BROADCAST:{gcmType:1,sessionType:"BO_BROADCAST"}});let Ri,Di;!function(e){e.WebclientOpt="WEB_CLIENT_OPT",e.WebclientWebinarToken="WEB_CLIENT_WEBINAR_TOKEN",e.WebclientMeetingToken="WEB_CLIENT_MEETING_TOKEN",e.WebclientZtk="WEB_CLIENT_ZTK",e.WebclientZsk="WEB_CLIENT_ZSK",e.WebclientTk="WEB_CLIENT_TK",e.WebclientIVState="WEB_CLIENT_IV_STATE",e.WebclientIsOnHold="WEB_CLIENT_IS_ON_HOLD",e.WebclientUserId="WEB_CLIENT_USER_ID",e.WebclientParticipantId="WEB_CLIENT_PARTICIPANT_ID",e.WebclientZoomId="WEB_CLIENT_ZOOM_ID",e.WebclientUserName="WEB_CLIENT_USER_NAME",e.WebclientUserEmail="WEB_CLIENT_USER_EMAIL",e.WebclientBreakoutRoomAttendeeStatus="WEB_CLIENT_BO_ATTENDEE_STATUS",e.WebclientBreakoutRoomCommand="WEB_CLIENT_BO_COMMAND",e.WebclientAudioEncryptKey="WEB_CLIENT_AUDIO_ENCRYPT_KEY",e.WebclientVideoEncryptKey="WEB_CLIENT_VIDEO_ENCRYPT_KEY",e.WebclientSharingEncryptKey="WEB_CLIENT_SHARING_ENCRYPT_KEY"}(Ri||(Ri={})),(Di||(Di={})).WebclientDeviceId="WEBCLIENT_DEVICE_ID";const Ni=(window.crypto||window.msCrypto).subtle,Pi=Ri.WebclientIVState,Mi=Object.keys(wi).map(e=>wi[e].sessionType);class ki{constructor(e,t,r){this.isGCMEnabled=void 0,this.gcmSessionKey=void 0,this.gcmMainSessionKey=void 0,this.zoomId=void 0,this.resetParameters(e,t,r),di.set(Pi,{},ci.SessionStorage)}static init(e,t,r){this.instance?this.instance.resetParameters(e,t,r):this.instance=new ki(e,t,r)}static destroy(){this.instance&&(this.instance=void 0)}resetParameters(e,t,r){this.isGCMEnabled=!(pi()||!hi())&&r===Oi.AES_GCM,this.gcmSessionKey=_o(t),this.gcmMainSessionKey||(this.gcmMainSessionKey=this.gcmSessionKey),this.zoomId=String(e)}beginCrypto(e,t,r){const n=new Uint32Array(1);n[0]=9,n[0]+=Number(r);const o=new Uint8Array(n.buffer);let i=new Uint8Array(132);const s=_o(t);return i.set(s,0),i.set(o,s.length),i=i.subarray(0,s.length+4),Ni.importKey("raw",e,{name:"HMAC",hash:"SHA-256"},!0,["sign"]).then(e=>Ni.sign({name:"HMAC"},e,i)).then(e=>Ni.importKey("raw",e,{name:"AES-GCM",length:256},!0,["encrypt","decrypt"]))}getNextIV(e){const t=di.get(Pi);return void 0===t[e]?(t[e]=0,di.set(Pi,t,ci.SessionStorage)):di.set(Pi,t=>c(c({},t),{},{[e]:t[e]+1}),ci.SessionStorage)}resetIVState(){const e=di.get(Pi);if(void 0===e);else{const t=Object.keys(e).filter(e=>Mi.indexOf(e)>-1);t.length>0&&(t.forEach(t=>{e[t]+=1e6}),di.set(Pi,e,ci.SessionStorage))}}static resetIV(){if(void 0===this.instance)throw new Error("reset before intialize");this.instance.resetIVState()}static beginEncrypt(e){let{text:t,type:r}=e;const n=new Uint8Array(0);if(this.instance&&this.instance.isGCMEnabled){const e=16,o=this.instance.getNextIV(r.sessionType),i=new ArrayBuffer(16),s=new Uint8Array(i);new DataView(i).setUint32(0,o,!0);let a=null;return a="BO_BROADCAST"===r.sessionType?this.instance.gcmMainSessionKey:this.instance.gcmSessionKey,this.instance.beginCrypto(a,this.instance.zoomId,r.gcmType).then(r=>{const o=(new TextEncoder).encode(t);return Ni.encrypt({name:"AES-GCM",iv:s,additionalData:n,tagLength:8*e},r,o)}).then(t=>{const r=1+s.byteLength+2+n.byteLength+4+t.byteLength,o=new ArrayBuffer(r);new Uint8Array(o)[0]=s.length,new Uint8Array(o,1,s.byteLength).set(s),new DataView(o).setUint16(1+s.byteLength,n.length,!0),new Uint8Array(o,3+s.byteLength).set(n),new DataView(o).setUint32(1+s.byteLength+2+n.byteLength,t.byteLength-e,!0),new Uint8Array(o,1+s.byteLength+2+n.byteLength+4).set(new Uint8Array(t));const i=new Uint8Array(o).reduce((e,t)=>e+String.fromCharCode(t),"");return window.btoa(i).replace(/_/g,"/").replace(/-/g,"+").replace(/\=/g,"")})}return Promise.resolve(ho(t))}static beginDecrypt(e){let{decryptedText:t,type:r,zoomId:n}=e;if(this.instance&&this.instance.isGCMEnabled){const e=function(e){let t;const r=e.length,n=new Array(r);for(t=0;t{const t=function(e,t){e=new Uint8Array(e),t=new Uint8Array(t);const r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}(l,p);return Ni.decrypt({name:"AES-GCM",iv:i,additionalData:c,tagLength:8*p.length},e,t.buffer)}).then(e=>({message:(new TextDecoder).decode(e),iv:i,aad:c})).catch(e=>({message:"[".concat("This is an encrypted message","]"),iv:i,aad:c}))}{const e=new TextDecoder("utf-8");return Promise.resolve({message:e.decode(_o(t))})}}}ki.instance=void 0;const Ui=20234,Li=7937,Vi=7938,ji=12039,Hi=16138;let xi,Fi,Bi,Gi,Wi;!function(e){e.Open="open",e.Message="message",e.Error="error",e.Close="close"}(xi||(xi={}));class Ki{constructor(){this.eventHandlers=void 0,this.websocket=void 0,this.seq=void 0,this.intervalsToBeCleardWhenSocketClose=[],this.heartBeatInterval=6e4,this.eventHandlers=new Map,this.websocket=null,this.seq=1}on(e,t){let r=this.eventHandlers.get(e);r||(r=[]),r.push(t),this.eventHandlers.set(e,r)}off(e,t){const r=this.eventHandlers.get(e);if(r){const n=r.filter(e=>e!==t);this.eventHandlers.set(e,n)}}emit(e,t){const r=this.eventHandlers.get(e);r&&r instanceof Array&&r.slice(0).forEach(e=>{try{e(t)}catch(e){console.error(e)}})}sendMessageToRwg(e){this.seq+=1;const t=this.seq;return this.websocket&&this.websocket.readyState===WebSocket.OPEN&&this.websocket.send(JSON.stringify(Object.assign(e,{seq:t}))),t}connect(e){this.websocket=new WebSocket(e),this.websocket.binaryType="arraybuffer",this.addWebSocketEventListeners()}close(){var e;null===(e=this.websocket)||void 0===e||e.close()}addHeartBeat(){const e=setInterval(()=>{this.sendMessageToRwg({evt:0})},this.heartBeatInterval);this.intervalsToBeCleardWhenSocketClose.push(e)}clearIntervals(){this.intervalsToBeCleardWhenSocketClose.forEach(e=>clearInterval(e))}addWebSocketEventListeners(){this.websocket&&(this.websocket.addEventListener("open",e=>{this.addHeartBeat(),this.emit("open",e)}),this.websocket.addEventListener("message",e=>{this.emit("message",e)}),this.websocket.addEventListener("close",e=>{this.clearIntervals(),this.emit("close",e)}),this.websocket.addEventListener("error",e=>{this.emit("error",e)}))}joinMeeting(e){return{seq:this.sendMessageToRwg({evt:4097,body:{meetingtoken:e}})}}lockMeeting(e){return{seq:this.sendMessageToRwg({evt:4099,body:{bLock:e}})}}endMeeting(){return{seq:this.sendMessageToRwg({evt:4101,body:{}})}}leaveMeeting(){return{seq:this.sendMessageToRwg({evt:4103,body:{}})}}recordMeeting(e,t){return{seq:this.sendMessageToRwg({evt:4105,body:{bRecord:e,bPause:t}})}}expel(e){return{seq:this.sendMessageToRwg({evt:4107,body:{id:e}})}}expelAttendee(e){return{seq:this.sendMessageToRwg({evt:4205,body:{jid:e}})}}rename(e,t,r){return{seq:this.sendMessageToRwg({evt:4109,body:{id:e,dn2:t,olddn2:r}})}}assignHost(e,t){return{seq:this.sendMessageToRwg({evt:4111,body:{id:e,bCoHost:t}})}}reclaimHost(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{seq:this.sendMessageToRwg({evt:4133,body:{id:e,bCoHost:t}})}}revokeCoHost(e){return{seq:this.sendMessageToRwg({evt:4195,body:{id:e}})}}putOnHold(e,t){return{seq:this.sendMessageToRwg({evt:4113,body:{id:e,bHold:t}})}}setMuteOnEntry(e){return{seq:this.sendMessageToRwg({evt:4115,body:{bOn:e}})}}setHoldOnEntry(e){return{seq:this.sendMessageToRwg({evt:4117,body:{bOn:e}})}}inviteCRCDevice(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;return{seq:this.sendMessageToRwg({evt:4119,body:{ip:e,type:t,encrypt:r}})}}cancelInviteCRCDevice(e){return{seq:this.sendMessageToRwg({evt:4121,body:{transID:e}})}}sendCloseCaption(e){return{seq:this.sendMessageToRwg({evt:4125,body:c({},e)})}}allowViewParticipantNumber(e){return{seq:this.sendMessageToRwg({evt:4127,body:{bOn:e}})}}lowerAllHands(){return{seq:this.sendMessageToRwg({evt:4129,body:{}})}}raiseLowerHand(e,t){return{seq:this.sendMessageToRwg({evt:4131,body:{id:e,bOn:t}})}}chat(e,t,r,n){const o={text:e,destNodeID:t};return r&&Object.assign(o,{sn:r}),n&&Object.assign(o,{attendeeNodeID:n}),{seq:this.sendMessageToRwg({evt:4135,body:o})}}assignCC(e,t){return{seq:this.sendMessageToRwg({evt:4137,body:{id:e,bCCEditor:t}})}}enableLT(e){return{seq:this.sendMessageToRwg({evt:4227,body:{op:e?2:4}})}}allowAskLT(e){return{seq:this.sendMessageToRwg({evt:4263,body:{bAnonymous:e}})}}approveLT(){return{seq:this.sendMessageToRwg({evt:4262,body:{bApproved:!0}})}}askLT(e){return{seq:this.sendMessageToRwg({evt:4261,body:{bAnonymous:e}})}}setChatPriviledge(e){return{seq:this.sendMessageToRwg({evt:4141,body:{chatPriviledge:e}})}}sendFeedback(e){return{seq:this.sendMessageToRwg({evt:4143,body:{feedback:e}})}}clearFeedback(){return{seq:this.sendMessageToRwg({evt:4145,body:{}})}}allowUnmuteVideo(e){return{seq:this.sendMessageToRwg({evt:4147,body:{bOn:e}})}}allowUnmuteAudio(e){return{seq:this.sendMessageToRwg({evt:4149,body:{bOn:e}})}}allowRaiseHand(e){return{seq:this.sendMessageToRwg({evt:4151,body:{bOn:e}})}}boToken(e){return{seq:this.sendMessageToRwg({evt:4173,body:{topic:e}})}}startBO(e){return{seq:this.sendMessageToRwg({evt:4175,body:{proto:e}})}}stopBO(e){return{seq:this.sendMessageToRwg({evt:4177,body:{status:e}})}}assignToBO(e,t){return{seq:this.sendMessageToRwg({evt:4179,body:{targetID:e,targetBID:t}})}}switchBO(e,t){return{seq:this.sendMessageToRwg({evt:4181,body:{targetID:e,targetBID:t}})}}wantJoinBO(e,t){return{seq:this.sendMessageToRwg({evt:4183,body:{targetID:e,targetBID:t}})}}joinBO(e){return{seq:this.sendMessageToRwg({evt:4193,body:{targetBID:e}})}}leaveBO(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return{seq:this.sendMessageToRwg({evt:4185,body:{reason:e}})}}broadcastBO(e){return{seq:this.sendMessageToRwg({evt:4187,body:{textContent:e}})}}askForHelpBO(e){return{seq:this.sendMessageToRwg({evt:4189,body:{targetID:e}})}}askForHelpResultBO(e,t){return{seq:this.sendMessageToRwg({evt:4191,body:{targetID:e,helpResult:t}})}}allowParticipantRename(e){return{seq:this.sendMessageToRwg({evt:4163,body:{bOn:e}})}}allowMessageFeedbackNotify(e,t){return{seq:this.sendMessageToRwg({evt:4171,body:{bOn:e,id:t}})}}setPlayChime(e,t){return{seq:this.sendMessageToRwg({evt:4197,body:{bOn:e,id:t}})}}admitAllSilentUsers(){return{seq:this.sendMessageToRwg({evt:4199,body:{}})}}bindTeleUser(e,t,r){return{seq:this.sendMessageToRwg({evt:4201,body:{teleUserID:e,targetUserID:t,bBind:r}})}}practiceSession(){return{seq:this.sendMessageToRwg({evt:4207,body:null})}}roleChangeWebinar(e,t,r,n){return{seq:this.sendMessageToRwg({evt:4209,body:{jid:t,userID:r,clientCap:n,bPromote:e}})}}sendPromoteConsent(e,t){return{seq:this.sendMessageToRwg({evt:4254,body:{agreed:e,req_id:t}})}}batchCreateBOToken(e){const t=e.map((e,t)=>({topic:e,index:t}));return{seq:this.sendMessageToRwg({evt:4211,body:t})}}mute(e,t){return{seq:this.sendMessageToRwg({evt:8193,body:{bMute:t,id:e}})}}audioDrop(e){return{seq:this.sendMessageToRwg({evt:8195,body:{id:e}})}}audioDialout(e,t,r,n,o){return{seq:this.sendMessageToRwg({evt:8197,body:{pn:e,dn2:ho(t),bCallme:r,bPressOne:n,bGreeting:o}})}}audioCancelDialout(e,t){return{seq:this.sendMessageToRwg({evt:8199,body:{pn:e,bCallme:t}})}}audioMuteAll(e){return{seq:this.sendMessageToRwg({evt:8201,body:{bMute:e}})}}allowToTalk(e,t){return{seq:this.sendMessageToRwg({evt:8204,body:{id:e,bAllowTalk:t}})}}subscribeVideo(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;return{seq:this.sendMessageToRwg({evt:12289,body:{id:e,size:t,bOn:r}})}}unsubscribeVideo(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return{seq:this.sendMessageToRwg({evt:12291,body:{id:e}})}}muteAttendeeVideo(e,t){return{seq:this.sendMessageToRwg({evt:12297,body:{id:e,bOn:t}})}}notifyRwgIsMuteVideo(e,t){return this.muteAttendeeVideo(e,t)}pauseSharing(){return{seq:this.sendMessageToRwg({evt:16385,body:{}})}}resumeSharing(){return{seq:this.sendMessageToRwg({evt:16387,body:{}})}}allowAnonymousQuestion(e,t){return{seq:this.sendMessageToRwg({evt:4155,body:{userId:e,bOn:t}})}}allowViewAll(e,t){return{seq:this.sendMessageToRwg({evt:4157,body:{userId:e,bOn:t}})}}allowVote(e,t){return{seq:this.sendMessageToRwg({evt:4159,body:{userId:e,bOn:t}})}}allowComment(e,t){return{seq:this.sendMessageToRwg({evt:4161,body:{userId:e,bOn:t}})}}sharingRequestRemoteControl(e,t){return{seq:this.sendMessageToRwg({evt:16389,body:{id:e,bOn:t}})}}subscribeGrabRemoteControl(e,t){return{seq:this.sendMessageToRwg({evt:16393,body:{id:e,bOn:t}})}}subscribeSharing(e,t,r){const n={id:e,size:t};return r&&Object.assign(n,{bShareToBO:!0}),{seq:this.sendMessageToRwg({evt:16415,body:n})}}unsubscribeSharing(e,t){const r={id:e};return t&&Object.assign(r,{bShareToBO:!0}),{seq:this.sendMessageToRwg({evt:16417,body:r})}}sendRWGConnectionPerformance(e){return{seq:this.sendMessageToRwg({evt:4167,body:{data:e}})}}sendDatachannelOffer(e){return{seq:this.sendMessageToRwg({evt:24321,offer:e})}}joinOrLeaveVoip(e){return{seq:this.sendMessageToRwg({evt:8203,body:{bOn:e}})}}startSharing(e,t){return{seq:this.sendMessageToRwg({evt:16409,body:c({id:e,boOn:!1},null!=t?t:{})})}}stopSharing(e){return{seq:this.sendMessageToRwg({evt:16409,body:{id:e,bOn:!0}})}}lockSharing(e){return{seq:this.sendMessageToRwg({evt:4169,body:{lockShare:e}})}}startShareToBreakoutRoom(e){return{seq:this.sendMessageToRwg({evt:16425,body:{id:e,bShareToBO:!0}})}}stopShareToBreakoutRoom(e){return{seq:this.sendMessageToRwg({evt:16425,body:{id:e,bShareToBO:!1}})}}preAssignBreakoutRoom(){return{seq:this.sendMessageToRwg({evt:4213,body:{}})}}claimHost(e){return{seq:this.sendMessageToRwg({evt:4215,body:{hostKey:e}})}}allowMultiplePin(e,t){return{seq:this.sendMessageToRwg({evt:4217,body:{userID:e,bOn:t}})}}spotlightVideo(e,t){return{seq:this.sendMessageToRwg({evt:4219,body:c({id:e},t)})}}followHostLayout(e){return{seq:this.sendMessageToRwg({evt:4223,body:{bFollowHostVideo:e}})}}setVideoDragLayout(e){return{seq:this.sendMessageToRwg({evt:4218,body:{drag_list:e}})}}chatCmdReq(e,t){return{seq:this.sendMessageToRwg({evt:4237,body:{msgID:e,cmd:t}})}}activeAppLinkReq(e){return{seq:this.sendMessageToRwg({evt:4257,body:{appId:e}})}}activeAppInfoReq(){return{seq:this.sendMessageToRwg({evt:4255,body:{}})}}muteShareAudio(e){return{seq:this.sendMessageToRwg({evt:16423,body:{bOn:!0,bShareAudio:!e}})}}}class qi extends Ki{static createAgent(){return this.rwgInstance||(this.rwgInstance=new qi),this.rwgInstance}}qi.rwgInstance=null;class zi extends Ki{static getInstance(){return this.instance||(this.instance=new zi),this.instance}}zi.instance=null,function(e){e[e.NoAttendee=0]="NoAttendee",e[e.All=1]="All",e[e.AllPanelist=2]="AllPanelist",e[e.Host=3]="Host",e[e.NoOne=4]="NoOne",e[e.EveryonePublicly=5]="EveryonePublicly"}(Fi||(Fi={})),function(e){e[e.All=0]="All",e[e.Panelist=1]="Panelist",e[e.IndividualCcPanelist=2]="IndividualCcPanelist",e[e.Individual=3]="Individual",e[e.SilentModeUsers=4]="SilentModeUsers"}(Bi||(Bi={})),function(e){e[e.None=0]="None",e[e.Delete=1]="Delete",e[e.Modify=2]="Modify"}(Gi||(Gi={})),function(e){e[e.Success=0]="Success",e[e.Delete=1]="Delete",e[e.Block=3]="Block"}(Wi||(Wi={}));const Ji=[Fi.All,Fi.Host,Fi.NoOne,Fi.EveryonePublicly],Yi=[Fi.NoOne,Fi.All,Fi.AllPanelist],Zi={userId:Bi.All,displayName:"Everyone",isHost:!1,isCoHost:!1},Qi={userId:Bi.Panelist,displayName:"All panelists"},Xi={userId:Bi.SilentModeUsers,displayName:"Everyone (in Waiting Room)",isHost:!1,isCoHost:!1};class $i{static getInstance(){return this.instance||(this.instance=new $i),this.instance}constructor(){this.eventHandlers=void 0,this.websocket=void 0,this.seq=void 0,this.intervalsToBeCleardWhenSocketClose=[],this.heartBeatInterval=6e4,this.eventHandlers=new Map,this.websocket=null,this.seq=1}on(e,t){let r=this.eventHandlers.get(e);r||(r=[]),r.push(t),this.eventHandlers.set(e,r)}off(e,t){const r=this.eventHandlers.get(e);if(r){const n=r.filter(e=>e!==t);this.eventHandlers.set(e,n)}}emit(e,t){const r=this.eventHandlers.get(e);r&&r instanceof Array&&r.slice(0).forEach(e=>{try{e(t)}catch(e){console.error(e)}})}sendCommandMsg(e,t,r){this.seq+=1;const n=this.seq;return this.websocket&&this.websocket.readyState===WebSocket.OPEN&&this.websocket.send(JSON.stringify({seq:n,body:{bcm:r,type:t?Fi.AllPanelist:Fi.All,msg:e,jid:[t]},evt:24582})),n}connectXmpp(){this.seq+=1;const e=this.seq;return this.websocket&&this.websocket.readyState===WebSocket.OPEN&&this.websocket.send(JSON.stringify({seq:e,body:{},evt:24576})),e}connect(e){this.websocket=new WebSocket(e),this.websocket.binaryType="arraybuffer",this.addWebSocketEventListeners()}close(){var e;null===(e=this.websocket)||void 0===e||e.close()}clearIntervals(){this.intervalsToBeCleardWhenSocketClose.forEach(e=>clearInterval(e))}addWebSocketEventListeners(){this.websocket&&(this.websocket.addEventListener("open",e=>{this.emit("open",e)}),this.websocket.addEventListener("message",e=>{this.emit("message",e)}),this.websocket.addEventListener("close",e=>{this.clearIntervals(),this.emit("close",e)}),this.websocket.addEventListener("error",e=>{this.emit("error",e)}))}}$i.instance=null;const es=Ri.WebclientIVState;class ts{static getInstance(){return void 0===this.agentInstance&&(this.agentInstance=new ts),this.agentInstance}constructor(){this.assetsPath=void 0,this.instance=void 0,this.callbackList=void 0,this.mediaWorkersPath=void 0,this.constraints=void 0,this.svcUrl=void 0,this.meetingNumber=void 0,this.confId=void 0,this.mediaSocketAddress=void 0,this.currentUserId=void 0,this.receivedSharingCanvas=void 0,this.sharingCanvas=void 0,this.mediaOptions=void 0,this.callbackList=[]}init(){if(!this.instance){const e={ivObj:{[Ti.AUDIO_ENCODE]:di.get(es)&&di.get(es)[Ti.AUDIO_ENCODE],[Ti.VIDEO_ENCODE]:di.get(es)&&di.get(es)[Ti.VIDEO_ENCODE],[Ti.SHARING_ENCODE]:di.get(es)&&di.get(es)[Ti.SHARING_ENCODE]}};this.instance=new JsMediaSDK_Instance(e),this.instance.setRWGAgent(qi.createAgent())}}setAssetsAndConstraint(e,t,r,n){var o;this.assetsPath=e,this.constraints=t,this.mediaWorkersPath=((e,t)=>t?{audioWorkerPath:"".concat(e,"/").concat("1501","_js_audio_process.min.js"),audioWorkletPath:"".concat(e,"/").concat("1501","_js_audio_worklet.min.js"),audioWasm:"".concat(e,"/").concat("1501","_audio.encode.wasm"),videoWorkerPath:"".concat(e,"/").concat("1501","_video_s.min.js"),videoMtWorkerPath:"".concat(e,"/").concat("1501","_video_m.min.js"),videoWasm:"".concat(e,"/").concat("1501","_video.decode.wasm"),videoMtWasm:"".concat(e,"/").concat("1501","_video.mt.wasm"),sharingWorkerPath:"".concat(e,"/").concat("1501","_sharing_s.min.js"),sharingMtWorkerPath:"".concat(e,"/").concat("1501","_sharing_m.min.js"),videoSIMDWorkerPath:"".concat(e,"/").concat("1501","_video_simd.min.js"),videoSIMDWasm:"".concat(e,"/").concat("1501","_video.simd.wasm"),sharingSIMDWorkerPath:"".concat(e,"/").concat("1501","_sharing_simd.min.js"),videoMSIMDWasm:"".concat(e,"/").concat("1501","_video.mtsimd.wasm"),sharingMSIMDWorkerPath:"".concat(e,"/").concat("1501","_sharing_mtsimd.min.js"),videoMSIMDWorkerPath:"".concat(e,"/").concat("1501","_video_mtsimd.min.js"),audioSIMDWorkletPath:"".concat(e,"/").concat("1501","_audio_simd.min.js"),audioSIMDWasm:"".concat(e,"/").concat("1501","_audio.simd.wasm")}:{audioWorkerPath:"".concat(e,"/js_audio_process.min.js"),audioWorkletPath:"".concat(e,"/js_audio_worklet.min.js"),audioWasm:"".concat(e,"/audio.encode.wasm"),videoWorkerPath:"".concat(e,"/video_s.min.js"),videoMtWorkerPath:"".concat(e,"/video_m.min.js"),videoWasm:"".concat(e,"/video.decode.wasm"),videoMtWasm:"".concat(e,"/video.mt.wasm"),sharingWorkerPath:"".concat(e,"/sharing_s.min.js"),sharingMtWorkerPath:"".concat(e,"/sharing_m.min.js"),videoSIMDWorkerPath:"".concat(e,"/video_simd.min.js"),videoSIMDWasm:"".concat(e,"/video.simd.wasm"),sharingSIMDWorkerPath:"".concat(e,"/sharing_simd.min.js"),videoMSIMDWasm:"".concat(e,"/video.mtsimd.wasm"),sharingMSIMDWorkerPath:"".concat(e,"/sharing_mtsimd.min.js"),videoMSIMDWorkerPath:"".concat(e,"/video_mtsimd.min.js"),audioSIMDWorkletPath:"".concat(e,"/audio_simd.min.js"),audioSIMDWasm:"".concat(e,"/audio.simd.wasm")})(this.assetsPath,!!r),this.onMediaSDKCallback=this.onMediaSDKCallback.bind(this),this.mediaOptions=n,null===(o=this.instance)||void 0===o||o.JsMediaSDK_PreLoad(this.mediaWorkersPath,this.onMediaSDKCallback,n)}onMediaSDKCallback(e,t){this.callbackList.length>0&&this.callbackList.forEach(r=>r(e,t))}registerCallback(e){this.callbackList.push(e)}unregisterCallback(e){this.callbackList=this.callbackList.filter(t=>t!==e)}static isSupportVideoEncodeHardwareAcceleration(){return JsMediaSDK_Instance.util.IsSupportVideoEncodeHardwareAcceleration()}static isSupportVideoDecodeHardwareAcceleration(){return JsMediaSDK_Instance.util.IsSupportVideoDecodeHardwareAcceleration()}static isCompatibleHardwareForEncode(){return"function"==typeof window.OffscreenCanvas&&0==JsMediaSDK_Instance.util.AdapterWhiteListCheckForEncoder()}connect(e){var t,r,n,o,i,s;let{svcUrl:a,meetingNumber:c,conId:u,e2eEncrypt:d,isViewOnly:l,currentUserId:p,isWebinar:h,enableAudioQos:f,enableVideoQos:v=!1}=e;this.svcUrl=a,this.meetingNumber=c,this.confId=u;const _=((e,t,r)=>({videoSocketAddress:"wss://".concat(e,"/wc/media/").concat(t,"?type=v&cid=").concat(r),audioSocketAddress:"wss://".concat(e,"/wc/media/").concat(t,"?type=a&cid=").concat(r),sharingSocketAddress:"wss://".concat(e,"/wc/media/").concat(t,"?type=").concat(vi()?"j":"s","&cid=").concat(r)}))(a,c,u);this.mediaSocketAddress=_,this.currentUserId=p;const m=Ii(null===(t=this.mediaOptions)||void 0===t?void 0:t.enableMultiDecodeVideoWithoutSAB);var y,g,E,S,b,A,I;(null===(r=this.instance)||void 0===r||r.setPropsBeforeInit({callback:this.onMediaSDKCallback,audioWorkletPath:hi()?null===(n=this.mediaWorkersPath)||void 0===n?void 0:n.audioWorkletPath:void 0,e2eEncrypt:d,isEnableListenInitEvent:!0}),!0===(null===(o=this.constraints)||void 0===o?void 0:o.audio)&&hi()&&!yi())&&((h||fi())&&(null===(y=this.instance)||void 0===y||y.initAudioDecode(this.mediaWorkersPath,_.audioSocketAddress,p,!1,u,c,m,f)),!fi()||h&&l||null===(g=this.instance)||void 0===g||g.initAudioEncode(this.mediaWorkersPath,_.audioSocketAddress,p,!1,u,c,m,f));!0===(null===(i=this.constraints)||void 0===i?void 0:i.video)&&hi()&&(null===(E=this.instance)||void 0===E||E.initVideoDecode(this.mediaWorkersPath,_.videoSocketAddress,p,!1,u,c,m),h&&l||null===(S=this.instance)||void 0===S||S.initVideoEncode(this.mediaWorkersPath,_.videoSocketAddress,p,!1,u,c,m,!1,v,!0,!0)),!0===(null===(s=this.constraints)||void 0===s?void 0:s.screen)&&(hi()?(null===(b=this.instance)||void 0===b||b.initSharingDecode(this.mediaWorkersPath,_.sharingSocketAddress,p,!1,u,c,m),h&&l||null===(A=this.instance)||void 0===A||A.initSharingEncode(this.mediaWorkersPath,_.sharingSocketAddress,p,!1,u,c,m)):null===(I=this.instance)||void 0===I||I.initSharingDecode(_.sharingSocketAddress))}destroy(){var e;null===(e=this.instance)||void 0===e||e.destroy(),this.instance=null,this.callbackList=[]}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()}muteAudio(){var e;null===(e=this.instance)||void 0===e||e.Notify_MeidaSDK(8,{ssrc:0})}unmuteAudio(){var e;null===(e=this.instance)||void 0===e||e.Notify_MeidaSDK(7,{ssrc:0,AudioSelectValue:0})}joinComputerAudio(e,t,r,n,o){var i;return null===(i=this.instance)||void 0===i?void 0:i.Notify_MeidaSDK(22,c({CaptureAudio:n,CaptureAudioInfo:{ssrc:e,AudioSelectValue:"default"===t?null:t},speakerInfo:{defaultDeviceId:r}},o?{useAudioBridge:!0,audioBridge:o}:{}))}leaveComputerAudio(){var e;return null===(e=this.instance)||void 0===e?void 0:e.Notify_MeidaSDK(21,null)}joinSharingAudio(e){var t;let{ssrc:r,microphoneDeviceId:n,speakerDeviceId:o,isCaptureAudio:i}=e;return null===(t=this.instance)||void 0===t?void 0:t.Notify_MeidaSDK(72,{CaptureAudio:i,CaptureAudioInfo:{ssrc:r,AudioSelectValue:"default"===n?null:n},speakerInfo:{defaultDeviceId:o},checkAutoplay:!1})}leaveSharingAudio(e){var t;return null===(t=this.instance)||void 0===t?void 0:t.Notify_MeidaSDK(73,{isPause:e?1:0})}changeSpeaker(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(11,{ssrc:0,AudioSelectValue:e})}changeMicrophone(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(18,{ssrc:0,AudioSelectValue:"default"===e?null:e})}restoreWebRTC(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(19,{ssrc:0,AudioSelectValue:"default"===e?null:e})}renderVideo(e,t,r,n,o,i,s,a,c,u,d){var l;null===(l=this.instance)||void 0===l||l.Notify_MeidaSDK(1,{userId:t,width:n,height:o,x:i,y:s,quality:a,isMyself:c,canvas:e,enableWaterMark:d,waterMarkText:u,zone:r})}stopRenderVideo(e,t,r,n){var o;let i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];null===(o=this.instance)||void 0===o||o.Notify_MeidaSDK(2,{canvas:e,userId:t,RGBA:n,doNotClean:i,zone:r})}startCaptureVideo(e,t,r,n,o){var i;null===(i=this.instance)||void 0===i||i.Notify_MeidaSDK(3,{ssid:e,width:r,height:n,fps:24,video:o,VideoSelectValue:"default"===t?null:t})}stopCaptureVideo(){var e;null===(e=this.instance)||void 0===e||e.Notify_MeidaSDK(4,{ssrc:0})}changeCamera(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(12,{VideoSelectValue:"default"===e?null:e})}switchCanvasForVideoCapture(e){var t;let r=e;Array.isArray(e)||(r=[e]),null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(25,r)}renderSharing(e,t){var r;let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];this.receivedSharingCanvas=t,null===(r=this.instance)||void 0===r||r.Notify_MeidaSDK(23,{width:0,height:0,ssrc:e,canvas:t,enableWaterMark:n,waterMarkText:o,isFromMainSession:i})}stopRenderSharing(){var e;null===(e=this.instance)||void 0===e||e.Notify_MeidaSDK(24,{})}switchSharingSource(e){var t;let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(36,{ssrc:e,isFromMainSession:Number(r)})}ajustmentReceivedSharingCanvas(e,t){if(this.receivedSharingCanvas)try{this.receivedSharingCanvas.width=e,this.receivedSharingCanvas.height=t}catch(e){}}startRemoteControl(e,t,r){var n;null===(n=this.instance)||void 0===n||n.Notify_MeidaSDK(26,c({socketURL:"wss://".concat(this.svcUrl),meetingID:this.meetingNumber,condID:this.confId,os:t,dom:e},r))}stopRemoteControl(){var e;null===(e=this.instance)||void 0===e||e.Notify_MeidaSDK(28)}resendRemoteControlPositionPDU(){var e;null===(e=this.instance)||void 0===e||e.Notify_MeidaSDK(41)}updateRemoteControlProperties(e){var t;const{dimension:r}=e,n=d(e,["dimension"]);null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(27,c(c({},r),n))}startDesktopSharing(e,t,r){var n;let o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];this.sharingCanvas=document.querySelector("#".concat(t)),null===(n=this.instance)||void 0===n||n.Notify_MeidaSDK(30,{mode:i,ssid:e,canvas:t,video:r,showShareAudioOption:o})}stopDesktopSharing(){var e;null===(e=this.instance)||void 0===e||e.Notify_MeidaSDK(31,{})}pauseDesktopSharing(){var e;null===(e=this.instance)||void 0===e||e.Notify_MeidaSDK(32,{})}resumeDesktopSharing(){var e;null===(e=this.instance)||void 0===e||e.Notify_MeidaSDK(33,{})}ajustmentSharingCanvas(e,t){if(this.sharingCanvas)try{this.sharingCanvas.width=e,this.sharingCanvas.height=t}catch(e){}}checkChromeSharingExtension(){var e;null===(e=this.instance)||void 0===e||e.Notify_MeidaSDK(34,{})}enableAudioEncode(){var e,t;null===(e=this.instance)||void 0===e||e.initAudioEncode(this.mediaWorkersPath,this.mediaSocketAddress.audioSocketAddress,this.currentUserId,!1,this.confId,this.meetingNumber,Ii(null===(t=this.mediaOptions)||void 0===t?void 0:t.enableMultiDecodeVideoWithoutSAB))}sendUserNodeList(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(43,e)}updateRenderedSharingDimension(e,t){var r;null===(r=this.instance)||void 0===r||r.Notify_MeidaSDK(44,{width:e,height:t})}pauseOrResumeAudio(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(45,{bPause:e})}updateRenderedVideoCanvasDimension(e,t,r){var n;null===(n=this.instance)||void 0===n||n.Notify_MeidaSDK(46,{canvas:e,width:t,height:r})}clearVideoCanvas(e,t){var r;null===(r=this.instance)||void 0===r||r.Notify_MeidaSDK(47,{id:e,RGBA:t})}adjustRenderedVideoPosition(e,t,r,n,o,i,s){var a;null===(a=this.instance)||void 0===a||a.Notify_MeidaSDK(48,{userId:t,x:n,y:o,width:i,height:s,canvas:e,zone:r})}mirrorVideo(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(75,{isMirrorMyVideo:e})}updateUserMediaSN(e){var t,r,n;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(80,{isFromMainSession:Number(e.isFromMainSession),mediaActionType:e.iVType,body:{add:null!==(r=e.added)&&void 0!==r?r:[],remove:null!==(n=e.removed)&&void 0!==n?n:[]}})}updateMediaParams(e){var t;const{iVType:r,isFromMainSession:n,updateParams:o}=e;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(81,{mediaActionType:r,isFromMainSession:Number(n),updateParams:o})}createMSChannel(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(84,e)}addReceivedSharingChannelType(e){var t;const{isFromMainSession:r}=e,n=d(e,["isFromMainSession"]);null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(82,c({isFromMainSession:Number(r)},n))}removeReceivedSharingChannelType(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(83,{isFromMainSession:Number(e.isFromMainSession),ssrc:e.ssrc})}enableHardwareAccelerationForVideoDecode(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(70,{enable:e})}enableHardwareAccelerationForVideoEncode(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(71,{enable:e})}setSharingAudioVolume(e,t){var r;null===(r=this.instance)||void 0===r||r.Notify_MeidaSDK(74,{userid:e>>10,shareVolume:t?0:100})}subscribeToQos(e,t){e.forEach(e=>{var r;null===(r=this.instance)||void 0===r||r.updateQosSubscription(!0,e,t)})}unsubscribeFromQos(e){e.forEach(e=>{var t;null===(t=this.instance)||void 0===t||t.updateQosSubscription(!1,e)})}passThroughRWGMessage(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(40,e)}startVirtualBackgroundSetting(e,t,r,n,o,i){var s;null===(s=this.instance)||void 0===s||s.Notify_MeidaSDK(91,{canvas:e,bgdom:t,width:o,height:i,ssid:r,VideoSelectValue:"default"===n?null:n})}updateVirtualBackgroundImage(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(92,{bgdom:e})}stopVirtualBackgroundSetting(){var e;let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null===(e=this.instance)||void 0===e||e.Notify_MeidaSDK(93,{isSwitch:t})}}var rs;ts.agentInstance=void 0,function(e){e.ConnectionChange="connection-change",e.OnHoldChange="on-hold-change",e.UserAdd="user-added",e.UserUpdate="user-updated",e.UserRemove="user-removed",e.AttendeeUpdate="attendee-updated",e.MeetingAttributeUpdate="meeting-attribute-updated",e.PromoteAttendeeConsent="promote-attendee-consent",e.ActiveAppsUpdate="active-apps-updated"}(rs||(rs={}));const ns={success:"ADD_CURRENT_USER_PARTICIPANT_ATTRIBUTE",fail:["JOIN_MEETING_FAILED"]},os={[rs.ConnectionChange]:[{event:"JOIN_MEETING_SUCCESS",payload:()=>({state:ii.Connected})},{event:"JOIN_MEETING_FAILED",payload:e=>c({state:ii.Fail},e)},{event:"RECONNECTING_MEETING",payload:e=>c({state:ii.Reconnecting},e)},{event:"LEAVING_MEETING",payload:e=>c({state:ii.Closed},e)}],[rs.OnHoldChange]:[{event:"MEETING_IN_WAITING_ROOM",payload:e=>({isOnHold:e})}],[rs.UserAdd]:[{event:"ADD_CURRENT_USER_PARTICIPANT_ATTRIBUTE",payload:e=>[e]},{event:"ADD_USER_PARTICIPANT_ATTRIBUTE",payload:e=>e}],[rs.UserUpdate]:[{event:"UPDATE_CURRENT_USER_PARTICIPANT_ATTRIBUTE",payload:e=>[e]},{event:"UPDATE_USER_PARTICIPANT_ATTRIBUTE",payload:e=>e}],[rs.UserRemove]:[{event:"REMOVE_USER_PARTICIPANT_ATTRIBUTE",payload:e=>e}],[rs.AttendeeUpdate]:[{event:"UPDATE_WEBINAR_PARTICIPANT_ATTRIBUTE",payload:e=>e}],[rs.MeetingAttributeUpdate]:[{event:"UPDATE_MEETING_ATTRIBUTE",payload:()=>{}}],[rs.PromoteAttendeeConsent]:[{event:"MEETING_WEBINAR_PROMOTE_CONSENT_REQ",payload:e=>{let{req_id:t,sender_id:r}=e;return{reqId:t,senderId:r}}}],[rs.ActiveAppsUpdate]:[{event:"ACTIVE_APPS_UPDATE",payload:()=>{}}]};let is;!function(e){e.ChatOnMessage="chat-on-message",e.ChatPrivilegeChange="chat-privilege-change",e.ChatDeleteMessage="chat-delete-message"}(is||(is={}));const ss={[is.ChatOnMessage]:[{event:"CHAT_RECEIVE_MESSAGE_EVENTS",payload:e=>e}],[is.ChatPrivilegeChange]:[{event:"CHAT_PRIVILEGE_CHANGE",payload:e=>e}],[is.ChatDeleteMessage]:[{event:"CHAT_DELETE_MESSAGE_REPONSE",payload:e=>e}]};let as;!function(e){e.CommandChannelStatus="command-channel-status",e.CommandChannelMessage="command-channel-message"}(as||(as={}));const cs={[as.CommandChannelStatus]:[{event:"COMMAND_STATUS_EVENTS",payload:e=>e}],[as.CommandChannelMessage]:[{event:"COMMAND_RECEIVE_MESSAGE_EVENTS",payload:e=>e}]};let us,ds,ls;!function(e){e.Recording="Recording",e.Paused="Paused",e.Stopped="Stopped"}(us||(us={})),function(e){e[e.None=0]="None",e[e.Init=1]="Init",e[e.Start=2]="Start",e[e.Pause=3]="Pause",e[e.Stop=4]="Stop"}(ds||(ds={})),function(e){e.RecordingChange="recording-change",e.LocalRecordingChange="local-recording-change"}(ls||(ls={}));const ps={[ls.RecordingChange]:[{event:"CLOUD_RECORDING_STATUS_CHANGE",payload:e=>{const{cmrServerStatus:t}=e;return t===ds.Start?us.Recording:t===ds.Pause?us.Paused:us.Stopped}}],[ls.LocalRecordingChange]:[{event:"LOCAL_RECORDING_CHANGE",payload:e=>e}]};let hs,fs,vs,_s,ms,ys;!function(e){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.StartVideoStreamInVbSettingSuccess=94]="StartVideoStreamInVbSettingSuccess",e[e.VbModelPreloading_3S=96]="VbModelPreloading_3S",e[e.VbModelPreloading_10S=97]="VbModelPreloading_10S",e[e.VbModelPreloadingOk=98]="VbModelPreloadingOk",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.UserForbiddedCaptureAudio=-2]="UserForbiddedCaptureAudio",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.DesktopSharingSystemError=-22]="DesktopSharingSystemError",e[e.SharingDesktopStreamHaveNoAudio=-27]="SharingDesktopStreamHaveNoAudio",e.audioQosData="AUDIO_QOS_DATA",e.videoQosData="VIDEO_QOS_DATA",e[e.AudioBridgeReconnectStart=-29]="AudioBridgeReconnectStart",e[e.AudioBridgeReconnectEnd=-31]="AudioBridgeReconnectEnd",e[e.VbSettingParaError=-34]="VbSettingParaError"}(hs||(hs={})),function(e){e[e.EncodeSuccess=1]="EncodeSuccess",e[e.DecodeSuccess=2]="DecodeSuccess",e[e.EncodeFailed=-1]="EncodeFailed",e[e.DecodeFailed=-2]="DecodeFailed"}(fs||(fs={})),function(e){e.Spotlight="Spotlight",e.Unmute="Unmute",e.AllowToTalk="Allow to talk"}(vs||(vs={})),function(e){e.Active="active",e.PassiveByMuteOne="passive(mute one)",e.PassiveByMuteAll="passive(mute all)",e.SharingAudio="sharing audio"}(_s||(_s={})),function(e){e.Join="join",e.Leave="leave",e.Muted="muted",e.Unmuted="unmuted"}(ms||(ms={})),function(e){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"}(ys||(ys={}));const gs=new Blob([new Uint8Array([255,227,24,196,0,0,0,3,72,1,64,0,0,4,132,16,31,227,192,225,76,255,67,12,255,221,27,255,228,97,73,63,255,195,131,69,192,232,223,255,255,207,102,239,255,255,255,101,158,206,70,20,59,255,254,95,70,149,66,4,16,128,0,2,2,32,240,138,255,36,106,183,255,227,24,196,59,11,34,62,80,49,135,40,0,253,29,191,209,200,141,71,7,255,252,152,74,15,130,33,185,6,63,255,252,195,70,203,86,53,15,255,255,247,103,76,121,64,32,47,255,34,227,194,209,138,76,65,77,69,51,46,57,55,170,170,170,170,170,170,170,170,170,170,255,227,24,196,73,13,153,210,100,81,135,56,0,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170])],{type:"audio/mpeg"}),Es=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]);let Ss,bs,As,Is,Cs,Ts,Os,ws,Rs,Ds,Ns,Ps,Ms,ks;!function(e){e[e.HostGrab=0]="HostGrab",e[e.OnlyHost=1]="OnlyHost",e[e.AnyoneGrab=2]="AnyoneGrab",e[e.MultipleShare=3]="MultipleShare"}(Ss||(Ss={})),function(e){e.Sharing="sharing",e.Paused="paused",e.End="ended"}(bs||(bs={})),function(e){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"}(As||(As={})),function(e){e.Active="Active",e.Inactive="Inactive"}(Is||(Is={})),function(e){e.Muted="Muted",e.Unmuted="Unmuted"}(Cs||(Cs={})),function(e){e.Active="Active",e.Inactive="Inactive"}(Ts||(Ts={})),function(e){e.Success="Success",e.Failed="Failed",e.Initial="Initial"}(Os||(Os={})),function(e){e.Started="Started",e.Stopped="Stopped",e.Failed="Failed"}(ws||(ws={})),function(e){e.Approved="Approved",e.Rejected="Rejected"}(Rs||(Rs={})),function(e){e.PrivilegeChange="PrivilegeChange",e.StopScreenCapture="StopScreenCapture",e.ShareFromMainSession="ShareFromMainSession"}(Ds||(Ds={})),function(e){e.Muted="Muted",e.Unmuted="Unmuted",e.NoAudio="NoAudio",e.Phone="Phone"}(Ns||(Ns={})),function(e){e[e.ImageNotMatch=2]="ImageNotMatch",e[e.CanvasNotMatch=3]="CanvasNotMatch",e[e.VBModelNotMatch=4]="VBModelNotMatch"}(Ps||(Ps={})),function(e){e.VideoEncode="0",e.VideoDecode="1",e.AudioEncode="2",e.AudioDecode="3",e.SharingEncode="4",e.SharingDecode="5"}(Ms||(Ms={})),function(e){e[e.NotConnect=0]="NotConnect",e[e.Connecting=1]="Connecting",e[e.ConnectSuccess=2]="ConnectSuccess",e[e.ConnectFail=3]="ConnectFail"}(ks||(ks={}));const Us={data:{sample_rate:0,rtt:0,jitter:0,avg_loss:0,max_loss:0}},Ls={data:{sample_rate:0,rtt:0,jitter:0,avg_loss:0,max_loss:0,width:0,height:0,fps:0}};let Vs;!function(e){e.DeviceChange="device-change",e.MediaSDKChange="media-sdk-change"}(Vs||(Vs={}));const js={[Vs.DeviceChange]:[{event:"MEDIA_DEVICE_CHANGE",payload:()=>({})}],[Vs.MediaSDKChange]:[{event:"AUDIO_ENCODE_SUCCESS",payload:()=>({type:"audio",action:"encode",result:"success"})},{event:"AUDIO_ENCODE_FAIL",payload:()=>({type:"audio",action:"encode",result:"fail"})},{event:"AUDIO_DECODE_SUCCESS",payload:()=>({type:"audio",action:"decode",result:"success"})},{event:"AUDIO_DECODE_FAIL",payload:()=>({type:"audio",action:"decode",result:"fail"})},{event:"VIDEO_ENCODE_SUCCESS",payload:()=>({type:"video",action:"encode",result:"success"})},{event:"VIDEO_ENCODE_FAIL",payload:()=>({type:"video",action:"encode",result:"fail"})},{event:"VIDEO_DECODE_SUCCESS",payload:()=>({type:"video",action:"decode",result:"success"})},{event:"VIDEO_DECODE_FAIL",payload:()=>({type:"video",action:"decode",result:"fail"})},{event:"SHARING_ENCODE_SUCCESS",payload:()=>({type:"share",action:"encode",result:"success"})},{event:"SHARING_ENCODE_FAIL",payload:()=>({type:"share",action:"encode",result:"fail"})},{event:"SHARING_DECODE_SUCCESS",payload:()=>({type:"share",action:"decode",result:"success"})},{event:"SHARING_DECODE_FAIL",payload:()=>({type:"share",action:"decode",result:"fail"})}]},Hs={success:"VIDEO_CAPTURE_START_SUCCESS",fail:["CAN_NOT_DETECT_CAMERA","CAN_NOT_FIND_CAMERA","VIDEO_USER_FORBIDDEN_CAPTURE","VIDEO_ESTABLISH_STREAM_ERROR","VIDEO_CAMERA_IS_TAKEN","VIDEO_VITRUAL_BACKGROUND_FAILED"]};let xs;!function(e){e.VideoActiveChange="video-active-change",e.PeerVideoStateChange="peer-video-state-change",e.VideoSpotlightChange="video-spotlight-change",e.VideoMutedChange="video-muted-change",e.VideoCapturingChange="video-capturing-change",e.AskForStartVideoConsent="ask-for-start-video-consent",e.VideoDimensionChange="video-dimension-change",e.VideoFollowHostOrder="video-follow-host-order-change",e.VideoHostLayoutChange="video-host-layout-change",e.VideoVBPreloadChange="video-virtual-background-preload-change",e.VideoStatisticDataChange="video_statistic_data_change"}(xs||(xs={}));const Fs={[xs.VideoActiveChange]:[{event:"RECEIVE_VIDEO_ACTIVE_INDICATION",payload:e=>({state:e.bVideoOn?Is.Active:Is.Inactive,userId:e.userId})}],[xs.VideoCapturingChange]:[{event:"VIDEO_CAPTURE_START_SUCCESS",payload:()=>({state:ws.Started})},{event:"VIDEO_CAPTURE_STOP_RESULT",payload:e=>({state:null!=e&&e.failed?ws.Failed:ws.Stopped})}],[xs.VideoMutedChange]:[{event:"RECEIVE_VIDEO_MUTE_INDICATION",payload:e=>({state:e.isVideoMuted?Cs.Muted:Cs.Unmuted,userId:e.id})}],[xs.AskForStartVideoConsent]:[{event:"ASK_FOR_START_VIDEO_CONSENT",payload:e=>({state:e.isVideoMuted?Cs.Muted:Cs.Unmuted,userId:e.id})}],[xs.VideoSpotlightChange]:[{event:"VIDEO_SPOTLIGHT_CHANGE",payload:e=>({spotlightList:e.spotlightList&&e.spotlightList.map(e=>({userId:e}))})}],[xs.VideoDimensionChange]:[{event:"RECEIVE_VIDEO_DIMENSION_CHANGE",payload:e=>({type:"received",width:e.width,height:e.height})}],[xs.VideoFollowHostOrder]:[{event:"VIDEO_FOLLOW_HOST_ORDER_CHANGE",payload:e=>({isFollowHostOrder:e.bOn})}],[xs.VideoHostLayoutChange]:[{event:"VIDEO_HOST_DRAG_LAYOUT_CHANGE",payload:e=>Array.isArray(e.layout)?e.layout.map(e=>({userId:e})):[]}],[xs.PeerVideoStateChange]:[{event:"VIDEO_NEW_USER_START",payload:e=>c({action:"Start"},e)},{event:"VIDEO_OLD_USER_STOP",payload:e=>c({action:"Stop"},e)}],[xs.VideoVBPreloadChange]:[{event:"VIDEO_VIRTUAL_BACKGROUND_PRELOAD_READY",payload:e=>({isReady:e})}],[xs.VideoStatisticDataChange]:[{event:"VIDEO_STATISTIC_DATA",payload:e=>e}]};let Bs;!function(e){e.ActiveSpeaker="active-speaker",e.UnmuteAudioConsent="unmute-audio-consent",e.CurrentAudioChange="current-audio-change",e.DialoutStateChange="dialout-state-change",e.MergeAudio="merged-audio",e.AutoPlayFailed="auto-play-audio-failed",e.AllowTalkChange="allow-talk-change",e.ShareAudioChange="share-audio-change",e.AudioStatisticDataChange="audio_statistic_data_change"}(Bs||(Bs={}));const Gs={JoinComputerAudio:{success:"AUDIO_CURRENT_USER_JOIN_BY_VOIP",fail:["USER_FORBIDDEN_MICROPHONE","ESTABLISH_AUDIO_STREAM_ERROR"]},LeaveComputerAudio:{success:"AUDIO_CURRENT_USER_LEAVE_AUDIO"},JoinAudioByCallMe:{success:"AUDIO_DIALOUT_RESULT_SUCCESS",fail:["DIALOUT_FAIL"]},cancelDialOut:{success:"AUDIO_DIALOUT_CANCEL_SUCCESS",fail:["DIALOUT_CANCEL_FAIL"]},hangup:{success:"AUDIO_CURRENT_USER_LEAVE_AUDIO"}},Ws={[Bs.ActiveSpeaker]:[{event:"AUDIO_ACTIVE_SPEAKER",payload:e=>e}],[Bs.UnmuteAudioConsent]:[{event:"AUDIO_UNMUTE_CONSENT",payload:e=>({reason:e})}],[Bs.CurrentAudioChange]:[{event:"AUDIO_CURRENT_USER_JOIN_BY_PHONE",payload:()=>({action:ms.Join,type:"phone"})},{event:"AUDIO_CURRENT_USER_JOIN_BY_VOIP",payload:()=>({action:ms.Join,type:"computer"})},{event:"AUDIO_CURRENT_USER_LEAVE_AUDIO",payload:()=>({action:ms.Leave})},{event:"AUDIO_CURRENT_USER_MUTED",payload:e=>{let{source:t}=e;return{action:ms.Muted,source:t}}},{event:"AUDIO_CURRENT_USER_UNMUTED",payload:e=>{let{source:t}=e;return{action:ms.Unmuted,source:t}}}],[Bs.DialoutStateChange]:[{event:"AUDIO_DIALOUT_RESULT_CODE",payload:e=>e}],[Bs.MergeAudio]:[{event:"AUDIO_MERGE_AUDIO_INDICATION",payload:e=>e}],[Bs.AutoPlayFailed]:[{event:"AUDIO_AUTO_PLAY_FAILED",payload:()=>{}}],[Bs.AllowTalkChange]:[{event:"AUDIO_ALLOW_TALK_CHANGE",payload:e=>({enabled:e})}],[Bs.ShareAudioChange]:[{event:"SHARE_AUDIO_STATE_CHANGE",payload:e=>e}],[Bs.AudioStatisticDataChange]:[{event:"AUDIO_STATISTIC_DATA",payload:e=>e}]};let Ks;!function(e){e.ShareActiveChange="active-share-change",e.ShareDimensionChange="share-content-dimension-change",e.SharePassiveStop="passively-stop-share",e.SharePeerStateChange="peer-share-state-change",e.ShareContentChange="share-content-change",e.SharePrivilegeChange="share-privilege-change",e.RemoteControlApprovedChange="remote-control-approved-change",e.RemoteControlInControlChange="remote-control-in-control-change",e.RemoteControlClipboardChange="remote-control-clipboard-change"}(Ks||(Ks={}));const qs={[Ks.ShareActiveChange]:[{event:"SHARE_ACTIVE_INDICATION",payload:e=>{const{isActive:t,activeUserId:r}=e;return c({state:t?"Active":"Inactive",userId:r},d(e,["isActive","activeUserId"]))}}],[Ks.ShareDimensionChange]:[{event:"SHARE_DIMENSION_CHANGE",payload:e=>({type:"sended",width:e.width,height:e.height})},{event:"SHARE_RECEIVED_DIMENSION_CHANGE",payload:e=>({type:"received",width:e.width,height:e.height})}],[Ks.SharePassiveStop]:[{event:"SHARE_VIDEO_STREAMS_END",payload:()=>({reason:Ds.StopScreenCapture})},{event:"SHARE_PASSIVE_STOP_SHARE",payload:()=>({reason:Ds.PrivilegeChange})},{event:"SHARE_PASSIVE_BO_STOP",payload:()=>({reason:Ds.ShareFromMainSession})}],[Ks.SharePeerStateChange]:[{event:"SHARE_NEW_USER_ADD",payload:e=>({userId:e.id,action:"Start"})},{event:"SHARE_USER_REMOVE",payload:e=>({userId:e.id,action:"Stop"})}],[Ks.ShareContentChange]:[{event:"SHARE_AUTO_CHANGE_SOURCE",payload:e=>e}],[Ks.RemoteControlApprovedChange]:[{event:"SHARE_REMOTE_CONTROL_APPROVE",payload:e=>({state:e?Rs.Approved:Rs.Rejected})}],[Ks.RemoteControlInControlChange]:[{event:"SHARE_GRAB_REMOTE_CONTROL_CHANGE",payload:e=>({isControlling:e})}],[Ks.RemoteControlClipboardChange]:[{event:"SHARE_REMOTE_CONTROL_CLIPBOARD_CHANGE",payload:e=>e}],[Ks.SharePrivilegeChange]:[{event:"SHARE_PRIVILEGE_CHANGE",payload:e=>({privilege:e})}]},zs="INVALID_OPERATION",Js="INVALID_PARAMETERS";let Ys;!function(e){e.InviteToJoin="invite-to-join",e.RoomCountdown="room-countdown",e.RoomTimeUp="room-time-up",e.ClosingRoomCountdown="closing-room-countdown",e.BroadcastMessage="broadcast-message",e.AskForHelp="ask-for-help",e.AskForHelpResponse="ask-for-help-response",e.RoomStateChange="room-state-change",e.MainSessionUserUpdate="main-session-user-updated"}(Ys||(Ys={}));const Zs={[Ys.InviteToJoin]:[{event:"BREAKOUT_ROOM_INVITE_TO_JOIN_NOTIFICATION",payload:e=>e}],[Ys.RoomCountdown]:[{event:"BREAKOUT_ROOM_ROOM_COUTDOWN",payload:e=>e}],[Ys.RoomTimeUp]:[{event:"BREAKOUT_ROOM_ROOM_COUNTDOWN_TIME_UP",payload:e=>e}],[Ys.ClosingRoomCountdown]:[{event:"BREAKOUT_ROOM_ROOM_CLOSING_COUNTDOWN",payload:e=>e}],[Ys.BroadcastMessage]:[{event:"BREAKOUT_ROOM_BROADCAST_MESSAGE",payload:e=>e}],[Ys.AskForHelp]:[{event:"BREAKOUT_ROOM_ASK_HELP_REQUEST",payload:e=>e}],[Ys.AskForHelpResponse]:[{event:"BREAKOUT_ROOM_ASK_HELP_RESPONSE",payload:e=>e}],[Ys.RoomStateChange]:[{event:"BREAKOUT_ROOM_ATTRIBUTE_INDICATION",payload:e=>({status:e.controlStatus})}],[Ys.MainSessionUserUpdate]:[{event:"BREAKOUT_ROOM_MAIN_SESSION_USER_UPDATE",payload:()=>({})}]},Qs=c(c(c(c(c(c(c(c(c(c(c({},os),{"closed-caption-message":[{event:"CC_RECEIVE_MESSAGE",payload:e=>e}],"closed-caption-lt-status":[{event:"LT_STATUS_CHANGE",payload:e=>e}],"closed-caption-lt-message":[{event:"LT_RECEIVE_MESSAGE",payload:e=>e}],"closed-caption-status":[{event:"CC_ASSIGN_CC_EDITOR_SUCCESS",payload:e=>e},{event:"CC_STATUS_CHANGE",payload:e=>e}]}),ss),cs),ps),Ws),Fs),{"qa-message":[{event:"QA_VOTE_EVENTS",payload:e=>e},{event:"QA_DISMISS_EVENT",payload:e=>e},{event:"QA_LIVE_ANSWER_EVENT",payload:e=>e},{event:"QA_NEW_ANSWER_EVENT",payload:e=>e},{event:"QA_NEW_QUESTION_EVENT",payload:e=>e}],"qa-setting":[{event:"QA_SETTING_SUCCESS_EVENT",payload:e=>e}]}),qs),js),Zs),Xs=($s=$s||Object.create(null),{on:function(e,t){($s[e]||($s[e]=[])).push(t)},off:function(e,t){$s[e]&&$s[e].splice($s[e].indexOf(t)>>>0,1)},emit:function(e,t){($s[e]||[]).slice().map((function(e){e(t)})),($s["*"]||[]).slice().map((function(r){r(e,t)}))}});var $s;const ea=new Map,ta=new Array,ra=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;Xs.emit(e,t)},na=e=>new Promise((t,r)=>{e.fail&&e.fail.length>0?it(Ye(Xs,e.success).pipe(yt(1)),$e(...e.fail.map(e=>Ye(Xs,e).pipe(yt(1),Fe(t=>ce({type:e,payload:t})))))).subscribe(e=>t(e),e=>{"object"==typeof e.payload?r(c({type:e.type},e.payload)):void 0===e.payload?r({type:e.type}):r(e)}):Ye(Xs,e.success).pipe(yt(1)).subscribe(e=>t(e))}),oa=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e4;return new Promise((n,o)=>{let i=ee;"string"==typeof e?i=Ye(Xs,e).pipe(yt(1)):(i=Ye(Xs,e.event),e.operations&&(i=e.operations.reduce((e,t)=>e.pipe(t),i))),it(i,ct(r).pipe(It(ce("timeout")))).subscribe(e=>{if(t){const r=t(e);"boolean"==typeof r?r?n(""):o({type:"INTERNAL_ERROR"}):0===r.ret?n(r.body):o({type:"INTERNAL_ERROR",reason:r.body})}else n(e)},()=>{o({type:"OPERATION_TIMEOUT"})})})},ia=(e,t)=>void 0!==t?Ye(Xs,e).pipe(yt(t)):Ye(Xs,e),sa=()=>{ta.forEach(e=>{e.unsubscribe()}),ta.length=0,ea.clear()},{setAttendeesList:aa,setXmppAttendeeList:ca,setIsAdmitAllSilentUsers:ua,resetParticipants:da,addFailoverAttendees:la,removeFailoverAttendees:pa,setClearRaiseHand:ha,setClearAttendeeFeedback:fa}=Ur({SET_ATTENDEES_LIST:e=>e,SET_XMPP_ATTENDEE_LIST:e=>e,RESET_PARTICIPANTS:()=>({}),SET_IS_ADMIT_ALL_SILENT_USERS:e=>e,REMOVE_FAILOVER_ATTENDEES:e=>e,ADD_FAILOVER_ATTENDEES:e=>e,SET_CLEAR_RAISE_HAND:()=>({}),SET_CLEAR_ATTENDEE_FEEDBACK:()=>({})});var va=function(e,t){return e===t};function _a(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every((function(e){return"function"==typeof e}))){var r=t.map((function(e){return"function"==typeof e?"function "+(e.name||"unnamed")+"()":typeof e})).join(", ");throw new Error("createSelector expects all input-selectors to be functions, but received the following types: ["+r+"]")}return t}var ma=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n-1){var o=r[n];return n>0&&(r.splice(n,1),r.unshift(o)),o.value}return"NOT_FOUND"}return{get:n,put:function(t,o){"NOT_FOUND"===n(t)&&(r.unshift({key:t,value:o}),r.length>e&&r.pop())},getEntries:function(){return r},clear:function(){r=[]}}}(c,d);function p(){var t=l.get(arguments);if("NOT_FOUND"===t){if(t=e.apply(null,arguments),u){var r=l.getEntries(),n=r.find((function(e){return u(e.value,t)}));n&&(t=n.value)}l.put(arguments,t)}return t}return p.clearCache=function(){return l.clear()},p}));const ya=e=>{let{participants:{attendeesList:t}}=e;return t};let ga,Ea,Sa;!function(e){e[e.Attendee=0]="Attendee",e[e.Host=1]="Host",e[e.Owner=4]="Owner",e[e.ViewOnly=8]="ViewOnly",e[e.HostOwner=5]="HostOwner",e[e.ViewOnlyCanTalk=24]="ViewOnlyCanTalk"}(ga||(ga={})),function(e){e[e.Host=10]="Host",e[e.Panelist=20]="Panelist",e[e.Attendee=30]="Attendee"}(Ea||(Ea={})),function(e){e[e.Client=9]="Client",e[e.Phone=5]="Phone",e[e.H323=15]="H323"}(Sa||(Sa={}));const ba=e=>(e&ga.Host)===ga.Host,Aa=e=>(e&Sa.Phone)===Sa.Phone,Ia=e=>e===ga.ViewOnlyCanTalk,Ca=e=>(e&ga.ViewOnly)===ga.ViewOnly;let Ta,Oa,wa,Ra,Da,Na;!function(e){e[e.Automatically=1]="Automatically",e[e.Manually=2]="Manually"}(Ta||(Ta={})),function(e){e[e.NotStarted=1]="NotStarted",e[e.InProgress=2]="InProgress",e[e.Closing=3]="Closing",e[e.Closed=4]="Closed"}(Oa||(Oa={})),function(e){e[e.NoToken=1]="NoToken",e[e.GotToken=2]="GotToken",e[e.Started=3]="Started",e[e.Closing=4]="Closing",e[e.Closed=5]="Closed"}(wa||(wa={})),function(e){e.Initial="initial",e.Invited="invited",e.Joining="joining",e.InRoom="in room",e.Leaving="leaving",e.TimeUp="time up",e.MainSession="main session"}(Ra||(Ra={})),function(e){e.Join="joinRequest",e.Switch="switchRequest",e.Leave="leaveRequest",e.Broadcast="messageText",e.HelpReq="helpRequest",e.HelpRes="helpResponse",e.CoHostWantJoinThisBo="wantJoinThisBO"}(Da||(Da={})),function(e){e[e.Received=0]="Received",e[e.Busy=1]="Busy",e[e.Ignore=2]="Ignore",e[e.AlreadyInRoom=3]="AlreadyInRoom"}(Na||(Na={}));const Pa=ma([e=>{let{meeting:{userId:t}}=e;return t},ya],(e,t)=>t.find(t=>t.userId===e)),Ma=ma([Pa],e=>(null==e?void 0:e.isHost)||(null==e?void 0:e.bCoHost)),ka=ma([Pa],e=>null==e?void 0:e.isHost),Ua=ma([e=>{let{participants:{xmppAttendeeList:t}}=e;return t}],e=>e.filter(e=>e.userRole===Ea.Attendee)),La=ma([ya],e=>e.filter(e=>e.bHold&&!e.bid)),Va=ma([ya,e=>{let{breakoutRoom:t}=e;return t&&t.controlStatus},e=>{let{breakoutRoom:t}=e;return t&&t.currentRoom.status}],(e,t,r)=>t!==Oa.InProgress&&t!==Oa.Closing||r!==Ra.InRoom?e.filter(e=>!e.bHold&&!e.bid):e.filter(e=>!e.bHold)),ja=ma([Va],e=>e.find(e=>e.isHost)),Ha=ma([Va],e=>e.filter(e=>e.bCoHost)),xa=ma([Pa,Va],(e,t)=>t.filter(t=>t.userId!==(null==e?void 0:e.userId)));let Fa;!function(e){e.Closed="closed",e.Connecting="connecting",e.Connected="connected"}(Fa||(Fa={}));const{setAsnIds:Ba,setIsCanUnmute:Ga,setDialoutSequence:Wa,setDialoutResultCode:Ka,setIsAllowToTalk:qa,setIsHostMuteAll:za,setIsActiveOperation:Ja,setAudioSsrc:Ya,setIsMutedUponEntry:Za,setIsUserGrantCaptureAudio:Qa,setIsMicrophoneForbidden:Xa,setWebrtcRestartCount:$a,setMicrophoneList:ec,setSpeakerList:tc,setActiveMicrophone:rc,setActiveSpeaker:nc,setCanPlayAudio:oc,resetAudio:ic,setIsComputerAudioLoading:sc,setIsSpeakerOnly:ac,setIsAllowToTalkAttendeeConnected:cc,setIsMuteBeforeSharingAudio:uc,addLocalShareAudioUser:dc,updateLocalShareAudioUser:lc,setIsJoinComputerAudioBeforeSharingAudio:pc,setIsShareAudioEnabled:hc,setIsShareAudioMuted:fc,setIsSharingAudio:vc,setAudioDataEncoding:_c,setAudioDataDecoding:mc}=Ur("SET_ASN_IDS","SET_IS_CAN_UNMUTE","SET_DIALOUT_SEQUENCE","SET_DIALOUT_RESULT_CODE","SET_IS_ALLOW_TO_TALK","SET_IS_HOST_MUTE_ALL","SET_IS_ACTIVE_OPERATION","SET_AUDIO_SSRC","SET_IS_MUTED_UPON_ENTRY","SET_IS_USER_GRANT_CAPTURE_AUDIO","SET_IS_MICROPHONE_FORBIDDEN","SET_WEBRTC_RESTART_COUNT","SET_MICROPHONE_LIST","SET_SPEAKER_LIST","SET_ACTIVE_MICROPHONE","SET_ACTIVE_SPEAKER","SET_CAN_PLAY_AUDIO","RESET_AUDIO","SET_IS_COMPUTER_AUDIO_LOADING","SET_IS_SPEAKER_ONLY","SET_IS_ALLOW_TO_TALK_ATTENDEE_CONNECTED","SET_IS_MUTE_BEFORE_SHARING_AUDIO","SET_IS_SHARING_AUDIO","ADD_LOCAL_SHARE_AUDIO_USER","UPDATE_LOCAL_SHARE_AUDIO_USER","SET_IS_JOIN_COMPUTER_AUDIO_BEFORE_SHARING_AUDIO","SET_IS_SHARE_AUDIO_ENABLED","SET_IS_SHARE_AUDIO_MUTED","SET_AUDIO_DATA_ENCODING","SET_AUDIO_DATA_DECODING"),{setSharePrivilege:yc,setShareActiveNode:gc,setIsReceiveSharing:Ec,setIsChromeExtensionInstalled:Sc,setIsScreenShareForbidden:bc,setShareDimension:Ac,setShareStatus:Ic,setShareSsrc:Cc,setShareQuality:Tc,setReceivedShareDimension:Oc,setIsRemoteControlApproved:wc,setIsGrabRemoteControl:Rc,setIsVerifiedSharingRenderCanvasAfterFailover:Dc,setIsVerifiedSharingCaptureCanvasAfterFailover:Nc,setIsSdkGrabControl:Pc,setIsReceiveSharingFromMainSession:Mc,setIsSharingToBreakoutRoom:kc,resetShare:Uc}=Ur("SET_SHARE_PRIVILEGE","SET_SHARE_ACTIVE_NODE","SET_IS_RECEIVE_SHARING","SET_IS_CHROME_EXTENSION_INSTALLED","SET_IS_SCREEN_SHARE_FORBIDDEN","SET_SHARE_DIMENSION","SET_SHARE_STATUS","SET_SHARE_SSRC","SET_SHARE_QUALITY","SET_RECEIVED_SHARE_DIMENSION","SET_IS_REMOTE_CONTROL_APPROVED","SET_IS_GRAB_REMOTE_CONTROL","SET_IS_VERIFIED_SHARING_RENDER_CANVAS_AFTER_FAILOVER","SET_IS_VERIFIED_SHARING_CAPTURE_CANVAS_AFTER_FAILOVER","SET_IS_SDK_GRAB_CONTROL","SET_IS_RECEIVE_SHARING_FROM_MAIN_SESSION","SET_IS_SHARING_TO_BREAKOUT_ROOM","RESET_SHARE"),{setVideoSsrc:Lc,setActiveVideoId:Vc,setCameraList:jc,setActiveCamera:Hc,setIsCurrentUserStartedVideo:xc,setSpotlightVideo:Fc,setIsCaptureForbidden:Bc,setVideoMaxQuality:Gc,setCaptureCanvasList:Wc,setIsVideoMuted:Kc,setIsCaptureCameraLoading:qc,setIsCameraTaken:zc,setIsVerifiedVideoRenderCanvasAfterFailover:Jc,setIsVerifiedVideoCaptureCanvasAfterFailover:Yc,resetVideo:Zc,setReceivedVideoDimension:Qc,addSubscribedVideoId:Xc,removeSubscribedVideoId:$c,setIsFollowHostVideoLayout:eu,setHostDragLayout:tu,addRenderedVideoId:ru,removeRenderedVideoId:nu,setIsSupportHdVideo:ou,setHighDefinitionVideoId:iu,setIsCanUnmuteVideo:su,setIsVbPreloadReady:au,setIsVbConfiged:cu,setVbImageSrc:uu,setVideoDataEncoding:du,setVideoDataDecoding:lu,setHardwareAccelerationState:pu}=Ur("SET_VIDEO_SSRC","SET_ACTIVE_VIDEO_ID","SET_CAMERA_LIST","SET_ACTIVE_CAMERA","SET_IS_CURRENT_USER_STARTED_VIDEO","SET_SPOTLIGHT_VIDEO","SET_IS_CAPTURE_FORBIDDEN","SET_VIDEO_MAX_QUALITY","SET_CAPTURE_CANVAS_LIST","SET_IS_VIDEO_MUTED","SET_IS_CAPTURE_CAMERA_LOADING","SET_IS_CAMERA_TAKEN","SET_IS_VERIFIED_VIDEO_RENDER_CANVAS_AFTER_FAILOVER","SET_IS_VERIFIED_VIDEO_CAPTURE_CANVAS_AFTER_FAILOVER","RESET_VIDEO","SET_RECEIVED_VIDEO_DIMENSION","ADD_SUBSCRIBED_VIDEO_ID","REMOVE_SUBSCRIBED_VIDEO_ID","SET_IS_FOLLOW_HOST_VIDEO_LAYOUT","SET_HOST_DRAG_LAYOUT","ADD_RENDERED_VIDEO_ID","REMOVE_RENDERED_VIDEO_ID","SET_IS_SUPPORT_HD_VIDEO","SET_HIGH_DEFINITION_VIDEO_ID","SET_IS_CAN_UNMUTE_VIDEO","SET_IS_VB_PRELOAD_READY","SET_IS_VB_CONFIGED","SET_VB_IMAGE_SRC","SET_VIDEO_DATA_ENCODING","SET_VIDEO_DATA_DECODING","SET_HARDWARE_ACCELERATION_STATE"),{setTempSetting:hu,setSetting:fu,setQuestionList:vu,setQuestionUpVoted:_u,resetQa:mu}=Ur("SET_TEMP_SETTING","SET_SETTING","SET_QUESTION_LIST","SET_QUESTION_UP_VOTED","SET_SELF_LIVE_ANSWER","RESET_QA"),{setChatPrivilege:yu,addChatMessageHistory:gu,resetChat:Eu,setIsAllowAttendeeChat:Su,setLatestChatMessageId:bu,removeChatMessage:Au}=Ur("SET_CHAT_PRIVILEGE","ADD_CHAT_MESSAGE_HISTORY","RESET_CHAT","SET_IS_ALLOW_ATTENDEE_CHAT","SET_LATEST_CHAT_MESSAGE_ID","REMOVE_CHAT_MESSAGE"),{setCcEditorInfo:Iu,setTempSendCcText:Cu,setCcLtMessage:Tu,setTempReceiveLtText:Ou,setTempReceiveCcText:wu,setGatewayInfoList:Ru,setLtEnable:Du,setIsListenClosedCaption:Nu,setCcEnable:Pu,allowParticipantAskLt:Mu,receiveAskStartLt:ku,setMeetingEnabledLtFeature:Uu,updateLtStatus:Lu,deleteMessage:Vu,updateMessage:ju,resetClosedCaption:Hu}=Ur("SET_CC_EDITOR_INFO","SET_CC_LT_MESSAGE","SET_TEMP_SEND_CC_TEXT","SET_TEMP_RECEIVE_LT_TEXT","SET_TEMP_RECEIVE_CC_TEXT","SET_GATEWAY_INFO_LIST","SET_LT_ENABLE","SET_IS_LISTEN_CLOSED_CAPTION","SET_CC_ENABLE","ALLOW_PARTICIPANT_ASK_LT","RECEIVE_ASK_START_LT","SET_MEETING_ENABLED_LT_FEATURE","UPDATE_LT_STATUS","DELETE_MESSAGE","UPDATE_MESSAGE","RESET_CLOSED_CAPTION"),{addBreakoutRooms:xu,setBreakoutRoomAllocationPattern:Fu,setBreakoutRoomSequenceId:Bu,setMeetingElapsedTime:Gu,setStartRoomElapsedTime:Wu,setBreakoutRoomOptions:Ku,setBreakoutRoomControlStatus:qu,setBreakoutRooms:zu,setCurrentBreakoutRoom:Ju,setBreakoutRoomAttendeeStatus:Yu,setBreakoutRoomConfId:Zu,setBreakoutRoomToken:Qu,resetBreakoutRoom:Xu,setBreakoutRoomClosingRoomTime:$u,setBreakoutRoomBroadcastMessage:ed,setBreakoutRoomHostReplyType:td,setBreakoutRoomHostReplyRequestId:rd,setMainSessionAttendeeList:nd,setIsHugeBreakoutRoom:od,setBreakoutRoomUpdatedUserRoleCount:id,setBreakoutRoomPreAssignedRoomList:sd}=Ur("ADD_BREAKOUT_ROOMS","SET_BREAKOUT_ROOM_ALLOCATION_PATTERN","SET_BREAKOUT_ROOM_SEQUENCE_ID","SET_MEETING_ELAPSED_TIME","SET_START_ROOM_ELAPSED_TIME","SET_BREAKOUT_ROOM_OPTIONS","SET_BREAKOUT_ROOM_CONTROL_STATUS","SET_BREAKOUT_ROOMS","SET_CURRENT_BREAKOUT_ROOM","SET_BREAKOUT_ROOM_ATTENDEE_STATUS","SET_BREAKOUT_ROOM_CONF_ID","SET_BREAKOUT_ROOM_TOKEN","RESET_BREAKOUT_ROOM","SET_BREAKOUT_ROOM_CLOSING_ROOM_TIME","SET_BREAKOUT_ROOM_BROADCAST_MESSAGE","SET_BREAKOUT_ROOM_HOST_REPLY_TYPE","SET_BREAKOUT_ROOM_HOST_REPLY_REQUEST_ID","SET_MAIN_SESSION_ATTENDEE_LIST","SET_IS_HUGE_BREAKOUT_ROOM","SET_BREAKOUT_ROOM_UPDATED_USER_ROLE_COUNT","SET_BREAKOUT_ROOM_PRE_ASSIGNED_ROOM_LIST"),ad=(e,t,r,n,o,i)=>{const s={ts:n,auth:o,rwcToken:r,dmz:1};return i&&Object.assign(s,{confID:i}),"https://".concat(e,"/wc/ping/").concat(t,"?").concat(new URLSearchParams(s).toString())},cd=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const{socket:{zoomSocketStatus:r,xmppSocketStatus:n,mainSessionSocketStatus:o},meeting:{meetingStatus:i}}=e,s=[Ko("closed")];if("joined"===i){const t=ts.getInstance(),r=qi.createAgent();if(t.disconnect(),t.destroy(),e.video&&e.video.subscribedVideoList.length>0&&e.video.subscribedVideoList.forEach(e=>{r.unsubscribeVideo(e)}),e.share&&e.share.isReceiveSharing){const t=e.share.activeNodeId;e.share.isRemoteControlApproved&&r.sharingRequestRemoteControl(t,!1),r.unsubscribeSharing(t)}}if(t||(di.clearSession(),[Ri.WebclientTk,Ri.WebclientZsk,Ri.WebclientZtk].forEach(e=>{sessionStorage.removeItem(e)}),ki.destroy()),r!==Fa.Closed&&s.push(Wr()),n!==Fa.Closed&&s.push(Kr()),o!==Fa.Closed&&s.push(Qr()),t){const t=Pa(e);s.push(Vo({audio:null==t?void 0:t.audio,muted:null==t?void 0:t.muted,video:null==t?void 0:t.bVideoOn}))}else s.push(Vo({audio:!1,muted:void 0,video:!1}));return s.push(dn(),Sn(),da(),ic(),Uc(),Zc(),mu(),Eu(),Hu(),Xu()),s},ud=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;nt.find(t=>t.userId===e)),tt(e=>!!e),yt(1)]},...r)};function dd(e){return H(Oe((t,r)=>e(t,r)),tt(e=>null!=e))}function ld(e){return H(Fe((t,r)=>e(t,r)||ee))}function pd(e){return H(Nt((t,r)=>e(t,r)||ee))}function hd(e){return H(Fe((t,r)=>e(t,r)),Fe(e=>Array.isArray(e)?Ve(e):ae(e)))}const fd=(e,t)=>{const r=performance.now();let n=0,o=!1;return setTimeout((function i(){n+=t,e();const s=performance.now()-r-n,a=setTimeout(i,Math.max(t-s,0));o&&clearTimeout(a)}),t),()=>{o=!0}},vd={period:500,rules:[{peak:50,throttle:300},{peak:60,throttle:400}]},_d={["".concat(Li)]:()=>({payloads:{add:[],update:[],remove:[]},onThrottle(e){e.add&&this.payloads.add.push(...e.add),e.update&&this.payloads.update.push(...e.update),e.remove&&this.payloads.remove.push(...e.remove)}})};function md(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:vd;return t=>new F(r=>{const n=new Map;let o=0,i=null;const{period:s,rules:a}=e;let c=null;i||(i=fd(()=>{o=0},s));const u=Object.keys(_d),d=t.subscribe({next(e){if(e&&e.evt&&null!==i){o+=1;const{evt:t,body:i}=e,s=String(t);if(u.indexOf(s)>=0)if(c){const e=n.get(s);if(e)e.onThrottle(i);else{const e=_d[s]();e.onThrottle(i),n.set(s,e)}}else{let t=0;if(a.forEach(e=>{o>e.peak&&(t=e.throttle)}),t>0){const e=_d[s]();e.onThrottle(i),n.set(s,e),c=setTimeout(()=>{n.forEach((e,t)=>{const n={evt:Number(t),body:e.payloads};r.next(n)}),n.clear(),c=null},t)}else r.next(e)}else r.next(e)}else r.next(e)},error(e){r.error(e)},complete(){r.complete()}});return()=>{d.unsubscribe(),i&&(i(),i=null),o=0}})}ma([Va,e=>{let{share:{isReceiveSharing:t}}=e;return t},e=>{let{share:{activeNodeId:t}}=e;return t}],(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;return t?e.find(e=>e.userId===r&&!0===e.sharerOn):null}));const yd=ma([Va],e=>e.filter(e=>e.sharerOn||e.sharerPause));class gd{constructor(e){this._cancelError=new Error("request for lock canceled"),this._locked=void 0,this._queue=[],this._waiters=[],this._currentReleaser=void 0,e&&(this._cancelError=e),this._locked=!1}acquire(){const e=this.isLocked(),t=new Promise((e,t)=>{this._queue.push({resolve:e,reject:t})});return e||this._dispatch(),t}async runExclusive(e){const t=await this.acquire();try{return await e()}finally{t()}}async waitForUnlock(){return this.isLocked()?new Promise(e=>this._waiters.push({resolve:e})):Promise.resolve()}isLocked(){return this._locked}release(){if(this._currentReleaser){const e=this._currentReleaser;this._currentReleaser=void 0,e()}}cancel(){this._queue.forEach(e=>e.reject(this._cancelError)),this._queue=[]}_dispatch(){const e=this._queue.shift();if(!e)return;let t=!1;this._currentReleaser=()=>{t||(t=!0,this._locked=!1,this._resolveWaiters(),this._dispatch())},this._locked=!0,e.resolve(this._currentReleaser)}_resolveWaiters(){this._waiters.forEach(e=>e.resolve()),this._waiters=[]}}const Ed=(e,t,r)=>ze(...[t,r].map((t,r)=>{if("initial"!==t)return Ve(Promise.resolve("success"===t));{const t=0===r?"ENCODE":"DECODE";return it(ia("".concat(e.toUpperCase(),"_").concat(t,"_SUCCESS"),1).pipe(St(!0)),ia("".concat(e.toUpperCase(),"_").concat(t,"_FAIL"),1).pipe(St(!1)))}})),Sd=e=>{const t=Pa(e.value);return t?ae(t):ia("ADD_CURRENT_USER_PARTICIPANT_ATTRIBUTE",1).pipe(le(Ee),Ht(e),Oe(e=>{let[,t]=e;return Pa(t)}))},bd=()=>Ve(navigator.mediaDevices.enumerateDevices()).pipe(Oe(e=>{const t=[],r=[],n=[];return e.forEach(e=>{const{kind:o,deviceId:i,label:s}=e;switch(o){case"audioinput":"communications"===i||/ZoomAudioDevice/i.test(s)||/Zoom-\S*/.test(s)||/CubebAggregateDevice\S*/.test(s)||t.push({deviceId:i,label:s});break;case"audiooutput":"communications"===i||/ZoomAudioDevice/i.test(s)||r.push({deviceId:i,label:s});break;case"videoinput":n.push({deviceId:i,label:s})}}),{microphones:t,speakers:r,cameras:n}}));function Ad(e){if(e){let r=e;try{const t=e.width;e.width=t}catch(n){var t;r=e.cloneNode(!0),null===(t=e.parentNode)||void 0===t||t.replaceChild(r,e)}return r}return e}function Id(){return yi()}const Cd=(()=>{const e=new gd;return{withAudioAction:t=>function(){for(var r=arguments.length,n=new Array(r),o=0;o{let i=!1;const s=setTimeout(()=>{i=!0,o(new Error("Operation Timeout!"))},3e4);try{const o=await e.acquire();i?o():(clearTimeout(s),r(t(...n)))}catch(e){i||(clearTimeout(s),o(e))}})},processAudioAction:t=>e.acquire().then(()=>t()),completeAudioAction:()=>{e.release()},cancelAllAudioAction:()=>{e.cancel()}}})();function Td(e){const t=["joinComputerAudio","joinSharingAudio","leaveComputerAudio","leaveSharingAudio"];return new Proxy(e,{get:(e,r)=>"string"==typeof r&&t.includes(r)?function(){return Cd.withAudioAction(e[r].bind(e))(...arguments)}:Reflect.get(e,r)})}function Od(){var e,t;const r=mi()&&Number(null===(e=li())||void 0===e||null===(t=e.match(/\d+$/))||void 0===t?void 0:t[0])>=91,n=navigator.hardwareConcurrency>2;return!Ci()&&bi()&&Si()&&r&&n}const wd=qi.createAgent();var Rd=Object.freeze({__proto__:null,sharePrivilegeChangeEpic:(e,t)=>Cn(e,Vi).pipe(tt(e=>{var t;return void 0!==(null===(t=e.payload.body)||void 0===t?void 0:t.lockShare)}),Ht(t),kt(e=>{let[t,r]=e;const{share:{sharePrivilege:n}}=r,{payload:{body:{lockShare:o}}}=t;n!==o&&ra("SHARE_PRIVILEGE_CHANGE",o)}),Oe(e=>{let[t]=e;return yc(t.payload.body.lockShare)})),shareSSrcEpic:e=>Cn(e,20227).pipe(Oe(e=>Cc(e.payload.body.ssrc))),shareStatusChangeEpic:(e,t)=>Cn(e,20225).pipe(Ht(t),tt(e=>{let[t,r]=e;const{payload:{body:n}}=t,{share:{isReceiveSharingFromMainSession:o}}=r;return!o||o&&n.fromMainSession}),Oe(e=>{let[t,r]=e;const{share:{isReceiveSharing:n,activeNodeId:o,shareQuality:i,isReceiveSharingFromMainSession:s},breakoutRoom:a}=r,{payload:{body:c}}=t;if(n&&1===c.bStatus){let e=!1;(null==a?void 0:a.currentRoom.status)===Ra.InRoom&&a.mainSessionAttendeeList.length>0&&(e=a.mainSessionAttendeeList.findIndex(e=>e.userId===o)>-1),wd.unsubscribeSharing(o,e),wd.subscribeSharing(c.activeNodeID,i,s),ts.getInstance().switchSharingSource(c.ssrc,s),ra("SHARE_AUTO_CHANGE_SOURCE",{userId:c.activeNodeID})}else if(1===c.bStatus){const e={activeUserId:c.activeNodeID,isActive:!0};s&&Object.assign(e,{isFromMainSession:!0}),ra("SHARE_ACTIVE_INDICATION",e)}else if(n){const e={activeUserId:c.activeNodeID,isActive:!1};s&&Object.assign(e,{isFromMainSession:!0}),ra("SHARE_ACTIVE_INDICATION",e)}return gc(c)})),handleChromeExtensionEpic:e=>Rn(e,hs.CheckChromeSharingExtensionResponse).pipe(Oe(e=>(ra("SHARE_CHECK_CHROME_SHARING_EXTENSION",e.payload.data),Sc(e.payload.data)))),handleSDKShareSuccessEpic:(e,t)=>Rn(e,[hs.SharingDesktopStreamHaveAudio,hs.SharingDesktopStreamHaveNoAudio]).pipe(Ht(t),Oe(e=>{let[t,r]=e;const{meeting:{userId:n},share:{isSharingToBreakoutRoom:o}}=r,{payload:{type:i}}=t,s=i===hs.SharingDesktopStreamHaveAudio;return wd.startSharing(n,{bShareToBO:o,bShareAudio:s}),bc(!1)})),handleSDKShareErrorEpic:e=>Rn(e,[hs.DesktopSharingError,hs.DesktopSharingChromeExtensionUninstalled,hs.DesktopSharingPermissionDenied,hs.DesktopSharingSystemError]).pipe(Fe(e=>{const t=[];let r="";return[hs.DesktopSharingPermissionDenied,hs.DesktopSharingSystemError].includes(e.payload.type)&&(t.push(bc(!0)),e.payload.type===hs.DesktopSharingSystemError?/mac/i.test(navigator.platform)&&(r="To use screen share on Chrome, please allow screen recording access in system setting."):r="To use screen share, please allow the permission request."),ra("SHARE_START_DESKTOP_SHARE_FAILED",{reason:r}),Ve(t)})),handleSDKShareDimensionChangeEpic:e=>Rn(e,hs.CurrentDesktopSharingWidthHeight).pipe(tt(e=>!!e.payload.data),Oe(e=>{ra("SHARE_DIMENSION_CHANGE",e.payload.data);const{payload:{data:{width:t,height:r}}}=e;return ts.getInstance().ajustmentSharingCanvas(t,r),Ac(e.payload.data)})),handleSDKReceivedShareSizeChangeEpic:(e,t)=>Rn(e,hs.SharingDecodeMaxSize).pipe(tt(e=>!!e.payload.data),Ht(t),dd(e=>{let[t,r]=e;const{share:{shareQuality:n,activeNodeId:o,isReceiveSharingFromMainSession:i}}=r,{payload:{data:{size:s}}}=t,a=Number(s);if(n!==a)return wd.subscribeSharing(o,a,i),Tc(a)})),handleRWGShareOriginalDimensionEpic:e=>Cn(e,20226).pipe(kt(e=>{var t,r;if(ra("SHARE_RECEIVED_DIMENSION_CHANGE",null===(t=e.payload)||void 0===t?void 0:t.body),null!==(r=e.payload)&&void 0!==r&&r.body){const{payload:{body:{width:t,height:r}}}=e;ts.getInstance().ajustmentReceivedSharingCanvas(t,r)}}),Oe(e=>Oc(e.payload.body))),handleSDKShareOriginalDimensionEpic:e=>Rn(e,hs.SharingPara).pipe(kt(e=>{var t,r;if(ra("SHARE_RECEIVED_DIMENSION_CHANGE",null===(t=e.payload.data)||void 0===t?void 0:t.body),null!==(r=e.payload.data)&&void 0!==r&&r.body){const{payload:{data:{body:{width:t,height:r}}}}=e;ts.getInstance().ajustmentReceivedSharingCanvas(t,r)}}),Oe(e=>{var t;return Oc(null===(t=e.payload.data)||void 0===t?void 0:t.body)})),handleSDKStopShareEpic:(e,t)=>Rn(e,hs.UserStopDesktopSharing).pipe(Ht(t),Oe(e=>{let[,t]=e;const{meeting:{userId:r},share:{status:n}}=t;return n!==bs.End&&(wd.stopSharing(r),ra("SHARE_VIDEO_STREAMS_END")),Ic(bs.End)})),handleRWGCurrentUserShareChangeEpic:(e,t)=>Cn(e,Li).pipe(Ht(t),tt(e=>{let[t,r]=e;const{meeting:{userId:n}}=r,o=t.payload.body.update;return o&&o.length>0&&o.findIndex(e=>e.id===n&&void 0!==e.bShareOn)>-1}),Fe(e=>{let[t,r]=e;const{meeting:{userId:n},share:{status:o,isReceiveSharing:i,activeNodeId:s}}=r,{payload:{body:{update:a}}}=t,c=a.find(e=>e.id===n&&!1===e.bShareOn),u=a.find(e=>e.id===n&&!0===e.bShareOn),d=[],l=ts.getInstance();return c&&o!==bs.End&&(wd.stopSharing(n),l.stopDesktopSharing(),d.push(Ic(bs.End)),ra("SHARE_PASSIVE_STOP_SHARE")),u&&o===bs.End&&(i&&(l.stopRenderSharing(),wd.unsubscribeSharing(s),d.push(Ec(!1))),d.push(Ic(bs.Sharing))),Ve(d)})),handleMultipleShareChangeEpic:(e,t)=>Cn(e,Li).pipe(Ht(t),tt(e=>{let[t,r]=e;const{meeting:{userId:n}}=r,o=t.payload.body.update;return o&&o.length>0&&o.findIndex(e=>e.id!==n&&void 0!==e.bShareOn)>-1}),Fe(r=>{let[n,o]=r;const{payload:{body:{update:i}}}=n,{share:{activeNodeId:s,isReceiveSharing:a,shareQuality:c,isReceiveSharingFromMainSession:u}}=o,d=yd(o),l=i.filter(e=>!0===e.bShareOn&&!1===e.bSharePause),p=i.filter(e=>!1===e.bShareOn);return l.length>0&&l.forEach(e=>{-1===d.findIndex(t=>t.userId===e.id)&&ra("SHARE_NEW_USER_ADD",e)}),p.length>0&&(p.forEach(e=>{ra("SHARE_USER_REMOVE",e)}),a&&p.some(e=>e.id===s))?it(Cn(e,20225).pipe(yt(1),It(ee)),ct(50).pipe(It(ce("timeout")))).pipe(dt(()=>{const{share:{activeNodeId:e,isReceiveSharingFromMainSession:r,shareQuality:n},audio:o}=t.value,i=d.filter(t=>t.userId!==e);if(i.length>0){const t=i[0],{userId:s}=t;wd.unsubscribeSharing(e,r),wd.subscribeSharing(s,n,r);const a=ts.getInstance();return a.switchSharingSource(s,r),null==o||o.localShareAudioUserMutedList.forEach(e=>{a.setSharingAudioVolume(s,e.userId!==s||e.muted)}),ra("SHARE_AUTO_CHANGE_SOURCE",{userId:s}),ae(gc({activeNodeID:s,bStatus:1,ssrc:s}))}return ee})):ee})),handleSharingEncryptIndication:(e,t)=>Cn(e,Ui).pipe(Ht(t),Nt(e=>{let[r,n]=e;const{payload:{body:{encryptKey:o,additionalType:i}}}=r,{media:{sharingDecodeStatus:s,sharingEncodeStatus:a},meeting:{confId:c,userId:u,zoomId:d,meetingId:l,meetingNumber:p,isWebinar:h}}=n;return Sd(t).pipe(Nt(e=>{let r=a;return h&&e&&Ca(e.userRole)&&(r="failed"),Ed("sharing",r,s).pipe(kt(e=>{let[r,n]=e;const s=ts.getInstance(),a={userId:u,sn:_o(d),confId:c,encryptKey:_o(o),encryptType:i,meetingId:l,meetingNumber:p};if(r&&(null==s||s.updateMediaParams({iVType:Ti.SHARING_ENCODE,isFromMainSession:!1,updateParams:a})),n){s.updateMediaParams({iVType:Ti.SHARING_DECODE,isFromMainSession:!1,updateParams:a});const{participants:{attendeesList:e}}=t.value;if(e.length>0){const t=e.map(e=>({userid:e.userId,sn:e.zoomID&&_o(e.zoomID)}));s.updateUserMediaSN({added:t,isFromMainSession:!1,iVType:Ti.SHARING_DECODE})}}}),It(ee))}))})),handleSharingReceivingChannelReadyEpic:(e,t)=>wn(e,20235).pipe(Ht(t),kt(e=>{let[t,r]=e;const{media:{sharingDecodeStatus:n}}=r,{type:o,payload:{body:i}}=t,s=o==="".concat(en);Ed("sharing","success",n).subscribe(e=>{let[,t]=e;t&&ts.getInstance().addReceivedSharingChannelType(c({isFromMainSession:s},i))})}),It(ee)),handleSharingReceivingChannelCloseEpic:(e,t)=>wn(e,20236).pipe(Ht(t),kt(e=>{let[t,r]=e;const{media:{sharingDecodeStatus:n}}=r,{type:o,payload:{body:{ssrc:i}}}=t,s=o==="".concat(en);Ed("sharing","success",n).subscribe(e=>{let[,t]=e;t&&ts.getInstance().removeReceivedSharingChannelType({isFromMainSession:s,ssrc:i})})}),It(ee))});function Dd(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n3?t.i-4:t.i:Array.isArray(e)?1:Vd(e)?2:jd(e)?3:0}function Ud(e,t){return 2===kd(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Ld(e,t,r){var n=kd(e);2===n?e.set(t,r):3===n?(e.delete(t),e.add(r)):e[t]=r}function Vd(e){return dl&&e instanceof Map}function jd(e){return ll&&e instanceof Set}function Hd(e){return e.o||e.t}function xd(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=yl(e);delete t[vl];for(var r=ml(t),n=0;n1&&(e.set=e.add=e.clear=e.delete=Bd),Object.freeze(e),t&&Md(e,(function(e,t){return Fd(t,!0)}),!0)),e}function Bd(){Dd(2)}function Gd(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function Wd(e){var t=gl[e];return t||Dd(18,e),t}function Kd(){return cl}function qd(e,t){t&&(Wd("Patches"),e.u=[],e.s=[],e.v=t)}function zd(e){Jd(e),e.p.forEach(Zd),e.p=null}function Jd(e){e===cl&&(cl=e.l)}function Yd(e){return cl={p:[],l:cl,h:e,m:!0,_:0}}function Zd(e){var t=e[vl];0===t.i||1===t.i?t.j():t.O=!0}function Qd(e,t){t._=t.p.length;var r=t.p[0],n=void 0!==e&&e!==r;return t.h.g||Wd("ES5").S(t,e,n),n?(r[vl].P&&(zd(t),Dd(4)),Pd(e)&&(e=Xd(t,e),t.l||el(t,e)),t.u&&Wd("Patches").M(r[vl],e,t.u,t.s)):e=Xd(t,r,[]),zd(t),t.u&&t.v(t.u,t.s),e!==hl?e:void 0}function Xd(e,t,r){if(Gd(t))return t;var n=t[vl];if(!n)return Md(t,(function(o,i){return $d(e,n,t,o,i,r)}),!0),t;if(n.A!==e)return t;if(!n.P)return el(e,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var o=4===n.i||5===n.i?n.o=xd(n.k):n.o;Md(3===n.i?new Set(o):o,(function(t,i){return $d(e,n,o,t,i,r)})),el(e,o,!1),r&&e.u&&Wd("Patches").R(n,r,e.u,e.s)}return n.o}function $d(e,t,r,n,o,i){if(Nd(o)){var s=Xd(e,o,i&&t&&3!==t.i&&!Ud(t.D,n)?i.concat(n):void 0);if(Ld(r,n,s),!Nd(s))return;e.m=!1}if(Pd(o)&&!Gd(o)){if(!e.h.F&&e._<1)return;Xd(e,o),t&&t.A.l||el(e,o)}}function el(e,t,r){void 0===r&&(r=!1),e.h.F&&e.m&&Fd(t,r)}function tl(e,t){var r=e[vl];return(r?Hd(r):e)[t]}function rl(e,t){if(t in e)for(var r=Object.getPrototypeOf(e);r;){var n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Object.getPrototypeOf(r)}}function nl(e){e.P||(e.P=!0,e.l&&nl(e.l))}function ol(e){e.o||(e.o=xd(e.t))}function il(e,t,r){var n=Vd(t)?Wd("MapSet").N(t,r):jd(t)?Wd("MapSet").T(t,r):e.g?function(e,t){var r=Array.isArray(e),n={i:r?1:0,A:t?t.A:Kd(),P:!1,I:!1,D:{},l:t,t:e,k:null,o:null,j:null,C:!1},o=n,i=El;r&&(o=[n],i=Sl);var s=Proxy.revocable(o,i),a=s.revoke,c=s.proxy;return n.k=c,n.j=a,c}(t,r):Wd("ES5").J(t,r);return(r?r.A:Kd()).p.push(n),n}function sl(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return xd(e)}var al,cl,ul="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),dl="undefined"!=typeof Map,ll="undefined"!=typeof Set,pl="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,hl=ul?Symbol.for("immer-nothing"):((al={})["immer-nothing"]=!0,al),fl=ul?Symbol.for("immer-draftable"):"__$immer_draftable",vl=ul?Symbol.for("immer-state"):"__$immer_state",_l=""+Object.prototype.constructor,ml="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,yl=Object.getOwnPropertyDescriptors||function(e){var t={};return ml(e).forEach((function(r){t[r]=Object.getOwnPropertyDescriptor(e,r)})),t},gl={},El={get:function(e,t){if(t===vl)return e;var r=Hd(e);if(!Ud(r,t))return function(e,t,r){var n,o=rl(t,r);return o?"value"in o?o.value:null===(n=o.get)||void 0===n?void 0:n.call(e.k):void 0}(e,r,t);var n=r[t];return e.I||!Pd(n)?n:n===tl(e.t,t)?(ol(e),e.o[t]=il(e.A.h,n,e)):n},has:function(e,t){return t in Hd(e)},ownKeys:function(e){return Reflect.ownKeys(Hd(e))},set:function(e,t,r){var n=rl(Hd(e),t);if(null==n?void 0:n.set)return n.set.call(e.k,r),!0;if(!e.P){var o=tl(Hd(e),t),i=null==o?void 0:o[vl];if(i&&i.t===r)return e.o[t]=r,e.D[t]=!1,!0;if(function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}(r,o)&&(void 0!==r||Ud(e.t,t)))return!0;ol(e),nl(e)}return e.o[t]===r&&"number"!=typeof r&&(void 0!==r||t in e.o)||(e.o[t]=r,e.D[t]=!0,!0)},deleteProperty:function(e,t){return void 0!==tl(e.t,t)||t in e.t?(e.D[t]=!1,ol(e),nl(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var r=Hd(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:n.enumerable,value:r[t]}:n},defineProperty:function(){Dd(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){Dd(12)}},Sl={};Md(El,(function(e,t){Sl[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),Sl.deleteProperty=function(e,t){return El.deleteProperty.call(this,e[0],t)},Sl.set=function(e,t,r){return El.set.call(this,e[0],t,r,e[0])};var bl=new(function(){function e(e){var t=this;this.g=pl,this.F=!0,this.produce=function(e,r,n){if("function"==typeof e&&"function"!=typeof r){var o=r;r=e;var i=t;return function(e){var t=this;void 0===e&&(e=o);for(var n=arguments.length,s=Array(n>1?n-1:0),a=1;a1?n-1:0),i=1;i=0;r--){var n=t[r];if(0===n.path.length&&"replace"===n.op){e=n.value;break}}r>-1&&(t=t.slice(r+1));var o=Wd("Patches").$;return Nd(e)?o(e,t):this.produce(e,(function(e){return o(e,t)}))},e}()),Al=bl.produce;bl.produceWithPatches.bind(bl),bl.setAutoFreeze.bind(bl),bl.setUseProxies.bind(bl),bl.applyPatches.bind(bl),bl.createDraft.bind(bl),bl.finishDraft.bind(bl);const Il={ssrc:0,status:bs.End,shareDimension:{width:0,height:0},receivedShareDimension:{width:1920,height:1080,logicWidth:1920,logicHeight:1080},sharePrivilege:Ss.OnlyHost,activeNodeId:0,activeSsrc:0,shareQuality:1,isRemoteSharingActive:!1,isReceiveSharing:!1,isRemoteControlApproved:!1,isGrabRemoteControl:!1,isSDKGrabControl:!1,isChromeExtensionInstalled:!1,isScreenShareForbidden:!1,isReceiveSharingFromMainSession:!1,isSharingToBreakoutRoom:!1},Cl=Fr({["".concat(yc)]:Al((e,t)=>{let{payload:r}=t;e.sharePrivilege=r}),["".concat(gc)]:Al((e,t)=>{let{payload:r}=t;e.isRemoteSharingActive=1===r.bStatus,e.activeNodeId=r.activeNodeID,e.activeSsrc=r.ssrc}),["".concat(Ec)]:Al((e,t)=>{let{payload:r}=t;e.isReceiveSharing=r}),["".concat(Sc)]:Al((e,t)=>{let{payload:r}=t;e.isChromeExtensionInstalled=r}),["".concat(Ac)]:Al((e,t)=>{let{payload:r}=t;e.shareDimension=c({},r)}),["".concat(Ic)]:Al((e,t)=>{let{payload:r}=t;e.status=r}),["".concat(Cc)]:Al((e,t)=>{let{payload:r}=t;e.ssrc=r}),["".concat(Tc)]:Al((e,t)=>{let{payload:r}=t;e.shareQuality=r}),["".concat(Oc)]:Al((e,t)=>{let{payload:r}=t;e.receivedShareDimension=c({},r)}),["".concat(wc)]:Al((e,t)=>{let{payload:r}=t;e.isRemoteControlApproved=r}),["".concat(Rc)]:Al((e,t)=>{let{payload:r}=t;e.isGrabRemoteControl=r}),["".concat(Dc)]:Al((e,t)=>{let{payload:r}=t;e.isVerifiedRenderCanvasAfterFailover=r}),["".concat(Nc)]:Al((e,t)=>{let{payload:r}=t;e.isVerifiedCaptureCanvasAfterFailover=r}),["".concat(Pc)]:Al((e,t)=>{let{payload:r}=t;e.isSDKGrabControl=r}),["".concat(Mc)]:Al((e,t)=>{let{payload:r}=t;e.isReceiveSharingFromMainSession=r}),["".concat(kc)]:Al((e,t)=>{let{payload:r}=t;e.isSharingToBreakoutRoom=r}),["".concat(Uc)]:()=>c(c({},Il),{},{isVerifiedRenderCanvasAfterFailover:!1,isVerifiedCaptureCanvasAfterFailover:!1})},Il),Tl=In(Rd),Ol=qi.createAgent(),wl=(e,t)=>e.pipe(Kt("".concat(Ao)),Ht(t),tt(e=>{let[,t]=e;return void 0!==t.meeting.encryptedRWC}),pd(e=>{let[,t]=e;const{meeting:{encryptedRWC:r,ts:n,auth:o,meetingNumber:i},breakoutRoom:s}=t;if(r){const e=Object.keys(r).map(e=>{const t=r[e];let a=void 0;return a=s&&s.currentRoom.boConfId?ad(e,i,t,n,o,s.currentRoom.boConfId):ad(e,i,t,n,o),{url:a,domain:e,rwcToken:t}}),t=null==e?void 0:e.length,a=[];return Ve(e).pipe(Fe(e=>zn(e.url).pipe(Fe(t=>{let r={};return r=t.response?c(c({},t.response),{},{fromNginx:!1}):{rwg:e.domain,rwcToken:e.rwcToken,fromNginx:!0},Ve([nn(r),Br()])}),dt(()=>(a.push(e.url),a.length===t&&ra("JOIN_MEETING_FAILED",{reason:"connection error",errorCode:-3e3}),ee)))),Ot(ko(performance.now())))}}));var Rl=Object.freeze({__proto__:null,pingRWCEpic:wl,joinMeetingWelcomeEpic:e=>Cn(e,0).pipe(kt(e=>{var t;if("READY"===(null===(t=e.payload.body)||void 0===t?void 0:t.status)){const e=di.get(Ri.WebclientMeetingToken);e&&Ol.joinMeeting(e)}}),It(ee)),joinMeetingSuccessfulEpic:(e,t)=>Cn(e,4098).pipe(Ht(t),pd(e=>{let[t,r]=e;const{payload:{body:{res:n,userID:o,zoomID:i,mn:s,participantID:a,hugeBO:c,elapsed:u,disableAqos:d,disableVqos:l,meetingtoken:p,role:h}}}=t,{meeting:{pingRWCTimestamp:f,isWebinar:v,userEmail:_,userName:m,isMeetingReset:y,meetingOptions:g,xmppConfig:E,zlkJwtToken:S,cv:b},media:{mediaConstraints:A,assetsPath:I},breakoutRoom:C}=r;if(Zn.CONF_SUCCESS===n){const{WebclientParticipantId:e,WebclientUserId:r,WebclientZoomId:n,WebclientUserEmail:T,WebclientUserName:O,WebclientMeetingToken:w}=Ri;di.set(r,o,ci.SessionStorage),di.set(n,i,ci.SessionStorage),di.set(e,a,ci.SessionStorage),_&&di.set(T,_,ci.SessionStorage),di.set(O,m,ci.SessionStorage),p&&di.set(w,p,ci.SessionStorage),Ol.sendRWGConnectionPerformance("WCL_M, JMCT(".concat(performance.now()-f,")"));const R=[Uo(t.payload.body),Jo(performance.now())];ts.getInstance().init(),y&&(R.push(Fo(!1)),void 0!==A&&void 0!==I&&R.push(ln())),v&&R.push(Gr()),E&&S&&R.push(Xr()),C&&(g&&!0===g.isBO100Enabled&&R.push(od(c)),C.currentRoom.boConfId&&R.push(Zr()),void 0!==u&&R.push(Gu(u)));let D=!l;const N=!d;return S&&yo(b,"1.3.0")<0&&(D=!1),R.unshift(Yo({audioQos:N,videoQos:D})),(h&ga.Owner)===ga.Owner&&(ra("JOIN_MEETING_FAILED",{reason:"dont support assisnt join through widget",errorCode:-1}),Ol.leaveMeeting()),ra("JOIN_MEETING_SUCCESS",{meetingNumber:s}),Ve(R)}return Zn.CONF_FAIL_CONFLOCKED===n?ra("JOIN_MEETING_FAILED",ao(n)):Zn.CONF_FAIL_CONF_USER_FULL===n?ra("JOIN_MEETING_FAILED",Object.assign({},ao(n),{lmUrl:t.payload.body.lmURL})):(Zn.CONF_FAIL_MEETING_OVER===n||Zn.CONF_RESULT_MMR_IB_REJECT===n||Zn.CONF_FAIL_RESULT_MMR_CONF_PARTICIPANT_EXISTS===n||[Zn.CONF_FAIL_HAS_BEEN_REMOVED,Zn.CONF_FAIL_WEBINAR_DENIED_EMAIL].includes(n),ra("JOIN_MEETING_FAILED",ao(n))),Ve(cd(r,!1))})),handleMeetingAttributeChangeEpic:(e,t)=>Cn(e,Vi).pipe(Ht(t),Oe(e=>{let[t,r]=e;const{payload:{body:n}}=t,{meeting:{zoomId:o,encType:i}}=r;if(void 0!==(null==n?void 0:n.encryptKey)&&ki.init(o,n.encryptKey,i),void 0!==(null==n?void 0:n.gatewayKey)){const e=ts.getInstance(),[,t,r]=n.gatewayKey.split(".");e.sendUserNodeList([{userid:Number(t),sn:r&&_o(r)}])}return ra("UPDATE_MEETING_ATTRIBUTE",n),Lo(n)})),handleMeetingEndEpic:(e,t)=>Cn(e,7939).pipe(Ht(t),Fe(e=>{let[t,r]=e;const{payload:{body:n}}=t;if(void 0!==n.reason){if(Qn.LEAVEREASON_RECONNECT===n.reason)return Xn.LEAVESUBREASON_WAITINGROOMFAILOVER===n.subReason?ra("RECONNECTING_MEETING",{reason:ni.OnHold}):ra("RECONNECTING_MEETING",{reason:ni.Failover}),ae(Io());Qn.LEAVEREASON_KICKEDBYHOST===n.reason?ra("LEAVING_MEETING",{reason:"kicked by host"}):Qn.LEAVEREASON_ENDBYHOST!==n.reason&&Qn.LEAVEREASON_ENDBYHOSTSTARTANOTHERMEETING!==n.reason||ra("LEAVING_MEETING",{reason:"ended by host"})}return r.meeting.isMeetingReset?ee:Ve(cd(r,!1))})),meetingFailoverEpic:(e,t)=>e.pipe(Kt("".concat(Io)),Ht(t),Fe(e=>{let[,t]=e;const r=cd(t,!0);let n;if(t.meeting.zlkJwtToken){const e=function(e){if(e){const{meeting:{topic:t,passWord:r,userName:n,zlkJwtToken:o,lang:i,cv:s,customerKey:a}}=e;return{topic:t,passWord:r,userName:n,zlkJwtToken:o,lang:i,cv:s,customerKey:a}}return null}(t),r={topic:null==e?void 0:e.topic,password:null==e?void 0:e.passWord,userName:null==e?void 0:e.userName,zlk:null==e?void 0:e.zlkJwtToken,lang:null==e?void 0:e.lang,cv:null==e?void 0:e.cv,customerKey:null==e?void 0:e.customerKey};n=ae(bo(r)).pipe(ft(1e3))}else{const e=function(e){const{meeting:{apiKey:t,signature:r,signatureType:n,meetingNumber:o,userName:i,lang:s,passWord:a,userEmail:c,sdkUrl:u,sdkOrigin:d,proxy:l,cv:p,ztk:h,zsk:f,tk:v}}=e,_=h||sessionStorage.getItem(Ri.WebclientZtk),m=f||sessionStorage.getItem(Ri.WebclientZsk);return{apiKey:t,signature:r,signatureType:n,meetingNumber:o,userName:i,lang:s,passWord:a,userEmail:c,sdkUrl:u,sdkOrigin:d,proxy:l,cv:p,ztk:_,zsk:m,tk:v||sessionStorage.getItem(Ri.WebclientTk),ulsm:m?1:0}}(t);n=ae(So(e)).pipe(ft(1e3))}return qe(Ve(r),n)})),hostChangeEpic:e=>wn(e,7940).pipe(kt(e=>{ra("MEETING_HOST_CHANGE_INDICATION",e.payload.body.bHost)}),Oe(e=>jo(e.payload.body))),cohostChangeEpic:e=>wn(e,7941).pipe(kt(e=>{ra("MEETING_COHOST_CHANGE_INDICATION",e.payload.body.bCoHost)}),Oe(e=>Ho(e.payload.body))),setMeetingOptEpic:e=>wn(e,7945).pipe(kt(e=>{const{payload:{body:{opt:t}}}=e;di.set(Ri.WebclientOpt,t,ci.SessionStorage)}),It(ee)),setMeetingOnHoldEpic:(e,t)=>Cn(e,7942).pipe(kt(e=>{const{payload:{body:{bHold:t}}}=e;di.set(Ri.WebclientIsOnHold,t?1:0,ci.SessionStorage),ra("MEETING_IN_WAITING_ROOM",t)}),Ht(t),Fe(e=>{let[t,r]=e;const n=[xo(t.payload.body.bHold)];if(t.payload.body.bHold){const e=Pa(r);if(e){n.push(Bo({audio:e.audio,video:e.bVideoOn,muted:e.muted}));const t=ts.getInstance();if("computer"===e.audio&&(t.leaveComputerAudio(),Ol.joinOrLeaveVoip(!1)),e.bVideoOn&&t.stopCaptureVideo(),e.sharerOn&&(Ol.stopSharing(e.userId),t.stopDesktopSharing(),n.push(Ic(bs.End))),r.video&&r.video.subscribedVideoList.length>0&&r.video.subscribedVideoList.forEach(e=>{Ol.unsubscribeVideo(e)}),r.share&&r.share.isReceiveSharing){const e=r.share.activeNodeId;r.share.isRemoteControlApproved&&(Ol.sharingRequestRemoteControl(e,!1),t.stopRemoteControl()),Ol.unsubscribeSharing(e),t.stopRenderSharing()}}}return Ve(n)})),setMeetingDataCenterRegionEpic:e=>Cn(e,7954).pipe(Oe(e=>qo(e.payload.body))),claimHostResponseEpic:e=>Cn(e,4216).pipe(kt(e=>{ra("MEETING_CLAIM_HOST_KEY_RESPONSE",e.payload.body.bresult)}),It(ee)),leaveMeetingEpic:(e,t)=>e.pipe(Kt("".concat(Co),"".concat(To)),Ht(t),Fe(e=>{let[t,r]=e;return t.type==="".concat(Co)?(Ol.leaveMeeting(),ra("LEAVING_MEETING",{})):t.type==="".concat(To)&&(Ol.endMeeting(),ra("LEAVING_MEETING",{})),Ve(cd(r,!1))})),versionUpgradeEpic:e=>Cn(e,2).pipe(kt(()=>{console.warn("Upgrade to latest version to optimize meeting experience")}),It(ee)),versionBlockEpic:e=>Cn(e,1).pipe(kt(e=>{const{payload:{body:{upgradeVersion:t}}}=e,r=ao(1e3);if(r&&r.reason){const e=r.reason.replace(/{(\d+)}/g,()=>t);r.reason=e}ra("JOIN_MEETING_FAILED",r)}),It(ee))});let Dl="zoom.us";const Nl="https://dmogdx0jrul3u.cloudfront.net/".concat("2.4.1","/lib/av"),Pl="https://source.zoom.us/".concat("2.4.1","/lib/av"),Ml="https://jssdk.zoomus.cn/".concat("2.4.1","/lib/av");let kl,Ul;!function(e){e.Expel="expel",e.Promote="promote",e.Depromote="depromote",e.MemberChange="memberChange",e.RaiseHand="raisehand",e.LowerHand="lowerhand",e.PutdownHands="putdownhands"}(kl||(kl={})),function(e){e[e.AttendeeToAllPanelist=1]="AttendeeToAllPanelist",e[e.PanelistToAttendee=3]="PanelistToAttendee"}(Ul||(Ul={}));const Ll=["CONNECTED","DISCONNECTED","POOL","CONNFAIL","OnlineMembers","GroupChange","RosterChange","WebinarQA","Message"];class Vl{constructor(){if(this.callbackList=void 0,this.instance=void 0,this.callbackList=[],"undefined"!=typeof webIM&&(this.instance=new webIM.WebimInstance,this.instance)){const e=this.instance.server;Ll.forEach(t=>{e.on(t,e=>{this.onXmppCallback(t,e)})})}this.onXmppCallback=this.onXmppCallback.bind(this)}static getInstance(){return void 0===this.agentInstance&&(this.agentInstance=new Vl),this.agentInstance}onXmppCallback(e,t){this.callbackList.length>0&&this.callbackList.forEach(r=>r(e,t))}registerCallback(e){this.callbackList.push(e)}unregisterCallback(e){this.callbackList=this.callbackList.filter(t=>t!==e)}connect(e){var t;const{svcUrl:r,meetingNumber:n,conId:o,clientCap:i,jid:s,displayName:a}=e;if(!this.instance&&void 0!==window.webIM){this.instance=new window.webIM.WebimInstance;const e=this.instance.server;Ll.forEach(t=>{e.on(t,e=>{this.onXmppCallback(t,e)})})}const c="wss://".concat(r,"/wc/media/").concat(n,"?type=x&cid=").concat(o);null===(t=this.instance)||void 0===t||t.server.connect({url:c,jid:s,meetingNumber:n,clientCap:i,displayName:a})}lowerHand(e){var t;null===(t=this.instance)||void 0===t||t.server.lowerHand(e)}raiseHand(){var e;null===(e=this.instance)||void 0===e||e.server.raiseHand()}sendWebinarMsg(e,t,r,n){var o;null===(o=this.instance)||void 0===o||o.server.sendWebinarMsg(e,t,r,n)}rename(e,t){var r;null===(r=this.instance)||void 0===r||r.server.rename(e,t)}sendAsk(e,t,r){var n;null===(n=this.instance)||void 0===n||n.server.sendAsk(e,t,r)}sendAnswer(e,t,r){var n;null===(n=this.instance)||void 0===n||n.server.sendAnswer(e,t,r)}answerOnline(e,t){var r;null===(r=this.instance)||void 0===r||r.server.answerOnline(e,t)}sendDismiss(e){var t;null===(t=this.instance)||void 0===t||t.server.sendDismiss(e)}sendReOpen(e){var t;null===(t=this.instance)||void 0===t||t.server.sendReOpen(e)}sendUpVote(e){var t;null===(t=this.instance)||void 0===t||t.server.sendUpVote(e)}sendDownVote(e){var t;null===(t=this.instance)||void 0===t||t.server.sendDownVote(e)}disconnect(){var e;null===(e=this.instance)||void 0===e||e.server.disconnect(),this.instance=void 0}}let jl,Hl;Vl.agentInstance=void 0;var xl=Object.freeze({__proto__:null,startIdleTimerEpic:(e,t)=>e.pipe(Kt("".concat(Uo)),Ht(t),tt(e=>{let[,t]=e;return void 0!==t.meeting.zlkJwtToken}),Nt(()=>{var e,t;return jl&&jl.complete(),jl=new q,Hl=(e=6e4,void 0===e&&(e=0),void 0===t&&(t=Ae),(!Qe(e)||e<0)&&(e=0),t&&"function"==typeof t.schedule||(t=Ae),new F((function(r){return r.add(t.schedule(Xe,e,{subscriber:r,counter:0,period:e})),r}))).pipe(Oe(()=>performance.now())).subscribe(jl),jl.pipe(Oe(e=>Oo(e)))})),terminateIdleTimerEpic:e=>e.pipe(Kt("".concat(Wr))).pipe(kt(()=>{jl&&(jl.complete(),Hl.unsubscribe())}),It(ee)),idleCheckingEpic:(e,t)=>e.pipe(Kt("".concat(Oo)),Ht(t),Fe(e=>{var t;let[r,n]=e;const{meeting:{idleStartTime:o,sessionIdleTimeoutMins:i,isOriginHost:s},participants:{attendeesList:a,xmppAttendeeList:c},recording:u,breakoutRoom:d}=n,l=r.payload,p=[];if(1===a.length&&0===c.length&&(null==d||null===(t=d.currentRoom)||void 0===t?void 0:t.status)!==Ra.InRoom&&(null==u?void 0:u.cmrStatus)!==ds.Start)if(o){const e=s&&ba(a[0].userRole)?i:40;l-o>60*e*1e3&&(console.warn("No active for ".concat(e," minutes, will end the session.")),p.push(To()),ct(500).subscribe(()=>{sa()}))}else p.push(Qo(l));else p.push(Qo(void 0));return Ve(p)})),resetIdleStartTimeEpic:(e,t)=>e.pipe(Kt("".concat(zr)),tt(e=>[Li,Vi].includes(e.payload.evt)&&void 0!==t.value.meeting.idleStartTime),le(be),Fe(()=>{var e;const{participants:{attendeesList:r,xmppAttendeeList:n},recording:o,breakoutRoom:i}=t.value,s=[];return(r.length>1||n.length>0||(null==o?void 0:o.cmrStatus)===ds.Start||(null==i||null===(e=i.currentRoom)||void 0===e?void 0:e.status)===Ra.InRoom)&&s.push(Qo(void 0)),Ve(s)})),resetIdleStartTimeAfterLeaveMeetingEpic:e=>e.pipe(Kt("".concat(Co),"".concat(To)),St(Qo(void 0)))});let Fl=0;var Bl,Gl=lo((function(e,t){var r;r=function(){function e(){for(var e=0,t={};e1&&void 0!==arguments[1]?arguments[1]:0,r=(Jl[e[t+0]]+Jl[e[t+1]]+Jl[e[t+2]]+Jl[e[t+3]]+"-"+Jl[e[t+4]]+Jl[e[t+5]]+"-"+Jl[e[t+6]]+Jl[e[t+7]]+"-"+Jl[e[t+8]]+Jl[e[t+9]]+"-"+Jl[e[t+10]]+Jl[e[t+11]]+Jl[e[t+12]]+Jl[e[t+13]]+Jl[e[t+14]]+Jl[e[t+15]]).toLowerCase();if(!zl(r))throw TypeError("Stringified UUID is invalid");return r}(n)}let Ql;!function(e){e[e.Unknown=0]="Unknown",e[e.Windows=1]="Windows",e[e.Mac=2]="Mac",e[e.Pad=3]="Pad",e[e.Mobile=4]="Mobile",e[e.CallIn=5]="CallIn",e[e.Linux=6]="Linux",e[e.WebClient=7]="WebClient",e[e.ChromeOs=8]="ChromeOs"}(Ql||(Ql={}));const{WebclientIsOnHold:Xl,WebclientOpt:$l,WebclientParticipantId:ep,WebclientZoomId:tp,WebclientWebinarToken:rp,WebclientMeetingToken:np}=Ri,{WebclientDeviceId:op}=Di,ip=Vl.getInstance();let sp;var ap=Object.freeze({__proto__:null,loadWebIMEpic:(e,t)=>e.pipe(Kt("".concat(qr)),Ht(t),Fe(e=>{let[,t]=e;const{media:{assetsPath:r}}=t;return Ve(new Promise((e,t)=>{ei("".concat(r,"/webim.min.js"),()=>{e("")},()=>{t()})})).pipe(St(an(!0)),dt(e=>ae(an(!1))))})),connectXMPPSocketEpic:(e,t)=>e.pipe(Kt("".concat(Gr)),Ht(t),tt(e=>{let[,t]=e;return"closed"===t.socket.xmppSocketStatus}),pd(t=>{let[,r]=t;const{meeting:{svcUrl:n,meetingNumber:o,conId:i,jid:s,userName:a},socket:{isXmppSDKLoaded:c}}=r,u=hi()&&fi()?11:10;let d=ae(c);return!1===c&&(d=e.pipe(Kt("".concat(an)),yt(1))),d.pipe(Fe(e=>{return e?(t={svcUrl:n,meetingNumber:o,conId:i,jid:s,userName:a,clientCap:u},ip.connect(t),sp=new q,Ze(e=>ip.registerCallback(e),e=>ip.unregisterCallback(e),(e,t)=>({event:e,data:t})).subscribe(sp),sp).pipe(Oe(e=>Yr(e)),Ot(sn(Fa.Connecting))):ce("webim load fail");var t}))})),connectedXmppSocketEpic:(e,t)=>e.pipe(Kt("".concat(sn)),tt(e=>e.payload===Fa.Connecting),pd(()=>{if(sp){const e=sp.pipe(tt(e=>"CONNECTED"===e.event)),r=sp.pipe(tt(e=>"DISCONNECTED"===e.event));return $e(e.pipe(Fe(()=>ae(sn(Fa.Connected)))),r.pipe(ft(1e3),Ht(t),tt(e=>{let[,t]=e;return"closed"!==t.socket.xmppSocketStatus&&"joined"===t.meeting.meetingStatus&&!t.meeting.isMeetingReset}),Oe(()=>(ra("RECONNECTING_MEETING",{reason:ni.Failover}),Io()))))}})),disconnectXmppSocketEpic:e=>e.pipe(Kt("".concat(Kr)),St(sn(Fa.Closed)),kt(()=>{var e;ip.disconnect(),null===(e=sp)||void 0===e||e.complete()}))});const{setCloudRecordingStatus:cp,setCloudRecordingEnable:up,setAllowStopAutoRecording:dp,setAutomaticCloudRecordingEnable:lp}=Ur("SET_CLOUD_RECORDING_STATUS","SET_CLOUD_RECORDING_ENABLE","SET_ALLOW_STOP_AUTO_RECORDING","SET_AUTOMATIC_CLOUD_RECORDING_ENABLE"),pp={meetingStatus:"initial",isWindowOpen:!1,apiKey:"",signature:"",signatureType:"",lang:"en-US",tk:"",customerKey:"",mtkGuid:"",pingRWCTimestamp:0,passWord:"",meetingNumber:0,userName:"",userEmail:"",sdkUrl:"",sdkOrigin:"",proxy:1,cv:"",meetingId:"",tid:"",ts:"",auth:"",sign:"",isSupportCallOut:!1,tollNumbers:void 0,recordingEnable:!1,callOutCountry:void 0,inviteEmail:"",xmppConfig:null,isSupportH323:!1,h323GatewayInfo:"",h323Password:"",trackAuth:"",isOriginHost:!1,isWebinar:!1,encryptedRWC:void 0,meetingOptions:{},meetingTopic:"",isSupportQA:!1,bLock:!1,bHoldUponEntry:!1,viewOnly:0,listenOnlyPhone:0,bAllowRaiseHand:!1,bAllowAttendeeRename:!1,bBroadcast:void 0,bAllowPlayChimeForEnterOrExit:!1,bIbDisableShare:!1,bIbDisableChat:!1,bAllowShowCount:!1,encryptKey:"",bNoHostTimeOut:!1,confId:"",conId:"",e2eEncrypt:!1,zoomId:"",jid:"",xtoken:"",groups:void 0,svcUrl:"",encType:NaN,userGUID:"",userId:NaN,isHost:!1,isCoHost:!1,participantID:0,isOnHold:!1,isMeetingReset:!1,bRecord:!1,audioVideoBeforeOnHold:void 0,region:void 0,network:void 0,joinMeetingTimeStamp:0,enableAudioQos:!0,enableVideoQos:!0,activeAppInfo:void 0,recordingDisclaimerForRecorder:{},recordingDisclaimer:{},ccUrl:"",sessionIdleTimeoutMins:40,reportDomain:"",isAudioBridgeEnabled:!0},hp=Fr({["".concat(wo)]:Al((e,t)=>{let{payload:r}=t;r.customerKey=e.customerKey||r.customerKey||"",Object.assign(e,r)}),["".concat(Ro)]:Al((e,t)=>{let{payload:r}=t;e.isWindowOpen=r}),["".concat(Do)]:Al((e,t)=>{let{payload:r}=t;r.useSDK?e.signatureType="sdk":e.signatureType="api",e.apiKey=r.apiKey,e.signature=r.signature,e.lang=r.language}),["".concat(No)]:Al((e,t)=>{let{payload:r}=t;e.ztk=r}),["".concat(Po)]:Al((e,t)=>{let{payload:r}=t;e.zsk=r}),["".concat(Mo)]:Al((e,t)=>{let{payload:r}=t;e.tk=r.tk,e.mtkGuid=r.mtkGuid}),["".concat(ko)]:Al((e,t)=>{let{payload:r}=t;e.pingRWCTimestamp=r}),["".concat(Uo)]:Al((e,t)=>{let{payload:r}=t;e.confId=r.confID,e.conId=r.conID,e.e2eEncrypt=r.e2eEncrypt,e.meetingNumber=parseInt(r.mn,10),e.zoomId=r.zoomID,e.meetingStatus="joined",e.jid=r.jid,e.xtoken=r.xtoken,e.groups=r.groups,e.svcUrl=r.svcUrl,e.encType=r.encType,e.userGUID=r.userGUID,e.userId=r.userID,e.role=r.role,e.participantID=r.participantID,e.reportDomain=r.reportDomain}),["".concat(Lo)]:Al((e,t)=>{let{payload:r}=t;Object.assign(e,r)}),["".concat(jo)]:Al((e,t)=>{let{payload:r}=t;e.isHost=r}),["".concat(Ho)]:Al((e,t)=>{let{payload:r}=t;e.isCoHost=r}),["".concat(xo)]:Al((e,t)=>{let{payload:r}=t;e.isOnHold=r}),["".concat(Fo)]:Al((e,t)=>{let{payload:r}=t;e.isMeetingReset=r}),["".concat(Bo)]:Al((e,t)=>{let{payload:r}=t;e.audioVideoBeforeOnHold=r}),["".concat(Go)]:Al((e,t)=>{let{payload:r}=t;e.currentUserAudioBeforeReset=r}),["".concat(Wo)]:Al((e,t)=>{let{payload:r}=t;e.isCurrentUserMutedBeforeReset=r}),["".concat(Ko)]:Al((e,t)=>{let{payload:r}=t;e.meetingStatus=r}),["".concat(qo)]:Al((e,t)=>{let{payload:r}=t;e.region=r.region,e.network=r.network}),["".concat(zo)]:Al((e,t)=>{let{payload:r}=t;e.isCurrentUserStartVideoBeforeReset=r}),["".concat(Jo)]:Al((e,t)=>{let{payload:r}=t;e.joinMeetingTimeStamp=r}),["".concat(Yo)]:Al((e,t)=>{let{payload:r}=t;e.enableAudioQos=r.audioQos,e.enableVideoQos=r.videoQos}),["".concat(Zo)]:Al((e,t)=>{let{payload:r}=t;e.activeAppInfo=r}),["".concat(Qo)]:Al((e,t)=>{let{payload:r}=t;e.idleStartTime=r}),["".concat(Xo)]:Al((e,t)=>{let{payload:r}=t;e.sessionIdleTimeoutMins=r}),["".concat($o)]:Al((e,t)=>{let{payload:r}=t;e.isAudioBridgeEnabled=r}),["".concat(Vo)]:Al((e,t)=>{let{payload:r}=t;Object.assign(e,c(c({},pp),{},{isMeetingReset:!0,currentUserAudioBeforeReset:e.audioVideoBeforeOnHold?e.audioVideoBeforeOnHold.audio:r.audio,isCurrentUserMutedBeforeReset:e.audioVideoBeforeOnHold?e.audioVideoBeforeOnHold.muted:r.muted,isCurrentUserStartVideoBeforeReset:e.audioVideoBeforeOnHold?e.audioVideoBeforeOnHold.video:r.video,apiKey:e.apiKey,signatureType:e.signatureType,signature:e.signature,meetingNumber:e.meetingNumber,userName:e.userName,lang:e.lang,passWord:e.passWord,userEmail:e.userEmail,sdkUrl:e.sdkUrl,sdkOrigin:e.sdkOrigin,proxy:1,cv:e.cv,zsk:e.zsk,ztk:e.ztk,idleStartTime:e.idleStartTime,sessionIdleTimeoutMins:e.sessionIdleTimeoutMins,customerKey:e.customerKey}))})},pp),fp=In(Rl,xl,{meetingInfoEpic:(e,t)=>e.pipe(Kt("".concat(bo)),Nt(e=>{const r=Object.assign({},e.payload,{password:ho(e.payload.password),topic:ho(e.payload.topic)}),{videoSDKUrl:n}={meetingSDKUrl:"https://".concat(Dl,"/api/v1/wc/info"),videoSDKUrl:"https://".concat(Dl,"/wc/lsdk")};return function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"zoomsdkjsonpcallback";return new F(n=>{Fl++;const o="".concat(r).concat(Fl),i=document.createElement("script");Object.keys(t).forEach(e=>(void 0===t[e]||null===t[e])&&delete t[e]),i.src="".concat(e,"?").concat(new URLSearchParams(Object.assign(t,{callback:o})).toString()),i.async=!0,i.onerror=e=>n.error(e),document.getElementsByTagName("head")[0].appendChild(i),window[o]=e=>{i.parentNode&&i.parentNode.removeChild(i),delete window[o],n.next(e),n.complete()}})}(n,r).pipe(dt(e=>ae({status:!1,result:e.toString(),errorCode:-3e3})),Fe(r=>{const[n,o]=ot(ae(r),e=>!0===e.status&&void 0!==e.result);return o.subscribe(e=>{e.state||(3e3===e.errorCode&&"Meeting password is incorrect"===e.errorMessage?ra("JOIN_MEETING_FAILED",so(3004)):-3e3===e.errorCode?ra("JOIN_MEETING_FAILED",{reason:"connection error"}):3e3===e.errorCode?ra("JOIN_MEETING_FAILED",{reason:e.errorMessage,errorCode:200}):300===e.errorCode?ra("JOIN_MEETING_FAILED",{reason:"This account does not exist or does not belong to you",errorCode:200}):124===e.errorCode&&"Parse lite sdk topic and pwd fail"===e.errorMessage?ra("JOIN_MEETING_FAILED",{reason:"Parse topic and pwd fail",errorCode:200}):124===e.errorCode&&"The java web token is expired or more than 2 days or ineffective."===e.errorMessage?ra("JOIN_MEETING_FAILED",{reason:"The token is expired or more than 2 days or ineffective.",errorCode:200}):124===e.errorCode&&ra("JOIN_MEETING_FAILED",{reason:"Verify JWT failed",errorCode:200}))}),n.pipe(ld(r=>{if(!0===r.status){const{result:{mid:n,websdkClientFeatureOptions:o}}=r;di.init(n);const i=((e,t)=>{if(e.result){const{result:{mn:r,ts:n,auth:o,track_auth:i,mid:s,tid:a,encryptedRWC:c,user_identity:u,meetingOptions:d,can_recording:l,wcXMPPConfig:p,call_out_country_json:h,isOriginalHost:f,support_call_out:v}}=e,{lang:_,password:m,topic:y,zlk:g,cv:E,userName:S}=t;return{meetingNumber:r,meetingId:s,tid:a,ts:n,auth:o,passWord:m,trackAuth:i,customerKey:u,encryptedRWC:JSON.parse(c||"{}"),meetingOptions:JSON.parse(d||"{}"),recordingEnable:"1"===l,topic:y,userName:di.get(Ri.WebclientUserName)||S,cv:E,zlkJwtToken:g,xmppConfig:JSON.parse(p||"{}"),callOutCountry:JSON.parse(h||"{}"),lang:_,isOriginHost:f,isSupportCallOut:"1"===v}}return e})(r,e.payload),s=[ae(wo(i)),ae(up(null==i?void 0:i.recordingEnable)),bn(wl,t,Ao())],a=(e=>{const t={["".concat(ai.AudioBridgeEnable)]:$o},r=[];if(e){const n=e.length;Object.keys(ai).filter(e=>!Number.isNaN(Number(ai[e]))).forEach(o=>{const i=ai[o],s="1"===e.charAt(n-i);r.push(ae(t["".concat(i)](s)))})}return r})(o);return a.length>0&&s.unshift(...a),qe(...s)}}))}))}))}),vp=qi.createAgent();let _p;var mp=Object.freeze({__proto__:null,connectZoomSocketEpic:(e,t)=>e.pipe(Kt("".concat(Br)),Ht(t),tt(e=>{let[,t]=e;return t.socket.zoomSocketStatus===Fa.Closed}),pd(e=>{let[,t]=e;const{socket:{retryCount:r,rwgServerList:n},meeting:o,breakoutRoom:i}=t;let s;if(o.zlkJwtToken)s=function(e){let{passWord:t,meetingNumber:r,userName:n,topic:o,trackAuth:i,tid:s,meetingId:a,ts:c,auth:u,lang:d,retryCount:l,rwgServerList:p,cv:h,customerKey:f,zlkJwtToken:v,isAudioBridgeEnabled:_}=e;const m=Gl.get("_zm_mtk_guid");let y=di.get(op);if(y||(y=Zl(),di.set(op,y,ci.LocalStorage)),p.length>l){const e=li(),g=p[l];let E={dn2:ho(n),topic:ho(o),auth:u,browser:e,trackAuth:i,mid:a,tid:s,lang:d,ts:c,"ZM-CID":y,_ZM_MTG_TRACK_ID:m||"",iccv:h,customer_key:ho(f),cfs:0,zlkJwtToken:v};""!==t&&(E=Object.assign(E,{mpwd:ho(t)})),g.rwcAuth?E=Object.assign(E,{rwcAuth:g.rwcAuth}):g.rwcToken&&(E=Object.assign(E,{rwcToken:g.rwcToken}));let S=2;return vi()?S=1:_i()&&(S=0),E=Object.assign(E,{as_type:S}),[{key:$l,queryKey:"opt"},{key:ep,queryKey:"participantID"},{key:tp,queryKey:"zoomid"}].forEach(e=>{const t=di.get(e.key);void 0!==t&&(E[e.queryKey]=t)}),di.get(np)&&Object.assign(E,{isdj:1}),null!=e&&e.startsWith("ios-safari")&&_&&Object.assign(E,{useABAudio:1}),"wss://".concat(g.rwg,"/instantsdk/").concat(r,"?").concat(new URLSearchParams(E).toString())}return null}(c(c({},o),{},{retryCount:r,rwgServerList:n}));else{let e=c(c({},o),{},{retryCount:r,rwgServerList:n});if(i&&i.currentRoom.status===Ra.Joining){const{currentRoom:{boId:t,boConfId:r,boToken:n}}=i;e=c(c({},e),{},{bid:t,botk:n,confID:r})}s=function(e){let{isHost:t,isOriginHost:r,passWord:n,meetingNumber:o,userName:i,zsk:s,ztk:a,trackAuth:c,tid:u,sign:d,signatureType:l,meetingId:p,ts:h,auth:f,lang:v,tk:_,retryCount:m,rwgServerList:y,userEmail:g,cv:E,bid:S,botk:b,confID:A,customerKey:I,isAudioBridgeEnabled:C}=e;const T=Gl.get("_zm_mtk_guid");let O=di.get(op);if(O||(O=Zl(),di.set(op,O,ci.LocalStorage)),y.length>m){const e=li(),w=y[m];let R={dn2:ho(i),auth:f,signType:l,browser:e,trackAuth:c,mid:p,tid:u,email:g,lang:v,zak:a||"",tk:_||"",customer_key:ho(I),ts:h,"ZM-CID":O,_ZM_MTG_TRACK_ID:T||"",jscv:E,cfs:0};const D=sessionStorage.getItem(Ri.WebclientZsk)||s;R=D?Object.assign(R,{zak:s}):Object.assign(R,{sign:d}),t&&r||""===n||(R=Object.assign(R,{mpwd:n})),w.rwcAuth?R=Object.assign(R,{rwcAuth:w.rwcAuth}):w.rwcToken&&(R=Object.assign(R,{rwcToken:w.rwcToken}));let N=2;return vi()?N=1:_i()&&(N=0),R=Object.assign(R,{as_type:N}),[{key:Xl,queryKey:"cfs"},{key:$l,queryKey:"opt"},{key:ep,queryKey:"participantID"},{key:tp,queryKey:"zoomid"},{key:rp,queryKey:"tk"}].forEach(e=>{const t=di.get(e.key);void 0!==t&&(R[e.queryKey]=t)}),S&&b&&A&&Object.assign(R,{bid:ho(S),botk:b,confID:A}),di.get(np)&&Object.assign(R,{isdj:1}),null!=e&&e.startsWith("ios-safari")&&C&&Object.assign(R,{useABAudio:1}),"wss://".concat(w.rwg,"/wc/api/").concat(o,"?").concat(new URLSearchParams(R).toString())}return null}(e)}if(s){const e=(a=s,vp.connect(a),_p=new q,Ze(e=>vp.on(xi.Message,e),e=>vp.off(xi.Message,e),e=>e.data).subscribe(_p),_p);return $e(e.pipe(tt(e=>"string"==typeof e),Oe(e=>JSON.parse(e)),md(),dd(e=>{if(0!==e.evt||!e.body||"invalid parameters!"!==e.body.test)return zr(e);ra("JOIN_MEETING_FAILED",so(eo.INVALID_PARAMETER))}),Ot(rn(Fa.Connecting))),e.pipe(tt(e=>e instanceof ArrayBuffer),Oe(e=>Jr(e))))}var a})),connectedZoomSocketEpic:(e,t)=>e.pipe(Kt("".concat(Br)),Nt(()=>{const[e,r,n]=[xi.Open,xi.Close,xi.Error].map(e=>Ze(t=>vp.on(e,t),t=>vp.on(e,t)));return $e(e.pipe(Fe(()=>$e(ae(rn(Fa.Connected)),ct(6e4).pipe(Ht(t),tt(e=>{let[,t]=e;return"initial"===t.meeting.meetingStatus&&!t.meeting.isMeetingReset}),Oe(()=>(ra("RECONNECTING_MEETING",{reason:ni.Failover}),Io())))))),r.pipe(Ht(t),tt(e=>{let[,t]=e;return t.socket.zoomSocketStatus!==Fa.Closed&&"joined"===t.meeting.meetingStatus&&!t.meeting.isMeetingReset}),Oe(()=>(ra("RECONNECTING_MEETING",{reason:ni.Failover}),Io()))),n.pipe(Ht(t),ld(e=>{let[,t]=e;const{meeting:{meetingStatus:r,isMeetingReset:n},socket:{retryCount:o,rwgServerList:i}}=t,s=[];return"initial"===r&&null!=i&&i.length?i.length>o+1?s.push(on(o+1),Wr({retry:!0})):ra("JOIN_MEETING_FAILED",{reason:"connection error",errorCode:-3e3}):n||"joined"!==r||(ra("RECONNECTING_MEETING",{reason:ni.Failover}),s.push(Io())),Ve(s)})))})),disconnectZoomSocketEpic:e=>e.pipe(Kt("".concat(Wr)),Fe(e=>e.payload&&e.payload.retry?ae(Br()).pipe(ft(1e3),Ot(rn(Fa.Closed))):ae(rn(Fa.Closed))),ft(100),kt(()=>{var e;vp.close(),null===(e=_p)||void 0===e||e.complete()}))});const yp=zi.getInstance();let gp;var Ep=Object.freeze({__proto__:null,connectMainSessionSocketEpic:(e,t)=>e.pipe(Kt("".concat(Zr)),Ht(t),tt(e=>{let[,t]=e;return"closed"===t.socket.mainSessionSocketStatus}),Nt(e=>{let[,t]=e;const{meeting:{svcUrl:r,meetingNumber:n,conId:o}}=t;return(e=>(yp.connect(e),gp=new q,Ze(e=>yp.on(xi.Message,e),e=>yp.off(xi.Message,e)).pipe(Oe(e=>e.data)).subscribe(gp),gp))(function(e,t,r){return"wss://".concat(e,"/wc/media/").concat(t,"?type=m&cid=").concat(r,"&mode=2")}(r,n,o)).pipe(Oe(e=>JSON.parse(e)),tt(e=>0!==e.evt),md(),Oe(e=>en(e)),Ot(cn(Fa.Connecting)))})),connectedMainSessionSocketEpic:(e,t)=>e.pipe(Kt("".concat(Zr)),Nt(()=>{const[e,r,n]=[xi.Open,xi.Close,xi.Error].map(e=>Ze(t=>yp.on(e,t),t=>yp.on(e,t)));return $e(e.pipe(St(cn(Fa.Connected))),r.pipe(Ht(t),tt(e=>{let[,t]=e;return"closed"!==t.socket.zoomSocketStatus&&"joined"===t.meeting.meetingStatus}),Oe(()=>(ra("RECONNECTING_MEETING",{reason:ni.Failover}),Io()))),n.pipe(Oe(()=>(ra("RECONNECTING_MEETING",{reason:ni.Failover}),Io()))))})),disconnectMainSessionSocketEpic:e=>e.pipe(Kt("".concat(Qr)),St(cn(Fa.Closed)),kt(()=>{var e;yp.close(),null===(e=gp)||void 0===e||e.complete()}))});const Sp=$i.getInstance();let bp;var Ap=Object.freeze({__proto__:null,connectCmdChannelSocketEpic:(e,t)=>e.pipe(Kt("".concat(Xr)),Ht(t),tt(e=>{let[,t]=e;return"closed"===t.socket.cmdChannelSocketStatus}),Nt(e=>{let[,t]=e;const{meeting:{svcUrl:r,meetingNumber:n,conId:o},socket:{cmdChannelSocketStatus:i}}=t;return(e=>(Sp.connect(e),bp=new q,Ze(e=>Sp.on(xi.Message,e),e=>Sp.off(xi.Message,e)).pipe(Oe(e=>e.data)).subscribe(bp),bp))(function(e,t,r){return"wss://".concat(e,"/wc/media/").concat(t,"?type=x&cid=").concat(r)}(r,n,o)).pipe(Oe(e=>{if("string"==typeof e){const t=JSON.parse(e);return 0===(null==t?void 0:t.evt)&&i!==Fa.Connected&&$i.getInstance().connectXmpp(),t}return{}}),tt(e=>void 0!==(null==e?void 0:e.evt)),Oe(e=>tn(e)),Ot(un(Fa.Connecting)))})),connectedCmdChannelSocketEpic:(e,t)=>e.pipe(Kt("".concat(Xr)),Nt(()=>{const[e,r,n]=[xi.Open,xi.Close,xi.Error].map(e=>Ze(t=>Sp.on(e,t),t=>Sp.on(e,t)));return $e(e.pipe(St(un(Fa.Connected))),r.pipe(ft(1e3),Ht(t),tt(e=>{let[,t]=e;return"closed"!==t.socket.cmdChannelSocketStatus&&"joined"===t.meeting.meetingStatus&&!t.meeting.isMeetingReset}),Oe(()=>(ra("RECONNECTING_MEETING",{reason:ni.Failover}),Io()))),n.pipe(ft(1e3),Ht(t),tt(e=>{let[,t]=e;return"closed"!==t.socket.cmdChannelSocketStatus&&"joined"===t.meeting.meetingStatus&&!t.meeting.isMeetingReset}),Oe(()=>(ra("RECONNECTING_MEETING",{reason:ni.Failover}),Io()))))})),disconnectCmdChannelSocketEpic:e=>e.pipe(Kt("".concat($r)),St(un(Fa.Closed)),ft(100),kt(()=>{var e;Sp.close(),null===(e=bp)||void 0===e||e.complete()}))});const Ip={zoomSocketStatus:Fa.Closed,isXmppSDKLoaded:!1,xmppSocketStatus:Fa.Closed,mainSessionSocketStatus:Fa.Closed,cmdChannelSocketStatus:Fa.Closed,retryCount:0,rwgServerList:[]},Cp=Fr({["".concat(rn)]:Al((e,t)=>{let{payload:r}=t;e.zoomSocketStatus=r}),["".concat(nn)]:Al((e,t)=>{let{payload:r}=t;const{rwgServerList:n}=e;n.find(e=>e===r.rwg)||n.push(r)}),["".concat(on)]:Al((e,t)=>{let{payload:r}=t;e.retryCount=r}),["".concat(sn)]:Al((e,t)=>{let{payload:r}=t;e.xmppSocketStatus=r}),["".concat(an)]:Al((e,t)=>{let{payload:r}=t;e.isXmppSDKLoaded=r}),["".concat(cn)]:Al((e,t)=>{let{payload:r}=t;e.mainSessionSocketStatus=r}),["".concat(un)]:Al((e,t)=>{let{payload:r}=t;e.cmdChannelSocketStatus=r}),["".concat(dn)]:()=>Ip},Ip),Tp=In(mp,ap,Ep,Ap),Op={id:"userId",type:e=>Aa(e)?{userType:e,avatarBackgroundType:Math.floor(8*Math.random())+1}:{userType:e},role:e=>({userRole:e,isHost:ba(e)}),dn2:e=>({displayName:fo(e)}),bShareOn:"sharerOn",bSharePause:"sharerPause",bLocalRecordStatus:e=>({bLocalRecord:1===e}),bGuest:"isGuest",bCapsRequestLT:"isRequestLT"};var wp=Object.freeze({__proto__:null,updateAttendeesEpic:(e,t)=>Cn(e,Li).pipe(Oe(e=>(e=>{const t={};return["add","remove","update"].forEach(r=>{null!==e[r]&&void 0!==e[r]&&(t[r]=e[r].reduce((e,t)=>{const r=Object.keys(t).reduce((e,r)=>{const n=Op[r];return"function"==typeof n?Object.assign(e,n(t[r])):"string"==typeof n?e[n]=t[r]:e[r]=t[r],e},{}),n=e.find(e=>e.userId===r.userId);return void 0!==n?Object.assign(n,r):e.push(r),e},[]))}),t})(e.payload.body)),Ht(t),Fe(e=>{let[t,r]=e;const n=[aa(t)],{meeting:{userId:o,isWebinar:i},participants:{attendeesList:s,failoverAttendeesList:a,allowTalkAttendeesList:u}}=r,d=u.map(e=>e.userId);if(t.add){const e=t.add.find(e=>e.userId===o);void 0!==e&&ra("ADD_CURRENT_USER_PARTICIPANT_ATTRIBUTE",e);const r=t.add.filter(e=>e.userId!==o);if(r.length>0){const e=r.filter(e=>!Ia(e.userRole)).map(e=>{const t=a.find(t=>t.zoomID===e.zoomID);return t?c(c({},e),{},{source:t.isOnHold?"on hold":"failover"}):e}),t=e.filter(e=>!!e.source).map(e=>({zoomID:e.zoomID}));if(n.push(pa(t)),ra("ADD_USER_PARTICIPANT_ATTRIBUTE",e),i){const e=r.filter(e=>Ia(e.userRole));e.length>0&&ra("UPDATE_WEBINAR_PARTICIPANT_ATTRIBUTE",e.map(e=>({userId:e.userId,isAllowToTalk:!0})))}}}if(t.update){const e=t.update.find(e=>e.userId===o);void 0!==e&&ra("UPDATE_CURRENT_USER_PARTICIPANT_ATTRIBUTE",e);const r=t.update.filter(e=>!(e.userId===o||d.includes(e.userId)));if(r.length>0&&ra("UPDATE_USER_PARTICIPANT_ATTRIBUTE",r),i){const e=t.update.filter(e=>e.userId!==o&&d.includes(e.userId));e.length>0&&ra("UPDATE_WEBINAR_PARTICIPANT_ATTRIBUTE",e)}}if(t.remove){const e=t.remove.map(e=>{const t=s.find(t=>t.userId===e.userId);return t?2===e.action&&1===e.nUserStatus?t.bHold?(n.push(la({zoomID:t.zoomID,isOnHold:!0})),c(c({},e),{},{reason:"on hold"})):(n.push(la({zoomID:t.zoomID,isOnHold:!1})),c(c({},e),{},{reason:"failover"})):e:null}).filter(e=>!!e);if(ra("REMOVE_USER_PARTICIPANT_ATTRIBUTE",e),i){const e=t.remove.filter(e=>d.includes(e.userId));e.length>0&&ra("UPDATE_WEBINAR_PARTICIPANT_ATTRIBUTE",e.map(e=>({userId:e.userId,isAllowToTalk:!1})))}}return Ve(n)})),receiveUserListFromXMPPEpic:e=>Tn(e,"POOL").pipe(tt(e=>e.payload.data.action===kl.MemberChange),kt(e=>{ra("UPDATE_WEBINAR_PARTICIPANT_ATTRIBUTE",e.payload.data.data)}),Fe(e=>Ve([ca(e.payload.data.data)]))),handleAdmitAllSilentUsersEpic:e=>Cn(e,7951).pipe(kt(e=>{!1===e.payload.body.bStarted&&ra("ADMIT_ALL_SILENT_USERS_END",e.payload.body.bStarted)}),Oe(e=>ua(e.payload.body.bStarted))),handleKVUpdateIndicationEpic:e=>Cn(e,7946).pipe(tt(e=>{var t;return["bRaiseHand","feedback"].includes(null===(t=e.payload.body)||void 0===t?void 0:t.key)&&0===e.payload.body.value}),Oe(e=>(ra("UPDATE_USER_PARTICIPANT_ATTRIBUTE",{}),"bRaiseHand"===e.payload.body.key?ha():fa())))});const Rp={attendeesList:[],xmppAttendeeList:[],allowTalkAttendeesList:[],failoverAttendeesList:[],isAdmitAllSilentUsers:!1},Dp=Fr({["".concat(aa)]:Al((e,t)=>{let{payload:r}=t;void 0!==r.add&&r.add.length>0&&r.add.forEach(t=>{const r=e.attendeesList.find(e=>e.userId===t.userId);if(void 0!==r)Object.assign(r,t);else{const r=e.allowTalkAttendeesList.find(e=>e.userId===t.userId);void 0!==r?Object.assign(r,t):Ia(t.userRole)?e.allowTalkAttendeesList.push(t):e.attendeesList.push(t)}}),void 0!==r.update&&r.update.length>0&&r.update.forEach(t=>{const r=e.attendeesList.find(e=>e.userId===t.userId);if(void 0!==r)Object.assign(r,t);else{const r=e.allowTalkAttendeesList.find(e=>e.userId===t.userId);void 0!==r&&Object.assign(r,t)}}),void 0!==r.remove&&r.remove.length>0&&r.remove.forEach(t=>{const r=e.attendeesList.findIndex(e=>e.userId===t.userId);if(-1!==r)e.attendeesList.splice(r,1);else{const r=e.allowTalkAttendeesList.findIndex(e=>e.userId===t.userId);-1!==r&&e.allowTalkAttendeesList.splice(r,1)}})}),["".concat(ca)]:Al((e,t)=>{let{payload:r}=t;e.xmppAttendeeList=r.map(e=>c(c({},e),{},{displayName:e.name,userId:Number(e.node),userRole:Number(e.role)}))}),["".concat(ua)]:Al((e,t)=>{let{payload:r}=t;e.isAdmitAllSilentUsers=r}),["".concat(ha)]:Al(e=>{e.attendeesList.forEach(e=>{e.bRaiseHand&&(e.bRaiseHand=!1)})}),["".concat(fa)]:Al(e=>{e.attendeesList.forEach(e=>{e.feedback>0&&(e.feedback=0)})}),["".concat(la)]:Al((e,t)=>{let{payload:r}=t;e.failoverAttendeesList.push(r)}),["".concat(pa)]:Al((e,t)=>{let{payload:r}=t;r.forEach(t=>{const r=e.failoverAttendeesList.findIndex(e=>e.zoomID===t.zoomID);-1!==r&&e.failoverAttendeesList.splice(r,1)})}),["".concat(da)]:()=>Rp},Rp),Np=In(wp),Pp={audioEncodeStatus:"initial",audioDecodeStatus:"initial",videoEncodeStatus:"initial",videoDecodeStatus:"initial",sharingEncodeStatus:"initial",sharingDecodeStatus:"initial",assetsPath:"",mediaConstraints:void 0,fileWithVersion:!1,enforceMultipleVideos:!1},Mp=Fr({["".concat(fn)]:Al((e,t)=>{let{payload:r}=t;e.audioDecodeStatus=r}),["".concat(hn)]:Al((e,t)=>{let{payload:r}=t;e.audioEncodeStatus=r}),["".concat(yn)]:Al((e,t)=>{let{payload:r}=t;e.sharingDecodeStatus=r}),["".concat(mn)]:Al((e,t)=>{let{payload:r}=t;e.sharingEncodeStatus=r}),["".concat(_n)]:Al((e,t)=>{let{payload:r}=t;e.videoDecodeStatus=r}),["".concat(vn)]:Al((e,t)=>{let{payload:r}=t;e.videoEncodeStatus=r}),["".concat(gn)]:Al((e,t)=>{let{payload:r}=t;e.mediaConstraints=r.mediaConstraints,e.assetsPath=r.assetsPath,e.fileWithVersion=r.fileWithVersion,e.enforceMultipleVideos=r.enforceMultipleVideos}),["".concat(En)]:Al((e,t)=>{let{payload:r}=t;const{type:n,encrypeKey:o,additionalType:i}=r,s={encrypeKey:o,additionalType:i};"audio"===n?e.audioEncrypt=s:"video"===n?e.videoEncrypt=s:"sharing"===n&&(e.sharingEncrypt=s)}),["".concat(Sn)]:e=>c(c({},Pp),{},{mediaConstraints:e.mediaConstraints,assetsPath:e.assetsPath,fileWithVersion:e.fileWithVersion})},Pp);var kp=function(e){return e&&e.default||e}(Object.freeze({__proto__:null,default:{}})),Up=lo((function(e,t){!function(e,t){var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function n(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var o,i=function(){return(i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r90||r||(e(t+=(100-t)/50),requestAnimationFrame(n))};return n(),{finish:function(){100===t||r||(t=100,e(100))},abort:function(){100===t||r||(r=!0)},get curProgress(){return t}}}function C(){}function T(){T.init.call(this)}function O(e){return void 0===e._maxListeners?T.defaultMaxListeners:e._maxListeners}function w(e,t,r){if(t)e.call(r);else for(var n=e.length,o=L(e,n),i=0;i0&&s.length>o){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,a=c,"function"==typeof console.warn?console.warn(a):console.log(a)}}else s=i[t]=r,++e._eventsCount;return e}function k(e,t,r){var n=!1;function o(){e.removeListener(t,o),n||(n=!0,r.apply(e,arguments))}return o.listener=r,o}function U(e){var t=this._events;if(t){var r=t[e];if("function"==typeof r)return 1;if(r)return r.length}return 0}function L(e,t){for(var r=new Array(t);t--;)r[t]=e[t];return r}C.prototype=Object.create(null),T.EventEmitter=T,T.usingDomains=!1,T.prototype.domain=void 0,T.prototype._events=void 0,T.prototype._maxListeners=void 0,T.defaultMaxListeners=10,T.init=function(){this.domain=null,T.usingDomains&&(void 0).active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new C,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},T.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},T.prototype.getMaxListeners=function(){return O(this)},T.prototype.emit=function(e){var t,r,n,o,i,s,a,c="error"===e;if(s=this._events)c=c&&null==s.error;else if(!c)return!1;if(a=this.domain,c){if(t=arguments[1],!a){if(t instanceof Error)throw t;var u=new Error('Uncaught, unspecified "error" event. ('+t+")");throw u.context=t,u}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=a,t.domainThrown=!1,a.emit("error",t),!1}if(!(r=s[e]))return!1;var d="function"==typeof r;switch(n=arguments.length){case 1:w(r,d,this);break;case 2:R(r,d,this,arguments[1]);break;case 3:D(r,d,this,arguments[1],arguments[2]);break;case 4:N(r,d,this,arguments[1],arguments[2],arguments[3]);break;default:for(o=new Array(n-1),i=1;i0;)if(r[i]===t||r[i].listener&&r[i].listener===t){s=r[i].listener,o=i;break}if(o<0)return this;if(1===r.length){if(r[0]=void 0,0==--this._eventsCount)return this._events=new C,this;delete n[e]}else!function(e,t){for(var r=t,n=r+1,o=e.length;n0?Reflect.ownKeys(this._events):[]};var V,j=function(e){function t(t){var r=e.call(this)||this;return r.timeout=(null==t?void 0:t.timeout)||3e4,r}return n(t,e),t.prototype.clearTimeoutCheck=function(){this.timeoutTimer&&(clearTimeout(this.timeoutTimer),this.timeoutTimer=null)},t.prototype.startTimeoutCheck=function(){var e=this;!this.timeoutTimer&&!this.finished&&this.timeout>0&&(this.timeoutTimer=setTimeout((function(){e.finished||(e.finished=!0,e.data=null,e.emit("timeout")),e.clearTimeoutCheck()}),this.timeout))},t}(T),H=function(e){function t(t){var r=e.call(this,t)||this;return r.uuid=u(),r.domParams=t||{},r}return n(t,e),t.prototype.jsonp=function(){var e=this;if(!this.finished){var t=this.domParams,r=t.url,n=t.jsonpCallbackName,o=void 0===n?"callback":n,i=t.body,s=t.integrity;this.script=document.createElement("script"),s&&(this.script.integrity=s,this.script.crossOrigin="anonymous");var a="";i&&Object.entries(i).forEach((function(e){var t=e[0],r=e[1];a+=(a?"&":"")+t+"="+r})),a+=(a?"&":"")+o+"="+this.uuid,this.script.src=r+(r.includes("?")?"":"?")+a,this.jsonpCallback(),this.progressMonitory=I((function(t){e.finished||e.emit("progressUpdated",t)})),document.body.appendChild(this.script)}},t.prototype.clearSideEffect=function(e){if(void 0===e&&(e=!1),document.body.removeChild(this.script),e){var t=this.uuid;window[this.uuid]=function(){window[t]&&delete window[t]}}else delete window[this.uuid];this.script=null,this.uuid=null,this.finished=!0,this.data=null,this.clearTimeoutCheck()},t.prototype.jsonpCallback=function(){var e=this;this.script.onerror=function(t){var r;e.finished||(e.clearSideEffect(),null===(r=e.progressMonitory)||void 0===r||r.abort(),e.emit("error",new Error("string"==typeof t?t:"load jsonp script failed")))},window[this.uuid]=function(t){var r;if(!e.finished){var n=e.domParams,o=n.encoding,i=n.blobType,s=n.unZipOptions,a=n.beforeTransformData,c=n.afterTransformData;null===(r=e.progressMonitory)||void 0===r||r.finish(),e.clearSideEffect(),(a?a(t||""):Promise.resolve(t||"")).then((function(t){return A(t,{encoding:o,blobType:i,unZipOptions:s}).then((function(t){return(c?c(t):Promise.resolve(t)).then((function(t){return e.emit("finished",t)}))}))})).catch((function(t){return e.emit("error",t)}))}}},t.prototype.abort=function(){this.clearSideEffect(!0)},t}(j),x=function(e){function t(t){var r=e.call(this,t)||this;return r.socketParams=t||{},r}return n(t,e),t.prototype.write=function(e,t){e&&!this.finished&&(e instanceof Error?this.handleError(e):(this.data?this.appendData(e):this.data=e,this.handlePerCentUpdate(t)))},t.prototype.handlePerCentUpdate=function(e){void 0===e||this.finished||this.emit("progressUpdated",e)},t.prototype.handleError=function(e){this.data=null,this.finished=!0,this.clearTimeoutCheck(),this.emit("error",e)},t.prototype.appendData=function(e){a(e)===a(this.data)?"string"==typeof e?this.data+=e:Blob&&e instanceof Blob?this.data=new Blob([this.data,e],{type:e.type}):ArrayBuffer&&e instanceof ArrayBuffer&&(this.data=s(this.data,e)):this.handleError(new Error("every piece of the data format must be the same"))},t.prototype.end=function(e){var t=this;if(!this.finished){this.handlePerCentUpdate(100),e&&this.write(e);var r=this.socketParams,n=r.encoding,o=r.blobType,i=r.unZipOptions,s=r.beforeTransformData,a=r.afterTransformData;(s?s(this.data):Promise.resolve(this.data)).then((function(e){return A(e,{encoding:n,blobType:o,unZipOptions:i}).then((function(e){return(a?a(e):Promise.resolve(e)).then((function(e){return t.emit("finished",e)}))}))})).catch((function(e){return t.emit("error",e)})),this.data=null,this.finished=!0,this.clearTimeoutCheck()}},t.prototype.abort=function(){this.data=null,this.finished=!0,this.clearTimeoutCheck()},t}(j),F=function(t){function r(e){var r=t.call(this,e)||this;return r.xhrParams=e||{},r.xhrParams.headers=i({},r.xhrParams.headers||{}),r}return n(r,t),r.prototype.supportFetch=function(){return!!window.fetch&&window.AbortController&&window.Request},r.prototype.ajax=function(){var t=this;if(!this.finished)if(this.xhrParams.url){var r=this.xhrParams,n=r.headers,o=void 0===n?{}:n,s=r.url,a=r.body,c=void 0===a?{}:a,u=r.method,d=void 0===u?"POST":u,l=r.encoding,p=r.integrity;this.controller=this.supportFetch()?new AbortController:new XMLHttpRequest;var h=this.supportFetch()?I((function(e){t.finished||t.emit("progressUpdated",e)})):null;(this.supportFetch()?fetch(new Request(s,i({method:d,headers:o,body:"GET"===d?void 0:JSON.stringify(c),signal:this.controller.signal},p?{integrity:p,mode:"cors"}:{}))).then((function(t){return t.ok?l===e.TransformDataFormat.STRING?t.text():l===e.TransformDataFormat.ARRAY_BUFFER?t.arrayBuffer():t.blob():Promise.reject(new Error("xhr download "+s+" failed!"))})):new Promise((function(r,n){var i=new XMLHttpRequest;t.controller=i,i.open(d,s),i.responseType=l===e.TransformDataFormat.STRING?"text":l===e.TransformDataFormat.ARRAY_BUFFER?"arraybuffer":"blob",Object.entries(o).forEach((function(e){var t=e[0],r=e[1];i.setRequestHeader(t,r)})),i.onload=function(){var e=i.status,t=i.response,o=i.statusText;e>=200&&e<300||304===e?r(t):n(new Error(e+": "+o))},i.onprogress=function(e){var r=e||{},n=r.total,o=r.loaded;void 0===o||t.finished||(n?t.emit("progressUpdated",o/n*100):o&&!h&&(h=I((function(e){t.finished||t.emit("progressUpdated",e)}))))},i.onerror=function(){n(new Error("xhr download "+s+" failed!"))},i.send(JSON.stringify(c))}))).then((function(e){if(!t.finished){var r=t.xhrParams,n=r.encoding,o=r.blobType,i=r.unZipOptions,s=r.beforeTransformData,a=r.afterTransformData;null==h||h.finish(),t.finished=!0,t.clearTimeoutCheck(),(s?s(e):Promise.resolve(e)).then((function(e){return A(e,{encoding:n,blobType:o,unZipOptions:i}).then((function(e){return(a?a(e):Promise.resolve(e)).then((function(e){return t.emit("finished",e)}))}))})).catch((function(e){return t.emit("error",e)}))}})).catch((function(e){t.finished||(t.finished=!0,t.clearTimeoutCheck(),null==h||h.abort(),t.emit("error",e))}))}else this.emit("error",new Error("xhrDownloader url params invalid!"))},r.prototype.abort=function(){this.data=null,this.finished=!0,this.clearTimeoutCheck(),this.controller.abort()},r}(j),B=0,G=new T,W=function(){B-=1,G.emit("ThreadPoolReady")};(V=e.DownloaderType||(e.DownloaderType={})).XHR="xhr",V.DOM="dom",V.SOCKET="socket";var K=function(t){function r(r){var n=t.call(this)||this;return n.aborted=!1,n.downloadParmas=i({type:e.DownloaderType.XHR},r),n.id=u(),n}return n(r,t),r.prototype.start=function(){var t=this;B+=1,this.progress=0,this.emit("downloadStart"),this.onDownloadStartCallback&&this.onDownloadStartCallback();var r=this.downloadParmas,n=r.type,o=r.xhrParams,i=r.domParams,s=r.socketParams;switch(n){case e.DownloaderType.DOM:this.downloader=new H(i),this.downloader.jsonp();break;case e.DownloaderType.SOCKET:this.downloader=new x(s);break;default:this.downloader=new F(o),this.downloader.ajax()}return this.downloader.startTimeoutCheck(),this.downloader.on("error",(function(e){t.emit("error",e),t.onErrorCallback&&t.onErrorCallback(e),W()})).on("finished",(function(e){t.emit("complete",e),t.onCompleteCallback&&t.onCompleteCallback(e),W()})).on("progressUpdated",(function(e){t.progress=e,t.emit("progressUpdated",e),t.onProgressUpdatedCallback&&t.onProgressUpdatedCallback(e)})).on("timeout",(function(){t.emit("timeout"),t.onTimeoutCallback&&t.onTimeoutCallback(),W()})),this},r.prototype.abort=function(){if(this.aborted)return this;this.aborted=!0,this.downloader&&!this.downloader.finished&&this.downloader.abort();var e=new Error("file download has been aborted");return this.emit("abort",e),this.onAbortCallback&&this.onAbortCallback(e),W(),this},r.prototype.onDownloadStart=function(e){return this.onDownloadStartCallback=e,this},r.prototype.onProgressUpdated=function(e){return this.onProgressUpdatedCallback=e,this},r.prototype.onError=function(e){return this.onErrorCallback=e,this},r.prototype.onComplete=function(e){return this.onCompleteCallback=e,this},r.prototype.onAbort=function(e){return this.onAbortCallback=e,this},r.prototype.onTimeout=function(e){return this.onTimeoutCallback=e,this},r.prototype.isInProgress=function(){return void 0!==this.progress},r.prototype.isFinished=function(){return 100===this.progress},r}(T),q=function(){function e(e){this.taskList=[],this.options=e||{};var t=this.options.threadLimit;if((void 0===t?6:t)>6)throw new Error("threadLimit must be lower than 6");G.on("ThreadPoolReady",this.startNextTask.bind(this))}return e.prototype.download=function(e){var t=new K(e),r=this.removeTask.bind(this,t);return t.on("abort",r),this.taskList.push(t),this.checkTaskReady(t),t},e.prototype.startNextTask=function(){var e=this.taskList.find((function(e){return!e.isInProgress()}));e&&this.checkTaskReady(e)},e.prototype.checkTaskReady=function(e){var t=this.options.threadLimit,r=void 0===t?6:t;if(!(this.taskList.findIndex((function(e){return!e.isInProgress()}))>=r||B+1>6)){var n=this.removeTask.bind(this,e);e.on("complete",n),e.on("error",n),e.on("timeout",n),setTimeout((function(){return e.start()}),0)}},e.prototype.removeTask=function(e){var t=this;this.taskList.some((function(r,n){return r===e&&(setTimeout((function(){return e.removeAllListeners()}),0),t.taskList.splice(n,1),!0)}))},e}();e.DownloadTask=K,e.IDownloadManager=q,e.appendBuffer=s,e.arrayBufferToBlob=p,e.arrayBufferToString=h,e.blobToArrayBuffer=d,e.blobToText=l,e.genUuid=u,e.getDataFormat=a,e.getExtName=_,e.getFileName=y,e.getFullPathName=m,e.isImgFile=g,e.isJsonFile=E,e.isVersionFile=S,e.monitorProgress=I,e.sep="/",e.stringToArrayBuffer=v,e.stringToBlob=f,e.transformData=A,Object.defineProperty(e,"__esModule",{value:!0})}(t,kp)}));uo(Up);var Lp=uo(lo((function(e,t){!function(e,t){var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function n(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var o=function(){return(o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0&&c.length>o){c.warned=!0;var d=new Error("Possible EventEmitter memory leak detected. "+c.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");d.name="MaxListenersExceededWarning",d.emitter=e,d.type=t,d.count=c.length,u=d,"function"==typeof console.warn?console.warn(u):console.log(u)}}else c=s[t]=r,++e._eventsCount;return e}function f(e,t,r){var n=!1;function o(){e.removeListener(t,o),n||(n=!0,r.apply(e,arguments))}return o.listener=r,o}function v(e){var t=this._events;if(t){var r=t[e];if("function"==typeof r)return 1;if(r)return r.length}return 0}function _(e,t){for(var r=new Array(t);t--;)r[t]=e[t];return r}function m(e){var t;return null===(t=null==e?void 0:e.path)||void 0===t?void 0:t.startsWith("ZipInfo:")}function y(e){return"string"==typeof e&&e.startsWith("ZipInfo:")}function g(e,t){return(Array.isArray(e)?e:[e]).some((function(e){if("number"!=typeof e.version)throw new Error("file version must be an int number");return e.version0;)if(r[s]===t||r[s].listener&&r[s].listener===t){a=r[s].listener,o=s;break}if(o<0)return this;if(1===r.length){if(r[0]=void 0,0==--this._eventsCount)return this._events=new i,this;delete n[e]}else!function(e,t){for(var r=t,n=r+1,o=e.length;n0?Reflect.ownKeys(this._events):[]};var S,b=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(s),A=function(e){function r(t){var r=e.call(this)||this;if(r.ready=!1,r.openError=!1,r.isEnable()){var n=t||{},o=n.nameSpaceId,i=n.indexDbVersion;r.dbName=function(e){return"resource-manager"+(e?"-"+e:"")}(o);var s=indexedDB.open(r.dbName,i||1);s.addEventListener("error",(function(){r.openError=!0,r.checkReady(),r.emit("error",new Error("failed to open indexedDB"))})),s.addEventListener("success",(function(){r.db=s.result,r.checkReady()})),s.addEventListener("upgradeneeded",(function(){r.db=s.result,r.handleSuccess()})),setTimeout((function(){r.checkReady()}),5e3)}else r.checkReady();return r}return n(r,e),r.prototype.checkReady=function(){this.ready||(this.ready=!0,this.emit("ready"))},r.prototype.handleSuccess=function(){if(!this.db.objectStoreNames||0===this.db.objectStoreNames.length||!this.db.objectStoreNames.contains("resource")){var e=this.db.createObjectStore("resource",{keyPath:"path",autoIncrement:!1});e.createIndex("path","path"),e.createIndex("sourceURL","sourceURL",{unique:!1})}},r.prototype.createAction=function(e){var t=this.db.transaction(["resource"],e||"readonly");return{trans:t,store:t.objectStore("resource")}},r.prototype.handleAction=function(e,t){return new Promise((function(r,n){var o=t();e.addEventListener("complete",(function(){r(o.result)})),e.addEventListener("error",(function(){n(e.error||new Error("transaction error"))})),e.addEventListener("abort",(function(){n(e.error||new Error("transaction aborted"))}))}))},r.prototype.put=function(){for(var e=[],t=0;t=0;o--){var i=r.memoryFiles[o];("string"==typeof e&&(i.path===e||i.path.startsWith(""+e+t.sep))||e.path===i.path)&&r.memoryFiles.splice(o,1)}n(!0)}))},r.prototype.clear=function(){var e=this;return new Promise((function(t){e.memoryFiles=[],t(!0)}))},r.prototype.findFileByPath=function(e){var t=this;return new Promise((function(r){r(t.memoryFiles.filter((function(t){return t.path===e}))[0])}))},r.prototype.findFileBySourceURL=function(e){var t=this;return new Promise((function(r){r(t.memoryFiles.filter((function(t){return t.sourceURL===e})))}))},r.prototype.isDirectory=function(e){var r=this;return new Promise((function(n){y(e)?n(!1):n(r.memoryFiles.some((function(r){return r.path.startsWith(""+e+t.sep)})))}))},r.prototype.ls=function(e){var r=this;return new Promise((function(n){var o=[];r.memoryFiles.forEach((function(r){if(!m(r))if(e){if(r.path.startsWith(""+e+t.sep)){var n=r.path.split(""+e+t.sep)[1]||"";if(n.includes(t.sep)){var i=""+e+t.sep+n.split(t.sep)[0];return void(i&&!o.includes(i)&&o.push(i))}o.push(r)}}else if(r.path.includes(t.sep)){var s=r.path.split(t.sep)[0]||"";s&&!o.includes(s)&&o.push(s)}else o.push(r)})),n(o)}))},r}(b),C=function(e){function r(t){var r=e.call(this)||this;if(r.isLocalAvaliable=void 0,r.isEnable()){var n=(t||{}).nameSpaceId;r.storageName=function(e){return"resource-manager"+(e?"-"+e:"")}(n)}return r}return n(r,e),r.prototype.isEnable=function(){if(void 0!==this.isLocalAvaliable)return this.isLocalAvaliable;try{this.isLocalAvaliable=!0,localStorage.setItem("privateTest","")}catch(e){this.isLocalAvaliable=!1}return this.isLocalAvaliable},r.prototype.saveFile=function(e){var t=this;return this.isEnable()?new Promise((function(r){var n=t.getLocalFile();n.some((function(t,r){return t.path===e.path&&(n.splice(r,1,e),!0)}))||n.push(e),localStorage.setItem(t.storageName,JSON.stringify(n)),r(!0)})):Promise.resolve(!1)},r.prototype.getLocalFile=function(){var e=localStorage.getItem(this.storageName),t=[];if(e)try{t=JSON.parse(e)||"[]"}catch(e){console.log(e)}return t},r.prototype.removeFile=function(e){var r=this;return this.isEnable()?new Promise((function(n){for(var o=r.getLocalFile(),i=o.length-1;i>=0;i--){var s=o[i];("string"==typeof e&&(s.path===e||s.path.startsWith(""+e+t.sep))||e.path===s.path)&&o.splice(i,1)}localStorage.setItem(r.storageName,JSON.stringify(o)),n(!0)})):Promise.resolve(!1)},r.prototype.clear=function(){var e=this;return this.isEnable()?new Promise((function(t){localStorage.removeItem(e.storageName),t(!0)})):Promise.resolve(!1)},r.prototype.findFileByPath=function(e){var t=this;return this.isEnable()?new Promise((function(r){r(t.getLocalFile().filter((function(t){return t.path===e}))[0])})):Promise.resolve(void 0)},r.prototype.findFileBySourceURL=function(e){var t=this;return this.isEnable()?new Promise((function(r){r(t.getLocalFile().filter((function(t){return t.sourceURL===e})))})):Promise.resolve([])},r.prototype.isDirectory=function(e){var r=this;return this.isEnable()?new Promise((function(n){y(e)?n(!1):n(r.getLocalFile().some((function(r){return r.path.startsWith(""+e+t.sep)})))})):Promise.resolve(!1)},r.prototype.ls=function(e){var r=this;return this.isEnable()?new Promise((function(n){var o=[];r.getLocalFile().forEach((function(r){if(!m(r))if(e){if(r.path.startsWith(""+e+t.sep)){var n=r.path.split(""+e+t.sep)[1]||"";if(n.includes(t.sep)){var i=""+e+t.sep+n.split(t.sep)[0];return void(i&&!o.includes(i)&&o.push(i))}o.push(r)}}else if(r.path.includes(t.sep)){var s=r.path.split(t.sep)[0]||"";s&&!o.includes(s)&&o.push(s)}else o.push(r)})),n(o)})):Promise.resolve([])},r}(b);(S=e.FileStoreEnum||(e.FileStoreEnum={})).MEMORY="memoryStore",S.INDEX_DB="indexedDBStore",S.STORAGE="storageStore";var T=function(r){function i(e){var t=r.call(this)||this;return t.indexedDBStore=new A(e),t.memoryStore=new I,t.storageStore=new C(e),t}return n(i,r),i.prototype.saveFile=function(t,r,n){var i=this;void 0===r&&(r=!0);var s=(n||{}).forceSpecifyStore;return(r?this.findFileByPath(t.path,n):Promise.resolve(void 0)).then((function(r){if((null==r?void 0:r.version)&&g(t,r.version))throw new Error("there is an higher version file existed already");var n=o(o({},t),{createTime:r&&r.createTime||Date.now(),updateTime:Date.now()});return s&&i[s]&&i[s].isEnable()&&(s!==e.FileStoreEnum.STORAGE||i.isLocalStorageAvaliable(n))?i[s].saveFile(n):i[i.saveToTargetStoreRule(n)].saveFile(n)}))},i.prototype.isLocalStorageAvaliable=function(e){var r=e.data;return"string"===t.getDataFormat(r)&&r.length<=102400&&this.storageStore.isEnable()},i.prototype.saveToTargetStoreRule=function(t){return this.indexedDBStore.isEnable()?e.FileStoreEnum.INDEX_DB:this.isLocalStorageAvaliable(t)?e.FileStoreEnum.STORAGE:e.FileStoreEnum.MEMORY},i.prototype.removeFile=function(e,t){var r=(t||{}).forceSpecifyStore;return r&&this[r]?this[r].removeFile(e):Promise.all([this.indexedDBStore.removeFile(e),this.storageStore.removeFile(e),this.memoryStore.removeFile(e)]).then((function(){return!0}))},i.prototype.clear=function(e){var t=(e||{}).forceSpecifyStore;return t&&this[t]?this[t].clear():Promise.all([this.indexedDBStore.clear(),this.storageStore.clear(),this.memoryStore.clear()]).then((function(){return!0}))},i.prototype.findFileByPath=function(e,t){var r=this,n=(t||{}).forceSpecifyStore;return n&&this[n]?this[n].findFileByPath(e):E(this.searchInTargetStoreRule(),(function(t,n){return t?Promise.resolve(t):r[n].findFileByPath(e)}))},i.prototype.findFileBySourceURL=function(e,t){var r=this,n=(t||{}).forceSpecifyStore;return n&&this[n]?this[n].findFileBySourceURL(e):E(this.searchInTargetStoreRule(),(function(t,n){return r[n].findFileBySourceURL(e).then((function(e){return t?t.filter((function(t){return!e.some((function(e){return e.path===t.path}))})).concat(e||[]):e||[]}))}))},i.prototype.searchInTargetStoreRule=function(){return[e.FileStoreEnum.INDEX_DB,e.FileStoreEnum.STORAGE,e.FileStoreEnum.MEMORY]},i.prototype.isDirectory=function(e){var t=this;return e?E(this.searchInTargetStoreRule(),(function(r,n){return r?Promise.resolve(!0):t[n].isDirectory(e)})):Promise.resolve(!0)},i.prototype.ls=function(e){var t=this;return this.isDirectory(e).then((function(r){if(!r)throw new Error("path: "+e+" is an invalid directory path");return E(t.searchInTargetStoreRule(),(function(r,n){return t[n].ls(e).then((function(e){return r?(e||[]).concat(r.filter((function(t){return!e.some((function(e){return"string"==typeof t?e===t:"string"!=typeof e&&e.path===t.path}))}))):e}))}))}))},i}(s),O=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(s),w=function(e){function r(r){var n=e.call(this)||this,o=r||{},i=o.storeOptions,s=o.downloadManagerOptions;return n.downloadManager=new t.IDownloadManager(s),n.store=new T(i),n.store.indexedDBStore.on("ready",(function(){return n.emit("ready")})),n}return n(r,e),r.prototype.getFile=function(e,t,r){var n=this,o=new O,i=Promise.resolve(void 0),s=t||{},a=s.downloadOptions,c=s.forceDownload,u=s.saveRootPath;c?i=Promise.resolve(void 0):"string"==typeof e?i=this.store.findFileByPath(e,r):(null==e?void 0:e.sourceURL)?i=this.store.findFileBySourceURL(e.sourceURL):a&&(a.domParams||a.socketParams||a.xhrParams)&&(i=this.store.findFileBySourceURL(this.genSourceURL(a)));var d=null,l=new Promise((function(e){d=e}));return o.getDownloadTask=function(){return l},i=i.then((function(e){if(e&&(!Array.isArray(e)||e.length)){var t=e;if(Array.isArray(t)){var n=t.find((function(e){return m(e)}));if(!n)return;t=t.filter((function(e){return!m(e)}));var i=n.data;if("string"!=typeof i)return;if(!JSON.parse(i||"[]").every((function(e){return t.some((function(t){return t.path===e}))})))return}if(!(null==r?void 0:r.targetVersion)||!g(t,r.targetVersion))return o.emit("checkExpire",!1),t;o.emit("checkExpire",!0)}})).then((function(t){if(!t&&a){var i=n.downloadManager.download(a);return d(i),new Promise((function(t,s){i.on("complete",(function(i){setTimeout((function(){var s=Array.isArray(i)?i.map((function(e){var t=e.data,o=e.path,i=e.extName;return{path:n.genFilePath(u,o),sourceURL:n.genSourceURL(a),data:t,fileFormat:i||n.getFileFormat(a),version:(null==r?void 0:r.targetVersion)||1}})):{path:n.genFilePath(u,void 0),sourceURL:n.genSourceURL(a),data:i,fileFormat:n.getFileFormat(a),version:(null==r?void 0:r.targetVersion)||1};if(Array.isArray(s)&&"string"==typeof e&&e){var c=s.find((function(t){return t.path===e}));t(c||s)}else t(s);o.emit("beforeSet",s),n.beforeWrite(s,r).then((function(){o.emit("afterSet")})).catch((function(e){return o.emit("afterSet",e)}))}),0)})),i.on("abort",s),i.on("error",s),i.on("timeout",(function(){return s(new Error("download timeout"))}))}))}return d(void 0),t})).catch((function(e){return d(void 0),Promise.reject(e)})),o.getResult=function(){return i},o},r.prototype.genSourceURL=function(e){var r=e.domParams,n=e.type,o=e.xhrParams;if(n===t.DownloaderType.SOCKET)return null;var i=(n===t.DownloaderType.DOM?r:o)||{},s=i.url,a=void 0===s?"":s,c=i.body;return c&&Object.keys(c).length?a+(a.includes("?")?"&":"?")+"downloadBodyParams="+JSON.stringify(c):a},r.prototype.updateFile=function(e,t){return this.saveStore(e,!0,t)},r.prototype.beforeWrite=function(e,t){var r,n,o=this;return Array.isArray(e)?Promise.all(e.concat((r=e,n=r[0].sourceURL||"",{path:"ZipInfo:"+n,sourceURL:n,data:JSON.stringify(r.map((function(e){return e.path})))})).map((function(e){return o.saveStore(e,!1,t)}))).then((function(e){return e.filter((function(e){return!m(e)}))})):this.saveStore(e,!0,t)},r.prototype.getFileFormat=function(e){var r=e||{},n=r.xhrParams,o=r.domParams,i=r.socketParams,s=r.type;return s===t.DownloaderType.DOM&&(null==o?void 0:o.fileFormat)?o.fileFormat:s===t.DownloaderType.SOCKET&&(null==i?void 0:i.fileFormat)?i.fileFormat:(null==n?void 0:n.fileFormat)?n.fileFormat:"unknow"},r.prototype.genFilePath=function(e,r){return r?""+(e||"")+(e?t.sep:"")+r:e||""},r.prototype.saveStore=function(e,t,r){return void 0===t&&(t=!0),this.store.saveFile(e,t,r).then((function(t){if(t)return e;throw new Error("fail to save file in local store")}))},r.prototype.remove=function(e,t){return this.store.removeFile(e,t)},r.prototype.clear=function(e){return this.store.clear(e)},r.prototype.list=function(e){return this.store.ls(e)},r.prototype.updateVersion=function(e,t){var r=this;return this.store.findFileByPath(e).then((function(n){if(n)return r.saveStore(o(o({},n),{version:t})).then((function(){}));throw new Error("the target path: "+e+" isn't existed")}))},r.prototype.updateSourceURL=function(e,t){var r=this;return this.store.findFileByPath(e).then((function(n){if(n)return r.saveStore(o(o({},n),{sourceURL:t})).then((function(){}));throw new Error("the target path: "+e+" isn't existed")}))},r}(s);e.IResourceManager=w,Object.defineProperty(e,"__esModule",{value:!0})}(t,Up)})));function Vp(e,t,r,n){const{meeting:{userId:o},audio:{localShareAudioUserMutedList:i}}=n;return i.filter(e=>e.userId!==t).forEach(t=>{e.setSharingAudioVolume(t.userId,!0)}),e.setSharingAudioVolume(t,r),t===o?fc(r):lc({userId:t,muted:r})}function jp(e,t,r){const{audio:{audioSsrc:n,activeMicrophone:o,activeSpeaker:i,isAllowToTalk:s,isSpeakerOnly:a},meeting:{svcUrl:c,conId:u,reportDomain:d,isAudioBridgeEnabled:l}}=t,p=Pa(t),h=a||Ca(p.userRole)&&!s,f=null!=r?r:!h;return Id()&&!l&&console.warn("Cannot start audio due to the service is not ready."),e.joinComputerAudio(n,o,i,f,Id()?{rwgHost:c,cid:u,nginxHost:d}:void 0)}async function Hp(e,t,r){const n=[],{audio:{isJoinComputerAudioBeforeSharingAudio:o,mutedBeforeSharingAudio:i}}=r,s=Pa(r);return!0===o&&(await jp(e,r),n.push(pc(void 0)),!1===i&&(n.push(Ja(!0)),t.mute(s.userId,!1)),n.push(uc(void 0))),n}async function xp(e,t,r){const{audio:{isSharingAudio:n},meeting:{userId:o}}=r,i=[];if(i.push(Vp(e,o,!0,r)),n){await e.leaveSharingAudio(!1),i.push(vc(!1));const n=await Hp(e,t,r);i.push(...n),setTimeout(()=>{ra("SHARE_AUDIO_STATE_CHANGE",{state:"off"})},0)}return i.push(hc(!1)),i}async function Fp(e,t,r){const{audio:{audioSsrc:n,activeMicrophone:o,activeSpeaker:i}}=r,s=Pa(r),a=await async function(e,t){const r=[],n=Pa(t),{audio:{isMicrophoneForbidden:o}}=t;return"computer"===(null==n?void 0:n.audio)&&(r.push(pc(!0)),r.push(uc(n.muted)),await e.leaveComputerAudio(),r.push($a(0)),o&&r.push(Xa(!1))),r}(e,r);return await e.leaveSharingAudio(!0),await e.joinSharingAudio({ssrc:n,microphoneDeviceId:o,speakerDeviceId:i,isCaptureAudio:Ca(s.userRole)}),a.push(hc(!0)),a.push(vc(!0)),a.push(Vp(e,s.userId,!1,r)),a.findIndex(e=>e.type==="".concat(pc)&&!0===e.payload)>-1&&(a.push(Ja(!0)),t.mute(r.meeting.userId,!0),ra("AUDIO_CURRENT_USER_MUTED",{source:_s.SharingAudio})),setTimeout(()=>{ra("SHARE_AUDIO_STATE_CHANGE",{state:"on"})},0),a}const Bp=()=>{var e;const t=null===(e=li())||void 0===e?void 0:e.toLocaleLowerCase();if(t.indexOf("safari")>-1&&-1===t.indexOf("ios-safari")){var r;const e=null===(r=navigator.userAgent.match(/version\/(\d+\.?\d+)/i))||void 0===r?void 0:r[1];return yo(e||"","15.2")>=0}return!1},Gp=qi.createAgent(),Wp=Td(ts.getInstance()),Kp=e=>e.audioConnectionStatus===ks.ConnectSuccess&&!e.muted;var qp=Object.freeze({__proto__:null,audioAsnsEpic:(e,t)=>Cn(e,12033).pipe(Ht(t),Oe(e=>{let[t,r]=e;const{participants:{attendeesList:n,allowTalkAttendeesList:o}}=r,i=t.payload.body,s={};return i&&([...n,...o].forEach(e=>{for(let t=1;t<=3;t++){const r="asn".concat(t),{userId:n,displayName:o}=e;if(void 0!==i[r]&&n===i[r]){s[r]={userId:n,displayName:o};break}}}),ra("AUDIO_ACTIVE_SPEAKER",Object.values(s))),Ba(s)})),unmuteConsentAfterSpotlighted:(e,t)=>Cn(e,16135).pipe(Ht(t),kt(e=>{let[t,r]=e;const{payload:{body:{id:n,bLeadershipOn:o}}}=t,{audio:{bCanUnmute:i}}=r,s=Pa(r);if(s){const{isHost:e,bCoHost:t,userId:r,audio:a,muted:c}=s,u=e||t;o&&r>>10==n>>10&&(null!==a&&""!==a&&!0!==c||!u&&!i||ra("AUDIO_UNMUTE_CONSENT",vs.Spotlight))}}),It(ee)),unmuteConsentEpic:(e,t)=>Cn(e,12037).pipe(Ht(t),kt(e=>{let[,t]=e;const r=Pa(t);null!==(null==r?void 0:r.audio)&&""!==(null==r?void 0:r.audio)&&1==(null==r?void 0:r.muted)&&ra("AUDIO_UNMUTE_CONSENT",vs.Unmute)}),It(ee)),setAudioAttributeEpic:(e,t)=>Cn(e,Vi).pipe(tt(e=>e.payload.body&&["bCanUnmute","bMutedAll","bMutedUponEntry"].some(t=>void 0!==e.payload.body[t])),dd(e=>{if(void 0!==e.payload.body.bCanUnmute)return Ga(e.payload.body.bCanUnmute);if(void 0!==e.payload.body.bMutedAll){const r=Pa(t.value);if(("computer"===(null==r?void 0:r.audio)||"phone"===(null==r?void 0:r.audio))&&0==r.muted)return za(e.payload.body.bMutedAll)}return void 0!==e.payload.body.bMutedUponEntry?Za(e.payload.body.bMutedUponEntry):void 0})),currentUserAudioChangeEpic:(e,t)=>Cn(e,Li).pipe(Ht(t),tt(e=>{let[,t]=e;return t.socket.zoomSocketStatus===Fa.Connected}),Fe(e=>{let[t,r]=e;if(t.payload.body.update&&t.payload.body.update.some(e=>void 0!==e.audio||void 0!==e.muted)){const e=r.meeting.userId,n=t.payload.body.update,[o,i]=ot(Ve(n),t=>t.id===e);i.subscribe(e=>{ra("AUDIO_PARTICIPANT_AUDIO_UPDATE",e)});const{audio:{isActiveOperation:s,isMutedAll:a,isSpeakerOnly:c,isAllowToTalk:u,isShareAudioEnabled:d,isSharingAudio:l}}=r;let p=Pa(r);!p&&t.payload.body.add&&t.payload.body.add.length>0&&(p=t.payload.body.add.find(t=>t.id===e),p&&(p.userRole=p.role));const h=Ca(p.userRole);return o.pipe(kt(async e=>{var t,r,n,o;if(e.audio!==(null===(t=p)||void 0===t?void 0:t.audio))if(""===e.audio)ra("AUDIO_CURRENT_USER_LEAVE_AUDIO");else if("computer"===e.audio){const e=h&&!u||c;l&&ra("AUDIO_CURRENT_USER_JOIN_BY_VOIP"),e&&ra("AUDIO_CURRENT_USER_JOIN_BY_VOIP")}else if("phone"===e.audio){var i;"computer"===(null===(i=p)||void 0===i?void 0:i.audio)&&(await Wp.leaveComputerAudio(),Gp.joinOrLeaveVoip(!1)),ra("AUDIO_CURRENT_USER_JOIN_BY_PHONE")}if(null!==(r=p)&&void 0!==r&&r.audio&&""!==(null===(n=p)||void 0===n?void 0:n.audio)&&e.muted!==(null===(o=p)||void 0===o?void 0:o.muted))if(!0===e.muted){const e=s?_s.Active:a?_s.PassiveByMuteAll:_s.PassiveByMuteOne;ra("AUDIO_CURRENT_USER_MUTED",{source:e}),d||Wp.muteAudio()}else!1===e.muted&&(ra("AUDIO_CURRENT_USER_UNMUTED",{source:s?"active":"passive"}),Wp.unmuteAudio())}),tt(e=>{var t,r;return""!==(null===(t=p)||void 0===t?void 0:t.audio)&&e.muted!==(null===(r=p)||void 0===r?void 0:r.muted)}),It(ae(Ja(!1),za(!1))))}return ee})),handleDialOutEpic:(e,t)=>Cn(e,8198).pipe(Ht(t),tt(e=>{let[t,r]=e;return t.payload.seq==r.audio.dialout.sequence}),kt(e=>{let[t]=e;const r=t.payload.body.result;ra("AUDIO_DIALOUT_RESULT_CODE",{code:r}),r===ys.Success?ra("AUDIO_DIALOUT_RESULT_SUCCESS"):-1===[ys.Calling,ys.Ringing,ys.Accepted,ys.Success].indexOf(r)&&ra("DIALOUT_FAIL")}),Oe(e=>{let[t]=e;return Ka(t.payload.body.result)})),handleDialouCancelEpic:e=>Cn(e,8198).pipe(tt(e=>{var t;return[ys.Canceling,ys.Canceled,ys.CancelFailed].includes(null===(t=e.payload.body)||void 0===t?void 0:t.result)}),kt(e=>{var t;const r=null===(t=e.payload.body)||void 0===t?void 0:t.result;ra("AUDIO_DIALOUT_RESULT_CODE",{code:r}),r===ys.Canceled?ra("AUDIO_DIALOUT_CANCEL_SUCCESS"):r===ys.CancelFailed&&ra("DIALOUT_CANCEL_FAIL")}),Oe(e=>Ka(e.payload.body.result))),handleAllowToTalkEpic:(e,t)=>Cn(e,12036).pipe(Ht(t),Fe(e=>{let[t,r]=e;const n=Pa(r),{media:{audioEncodeStatus:o}}=r,{promoterID:i,bAllowTalk:s}=t.payload.body;if((null==n?void 0:n.userId)===i){if(ra("AUDIO_ALLOW_TALK_CHANGE",s),s){let e=ae(!0);return"success"!==o&&(Wp.enableAudioEncode(),e=it(ia("AUDIO_ENCODE_SUCCESS",1).pipe(St(!0)),ia("AUDIO_ENCODE_FAIL",1).pipe(St(!1)))),e.pipe(Fe(e=>(e&&ra("AUDIO_UNMUTE_CONSENT",vs.AllowToTalk),ee)),Ot(qa(!0)))}if(Gp.mute(i,!0),"computer"===(null==n?void 0:n.audio))return Wp.leaveComputerAudio(),ct(300).pipe(kt(async()=>{(Bp()?it(Ye(document,"click").pipe(yt(1)),Ye(document,"touchend").pipe(yt(1))).toPromise():Promise.resolve(!0)).then(()=>{jp(Wp,r,!1)})}),It(ee),Ot(qa(!1)))}return ee})),handleAllowToTalkResponseEpic:e=>Cn(e,8205).pipe(kt(e=>{ra("AUDIO_ALLOW_TO_TALK_RESPONSE",e.payload.body)}),It(ee)),handleAttendeePromoteDepromote:(e,t)=>Tn(e,"POOL").pipe(tt(e=>e.payload.data.action===kl.Depromote||e.payload.data.action===kl.Promote),Ht(t),kt(e=>{let[t,r]=e;const n=Pa(r);"phone"===(null==n?void 0:n.audio)?Gp.audioDrop(n.userId):"computer"===(null==n?void 0:n.audio)&&(t.payload.data.action,kl.Promote)}),It(ee)),setAudioSSRCEpic:(e,t)=>Cn(e,12035).pipe(Ht(t),Fe(e=>{let[r,n]=e;const{meeting:{currentUserAudioBeforeReset:o},media:{audioDecodeStatus:i,audioEncodeStatus:s}}=n,{payload:{body:{ssrc:a}}}=r,c=Sd(t).pipe(Fe(e=>{if("computer"===o&&(null==e||!e.audio)){const r=Ca(e.userRole);return Ed("audio",r?"success":s,i).pipe(tt(e=>{let[t,r]=e;return t&&r}),kt(()=>{(Bp()?it(Ye(document,"click").pipe(yt(1)),Ye(document,"touchend").pipe(yt(1))).toPromise():Promise.resolve(!0)).then(()=>{Gp.joinOrLeaveVoip(!0),jp(Wp,t.value)})}),St(Go(void 0)))}return ee}));return $e(ae(Ya(a)),c)})),handleMergeAudioEpic:(e,t)=>Cn(e,7952).pipe(Nt(e=>ia("AUDIO_CURRENT_USER_JOIN_BY_PHONE",1).pipe(Ht(t),kt(t=>{let[,r]=t;const{BindStatus:n,nOperatorUserId:o}=e.payload.body,i=r.participants.attendeesList.find(e=>e.userId===o);!0===n&&ra("AUDIO_MERGE_AUDIO_INDICATION",{operatorName:null==i?void 0:i.displayName,operatorUserId:o,operatorRole:null==i?void 0:i.userRole})})))),handleUserGrantAudioCaptureEpic:(e,t)=>Rn(e,hs.UserGrantCaptureAudio).pipe(Ht(t),Fe(e=>{let[,t]=e;ra("AUDIO_CURRENT_USER_JOIN_BY_VOIP");const r=Pa(t),{meeting:{isCurrentUserMutedBeforeReset:n},audio:{bMutedUponEntry:o,isUserGrantCaptureAudio:i,isAllowToTalk:s}}=t,a=[Qa(!0)];if(r){!0===r.muted&&!1===s&&Gp.mute(r.userId,!0);const e=i||r.isHost||s;(!0===n||!e&&o)&&(Gp.mute(r.userId,!0),n&&a.push(Wo(void 0)))}return Ve(a)})),handleUserForbiddenMicrophoneEpic:e=>Rn(e,hs.UserForbiddedCaptureAudio).pipe(kt(()=>{ra("USER_FORBIDDEN_MICROPHONE")}),St(Xa(!0))),handleAudioSocketErrorEpic:e=>Rn(e,hs.AudioWebsocketBroken).pipe(kt(()=>{ra("ESTABLISH_AUDIO_STREAM_ERROR")}),It(ee)),handleAudioZeroDataEpic:(e,t)=>Rn(e,hs.AudioZeroData).pipe(Ht(t),dd(e=>{let[,t]=e;const{audio:{webrtcRestartCount:r,activeMicrophone:n}}=t;if(r<3)return Wp.restoreWebRTC(n),$a(r+1)})),handleAutoPlayEpic:(e,t)=>e.pipe(Kt("".concat(oc)),tt(e=>!1===e.payload),Fe(()=>(ra("AUDIO_AUTO_PLAY_FAILED"),it(Ye(document,"click").pipe(yt(1)),Ye(document,"touchend").pipe(yt(1))).pipe(kt(()=>{Gp.joinOrLeaveVoip(!0),jp(Wp,t.value)}),St(oc(!0)))))),handleAudioActionCompleteEpic:e=>Rn(e,[hs.JoinComputerAudioComplete,hs.JoinSharingAudioComplete,hs.LeaveComputerAudioComplete,hs.LeaveSharingAudioComplete]).pipe(kt(()=>{Cd.completeAudioAction()}),It(ee)),handleAudioQosDataEpic:(e,t)=>Rn(e,hs.audioQosData).pipe(Ht(t),Oe(e=>{let[t,r]=e;const{meeting:{isWebinar:n},media:{audioEncodeStatus:o,audioDecodeStatus:i},participants:{xmppAttendeeList:s,allowTalkAttendeesList:a}}=r,c=Pa(r),u=xa(r);let d=u.length>0,l=u.some(Kp);n&&(d=d||Boolean(s.length),l=l||a.some(Kp));const p=("computer"===(null==c?void 0:c.audio)||"phone"===(null==c?void 0:c.audio))&&o&&!(null!=c&&c.muted)&&d,h=("computer"===(null==c?void 0:c.audio)||"phone"===(null==c?void 0:c.audio))&&i&&d&&l;return t.payload.data.encoding?p?(ra("AUDIO_STATISTIC_DATA",t.payload),_c(t.payload)):_c(Us):h?(ra("AUDIO_STATISTIC_DATA",t.payload),mc(t.payload)):mc(Us)}))});const zp=qi.createAgent(),Jp=Td(ts.getInstance());var Yp=Object.freeze({__proto__:null,handleAddLocalShareAudioUserEpic:(e,t)=>Cn(e,Li).pipe(tt(e=>{const t=e.payload.body.update;return t&&t.length>0&&t.findIndex(e=>void 0!==e.bShareOn)>-1}),Ht(t),Fe(e=>{let[t,r]=e;const{payload:{body:{update:n}}}=t,{audio:{localShareAudioUserMutedList:o}}=r,i=n.filter(e=>!0===e.bShareOn&&!0===e.bShareAudioOn),s=[];return i.length>0&&i.forEach(e=>{-1===o.findIndex(t=>t.userId===e.id)&&s.push(dc(e.id))}),Ve(s)})),handleShareWithAudioEpic:(e,t)=>Rn(e,hs.SharingDesktopStreamHaveAudio).pipe(Nt(()=>Cn(e,Li).pipe(tt(e=>{var r;const{payload:{body:n}}=e,{meeting:{userId:o}}=t.value;return(null==n||null===(r=n.update)||void 0===r?void 0:r.findIndex(e=>e.id===o&&!0===e.bShareOn))>-1}),yt(1),hd(async()=>{const e=t.value;return await Fp(Jp,zp,e)}),Ot(hc(!0))))),handleMediaSDKLeaveShareAudioEpic:(e,t)=>Rn(e,hs.SharingDesktopStreamHaveNoAudio).pipe(Ht(t),tt(e=>{var t;let[,r]=e;return!0===(null===(t=r.audio)||void 0===t?void 0:t.isShareAudioEnabled)}),hd(async e=>{let[,t]=e;return await xp(Jp,zp,t)})),handleJoinComputerAudioAfterShareAudioEpic:(e,t)=>Cn(e,Li).pipe(Ht(t),tt(e=>{let[,t]=e;return t.socket.zoomSocketStatus===Fa.Connected&&!0===t.audio.isSharingAudio}),Fe(e=>{var r;let[n,o]=e;if(null!==(r=n.payload.body.update)&&void 0!==r&&r.some(e=>void 0!==e.audio||void 0!==e.muted)){const{meeting:{userId:e}}=o,r=n.payload.body.update.filter(t=>t.id===e);return Sd(t).pipe(Fe(e=>{const t=[];return r.findIndex(e=>"computer"===e.audio)>-1&&"computer"!==(null==e?void 0:e.audio)&&(t.push(pc(!0)),t.push(uc(!0))),Ve(t)}))}return ee})),handleShareAudioWithCurrentShareStatusChangeEpic:(e,t)=>e.pipe(Kt("".concat(Ic)),le(be),Ht(t),tt(e=>{var t;let[,r]=e;return!0===(null===(t=r.audio)||void 0===t?void 0:t.isShareAudioEnabled)}),hd(async e=>{let[t,r]=e;const{payload:n}=t,{audio:{isShareAudioMuted:o,isSharingAudio:i}}=r,s=[];if(n===bs.End){const e=await xp(Jp,zp,r);s.push(...e)}else if(n===bs.Paused){if(!1===o&&!0===i){await Jp.leaveSharingAudio(!0),s.push(vc(!1));const e=await Hp(Jp,zp,r);s.push(...e),setTimeout(()=>{ra("SHARE_AUDIO_STATE_CHANGE",{state:"off"})},0)}}else if(n===bs.Sharing&&!1===o&&!1===i){const e=await Fp(Jp,zp,r);s.push(...e)}return s}))});const Zp=qi.createAgent(),Qp=ts.getInstance();var Xp=Object.freeze({__proto__:null,handleAudioBridgeTokenEpic:e=>Cn(e,4299).pipe(kt(e=>{const{payload:t}=e;Qp.passThroughRWGMessage(t)}),It(ee)),handleAudioBridgeReconnectEpic:e=>Rn(e,hs.AudioBridgeReconnectStart).pipe(kt(()=>{Zp.joinOrLeaveVoip(!1)}),It(ee)),handleAudioBridgeReconnectSuccessEpic:e=>Rn(e,hs.AudioBridgeReconnectEnd).pipe(kt(()=>{Zp.joinOrLeaveVoip(!0)}),It(ee))});const $p={asnIds:{asn1:{userId:0,displayName:null},asn2:{userId:0,displayName:null},asn3:{userId:0,displayName:null}},microphoneDevicesList:[],speakerDevicesList:[],activeMicrophone:"default",activeSpeaker:"default",isMicrophoneForbidden:!1,audioSsrc:0,bCanUnmute:!1,bMutedUponEntry:!1,isAllowToTalk:void 0,dialout:{sequence:0,returnCode:-1},canPlayAudio:!1,isActiveOperation:!1,isMutedAll:!1,isUserGrantCaptureAudio:!1,webrtcRestartCount:0,isComputerAudioLoading:!1,isSpeakerOnly:!1,localShareAudioUserMutedList:[],statistic:{encode:{sample_rate:0,rtt:0,jitter:0,avg_loss:0,max_loss:0},decode:{sample_rate:0,rtt:0,jitter:0,avg_loss:0,max_loss:0}}},eh=Fr({["".concat(Ba)]:Al((e,t)=>{let{payload:r}=t;e.asnIds=c({},r)}),["".concat(Ga)]:Al((e,t)=>{let{payload:r}=t;e.bCanUnmute=r}),["".concat(Wa)]:Al((e,t)=>{let{payload:r}=t;const{dialout:n}=e;n.sequence=r}),["".concat(Ka)]:Al((e,t)=>{let{payload:r}=t;const{dialout:n}=e;n.returnCode=r}),["".concat(qa)]:Al((e,t)=>{let{payload:r}=t;e.isAllowToTalk=r,e.isAllowToTalkAttendeeConnected=!1}),["".concat(Ja)]:Al((e,t)=>{let{payload:r}=t;e.isActiveOperation=r}),["".concat(za)]:Al((e,t)=>{let{payload:r}=t;e.isMutedAll=r}),["".concat(Ya)]:Al((e,t)=>{let{payload:r}=t;e.audioSsrc=r}),["".concat(Za)]:Al((e,t)=>{let{payload:r}=t;e.bMutedUponEntry=r}),["".concat(Qa)]:Al((e,t)=>{let{payload:r}=t;e.isUserGrantCaptureAudio=r}),["".concat(Xa)]:Al((e,t)=>{let{payload:r}=t;e.isMicrophoneForbidden=r}),["".concat($a)]:Al((e,t)=>{let{payload:r}=t;e.webrtcRestartCount=r}),["".concat(ec)]:Al((e,t)=>{let{payload:r}=t;e.microphoneDevicesList=r}),["".concat(tc)]:Al((e,t)=>{let{payload:r}=t;e.speakerDevicesList=r}),["".concat(rc)]:Al((e,t)=>{let{payload:r}=t;e.activeMicrophone=r}),["".concat(nc)]:Al((e,t)=>{let{payload:r}=t;e.activeSpeaker=r}),["".concat(oc)]:Al((e,t)=>{let{payload:r}=t;e.canPlayAudio=r}),["".concat(ic)]:e=>{let{dialout:{returnCode:t}}=e;return c(c({},$p),{},{dialout:c(c({},$p.dialout),{},{returnCode:t})})},["".concat(sc)]:Al((e,t)=>{let{payload:r}=t;e.isComputerAudioLoading=r}),["".concat(ac)]:Al((e,t)=>{let{payload:r}=t;e.isSpeakerOnly=r}),["".concat(cc)]:Al((e,t)=>{let{payload:r}=t;e.isAllowToTalkAttendeeConnected=r}),["".concat(uc)]:Al((e,t)=>{let{payload:r}=t;e.mutedBeforeSharingAudio=r}),["".concat(vc)]:Al((e,t)=>{let{payload:r}=t;e.isSharingAudio=r}),["".concat(fc)]:Al((e,t)=>{let{payload:r}=t;e.isShareAudioMuted=r}),["".concat(dc)]:Al((e,t)=>{let{payload:r}=t;e.localShareAudioUserMutedList.push({userId:r,muted:!1})}),["".concat(lc)]:Al((e,t)=>{let{payload:r}=t;const n=e.localShareAudioUserMutedList.find(e=>e.userId===r.userId);n&&(n.muted=r.muted)}),["".concat(pc)]:Al((e,t)=>{let{payload:r}=t;e.isJoinComputerAudioBeforeSharingAudio=r}),["".concat(hc)]:Al((e,t)=>{let{payload:r}=t;e.isShareAudioEnabled=r}),["".concat(_c)]:Al((e,t)=>{let{payload:r}=t;e.statistic.encode=r.data}),["".concat(mc)]:Al((e,t)=>{let{payload:r}=t;e.statistic.decode=r.data})},$p),th=In(qp,Yp,Xp),rh=e=>4294966272&e,nh=e=>{let t={R:0,G:0,B:0,A:0};if("string"==typeof e&&e.startsWith("#")){const a=e.slice(1);try{if(3===a.length){const e=Array.from(a).map(e=>e.repeat(2)).map(e=>parseInt(e,16));t={R:e[0]/255,G:e[1]/255,B:e[2]/255,A:1}}else if(6===a.length||8===a.length){var r,n,o,i,s;const e=null===(r=a.match(/\S{2}/g))||void 0===r?void 0:r.map(e=>parseInt(e,16));t={R:(null!==(n=null==e?void 0:e[0])&&void 0!==n?n:0)/255,G:(null!==(o=null==e?void 0:e[1])&&void 0!==o?o:0)/255,B:(null!==(i=null==e?void 0:e[2])&&void 0!==i?i:0)/255,A:null!=e&&e[3]?(null!==(s=null==e?void 0:e[3])&&void 0!==s?s:0)/255:1}}}catch(t){console.warn("error color representation:",e)}}else"object"==typeof e&&(t={R:e.R/255,G:e.G/255,B:e.B/255,A:e.A||1});return t};async function oh(e,t,r){if("blur"===e)return"blur";{let n=e;if(t){const t=await function(e){return new Promise((t,r)=>{try{const r=document.createElement("canvas"),n=r.getContext("2d"),o=new Image;o.src=e;const i=16/9,s=1280,a=Math.floor(s/i);r.width=s,r.height=a,o.onload=()=>{const{width:e,height:c}=o,u=c*i;if(u>s){const t=e,r=Math.floor(e/i),u=0,d=(c-r)/2;null==n||n.drawImage(o,u,d,t,r,0,0,s,a)}else{const t=u,r=c,i=(e-t)/2,d=0;null==n||n.drawImage(o,i,d,t,r,0,0,s,a)}r.toBlob(e=>{t(e)})}}catch(e){e instanceof DOMException&&e.code===DOMException.SECURITY_ERR&&console.error("Image is not from the same origin, add CORS header to solve this issue"),r(e)}})}(e);n=URL.createObjectURL(t)}if(n){const e=Math.floor(100*Math.random()),o="".concat("__ZOOM_SDK_VIRTUAL_BACKGROUND_IMAGE_@__").concat(e),i=document.createElement("img");return i.src=n,i.id=o,i.style.display="none",i.onload=()=>{t&&URL.revokeObjectURL(n)},i.onerror=e=>{t&&URL.revokeObjectURL(n),console.error("Cannot load virtual background image.",e)},(null!=r?r:document.body).appendChild(i),new Promise(e=>{i.onload=()=>{t&&URL.revokeObjectURL(n),e(o)},i.onerror=r=>{t&&URL.revokeObjectURL(n),console.error("Cannot load virtual background image.",r),e(null)}})}}return null}const ih=qi.createAgent(),sh=ts.getInstance();var ah=Object.freeze({__proto__:null,handleStartCaptureVideoSuccessEpic:(e,t)=>Rn(e,hs.StartVideoCaptureSuccess).pipe(Ht(t),dd(e=>{let[,t]=e;const{video:{cameraDevicesList:r,activeCamera:n},meeting:{userId:o}}=t;return r.length<1?(ra("CAN_NOT_DETECT_CAMERA",{reason:"Cannot detect camera devices"}),void sh.stopCaptureVideo()):"default"===n||r.some(e=>e.deviceId===n)?void ih.muteAttendeeVideo(o,!1):(ra("CAN_NOT_FIND_CAMERA",{reason:"cannot find target camera"}),void sh.stopCaptureVideo())})),startVideoResponse:(e,t)=>Cn(e,Li).pipe(Ht(t),tt(e=>{var t,r,n,o;let[i,s]=e;const a=s.meeting.userId;return(null==i||null===(t=i.payload)||void 0===t||null===(r=t.body)||void 0===r||null===(n=r.update)||void 0===n||null===(o=n[0])||void 0===o?void 0:o.id)===a}),tt(e=>{var t,r,n,o;let[i]=e;return!0===(null==i||null===(t=i.payload)||void 0===t||null===(r=t.body)||void 0===r||null===(n=r.update)||void 0===n||null===(o=n[0])||void 0===o?void 0:o.bVideoOn)}),dd(()=>(ra("VIDEO_CAPTURE_START_SUCCESS"),xc(!0)))),handleForbiddenCaptureVideoEpic:e=>Rn(e,hs.UserForbiddedCaptureVideo).pipe(kt(()=>ra("VIDEO_USER_FORBIDDEN_CAPTURE")),St(Bc(!0))),handleCameraIsTakenByOtherProgramsEpic:e=>Rn(e,hs.UserCameraIsTakenByOtherPrograms).pipe(kt(()=>ra("VIDEO_CAMERA_IS_TAKEN",{reason:"User camera is taken by other programs."})),St(zc(!0))),handleVideoSocketErrorEpic:e=>Rn(e,hs.VideoWebsocketBroken).pipe(kt(()=>{ra("VIDEO_ESTABLISH_STREAM_ERROR",{reason:"Video websocket broken."})}),It(ee)),handleStopVideoCaptureFailedEpic:e=>Rn(e,hs.StopVideoCaptureFailed).pipe(kt(()=>{ra("VIDEO_CAPTURE_STOP_RESULT",{failed:!0,reason:"Unknown."})}),It(ee)),handleStopVideoCaptureSuccessEpic:(e,t)=>Rn(e,hs.StopVideoCaptureSuccess).pipe(Ht(t),dd(e=>{let[,t]=e;const{meeting:{userId:r},video:{isCurrentUserStartedVideo:n}}=t;n||ra("VIDEO_CAPTURE_STOP_RESULT"),ih.muteAttendeeVideo(r,!0)})),stopVideoResponse:(e,t)=>Cn(e,Li).pipe(Ht(t),tt(e=>{var t,r,n,o;let[i,s]=e;const a=s.meeting.userId;return(null==i||null===(t=i.payload)||void 0===t||null===(r=t.body)||void 0===r||null===(n=r.update)||void 0===n||null===(o=n[0])||void 0===o?void 0:o.id)===a}),tt(e=>{var t,r,n,o;let[i]=e;return!1===(null==i||null===(t=i.payload)||void 0===t||null===(r=t.body)||void 0===r||null===(n=r.update)||void 0===n||null===(o=n[0])||void 0===o?void 0:o.bVideoOn)}),dd(()=>(ra("VIDEO_CAPTURE_STOP_RESULT"),xc(!1)))),receiveVideoMuteIndication:(e,t)=>Cn(e,16133).pipe(Ht(t),tt(e=>{var t,r;let[n,o]=e;return(null==n||null===(t=n.payload)||void 0===t||null===(r=t.body)||void 0===r?void 0:r.id)===o.meeting.userId}),dd(e=>{let[t]=e;const{id:r,bVideoMute:n}=t.payload.body;return ra("RECEIVE_VIDEO_MUTE_INDICATION",{id:r,isVideoMuted:n}),!0===n&&sh.stopCaptureVideo(),!1===n&&ra("ASK_FOR_START_VIDEO_CONSENT",{id:r,isVideoMuted:n}),Kc(n)})),receiveVideoActiveIndication:e=>Cn(e,16129).pipe(Oe(e=>{const{payload:{body:{id:t,bVideoOn:r}}}=e,n=rh(t);return ra("RECEIVE_VIDEO_ACTIVE_INDICATION",{bVideoOn:r,userId:n}),Vc({bVideoOn:r,userId:n})})),receiveVideoSsrcIndication:(e,t)=>Cn(e,16131).pipe(tt(e=>void 0!==e.payload.body.ssrc),Ht(t),Nt(e=>{let[r,n]=e;const{meeting:{isCurrentUserStartVideoBeforeReset:o},media:{videoEncodeStatus:i},video:{captureCanvasList:s,activeCamera:a,isVerifiedVideoCaptureCanvasAfterFailover:c}}=n,{payload:{body:{ssrc:u}}}=r,d=Sd(t).pipe(Fe(e=>e&&!0===o&&!0!==e.bVideoOn?Ed("video",i,"success").pipe(tt(e=>{let[t,r]=e;return t&&r}),Fe(()=>{const e=[xc(void 0)];return!1===c&&(Array.isArray(s)?s.forEach(e=>{Ad(document.querySelector("#".concat(e)))}):Ad(document.querySelector("#".concat(s))),e.push(Yc(!0))),ts.getInstance().startCaptureVideo(u,a,640,360),Ve(e)})):ee));return $e(ae(Lc(u)),d)})),receiveVideoDecodeMaxSizeEpic:e=>Rn(e,hs.VideoDecodeMaxSize).pipe(tt(e=>{var t;return null==e||null===(t=e.payload)||void 0===t?void 0:t.data}),ld(e=>{const{size:t}=e.payload.data;return ae(Gc(t))})),spotlightVideoResponseEpic:e=>Cn(e,16135).pipe(Oe(e=>{const{payload:{body:{bLeadershipOn:t,id:r}}}=e,n=[];return t&&n.push(rh(r)),ra("VIDEO_SPOTLIGHT_CHANGE",{spotlightList:n}),Fc(n)})),handleGroupLayoutIndicationEpic:(e,t)=>Cn(e,7958).pipe(Ht(t),Oe(e=>{let[t,r]=e;const{payload:{body:n}}=t;let o=[];n&&n.group_list&&n.group_list[0]&&(o=n.group_list[0].map(e=>e.id));const i=Va(r);return o=o.filter(e=>i.findIndex(t=>t.userId===e)>=0),ra("VIDEO_SPOTLIGHT_CHANGE",{spotlightList:o}),Fc(o)})),handleCurrentVideoResolution:e=>Rn(e,hs.CurrentVideoResolution).pipe(dd(e=>(ra("VIDEO_RENDER_START_SUCCESS"),ra("RECEIVE_VIDEO_DIMENSION_CHANGE",e.payload.data),Qc(e.payload.data)))),handleMeetingVideoAttributeEpic:e=>Cn(e,Vi).pipe(tt(e=>{const{payload:{body:t}}=e;return void 0!==(null==t?void 0:t.bFollowHostVideo)||void 0!==(null==t?void 0:t.VideoHd)||void 0!==(null==t?void 0:t.bCanUnmuteVideo)}),Oe(e=>{const{payload:{body:{bFollowHostVideo:t,VideoHd:r,bCanUnmuteVideo:n}}}=e;return void 0!==t?(ra("VIDEO_FOLLOW_HOST_ORDER_CHANGE",{bOn:t}),eu(t)):void 0!==n?su(n):(sh.enableHardwareAccelerationForVideoEncode(!1),ou(1===r))})),handleHostDragLayoutIndicationEpic:(e,t)=>Cn(e,7957).pipe(Ht(t),Oe(e=>{let[t,r]=e;const{video:{isFollowHostVideoLayout:n}}=r,{payload:{body:o}}=t,i=o&&o.drag_list&&o.drag_list.map(e=>e.id);return n&&ra("VIDEO_HOST_DRAG_LAYOUT_CHANGE",{layout:i}),tu(i)})),handlePeerVideoStateChangeEpic:(e,t)=>Cn(e,Li).pipe(Ht(t),tt(e=>{let[t,r]=e;const{meeting:{userId:n},video:{subscribedVideoList:o}}=r,i=t.payload.body.update,s=t.payload.body.remove;return i&&i.length>0&&i.findIndex(e=>e.id!==n&&(void 0!==e.bVideoOn||e.bHold))>-1||s&&s.some(e=>o.includes(e.id))}),kt(e=>{let[t,r]=e;const{payload:{body:{remove:n,update:o}}}=t,{video:{subscribedVideoList:i}}=r,s=La(r);if(n&&n.length>0&&n.filter(e=>i.includes(e.id)).forEach(e=>{ra("VIDEO_OLD_USER_STOP",{userId:e.id})}),o&&o.length>0){const e=o.filter(e=>void 0!==e.bVideoOn).filter(e=>-1===s.findIndex(t=>t.userId===e.id)),t=o.filter(e=>!0===e.bHold);t.length>0&&t.filter(e=>i.includes(e.id)).forEach(e=>{ra("VIDEO_OLD_USER_STOP",{userId:e.id})}),e.forEach(e=>{e.bVideoOn?ra("VIDEO_NEW_USER_START",{userId:e.id}):ra("VIDEO_OLD_USER_STOP",{userId:e.id})})}}),It(ee)),handleAudioQosDataEpic:(e,t)=>Rn(e,hs.videoQosData).pipe(Ht(t),Oe(e=>{let[t,r]=e;const{video:{isCaptureForbidden:n,isCameraTaken:o},media:{videoEncodeStatus:i,videoDecodeStatus:s}}=r,a=Pa(r),c=xa(r),u=c.length>0,d=(null==a?void 0:a.bVideoOn)&&!n&&!o,l=c.some(e=>e.bVideoOn),p=i&&d&&u,h=s&&u&&l;return t.payload.data.encoding?p?(ra("VIDEO_STATISTIC_DATA",t.payload),du(t.payload)):du(Ls):h?(ra("VIDEO_STATISTIC_DATA",t.payload),lu(t.payload)):lu(Ls)}))}),ch=Object.freeze({__proto__:null,handleVBPreloadEpic:e=>Rn(e,[hs.VbModelPreloadingOk,hs.VbModelPreloading_3S,hs.VbModelPreloading_10S,hs.VbSettingParaError]).pipe(Fe(e=>{const{payload:{type:t,data:r}}=e,n=[];return[hs.VbModelPreloadingOk,hs.VbModelPreloading_3S,hs.VbModelPreloading_10S].includes(t)?(n.push(au(!0)),ra("VIDEO_VIRTUAL_BACKGROUND_PRELOAD_READY",!0),t===hs.VbModelPreloading_10S&&console.warn("Virtual Background is taking longer than expected to load.")):t===hs.VbSettingParaError&&(r===Ps.VBModelNotMatch?(ra("VIDEO_VIRTUAL_BACKGROUND_PRELOAD_READY",!1),n.push(au(!1))):(ra("VIDEO_VIRTUAL_BACKGROUND_SETTING_SUCCESS",!1),n.push(cu(!1)))),Ve(n)})),handleVBSettingSuccessEpic:e=>Rn(e,hs.StartVideoStreamInVbSettingSuccess).pipe(Oe(()=>(ra("VIDEO_VIRTUAL_BACKGROUND_SETTING_SUCCESS",!0),cu(!0))))});const uh={videoSsrc:0,cameraDevicesList:[],activeCamera:"default",activeVideoId:0,isCurrentUserStartedVideo:!1,spotlightUserList:[],isCaptureForbidden:!1,receivedVideoMaxQuality:2,captureCanvasList:[],subscribedVideoList:[],renderedVideoList:[],isVideoMuted:!1,isCaptureCameraLoading:!1,isCameraTaken:!1,receivedVideoDimension:{width:0,height:0},isFollowHostVideoLayout:!1,hostDragLayout:[],isSupportHDVideo:!1,highDefinitionVideoId:void 0,bCanUnmuteVideo:!1,virtualBackground:{isVBConfigured:!1,isVBPreloadReady:void 0,imageSrc:void 0,cropped:void 0},statistic:{encode:{sample_rate:0,rtt:0,jitter:0,avg_loss:0,max_loss:0,width:0,height:0,fps:0},decode:{sample_rate:0,rtt:0,jitter:0,avg_loss:0,max_loss:0,width:0,height:0,fps:0}},hardwareAcceleration:{encode:!1,decode:!1}},dh=Fr({["".concat(Lc)]:Al((e,t)=>{let{payload:r}=t;e.videoSsrc=r}),["".concat(jc)]:Al((e,t)=>{let{payload:r}=t;e.cameraDevicesList=r}),["".concat(Hc)]:Al((e,t)=>{let{payload:r}=t;e.activeCamera=r}),["".concat(Vc)]:Al((e,t)=>{let{payload:r}=t;e.activeVideoId=r.userId}),["".concat(xc)]:Al((e,t)=>{let{payload:r}=t;e.isCurrentUserStartedVideo=r}),["".concat(Fc)]:Al((e,t)=>{let{payload:r}=t;e.spotlightUserList=r}),["".concat(Bc)]:Al((e,t)=>{let{payload:r}=t;e.isCaptureForbidden=r}),["".concat(Gc)]:Al((e,t)=>{let{payload:r}=t;e.receivedVideoMaxQuality=r}),["".concat(Wc)]:Al((e,t)=>{let{payload:r}=t,n=r;Array.isArray(r)||(n=[r]),e.captureCanvasList=n}),["".concat(Kc)]:Al((e,t)=>{let{payload:r}=t;e.isVideoMuted=r}),["".concat(qc)]:Al((e,t)=>{let{payload:r}=t;e.isCaptureCameraLoading=r}),["".concat(zc)]:Al((e,t)=>{let{payload:r}=t;e.isCameraTaken=r}),["".concat(Yc)]:Al((e,t)=>{let{payload:r}=t;e.isVerifiedVideoCaptureCanvasAfterFailover=r}),["".concat(Jc)]:Al((e,t)=>{let{payload:r}=t;e.isVerifiedVideoRenderCanvasAfterFailover=r}),["".concat(Qc)]:Al((e,t)=>{let{payload:r}=t;e.receivedVideoDimension=r}),["".concat(Xc)]:Al((e,t)=>{let{payload:r}=t;e.subscribedVideoList.includes(r)||e.subscribedVideoList.push(r)}),["".concat($c)]:Al((e,t)=>{let{payload:r}=t;const n=e.subscribedVideoList.indexOf(r);n>=0&&e.subscribedVideoList.splice(n,1)}),["".concat(ru)]:Al((e,t)=>{let{payload:r}=t;-1===e.renderedVideoList.findIndex(e=>e.userId===r.userId&&e.key===r.key&&e.canvasId===r.canvasId)&&e.renderedVideoList.push(c({},r))}),["".concat(nu)]:Al((e,t)=>{let{payload:r}=t;const n=e.renderedVideoList.findIndex(e=>e.userId===r.userId&&e.key===r.key&&e.canvasId===r.canvasId);n>=0&&e.renderedVideoList.splice(n,1)}),["".concat(eu)]:Al((e,t)=>{let{payload:r}=t;e.isFollowHostVideoLayout=r}),["".concat(tu)]:Al((e,t)=>{let{payload:r}=t;e.hostDragLayout=r}),["".concat(ou)]:Al((e,t)=>{let{payload:r}=t;e.isSupportHDVideo=r}),["".concat(iu)]:Al((e,t)=>{let{payload:r}=t;e.highDefinitionVideoId=r}),["".concat(su)]:Al((e,t)=>{let{payload:r}=t;e.bCanUnmuteVideo=r}),["".concat(au)]:Al((e,t)=>{let{payload:r}=t;e.virtualBackground.isVBPreloadReady=r}),["".concat(cu)]:Al((e,t)=>{let{payload:r}=t;e.virtualBackground.isVBConfigured=r}),["".concat(uu)]:Al((e,t)=>{let{payload:r}=t;e.virtualBackground.imageSrc=r.imageSrc,e.virtualBackground.cropped=r.cropped}),["".concat(pu)]:Al((e,t)=>{let{payload:r}=t;const{encode:n,decode:o}=r;void 0!==n&&(e.hardwareAcceleration.encode=n),void 0!==o&&(e.hardwareAcceleration.decode=o)}),["".concat(Zc)]:e=>c(c({},uh),{},{captureCanvasList:e.captureCanvasList,activeCamera:e.activeCamera,isVerifiedVideoCaptureCanvasAfterFailover:!1,isVerifiedVideoRenderCanvasAfterFailover:!1}),["".concat(du)]:Al((e,t)=>{let{payload:r}=t;e.statistic.encode=r.data}),["".concat(lu)]:Al((e,t)=>{let{payload:r}=t;e.statistic.decode=r.data})},uh),lh=In(ah,ch),{InitSuccessVideo:ph,InitSuccessAudio:hh,InitSuccessSharing:fh,InitFailedVideo:vh,InitFailedAudio:_h,InitFailedSharing:mh}=hs;let yh;const gh=new J(An(fp,Tp,Np,In(Object.freeze({__proto__:null,connectToMediaStreamEpic:(e,t)=>e.pipe(Kt("".concat(ln)),Ht(t),tt(e=>{let[,t]=e;return void 0!==t.media.assetsPath&&void 0!==t.media.mediaConstraints}),kt(e=>{let[,r]=e;const{media:{assetsPath:n,mediaConstraints:o,fileWithVersion:i,enforceMultipleVideos:s},meeting:{enableAudioQos:a,enableVideoQos:c}}=r;if(yh=ts.getInstance(),n&&o){let e=void 0;Od()&&(e={resourceManager:Lp.IResourceManager,file:[{path:"".concat(n,"/vb-resources/vbbuffer.bin"),type:"bin"},{path:"".concat(n,"/vb-resources/tf.min.js"),type:"js"}],enableMultiDecodeVideoWithoutSAB:!!s}),yh.setAssetsAndConstraint(n,o,i,e)}Sd(t).pipe(Ht(t)).subscribe(e=>{let[t,r]=e;const{meeting:{svcUrl:n,meetingNumber:o,conId:i,e2eEncrypt:s,userId:u,isWebinar:d}}=r;var l;t&&(null===(l=yh)||void 0===l||l.connect({svcUrl:n,meetingNumber:o,conId:i,e2eEncrypt:s,isViewOnly:Ca(t.userRole),currentUserId:u,isWebinar:d,enableAudioQos:a,enableVideoQos:c}))})}),Nt(()=>Ze(e=>{var t;return null===(t=yh)||void 0===t?void 0:t.registerCallback(e)},e=>{var t;return null===(t=yh)||void 0===t?void 0:t.unregisterCallback(e)},(e,t)=>({type:e,data:t})).pipe(Oe(e=>pn(e))))),connectedMediaStreamEpic:e=>Rn(e,[ph,hh,fh,vh,_h,mh]).pipe(ld(e=>{const{payload:{type:t,data:r}}=e;if(t===hh||t===_h){if(r===fs.EncodeSuccess)return ra("AUDIO_ENCODE_SUCCESS"),ae(hn("success"));if(r===fs.DecodeSuccess)return ra("AUDIO_DECODE_SUCCESS"),ae(fn("success"));if(r===fs.EncodeFailed)return ra("AUDIO_ENCODE_FAIL"),ae(hn("failed"));if(r===fs.DecodeFailed)return ra("AUDIO_DECODE_FAIL"),ae(fn("failed"))}else if(t===ph||t===vh){if(r===fs.EncodeSuccess)return ra("VIDEO_ENCODE_SUCCESS"),ae(vn("success"));if(r===fs.DecodeSuccess)return ra("VIDEO_DECODE_SUCCESS"),ae(_n("success"));if(r===fs.EncodeFailed)return ra("VIDEO_ENCODE_FAIL"),ae(vn("failed"));if(r===fs.DecodeFailed)return ra("VIDEO_DECODE_FAIL"),ae(_n("failed"))}else if(t===fh||t===mh){if(r===fs.EncodeSuccess)return ra("SHARING_ENCODE_SUCCESS"),ae(mn("success"));if(r===fs.DecodeSuccess)return ra("SHARING_DECODE_SUCCESS"),ae(yn("success"));if(r===fs.EncodeFailed)return ra("SHARING_ENCODE_FAIL"),ae(mn("failed"));if(r===fs.DecodeFailed)return ra("SHARING_DECODE_FAIL"),ae(yn("failed"));if(t===fh&&void 0===r)return ra("SHARING_DECODE_SUCCESS"),ae(yn("success"))}})),mediaDeviceUpdateEpic:(e,t)=>Rn(e,[ph,hh]).pipe(pd(()=>{if("object"==typeof navigator.mediaDevices)return $e(bd(),$e(Rn(e,hs.StartVideoCaptureSuccess),Ye(navigator.mediaDevices,"devicechange"),Rn(e,hs.UserGrantCaptureAudio)).pipe(Fe(()=>bd().pipe(kt(()=>{ra("MEDIA_DEVICE_CHANGE")}))))).pipe(Ht(t),Fe(e=>{let[t,r]=e;const n=[ec(t.microphones),tc(t.speakers),jc(t.cameras)];if(r.audio){const{audio:{activeMicrophone:e,activeSpeaker:s,microphoneDevicesList:a,speakerDevicesList:c}}=r,{microphones:u,speakers:d}=t,l=a.filter(e=>-1===u.findIndex(t=>t.deviceId===e.deviceId)),p=c.filter(e=>-1===d.findIndex(t=>t.deviceId===e.deviceId));var o,i;l.length>0&&l[0].deviceId===e&&(null===(o=yh)||void 0===o||o.changeMicrophone("default"),n.push(rc("default"))),p.length>0&&p[0].deviceId===s&&(null===(i=yh)||void 0===i||i.changeSpeaker("default"),n.push(nc("default")))}return Ve(n)}))})),sendUserNodeListToMediaSDKEpic:e=>wn(e,Li).pipe(kt(e=>{const{type:t,payload:{body:r}}=e,n=ts.getInstance(),o=t==="".concat(en);if(r.add){const e=r.add.map(e=>({userid:e.id,sn:e.zoomID&&_o(e.zoomID)}));o||n.sendUserNodeList(e),n.updateUserMediaSN({added:e,isFromMainSession:o,iVType:Ti.SHARING_DECODE})}r.remove&&(o||n.sendUserNodeList(r.remove.map(e=>({userid:e.id,bremove:!0}))),n.updateUserMediaSN({removed:r.remove.map(e=>e.id),isFromMainSession:o,iVType:Ti.SHARING_DECODE}))}),It(ee)),handleMediaSdkGcmIVResponseEpic:e=>Rn(e,hs.AesGcmIvResponse).pipe(kt(e=>{const{payload:{data:{workerType:t,iv:r}}}=e,n=di.get(Ri.WebclientIVState);if(n){const e=c(c({},n),{},{[t]:r});di.set(Ri.WebclientIVState,e,ci.SessionStorage)}}),It(ee)),handleMediaEncryptIndication:e=>e.pipe(Kt("".concat(zr)),tt(e=>[ji,Hi,Ui].includes(e.payload.evt)),Oe(e=>{const{payload:{evt:t,body:{encryptKey:r,additionalType:n}}}=e;return En({type:t===ji?"audio":t===Hi?"video":"sharing",encryptKey:r,additionalType:n})}))})))),Eh=(e,t,r)=>gh.pipe(Fe(n=>n(e,t,r))),Sh={meeting:hp,socket:Cp,participants:Dp,media:Mp},bh=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=$.constructor,r=new t($.SchedulerAction),n=new q,o=void 0,i=function(t){o=t;var i=(new q).pipe(le(r)),s=(new q).pipe(le(r)),a=new zt(i),c=new Jt(s,o.getState());return n.pipe(Oe((function(t){var r="dependencies"in e?t(a,c,e.dependencies):t(a,c);if(!r)throw new TypeError('Your root Epic "'+(t.name||"")+"\" does not return a stream. Double check you're not missing a return statement!");return r})),Fe((function(e){return Ve(e).pipe(Rt(r),le(r))}))).subscribe(o.dispatch),function(e){return function(t){var r=e(t);return s.next(o.getState()),i.next(t),r}}};return i.run=function(e){n.next(e)},i}(),Ah=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||S;function Ih(e){return function(e){for(var t=Object.keys(e),r={},n=0;ne.userId===t);if(o.findIndex(e=>e===kh.Attendee)>-1&&(i=Ua(n).find(e=>e.userId===t)),!i)return Promise.reject({type:Js,reason:"no matching user"});{const{meeting:{userId:e}}=r.getState();for(let r=0;r1?n-1:0),s=1;s{if(this[wh][e]&&void 0===o.getState()[e]){const{epic:t,reducer:r,Client:n}=this[wh][e];o.injectReducer(e,r),o.injectEpic(t);const i=new n(o);this.modules.set(e,i)}}),null!=n&&n.audio&&void 0===o.getState().audio&&(o.injectReducer("audio",eh),o.injectEpic(th)),null!=n&&n.video&&void 0===o.getState().video&&(o.injectReducer("video",dh),o.injectEpic(lh)),null!=n&&n.screen&&void 0===o.getState().share&&(o.injectReducer("share",Cl),o.injectEpic(Tl))}return n(Do({apiKey:e,signature:t,language:a,useSDK:this.useSDK})),n(gn({mediaConstraints:r&&r.constraints||{},assetsPath:i,fileWithVersion:s,enforceMultipleVideos:null==r?void 0:r.enforceMultipleVideos})),new Promise((e,t)=>{null!=r&&r.skipJsMedia?e(""):ei(c,()=>{e("")},()=>{t({type:Js,reason:"depedent assets are not accessible"})})})}on(e,t){((e,t)=>{const r=Qs[e];if(r){const n=ea.get(e);if(n)n.push(t),ea.set(e,n);else{const n=[t];ea.set(e,n);const o=$e(...r.map(e=>{const{event:t,payload:r}=e;return Ye(Xs,t).pipe(Oe(e=>r(e)),le(Ee))})).subscribe(t=>{const r=ea.get(e);r&&r.forEach(e=>{e(t)})});ta.push(o)}}})(e,t)}off(e,t){((e,t)=>{if(Qs[e]){const r=ea.get(e);if(Array.isArray(r)){const n=r.filter(e=>e!==t);ea.set(e,n)}}})(e,t)}getFeatureModule(e){return this.modules.get(e)}leave(){const{[Th]:e,[Oh]:t}=this;return"connected"===e().socket.zoomSocketStatus?(t(Co()),ct(500).pipe(St("")).toPromise()):Promise.resolve("")}end(){const{[Th]:e,[Oh]:t}=this;return"connected"===e().socket.zoomSocketStatus?(t(To()),ct(500).pipe(kt(()=>{sa()}),St("")).toPromise()):Promise.resolve("")}changeName(e,t){const r=this[Ch].getState(),{meeting:{bAllowAttendeeRename:n}}=r,o=Pa(r),i=Ca(o.userRole),s=Ma(r);if(i)return Promise.reject({type:"INSUFFICIENT_PRIVILEGES"});if(t&&t!==(null==o?void 0:o.userId)){if(s){const{participants:{attendeesList:n}}=r,o=n.find(e=>e.userId===t);if(o)return Fh.rename(t,ho(e),ho(o.displayName)),ud(t,t=>t.displayName===e);{const n=Ua(r).find(e=>e.userId===t);return n?(Vl.getInstance().rename(n.jid,e),oa("UPDATE_WEBINAR_PARTICIPANT_ATTRIBUTE",t=>{const r=t.find(e=>e.jid===n.jid);return r&&r.name===e})):Promise.reject({type:Js,reason:"no matching user"})}}return Promise.reject({type:"INSUFFICIENT_PRIVILEGES"})}return e===o.displayName?Promise.resolve():s||n?(Fh.rename(o.userId,ho(e),ho(o.displayName)),oa("UPDATE_CURRENT_USER_PARTICIPANT_ATTRIBUTE",t=>t.displayName===e)):Promise.reject({type:"INSUFFICIENT_PRIVILEGES",reason:"host disallow rename themselves"})}makeHost(e){return Fh.assignHost(e,!1),ud(e,e=>!0===e.isHost)}makeCoHost(e){const t=this[Ch].getState(),r=Va(t).find(t=>t.userId===e);return!0===(null==r?void 0:r.bCoHost)?Promise.reject({type:Js,reason:"user:[".concat(e,"] is already co-host ")}):(Fh.assignHost(e,!0),ud(e,e=>!0===e.bCoHost))}revokeCoHost(e){const t=this[Ch].getState(),r=Va(t).find(t=>t.userId===e);return!1===(null==r?void 0:r.bCoHost)?Promise.reject({type:Js,reason:"user:[".concat(e,"] is not a co-host")}):(Fh.revokeCoHost(e),ud(e,e=>!1===e.bCoHost))}isHost(){const e=this[Ch].getState(),t=Pa(e);return!!t&&t.isHost}isCoHost(){const e=this[Ch].getState(),t=Pa(e);return!!t&&!!t.bCoHost}isOriginHost(){const{meeting:{isOriginHost:e}}=this[Th]();return e}getCurrentUserInfo(){const e=this[Ch].getState(),t=Pa(e);if(t){const r={userId:t.userId,displayName:t.displayName,audio:t.audio,muted:t.muted,isHost:t.isHost,isCoHost:t.bCoHost,isGuest:t.bGuest,avatar:t.avatar,isPhoneUser:Aa(t.userType),bRaiseHand:t.bRaiseHand,bHold:t.bHold,bVideoOn:t.bVideoOn,sharerOn:t.sharerOn,sharePause:t.sharerPause,feedback:t.feedback};if(e.meeting.isWebinar&&Ca(t.userRole)){const{audio:t}=e,n=null==t?void 0:t.isAllowToTalk;Object.assign(r,{isAllowToTalk:n})}return r}return null}getParticipantsList(){const e=this[Ch].getState(),{meeting:{meetingStatus:t}}=e,r=Pa(e);return"joined"===t&&r&&!r.bHold?Va(e).map(e=>({userId:e.userId,displayName:e.displayName,audio:e.audio,muted:e.muted,isHost:e.isHost,isCoHost:e.bCoHost,isGuest:e.bGuest,avatar:e.avatar,isPhoneUser:Aa(e.userType),bRaiseHand:e.bRaiseHand,bHold:e.bHold,bVideoOn:e.bVideoOn,sharerOn:e.sharerOn,sharePause:e.sharerPause,feedback:e.feedback,bLocalRecord:e.bLocalRecord,sdkKey:e.sdkKey})):[]}getMeetingHost(){const e=this[Th](),t=ja(e);return t?{userId:t.userId,displayName:t.displayName,audio:t.audio,muted:t.muted,isHost:t.isHost,isCoHost:t.bCoHost,avatar:t.avatar,isPhoneUser:Aa(t.userType),bRaiseHand:t.bRaiseHand,bHold:t.bHold,bVideoOn:t.bVideoOn,sharerOn:t.sharerOn,feedback:t.feedback}:null}getMeetingInfo(){const{meeting:{meetingStatus:e,isOnHold:t,meetingNumber:r,passWord:n,userName:o,userEmail:i,meetingTopic:s,meetingOptions:a,encType:c,region:u,network:d,topic:l,zlkJwtToken:p,userId:h,lang:f,inviteEmail:v,meetingId:_,participantID:m,h323Password:y,recordingDisclaimer:g,recordingDisclaimerForRecorder:E}}=this[Th](),S="joined"===e&&!t;if(p)return{topic:l,password:n,userName:o,isInMeeting:S,userId:h,meetingId:_};{let e="";return 0===c?e="None":1===c?e="AES ECB":2===c&&(e="AES GCM"),{meetingNumber:r,password:n,userName:o,userEmail:i,inviteEmail:v,meetingTopic:s,encryptionType:e,region:u,network:d,isInMeeting:S,userId:h,lang:f,webEndpoint:Dl,meetingId:_,participantId:m,telPwd:y,recordingInfo:{recordingDisclaimer:g,recordingDisclaimerForRecorder:E,isUserEnableRecordingReminder:null==a?void 0:a.isUserEnableRecordingReminder}}}}}).prototype,"end",[Ph,Dh],Object.getOwnPropertyDescriptor(xh.prototype,"end"),xh.prototype),l(xh.prototype,"changeName",[Dh],Object.getOwnPropertyDescriptor(xh.prototype,"changeName"),xh.prototype),l(xh.prototype,"makeHost",[Vh,Ph,Dh],Object.getOwnPropertyDescriptor(xh.prototype,"makeHost"),xh.prototype),l(xh.prototype,"makeCoHost",[jh,Ph,Dh],Object.getOwnPropertyDescriptor(xh.prototype,"makeCoHost"),xh.prototype),l(xh.prototype,"revokeCoHost",[Hh,Ph,Dh],Object.getOwnPropertyDescriptor(xh.prototype,"revokeCoHost"),xh.prototype),xh);var Gh=Object.freeze({__proto__:null,receiveChatMessageFromXMPPEpic:(e,t)=>Tn(e,"Message").pipe(Ht(t),Fe(e=>{let[t,r]=e;const{payload:{data:{sn:n,senderName:o,senderJid:i,receiver:s,text:a,type:c}}}=t,u=Pa(r),d=Ua(r),{meeting:{jid:l,userId:p},participants:{xmppAttendeeList:h}}=r;return ki.beginDecrypt({decryptedText:a,type:wi.XMPP_CHAT,zoomId:n}).then(e=>{var t;let{message:r}=e,n=null,a=0,f="";u&&Ca(u.userRole)&&l===s?(n=h.find(e=>e.jid===i),a=p,f=u.displayName):c===Bi.Panelist&&(n=d.find(e=>e.jid===i),a=Bi.Panelist,f=Qi.displayName);const v={message:r,sender:{name:o,userId:(null===(t=n)||void 0===t?void 0:t.userId)||0,avatar:""},receiver:{name:f,userId:a},timestamp:(new Date).getTime()};return ra("CHAT_RECEIVE_MESSAGE_EVENTS",v),gu(v)})})),receiveChatMessageFromRWGEpic:(e,t)=>Cn(e,7944).pipe(Ht(t),Fe(e=>{let[t,r]=e;const{meeting:{bIbDisableChat:n,isWebinar:o},participants:{attendeesList:i}}=r,{payload:{body:{attendeeNodeID:s,sn:a,destNodeID:c,text:u,senderName:d,msgID:l}}}=t,p=Pa(r),h=Ua(r);if(p){const e=Ca(null==p?void 0:p.userRole)&&s===p.userId&&!l;if(!n&&!e){let e,t=a;if(!a){const e=i.find(e=>e.userId===c);e&&(t=e.zoomID)}if(s===Bi.SilentModeUsers){const t=fo(u),r={id:l,message:t,sender:{name:"Host",userId:c},receiver:{name:"Everyone (in Waiting Room)",userId:s},timestamp:(new Date).getTime()};e=Promise.resolve(r)}else e=ki.beginDecrypt({decryptedText:u,zoomId:t,type:wi.RWG_CHAT}).then(e=>{let{message:t}=e;const r=i.find(e=>e.userId===c),n=d?fo(d):null==r?void 0:r.displayName;let a="";if(s===Bi.All)a=o?"All panelists and attendees":"Everyone";else if(s===Bi.Panelist)a="All panelists";else if(o&&h.findIndex(e=>e.userId===s)>-1)a=h.find(e=>e.userId===s).displayName;else{const e=i.find(e=>e.userId===s);e&&(a=e.displayName)}return{id:l,message:t,sender:{name:n,userId:c,avatar:null==r?void 0:r.avatar},receiver:{name:a,userId:s},timestamp:(new Date).getTime()}});return e.then(e=>(ra("CHAT_RECEIVE_MESSAGE_EVENTS",e),gu(e)))}}return ee})),changePrivilegeResponse:(e,t)=>Cn(e,Vi).pipe(tt(e=>{var t,r;return void 0!==(null===(t=e.payload.body)||void 0===t?void 0:t.chatPriviledge)||void 0!==(null===(r=e.payload.body)||void 0===r?void 0:r.bAllowAttendeeChat)}),Ht(t),Oe(e=>{let[t,r]=e;const{payload:{body:{chatPriviledge:n,bAllowAttendeeChat:o}}}=t,{chat:{chatPrivilege:i}}=r;return void 0!==o?(ra("CHAT_PRIVILEGE_CHANGE",!0===o?{chatPrivilege:i}:{chatPrivilege:Fi.NoAttendee}),Su(o)):(ra("CHAT_PRIVILEGE_CHANGE",{chatPrivilege:n}),yu(n))})),chatResponseEpic:(e,t)=>Cn(e,4136).pipe(Ht(t),Fe(e=>{let[t,r]=e;const{payload:{body:{result:n,destNodeID:o,msgID:i}}}=t,{meeting:{userId:s},chat:{chatHistory:a}}=r;if(n===Wi.Success){var c,u;const e=[];for(let t=a.length-1;t>=0;t--){const r=a[t];if(!r.id&&r.sender.userId===s&&[Bi.All,Bi.Panelist,o].includes(r.receiver.userId)&&e.unshift(r),r.id)break}const t=e.length>0&&null!==(c=null===(u=e[0])||void 0===u?void 0:u.highResTimeStampForIdentification)&&void 0!==c?c:0;return ra("CHAT_MESSAGE_RESPONSE",{msgId:i,receiverId:o,identification:t}),ae(bu({destNodeID:o,msgID:i,userId:s}))}return n===Wi.Delete||n===Wi.Block?ae(Au({msgId:i})):ee})),chatCmdResponseEpic:e=>Cn(e,4238).pipe(Fe(e=>{const{payload:{body:{bSuccess:t,cmd:r,msgID:n}}}=e,o=[];if(t)switch(r){case Gi.Delete:o.push(Au({msgId:n})),ra("CHAT_DELETE_MESSAGE_REPONSE",{id:n})}return Ve(o)})),chatCmdIndicationEpic:e=>Cn(e,7960).pipe(Fe(e=>{const{payload:{body:{cmd:t,msgID:r}}}=e,n=[];switch(t){case Gi.Delete:n.push(Au({msgId:r})),ra("CHAT_DELETE_MESSAGE_REPONSE",{id:r})}return Ve(n)}))});const Wh={chatHistory:[],chatPrivilege:Fi.All,isAllowAttendeeChat:!0},Kh=Fr({["".concat(gu)]:Al((e,t)=>{let{payload:r}=t;e.chatHistory.push(r)}),["".concat(yu)]:Al((e,t)=>{let{payload:r}=t;e.chatPrivilege=r}),["".concat(Su)]:Al((e,t)=>{let{payload:r}=t;e.isAllowAttendeeChat=r}),["".concat(bu)]:Al((e,t)=>{let{payload:r}=t;const{destNodeID:n,msgID:o,userId:i}=r,s=[];for(let t=e.chatHistory.length-1;t>=0;t--){const r=e.chatHistory[t];if(!r.id&&r.sender.userId===i&&[Bi.All,Bi.Panelist,n].includes(r.receiver.userId)&&s.unshift(r),r.id)break}s.length>0&&(s[0].id=o)}),["".concat(Au)]:Al((e,t)=>{let{payload:r}=t;const{msgId:n}=r,o=e.chatHistory.findIndex(e=>e.id===n);o>=0&&e.chatHistory.splice(o,1)}),["".concat(Eu)]:()=>c({},Wh)},Wh);function qh(e,t,r){if(null!=r&&r.host)return[ja(e),...Ha(e)].filter(e=>(null==e?void 0:e.userId)!==t).map(e=>({userId:null==e?void 0:e.userId,displayName:null==e?void 0:e.displayName,isHost:null==e?void 0:e.isHost,isCoHost:null==e?void 0:e.bCoHost}));{let n=[ja(e),...Ha(e),...e.participants.attendeesList.filter(e=>!(e.bCoHost||e.isHost||e.bHold))];if(null!=r&&r.includeAttendee){const t=Ua(e).filter(e=>!Aa(e.userType));n=[...n,...t]}return n.filter(e=>(null==e?void 0:e.userId)!==t).map(e=>({userId:null==e?void 0:e.userId,displayName:null==e?void 0:e.displayName,isHost:null==e?void 0:e.isHost,isCoHost:null==e?void 0:e.bCoHost}))}}var zh;const Jh=qi.createAgent(),Yh=Vl.getInstance(),Zh=e=>{const{text:t,destId:r,sn:n,attendeeId:o}=e;return ki.beginEncrypt({text:t,type:wi.RWG_CHAT}).then(e=>{Jh.chat(e,r,n,o)})};let Qh=(l((zh=class extends Lh{send(e,t){if(!e)return Promise.reject({type:Js,reason:"Text is empty"});const{[Th]:r,[Oh]:n}=this,o=r(),i=Pa(o),s=function(e,t){if(t===Bi.All)return Zi;if(t===Bi.Panelist)return Qi;if(t===Bi.SilentModeUsers)return Xi;{const{meeting:{isWebinar:r},participants:{xmppAttendeeList:n,attendeesList:o}}=e;return r?o.find(e=>e.userId===t)||n.find(e=>e.userId===t):o.find(e=>e.userId===t)}}(o,t),a=((e,t,r)=>{const n=null==t?void 0:t.userId;if(null==e||!e.zoomID||null==t||!t.displayName||n===e.userId)return{type:Js,reason:"invalid target user"};const{chat:{chatPrivilege:o},meeting:{isWebinar:i}}=r,s=Ma(r),a=t.isHost||t.bCoHost;if(!s)if(i&&Ca(e.userRole)){if(o===Fi.NoAttendee||o===Fi.AllPanelist&&n!==Bi.Panelist||o===Fi.All&&n!==Bi.All&&n!==Bi.Panelist)return{type:"INSUFFICIENT_PRIVILEGES",reason:"Insufficient chat privilege"}}else if(o===Fi.NoAttendee||o===Fi.Host&&!a||n===Bi.SilentModeUsers||o===Fi.EveryonePublicly&&n!==Bi.All&&!a)return{type:"INSUFFICIENT_PRIVILEGES",reason:"Insufficient chat privilege"};return null})(i,s,o);if(a)return Promise.reject(a);const{meeting:{isWebinar:u,encType:l}}=o,p=l===Oi.AES_GCM;let h=Promise.resolve(),f=!1;return t===Bi.SilentModeUsers?Jh.chat(ho(e),t):u?s.userRole===Ea.Attendee?8==(8&s.clientCap)?h=Zh({text:e,destId:Bi.IndividualCcPanelist,sn:null==i?void 0:i.zoomID,attendeeId:t}):(h=Zh({text:e,destId:Bi.Panelist,sn:null==i?void 0:i.zoomID,attendeeId:t}).then(()=>(e=>{const{text:t,jid:r,isGCMEnabled:n}=e;return ki.beginEncrypt({text:t,type:wi.XMPP_CHAT}).then(e=>{Yh.sendWebinarMsg(e,r,Bi.IndividualCcPanelist,n)})})({text:e,jid:s.jid,isGCMEnabled:p})),f=!0):s&&(h=Zh({text:e,destId:s.userId,sn:null==i?void 0:i.zoomID})):h=Zh({text:e,destId:s.userId,sn:null==i?void 0:i.zoomID}),h.then(()=>{const r=(new Date).getTime(),o=performance.now(),a={message:e,sender:{name:null==i?void 0:i.displayName,userId:null==i?void 0:i.userId,avatar:null==i?void 0:i.avatar},receiver:{name:null==s?void 0:s.displayName,userId:null==s?void 0:s.userId},timestamp:r,highResTimeStampForIdentification:o};return n(gu(a)),f?(ra("CHAT_RECEIVE_MESSAGE_EVENTS",a),a):new Promise((e,r)=>{var n;ia("CHAT_MESSAGE_RESPONSE").pipe(function(e,t){return void 0===t&&(t=Ae),function(e,t,r){return void 0===r&&(r=Ae),function(n){var o=ht(e),i=o?+e-r.now():Math.abs(e);return n.lift(new Vt(i,o,t,r))}}(e,ce(new Te),t)}(5e3),(n=e=>o!==e.identification||!([e.receiverId,Bi.All,Bi.Panelist].includes(t)||e.receiverId===Bi.IndividualCcPanelist),function(e){return e.lift(new Ct(n))}),yt(1)).subscribe(t=>{const{msgId:r}=t,n=c({id:r},d(a,["highResTimeStampForIdentification"]));ra("CHAT_RECEIVE_MESSAGE_EVENTS",n),e(n)},()=>{r({type:"OPERATION_TIMEOUT"})})})})}setPrivilege(e){const t=this[Th](),{meeting:{isWebinar:r},chat:{chatPrivilege:n}}=t;return n===e?Promise.resolve(""):!r&&!Ji.includes(e)||r&&!Yi.includes(e)?Promise.reject({type:Js,reason:"invalid privilege value of parameter"}):(Jh.setChatPriviledge(e),oa("CHAT_PRIVILEGE_CHANGE",t=>t.chatPrivilege===e))}deleteMessage(e){const t=this[Th](),{chat:{chatHistory:r},meeting:{meetingOptions:n,userId:o}}=t;if(null!=n&&n.isEnableDeleteChatMsg){const n=Ma(t),i=r.find(t=>t.id===e);if(i){const{sender:t}=i;if(n)Jh.chatCmdReq(e,Gi.Delete);else{if(t.userId!==o)return Promise.reject({type:"INSUFFICIENT_PRIVILEGES",reason:"can not delete message"});Jh.chatCmdReq(e,Gi.Delete)}return oa("CHAT_DELETE_MESSAGE_REPONSE",t=>t.id===e).then(()=>({id:e}))}return Promise.reject({type:Js,reason:"msgId is wrong"})}return Promise.reject({type:zs,reason:"can not delete messages"})}lockChat(e){const t=this[Th](),{meeting:{meetingOptions:r}}=t,n=null!=r&&r.isPrivateChatEnabled?Fi.All:Fi.EveryonePublicly;return this.setPrivilege(e?Fi.NoOne:n)}getPrivilege(){const{chat:{chatPrivilege:e,isAllowAttendeeChat:t}}=this[Th]();return t?e:Fi.NoAttendee}getReceivers(){const e=this[Th](),{chat:{chatPrivilege:t,isAllowAttendeeChat:r},meeting:{isWebinar:n}}=e;if(!n&&!r)return[];const o=Pa(e);if(o)if(n){if(!Ca(o.userRole)){const t=qh(e,o.userId,{includeAttendee:!0});return[Qi,Zi,...t]}if(!r)return[];if(t===Fi.All)return[Qi,Zi];if(t===Fi.AllPanelist)return[Qi];if(t===Fi.NoOne)return[]}else{const r=Ma(e);if(t===Fi.All||r){const t=qh(e,o.userId);return[Zi,...t]}if(t===Fi.Host)return qh(e,o.userId,{host:!0});if(t===Fi.EveryonePublicly){const t=qh(e,o.userId,{host:!0});return[Zi,...t]}if(t===Fi.NoOne)return[]}return[]}getHistory(){return this[Th]().chat.chatHistory.map(e=>d(e,["highResTimeStampForIdentification"]))}isAllowToDeleteMessages(){const e=this[Th](),{meeting:{meetingOptions:t}}=e;return null==t?void 0:t.isEnableDeleteChatMsg}}).prototype,"send",[Dh],Object.getOwnPropertyDescriptor(zh.prototype,"send"),zh.prototype),l(zh.prototype,"setPrivilege",[Nh,Dh],Object.getOwnPropertyDescriptor(zh.prototype,"setPrivilege"),zh.prototype),l(zh.prototype,"deleteMessage",[Dh],Object.getOwnPropertyDescriptor(zh.prototype,"deleteMessage"),zh.prototype),l(zh.prototype,"lockChat",[Nh,Dh],Object.getOwnPropertyDescriptor(zh.prototype,"lockChat"),zh.prototype),zh);const Xh=In(Gh);var $h=Object.freeze({__proto__:null,receiveCloudRecordIndication:e=>Cn(e,Vi).pipe(tt(e=>{var t,r,n;return void 0!==(null===(t=e.payload.body)||void 0===t?void 0:t.cmrServerStatus)||void 0!==(null===(r=e.payload.body)||void 0===r?void 0:r.disAllowClientStopAutoCmr)||void 0!==(null===(n=e.payload.body)||void 0===n?void 0:n.enableAutomicRecordingCloud)}),Fe(e=>{const{cmrServerStatus:t,disAllowClientStopAutoCmr:r,enableAutomicRecordingCloud:n}=e.payload.body,o=[];return void 0!==t&&(t!==ds.Init&&ra("CLOUD_RECORDING_STATUS_CHANGE",{cmrServerStatus:t}),o.push(cp(t))),void 0!==r&&o.push(dp(!r)),void 0!==n&&o.push(lp(n)),Ve(o)})),receiveLocalRecordingIndicationEpic:e=>Cn(e,Li).pipe(tt(e=>{const{payload:{body:{update:t}}}=e;return null==t?void 0:t.some(e=>void 0!==e.bLocalRecordStatus)}),kt(e=>{const{payload:{body:{update:t}}}=e;t.filter(e=>void 0!==e.bLocalRecordStatus).forEach(e=>{ra("LOCAL_RECORDING_CHANGE",{userId:e.id,bLocalRecord:1===e.bLocalRecordStatus})})}),It(ee))});const ef={cmrStatus:ds.Stop,recordingEnable:!1,allowStopAutoRecording:!1,automaticCloudRecordingEnable:!1},tf=Fr({["".concat(cp)]:Al((e,t)=>{let{payload:r}=t;e.cmrStatus=r}),["".concat(up)]:Al((e,t)=>{let{payload:r}=t;e.recordingEnable=r}),["".concat(dp)]:Al((e,t)=>{let{payload:r}=t;e.allowStopAutoRecording=r}),["".concat(lp)]:Al((e,t)=>{let{payload:r}=t;e.automaticCloudRecordingEnable=r})},ef);var rf,nf,of,sf;const af=qi.createAgent();let cf=(rf=Mh("recording"),nf=Mh("recording"),of=Mh("recording"),l((sf=class extends Lh{startRecording(){const e=this[Th](),{meeting:{bIbDisableRecording:t,recordingEnable:r},recording:{cmrStatus:n}}=e;return t?Promise.reject({type:zs,reason:"Rejected by Information Barrier"}):r?n===ds.Start?Promise.resolve(""):(af.recordMeeting(!0,!1),oa("CLOUD_RECORDING_STATUS_CHANGE",e=>e.cmrServerStatus===ds.Start)):Promise.reject({type:zs,reason:"The account of the meeting disabled the cloud recording"})}pauseRecording(){const e=this[Th](),{recording:{cmrStatus:t}}=e;return t===ds.Pause?Promise.resolve(""):t!==ds.Start?Promise.reject({type:zs,reason:"Recording is not started"}):(af.recordMeeting(!1,!0),oa("CLOUD_RECORDING_STATUS_CHANGE",e=>e.cmrServerStatus===ds.Pause))}stopRecording(){const e=this[Th](),{recording:{cmrStatus:t}}=e;return t===ds.Stop?Promise.resolve(""):(af.recordMeeting(!1,!1),oa("CLOUD_RECORDING_STATUS_CHANGE",e=>e.cmrServerStatus===ds.Stop))}getRecordingStatus(){const e=this[Th](),{recording:{cmrStatus:t}}=e;return t===ds.Start?us.Recording:t===ds.Pause?us.Paused:us.Stopped}isRecordingEnabled(){const e=this[Th](),{recording:{recordingEnable:t}}=e;return t}isAllowedToStopAutoRecording(){const e=this[Th](),{recording:{allowStopAutoRecording:t}}=e;return t}isAutomaticCloudRecordingEnabled(){const e=this[Th](),{recording:{automaticCloudRecordingEnable:t}}=e;return t}}).prototype,"startRecording",[Nh,Dh,rf],Object.getOwnPropertyDescriptor(sf.prototype,"startRecording"),sf.prototype),l(sf.prototype,"pauseRecording",[Nh,Dh,nf],Object.getOwnPropertyDescriptor(sf.prototype,"pauseRecording"),sf.prototype),l(sf.prototype,"stopRecording",[Nh,Dh,of],Object.getOwnPropertyDescriptor(sf.prototype,"stopRecording"),sf.prototype),sf);const uf=In($h);let df,lf;!function(e){e[e.All=1]="All",e[e.Private=2]="Private"}(df||(df={})),(lf||(lf={})).SUCCESS="success";const{updateCmdJid:pf,removeCmdJid:hf,setCmdChannelConnectionStatus:ff,resetCmdChannel:vf}=Ur("UPDATE_CMD_JID","REMOVE_CMD_JID","SET_CMD_CHANNEL_CONNECTION_STATUS","RESET_CMD_CHANNEL");var _f=Object.freeze({__proto__:null,receiveCmdChannelResponseXMPPEpic:(e,t)=>On(e,24577).pipe(Ht(t),dd(e=>{let[t]=e;const{payload:{body:{status:r}}}=t;if(r===lf.SUCCESS)return ra("COMMAND_STATUS_EVENTS",ii.Connected),ff(r)})),receiveCmdChannelMessageFromXMPPEpic:(e,t)=>On(e,24583).pipe(Ht(t),kt(e=>{let[t,r]=e;const{meeting:{userId:n,encType:o},cmd:{jids:i}}=r,{payload:{body:{senderName:s,senderJid:a,text:c,type:u,receiver:d,msgid:l,sn:p}}}=t,h=mo(i,d),f=o===Oi.AES_GCM,v=mo(i,a),_=(new Date).getTime();let m=Promise.resolve({message:c});return f&&(m=ki.beginDecrypt({decryptedText:c,type:wi.XMPP_CHAT,zoomId:p})),m.then(e=>{let{message:t}=e;(u===df.Private&&parseInt(h,10)===n||u===df.All)&&ra("COMMAND_RECEIVE_MESSAGE_EVENTS",{senderId:v,senderName:s,text:fo(t),timestamp:_,msgid:l})})}),It(ee)),receiveUserJidUpdateFromXMPPEpic:e=>On(e,24595).pipe(Oe(e=>{const{payload:{body:{action:t,data:r}}}=e;return["list","UPDATE","add"].includes(t)&&r?pf(r):"memberremove"===t&&r?hf(r):{type:""}}))});const mf={connectionStatus:"initial",jids:{}},yf=Fr({["".concat(vf)]:()=>c({},mf),["".concat(pf)]:Al((e,t)=>{let{payload:r}=t;r.map(t=>{const{jid:r,node:n}=t;e.jids[n]=r})}),["".concat(hf)]:Al((e,t)=>{let{payload:r}=t;r.map(t=>{const{jid:r}=t,n=mo(e.jids,r);delete e.jids[n]})}),["".concat(ff)]:Al((e,t)=>{let{payload:r}=t;e.connectionStatus=r})},mf);var gf,Ef;const Sf=$i.getInstance(),bf=(e,t,r)=>{const n=t,o=ho(e);return r?ki.beginEncrypt({text:o,type:wi.XMPP_CHAT}).then(e=>{Sf.sendCommandMsg(e,n,!0)}):Sf.sendCommandMsg(o,n,!1)};let Af=(gf=function(e,t,r){const n=r.value;let o=void 0,i=!0;r.value=function(){if(!i)return Promise.reject({type:"OPERATION_LOCKED",reason:"Cannot complete the operation due to the rate limit(".concat(50,"ms)")});i=!1,o=window.setTimeout(()=>{i=!0,window.clearTimeout(o),o=void 0},50);for(var e=arguments.length,t=new Array(e),r=0;r512)return Promise.reject({type:Js,reason:"Text too long > 512"});const{[Th]:r}=this,n=r(),{socket:{cmdChannelSocketStatus:o},meeting:{userId:i,encType:s},cmd:{jids:a,connectionStatus:c}}=n,u=s===Oi.AES_GCM;return o!==Fa.Connected?Promise.reject({type:"IMPROPER_MEETING_STATE",reason:"cmd channel not ready"}):(c===lf.SUCCESS?Promise.resolve(!0):ia("COMMAND_STATUS_EVENTS",1).toPromise().then(e=>e===ii.Connected||Promise.reject({type:zs,reason:"Cannot establish the command channel"}))).then(()=>t?t in a?(bf(e,a[t],u),{timestamp:(new Date).getTime(),text:e,receiverId:t,senderId:i}):Promise.reject({type:zs,reason:"can't find userId ".concat(t)}):(bf(e,"",u),{timestamp:(new Date).getTime(),text:e,receiverId:"",senderId:i}))}getJids(){const{[Th]:e}=this,t=e(),{cmd:{jids:r}}=t;return r}}).prototype,"send",[gf,Dh],Object.getOwnPropertyDescriptor(Ef.prototype,"send"),Ef.prototype),Ef);const If=In(_f),Cf=(e,t,r,n)=>{const{getState:o,dispatch:i}=r,s=o(),{participants:{attendeesList:a},audio:{localShareAudioUserMutedList:c}}=s,u=a.find(t=>t.userId==e);if(u){if(u.bShareAudioOn){const r=c.find(t=>t.userId===e);return r&&r.muted===!t&&i(Vp(n,e,t,s)),Promise.resolve("")}return Promise.reject({type:zs,reason:"Cannot ".concat(t?"mute":"unmute"," share audio when the user's share audio is not enable.")})}return Promise.reject({type:Js,reason:"Cannot find the user"})},Tf=ma([Va],e=>e.filter(e=>e.bVideoOn)),Of=()=>"function"==typeof window.OffscreenCanvas&&("function"==typeof window.ImageCapture||"function"==typeof window.MediaStreamTrackProcessor)&&function(){try{return"undefined"!=typeof MessageChannel&&(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(Es)}catch(e){return!1}}();var wf,Rf,Df,Nf,Pf,Mf,kf,Uf,Lf,Vf,jf,Hf,xf,Ff,Bf,Gf,Wf,Kf,qf,zf,Jf,Yf,Zf,Qf,Xf,$f,ev,tv,rv,nv,ov,iv,sv;let av=(wf=Mh("audio"),Rf=Mh("audio"),Df=Mh("audio"),Nf=Mh("audio"),Pf=Mh("audio"),Mf=Mh("audio"),kf=Mh("audio"),Uf=Mh("audio"),Lf=Mh("audio"),Vf=Mh("audio"),jf=Mh("share"),Hf=Mh("audio"),xf=Mh("share"),Ff=Mh("video"),Bf=Mh("video"),Gf=Mh("video"),Wf=Mh("video"),Kf=Mh("video"),qf=Mh("video"),zf=Mh("video"),Jf=Mh("video"),Yf=Mh("video"),Zf=Mh("video"),Qf=Mh("share"),Xf=Mh("share"),$f=Mh("share"),ev=Mh("share"),tv=Mh("share"),rv=Mh("share"),nv=Mh("share"),ov=Mh("share"),cv="isShareOptionLocked",iv=function(e,t,r){const n=r.value;r.value=function(){const e=this[Ch];if(e){const{meeting:{meetingOptions:t}}=e.getState();if(!0===t[cv])return Promise.reject({type:"OPERATION_LOCKED",reason:"".concat(cv," is locked")})}for(var t=arguments.length,r=new Array(t),o=0;o{const{store:{getState:r,dispatch:n},rwgAgent:o,mediaAgent:i}=e,s=r(),{speakerOnly:a,autoStartAudioInSafari:c}=t||{},u=Pa(s);if("computer"===(null==u?void 0:u.audio))return Promise.resolve();if("phone"===(null==u?void 0:u.audio))return Promise.reject({type:zs,reason:"joined by phone"});{const{audio:{isAllowToTalk:e,isComputerAudioLoading:t,canPlayAudio:d},media:{audioDecodeStatus:l,audioEncodeStatus:p}}=s;if(t)return Promise.reject({type:zs,reason:"Computer audio has been loading, please wait."});if(a&&n(ac(a)),!u)return Promise.reject({type:zs,reason:"Please call `startAudio` method after the `join` has been resolved"});{const{userRole:t}=u,s=Ca(t),h=s&&!e||a||Id()?"success":p,f=Id()?"success":l;if(Bp()&&("success"!==f||"success"!==h))return Promise.reject({type:zs,reason:"It is required to wait for the audio encoding and decoding to be ready before calling `startAudio` method"});n(sc(!0)),Ed("audio",h,f).subscribe(t=>{let[u,l]=t;if(u&&l){let t=d||Bp()&&!c?Promise.resolve():function(){const e=URL.createObjectURL(gs),t=new Audio(e);return t.muted=!1,yi()?new Promise((r,n)=>{var o;t.addEventListener("canplaythrough",()=>{t.play().then(()=>{r(!0)}).catch(e=>{n(e)}).finally(()=>{URL.revokeObjectURL(e)})}),null===(o=t.load)||void 0===o||o.call(t)}):t.play().finally(()=>{URL.revokeObjectURL(e)})}();void 0===t&&(t=Promise.resolve()),t.then(()=>{const t=r(),{audio:{isSharingAudio:c}}=t;o.joinOrLeaveVoip(!0),c||jp(i,t,!(s&&!e||a)),s&&e&&n(cc(!0)),n(oc(!0))}).catch(()=>{n(oc(!1))})}})}return"failed"===p||"failed"===l?(n(sc(!1)),Promise.reject({type:"INTERNAL_ERROR",reason:"audio encode or decode error"})):new Promise((e,t)=>{it(ia(Gs.JoinComputerAudio.success,1),$e(...Gs.JoinComputerAudio.fail.map(e=>ia(e,1).pipe(Fe(()=>ce({type:"INSUFFICIENT_PRIVILEGES",reason:e}))))),ct(45e3).pipe(Fe(()=>ce({type:"OPERATION_TIMEOUT"})))).subscribe(()=>{n(sc(!1)),e("")},e=>{d&&o.joinOrLeaveVoip(!1),n(sc(!1)),t(e)})})}})(this[Rh],e)}stopAudio(){return(async e=>{const{store:{getState:t,dispatch:r},mediaAgent:n,rwgAgent:o}=e,i=t(),{audio:{isComputerAudioLoading:s,isShareAudioEnabled:a,isSharingAudio:c}}=i,u=Pa(i);if(s)return Promise.reject({type:zs,reason:"Computer audio has not finished joining, please wait."});if(a){if(c)return Promise.reject({type:zs,reason:"Cannot stop audio during sharing with audio"});r(pc(void 0)),r(uc(void 0))}return"computer"===(null==u?void 0:u.audio)?(await n.leaveComputerAudio(),o.joinOrLeaveVoip(!1),r($a(0)),oa("AUDIO_CURRENT_USER_LEAVE_AUDIO")):Promise.resolve("")})(this[Rh])}muteAudio(e){return((e,t)=>{const{store:{getState:r,dispatch:n},rwgAgent:o}=e,i=r(),s=Pa(i);if(null==t||t===(null==s?void 0:s.userId))return""===(null==s?void 0:s.audio)||null===(null==s?void 0:s.audio)?Promise.reject({type:zs,reason:"no audio joined"}):!0===(null==s?void 0:s.muted)?Promise.resolve(""):(i.audio.isShareAudioEnabled&&n(uc(!0)),n(Ja(!0)),o.mute(s.userId,!0),oa("AUDIO_CURRENT_USER_MUTED").then(()=>""));if(Ma(i)){const{participants:{allowTalkAttendeesList:e,attendeesList:r}}=i,n=e.concat(r).find(e=>e.userId===t);return n?""===n.audio||null===n?Promise.reject({type:zs,reason:"no audio joined"}):!1===n.muted?(o.mute(t,!0),oa("AUDIO_PARTICIPANT_AUDIO_UPDATE",e=>e.id===t&&1==e.muted)):Promise.resolve(""):Promise.reject({type:Js,reason:"no matching user"})}return Promise.reject({type:"INSUFFICIENT_PRIVILEGES"})})(this[Rh],e)}unmuteAudio(e){return(async(e,t)=>{const{store:{getState:r,dispatch:n},rwgAgent:o,mediaAgent:i}=e,s=r(),a=Pa(s);if(void 0===t||t===(null==a?void 0:a.userId)){if(""===(null==a?void 0:a.audio)||null===(null==a?void 0:a.audio))return Promise.reject({type:zs,reason:"no audio joined"});if(!1===(null==a?void 0:a.muted))return Promise.resolve("");if(s.audio.isShareAudioEnabled){if(s.audio.isSharingAudio)return Promise.reject({type:zs,reason:"Cannot unmute audio during sharing with audio"});n(uc(!1))}if(n(Ja(!0)),s.audio.bCanUnmute||null!=a&&a.isHost||null!=a&&a.bCoHost){if(Ca(a.userRole)){const{audio:{isAllowToTalk:e,isAllowToTalkAttendeeConnected:t}}=s;e?t||(await i.leaveComputerAudio(),await jp(i,s,!0),n(cc(!0))):Promise.reject({type:zs,reason:"Webinar attendee cannot unmute self audio."})}return o.mute(a.userId,!1),oa("AUDIO_CURRENT_USER_UNMUTED").then(()=>"")}return Promise.reject({type:"INSUFFICIENT_PRIVILEGES",reason:"host not allow unmute themselves"})}if(Ma(s)){const{participants:{allowTalkAttendeesList:e,attendeesList:r}}=s,n=e.concat(r).find(e=>e.userId===t);return n?""===n.audio||null===n?Promise.reject({type:zs,reason:"no audio joined"}):(!0===n.muted&&o.mute(t,!1),Promise.resolve("")):Promise.reject({type:Js,reason:"no matching user"})}return Promise.reject({type:"INSUFFICIENT_PRIVILEGES"})})(this[Rh],e)}dialOut(e,t,r,n){return((e,t,r,n,o)=>{const{store:{getState:i,dispatch:s},rwgAgent:a}=e,c=i(),{meeting:{callOutCountry:u,isSupportCallOut:d}}=c;if(d&&Array.isArray(u)&&u.findIndex(e=>e.code===t)>-1){const{seq:e}=a.audioDialout(t+r,n,!(null==o||!o.callMe),!(null==o||!o.pressingOne),!(null==o||!o.greeting));return s(Wa(e)),na(Gs.JoinAudioByCallMe)}return Promise.reject({type:Js,reason:"no matching country code"})})(this[Rh],e,t,r,n)}cancelDialOut(e,t,r){return((e,t,r,n)=>{const{rwgAgent:o}=e;return o.audioCancelDialout(t+r,!(null==n||!n.callMe)),na(Gs.cancelDialOut)})(this[Rh],e,t,r)}hangup(){return(e=>{const{store:{getState:t},rwgAgent:r}=e,n=t(),o=Pa(n);return"phone"===(null==o?void 0:o.audio)&&null!==o.userId?(r.audioDrop(o.userId),na(Gs.hangup)):Promise.reject({type:zs,reason:"not joined audio by phone"})})(this[Rh])}switchMicrophone(e){return((e,t)=>{const{store:{getState:r,dispatch:n},mediaAgent:o}=e,{audio:{microphoneDevicesList:i,activeMicrophone:s}}=r();return"default"!==t&&-1==i.findIndex(e=>e.deviceId===t)?Promise.reject({type:"INVALID_DEVICE_ID"}):(t!==s&&(o.changeMicrophone(t),n(rc(t))),Promise.resolve(""))})(this[Rh],e)}switchSpeaker(e){return((e,t)=>{const{store:{getState:r,dispatch:n},mediaAgent:o}=e,{audio:{speakerDevicesList:i,activeSpeaker:s}}=r();return"default"!==t&&-1==i.findIndex(e=>e.deviceId===t)?Promise.reject({type:"INVALID_DEVICE_ID"}):(t!==s&&(o.changeSpeaker(t),n(nc(t))),Promise.resolve(""))})(this[Rh],e)}muteShareAudio(e){return((e,t)=>{const{mediaAgent:r,rwgAgent:n,store:{getState:o,dispatch:i}}=e,s=o(),{meeting:{userId:a}}=s;if(t&&t!==a)return Cf(t,!0,e.store,r);{const{audio:{isSharingAudio:e,isShareAudioEnabled:t,isShareAudioMuted:o}}=s;return t?o?Promise.resolve(""):(n.muteShareAudio(!0),e&&(null===(c=r.leaveSharingAudio(!0))||void 0===c||c.then(()=>{Hp(r,n,s).then(e=>{e.forEach(e=>i(e))})})),Vp(r,a,!0,s),oa("UPDATE_CURRENT_USER_PARTICIPANT_ATTRIBUTE",e=>!1===e.bShareAudioOn).then(()=>(i(fc(!0)),e&&(i(vc(!1)),ra("SHARE_AUDIO_STATE_CHANGE",{state:"off"})),""))):Promise.reject({type:zs,reason:"Cannot mute sharing audio when sharing audio is not enable"});var c}})(this[Rh],e)}unmuteShareAudio(e){return((e,t)=>{const{mediaAgent:r,rwgAgent:n,store:{getState:o,dispatch:i}}=e,s=o(),{meeting:{userId:a}}=s;if(t&&t!==a)return Cf(t,!1,e.store,r);{const{audio:{isSharingAudio:e,isShareAudioEnabled:t,isShareAudioMuted:o},share:{status:c}}=s;return t?!1===o?Promise.resolve(""):(n.muteShareAudio(!1),!1===e&&c===bs.Sharing&&Fp(r,n,s).then(e=>{e.forEach(e=>i(e))}),Vp(r,a,!1,s),oa("UPDATE_CURRENT_USER_PARTICIPANT_ATTRIBUTE",e=>!0===e.bShareAudioOn).then(()=>(i(fc(!1)),!1===e&&c===bs.Sharing&&(i(vc(!0)),ra("SHARE_AUDIO_STATE_CHANGE",{state:"on"})),""))):Promise.reject({type:zs,reason:"Cannot unmute sharing audio when sharing audio is not enable"})}})(this[Rh],e)}getMicList(){return(e=>{let{store:{getState:t}}=e;const r=t();return r.audio?[...r.audio.microphoneDevicesList]:[]})(this[Rh])}getSpeakerList(){return(e=>{let{store:{getState:t}}=e;const r=t();return r.audio?[...r.audio.speakerDevicesList]:[]})(this[Rh])}isAudioMuted(e){return((e,t)=>{let{store:{getState:r}}=e;const n=r(),{meeting:{isWebinar:o}}=n;let i=null;return void 0===t?i=Pa(n):(i=n.participants.attendeesList.find(e=>e.userId===t),o&&!i&&(i=n.participants.xmppAttendeeList.find(e=>e.userId===t))),!!i&&!!i.muted})(this[Rh],e)}getActiveMicrophone(){return(e=>{let{store:{getState:t}}=e;const r=t();return r.audio?r.audio.activeMicrophone:null})(this[Rh])}getActiveSpeaker(){return(e=>{let{store:{getState:t}}=e;const r=t();return r.audio?r.audio.activeSpeaker:null})(this[Rh])}isSupportCallOut(){return(e=>{let{store:{getState:t}}=e;const{meeting:{isSupportCallOut:r,callOutCountry:n}}=t();return r&&Array.isArray(n)&&(null==n?void 0:n.length)>0})(this[Rh])}getDialOutStatus(){return(e=>{let{store:{getState:t}}=e;const{audio:r}=t();return null==r?void 0:r.dialout.returnCode})(this[Rh])}getDialOutCountries(){return(e=>{let{store:{getState:t}}=e;const{meeting:{callOutCountry:r}}=t();return Array.isArray(r)?r:[]})(this[Rh])}getShareAudioStatus(){return(e=>{let{store:{getState:t}}=e;const{audio:{isShareAudioEnabled:r,isShareAudioMuted:n,isSharingAudio:o}}=t();return{isShareAudioEnabled:r,isShareAudioMuted:n,isSharingAudio:o}})(this[Rh])}isOthersShareAudioMutedLocally(e){return((e,t)=>{var r;let{store:{getState:n}}=e;const{audio:{localShareAudioUserMutedList:o}}=n();return null===(r=o.find(e=>e.userId===t))||void 0===r?void 0:r.muted})(this[Rh],e)}startVideo(e){return((e,t)=>{const{store:{getState:r,dispatch:n},mediaAgent:o}=e,i=r(),{media:{videoDecodeStatus:s,videoEncodeStatus:a},video:{isCaptureCameraLoading:u,isCurrentUserStartedVideo:d,isVideoMuted:l}}=i;return d?Promise.reject({type:zs,reason:"Video is started"}):u?Promise.reject({type:zs,reason:"Camera is starting,please wait."}):l&&!Ma(i)?Promise.reject({type:zs,reason:"Video is muted by the host"}):!(!Of()&&Ai()||Ci())||null!=t&&t.videoElement?!Od()&&null!=t&&t.virtualBackground?Promise.reject({type:Js,reason:"Cannot start video with virtual background due to the restriction of platform"}):(n(qc(!0)),Ed("video",a,s).subscribe(e=>{let[i]=e;if(i){const e=r(),{video:{activeCamera:i,isSupportHDVideo:s,videoSsrc:a,virtualBackground:{isVBConfigured:u,isVBPreloadReady:d,imageSrc:l}}}=e,{cameraId:p=i,captureWidth:h=0,captureHeight:f=0,videoElement:v,mirrored:_,hd:m,virtualBackground:y}=t||{};_&&o.mirrorVideo(_);let g=void 0;if(v&&(v.id?g=v.id:(g="__ZOOM_SDK_SELF_VIDEO_@__".replace("@","".concat(Math.floor(1e4*Math.random()))),v.id=g)),m&&(console.log("HD support is currently limited, and comes with a number of restrictions and limitations. Please visit https://marketplace.zoom.us/docs/sdk/overview/720p for more details"),s&&ts.isCompatibleHardwareForEncode()?ts.isSupportVideoEncodeHardwareAcceleration().then(e=>{e?(o.enableHardwareAccelerationForVideoEncode(!0),n(pu({encode:e}))):console.warn("Cannot capture HD video due to hardware limitation")}):console.warn("Cannot capture HD video due to either account restriction and/or hardware limitation")),y||void 0===y&&l){const t=y||{imageUrl:void 0,cropped:void 0};(function(e){return void 0!==e?Ve(Promise.resolve(e)):ia("VIDEO_VIRTUAL_BACKGROUND_PRELOAD_READY",1).pipe(Oe(e=>e))})(d).subscribe(r=>{if(r){let r=void 0;r=u?t.imageUrl!==l?async function(e,t,r){if(e){const n=await oh(e,t);n&&(r.updateVirtualBackgroundImage(n),"blur"!==n&&setTimeout(()=>{var e;const t=document.getElementById(n);null==t||null===(e=t.parentNode)||void 0===e||e.removeChild(t)},0))}else r.updateVirtualBackgroundImage(null)}(t.imageUrl,t.cropped,o):Promise.resolve():async function(e,t,r,n){const o=(n,document.body),{imageUrl:i,cropped:s,captureHeight:a,captureWidth:c,cameraId:u}=e,d=document.createElement("div");d.style.display="none";let l=void 0;l=i?await oh(i,s,d):null;const p=Math.floor(100*Math.random());let h="".concat("__ZOOM_SDK_VIRTUAL_BACKGROUND_CANVAS_@__").concat(p);{const e=document.createElement("canvas");e.width=380,e.height=214,e.id=h,d.appendChild(e)}null==o||o.appendChild(d);const{video:{videoSsrc:f}}=r;return t.startVirtualBackgroundSetting(h,l,f,u,c,a),d}(c(c({},t),{},{captureWidth:h,captureHeight:f,cameraId:p}),o,e).then(e=>ia("VIDEO_VIRTUAL_BACKGROUND_SETTING_SUCCESS",1).toPromise().then(t=>{var r;return o.stopVirtualBackgroundSetting(),t?(null==e||null===(r=e.parentNode)||void 0===r||r.removeChild(e),!0):Promise.reject("vb setting error")})),r.then(()=>{n(uu({imageSrc:t.imageUrl,cropped:t.cropped})),i!==p&&n(Hc(p)),o.startCaptureVideo(a,p,h,f,g)}).catch(()=>{ra("VIDEO_VITRUAL_BACKGROUND_FAILED",{reason:"Cannot set virtual background image."})})}else ra("VIDEO_VITRUAL_BACKGROUND_FAILED",{reason:"Cannot load virtual background model."})})}else o.startCaptureVideo(a,p,h,f,g),i!==p&&n(Hc(p))}else n(qc(!1))}),na(Hs).then(()=>{n(zc(!1)),n(Bc(!1))}).finally(()=>{n(qc(!1))})):Promise.reject({type:Js,reason:"You must pass a