@vinay.kumar.ha/videosdk-ui-toolkit 2.3.5-1.5 → 2.3.5-1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/annoter.min.js +3 -0
- package/dist/lib/audio.encode.wasm +0 -0
- package/dist/lib/audio.light.simd.wasm +0 -0
- package/dist/lib/audio.simd.wasm +0 -0
- package/dist/lib/audio_light_simd.min.js +2 -0
- package/dist/lib/audio_simd.min.js +2 -0
- package/dist/lib/graphics.min.js +2 -0
- package/dist/lib/js_audio_level_worklet_process.min.js +2 -0
- package/dist/lib/js_audio_level_worklet_process_light.min.js +2 -0
- package/dist/lib/js_audio_process.min.js +2 -0
- package/dist/lib/js_audio_processor_worklet.min.js +2 -0
- package/dist/lib/js_audio_worklet.min.js +2 -0
- package/dist/lib/js_audio_worklet_light_simd.min.js +2 -0
- package/dist/lib/js_audio_worklet_process.min.js +2 -0
- package/dist/lib/js_audio_worklet_simd.min.js +2 -0
- package/dist/lib/js_media.min.js +3 -0
- package/dist/lib/js_sharing_audio_worklet.min.js +2 -0
- package/dist/lib/manifest.json +338 -0
- package/dist/lib/mesh_thread.min.js +2 -0
- package/dist/lib/net.wasm +0 -0
- package/dist/lib/net_thread.min.js +2 -0
- package/dist/lib/pako.min.js +2 -0
- package/dist/lib/qrscanner.min.js +2 -0
- package/dist/lib/share_processor.min.js +2 -0
- package/dist/lib/sharing_m.min.js +3 -0
- package/dist/lib/sharing_mtsimd.min.js +3 -0
- package/dist/lib/sharing_s.min.js +2 -0
- package/dist/lib/sharing_simd.min.js +2 -0
- package/dist/lib/tp.min.js +2 -0
- package/dist/lib/tp.wasm +0 -0
- package/dist/lib/vb-resource/dualModel.bin +0 -0
- package/dist/lib/vb-resource/tf.min.js +18 -0
- package/dist/lib/vb.min.js +2 -0
- package/dist/lib/vb_worker.min.js +2 -0
- package/dist/lib/video.decode.js +1 -0
- package/dist/lib/video.decode.wasm +0 -0
- package/dist/lib/video.mt.js +1 -0
- package/dist/lib/video.mt.wasm +0 -0
- package/dist/lib/video.mtsimd.js +1 -0
- package/dist/lib/video.mtsimd.wasm +0 -0
- package/dist/lib/video.simd.js +1 -0
- package/dist/lib/video.simd.wasm +0 -0
- package/dist/lib/video_m.min.js +3 -0
- package/dist/lib/video_mtsimd.min.js +3 -0
- package/dist/lib/video_processor.min.js +2 -0
- package/dist/lib/video_s.min.js +2 -0
- package/dist/lib/video_share_mtsimd.min.js +3 -0
- package/dist/lib/video_simd.min.js +2 -0
- package/dist/lib/wasm_ssrc_stream_service_dynmod.min.js +2 -0
- package/dist/lib/webgpu_renderer_dynmod.min.js +2 -0
- package/dist/lib/wmsc.min.js +2 -0
- package/dist/videosdk-ui-toolkit.min.esm.js +1832 -1832
- package/dist/videosdk-ui-toolkit.min.umd.js +82 -82
- package/package.json +1 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
(()=>{var e={1668:(e,t,r)=>{"use strict";const{Deflate:a,deflate:i,deflateRaw:n,gzip:o}=r(3303),{Inflate:s,inflate:d,inflateRaw:l,ungzip:c}=r(7083),u=r(9681);e.exports.Deflate=a,e.exports.deflate=i,e.exports.deflateRaw=n,e.exports.gzip=o,e.exports.Inflate=s,e.exports.inflate=d,e.exports.inflateRaw=l,e.exports.ungzip=c,e.exports.constants=u},3303:(e,t,r)=>{"use strict";const a=r(8411),i=r(9805),n=r(1996),o=r(4674),s=r(4442),d=Object.prototype.toString,{Z_NO_FLUSH:l,Z_SYNC_FLUSH:c,Z_FULL_FLUSH:u,Z_FINISH:h,Z_OK:_,Z_STREAM_END:p,Z_DEFAULT_COMPRESSION:f,Z_DEFAULT_STRATEGY:m,Z_DEFLATED:g}=r(9681);function v(e){this.options=i.assign({level:f,method:g,chunkSize:16384,windowBits:15,memLevel:8,strategy:m},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;let r=a.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==_)throw new Error(o[r]);if(t.header&&a.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?n.string2buf(t.dictionary):"[object ArrayBuffer]"===d.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,r=a.deflateSetDictionary(this.strm,e),r!==_)throw new Error(o[r]);this._dict_set=!0}}function y(e,t){const r=new v(t);if(r.push(e,!0),r.err)throw r.msg||o[r.err];return r.result}v.prototype.push=function(e,t){const r=this.strm,i=this.options.chunkSize;let o,s;if(this.ended)return!1;for(s=t===~~t?t:!0===t?h:l,"string"==typeof e?r.input=n.string2buf(e):"[object ArrayBuffer]"===d.call(e)?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(s===c||s===u)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(o=a.deflate(r,s),o===p)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),o=a.deflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===_;if(0!==r.avail_out){if(s>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},v.prototype.onData=function(e){this.chunks.push(e)},v.prototype.onEnd=function(e){e===_&&(this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},e.exports.Deflate=v,e.exports.deflate=y,e.exports.deflateRaw=function(e,t){return(t=t||{}).raw=!0,y(e,t)},e.exports.gzip=function(e,t){return(t=t||{}).gzip=!0,y(e,t)},e.exports.constants=r(9681)},7083:(e,t,r)=>{"use strict";const a=r(1447),i=r(9805),n=r(1996),o=r(4674),s=r(4442),d=r(7414),l=Object.prototype.toString,{Z_NO_FLUSH:c,Z_FINISH:u,Z_OK:h,Z_STREAM_END:_,Z_NEED_DICT:p,Z_STREAM_ERROR:f,Z_DATA_ERROR:m,Z_MEM_ERROR:g}=r(9681);function v(e){this.options=i.assign({chunkSize:65536,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(15&t.windowBits||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;let r=a.inflateInit2(this.strm,t.windowBits);if(r!==h)throw new Error(o[r]);if(this.header=new d,a.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=n.string2buf(t.dictionary):"[object ArrayBuffer]"===l.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=a.inflateSetDictionary(this.strm,t.dictionary),r!==h)))throw new Error(o[r])}function y(e,t){const r=new v(t);if(r.push(e),r.err)throw r.msg||o[r.err];return r.result}v.prototype.push=function(e,t){const r=this.strm,i=this.options.chunkSize,o=this.options.dictionary;let s,d,v;if(this.ended)return!1;for(d=t===~~t?t:!0===t?u:c,"[object ArrayBuffer]"===l.call(e)?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;){for(0===r.avail_out&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),s=a.inflate(r,d),s===p&&o&&(s=a.inflateSetDictionary(r,o),s===h?s=a.inflate(r,d):s===m&&(s=p));r.avail_in>0&&s===_&&r.state.wrap>0&&0!==e[r.next_in];)a.inflateReset(r),s=a.inflate(r,d);switch(s){case f:case m:case p:case g:return this.onEnd(s),this.ended=!0,!1}if(v=r.avail_out,r.next_out&&(0===r.avail_out||s===_))if("string"===this.options.to){let e=n.utf8border(r.output,r.next_out),t=r.next_out-e,a=n.buf2string(r.output,e);r.next_out=t,r.avail_out=i-t,t&&r.output.set(r.output.subarray(e,e+t),0),this.onData(a)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(s!==h||0!==v){if(s===_)return s=a.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(0===r.avail_in)break}}return!0},v.prototype.onData=function(e){this.chunks.push(e)},v.prototype.onEnd=function(e){e===h&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},e.exports.Inflate=v,e.exports.inflate=y,e.exports.inflateRaw=function(e,t){return(t=t||{}).raw=!0,y(e,t)},e.exports.ungzip=y,e.exports.constants=r(9681)},9805:e=>{"use strict";const t=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);e.exports.assign=function(e){const r=Array.prototype.slice.call(arguments,1);for(;r.length;){const a=r.shift();if(a){if("object"!=typeof a)throw new TypeError(a+"must be non-object");for(const r in a)t(a,r)&&(e[r]=a[r])}}return e},e.exports.flattenChunks=e=>{let t=0;for(let r=0,a=e.length;r<a;r++)t+=e[r].length;const r=new Uint8Array(t);for(let t=0,a=0,i=e.length;t<i;t++){let i=e[t];r.set(i,a),a+=i.length}return r}},1996:e=>{"use strict";let t=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){t=!1}const r=new Uint8Array(256);for(let e=0;e<256;e++)r[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;r[254]=r[254]=1,e.exports.string2buf=e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,r,a,i,n,o=e.length,s=0;for(i=0;i<o;i++)r=e.charCodeAt(i),55296==(64512&r)&&i+1<o&&(a=e.charCodeAt(i+1),56320==(64512&a)&&(r=65536+(r-55296<<10)+(a-56320),i++)),s+=r<128?1:r<2048?2:r<65536?3:4;for(t=new Uint8Array(s),n=0,i=0;n<s;i++)r=e.charCodeAt(i),55296==(64512&r)&&i+1<o&&(a=e.charCodeAt(i+1),56320==(64512&a)&&(r=65536+(r-55296<<10)+(a-56320),i++)),r<128?t[n++]=r:r<2048?(t[n++]=192|r>>>6,t[n++]=128|63&r):r<65536?(t[n++]=224|r>>>12,t[n++]=128|r>>>6&63,t[n++]=128|63&r):(t[n++]=240|r>>>18,t[n++]=128|r>>>12&63,t[n++]=128|r>>>6&63,t[n++]=128|63&r);return t},e.exports.buf2string=(e,a)=>{const i=a||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,a));let n,o;const s=new Array(2*i);for(o=0,n=0;n<i;){let t=e[n++];if(t<128){s[o++]=t;continue}let a=r[t];if(a>4)s[o++]=65533,n+=a-1;else{for(t&=2===a?31:3===a?15:7;a>1&&n<i;)t=t<<6|63&e[n++],a--;a>1?s[o++]=65533:t<65536?s[o++]=t:(t-=65536,s[o++]=55296|t>>10&1023,s[o++]=56320|1023&t)}}return((e,r)=>{if(r<65534&&e.subarray&&t)return String.fromCharCode.apply(null,e.length===r?e:e.subarray(0,r));let a="";for(let t=0;t<r;t++)a+=String.fromCharCode(e[t]);return a})(s,o)},e.exports.utf8border=(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);let a=t-1;for(;a>=0&&128==(192&e[a]);)a--;return a<0||0===a?t:a+r[e[a]]>t?a:t}},3269:e=>{"use strict";e.exports=(e,t,r,a)=>{let i=65535&e,n=e>>>16&65535,o=0;for(;0!==r;){o=r>2e3?2e3:r,r-=o;do{i=i+t[a++]|0,n=n+i|0}while(--o);i%=65521,n%=65521}return i|n<<16}},9681:e=>{"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},4823:e=>{"use strict";const t=new Uint32Array((()=>{let e,t=[];for(var r=0;r<256;r++){e=r;for(var a=0;a<8;a++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t})());e.exports=(e,r,a,i)=>{const n=t,o=i+a;e^=-1;for(let t=i;t<o;t++)e=e>>>8^n[255&(e^r[t])];return~e}},8411:(e,t,r)=>{"use strict";const{_tr_init:a,_tr_stored_block:i,_tr_flush_block:n,_tr_tally:o,_tr_align:s}=r(3665),d=r(3269),l=r(4823),c=r(4674),{Z_NO_FLUSH:u,Z_PARTIAL_FLUSH:h,Z_FULL_FLUSH:_,Z_FINISH:p,Z_BLOCK:f,Z_OK:m,Z_STREAM_END:g,Z_STREAM_ERROR:v,Z_DATA_ERROR:y,Z_BUF_ERROR:b,Z_DEFAULT_COMPRESSION:w,Z_FILTERED:S,Z_HUFFMAN_ONLY:M,Z_RLE:E,Z_FIXED:R,Z_DEFAULT_STRATEGY:T,Z_UNKNOWN:k,Z_DEFLATED:x}=r(9681),A=258,C=262,F=42,P=113,I=666,O=(e,t)=>(e.msg=c[t],t),D=e=>2*e-(e>4?9:0),L=e=>{let t=e.length;for(;--t>=0;)e[t]=0},W=e=>{let t,r,a,i=e.w_size;t=e.hash_size,a=t;do{r=e.head[--a],e.head[a]=r>=i?r-i:0}while(--t);t=i,a=t;do{r=e.prev[--a],e.prev[a]=r>=i?r-i:0}while(--t)};let N=(e,t,r)=>(t<<e.hash_shift^r)&e.hash_mask;const U=e=>{const t=e.state;let r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+r),e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))},B=(e,t)=>{n(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,U(e.strm)},V=(e,t)=>{e.pending_buf[e.pending++]=t},G=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},H=(e,t,r,a)=>{let i=e.avail_in;return i>a&&(i=a),0===i?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),r),1===e.state.wrap?e.adler=d(e.adler,t,i,r):2===e.state.wrap&&(e.adler=l(e.adler,t,i,r)),e.next_in+=i,e.total_in+=i,i)},j=(e,t)=>{let r,a,i=e.max_chain_length,n=e.strstart,o=e.prev_length,s=e.nice_match;const d=e.strstart>e.w_size-C?e.strstart-(e.w_size-C):0,l=e.window,c=e.w_mask,u=e.prev,h=e.strstart+A;let _=l[n+o-1],p=l[n+o];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(r=t,l[r+o]===p&&l[r+o-1]===_&&l[r]===l[n]&&l[++r]===l[n+1]){n+=2,r++;do{}while(l[++n]===l[++r]&&l[++n]===l[++r]&&l[++n]===l[++r]&&l[++n]===l[++r]&&l[++n]===l[++r]&&l[++n]===l[++r]&&l[++n]===l[++r]&&l[++n]===l[++r]&&n<h);if(a=A-(h-n),n=h-A,a>o){if(e.match_start=t,o=a,a>=s)break;_=l[n+o-1],p=l[n+o]}}}while((t=u[t&c])>d&&0!=--i);return o<=e.lookahead?o:e.lookahead},z=e=>{const t=e.w_size;let r,a,i;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-C)&&(e.window.set(e.window.subarray(t,t+t-a),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),W(e),a+=t),0===e.strm.avail_in)break;if(r=H(e.strm,e.window,e.strstart+e.lookahead,a),e.lookahead+=r,e.lookahead+e.insert>=3)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=N(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=N(e,e.ins_h,e.window[i+3-1]),e.prev[i&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=i,i++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<C&&0!==e.strm.avail_in)},$=(e,t)=>{let r,a,n,o=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,s=0,d=e.strm.avail_in;do{if(r=65535,n=e.bi_valid+42>>3,e.strm.avail_out<n)break;if(n=e.strm.avail_out-n,a=e.strstart-e.block_start,r>a+e.strm.avail_in&&(r=a+e.strm.avail_in),r>n&&(r=n),r<o&&(0===r&&t!==p||t===u||r!==a+e.strm.avail_in))break;s=t===p&&r===a+e.strm.avail_in?1:0,i(e,0,0,s),e.pending_buf[e.pending-4]=r,e.pending_buf[e.pending-3]=r>>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,U(e.strm),a&&(a>r&&(a=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+a),e.strm.next_out),e.strm.next_out+=a,e.strm.avail_out-=a,e.strm.total_out+=a,e.block_start+=a,r-=a),r&&(H(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r)}while(0===s);return d-=e.strm.avail_in,d&&(d>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=d&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-d,e.strm.next_in),e.strstart),e.strstart+=d,e.insert+=d>e.w_size-e.insert?e.w_size-e.insert:d),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),s?4:t!==u&&t!==p&&0===e.strm.avail_in&&e.strstart===e.block_start?2:(n=e.window_size-e.strstart,e.strm.avail_in>n&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,n+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),n>e.strm.avail_in&&(n=e.strm.avail_in),n&&(H(e.strm,e.window,e.strstart,n),e.strstart+=n,e.insert+=n>e.w_size-e.insert?e.w_size-e.insert:n),e.high_water<e.strstart&&(e.high_water=e.strstart),n=e.bi_valid+42>>3,n=e.pending_buf_size-n>65535?65535:e.pending_buf_size-n,o=n>e.w_size?e.w_size:n,a=e.strstart-e.block_start,(a>=o||(a||t===p)&&t!==u&&0===e.strm.avail_in&&a<=n)&&(r=a>n?n:a,s=t===p&&0===e.strm.avail_in&&r===a?1:0,i(e,e.block_start,r,s),e.block_start+=r,U(e.strm)),s?3:1)},q=(e,t)=>{let r,a;for(;;){if(e.lookahead<C){if(z(e),e.lookahead<C&&t===u)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=N(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-C&&(e.match_length=j(e,r)),e.match_length>=3)if(a=o(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=N(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=N(e,e.ins_h,e.window[e.strstart+1]);else a=o(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(a&&(B(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===p?(B(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(B(e,!1),0===e.strm.avail_out)?1:2},Y=(e,t)=>{let r,a,i;for(;;){if(e.lookahead<C){if(z(e),e.lookahead<C&&t===u)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=N(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-C&&(e.match_length=j(e,r),e.match_length<=5&&(e.strategy===S||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,a=o(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=N(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,a&&(B(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(a=o(e,0,e.window[e.strstart-1]),a&&B(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(a=o(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===p?(B(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(B(e,!1),0===e.strm.avail_out)?1:2};function Q(e,t,r,a,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=a,this.func=i}const K=[new Q(0,0,0,0,$),new Q(4,4,8,4,q),new Q(4,5,16,8,q),new Q(4,6,32,32,q),new Q(4,4,16,16,Y),new Q(8,16,32,32,Y),new Q(8,16,128,128,Y),new Q(8,32,128,256,Y),new Q(32,128,258,1024,Y),new Q(32,258,258,4096,Y)];function X(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=x,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),L(this.dyn_ltree),L(this.dyn_dtree),L(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),L(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),L(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Z=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==F&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&t.status!==P&&t.status!==I?1:0},J=e=>{if(Z(e))return O(e,v);e.total_in=e.total_out=0,e.data_type=k;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=2===t.wrap?57:t.wrap?F:P,e.adler=2===t.wrap?0:1,t.last_flush=-2,a(t),m},ee=e=>{const t=J(e);var r;return t===m&&((r=e.state).window_size=2*r.w_size,L(r.head),r.max_lazy_match=K[r.level].max_lazy,r.good_match=K[r.level].good_length,r.nice_match=K[r.level].nice_length,r.max_chain_length=K[r.level].max_chain,r.strstart=0,r.block_start=0,r.lookahead=0,r.insert=0,r.match_length=r.prev_length=2,r.match_available=0,r.ins_h=0),t},te=(e,t,r,a,i,n)=>{if(!e)return v;let o=1;if(t===w&&(t=6),a<0?(o=0,a=-a):a>15&&(o=2,a-=16),i<1||i>9||r!==x||a<8||a>15||t<0||t>9||n<0||n>R||8===a&&1!==o)return O(e,v);8===a&&(a=9);const s=new X;return e.state=s,s.strm=e,s.status=F,s.wrap=o,s.gzhead=null,s.w_bits=a,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+3-1)/3),s.window=new Uint8Array(2*s.w_size),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=4*s.lit_bufsize,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=3*(s.lit_bufsize-1),s.level=t,s.strategy=n,s.method=r,ee(e)};e.exports.deflateInit=(e,t)=>te(e,t,x,15,8,T),e.exports.deflateInit2=te,e.exports.deflateReset=ee,e.exports.deflateResetKeep=J,e.exports.deflateSetHeader=(e,t)=>Z(e)||2!==e.state.wrap?v:(e.state.gzhead=t,m),e.exports.deflate=(e,t)=>{if(Z(e)||t>f||t<0)return e?O(e,v):v;const r=e.state;if(!e.output||0!==e.avail_in&&!e.input||r.status===I&&t!==p)return O(e,0===e.avail_out?b:v);const a=r.last_flush;if(r.last_flush=t,0!==r.pending){if(U(e),0===e.avail_out)return r.last_flush=-1,m}else if(0===e.avail_in&&D(t)<=D(a)&&t!==p)return O(e,b);if(r.status===I&&0!==e.avail_in)return O(e,b);if(r.status===F&&0===r.wrap&&(r.status=P),r.status===F){let t=x+(r.w_bits-8<<4)<<8,a=-1;if(a=r.strategy>=M||r.level<2?0:r.level<6?1:6===r.level?2:3,t|=a<<6,0!==r.strstart&&(t|=32),t+=31-t%31,G(r,t),0!==r.strstart&&(G(r,e.adler>>>16),G(r,65535&e.adler)),e.adler=1,r.status=P,U(e),0!==r.pending)return r.last_flush=-1,m}if(57===r.status)if(e.adler=0,V(r,31),V(r,139),V(r,8),r.gzhead)V(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),V(r,255&r.gzhead.time),V(r,r.gzhead.time>>8&255),V(r,r.gzhead.time>>16&255),V(r,r.gzhead.time>>24&255),V(r,9===r.level?2:r.strategy>=M||r.level<2?4:0),V(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(V(r,255&r.gzhead.extra.length),V(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=l(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69;else if(V(r,0),V(r,0),V(r,0),V(r,0),V(r,0),V(r,9===r.level?2:r.strategy>=M||r.level<2?4:0),V(r,3),r.status=P,U(e),0!==r.pending)return r.last_flush=-1,m;if(69===r.status){if(r.gzhead.extra){let t=r.pending,a=(65535&r.gzhead.extra.length)-r.gzindex;for(;r.pending+a>r.pending_buf_size;){let i=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+i),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>t&&(e.adler=l(e.adler,r.pending_buf,r.pending-t,t)),r.gzindex+=i,U(e),0!==r.pending)return r.last_flush=-1,m;t=0,a-=i}let i=new Uint8Array(r.gzhead.extra);r.pending_buf.set(i.subarray(r.gzindex,r.gzindex+a),r.pending),r.pending+=a,r.gzhead.hcrc&&r.pending>t&&(e.adler=l(e.adler,r.pending_buf,r.pending-t,t)),r.gzindex=0}r.status=73}if(73===r.status){if(r.gzhead.name){let t,a=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>a&&(e.adler=l(e.adler,r.pending_buf,r.pending-a,a)),U(e),0!==r.pending)return r.last_flush=-1,m;a=0}t=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,V(r,t)}while(0!==t);r.gzhead.hcrc&&r.pending>a&&(e.adler=l(e.adler,r.pending_buf,r.pending-a,a)),r.gzindex=0}r.status=91}if(91===r.status){if(r.gzhead.comment){let t,a=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>a&&(e.adler=l(e.adler,r.pending_buf,r.pending-a,a)),U(e),0!==r.pending)return r.last_flush=-1,m;a=0}t=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,V(r,t)}while(0!==t);r.gzhead.hcrc&&r.pending>a&&(e.adler=l(e.adler,r.pending_buf,r.pending-a,a))}r.status=103}if(103===r.status){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(U(e),0!==r.pending))return r.last_flush=-1,m;V(r,255&e.adler),V(r,e.adler>>8&255),e.adler=0}if(r.status=P,U(e),0!==r.pending)return r.last_flush=-1,m}if(0!==e.avail_in||0!==r.lookahead||t!==u&&r.status!==I){let a=0===r.level?$(r,t):r.strategy===M?((e,t)=>{let r;for(;;){if(0===e.lookahead&&(z(e),0===e.lookahead)){if(t===u)return 1;break}if(e.match_length=0,r=o(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(B(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===p?(B(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(B(e,!1),0===e.strm.avail_out)?1:2})(r,t):r.strategy===E?((e,t)=>{let r,a,i,n;const s=e.window;for(;;){if(e.lookahead<=A){if(z(e),e.lookahead<=A&&t===u)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(i=e.strstart-1,a=s[i],a===s[++i]&&a===s[++i]&&a===s[++i])){n=e.strstart+A;do{}while(a===s[++i]&&a===s[++i]&&a===s[++i]&&a===s[++i]&&a===s[++i]&&a===s[++i]&&a===s[++i]&&a===s[++i]&&i<n);e.match_length=A-(n-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(r=o(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=o(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(B(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===p?(B(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(B(e,!1),0===e.strm.avail_out)?1:2})(r,t):K[r.level].func(r,t);if(3!==a&&4!==a||(r.status=I),1===a||3===a)return 0===e.avail_out&&(r.last_flush=-1),m;if(2===a&&(t===h?s(r):t!==f&&(i(r,0,0,!1),t===_&&(L(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),U(e),0===e.avail_out))return r.last_flush=-1,m}return t!==p?m:r.wrap<=0?g:(2===r.wrap?(V(r,255&e.adler),V(r,e.adler>>8&255),V(r,e.adler>>16&255),V(r,e.adler>>24&255),V(r,255&e.total_in),V(r,e.total_in>>8&255),V(r,e.total_in>>16&255),V(r,e.total_in>>24&255)):(G(r,e.adler>>>16),G(r,65535&e.adler)),U(e),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?m:g)},e.exports.deflateEnd=e=>{if(Z(e))return v;const t=e.state.status;return e.state=null,t===P?O(e,y):m},e.exports.deflateSetDictionary=(e,t)=>{let r=t.length;if(Z(e))return v;const a=e.state,i=a.wrap;if(2===i||1===i&&a.status!==F||a.lookahead)return v;if(1===i&&(e.adler=d(e.adler,t,r,0)),a.wrap=0,r>=a.w_size){0===i&&(L(a.head),a.strstart=0,a.block_start=0,a.insert=0);let e=new Uint8Array(a.w_size);e.set(t.subarray(r-a.w_size,r),0),t=e,r=a.w_size}const n=e.avail_in,o=e.next_in,s=e.input;for(e.avail_in=r,e.next_in=0,e.input=t,z(a);a.lookahead>=3;){let e=a.strstart,t=a.lookahead-2;do{a.ins_h=N(a,a.ins_h,a.window[e+3-1]),a.prev[e&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=e,e++}while(--t);a.strstart=e,a.lookahead=2,z(a)}return a.strstart+=a.lookahead,a.block_start=a.strstart,a.insert=a.lookahead,a.lookahead=0,a.match_length=a.prev_length=2,a.match_available=0,e.next_in=o,e.input=s,e.avail_in=n,a.wrap=i,m},e.exports.deflateInfo="pako deflate (from Nodeca project)"},7414:e=>{"use strict";e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},7293:e=>{"use strict";const t=16209;e.exports=function(e,r){let a,i,n,o,s,d,l,c,u,h,_,p,f,m,g,v,y,b,w,S,M,E,R,T;const k=e.state;a=e.next_in,R=e.input,i=a+(e.avail_in-5),n=e.next_out,T=e.output,o=n-(r-e.avail_out),s=n+(e.avail_out-257),d=k.dmax,l=k.wsize,c=k.whave,u=k.wnext,h=k.window,_=k.hold,p=k.bits,f=k.lencode,m=k.distcode,g=(1<<k.lenbits)-1,v=(1<<k.distbits)-1;e:do{p<15&&(_+=R[a++]<<p,p+=8,_+=R[a++]<<p,p+=8),y=f[_&g];t:for(;;){if(b=y>>>24,_>>>=b,p-=b,b=y>>>16&255,0===b)T[n++]=65535&y;else{if(!(16&b)){if(64&b){if(32&b){k.mode=16191;break e}e.msg="invalid literal/length code",k.mode=t;break e}y=f[(65535&y)+(_&(1<<b)-1)];continue t}for(w=65535&y,b&=15,b&&(p<b&&(_+=R[a++]<<p,p+=8),w+=_&(1<<b)-1,_>>>=b,p-=b),p<15&&(_+=R[a++]<<p,p+=8,_+=R[a++]<<p,p+=8),y=m[_&v];;){if(b=y>>>24,_>>>=b,p-=b,b=y>>>16&255,16&b){if(S=65535&y,b&=15,p<b&&(_+=R[a++]<<p,p+=8,p<b&&(_+=R[a++]<<p,p+=8)),S+=_&(1<<b)-1,S>d){e.msg="invalid distance too far back",k.mode=t;break e}if(_>>>=b,p-=b,b=n-o,S>b){if(b=S-b,b>c&&k.sane){e.msg="invalid distance too far back",k.mode=t;break e}if(M=0,E=h,0===u){if(M+=l-b,b<w){w-=b;do{T[n++]=h[M++]}while(--b);M=n-S,E=T}}else if(u<b){if(M+=l+u-b,b-=u,b<w){w-=b;do{T[n++]=h[M++]}while(--b);if(M=0,u<w){b=u,w-=b;do{T[n++]=h[M++]}while(--b);M=n-S,E=T}}}else if(M+=u-b,b<w){w-=b;do{T[n++]=h[M++]}while(--b);M=n-S,E=T}for(;w>2;)T[n++]=E[M++],T[n++]=E[M++],T[n++]=E[M++],w-=3;w&&(T[n++]=E[M++],w>1&&(T[n++]=E[M++]))}else{M=n-S;do{T[n++]=T[M++],T[n++]=T[M++],T[n++]=T[M++],w-=3}while(w>2);w&&(T[n++]=T[M++],w>1&&(T[n++]=T[M++]))}break}if(64&b){e.msg="invalid distance code",k.mode=t;break e}y=m[(65535&y)+(_&(1<<b)-1)]}}break}}while(a<i&&n<s);w=p>>3,a-=w,p-=w<<3,_&=(1<<p)-1,e.next_in=a,e.next_out=n,e.avail_in=a<i?i-a+5:5-(a-i),e.avail_out=n<s?s-n+257:257-(n-s),k.hold=_,k.bits=p}},1447:(e,t,r)=>{"use strict";const a=r(3269),i=r(4823),n=r(7293),o=r(1998),{Z_FINISH:s,Z_BLOCK:d,Z_TREES:l,Z_OK:c,Z_STREAM_END:u,Z_NEED_DICT:h,Z_STREAM_ERROR:_,Z_DATA_ERROR:p,Z_MEM_ERROR:f,Z_BUF_ERROR:m,Z_DEFLATED:g}=r(9681),v=16180,y=16190,b=16191,w=16192,S=16194,M=16199,E=16200,R=16206,T=16209,k=16210,x=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function A(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const C=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<v||t.mode>16211?1:0},F=e=>{if(C(e))return _;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=v,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,c},P=e=>{if(C(e))return _;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,F(e)},I=(e,t)=>{let r;if(C(e))return _;const a=e.state;return t<0?(r=0,t=-t):(r=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?_:(null!==a.window&&a.wbits!==t&&(a.window=null),a.wrap=r,a.wbits=t,P(e))},O=(e,t)=>{if(!e)return _;const r=new A;e.state=r,r.strm=e,r.window=null,r.mode=v;const a=I(e,t);return a!==c&&(e.state=null),a};let D,L,W=!0;const N=e=>{if(W){D=new Int32Array(512),L=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(o(1,e.lens,0,288,D,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;o(2,e.lens,0,32,L,0,e.work,{bits:5}),W=!1}e.lencode=D,e.lenbits=9,e.distcode=L,e.distbits=5},U=(e,t,r,a)=>{let i;const n=e.state;return null===n.window&&(n.wsize=1<<n.wbits,n.wnext=0,n.whave=0,n.window=new Uint8Array(n.wsize)),a>=n.wsize?(n.window.set(t.subarray(r-n.wsize,r),0),n.wnext=0,n.whave=n.wsize):(i=n.wsize-n.wnext,i>a&&(i=a),n.window.set(t.subarray(r-a,r-a+i),n.wnext),(a-=i)?(n.window.set(t.subarray(r-a,r),0),n.wnext=a,n.whave=n.wsize):(n.wnext+=i,n.wnext===n.wsize&&(n.wnext=0),n.whave<n.wsize&&(n.whave+=i))),0};e.exports.inflateReset=P,e.exports.inflateReset2=I,e.exports.inflateResetKeep=F,e.exports.inflateInit=e=>O(e,15),e.exports.inflateInit2=O,e.exports.inflate=(e,t)=>{let r,A,F,P,I,O,D,L,W,B,V,G,H,j,z,$,q,Y,Q,K,X,Z,J=0;const ee=new Uint8Array(4);let te,re;const ae=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(C(e)||!e.output||!e.input&&0!==e.avail_in)return _;r=e.state,r.mode===b&&(r.mode=w),I=e.next_out,F=e.output,D=e.avail_out,P=e.next_in,A=e.input,O=e.avail_in,L=r.hold,W=r.bits,B=O,V=D,Z=c;e:for(;;)switch(r.mode){case v:if(0===r.wrap){r.mode=w;break}for(;W<16;){if(0===O)break e;O--,L+=A[P++]<<W,W+=8}if(2&r.wrap&&35615===L){0===r.wbits&&(r.wbits=15),r.check=0,ee[0]=255&L,ee[1]=L>>>8&255,r.check=i(r.check,ee,2,0),L=0,W=0,r.mode=16181;break}if(r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&L)<<8)+(L>>8))%31){e.msg="incorrect header check",r.mode=T;break}if((15&L)!==g){e.msg="unknown compression method",r.mode=T;break}if(L>>>=4,W-=4,X=8+(15&L),0===r.wbits&&(r.wbits=X),X>15||X>r.wbits){e.msg="invalid window size",r.mode=T;break}r.dmax=1<<r.wbits,r.flags=0,e.adler=r.check=1,r.mode=512&L?16189:b,L=0,W=0;break;case 16181:for(;W<16;){if(0===O)break e;O--,L+=A[P++]<<W,W+=8}if(r.flags=L,(255&r.flags)!==g){e.msg="unknown compression method",r.mode=T;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=T;break}r.head&&(r.head.text=L>>8&1),512&r.flags&&4&r.wrap&&(ee[0]=255&L,ee[1]=L>>>8&255,r.check=i(r.check,ee,2,0)),L=0,W=0,r.mode=16182;case 16182:for(;W<32;){if(0===O)break e;O--,L+=A[P++]<<W,W+=8}r.head&&(r.head.time=L),512&r.flags&&4&r.wrap&&(ee[0]=255&L,ee[1]=L>>>8&255,ee[2]=L>>>16&255,ee[3]=L>>>24&255,r.check=i(r.check,ee,4,0)),L=0,W=0,r.mode=16183;case 16183:for(;W<16;){if(0===O)break e;O--,L+=A[P++]<<W,W+=8}r.head&&(r.head.xflags=255&L,r.head.os=L>>8),512&r.flags&&4&r.wrap&&(ee[0]=255&L,ee[1]=L>>>8&255,r.check=i(r.check,ee,2,0)),L=0,W=0,r.mode=16184;case 16184:if(1024&r.flags){for(;W<16;){if(0===O)break e;O--,L+=A[P++]<<W,W+=8}r.length=L,r.head&&(r.head.extra_len=L),512&r.flags&&4&r.wrap&&(ee[0]=255&L,ee[1]=L>>>8&255,r.check=i(r.check,ee,2,0)),L=0,W=0}else r.head&&(r.head.extra=null);r.mode=16185;case 16185:if(1024&r.flags&&(G=r.length,G>O&&(G=O),G&&(r.head&&(X=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(A.subarray(P,P+G),X)),512&r.flags&&4&r.wrap&&(r.check=i(r.check,A,G,P)),O-=G,P+=G,r.length-=G),r.length))break e;r.length=0,r.mode=16186;case 16186:if(2048&r.flags){if(0===O)break e;G=0;do{X=A[P+G++],r.head&&X&&r.length<65536&&(r.head.name+=String.fromCharCode(X))}while(X&&G<O);if(512&r.flags&&4&r.wrap&&(r.check=i(r.check,A,G,P)),O-=G,P+=G,X)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=16187;case 16187:if(4096&r.flags){if(0===O)break e;G=0;do{X=A[P+G++],r.head&&X&&r.length<65536&&(r.head.comment+=String.fromCharCode(X))}while(X&&G<O);if(512&r.flags&&4&r.wrap&&(r.check=i(r.check,A,G,P)),O-=G,P+=G,X)break e}else r.head&&(r.head.comment=null);r.mode=16188;case 16188:if(512&r.flags){for(;W<16;){if(0===O)break e;O--,L+=A[P++]<<W,W+=8}if(4&r.wrap&&L!==(65535&r.check)){e.msg="header crc mismatch",r.mode=T;break}L=0,W=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=b;break;case 16189:for(;W<32;){if(0===O)break e;O--,L+=A[P++]<<W,W+=8}e.adler=r.check=x(L),L=0,W=0,r.mode=y;case y:if(0===r.havedict)return e.next_out=I,e.avail_out=D,e.next_in=P,e.avail_in=O,r.hold=L,r.bits=W,h;e.adler=r.check=1,r.mode=b;case b:if(t===d||t===l)break e;case w:if(r.last){L>>>=7&W,W-=7&W,r.mode=R;break}for(;W<3;){if(0===O)break e;O--,L+=A[P++]<<W,W+=8}switch(r.last=1&L,L>>>=1,W-=1,3&L){case 0:r.mode=16193;break;case 1:if(N(r),r.mode=M,t===l){L>>>=2,W-=2;break e}break;case 2:r.mode=16196;break;case 3:e.msg="invalid block type",r.mode=T}L>>>=2,W-=2;break;case 16193:for(L>>>=7&W,W-=7&W;W<32;){if(0===O)break e;O--,L+=A[P++]<<W,W+=8}if((65535&L)!=(L>>>16^65535)){e.msg="invalid stored block lengths",r.mode=T;break}if(r.length=65535&L,L=0,W=0,r.mode=S,t===l)break e;case S:r.mode=16195;case 16195:if(G=r.length,G){if(G>O&&(G=O),G>D&&(G=D),0===G)break e;F.set(A.subarray(P,P+G),I),O-=G,P+=G,D-=G,I+=G,r.length-=G;break}r.mode=b;break;case 16196:for(;W<14;){if(0===O)break e;O--,L+=A[P++]<<W,W+=8}if(r.nlen=257+(31&L),L>>>=5,W-=5,r.ndist=1+(31&L),L>>>=5,W-=5,r.ncode=4+(15&L),L>>>=4,W-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=T;break}r.have=0,r.mode=16197;case 16197:for(;r.have<r.ncode;){for(;W<3;){if(0===O)break e;O--,L+=A[P++]<<W,W+=8}r.lens[ae[r.have++]]=7&L,L>>>=3,W-=3}for(;r.have<19;)r.lens[ae[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,te={bits:r.lenbits},Z=o(0,r.lens,0,19,r.lencode,0,r.work,te),r.lenbits=te.bits,Z){e.msg="invalid code lengths set",r.mode=T;break}r.have=0,r.mode=16198;case 16198:for(;r.have<r.nlen+r.ndist;){for(;J=r.lencode[L&(1<<r.lenbits)-1],z=J>>>24,$=J>>>16&255,q=65535&J,!(z<=W);){if(0===O)break e;O--,L+=A[P++]<<W,W+=8}if(q<16)L>>>=z,W-=z,r.lens[r.have++]=q;else{if(16===q){for(re=z+2;W<re;){if(0===O)break e;O--,L+=A[P++]<<W,W+=8}if(L>>>=z,W-=z,0===r.have){e.msg="invalid bit length repeat",r.mode=T;break}X=r.lens[r.have-1],G=3+(3&L),L>>>=2,W-=2}else if(17===q){for(re=z+3;W<re;){if(0===O)break e;O--,L+=A[P++]<<W,W+=8}L>>>=z,W-=z,X=0,G=3+(7&L),L>>>=3,W-=3}else{for(re=z+7;W<re;){if(0===O)break e;O--,L+=A[P++]<<W,W+=8}L>>>=z,W-=z,X=0,G=11+(127&L),L>>>=7,W-=7}if(r.have+G>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=T;break}for(;G--;)r.lens[r.have++]=X}}if(r.mode===T)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=T;break}if(r.lenbits=9,te={bits:r.lenbits},Z=o(1,r.lens,0,r.nlen,r.lencode,0,r.work,te),r.lenbits=te.bits,Z){e.msg="invalid literal/lengths set",r.mode=T;break}if(r.distbits=6,r.distcode=r.distdyn,te={bits:r.distbits},Z=o(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,te),r.distbits=te.bits,Z){e.msg="invalid distances set",r.mode=T;break}if(r.mode=M,t===l)break e;case M:r.mode=E;case E:if(O>=6&&D>=258){e.next_out=I,e.avail_out=D,e.next_in=P,e.avail_in=O,r.hold=L,r.bits=W,n(e,V),I=e.next_out,F=e.output,D=e.avail_out,P=e.next_in,A=e.input,O=e.avail_in,L=r.hold,W=r.bits,r.mode===b&&(r.back=-1);break}for(r.back=0;J=r.lencode[L&(1<<r.lenbits)-1],z=J>>>24,$=J>>>16&255,q=65535&J,!(z<=W);){if(0===O)break e;O--,L+=A[P++]<<W,W+=8}if($&&!(240&$)){for(Y=z,Q=$,K=q;J=r.lencode[K+((L&(1<<Y+Q)-1)>>Y)],z=J>>>24,$=J>>>16&255,q=65535&J,!(Y+z<=W);){if(0===O)break e;O--,L+=A[P++]<<W,W+=8}L>>>=Y,W-=Y,r.back+=Y}if(L>>>=z,W-=z,r.back+=z,r.length=q,0===$){r.mode=16205;break}if(32&$){r.back=-1,r.mode=b;break}if(64&$){e.msg="invalid literal/length code",r.mode=T;break}r.extra=15&$,r.mode=16201;case 16201:if(r.extra){for(re=r.extra;W<re;){if(0===O)break e;O--,L+=A[P++]<<W,W+=8}r.length+=L&(1<<r.extra)-1,L>>>=r.extra,W-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=16202;case 16202:for(;J=r.distcode[L&(1<<r.distbits)-1],z=J>>>24,$=J>>>16&255,q=65535&J,!(z<=W);){if(0===O)break e;O--,L+=A[P++]<<W,W+=8}if(!(240&$)){for(Y=z,Q=$,K=q;J=r.distcode[K+((L&(1<<Y+Q)-1)>>Y)],z=J>>>24,$=J>>>16&255,q=65535&J,!(Y+z<=W);){if(0===O)break e;O--,L+=A[P++]<<W,W+=8}L>>>=Y,W-=Y,r.back+=Y}if(L>>>=z,W-=z,r.back+=z,64&$){e.msg="invalid distance code",r.mode=T;break}r.offset=q,r.extra=15&$,r.mode=16203;case 16203:if(r.extra){for(re=r.extra;W<re;){if(0===O)break e;O--,L+=A[P++]<<W,W+=8}r.offset+=L&(1<<r.extra)-1,L>>>=r.extra,W-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=T;break}r.mode=16204;case 16204:if(0===D)break e;if(G=V-D,r.offset>G){if(G=r.offset-G,G>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=T;break}G>r.wnext?(G-=r.wnext,H=r.wsize-G):H=r.wnext-G,G>r.length&&(G=r.length),j=r.window}else j=F,H=I-r.offset,G=r.length;G>D&&(G=D),D-=G,r.length-=G;do{F[I++]=j[H++]}while(--G);0===r.length&&(r.mode=E);break;case 16205:if(0===D)break e;F[I++]=r.length,D--,r.mode=E;break;case R:if(r.wrap){for(;W<32;){if(0===O)break e;O--,L|=A[P++]<<W,W+=8}if(V-=D,e.total_out+=V,r.total+=V,4&r.wrap&&V&&(e.adler=r.check=r.flags?i(r.check,F,V,I-V):a(r.check,F,V,I-V)),V=D,4&r.wrap&&(r.flags?L:x(L))!==r.check){e.msg="incorrect data check",r.mode=T;break}L=0,W=0}r.mode=16207;case 16207:if(r.wrap&&r.flags){for(;W<32;){if(0===O)break e;O--,L+=A[P++]<<W,W+=8}if(4&r.wrap&&L!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=T;break}L=0,W=0}r.mode=16208;case 16208:Z=u;break e;case T:Z=p;break e;case k:return f;default:return _}return e.next_out=I,e.avail_out=D,e.next_in=P,e.avail_in=O,r.hold=L,r.bits=W,(r.wsize||V!==e.avail_out&&r.mode<T&&(r.mode<R||t!==s))&&U(e,e.output,e.next_out,V-e.avail_out)?(r.mode=k,f):(B-=e.avail_in,V-=e.avail_out,e.total_in+=B,e.total_out+=V,r.total+=V,4&r.wrap&&V&&(e.adler=r.check=r.flags?i(r.check,F,V,e.next_out-V):a(r.check,F,V,e.next_out-V)),e.data_type=r.bits+(r.last?64:0)+(r.mode===b?128:0)+(r.mode===M||r.mode===S?256:0),(0===B&&0===V||t===s)&&Z===c&&(Z=m),Z)},e.exports.inflateEnd=e=>{if(C(e))return _;let t=e.state;return t.window&&(t.window=null),e.state=null,c},e.exports.inflateGetHeader=(e,t)=>{if(C(e))return _;const r=e.state;return 2&r.wrap?(r.head=t,t.done=!1,c):_},e.exports.inflateSetDictionary=(e,t)=>{const r=t.length;let i,n,o;return C(e)?_:(i=e.state,0!==i.wrap&&i.mode!==y?_:i.mode===y&&(n=1,n=a(n,t,r,0),n!==i.check)?p:(o=U(e,t,r,r),o?(i.mode=k,f):(i.havedict=1,c)))},e.exports.inflateInfo="pako inflate (from Nodeca project)"},1998:e=>{"use strict";const t=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),r=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),a=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),i=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);e.exports=(e,n,o,s,d,l,c,u)=>{const h=u.bits;let _,p,f,m,g,v,y=0,b=0,w=0,S=0,M=0,E=0,R=0,T=0,k=0,x=0,A=null;const C=new Uint16Array(16),F=new Uint16Array(16);let P,I,O,D=null;for(y=0;y<=15;y++)C[y]=0;for(b=0;b<s;b++)C[n[o+b]]++;for(M=h,S=15;S>=1&&0===C[S];S--);if(M>S&&(M=S),0===S)return d[l++]=20971520,d[l++]=20971520,u.bits=1,0;for(w=1;w<S&&0===C[w];w++);for(M<w&&(M=w),T=1,y=1;y<=15;y++)if(T<<=1,T-=C[y],T<0)return-1;if(T>0&&(0===e||1!==S))return-1;for(F[1]=0,y=1;y<15;y++)F[y+1]=F[y]+C[y];for(b=0;b<s;b++)0!==n[o+b]&&(c[F[n[o+b]]++]=b);if(0===e?(A=D=c,v=20):1===e?(A=t,D=r,v=257):(A=a,D=i,v=0),x=0,b=0,y=w,g=l,E=M,R=0,f=-1,k=1<<M,m=k-1,1===e&&k>852||2===e&&k>592)return 1;for(;;){P=y-R,c[b]+1<v?(I=0,O=c[b]):c[b]>=v?(I=D[c[b]-v],O=A[c[b]-v]):(I=96,O=0),_=1<<y-R,p=1<<E,w=p;do{p-=_,d[g+(x>>R)+p]=P<<24|I<<16|O}while(0!==p);for(_=1<<y-1;x&_;)_>>=1;if(0!==_?(x&=_-1,x+=_):x=0,b++,0==--C[y]){if(y===S)break;y=n[o+c[b]]}if(y>M&&(x&m)!==f){for(0===R&&(R=M),g+=w,E=y-R,T=1<<E;E+R<S&&(T-=C[E+R],!(T<=0));)E++,T<<=1;if(k+=1<<E,1===e&&k>852||2===e&&k>592)return 1;f=x&m,d[f]=M<<24|E<<16|g-l}}return 0!==x&&(d[g+x]=y-R<<24|64<<16),u.bits=M,0}},4674:e=>{"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},3665:e=>{"use strict";function t(e){let t=e.length;for(;--t>=0;)e[t]=0}const r=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),a=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),i=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),n=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),o=new Array(576);t(o);const s=new Array(60);t(s);const d=new Array(512);t(d);const l=new Array(256);t(l);const c=new Array(29);t(c);const u=new Array(30);function h(e,t,r,a,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=a,this.max_length=i,this.has_stree=e&&e.length}let _,p,f;function m(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}t(u);const g=e=>e<256?d[e]:d[256+(e>>>7)],v=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},y=(e,t,r)=>{e.bi_valid>16-r?(e.bi_buf|=t<<e.bi_valid&65535,v(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=r-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)},b=(e,t,r)=>{y(e,r[2*t],r[2*t+1])},w=(e,t)=>{let r=0;do{r|=1&e,e>>>=1,r<<=1}while(--t>0);return r>>>1},S=(e,t,r)=>{const a=new Array(16);let i,n,o=0;for(i=1;i<=15;i++)o=o+r[i-1]<<1,a[i]=o;for(n=0;n<=t;n++){let t=e[2*n+1];0!==t&&(e[2*n]=w(a[t]++,t))}},M=e=>{let t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},E=e=>{e.bi_valid>8?v(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},R=(e,t,r,a)=>{const i=2*t,n=2*r;return e[i]<e[n]||e[i]===e[n]&&a[t]<=a[r]},T=(e,t,r)=>{const a=e.heap[r];let i=r<<1;for(;i<=e.heap_len&&(i<e.heap_len&&R(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!R(t,a,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=a},k=(e,t,i)=>{let n,o,s,d,h=0;if(0!==e.sym_next)do{n=255&e.pending_buf[e.sym_buf+h++],n+=(255&e.pending_buf[e.sym_buf+h++])<<8,o=e.pending_buf[e.sym_buf+h++],0===n?b(e,o,t):(s=l[o],b(e,s+256+1,t),d=r[s],0!==d&&(o-=c[s],y(e,o,d)),n--,s=g(n),b(e,s,i),d=a[s],0!==d&&(n-=u[s],y(e,n,d)))}while(h<e.sym_next);b(e,256,t)},x=(e,t)=>{const r=t.dyn_tree,a=t.stat_desc.static_tree,i=t.stat_desc.has_stree,n=t.stat_desc.elems;let o,s,d,l=-1;for(e.heap_len=0,e.heap_max=573,o=0;o<n;o++)0!==r[2*o]?(e.heap[++e.heap_len]=l=o,e.depth[o]=0):r[2*o+1]=0;for(;e.heap_len<2;)d=e.heap[++e.heap_len]=l<2?++l:0,r[2*d]=1,e.depth[d]=0,e.opt_len--,i&&(e.static_len-=a[2*d+1]);for(t.max_code=l,o=e.heap_len>>1;o>=1;o--)T(e,r,o);d=n;do{o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],T(e,r,1),s=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=s,r[2*d]=r[2*o]+r[2*s],e.depth[d]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1,r[2*o+1]=r[2*s+1]=d,e.heap[1]=d++,T(e,r,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const r=t.dyn_tree,a=t.max_code,i=t.stat_desc.static_tree,n=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,d=t.stat_desc.max_length;let l,c,u,h,_,p,f=0;for(h=0;h<=15;h++)e.bl_count[h]=0;for(r[2*e.heap[e.heap_max]+1]=0,l=e.heap_max+1;l<573;l++)c=e.heap[l],h=r[2*r[2*c+1]+1]+1,h>d&&(h=d,f++),r[2*c+1]=h,c>a||(e.bl_count[h]++,_=0,c>=s&&(_=o[c-s]),p=r[2*c],e.opt_len+=p*(h+_),n&&(e.static_len+=p*(i[2*c+1]+_)));if(0!==f){do{for(h=d-1;0===e.bl_count[h];)h--;e.bl_count[h]--,e.bl_count[h+1]+=2,e.bl_count[d]--,f-=2}while(f>0);for(h=d;0!==h;h--)for(c=e.bl_count[h];0!==c;)u=e.heap[--l],u>a||(r[2*u+1]!==h&&(e.opt_len+=(h-r[2*u+1])*r[2*u],r[2*u+1]=h),c--)}})(e,t),S(r,l,e.bl_count)},A=(e,t,r)=>{let a,i,n=-1,o=t[1],s=0,d=7,l=4;for(0===o&&(d=138,l=3),t[2*(r+1)+1]=65535,a=0;a<=r;a++)i=o,o=t[2*(a+1)+1],++s<d&&i===o||(s<l?e.bl_tree[2*i]+=s:0!==i?(i!==n&&e.bl_tree[2*i]++,e.bl_tree[32]++):s<=10?e.bl_tree[34]++:e.bl_tree[36]++,s=0,n=i,0===o?(d=138,l=3):i===o?(d=6,l=3):(d=7,l=4))},C=(e,t,r)=>{let a,i,n=-1,o=t[1],s=0,d=7,l=4;for(0===o&&(d=138,l=3),a=0;a<=r;a++)if(i=o,o=t[2*(a+1)+1],!(++s<d&&i===o)){if(s<l)do{b(e,i,e.bl_tree)}while(0!=--s);else 0!==i?(i!==n&&(b(e,i,e.bl_tree),s--),b(e,16,e.bl_tree),y(e,s-3,2)):s<=10?(b(e,17,e.bl_tree),y(e,s-3,3)):(b(e,18,e.bl_tree),y(e,s-11,7));s=0,n=i,0===o?(d=138,l=3):i===o?(d=6,l=3):(d=7,l=4)}};let F=!1;const P=(e,t,r,a)=>{y(e,0+(a?1:0),3),E(e),v(e,r),v(e,~r),r&&e.pending_buf.set(e.window.subarray(t,t+r),e.pending),e.pending+=r};e.exports._tr_init=e=>{F||((()=>{let e,t,n,m,g;const v=new Array(16);for(n=0,m=0;m<28;m++)for(c[m]=n,e=0;e<1<<r[m];e++)l[n++]=m;for(l[n-1]=m,g=0,m=0;m<16;m++)for(u[m]=g,e=0;e<1<<a[m];e++)d[g++]=m;for(g>>=7;m<30;m++)for(u[m]=g<<7,e=0;e<1<<a[m]-7;e++)d[256+g++]=m;for(t=0;t<=15;t++)v[t]=0;for(e=0;e<=143;)o[2*e+1]=8,e++,v[8]++;for(;e<=255;)o[2*e+1]=9,e++,v[9]++;for(;e<=279;)o[2*e+1]=7,e++,v[7]++;for(;e<=287;)o[2*e+1]=8,e++,v[8]++;for(S(o,287,v),e=0;e<30;e++)s[2*e+1]=5,s[2*e]=w(e,5);_=new h(o,r,257,286,15),p=new h(s,a,0,30,15),f=new h(new Array(0),i,0,19,7)})(),F=!0),e.l_desc=new m(e.dyn_ltree,_),e.d_desc=new m(e.dyn_dtree,p),e.bl_desc=new m(e.bl_tree,f),e.bi_buf=0,e.bi_valid=0,M(e)},e.exports._tr_stored_block=P,e.exports._tr_flush_block=(e,t,r,a)=>{let i,d,l=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=(e=>{let t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0})(e)),x(e,e.l_desc),x(e,e.d_desc),l=(e=>{let t;for(A(e,e.dyn_ltree,e.l_desc.max_code),A(e,e.dyn_dtree,e.d_desc.max_code),x(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*n[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),i=e.opt_len+3+7>>>3,d=e.static_len+3+7>>>3,d<=i&&(i=d)):i=d=r+5,r+4<=i&&-1!==t?P(e,t,r,a):4===e.strategy||d===i?(y(e,2+(a?1:0),3),k(e,o,s)):(y(e,4+(a?1:0),3),((e,t,r,a)=>{let i;for(y(e,t-257,5),y(e,r-1,5),y(e,a-4,4),i=0;i<a;i++)y(e,e.bl_tree[2*n[i]+1],3);C(e,e.dyn_ltree,t-1),C(e,e.dyn_dtree,r-1)})(e,e.l_desc.max_code+1,e.d_desc.max_code+1,l+1),k(e,e.dyn_ltree,e.dyn_dtree)),M(e),a&&E(e)},e.exports._tr_tally=(e,t,r)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=r,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(l[r]+256+1)]++,e.dyn_dtree[2*g(t)]++),e.sym_next===e.sym_end),e.exports._tr_align=e=>{y(e,2,3),b(e,256,o),(e=>{16===e.bi_valid?(v(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)})(e)}},4442:e=>{"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},1265:(e,t,r)=>{e.exports=r(4598)},7201:(e,t,r)=>{e.exports=r(3042)},1829:(e,t,r)=>{"use strict";var a=r(2222);e.exports=a},6040:(e,t,r)=>{"use strict";var a=r(8251);e.exports=a},7264:(e,t,r)=>{"use strict";var a=r(4139);r(768),r(8549),r(7152),r(1372),e.exports=a},9692:(e,t,r)=>{"use strict";var a=r(7045);e.exports=a},5663:(e,t,r)=>{"use strict";var a=r(70);e.exports=a},6823:(e,t,r)=>{"use strict";var a=r(8280),i=r(2017),n=String.prototype;e.exports=function(e){var t=e.replaceAll;return"string"==typeof e||e===n||a(n,e)&&t===n.replaceAll?i:t}},1042:(e,t,r)=>{"use strict";var a=r(8280),i=r(7511),n=String.prototype;e.exports=function(e){var t=e.trim;return"string"==typeof e||e===n||a(n,e)&&t===n.trim?i:t}},1926:(e,t,r)=>{"use strict";r(6750);var a=r(2046).Object,i=e.exports=function(e,t,r){return a.defineProperty(e,t,r)};a.defineProperty.sham&&(i.sham=!0)},2017:(e,t,r)=>{"use strict";r(1398),r(1995),r(929);var a=r(1747);e.exports=a("String","replaceAll")},7511:(e,t,r)=>{"use strict";r(727);var a=r(1747);e.exports=a("String","trim")},3842:(e,t,r)=>{"use strict";r(8545),r(3643),r(4452),r(3997),r(5084),r(2596),r(5721),r(4954),r(4123),r(3377),r(2230),r(5344),r(1660),r(4610),r(3669),r(4810),r(3325),r(7024),r(8172),r(5205);var a=r(2046);e.exports=a.Symbol},1730:(e,t,r)=>{"use strict";r(9363),r(3643),r(7057),r(4954);var a=r(560);e.exports=a.f("iterator")},1661:(e,t,r)=>{"use strict";r(8537),r(3669);var a=r(560);e.exports=a.f("toPrimitive")},3042:(e,t,r)=>{"use strict";e.exports=r(9604)},9604:(e,t,r)=>{"use strict";r(6038);var a=r(1829);e.exports=a},4997:(e,t,r)=>{"use strict";var a=r(6040);e.exports=a},2321:(e,t,r)=>{"use strict";var a=r(7264);r(3939),r(1785),r(1697),r(4664),r(3422),r(36),r(8703),r(6878),r(9671),r(359),e.exports=a},2231:(e,t,r)=>{"use strict";var a=r(9692);e.exports=a},9280:(e,t,r)=>{"use strict";var a=r(5663);e.exports=a},2159:(e,t,r)=>{"use strict";var a=r(2250),i=r(4640),n=TypeError;e.exports=function(e){if(a(e))return e;throw new n(i(e)+" is not a function")}},43:(e,t,r)=>{"use strict";var a=r(4018),i=String,n=TypeError;e.exports=function(e){if(a(e))return e;throw new n("Can't set "+i(e)+" as a prototype")}},2156:e=>{"use strict";e.exports=function(){}},6624:(e,t,r)=>{"use strict";var a=r(6285),i=String,n=TypeError;e.exports=function(e){if(a(e))return e;throw new n(i(e)+" is not an object")}},4436:(e,t,r)=>{"use strict";var a=r(7374),i=r(4849),n=r(575),o=function(e){return function(t,r,o){var s=a(t),d=n(s);if(0===d)return!e&&-1;var l,c=i(o,d);if(e&&r!=r){for(;d>c;)if((l=s[c++])!=l)return!0}else for(;d>c;c++)if((e||c in s)&&s[c]===r)return e||c||0;return!e&&-1}};e.exports={includes:o(!0),indexOf:o(!1)}},726:(e,t,r)=>{"use strict";var a=r(8311),i=r(1907),n=r(6946),o=r(9298),s=r(575),d=r(6968),l=i([].push),c=function(e){var t=1===e,r=2===e,i=3===e,c=4===e,u=6===e,h=7===e,_=5===e||u;return function(p,f,m,g){for(var v,y,b=o(p),w=n(b),S=s(w),M=a(f,m),E=0,R=g||d,T=t?R(p,S):r||h?R(p,0):void 0;S>E;E++)if((_||E in w)&&(y=M(v=w[E],E,b),e))if(t)T[E]=y;else if(y)switch(e){case 3:return!0;case 5:return v;case 6:return E;case 2:l(T,v)}else switch(e){case 4:return!1;case 7:l(T,v)}return u?-1:i||c?c:T}};e.exports={forEach:c(0),map:c(1),filter:c(2),some:c(3),every:c(4),find:c(5),findIndex:c(6),filterReject:c(7)}},7171:(e,t,r)=>{"use strict";var a=r(8828),i=r(6264),n=r(798),o=i("species");e.exports=function(e){return n>=51||!a((function(){var t=[];return(t.constructor={})[o]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},3427:(e,t,r)=>{"use strict";var a=r(1907);e.exports=a([].slice)},4010:(e,t,r)=>{"use strict";var a=r(1793),i=r(5468),n=r(6285),o=r(6264)("species"),s=Array;e.exports=function(e){var t;return a(e)&&(t=e.constructor,(i(t)&&(t===s||a(t.prototype))||n(t)&&null===(t=t[o]))&&(t=void 0)),void 0===t?s:t}},6968:(e,t,r)=>{"use strict";var a=r(4010);e.exports=function(e,t){return new(a(e))(0===t?0:t)}},5807:(e,t,r)=>{"use strict";var a=r(1907),i=a({}.toString),n=a("".slice);e.exports=function(e){return n(i(e),8,-1)}},3948:(e,t,r)=>{"use strict";var a=r(2623),i=r(2250),n=r(5807),o=r(6264)("toStringTag"),s=Object,d="Arguments"===n(function(){return arguments}());e.exports=a?n:function(e){var t,r,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=s(e),o))?r:d?n(t):"Object"===(a=n(t))&&i(t.callee)?"Arguments":a}},7382:(e,t,r)=>{"use strict";var a=r(8828);e.exports=!a((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},9550:e=>{"use strict";e.exports=function(e,t){return{value:e,done:t}}},1626:(e,t,r)=>{"use strict";var a=r(9447),i=r(4284),n=r(5817);e.exports=a?function(e,t,r){return i.f(e,t,n(1,r))}:function(e,t,r){return e[t]=r,e}},5817:e=>{"use strict";e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},5543:(e,t,r)=>{"use strict";var a=r(9447),i=r(4284),n=r(5817);e.exports=function(e,t,r){a?i.f(e,t,n(0,r)):e[t]=r}},9251:(e,t,r)=>{"use strict";var a=r(4284);e.exports=function(e,t,r){return a.f(e,t,r)}},8055:(e,t,r)=>{"use strict";var a=r(1626);e.exports=function(e,t,r,i){return i&&i.enumerable?e[t]=r:a(e,t,r),e}},2532:(e,t,r)=>{"use strict";var a=r(5951),i=Object.defineProperty;e.exports=function(e,t){try{i(a,e,{value:t,configurable:!0,writable:!0})}catch(r){a[e]=t}return t}},9447:(e,t,r)=>{"use strict";var a=r(8828);e.exports=!a((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},9552:(e,t,r)=>{"use strict";var a=r(5951),i=r(6285),n=a.document,o=i(n)&&i(n.createElement);e.exports=function(e){return o?n.createElement(e):{}}},8024:e=>{"use strict";var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},9287:e=>{"use strict";e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},376:e=>{"use strict";e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},6794:(e,t,r)=>{"use strict";var a=r(5951).navigator,i=a&&a.userAgent;e.exports=i?String(i):""},798:(e,t,r)=>{"use strict";var a,i,n=r(5951),o=r(6794),s=n.process,d=n.Deno,l=s&&s.versions||d&&d.version,c=l&&l.v8;c&&(i=(a=c.split("."))[0]>0&&a[0]<4?1:+(a[0]+a[1])),!i&&o&&(!(a=o.match(/Edge\/(\d+)/))||a[1]>=74)&&(a=o.match(/Chrome\/(\d+)/))&&(i=+a[1]),e.exports=i},1091:(e,t,r)=>{"use strict";var a=r(5951),i=r(6024),n=r(2361),o=r(2250),s=r(3846).f,d=r(7463),l=r(2046),c=r(8311),u=r(1626),h=r(9724);r(6128);var _=function(e){var t=function(r,a,n){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(r);case 2:return new e(r,a)}return new e(r,a,n)}return i(e,this,arguments)};return t.prototype=e.prototype,t};e.exports=function(e,t){var r,i,p,f,m,g,v,y,b,w=e.target,S=e.global,M=e.stat,E=e.proto,R=S?a:M?a[w]:a[w]&&a[w].prototype,T=S?l:l[w]||u(l,w,{})[w],k=T.prototype;for(f in t)i=!(r=d(S?f:w+(M?".":"#")+f,e.forced))&&R&&h(R,f),g=T[f],i&&(v=e.dontCallGetSet?(b=s(R,f))&&b.value:R[f]),m=i&&v?v:t[f],(r||E||typeof g!=typeof m)&&(y=e.bind&&i?c(m,a):e.wrap&&i?_(m):E&&o(m)?n(m):m,(e.sham||m&&m.sham||g&&g.sham)&&u(y,"sham",!0),u(T,f,y),E&&(h(l,p=w+"Prototype")||u(l,p,{}),u(l[p],f,m),e.real&&k&&(r||!k[f])&&u(k,f,m)))}},8828:e=>{"use strict";e.exports=function(e){try{return!!e()}catch(e){return!0}}},6024:(e,t,r)=>{"use strict";var a=r(1505),i=Function.prototype,n=i.apply,o=i.call;e.exports="object"==typeof Reflect&&Reflect.apply||(a?o.bind(n):function(){return o.apply(n,arguments)})},8311:(e,t,r)=>{"use strict";var a=r(2361),i=r(2159),n=r(1505),o=a(a.bind);e.exports=function(e,t){return i(e),void 0===t?e:n?o(e,t):function(){return e.apply(t,arguments)}}},1505:(e,t,r)=>{"use strict";var a=r(8828);e.exports=!a((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},3930:(e,t,r)=>{"use strict";var a=r(1505),i=Function.prototype.call;e.exports=a?i.bind(i):function(){return i.apply(i,arguments)}},6833:(e,t,r)=>{"use strict";var a=r(9447),i=r(9724),n=Function.prototype,o=a&&Object.getOwnPropertyDescriptor,s=i(n,"name"),d=s&&"something"===function(){}.name,l=s&&(!a||a&&o(n,"name").configurable);e.exports={EXISTS:s,PROPER:d,CONFIGURABLE:l}},1871:(e,t,r)=>{"use strict";var a=r(1907),i=r(2159);e.exports=function(e,t,r){try{return a(i(Object.getOwnPropertyDescriptor(e,t)[r]))}catch(e){}}},2361:(e,t,r)=>{"use strict";var a=r(5807),i=r(1907);e.exports=function(e){if("Function"===a(e))return i(e)}},1907:(e,t,r)=>{"use strict";var a=r(1505),i=Function.prototype,n=i.call,o=a&&i.bind.bind(n,n);e.exports=a?o:function(e){return function(){return n.apply(e,arguments)}}},1747:(e,t,r)=>{"use strict";var a=r(5951),i=r(2046);e.exports=function(e,t){var r=i[e+"Prototype"],n=r&&r[t];if(n)return n;var o=a[e],s=o&&o.prototype;return s&&s[t]}},5582:(e,t,r)=>{"use strict";var a=r(2046),i=r(5951),n=r(2250),o=function(e){return n(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?o(a[e])||o(i[e]):a[e]&&a[e][t]||i[e]&&i[e][t]}},6656:(e,t,r)=>{"use strict";var a=r(1907),i=r(1793),n=r(2250),o=r(5807),s=r(160),d=a([].push);e.exports=function(e){if(n(e))return e;if(i(e)){for(var t=e.length,r=[],a=0;a<t;a++){var l=e[a];"string"==typeof l?d(r,l):"number"!=typeof l&&"Number"!==o(l)&&"String"!==o(l)||d(r,s(l))}var c=r.length,u=!0;return function(e,t){if(u)return u=!1,t;if(i(this))return t;for(var a=0;a<c;a++)if(r[a]===e)return t}}}},9367:(e,t,r)=>{"use strict";var a=r(2159),i=r(7136);e.exports=function(e,t){var r=e[t];return i(r)?void 0:a(r)}},7703:(e,t,r)=>{"use strict";var a=r(1907),i=r(9298),n=Math.floor,o=a("".charAt),s=a("".replace),d=a("".slice),l=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,c=/\$([$&'`]|\d{1,2})/g;e.exports=function(e,t,r,a,u,h){var _=r+e.length,p=a.length,f=c;return void 0!==u&&(u=i(u),f=l),s(h,f,(function(i,s){var l;switch(o(s,0)){case"$":return"$";case"&":return e;case"`":return d(t,0,r);case"'":return d(t,_);case"<":l=u[d(s,1,-1)];break;default:var c=+s;if(0===c)return i;if(c>p){var h=n(c/10);return 0===h?i:h<=p?void 0===a[h-1]?o(s,1):a[h-1]+o(s,1):i}l=a[c-1]}return void 0===l?"":l}))}},5951:function(e,t,r){"use strict";var a=function(e){return e&&e.Math===Math&&e};e.exports=a("object"==typeof globalThis&&globalThis)||a("object"==typeof window&&window)||a("object"==typeof self&&self)||a("object"==typeof r.g&&r.g)||a("object"==typeof this&&this)||function(){return this}()||Function("return this")()},9724:(e,t,r)=>{"use strict";var a=r(1907),i=r(9298),n=a({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return n(i(e),t)}},8530:e=>{"use strict";e.exports={}},2416:(e,t,r)=>{"use strict";var a=r(5582);e.exports=a("document","documentElement")},3648:(e,t,r)=>{"use strict";var a=r(9447),i=r(8828),n=r(9552);e.exports=!a&&!i((function(){return 7!==Object.defineProperty(n("div"),"a",{get:function(){return 7}}).a}))},6946:(e,t,r)=>{"use strict";var a=r(1907),i=r(8828),n=r(5807),o=Object,s=a("".split);e.exports=i((function(){return!o("z").propertyIsEnumerable(0)}))?function(e){return"String"===n(e)?s(e,""):o(e)}:o},2647:(e,t,r)=>{"use strict";var a=r(1907),i=r(2250),n=r(6128),o=a(Function.toString);i(n.inspectSource)||(n.inspectSource=function(e){return o(e)}),e.exports=n.inspectSource},4932:(e,t,r)=>{"use strict";var a,i,n,o=r(551),s=r(5951),d=r(6285),l=r(1626),c=r(9724),u=r(6128),h=r(2522),_=r(8530),p="Object already initialized",f=s.TypeError,m=s.WeakMap;if(o||u.state){var g=u.state||(u.state=new m);g.get=g.get,g.has=g.has,g.set=g.set,a=function(e,t){if(g.has(e))throw new f(p);return t.facade=e,g.set(e,t),t},i=function(e){return g.get(e)||{}},n=function(e){return g.has(e)}}else{var v=h("state");_[v]=!0,a=function(e,t){if(c(e,v))throw new f(p);return t.facade=e,l(e,v,t),t},i=function(e){return c(e,v)?e[v]:{}},n=function(e){return c(e,v)}}e.exports={set:a,get:i,has:n,enforce:function(e){return n(e)?i(e):a(e,{})},getterFor:function(e){return function(t){var r;if(!d(t)||(r=i(t)).type!==e)throw new f("Incompatible receiver, "+e+" required");return r}}}},1793:(e,t,r)=>{"use strict";var a=r(5807);e.exports=Array.isArray||function(e){return"Array"===a(e)}},2250:e=>{"use strict";var t="object"==typeof document&&document.all;e.exports=void 0===t&&void 0!==t?function(e){return"function"==typeof e||e===t}:function(e){return"function"==typeof e}},5468:(e,t,r)=>{"use strict";var a=r(1907),i=r(8828),n=r(2250),o=r(3948),s=r(5582),d=r(2647),l=function(){},c=s("Reflect","construct"),u=/^\s*(?:class|function)\b/,h=a(u.exec),_=!u.test(l),p=function(e){if(!n(e))return!1;try{return c(l,[],e),!0}catch(e){return!1}},f=function(e){if(!n(e))return!1;switch(o(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return _||!!h(u,d(e))}catch(e){return!0}};f.sham=!0,e.exports=!c||i((function(){var e;return p(p.call)||!p(Object)||!p((function(){e=!0}))||e}))?f:p},7463:(e,t,r)=>{"use strict";var a=r(8828),i=r(2250),n=/#|\.prototype\./,o=function(e,t){var r=d[s(e)];return r===c||r!==l&&(i(t)?a(t):!!t)},s=o.normalize=function(e){return String(e).replace(n,".").toLowerCase()},d=o.data={},l=o.NATIVE="N",c=o.POLYFILL="P";e.exports=o},7136:e=>{"use strict";e.exports=function(e){return null==e}},6285:(e,t,r)=>{"use strict";var a=r(2250);e.exports=function(e){return"object"==typeof e?null!==e:a(e)}},4018:(e,t,r)=>{"use strict";var a=r(6285);e.exports=function(e){return a(e)||null===e}},7376:e=>{"use strict";e.exports=!0},2087:(e,t,r)=>{"use strict";var a=r(6285),i=r(5807),n=r(6264)("match");e.exports=function(e){var t;return a(e)&&(void 0!==(t=e[n])?!!t:"RegExp"===i(e))}},5594:(e,t,r)=>{"use strict";var a=r(5582),i=r(2250),n=r(8280),o=r(1175),s=Object;e.exports=o?function(e){return"symbol"==typeof e}:function(e){var t=a("Symbol");return i(t)&&n(t.prototype,s(e))}},7181:(e,t,r)=>{"use strict";var a=r(5116).IteratorPrototype,i=r(8075),n=r(5817),o=r(4840),s=r(3742),d=function(){return this};e.exports=function(e,t,r,l){var c=t+" Iterator";return e.prototype=i(a,{next:n(+!l,r)}),o(e,c,!1,!0),s[c]=d,e}},183:(e,t,r)=>{"use strict";var a=r(1091),i=r(3930),n=r(7376),o=r(6833),s=r(2250),d=r(7181),l=r(5972),c=r(9192),u=r(4840),h=r(1626),_=r(8055),p=r(6264),f=r(3742),m=r(5116),g=o.PROPER,v=o.CONFIGURABLE,y=m.IteratorPrototype,b=m.BUGGY_SAFARI_ITERATORS,w=p("iterator"),S="keys",M="values",E="entries",R=function(){return this};e.exports=function(e,t,r,o,p,m,T){d(r,t,o);var k,x,A,C=function(e){if(e===p&&D)return D;if(!b&&e&&e in I)return I[e];switch(e){case S:case M:case E:return function(){return new r(this,e)}}return function(){return new r(this)}},F=t+" Iterator",P=!1,I=e.prototype,O=I[w]||I["@@iterator"]||p&&I[p],D=!b&&O||C(p),L="Array"===t&&I.entries||O;if(L&&(k=l(L.call(new e)))!==Object.prototype&&k.next&&(n||l(k)===y||(c?c(k,y):s(k[w])||_(k,w,R)),u(k,F,!0,!0),n&&(f[F]=R)),g&&p===M&&O&&O.name!==M&&(!n&&v?h(I,"name",M):(P=!0,D=function(){return i(O,this)})),p)if(x={values:C(M),keys:m?D:C(S),entries:C(E)},T)for(A in x)(b||P||!(A in I))&&_(I,A,x[A]);else a({target:t,proto:!0,forced:b||P},x);return n&&!T||I[w]===D||_(I,w,D,{name:p}),f[t]=D,x}},5116:(e,t,r)=>{"use strict";var a,i,n,o=r(8828),s=r(2250),d=r(6285),l=r(8075),c=r(5972),u=r(8055),h=r(6264),_=r(7376),p=h("iterator"),f=!1;[].keys&&("next"in(n=[].keys())?(i=c(c(n)))!==Object.prototype&&(a=i):f=!0),!d(a)||o((function(){var e={};return a[p].call(e)!==e}))?a={}:_&&(a=l(a)),s(a[p])||u(a,p,(function(){return this})),e.exports={IteratorPrototype:a,BUGGY_SAFARI_ITERATORS:f}},3742:e=>{"use strict";e.exports={}},575:(e,t,r)=>{"use strict";var a=r(3121);e.exports=function(e){return a(e.length)}},1176:e=>{"use strict";var t=Math.ceil,r=Math.floor;e.exports=Math.trunc||function(e){var a=+e;return(a>0?r:t)(a)}},8075:(e,t,r)=>{"use strict";var a,i=r(6624),n=r(2220),o=r(376),s=r(8530),d=r(2416),l=r(9552),c=r(2522),u="prototype",h="script",_=c("IE_PROTO"),p=function(){},f=function(e){return"<"+h+">"+e+"</"+h+">"},m=function(e){e.write(f("")),e.close();var t=e.parentWindow.Object;return e=null,t},g=function(){try{a=new ActiveXObject("htmlfile")}catch(e){}var e,t,r;g="undefined"!=typeof document?document.domain&&a?m(a):(t=l("iframe"),r="java"+h+":",t.style.display="none",d.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(f("document.F=Object")),e.close(),e.F):m(a);for(var i=o.length;i--;)delete g[u][o[i]];return g()};s[_]=!0,e.exports=Object.create||function(e,t){var r;return null!==e?(p[u]=i(e),r=new p,p[u]=null,r[_]=e):r=g(),void 0===t?r:n.f(r,t)}},2220:(e,t,r)=>{"use strict";var a=r(9447),i=r(8661),n=r(4284),o=r(6624),s=r(7374),d=r(2875);t.f=a&&!i?Object.defineProperties:function(e,t){o(e);for(var r,a=s(t),i=d(t),l=i.length,c=0;l>c;)n.f(e,r=i[c++],a[r]);return e}},4284:(e,t,r)=>{"use strict";var a=r(9447),i=r(3648),n=r(8661),o=r(6624),s=r(470),d=TypeError,l=Object.defineProperty,c=Object.getOwnPropertyDescriptor,u="enumerable",h="configurable",_="writable";t.f=a?n?function(e,t,r){if(o(e),t=s(t),o(r),"function"==typeof e&&"prototype"===t&&"value"in r&&_ in r&&!r[_]){var a=c(e,t);a&&a[_]&&(e[t]=r.value,r={configurable:h in r?r[h]:a[h],enumerable:u in r?r[u]:a[u],writable:!1})}return l(e,t,r)}:l:function(e,t,r){if(o(e),t=s(t),o(r),i)try{return l(e,t,r)}catch(e){}if("get"in r||"set"in r)throw new d("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},3846:(e,t,r)=>{"use strict";var a=r(9447),i=r(3930),n=r(2574),o=r(5817),s=r(7374),d=r(470),l=r(9724),c=r(3648),u=Object.getOwnPropertyDescriptor;t.f=a?u:function(e,t){if(e=s(e),t=d(t),c)try{return u(e,t)}catch(e){}if(l(e,t))return o(!i(n.f,e,t),e[t])}},5407:(e,t,r)=>{"use strict";var a=r(5807),i=r(7374),n=r(4443).f,o=r(3427),s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return s&&"Window"===a(e)?function(e){try{return n(e)}catch(e){return o(s)}}(e):n(i(e))}},4443:(e,t,r)=>{"use strict";var a=r(3045),i=r(376).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return a(e,i)}},7170:(e,t)=>{"use strict";t.f=Object.getOwnPropertySymbols},5972:(e,t,r)=>{"use strict";var a=r(9724),i=r(2250),n=r(9298),o=r(2522),s=r(7382),d=o("IE_PROTO"),l=Object,c=l.prototype;e.exports=s?l.getPrototypeOf:function(e){var t=n(e);if(a(t,d))return t[d];var r=t.constructor;return i(r)&&t instanceof r?r.prototype:t instanceof l?c:null}},8280:(e,t,r)=>{"use strict";var a=r(1907);e.exports=a({}.isPrototypeOf)},3045:(e,t,r)=>{"use strict";var a=r(1907),i=r(9724),n=r(7374),o=r(4436).indexOf,s=r(8530),d=a([].push);e.exports=function(e,t){var r,a=n(e),l=0,c=[];for(r in a)!i(s,r)&&i(a,r)&&d(c,r);for(;t.length>l;)i(a,r=t[l++])&&(~o(c,r)||d(c,r));return c}},2875:(e,t,r)=>{"use strict";var a=r(3045),i=r(376);e.exports=Object.keys||function(e){return a(e,i)}},2574:(e,t)=>{"use strict";var r={}.propertyIsEnumerable,a=Object.getOwnPropertyDescriptor,i=a&&!r.call({1:2},1);t.f=i?function(e){var t=a(this,e);return!!t&&t.enumerable}:r},9192:(e,t,r)=>{"use strict";var a=r(1871),i=r(6285),n=r(4239),o=r(43);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=a(Object.prototype,"__proto__","set"))(r,[]),t=r instanceof Array}catch(e){}return function(r,a){return n(r),o(a),i(r)?(t?e(r,a):r.__proto__=a,r):r}}():void 0)},4878:(e,t,r)=>{"use strict";var a=r(2623),i=r(3948);e.exports=a?{}.toString:function(){return"[object "+i(this)+"]"}},581:(e,t,r)=>{"use strict";var a=r(3930),i=r(2250),n=r(6285),o=TypeError;e.exports=function(e,t){var r,s;if("string"===t&&i(r=e.toString)&&!n(s=a(r,e)))return s;if(i(r=e.valueOf)&&!n(s=a(r,e)))return s;if("string"!==t&&i(r=e.toString)&&!n(s=a(r,e)))return s;throw new o("Can't convert object to primitive value")}},2046:e=>{"use strict";e.exports={}},5606:(e,t,r)=>{"use strict";var a=r(6624);e.exports=function(){var e=a(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t}},663:(e,t,r)=>{"use strict";var a=r(3930),i=r(9724),n=r(8280),o=r(5606),s=RegExp.prototype;e.exports=function(e){var t=e.flags;return void 0!==t||"flags"in s||i(e,"flags")||!n(s,e)?t:a(o,e)}},4239:(e,t,r)=>{"use strict";var a=r(7136),i=TypeError;e.exports=function(e){if(a(e))throw new i("Can't call method on "+e);return e}},4840:(e,t,r)=>{"use strict";var a=r(2623),i=r(4284).f,n=r(1626),o=r(9724),s=r(4878),d=r(6264)("toStringTag");e.exports=function(e,t,r,l){var c=r?e:e&&e.prototype;c&&(o(c,d)||i(c,d,{configurable:!0,value:t}),l&&!a&&n(c,"toString",s))}},2522:(e,t,r)=>{"use strict";var a=r(5816),i=r(6499),n=a("keys");e.exports=function(e){return n[e]||(n[e]=i(e))}},6128:(e,t,r)=>{"use strict";var a=r(7376),i=r(5951),n=r(2532),o="__core-js_shared__",s=e.exports=i[o]||n(o,{});(s.versions||(s.versions=[])).push({version:"3.39.0",mode:a?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.39.0/LICENSE",source:"https://github.com/zloirock/core-js"})},5816:(e,t,r)=>{"use strict";var a=r(6128);e.exports=function(e,t){return a[e]||(a[e]=t||{})}},1470:(e,t,r)=>{"use strict";var a=r(1907),i=r(5482),n=r(160),o=r(4239),s=a("".charAt),d=a("".charCodeAt),l=a("".slice),c=function(e){return function(t,r){var a,c,u=n(o(t)),h=i(r),_=u.length;return h<0||h>=_?e?"":void 0:(a=d(u,h))<55296||a>56319||h+1===_||(c=d(u,h+1))<56320||c>57343?e?s(u,h):a:e?l(u,h,h+2):c-56320+(a-55296<<10)+65536}};e.exports={codeAt:c(!1),charAt:c(!0)}},5819:(e,t,r)=>{"use strict";var a=r(6833).PROPER,i=r(8828),n=r(6395);e.exports=function(e){return i((function(){return!!n[e]()||"
"!=="
"[e]()||a&&n[e].name!==e}))}},5993:(e,t,r)=>{"use strict";var a=r(1907),i=r(4239),n=r(160),o=r(6395),s=a("".replace),d=RegExp("^["+o+"]+"),l=RegExp("(^|[^"+o+"])["+o+"]+$"),c=function(e){return function(t){var r=n(i(t));return 1&e&&(r=s(r,d,"")),2&e&&(r=s(r,l,"$1")),r}};e.exports={start:c(1),end:c(2),trim:c(3)}},9846:(e,t,r)=>{"use strict";var a=r(798),i=r(8828),n=r(5951).String;e.exports=!!Object.getOwnPropertySymbols&&!i((function(){var e=Symbol("symbol detection");return!n(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&a&&a<41}))},3467:(e,t,r)=>{"use strict";var a=r(3930),i=r(5582),n=r(6264),o=r(8055);e.exports=function(){var e=i("Symbol"),t=e&&e.prototype,r=t&&t.valueOf,s=n("toPrimitive");t&&!t[s]&&o(t,s,(function(e){return a(r,this)}),{arity:1})}},2595:(e,t,r)=>{"use strict";var a=r(5582),i=r(1907),n=a("Symbol"),o=n.keyFor,s=i(n.prototype.valueOf);e.exports=n.isRegisteredSymbol||function(e){try{return void 0!==o(s(e))}catch(e){return!1}}},9197:(e,t,r)=>{"use strict";for(var a=r(5816),i=r(5582),n=r(1907),o=r(5594),s=r(6264),d=i("Symbol"),l=d.isWellKnownSymbol,c=i("Object","getOwnPropertyNames"),u=n(d.prototype.valueOf),h=a("wks"),_=0,p=c(d),f=p.length;_<f;_++)try{var m=p[_];o(d[m])&&s(m)}catch(e){}e.exports=function(e){if(l&&l(e))return!0;try{for(var t=u(e),r=0,a=c(h),i=a.length;r<i;r++)if(h[a[r]]==t)return!0}catch(e){}return!1}},4411:(e,t,r)=>{"use strict";var a=r(9846);e.exports=a&&!!Symbol.for&&!!Symbol.keyFor},4849:(e,t,r)=>{"use strict";var a=r(5482),i=Math.max,n=Math.min;e.exports=function(e,t){var r=a(e);return r<0?i(r+t,0):n(r,t)}},7374:(e,t,r)=>{"use strict";var a=r(6946),i=r(4239);e.exports=function(e){return a(i(e))}},5482:(e,t,r)=>{"use strict";var a=r(1176);e.exports=function(e){var t=+e;return t!=t||0===t?0:a(t)}},3121:(e,t,r)=>{"use strict";var a=r(5482),i=Math.min;e.exports=function(e){var t=a(e);return t>0?i(t,9007199254740991):0}},9298:(e,t,r)=>{"use strict";var a=r(4239),i=Object;e.exports=function(e){return i(a(e))}},6028:(e,t,r)=>{"use strict";var a=r(3930),i=r(6285),n=r(5594),o=r(9367),s=r(581),d=r(6264),l=TypeError,c=d("toPrimitive");e.exports=function(e,t){if(!i(e)||n(e))return e;var r,d=o(e,c);if(d){if(void 0===t&&(t="default"),r=a(d,e,t),!i(r)||n(r))return r;throw new l("Can't convert object to primitive value")}return void 0===t&&(t="number"),s(e,t)}},470:(e,t,r)=>{"use strict";var a=r(6028),i=r(5594);e.exports=function(e){var t=a(e,"string");return i(t)?t:t+""}},2623:(e,t,r)=>{"use strict";var a={};a[r(6264)("toStringTag")]="z",e.exports="[object z]"===String(a)},160:(e,t,r)=>{"use strict";var a=r(3948),i=String;e.exports=function(e){if("Symbol"===a(e))throw new TypeError("Cannot convert a Symbol value to a string");return i(e)}},4640:e=>{"use strict";var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},6499:(e,t,r)=>{"use strict";var a=r(1907),i=0,n=Math.random(),o=a(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+o(++i+n,36)}},1175:(e,t,r)=>{"use strict";var a=r(9846);e.exports=a&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},8661:(e,t,r)=>{"use strict";var a=r(9447),i=r(8828);e.exports=a&&i((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},551:(e,t,r)=>{"use strict";var a=r(5951),i=r(2250),n=a.WeakMap;e.exports=i(n)&&/native code/.test(String(n))},366:(e,t,r)=>{"use strict";var a=r(2046),i=r(9724),n=r(560),o=r(4284).f;e.exports=function(e){var t=a.Symbol||(a.Symbol={});i(t,e)||o(t,e,{value:n.f(e)})}},560:(e,t,r)=>{"use strict";var a=r(6264);t.f=a},6264:(e,t,r)=>{"use strict";var a=r(5951),i=r(5816),n=r(9724),o=r(6499),s=r(9846),d=r(1175),l=a.Symbol,c=i("wks"),u=d?l.for||l:l&&l.withoutSetter||o;e.exports=function(e){return n(c,e)||(c[e]=s&&n(l,e)?l[e]:u("Symbol."+e)),c[e]}},6395:e=>{"use strict";e.exports="\t\n\v\f\r \u2028\u2029\ufeff"},8545:(e,t,r)=>{"use strict";var a=r(1091),i=r(8828),n=r(1793),o=r(6285),s=r(9298),d=r(575),l=r(8024),c=r(5543),u=r(6968),h=r(7171),_=r(6264),p=r(798),f=_("isConcatSpreadable"),m=p>=51||!i((function(){var e=[];return e[f]=!1,e.concat()[0]!==e})),g=function(e){if(!o(e))return!1;var t=e[f];return void 0!==t?!!t:n(e)};a({target:"Array",proto:!0,arity:1,forced:!m||!h("concat")},{concat:function(e){var t,r,a,i,n,o=s(this),h=u(o,0),_=0;for(t=-1,a=arguments.length;t<a;t++)if(g(n=-1===t?o:arguments[t]))for(i=d(n),l(_+i),r=0;r<i;r++,_++)r in n&&c(h,_,n[r]);else l(_+1),c(h,_++,n);return h.length=_,h}})},9363:(e,t,r)=>{"use strict";var a=r(7374),i=r(2156),n=r(3742),o=r(4932),s=r(4284).f,d=r(183),l=r(9550),c=r(7376),u=r(9447),h="Array Iterator",_=o.set,p=o.getterFor(h);e.exports=d(Array,"Array",(function(e,t){_(this,{type:h,target:a(e),index:0,kind:t})}),(function(){var e=p(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=null,l(void 0,!0);switch(e.kind){case"keys":return l(r,!1);case"values":return l(t[r],!1)}return l([r,t[r]],!1)}),"values");var f=n.Arguments=n.Array;if(i("keys"),i("values"),i("entries"),!c&&u&&"values"!==f.name)try{s(f,"name",{value:"values"})}catch(e){}},8537:()=>{},9721:(e,t,r)=>{"use strict";var a=r(1091),i=r(5582),n=r(6024),o=r(3930),s=r(1907),d=r(8828),l=r(2250),c=r(5594),u=r(3427),h=r(6656),_=r(9846),p=String,f=i("JSON","stringify"),m=s(/./.exec),g=s("".charAt),v=s("".charCodeAt),y=s("".replace),b=s(1..toString),w=/[\uD800-\uDFFF]/g,S=/^[\uD800-\uDBFF]$/,M=/^[\uDC00-\uDFFF]$/,E=!_||d((function(){var e=i("Symbol")("stringify detection");return"[null]"!==f([e])||"{}"!==f({a:e})||"{}"!==f(Object(e))})),R=d((function(){return'"\\udf06\\ud834"'!==f("\udf06\ud834")||'"\\udead"'!==f("\udead")})),T=function(e,t){var r=u(arguments),a=h(t);if(l(a)||void 0!==e&&!c(e))return r[1]=function(e,t){if(l(a)&&(t=o(a,this,p(e),t)),!c(t))return t},n(f,null,r)},k=function(e,t,r){var a=g(r,t-1),i=g(r,t+1);return m(S,e)&&!m(M,i)||m(M,e)&&!m(S,a)?"\\u"+b(v(e,0),16):e};f&&a({target:"JSON",stat:!0,arity:3,forced:E||R},{stringify:function(e,t,r){var a=u(arguments),i=n(E?T:f,null,a);return R&&"string"==typeof i?y(i,w,k):i}})},7024:(e,t,r)=>{"use strict";var a=r(5951);r(4840)(a.JSON,"JSON",!0)},8172:()=>{},6750:(e,t,r)=>{"use strict";var a=r(1091),i=r(9447),n=r(4284).f;a({target:"Object",stat:!0,forced:Object.defineProperty!==n,sham:!i},{defineProperty:n})},5264:(e,t,r)=>{"use strict";var a=r(1091),i=r(9846),n=r(8828),o=r(7170),s=r(9298);a({target:"Object",stat:!0,forced:!i||n((function(){o.f(1)}))},{getOwnPropertySymbols:function(e){var t=o.f;return t?t(s(e)):[]}})},3643:()=>{},5205:()=>{},1398:()=>{},7057:(e,t,r)=>{"use strict";var a=r(1470).charAt,i=r(160),n=r(4932),o=r(183),s=r(9550),d="String Iterator",l=n.set,c=n.getterFor(d);o(String,"String",(function(e){l(this,{type:d,string:i(e),index:0})}),(function(){var e,t=c(this),r=t.string,i=t.index;return i>=r.length?s(void 0,!0):(e=a(r,i),t.index+=e.length,s(e,!1))}))},929:(e,t,r)=>{"use strict";var a=r(1091),i=r(3930),n=r(1907),o=r(4239),s=r(2250),d=r(7136),l=r(2087),c=r(160),u=r(9367),h=r(663),_=r(7703),p=r(6264),f=r(7376),m=p("replace"),g=TypeError,v=n("".indexOf),y=n("".replace),b=n("".slice),w=Math.max;a({target:"String",proto:!0},{replaceAll:function(e,t){var r,a,n,p,S,M,E,R,T,k,x=o(this),A=0,C="";if(!d(e)){if((r=l(e))&&(a=c(o(h(e))),!~v(a,"g")))throw new g("`.replaceAll` does not allow non-global regexes");if(n=u(e,m))return i(n,e,x,t);if(f&&r)return y(c(x),e,t)}for(p=c(x),S=c(e),(M=s(t))||(t=c(t)),E=S.length,R=w(1,E),T=v(p,S);-1!==T;)k=M?c(t(S,T,p)):_(S,p,T,[],void 0,t),C+=b(p,A,T)+k,A=T+E,T=T+R>p.length?-1:v(p,S,T+R);return A<p.length&&(C+=b(p,A)),C}})},1995:()=>{},727:(e,t,r)=>{"use strict";var a=r(1091),i=r(5993).trim;a({target:"String",proto:!0,forced:r(5819)("trim")},{trim:function(){return i(this)}})},3997:(e,t,r)=>{"use strict";r(366)("asyncIterator")},3674:(e,t,r)=>{"use strict";var a=r(1091),i=r(5951),n=r(3930),o=r(1907),s=r(7376),d=r(9447),l=r(9846),c=r(8828),u=r(9724),h=r(8280),_=r(6624),p=r(7374),f=r(470),m=r(160),g=r(5817),v=r(8075),y=r(2875),b=r(4443),w=r(5407),S=r(7170),M=r(3846),E=r(4284),R=r(2220),T=r(2574),k=r(8055),x=r(9251),A=r(5816),C=r(2522),F=r(8530),P=r(6499),I=r(6264),O=r(560),D=r(366),L=r(3467),W=r(4840),N=r(4932),U=r(726).forEach,B=C("hidden"),V="Symbol",G="prototype",H=N.set,j=N.getterFor(V),z=Object[G],$=i.Symbol,q=$&&$[G],Y=i.RangeError,Q=i.TypeError,K=i.QObject,X=M.f,Z=E.f,J=w.f,ee=T.f,te=o([].push),re=A("symbols"),ae=A("op-symbols"),ie=A("wks"),ne=!K||!K[G]||!K[G].findChild,oe=function(e,t,r){var a=X(z,t);a&&delete z[t],Z(e,t,r),a&&e!==z&&Z(z,t,a)},se=d&&c((function(){return 7!==v(Z({},"a",{get:function(){return Z(this,"a",{value:7}).a}})).a}))?oe:Z,de=function(e,t){var r=re[e]=v(q);return H(r,{type:V,tag:e,description:t}),d||(r.description=t),r},le=function(e,t,r){e===z&&le(ae,t,r),_(e);var a=f(t);return _(r),u(re,a)?(r.enumerable?(u(e,B)&&e[B][a]&&(e[B][a]=!1),r=v(r,{enumerable:g(0,!1)})):(u(e,B)||Z(e,B,g(1,v(null))),e[B][a]=!0),se(e,a,r)):Z(e,a,r)},ce=function(e,t){_(e);var r=p(t),a=y(r).concat(pe(r));return U(a,(function(t){d&&!n(ue,r,t)||le(e,t,r[t])})),e},ue=function(e){var t=f(e),r=n(ee,this,t);return!(this===z&&u(re,t)&&!u(ae,t))&&(!(r||!u(this,t)||!u(re,t)||u(this,B)&&this[B][t])||r)},he=function(e,t){var r=p(e),a=f(t);if(r!==z||!u(re,a)||u(ae,a)){var i=X(r,a);return!i||!u(re,a)||u(r,B)&&r[B][a]||(i.enumerable=!0),i}},_e=function(e){var t=J(p(e)),r=[];return U(t,(function(e){u(re,e)||u(F,e)||te(r,e)})),r},pe=function(e){var t=e===z,r=J(t?ae:p(e)),a=[];return U(r,(function(e){!u(re,e)||t&&!u(z,e)||te(a,re[e])})),a};l||(k(q=($=function(){if(h(q,this))throw new Q("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?m(arguments[0]):void 0,t=P(e),r=function(e){var a=void 0===this?i:this;a===z&&n(r,ae,e),u(a,B)&&u(a[B],t)&&(a[B][t]=!1);var o=g(1,e);try{se(a,t,o)}catch(e){if(!(e instanceof Y))throw e;oe(a,t,o)}};return d&&ne&&se(z,t,{configurable:!0,set:r}),de(t,e)})[G],"toString",(function(){return j(this).tag})),k($,"withoutSetter",(function(e){return de(P(e),e)})),T.f=ue,E.f=le,R.f=ce,M.f=he,b.f=w.f=_e,S.f=pe,O.f=function(e){return de(I(e),e)},d&&(x(q,"description",{configurable:!0,get:function(){return j(this).description}}),s||k(z,"propertyIsEnumerable",ue,{unsafe:!0}))),a({global:!0,constructor:!0,wrap:!0,forced:!l,sham:!l},{Symbol:$}),U(y(ie),(function(e){D(e)})),a({target:V,stat:!0,forced:!l},{useSetter:function(){ne=!0},useSimple:function(){ne=!1}}),a({target:"Object",stat:!0,forced:!l,sham:!d},{create:function(e,t){return void 0===t?v(e):ce(v(e),t)},defineProperty:le,defineProperties:ce,getOwnPropertyDescriptor:he}),a({target:"Object",stat:!0,forced:!l},{getOwnPropertyNames:_e}),L(),W($,V),F[B]=!0},5084:()=>{},3313:(e,t,r)=>{"use strict";var a=r(1091),i=r(5582),n=r(9724),o=r(160),s=r(5816),d=r(4411),l=s("string-to-symbol-registry"),c=s("symbol-to-string-registry");a({target:"Symbol",stat:!0,forced:!d},{for:function(e){var t=o(e);if(n(l,t))return l[t];var r=i("Symbol")(t);return l[t]=r,c[r]=t,r}})},2596:(e,t,r)=>{"use strict";r(366)("hasInstance")},5721:(e,t,r)=>{"use strict";r(366)("isConcatSpreadable")},4954:(e,t,r)=>{"use strict";r(366)("iterator")},4452:(e,t,r)=>{"use strict";r(3674),r(3313),r(751),r(9721),r(5264)},751:(e,t,r)=>{"use strict";var a=r(1091),i=r(9724),n=r(5594),o=r(4640),s=r(5816),d=r(4411),l=s("symbol-to-string-registry");a({target:"Symbol",stat:!0,forced:!d},{keyFor:function(e){if(!n(e))throw new TypeError(o(e)+" is not a symbol");if(i(l,e))return l[e]}})},3377:(e,t,r)=>{"use strict";r(366)("matchAll")},4123:(e,t,r)=>{"use strict";r(366)("match")},2230:(e,t,r)=>{"use strict";r(366)("replace")},5344:(e,t,r)=>{"use strict";r(366)("search")},1660:(e,t,r)=>{"use strict";r(366)("species")},4610:(e,t,r)=>{"use strict";r(366)("split")},3669:(e,t,r)=>{"use strict";var a=r(366),i=r(3467);a("toPrimitive"),i()},4810:(e,t,r)=>{"use strict";var a=r(5582),i=r(366),n=r(4840);i("toStringTag"),n(a("Symbol"),"Symbol")},3325:(e,t,r)=>{"use strict";r(366)("unscopables")},768:(e,t,r)=>{"use strict";var a=r(6264),i=r(4284).f,n=a("metadata"),o=Function.prototype;void 0===o[n]&&i(o,n,{value:null})},6038:(e,t,r)=>{"use strict";r(929)},8549:(e,t,r)=>{"use strict";r(366)("asyncDispose")},1697:(e,t,r)=>{"use strict";r(366)("customMatcher")},7152:(e,t,r)=>{"use strict";r(366)("dispose")},3939:(e,t,r)=>{"use strict";r(1091)({target:"Symbol",stat:!0},{isRegisteredSymbol:r(2595)})},3422:(e,t,r)=>{"use strict";r(1091)({target:"Symbol",stat:!0,name:"isRegisteredSymbol"},{isRegistered:r(2595)})},1785:(e,t,r)=>{"use strict";r(1091)({target:"Symbol",stat:!0,forced:!0},{isWellKnownSymbol:r(9197)})},36:(e,t,r)=>{"use strict";r(1091)({target:"Symbol",stat:!0,name:"isWellKnownSymbol",forced:!0},{isWellKnown:r(9197)})},8703:(e,t,r)=>{"use strict";r(366)("matcher")},6878:(e,t,r)=>{"use strict";r(366)("metadataKey")},1372:(e,t,r)=>{"use strict";r(366)("metadata")},4664:(e,t,r)=>{"use strict";r(366)("observable")},9671:(e,t,r)=>{"use strict";r(366)("patternMatch")},359:(e,t,r)=>{"use strict";r(366)("replaceAll")},2560:(e,t,r)=>{"use strict";r(9363);var a=r(9287),i=r(5951),n=r(4840),o=r(3742);for(var s in a)n(i[s],s),o[s]=o.Array},2222:(e,t,r)=>{"use strict";var a=r(6823);e.exports=a},4598:(e,t,r)=>{"use strict";var a=r(1042);e.exports=a},8251:(e,t,r)=>{"use strict";var a=r(1926);e.exports=a},4139:(e,t,r)=>{"use strict";var a=r(3842);r(2560),e.exports=a},7045:(e,t,r)=>{"use strict";var a=r(1730);r(2560),e.exports=a},70:(e,t,r)=>{"use strict";var a=r(1661);e.exports=a}},t={};function r(a){var i=t[a];if(void 0!==i)return i.exports;var n=t[a]={exports:{}};return e[a].call(n.exports,n,n.exports,r),n.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var a in t)r.o(t,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e={};r.r(e),r.d(e,{APP_Troubleshoting_Info:()=>bl,Before_Create_Thread:()=>md,BigLog_js:()=>yu,Crop_Mask_Bg_16V9:()=>Sc,Exit_Thread:()=>pd,GetCscThreadNum:()=>nl,GetEncThreadNum:()=>ol,GetLogLevel_js:()=>bu,GetWebCodecsEncoderFallbackFlag_js:()=>tl,GetWebCodecsEncoderL1T2Flag_js:()=>el,Get_Mix_Context_Data_And_Draw:()=>Mc,Get_Mix_Display_Data_And_Draw:()=>Ac,Get_Mixed_VB_Data_and_Draw:()=>qc,IsSupportMultiThread:()=>Qd,IsSupportMultiThreadForWebcodec:()=>Xd,JsMediaSDK_Log:()=>Hi,LOG_OUT:()=>Rl,LimitWebCodecsDecoderTo360_js:()=>al,LimitWebCodecsEncoderTo360_js:()=>rl,MCMMonitor_Sharing_LOG:()=>Sl,MCMMonitor_Video_LOG:()=>wl,Open_Sharing_WebSocket_Connect:()=>fu,Put_Decoded_Video_Buffer:()=>Il,Qos_Update_Bandwidth:()=>Xc,Qos_Update_Video_Hd_info:()=>Zc,Recieve_Wb_Packet:()=>Ml,SAVE_IV:()=>xl,Send_Data:()=>Au,Send_Wb_Rtp_Packet:()=>El,Set_Enocding_Key_And_Roster:()=>Mu,Set_Enocding_Key_And_Roster_whiteboard:()=>Eu,Set_Mask_Bg_Image:()=>_c,SharingSendData:()=>Wu,SubScribeUpdateSharing:()=>Gl,SubScribeUpdateVideo:()=>Vl,Update_Mask_Texture:()=>wc,UserAgentIsTesla_js:()=>il,Utf8ArrayToStr:()=>kl,VideoEncodeInit:()=>ql,WebCodecsEncoderFail_impl:()=>su,change_capture_resolution:()=>cl,change_sharing_type:()=>Bl,decode_callback:()=>yl,frame_callback_mouse_video_mode:()=>th,frame_callback_video_mode:()=>eh,freeWasmMemory:()=>Cl,getGraphicName:()=>Zd,getVendorName:()=>Jd,getWasmMemory:()=>Al,hardcodecpunumber:()=>Kd,js_info_from_wcl_thread:()=>ml,js_info_from_wcl_video_data:()=>pl,media_data_transport_type_monitor:()=>hl,network_quality_callback:()=>du,on_psl_mix_share_info_changed:()=>_l,on_share_encode_start:()=>Fh,prepareJSFile:()=>Lc,prepareModelFile:()=>Oc,processed_capture_data_callback:()=>fl,qos_monitor:()=>Jc,release_video_channel_callback:()=>gl,responseSharingQosData:()=>Qc,responseVideoQosData:()=>Kc,share_rtcp_data:()=>Ih,share_rtp_data:()=>Ph,sharing_decode_channel_change:()=>rh,sharing_decode_websocket_on_close:()=>Bu,sharing_decode_websocket_on_command:()=>Vu,sharing_decode_websocket_on_message:()=>Uu,sharing_decode_websocket_on_open:()=>Nu,sharing_qos_monitor:()=>eu,sharing_statistics_monitor:()=>tu,sharing_websocket_on_message:()=>vu,sharing_websocket_on_open:()=>mu,vbLoadingTimer:()=>gd,video_process_capture:()=>jl,video_rtcp_data:()=>Dh,video_rtp_data:()=>Oh,video_statistics_monitor:()=>ru,video_websocket_on_open:()=>nd,videocodec_create_helpthread:()=>fd,videoencode_create_helpthread:()=>hd,wcl_trace_log:()=>Tl});var t=r(4997),a=r(2321),i=r(2231);function n(e){return n="function"==typeof a&&"symbol"==typeof i?function(e){return typeof e}:function(e){return e&&"function"==typeof a&&e.constructor===a&&e!==a.prototype?"symbol":typeof e},n(e)}var s=r(9280);function d(e,r,a){return(r=function(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[s];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}(r))in e?t(e,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[r]=a,e}const l=9,c=15,u=18,h=20,_=21,p=31,f=35,m=38,g=52,v=60,y=61,b=66.5,w=67,S=68,M=69,E=72,R=75,T=76,k=107,x=120,A=121,C=127,F=128,P=133,I=135,O=140,D=141,L=151,W=188,N=190,U=191,B=192,V=193,G=197,H=-26,j=-28,z="VIDEO_QOS_DATA",$="VIDEOSHARE_QOS_DATA",q="EXPOSE_VB_FRAME",Y="MEDIASDK_CACHE_INFO",Q=new class{constructor(){this._highFrequencyLogs={},this.fixVersion="",this.cacheLogStack=[],this.isFlushing=!1}setInstance(e,t){this._instance=e,this.fixVersion=t}getMessageFromErrorOrEvent(e,t){let r=e;return t instanceof ErrorEvent?(t.filename&&(r+=` File: ${t.filename}`),(t.lineno||t.colno)&&(r+=` Line: ${t.lineno}:${t.colno}`),t.message&&(r+=` Message: ${t.message}`),t.error&&(r+=`\nStack: ${t.error.stack}`)):t instanceof Error?(t.message&&(r+=` Message: ${t.message}`),t.stack&&(r+=` Stack: ${t.stack}`),t.name&&(r+=` Name: ${t.name}`),t.constraint&&(r+=` Constraint: ${t.constraint}`)):t instanceof CloseEvent?(t.code&&(r+=` Code: ${t.code}`),t.reason&&(r+=` Reason: ${t.reason}`),r+=` wasClean: ${t.wasClean}`):t instanceof DOMException?(t.message&&(r+=` Message: ${t.message}`),t.name&&(r+=` Name: ${t.name}`)):r+=t?t.toString():"",r}_addCacheLog(e,t){this.cacheLogStack.length<100&&this.cacheLogStack.push({type:e,message:t})}flushCacheLog(){if(this._instance&&this.cacheLogStack.length>0&&!this.isFlushing){this.isFlushing=!0;let e="";this.cacheLogStack.forEach((t=>{let{type:r,message:{message:a="",tags:i=[]}}=t;const n=a?`${i.join("|")}:${a}|----|`:"";switch(r){case"log":this._log(a,[...i,Y]);break;case"warn":case"error":case"severityerror":case"directReport":e+=n}})),e&&this._directReport(e,[Y]),this.cacheLogStack=[],this.isFlushing=!1}}log(e,t=[]){this._instance?(this.flushCacheLog(),this._log(e,t)):this._addCacheLog("log",{message:e,tags:t})}warn(e,t=null,r=[]){e=this.getMessageFromErrorOrEvent(e,t),this._instance?(this.flushCacheLog(),this._warn(e,r)):this._addCacheLog("warn",{message:e,tags:r})}error(e,t=null,r=[]){var a;e=this.getMessageFromErrorOrEvent(e,t),this._highFrequencyLogs[e]?this._highFrequencyLogs[e]+=1:this._highFrequencyLogs[e]=1,!((a=this._highFrequencyLogs[e])&a-1)&&(this._instance?(this.flushCacheLog(),this._error(e,r)):this._addCacheLog("error",{message:e,tags:r}))}severityerror(e,t=[]){this._instance?(this.flushCacheLog(),this._severityerror(JSON.stringify(e),t)):this._addCacheLog("severityerror",{message:JSON.stringify(e),tags:t})}directReport(e,t=["MEDIASDK_INFO"]){var r;this._instance?(this.flushCacheLog(),null===(r=this._directReport)||void 0===r||r.call(this,e,t)):this._addCacheLog("directReport",{message:e,tags:t})}_log(e,t=[]){this._instance&&this._instance.log(e,t)}_warn(e,t=[]){this._instance&&this._instance.warn(e,t)}_error(e,t=[]){this._instance&&this._instance.error(e,[this.fixVersion,...t])}_severityerror(e,t=[]){this._instance&&this._instance.error(e,t)}_directReport(e,t=[]){var r,a;this._instance&&(null===(a=(r=this._instance).directReport)||void 0===a||a.call(r,{msg:e},t))}clearHighFrequencyLogs(){this._highFrequencyLogs={}}};new Error;const K=new Map;function X(e,t="|"){return e?e.toString().replaceAll(/[,,]/g,t):""}const Z="function"!=typeof importScripts;function J(e){postMessage({status:f,data:e})}function ee(e,t=null){Z?Q.error(e,t):te(e,t)}function te(e,t=null){var r,a;if(t instanceof Error||t instanceof ErrorEvent){const i=t;e+=" Code: "+(null==i?void 0:i.code)+" Message: "+(null==t?void 0:t.message)+" Stack: "+(null!==(a=null===(r=null==i?void 0:i.error)||void 0===r?void 0:r.stack)&&void 0!==a?a:null==i?void 0:i.stack),t=null}postMessage({status:y,errorMessage:e,errorEvent:t})}function re(e){postMessage({status:y,errorMessage:e,level:"low"})}function ae(e){Z?function(e,t){if(!function(e){const t=performance.now();return(!K.has(e)||t-K.get(e)>5e3)&&(K.set(e,t),!0)}(e))return;let r;try{r=X("object"==typeof t?JSON.stringify(t):t)}catch(e){r=X(t)}Q.error(`NotifyUIError,event=${e},data=${r}`)}(-51,e):postMessage({status:-27,where:e})}function ie(){return self.GROWABLE_HEAP_U8?self.GROWABLE_HEAP_U8():Module.HEAPU8}function ne(e){postMessage({status:H,canvasId:e,replaceCanvas:!1})}function oe(e){postMessage({status:j,canvasId:e})}function se(e){let t;try{if(t=null==e?void 0:e.getContext("2d",{willReadFrequently:!0}),!t)throw new Error("getContext return null for willReadFrequently, canvas:".concat(e))}catch(r){t=null==e?void 0:e.getContext("2d")}return t||te("get2DContextFromCanvas return null"),t}class de{constructor(e){this.sharedBufferList=e}storeFlexible(e,t){let r=e.byteLength-this.sharedBufferList.bytesPerElement;if(r>0){let e=Math.floor(.1*this.sharedBufferList.bytesPerElement),a=r>e?r:e;if(a+this.sharedBufferList.bytesPerElement>t)return Promise.reject("too big, more than maxBytesPerElement");this.sharedBufferList.increaseBufferSize(a)}return this.store(e)}store(e){return this.sharedBufferList.get().then((t=>{try{return this.obj=t,t.uint8s.set(e,0),this.yuvdata=new Uint8Array(t.uint8s.buffer,0,e.byteLength),!0}finally{this.autoRecycle()}}))}storeSync(e){let t=this.sharedBufferList.getSync();return null!==t&&(this.obj=t,t.uint8s.set(e,0),this.yuvdata=new Uint8Array(t.uint8s.buffer,0,e.byteLength),!0)}autoRecycle(){this.autoRecycleInterval=setTimeout((()=>{console.log("autoRecycle",this.obj.index),this.recycle()}),5e3)}recycle(){try{this.autoRecycleInterval&&clearInterval(this.autoRecycleInterval),this.sharedBufferList.recycle(this.obj.index)}catch(e){te("Error in YuvWrap.recycle: ".concat(e))}}}const le=["","MOZ_","OP_","WEBKIT_"];function ce(e,t){for(var r=0;r<le.length;++r){var a=le[r]+t,i=e.getExtension(a);if(i)return i}}const ue=new Map,he=new class{constructor(){this.ssrcInfoMap=new Map,this.timer=null}updateSSRCInfo(e,t){this.ssrcInfoMap.has(e)||this.ssrcInfoMap.set(e,{firstTime:0,lastTime:0,frames:0,fps:0}),this._calculateFPS(e,t),this._removeZeroFPS()}_calculateFPS(e,t){const r=this.ssrcInfoMap.get(e);if(0===r.frames?r.firstTime=t:r.lastTime=t,r.frames+=1,r.frames>2&&r.frames%5==0&&r.lastTime-r.firstTime>=1e3){const t=Math.floor(1e3/((r.lastTime-r.firstTime)/(r.frames-1)));r.fps!==t&&(this._notifyFPS(e,t),r.fps=t),r.firstTime=r.lastTime,r.frames=1}}_removeZeroFPS(){let e=Date.now();this.ssrcInfoMap.forEach(((t,r)=>{const a=this.ssrcInfoMap.get(r);a&&a.lastTime&&e-a.lastTime>2e3&&(this.ssrcInfoMap.delete(r),this._notifyFPS(r,0))}))}_notifyFPS(e,t){postMessage({status:66.6,data:{ssrc:e,fps:t}})}_checkIfNewFrameComing(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout((()=>{this._removeZeroFPS(),this.timer=null}),2500)}},_e=new class{constructor(){this.ssrcInfoMap=new Map,this.timer=null}updateSSRCInfo(e,t){this.ssrcInfoMap.has(e)||this.ssrcInfoMap.set(e,{timeList:[],lastTime:0,fps:0}),this._calculateFPS(e,t),this._removeZeroFPS(),this._checkIfNewFrameComing()}_calculateFPS(e,t){const r=this.ssrcInfoMap.get(e);if(r.timeList.push(t),r.lastTime=t,r.timeList.length>2){const t=r.timeList[0],a=r.timeList[r.timeList.length-1];if(a-t>=1e3){const i=Math.floor(1e3/((a-t)/(r.timeList.length-1)));r.fps!==i&&(this._notifyFPS(e,i),r.fps=i),r.timeList=[]}}r.timeList.length>30&&(r.timeList=r.timeList.slice(r.timeList.length-30))}_removeZeroFPS(){this.ssrcInfoMap.forEach(((e,t)=>{const r=this.ssrcInfoMap.get(t);r&&Date.now()-r.lastTime>2e3&&(this.ssrcInfoMap.delete(t),this._notifyFPS(t,0))}))}_notifyFPS(e,t){postMessage({status:66.6,data:{ssrc:e,fps:t}})}_checkIfNewFrameComing(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout((()=>{this._removeZeroFPS(),this.timer=null}),2500)}};function pe(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const{r_w:i,r_h:n,rotation:o,ssrc:s}=e;let d=1==o||3==o,l=d?n:i,c=d?i:n;const u=s>>10<<10,h=function(e,t){const r=e*t;return r<36864?0:r<129600?1:r<36e4?2:r<144e4?3:4}(l,c);if(!ue.get(u)||ue.get(u).width!==l||ue.get(u).height!==c){const e={width:l,height:c,ssrc:u,quality:h};ue.set(u,e),r?r(e):postMessage({status:b,data:e})}t&&(a?_e:he).updateSSRCInfo(u,Date.now())}function fe(e){return e&&"undefined"!=typeof atob?Uint8Array.from(atob(e),(e=>e.charCodeAt(0))):null}function me(e,t){return t&&(!e||e.url!=t)}class ge{constructor(){this.readStream=null,this.reader=null,this.streamProcessor=null,this.videotrack=null,this.rotation=0,this.videotag=!1,this.isSafari=!1}setReadStream(e){this.closeReadStream(),e&&(this.rotation=0,this.videotag=!1,this.readStream=e,this.reader=e.getReader(),this.isSafari=!1)}closeReadStream(){try{var e;null===(e=this.videotrack)||void 0===e||e.stop(),this.videotag||(this.reader&&this.reader.releaseLock&&this.reader.releaseLock(),this.readStream&&this.readStream.cancel&&this.readStream.cancel())}catch(e){}finally{this.reader=null,this.readStream=null,this.streamProcessor=null,this.videotrack=null}}createReadStream(e,t){this.closeReadStream(),this.rotation=t,this.videotag=!0,this.isSafari=!0,e&&(this.videotrack=e,this.streamProcessor=new MediaStreamTrackProcessor({track:e}),this.readStream=this.streamProcessor.readable,this.reader=this.readStream.getReader())}setRotation(e){this.isSafari&&this.videotrack&&(this.rotation=e)}async read(){let{done:e,value:t}=await this.reader.read();return{done:e,value:t,rotation:this.rotation,videotag:this.videotag}}}function ve(e,t){postMessage({status:_,data:"".concat(e,":").concat(t)})}let ye=null,be=null;function we(e,t,r,a){const i=((e,t,r)=>{let a=1==r||3==r;return(a?t:e)>=1920&&(a?e:t)>=1080})(t,r,a);return be===e&&ye===i||(be=e,ye=i,postMessage({status:D,data:i})),i}function Se(){const e=self.wasmMemory;(!e||!e.buffer||0===e.buffer.byteLength)&&postMessage({status:-36})}const Me=1e3,Ee=5,Re=43,Te=44,ke=45,xe=10,Ae=11,Ce=12,Fe=-1,Pe=0,Ie=3,Oe={SESSION_TYPE_CONF:0,SESSION_TYPE_AUDIO:1,SESSION_TYPE_DESKSHARE:2,SESSION_TYPE_VIDEO:3,SESSION_TYPE_CHAT:4,SESSION_TYPE_TELEPHONE:5,SESSION_TYPE_ZC_PING:6,SESSION_TYPE_TOTAL_CNT:7},De=15,Le=10,We=1,Ne=2,Ue=3,Be=5,Ve=15,Ge=25,He={DESKTOP_SOURCE:0,UAC_SOURCE:1},je={SHARE_REMOTE_CONTROL_UAC_MOUSE:144,SHARE_REMOTE_CONTROL_UAC_JPEG_FRAME:145},ze=1,$e=(new Map([["useinbandfec",1],["maxaveragebitrate",48e3],["maxplaybackrate",24e3],["sprop-maxcapturerate",24e3],["sprop-stereo",null],["stereo",null]]),new Map([["useinbandfec",null],["maxaveragebitrate",96e3],["maxplaybackrate",48e3],["sprop-maxcapturerate",48e3],["sprop-stereo",1],["stereo",1]]),new Map([["useinbandfec",null],["maxaveragebitrate",96e3],["maxplaybackrate",48e3],["sprop-maxcapturerate",48e3],["sprop-stereo",1],["stereo",1]]),new Map([["useinbandfec",null],["maxaveragebitrate",128e3],["maxplaybackrate",48e3],["sprop-maxcapturerate",48e3],["sprop-stereo",1],["stereo",1]]),new Map([["useinbandfec",null],["maxaveragebitrate",128e3],["maxplaybackrate",48e3],["sprop-maxcapturerate",48e3],["sprop-stereo",1],["stereo",1]]),new Map([["useinbandfec",null],["maxaveragebitrate",96e3],["maxplaybackrate",48e3],["sprop-maxcapturerate",48e3]]),new Map([["useinbandfec",1],["maxaveragebitrate",64e3],["maxplaybackrate",24e3],["sprop-maxcapturerate",24e3],["sprop-stereo",null],["stereo",null]]),new Map([["stereo",1]]),0),qe=["intel","nvidia","apple","amd","qualcomm","arm"],Ye=.005,Qe=class{_drawWatermarkWithShadow(e){let{ctx:t,textPos:r,opacity:a,name:i}=e;t.fillStyle="rgba(0, 0, 0, ".concat(a,")"),t.fillText(i,r.x,r.y),t.fillStyle="rgba(255, 255, 255, ".concat(a,")"),t.fillText(i,r.x+1,r.y+1)}_getTransformInfo(e){let t,{canvas:r,position:a}=e;if(1===a)t={x:r.width/2,y:0,rateRadio:0,maxWidth:r.width};else if(2===a)t={x:r.width/2,y:r.height,rateRadio:0,maxWidth:r.width};else if(4===a)t={x:0,y:r.height/2,rateRadio:Math.PI/2,maxWidth:r.height};else if(8===a)t={x:r.width,y:r.height/2,rateRadio:-Math.PI/2,maxWidth:r.height};else{const e=-21*Math.PI/180;t={x:r.width/2,y:r.height/2,rateRadio:e,maxWidth:Math.min(r.width/Math.cos(e),-r.height/Math.sin(e))}}return t.maxWidth>100&&(t.maxWidth-=50),t}_calcTextPos(e){let{position:t,ctx:r,name:a,textWidth:i}=e;const n=this._getPaddingWidth({ctx:r,position:t,name:a});return 1===t?{x:-i.width/2,y:n}:2===t||4===t||8===t?{x:-i.width/2,y:-n}:{x:-i.width/2,y:r.measureText(a[0]).width/2}}_getPaddingWidth(e){let{ctx:t,position:r,name:a}=e;return[1,2,4,8].includes(r)?32:t.measureText(a[0]).width}_setBaseLine(e){let{ctx:t,position:r}=e;t.textBaseline=1===r?"top":2===r||4===r||8===r?"bottom":"middle"}Get_WaterMarkRGBA(e){let{canvas:t,name:r,width:a,height:i,opacity:n=.15,position:o,convertToDataUrl:s=!1,transferToImage:d=!1}=e;if(!r||!a||!i)return;n=n||.15,a*=1,i*=1,t.width=a,t.height=i;let l=this._getTransformInfo({canvas:t,position:o});var c=t.getContext("2d");let u;if(c.clearRect(0,0,t.width,t.height),c.translate(l.x,l.y),c.rotate(l.rateRadio),this._setBaseLine({ctx:c,position:o}),c.lineWidth=1,c.imageSmoothingEnabled=!0,1==r.length){const e=l.maxWidth/r.length;c.font=e+"px 'Segoe UI'",u=c.measureText(r)}else{let e=16;for(c.font=e+"px 'Segoe UI'",u=c.measureText(r);u.width<l.maxWidth-2*this._getPaddingWidth({ctx:c,position:o,name:r});)e+=1,c.font=e+"px 'Segoe UI'",u=c.measureText(r);if(u.width>l.maxWidth-2*this._getPaddingWidth({ctx:c,position:o,name:r}))if(e>16)e-=1,c.font=e+"px 'Segoe UI'",u=c.measureText(r);else{const e=r;for(;r.length>5&&u.width>l.maxWidth-2*this._getPaddingWidth({ctx:c,position:o,name:r+"..."});)r=r.slice(0,r.length-1),u=c.measureText(r+"...");e!==r&&(r+="...")}}const h=this._calcTextPos({position:o,ctx:c,name:r,textWidth:u});var _;if(this._drawWatermarkWithShadow({ctx:c,name:r,opacity:n,textPos:h}),s)_=t.toDataURL();else if(d)_=t.transferToImageBitmap();else{var p=c.getImageData(0,0,c.canvas.width,c.canvas.height);_=new Uint8Array(p.data.buffer)}return c.rotate(-l.rateRadio),c.translate(-l.x,-l.y),_}Get_Repeated_WaterMarkRGBA(e){let{canvas:t,name:r,width:a,height:i,opacity:n=.15,position:o,convertToDataUrl:s=!1,transferToImage:d=!1}=e;if(!r||!a||!i)return;n=n||.15,a*=1,i*=1,t.width=a,t.height=i;const l=t.getContext("2d");l.clearRect(0,0,t.width,t.height),l.translate(a/2,i/2),l.rotate(-21*Math.PI/180),l.imageSmoothingEnabled=!0,l.font="".concat(32,"px 'Segoe UI'"),l.textBaseline="top";const c=l.measureText(r),u=.37*c.width;let h,_=0,p=-i;do{let e=_%2==0?u-a:-a;do{l.fillStyle="rgba(0, 0, 0, ".concat(n,")"),l.fillText(r,e,p),l.fillStyle="rgba(255, 255, 255, ".concat(n,")"),l.fillText(r,e+1,p+1),e+=c.width+u}while(e<a);p+=32+u,_++}while(p<i);if(s)h=t.toDataURL();else if(d)h=t.transferToImageBitmap();else{const e=l.getImageData(0,0,l.canvas.width,l.canvas.height);h=new Uint8Array(e.data.buffer)}return l.rotate(21*Math.PI/180),l.translate(-a/2,-i/2),h}};function Ke(){this.a=[],this.b=0,this.residue=null}Ke.prototype.getLength=function(){return this.a.length-this.b},Ke.prototype.isEmpty=function(){return 0==this.a.length},Ke.prototype.enqueue=function(e){this.a.push(e)},Ke.prototype.dequeue=function(){if(0!=this.a.length){var e=this.a[this.b];return 2*++this.b>=this.a.length&&(this.a=this.a.slice(this.b),this.b=0),e}return null},Ke.prototype.peek=function(){return 0<this.a.length?this.a[this.b]:void 0},Ke.prototype.clear=function(){this.a=[],this.b=0};const Xe=Ke;function Ze(){this.ssrcQueueMap=new Map,Ze.prototype.AddQueue=function(e){var t=new Xe;return this.ssrcQueueMap.set(e,t),t},Ze.prototype.DeleteQueue=function(e){this.ssrcQueueMap.delete(e)},Ze.prototype.GetQueue=function(e){return this.ssrcQueueMap.get(e)},Ze.prototype.GetQueueData=function(e){return this.ssrcQueueMap.get(e).dequeue()},Ze.prototype.PutQueueData=function(e,t){this.ssrcQueueMap.get(e).enqueue(t)},Ze.prototype.GetQueueLength=function(e){var t=this.ssrcQueueMap.get(e);return null!==t?t.getLength():0}}var Je=function(){this.frames=0,this.ntp=new Xe};Je.prototype={UpdateVideoInfo:function(e){this.frames++,this.ntp.getLength()>30&&this.ntp.dequeue(),this.ntp.enqueue(e)},GetVideoFpsInfo:function(){var e=this.ntp.getLength();if(!(e<5)){for(var t=0,r=0,a=0,i=0,n=0;n<e;n++){var o=this.ntp.dequeue();0==o&&0==a?r++:0!=o?(i=0,0==a&&(a=o),t=o):0!=a&&t!=a&&0==o&&i++}return 0==t||t==a?0:e-r-i-1!=0?(t-a)/(e-r-i-1):0}}};var et=function(){this.ssrcInfoMap=new Map};function tt(){this.ssrcQueueMap=new Map,this.ssrcInfo=new et,tt.prototype.AddQueue=function(e){var t=new Xe;return this.ssrcQueueMap.set(e,t),t},tt.prototype.DeleteQueue=function(e){this.ssrcQueueMap.delete(e)},tt.prototype.GetQueue=function(e){return this.ssrcQueueMap.get(e)},tt.prototype.ClearQueue=function(){this.ssrcQueueMap.clear()},tt.prototype.GetQueueData=function(e){return this.ssrcQueueMap.get(e).dequeue()},tt.prototype.PutQueueData=function(e,t){this.ssrcQueueMap.get(e).enqueue(t)},tt.prototype.GetQueueLength=function(e){var t=this.ssrcQueueMap.get(e);return t?t.getLength():0},tt.prototype.UpdateInfo=function(e,t){this.ssrcInfo.UpdateSSRCInfo(e,t)},tt.prototype.GetFpsInfo=function(e){return this.ssrcInfo.GetSSRCFpsInfo(e)}}function rt(e){let{sessionid:t}=e;this.sessionid=t||0,this.map=new Map,this.VideoQueueMGR=new tt}et.prototype={UpdateSSRCInfo:function(e,t){var r=this.ssrcInfoMap.get(e);r||(r=new Je,this.ssrcInfoMap.set(e,r)),r.UpdateVideoInfo(t)},GetSSRCFpsInfo:function(e){var t=this.ssrcInfoMap.get(e);return t?t.GetVideoFpsInfo():0}},function(){function e(e){let{sessionid:t}=e;this.map=new Map,this.AudioQueueMGR=new Ze,this.timemap=new Map,this.sessionid=t||0}e.prototype.Add=function(e,t){this.map.set(e,t),this.AudioQueueMGR.AddQueue(e)},e.prototype.Clear=function(){this.map.clear()},e.prototype.Keys=function(){return this.map.keys()},e.prototype.UpdateSSRCTimeMap=function(e){this.timemap=e},e.prototype.GetSSRCTimeMap=function(e){return this.timemap?this.timemap.get(e):null}}(),rt.prototype.Add=function(e,t){this.map.set(e,t)},rt.prototype.Clear=function(){this.map.clear()},rt.prototype.Keys=function(){return this.map.keys()};var at=function(){this.frames=0,this.ntp=new Xe};at.prototype={UpdateSharingInfo:function(e){this.frames++,this.ntp.getLength()>30&&this.ntp.dequeue(),this.ntp.enqueue(e)},GetSharingFpsInfo:function(){var e=this.ntp.getLength();if(!(e<5)){for(var t=0,r=0,a=0,i=0,n=0;n<e;n++){var o=this.ntp.dequeue();0==o&&0==a?r++:0!=o?(i=0,0==a&&(a=o),t=o):0!=a&&t!=a&&0==o&&i++}return 0==t||t==a?0:e-r-i-1!=0?(t-a)/(e-r-i-1):0}}};var it=function(){this.ssrcInfoMap=new Map};function nt(){this.ssrcQueueMap=new Map,this.ssrcInfo=new it,nt.prototype.AddQueue=function(e){var t=new Xe;return this.ssrcQueueMap.set(e,t),t},nt.prototype.DeleteQueue=function(e){this.ssrcQueueMap.delete(e)},nt.prototype.GetQueue=function(e){return this.ssrcQueueMap.get(e)},nt.prototype.ClearQueue=function(){this.ssrcQueueMap.clear()},nt.prototype.GetQueueData=function(e){return this.ssrcQueueMap.get(e).dequeue()},nt.prototype.PutQueueData=function(e,t){this.ssrcQueueMap.get(e).enqueue(t)},nt.prototype.GetQueueLength=function(e){var t=this.ssrcQueueMap.get(e);return t?t.getLength():0},nt.prototype.UpdateInfo=function(e,t){this.ssrcInfo.UpdateSSRCInfo(e,t)},nt.prototype.GetFpsInfo=function(e){return this.ssrcInfo.GetSSRCFpsInfo(e)}}function ot(e){let{sessionid:t}=e;this.map=new Map,this.sQueue=new Xe,this.SharingQueueMGR=new nt,this.sessionid=t||0}it.prototype={UpdateSSRCInfo:function(e,t){var r=this.ssrcInfoMap.get(e);r||(r=new at,this.ssrcInfoMap.set(e,r)),r.UpdateSharingInfo(t)},GetSSRCFpsInfo:function(e){var t=this.ssrcInfoMap.get(e);return t?t.GetSharingFpsInfo():0}},ot.prototype.Clear=function(){this.map.clear()},ot.prototype.Keys=function(){return this.map.keys()},ot.prototype.Add=function(e,t){this.map.set(e,t)},ot.prototype.Get=function(e){return this.map.get(e)},ot.prototype.PutData=function(e){e&&this.sQueue&&this.sQueue.enqueue(e)},ot.prototype.GetData=function(){if(this.sQueue)return this.sQueue.dequeue()},ot.prototype.ClearBuffer=function(){this.sQueue&&(this.sQueue=new Xe)};const st=512,dt=288;function lt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function ct(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?lt(Object(r),!0).forEach((function(t){d(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const ut=function(e,t){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:16/9;if(!e||!t)return null;const a=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:0)||0,i=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:0)||0;if(e/t>r){const n=t*r;return{width:n,height:t,left:Math.round((e-n)/2)+a,top:0+i}}{const n=e/r;return{width:e,height:n,left:0+a,top:Math.round((t-n)/2)+i}}};function ht(e,t,r){function a(e,t){return Math.min("px"===e.unit?e.value/t:e.value/100,.5)}return{radius_lb_x:a(e.topLeft.x,t),radius_lb_y:a(e.topLeft.y,r),radius_lt_x:a(e.bottomLeft.x,t),radius_lt_y:a(e.bottomLeft.y,r),radius_rb_x:a(e.topRight.x,t),radius_rb_y:a(e.topRight.y,r),radius_rt_x:a(e.bottomRight.x,t),radius_rt_y:a(e.bottomRight.y,r)}}const _t={radius_lb_x:0,radius_lb_y:0,radius_lt_x:0,radius_lt_y:0,radius_rb_x:0,radius_rb_y:0,radius_rt_x:0,radius_rt_y:0};function pt(e){this.Notify_APPUI=e.Notify_APPUI,this.isSupportOffscreenCanvas=e.isSupportOffscreenCanvas,this.jsMediaEngine=e.jsMediaEngine,this.threadNumbs=e.videodecodethreadnumb,this.globalTracingLogger=e.globalTracingLogger,this.monitorLoggerFn=e.monitorLoggerFn,this.renderManager=e.renderManager,this.isLSSPlayer=e.isLSSPlayer,this.waterMarkCanvas=null,this.videoRenderLevel=10,this.videoRenderLevelCount=1,this.renderPeriodTotal=100,this.renderPeriodCount=0,this.renderPeriodTotalFps=0,this.renderPeriodFpsCount=0,this.lastRenderAudioTimeStamp=0,this.videoBufEmptyCount=0,this.videoBufCount=0,this.videoRenderMaxLevel=15,this.timestamp=0,this.audioPlayTime=0,this.videoTimestamp=0,this.videoWaterMarkName="",this.isCreateVideoWaterMark=!1,this.isWaterMarkRepeatedEnable=!1,this.waterMarkOpacity=.15,this.currentactive=0,this.audioPlaySsrc=0,this.currentVideoHeight=0,this.currentVideoWidth=0,this.videoRenderArray=[],this.WaterMarkRGBA=new Qe,this.vMonitorCount=0,this.videoQueue=new tt,this.timestart=0,this.rendingFlag=!0,this.rAFID=0,this.rAFIDBack=null,this.prevRequestAnimationTimestap=0,this.retryRequestAnimationStep=2,this.ssrcDisplayMap=new Map,this.ssrcHaddataMap=new Map,this.zoneLastRenderedMap=new Map,this.ssrcCurrentRenderingMap=new Map,this.pauseSet=new Set,this.canvasToLocalDisplay=new Map,this.canvasIdSet=new Set,this.selfvideossrc=0,this.localVideoPtr=0,this.sabBuffer=0,this.localvideossrc=0,this.encodedVideoSharedArrayBufferUint8Array=null,this.encodedVideoSharedArrayBufferUint16Array=null,this.encodedVideoSharedArrayWasmMemory=null,this.startCaptureVideo=!1,this.clearColor=new Uint8Array(4),this.videorendercanvas=null,this.keyrender=null,this.renderIndex=0,this.activeSpeakssrc=0,this.renderMode=0,this.intervalHandle,this.croppingParams={top:0,left:0,height:1,width:1},this.coordinate={x:0,y:0,width:640,height:360},this.bWebglContextLostProtectingMap=new Map,this.ismirror=!1,this.firstFrameMap=new Map,this.lfTimeStamp=0,this.activeFps=0,this.lastActiveSSRC=0,this.disableOriginalRatio=!1,this.onStopDrawCallback=e.onStopDrawCallback,this.onReStoreCallback=e.onReStoreCallback,this.videoRenderWGLFSTOP=!1}pt.prototype.clearUseridRender=function(e,t,r,a){let i=e[0],n=i.display;if(n)if(!a&&n.setWatermarkFlag(0),this.renderMode)n.clearCanvas(t);else{let e=i.ssrc;if(!n||!t)return;this.croppingParams.top=0,this.croppingParams.left=0,this.croppingParams.height=1,this.croppingParams.width=1,this.clearColor[0]=255*t.R,this.clearColor[1]=255*t.G,this.clearColor[2]=255*t.B,this.clearColor[3]=255*t.A;const a=this.renderManager.getRendererProvider().isWebGLRendererType(),o=this.renderManager.getRendererProvider().isWebGL2RendererType(),s=this.renderManager.getRendererProvider().isWebGPURendererType();if(a||o){let e=this.canvasToLocalDisplay.get(i.canvas);if(!e)return;e.setVideoMode(Pe),e.colorRange=0,e.setFillMode(1,1),e.setRoundedCornerRadius(_t),e.updateSelfVideoTextures(1,1,this.clearColor,this.croppingParams,!0),void 0===r&&((r={}).x=i.x,r.y=i.y,r.width=i.width,r.height=i.height),e.drawSelfVideo(r,!0)}else if(s){if(!n)return;n.setVideoMode(Pe),n.setColorRange(0),n.setFillMode(1,1),n.setRoundedCornerRadius(_t),n.updateSelfVideoTextures(1,1,this.clearColor,this.croppingParams,!0),void 0===r&&((r={}).x=i.x,r.y=i.y,r.width=i.width,r.height=i.height),n.drawSelfVideo(r,!0)}let d=this;this.ssrcDisplayMap.forEach((function(t,r){let i,n;d.selfvideossrc&&r==d.Get_Logical_SSrc(d.selfvideossrc)&&(i=!0),r==d.Get_Logical_SSrc(e)&&(n=!0),t.forEach((e=>{if(!e.haddata||n)return;let t=e.display;d.coordinate.x=e.x,d.coordinate.y=e.y,d.coordinate.width=e.width,d.coordinate.height=e.height,t&&(!n||a&&o?t.getVideoMode()!=Fe&&(-1==[Pe,Ie].indexOf(t.getVideoMode())&&i?t.drawSelfVideo(d.coordinate,!1,d.ismirror):i?t.drawRemoteVideo(d.coordinate,d.ismirror):t.drawRemoteVideo(d.coordinate)):(t.drawSelfVideo(d.coordinate,!0),this.isLSSPlayer&&d.firstFrameMap.get(e.ssrc)&&d.firstFrameMap.delete(e.ssrc)))}))})),this.renderManager.renderFor(1)}},pt.prototype.Set_Render_Array_rAF=function(e){if(this.videoRenderArray=e,this.ssrcDisplayMap.clear(),this.ssrcHaddataMap.clear(),this.videoRenderArray.length>0)for(let e=0;e<this.videoRenderArray.length;e++){let t=this.ssrcDisplayMap.get(this.Get_Logical_SSrc(this.videoRenderArray[e].ssrc));t?t.push(this.videoRenderArray[e]):(t=[],t.push(this.videoRenderArray[e]),this.ssrcDisplayMap.set(this.Get_Logical_SSrc(this.videoRenderArray[e].ssrc),t),this.ssrcHaddataMap.set(this.Get_Logical_SSrc(this.videoRenderArray[e].ssrc),!1))}},pt.prototype.Set_Render_Array=function(e,t){this.renderMode?this.Set_Render_Array_IntervalMode(e,t):this.Set_Render_Array_rAF(e)},pt.prototype.ClearQueue=function(){this.videoQueue&&this.videoQueue.ClearQueue(),this.currentVideoHeight=0,this.currentVideoWidth=0},pt.prototype.Put_Video_Into_Buffer=function(e){if(this.videoQueue){var t=this.videoQueue.GetQueue(e.ssrc);if(t||(t=this.videoQueue.AddQueue(e.ssrc)),t.enqueue(e),this.videoQueue&&this.videoQueue.ssrcInfo){var r=e.ssrc>>10;this.videoQueue.ssrcInfo.UpdateSSRCInfo(r,e.ntptime)}for(var a=this.videoQueue.GetQueueLength(e.ssrc)-10;a>=0;)a--}},pt.prototype.Update_RemoteVideo_Texture=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,n=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(this.Check_Request_Animation(),t)if(e&&r){let t=this.Get_Logical_SSrc(r),o=this.FindVideoRenderListFromMap(r);if(!o.length)return void this.renderManager.destroyUnusedVideoFrame(e);let s=this,d=n&&(1==a||3==a);this.ssrcHaddataMap.set(t,!0),i?(this.croppingParams.top=i.y,this.croppingParams.left=i.x,this.croppingParams.height=i.height,this.croppingParams.width=i.width):(this.croppingParams.top=e.visibleRect?0:e.cropTop,this.croppingParams.left=e.visibleRect?0:e.cropLeft,this.croppingParams.height=e.visibleRect?e.visibleRect.height:e.cropHeight,this.croppingParams.width=e.visibleRect?e.visibleRect.width:e.cropWidth);let{width:l,height:c}=e.visibleRect||{};if(l&&c||(c=this.croppingParams.height,l=this.croppingParams.width),d){let e=c;c=l,l=e,e=this.croppingParams.height,this.croppingParams.height=this.croppingParams.width,this.croppingParams.width=e}n&&(a=0),this.canvasIdSet.clear(),o&&o.forEach((t=>{t.haddata=!0;let r=t.display;s.coordinate.x=t.x,s.coordinate.y=t.y,s.coordinate.width=t.width,s.coordinate.height=t.height;let i=!(r&&r.reuse&&t.rendercanvasID&&this.canvasIdSet.has(t.rendercanvasID));r&&(r.setVideoMode(Pe),s.Should_Update_Watermark(r,t.width,t.height,t.width,t.height)&&s.Update_Display_Watermark(r,t.width,t.height,t.width,t.height),e&&r.updateRemoteVideoTexturesImageBitmap(l,c,e,s.croppingParams,a,i),this.canvasIdSet.add(t.rendercanvasID))}))}else this.renderManager.destroyUnusedVideoFrame(e);else{if(e&&e.ssrc){let t=this.Get_Logical_SSrc(e.ssrc);if(this.isLSSPlayer&&this.pauseSet.has(t+" "+e.zone))return;let r,a=this.FindVideoRenderListFromMap(e.ssrc);if(!a.length)return e.yuvdataptr&&Module._free(e.yuvdataptr),void this.renderManager.destroyUnusedVideoFrame(e);let i=!1,n=this;this.ssrcHaddataMap.set(t,!0);let o=e;this.croppingParams.top=o.r_y,this.croppingParams.left=o.r_x,this.croppingParams.height=o.r_h,this.croppingParams.width=o.r_w,r=o,r.enableMultiDecodeVideoWithoutSAB?r.yuvdata=r.data:r.yuvdata=ie().subarray(r.yuvdataptr,r.yuvdataptr+r.yuvlength),!r.yuvdata.length||r.yuvdata.length!=r.width*r.height*3/2||this.croppingParams.top<0||this.croppingParams.left<0||this.croppingParams.left+this.croppingParams.width>r.width||this.croppingParams.top+this.croppingParams.height>r.height||a&&(this.canvasIdSet.clear(),a.forEach((e=>{e.haddata=!0;let a=e.display;n.coordinate.x=e.x,n.coordinate.y=e.y,n.coordinate.width=e.width,n.coordinate.height=e.height;let o=!(a&&a.reuse&&e.rendercanvasID&&this.canvasIdSet.has(e.rendercanvasID));a&&(a.setVideoMode(1),this.Should_Update_Watermark(a,e.width,e.height,e.width,e.height)&&this.Update_Display_Watermark(a,e.width,e.height,e.width,e.height),r&&(this.isLSSPlayer&&this.ssrcCurrentRenderingMap.set(t,r),a.updateRemoteVideoTextures(r.width,r.height,n.croppingParams,r.yuvdata,r.rotation,r.yuv_limited,n.coordinate,i,o)),this.canvasIdSet.add(e.rendercanvasID))})))}else this.renderManager.destroyUnusedVideoFrame(e);e.yuvdataptr&&Module._free(e.yuvdataptr)}},pt.prototype.Set_Cropping_Mode=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.disableOriginalRatio=!!e},pt.prototype.Update_Cropping_Params=function(){if(this.disableOriginalRatio){const e=ut(this.croppingParams.width,this.croppingParams.height,this.croppingParams.left,this.croppingParams.top);e&&(this.croppingParams=ct(ct({},this.croppingParams),e))}},pt.prototype.Update_SelfVideo_Texture=function(e,t,r,a){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Pe,n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0;if(n?(this.croppingParams.top=n.top,this.croppingParams.left=n.left,this.croppingParams.width=n.width,this.croppingParams.height=n.height):(this.croppingParams.top=0,this.croppingParams.left=0,this.croppingParams.height=t,this.croppingParams.width=e),this.renderMode){let n=0;this.canvasIdSet.clear();const s=this.FindVideoRenderList(a);for(;n<s.length;n++){this.coordinate.x=s[n].x,this.coordinate.y=s[n].y,this.coordinate.width=s[n].width,this.coordinate.height=s[n].height,this.Update_Cropping_Params(),s[n].display.setVideoMode(i);const{display:a,width:d,height:l}=s[n];this.Should_Update_Watermark(a,d,l,d,l)&&this.Update_Display_Watermark(a,d,l,d,l);let c=!(a&&a.reuse&&s[n].rendercanvasID&&this.canvasIdSet.has(s[n].rendercanvasID));-1!==[Pe,Ie].indexOf(i)?(s[n].display.updateSelfVideoTextures(e,t,r,this.croppingParams,c,o),s[n].enableMultiDecodeVideoWithoutSAB?s[n].firstFrame=!0:s[n].display.drawSelfVideo(this.coordinate,!1,this.ismirror)):(s[n].display.updateRemoteVideoTextures(e,t,this.croppingParams,r,o,0,this.coordinate,!1,c),s[n].enableMultiDecodeVideoWithoutSAB?s[n].firstFrame=!0:s[n].display.drawRemoteVideo(this.coordinate,this.ismirror)),this.canvasIdSet.add(s[n].rendercanvasID)}this.renderManager.renderFor(1)}else if(r&&a){let n=this.FindVideoRenderListFromMap(a);this.ssrcHaddataMap.set(a,!0);let s=this;n.length&&(this.canvasIdSet.clear(),n.forEach((a=>{a.haddata=!0,s.coordinate.x=a.x,s.coordinate.y=a.y,s.coordinate.width=a.width,s.coordinate.height=a.height,s.Update_Cropping_Params();let n=a.display,d=!(n&&n.reuse&&a.rendercanvasID&&this.canvasIdSet.has(a.rendercanvasID));n&&(n.setVideoMode(i),s.Should_Update_Watermark(n,a.width,a.height,a.width,a.height)&&s.Update_Display_Watermark(n,a.width,a.height,a.width,a.height),-1!==[Pe,Ie].indexOf(i)?n.updateSelfVideoTextures(e,t,r,s.croppingParams,d,o):n.updateRemoteVideoTextures(e,t,s.croppingParams,r,o,!0,s.coordinate,!1,d),this.canvasIdSet.add(a.rendercanvasID))})),this.renderManager.renderFor(1))}},pt.prototype.Draw_Send_Video_Img=function(e,t,r,a){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Pe,n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;this.Update_SelfVideo_Texture(t,r,e,a,i,n)},pt.prototype.setMirrorMyVideoOption=function(e){this.ismirror=e},pt.prototype.Start_Draw=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;return this.rendingFlag=!0,this.renderMode=e,e?t?(this.intervalHandle=setInterval(this.JsMediaSDK_VideoRender_interval.bind(this),t),this.intervalHandle):null:(function(e){if(e)vt=e}(this),this.Start_Request_Animation_Frame())},pt.prototype.Stop_Draw=function(){this.rendingFlag=!1,this.renderMode?clearInterval(this.intervalHandle):this.Stop_Request_Animation_Frame()},pt.prototype.contextLostCallback=function(e){let t=e.currentTarget.canvasId;mt&&ne(t),e.preventDefault()},pt.prototype.contextRestoredCallback=function(e){let t=e.currentTarget,r=t.canvasId,a=t.callback;this.Restored_From_Context_Lost(t,t,r,this.Log_Error.bind(this),a),this.onReStoreCallback&&this.onReStoreCallback(this),mt&&oe(r)},pt.prototype.webGLContextLostProtect=function(e,t,r){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;t&&t!==e&&(t.contextLostHandler&&t.removeEventListener("webglcontextlost",t.contextLostHandler),t.contextRestoredHandler&&t.removeEventListener("webglcontextrestored",t.contextRestoredHandler)),e&&!this.bWebglContextLostProtectingMap.get(e)&&(e.canvasId=r,e.callback=a,this.renderMode||((t=this.bWebglContextLostProtectingMap.get(r))&&(t.removeEventListener("webglcontextlost",t.contextLostHandler),t.removeEventListener("webglcontextrestored",t.contextRestoredHandler)),this.bWebglContextLostProtectingMap.set(r,e),e.contextLostHandler=this.contextLostCallback.bind(this),e.contextRestoredHandler=this.contextRestoredCallback.bind(this),e.addEventListener("webglcontextlost",e.contextLostHandler,{capture:!1}),e.addEventListener("webglcontextrestored",e.contextRestoredHandler,{capture:!1})))},pt.prototype._Replace_Video_Render_Array_From_Context_LOST=function(e){let{canvas:t,oldCanvas:r,newDisplayMap:a}=e;for(let e=0;e<this.videoRenderArray.length;e++)if(this.videoRenderArray[e].canvas===r||this.videoRenderArray[e].canvas===t){r!==t&&(this.videoRenderArray[e].canvas=t);const n=this.videoRenderArray[e].display.getFillMode();var i;this.videoRenderArray[e].display=a?a.get(this.videoRenderArray[e].display.getTextureIndex()):this._Create_WebGL_Canvas({videoRenderArrayIndex:e,canvas:t,canvasId:this.videoRenderArray[e].rendercanvasID}),n&&this.videoRenderArray[e].display&&this.videoRenderArray[e].display.setFillMode(n,this.videoRenderArray[e].display.getFillModeForResolution()),this.videoRenderArray[e].borderRadius&&(null===(i=this.videoRenderArray[e].display)||void 0===i||i.setRoundedCornerRadius(this.videoRenderArray[e].borderRadius))}},pt.prototype.Restored_From_Context_Lost=function(e,t,r,a){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;if(this.renderMode)this._Replace_Video_Render_Array_From_Context_LOST({canvas:e,oldCanvas:t});else{const n=this.renderManager.onRestoredFromContextLost(r,e,t,this.threadNumbs,a,this.canvasToLocalDisplay);n&&(this.ssrcDisplayMap.forEach(((r,a)=>{r.forEach((r=>{if(r.haddata=!1,r.canvas===t){t!==e&&(r.canvas=e);let a=r.display;r.display=n.get(a.getTextureIndex())}}))})),this._Replace_Video_Render_Array_From_Context_LOST({canvas:e,oldCanvas:t,newDisplayMap:n}),null==i||i({canvas:e,oldCanvas:t,newDisplayMap:n}),this.rendingFlag&&this.Start_Request_Animation_Frame())}},pt.prototype.Replace_Canvas=function(e,t){let r=null;this.bWebglContextLostProtectingMap.forEach(((e,a)=>{a===t&&(r=e)})),r!=e&&(this.bWebglContextLostProtectingMap.delete(t),this.webGLContextLostProtect(e,r,t),this.Restored_From_Context_Lost(e,r,t,this.Log_Error.bind(this))),this.isSupportOffscreenCanvas&&(this.waterMarkCanvas||this.videorendercanvas)&&(this.waterMarkCanvas=this.videorendercanvas=new OffscreenCanvas(640,360))},pt.prototype.Get_Display=function(e,t,r){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;const i=this.renderManager.getRendererProvider().isWebGLRendererType(),n=this.renderManager.getRendererProvider().isWebGL2RendererType();return(i||n)&&this.webGLContextLostProtect(e,null,t,a),this.renderManager.getVideoRenderDisplay(e,t,this.threadNumbs,this.Log_Error.bind(this),this.canvasToLocalDisplay)},pt.prototype.GiveBack_Display=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=e[0];r&&r.display&&this.renderManager.recycleRenderDisplay(r.canvas,r.display,t)},pt.prototype.Get_Logical_SSrc=function(e){return e?e>>10<<10:-1},pt.prototype.Set_LocalVideo_Ptr=function(e){e&&(this.localVideoPtr=e)},pt.prototype.Set_LocalVideo_Buffer=function(e){e&&(this.encodedVideoSharedArrayWasmMemory=e,this.sabBuffer=e.buffer,this.encodedVideoSharedArrayBufferUint8Array=new Uint8Array(this.sabBuffer),this.encodedVideoSharedArrayBufferUint16Array=new Uint16Array(this.sabBuffer))},pt.prototype.Set_LocalVideo_SSRC=function(e){e&&(this.localvideossrc=e,this.selfvideossrc=e)},pt.prototype.Draw_LocalVideo=function(){if(this.localVideoPtr&&this.sabBuffer&&this.localvideossrc){this.encodedVideoSharedArrayWasmMemory&&this.encodedVideoSharedArrayWasmMemory.buffer!=this.sabBuffer&&(this.encodedVideoSharedArrayBufferUint8Array=new Uint8Array(this.encodedVideoSharedArrayWasmMemory.buffer),this.encodedVideoSharedArrayBufferUint16Array=new Uint16Array(this.encodedVideoSharedArrayWasmMemory.buffer),this.sabBuffer=this.encodedVideoSharedArrayWasmMemory.buffer);let e=Atomics.load(this.encodedVideoSharedArrayBufferUint8Array,this.localVideoPtr),t=Atomics.load(this.encodedVideoSharedArrayBufferUint8Array,this.localVideoPtr+1),r=!0;if(e==t&&(r=!1),e-t==1&&(e=(e+1)%5),r){let t=0,r=this.encodedVideoSharedArrayBufferUint16Array[this.localVideoPtr/2+(4+8294414*e)/2],a=this.encodedVideoSharedArrayBufferUint16Array[this.localVideoPtr/2+(4+8294414*e+2)/2],i=this.encodedVideoSharedArrayBufferUint16Array[this.localVideoPtr/2+(4+8294414*e+4)/2],n=this.encodedVideoSharedArrayBufferUint16Array[this.localVideoPtr/2+(4+8294414*e+6)/2],o=this.encodedVideoSharedArrayBufferUint16Array[this.localVideoPtr/2+(4+8294414*e+8)/2],s=this.encodedVideoSharedArrayBufferUint16Array[this.localVideoPtr/2+(4+8294414*e+10)/2],d=this.encodedVideoSharedArrayBufferUint16Array[this.localVideoPtr/2+(4+8294414*e+12)/2],l=255&d,c=d>>8&255;t=l&&l!==Ie?r*a*3/2:r*a*4,this.croppingParams.top=i,this.croppingParams.left=n,this.croppingParams.height=s,this.croppingParams.width=o;let u=this.encodedVideoSharedArrayBufferUint8Array.subarray(this.localVideoPtr+4+8294414*e+4+8+2,this.localVideoPtr+4+8294414*e+4+8+2+t);this.Update_SelfVideo_Texture(r,a,u,this.Get_Logical_SSrc(this.localvideossrc),l,this.croppingParams,c),Atomics.store(this.encodedVideoSharedArrayBufferUint8Array,this.localVideoPtr,(e+1)%5)}}},pt.prototype.Update_LocalVideo=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=this.localvideossrc;if(this.renderMode){let i=0,n=0,o=!1,s=this.FindVideoRenderList(a),d=r&&(1==t||3==t);for(;n<s.length;n++){o=!0;let a=e;this.croppingParams.top=a.visibleRect?0:a.cropTop,this.croppingParams.left=a.visibleRect?0:a.cropLeft,this.croppingParams.height=a.visibleRect?d?a.visibleRect.width:a.visibleRect.height:a.cropHeight,this.croppingParams.width=a.visibleRect?d?a.visibleRect.height:a.visibleRect.width:a.cropWidth,this.coordinate.x=s[n].x,this.coordinate.y=s[n].y,this.coordinate.width=s[n].width,this.coordinate.height=s[n].height,this.Update_Cropping_Params(),s[n].display.setVideoMode(i);const{display:l,width:c,height:u}=s[n];0!=c&&0!=u&&(this.Should_Update_Watermark(l,c,u,c,u)&&this.Update_Display_Watermark(l,c,u,c,u),-1!==[Pe,Ie].indexOf(i)&&(s[n].display.updateRemoteVideoTexturesImageBitmap(this.croppingParams.width,this.croppingParams.height,a,this.croppingParams,r?0:t),s[n].enableMultiDecodeVideoWithoutSAB?s[n].firstFrame=!0:s[n].display.drawSelfVideo(this.coordinate,!1,this.ismirror)))}o||this.renderManager.destroyUnusedVideoFrame(e)}else this.Update_RemoteVideo_Texture(e,!0,a,t,null,r)},pt.prototype.Set_Capture_Video_Flag=function(e){this.startCaptureVideo=e},pt.prototype.Get_Capture_Video_Flag=function(){return this.startCaptureVideo},pt.prototype.FindVideoRender=function(e){if(!e)return null;for(let t=0;t<this.videoRenderArray.length;t++)if(this.videoRenderArray[t].ssrc&&this.videoRenderArray[t].ssrc>>10==e>>10)return this.videoRenderArray[t];return null},pt.prototype.FindVideoRenderList=function(e){let t=this.isActiveSeakerSsrc(e),r=this.FindVideoRender(1),a=[e>>10];t&&r&&a.push(0);let i=[];for(let e=0;e<this.videoRenderArray.length;e++)this.videoRenderArray[e].ssrc&&a.includes(this.videoRenderArray[e].ssrc>>10)&&i.push(this.videoRenderArray[e]);return i},pt.prototype.FindVideoRenderListFromMap=function(e){let t=this.isActiveSeakerSsrc(e),r=[...this.ssrcDisplayMap.get(this.Get_Logical_SSrc(e))||[]];if(t){let e=this.ssrcDisplayMap.get(this.Get_Logical_SSrc(1))||[];r.push(...e)}return r},pt.prototype.JsMediaSDK_VideoRender_interval=function(){this.startCaptureVideo&&this.Draw_LocalVideo();let e=this.FindVideoRender(1),t=this.FindVideoRender(this.activeSpeakssrc);if(0!=this.videoRenderArray.length){for(let a=0;a<this.videoRenderArray.length;a++){const i=this.videoRenderArray[a];if(this.isLSSPlayer&&this.pauseSet.has(i.ssrc+" "+i.zone))return;const{display:n,canvas:o,enableMultiDecodeVideoWithoutSAB:s,ssrc:d,isMyself:l}=i;var r=null;if(i==e&&t)continue;let c=d;i!=e||t||(c=this.activeSpeakssrc);let u=[i];if(i==t&&e&&u.push(e),this.isActiveSsrcVideo(c)){let e=Date.now();if(this.jsMediaEngine){let e=this.jsMediaEngine.Get_Video_SSRC_Latest_Time();this.timestamp=e.currentSSRCTime,this.audioPlayTime=e.audioPlayTime}this.calPacingTime(e),e-this.timestart<this.pacingTime&&e-this.timestart>0||(r=this.Get_Decoded_Video_Frame(this.Get_Logical_SSrc(c)),this.timestart=e)}else r=this.Get_Decoded_Video_Frame(this.Get_Logical_SSrc(c));if(r){let e;this.isActiveSsrcVideo(c)&&(this.videoTimestamp=r.ntptime),e=r.yuvdata instanceof de?r.yuvdata.yuvdata:r.yuvdata,this.croppingParams.top=r.r_y,this.croppingParams.left=r.r_x,this.croppingParams.height=r.r_h,this.croppingParams.width=r.r_w;const t=r.width>r.height&&(1===r.rotation||3===r.rotation)||r.width<r.height&&1!==r.rotation&&3!==r.rotation,a=t?r.height:r.width,i=t?r.width:r.height,{width:n,height:l}=o;if(this.currentVideoHeight==this.croppingParams.height&&this.currentVideoWidth==this.croppingParams.width||(this.Notify_APPUI?this.Notify_APPUI(3,{width:this.croppingParams.width,height:this.croppingParams.height}):postMessage({status:50,width:this.croppingParams.width,height:this.croppingParams.height}),this.currentVideoHeight=this.croppingParams.height,this.currentVideoWidth=this.croppingParams.width),e.length==r.width*r.height*3/2&&r.r_x>=0&&r.r_y>=0&&r.r_x+r.r_w<=r.width&&r.r_y+r.r_h<=r.height){8400==this.vMonitorCount&&(this.jsMediaEngine?this.jsMediaEngine.Send_Render_Monitor_Log("VDGLM"):postMessage({status:51,data:"VDGLW"}),this.vMonitorCount=0),this.vMonitorCount++;let t=this;u.forEach((o=>{o.display&&(t.Should_Update_Watermark(o.display,a,i,n,l)&&t.Update_Display_Watermark(o.display,a,i,n,l),s?o.display&&(o.display.setVideoMode(1),this.isLSSPlayer&&this.ssrcCurrentRenderingMap.set(d,r),o.display.updateRemoteVideoTextures(r.width,r.height,t.croppingParams,e,r.rotation,r.yuv_limited,o),o.firstFrame=!0):(o.display.setVideoMode(1),this.isLSSPlayer&&this.ssrcCurrentRenderingMap.set(d,r),o.display.drawNextOutputPictureFrame(r.width,r.height,t.croppingParams,e,r.rotation,r.yuv_limited,o)))}))}else this.Log_Error("Invalid YUV data: ".concat(r.r_x," ").concat(r.r_y," ").concat(r.r_w," ").concat(r.r_h," ").concat(r.width," ").concat(r.height));r.yuvdata instanceof de&&r.yuvdata.recycle()}s&&u.forEach((e=>{if(s&&e.firstFrame){const{x:t,y:r,width:a,height:i}=e,n={x:t,y:r,width:a,height:i};if(l)e.display.drawSelfVideo(n);else{if(this.isLSSPlayer){this.firstFrameMap.get(e.ssrc)||(this.firstFrameMap.set(e.ssrc,!0),this.Notify_APPUI?this.Notify_APPUI(1190,{ssrc:e.ssrc,params:e.display.croppingParams}):postMessage({status:"FIRST_FRAME",ssrc:e.ssrc,params:e.display.croppingParams}));const t=this.ssrcCurrentRenderingMap.get(e.ssrc);e.display.drawRemoteVideo(n),t&&this.zoneLastRenderedMap.set(e.ssrc+" "+e.zone,t)}e.display.drawRemoteVideo(n)}}}))}this.renderManager.renderFor(1)}},pt.prototype.Get_Decoded_Video_Frame=function(e){if(this.videoQueue){var t=this.videoQueue.GetQueue(e);return t?t.dequeue():null}},pt.prototype.Set_SSRC_Latest_Time_Stamp=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.timestamp!==e&&"number"==typeof e&&e&&(this.timestamp=e,this.audioPlaySsrc=t,this.audioPlayTime=Date.now())},pt.prototype.Get_Decoded_Video_Buffer_Length=function(e){return this.videoQueue?this.videoQueue.GetQueueLength(e):0},pt.prototype.Get_SSRC_VIDEO_FPS=function(e){if(e>>=10,this.videoQueue&&this.videoQueue.ssrcInfo){var t=this.videoQueue.ssrcInfo.GetSSRCFpsInfo(e);if(t)return Math.round(t)}return 0},pt.prototype.Change_Current_SSRC=function(e){this.currentactive=e,this.ClearQueue()},pt.prototype.Set_Render_Array_IntervalMode=function(e,t){if(this.videoRenderArray=e,this.isLSSPlayer&&this.ssrcDisplayMap.clear(),this.renderMode&&this.videoRenderArray.length>0)for(let e=0;e<this.videoRenderArray.length;e++){const i=this.videoRenderArray[e];var r;if(t){if(!i.display){if(i.enableMultiDecodeVideoWithoutSAB=t,i.display=this.Get_Display(i.canvas,i.canvas.id),i.display&&i.display.setFillMode(i.fillMode,i.fillModeForResolution),this.isLSSPlayer){let e=this.ssrcDisplayMap.get(this.Get_Logical_SSrc(i.ssrc));e||(e=[]),e.push(i),this.ssrcDisplayMap.set(this.Get_Logical_SSrc(i.ssrc),e)}var a;i.borderRadius&&(null===(a=i.display)||void 0===a||a.setRoundedCornerRadius(i.borderRadius))}}else this.renderManager.getRendererProvider().isWebGPURendererType()?i.display=this.Get_Display(i.canvas,i.rendercanvasID):i.display=this._Create_WebGL_Canvas({videoRenderArrayIndex:e,canvas:i.canvas,canvasId:i.rendercanvasID}),i.borderRadius&&(null===(r=i.display)||void 0===r||r.setRoundedCornerRadius(i.borderRadius)),this.webGLContextLostProtect(i.canvas,void 0,i.rendercanvasID)}},pt.prototype._Create_WebGL_Canvas=function(e){let{videoRenderArrayIndex:t,canvas:r,canvasId:a}=e;const i={forceNoGL:void 0,contextOptions:{webglcontextlostCallback:this.webglcontextlostCallback.bind(this),webglcontextrestoredCallback:this.webglcontextrestoredCallback.bind(this),params:{videoRenderArrayIndex:t,canvas:r,canvasId:a}},webGLResources:void 0,initMask:!1};return this.renderManager.createWebGLVideoRenderDisplay(r,a,0,i)},pt.prototype.webglcontextlostCallback=function(e,t){let{canvas:r,canvasId:a}=t;e.preventDefault()},pt.prototype.webglcontextrestoredCallback=function(e,t){var r,a;let{videoRenderArrayIndex:i,canvas:n,canvasId:o}=t;var s;(!this.videoRenderArray||i>=(null===(r=this.videoRenderArray)||void 0===r?void 0:r.length))&&this.Log_Error("videoRenderArray:".concat(this.videoRenderArray,", length:").concat(null===(s=this.videoRenderArray)||void 0===s?void 0:s.length)),this.renderMode&&i<(null===(a=this.videoRenderArray)||void 0===a?void 0:a.length)&&(this.videoRenderArray[i].display=this._Create_WebGL_Canvas({videoRenderArrayIndex:i,canvas:n,canvasId:o}),this.Set_Render_Array(this.videoRenderArray))},pt.prototype.ClearQueue=function(){try{let e=this.videoQueue.ssrcQueueMap;for(let[t,r]of e)for(;!r.isEmpty();){let e=r.dequeue();e.yuvdata&&e.yuvdata instanceof de&&e.yuvdata.recycle()}}catch(e){this.Log_Error("Exception during VideoRender.ClearQueue",e)}this.videoQueue&&this.videoQueue.ClearQueue(),this.currentVideoHeight=0,this.currentVideoWidth=0},pt.prototype.Set_WaterMark_Info=function(e){let{waterMarkCanvas:t,isCreateVideoWaterMark:r,videoWaterMarkName:a,watermarkOpacity:i,watermarkRepeated:n,watermarkPosition:o}=e;this.waterMarkCanvas=t||this.videorendercanvas,this.isCreateVideoWaterMark=r,this.videoWaterMarkName=a,void 0!==n&&(this.isWaterMarkRepeatedEnable=!!n),void 0!==i&&(this.waterMarkOpacity=i),void 0!==o&&(this.watermarkPosition=o)},pt.prototype.Set_WaterMark_Flag=function(e){if(this.videoRenderArray.length>0)for(let t=0;t<this.videoRenderArray.length;t++){const{display:r}=this.videoRenderArray[t];r.setWatermarkFlag(e?1:0)}},pt.prototype.Should_Watermark_Repeated=function(e,t){return this.isWaterMarkRepeatedEnable&&e>306&&t>202};const ft=function(e,t){if(e<640&&e){const r=640/e;e=640,t=Math.round(t*r)}return{width:e,height:t}};pt.prototype.Update_Display_Watermark=function(e,t,r,a,i){const n=this.Should_Watermark_Repeated(a,i);this.waterMarkCanvas||this.videorendercanvas||(this.videorendercanvas=this.isSupportOffscreenCanvas?new OffscreenCanvas(640,360):null);const o=a<st||i<dt?16:this.watermarkPosition,s=this.waterMarkCanvas||this.videorendercanvas;if("function"==typeof OffscreenCanvas&&s instanceof OffscreenCanvas&&OffscreenCanvasRenderingContext2D&&!OffscreenCanvasRenderingContext2D.prototype.measureText)return;const d=ft(t,r);t=d.width,r=d.height;const l=n?this.WaterMarkRGBA.Get_Repeated_WaterMarkRGBA({canvas:s,name:this.videoWaterMarkName,width:t,height:r,opacity:this.waterMarkOpacity,position:o}):this.WaterMarkRGBA.Get_WaterMarkRGBA({canvas:s,name:this.videoWaterMarkName,width:t,height:r,opacity:this.waterMarkOpacity,position:o});e.updateWatermark(t,r,l)},pt.prototype.Should_Update_Watermark=function(e,t,r,a,i){if(!this.isCreateVideoWaterMark)return!1;let n=!1;const o=ft(t,r);o.width===e.getWatermarkWidth()&&o.height===e.getWatermarkHeight()||(n=!0);const s=this.Should_Watermark_Repeated(a,i);e.isSetWatermark()||(n=!0),s!==e.isWatermarkRepeated()&&(n=!0,e.setWatermarkRepeated(s)),this.waterMarkOpacity&&this.waterMarkOpacity!==e.getWatermarkOpacity()&&(n=!0,e.setWatermarkOpacity(this.waterMarkOpacity),this.waterMarkOpacity=e.getWatermarkOpacity());const d=t<st||r<dt?16:this.watermarkPosition;return d!==e.getWatermarkPosition()&&(n=!0,e.setWatermarkPosition(d),this.watermarkPosition=e.getWatermarkPosition()),n},pt.prototype.calCulateActiveFps=function(e){this.activeFps&&e>=this.lfTimeStamp?this.activeFps=500/(e-this.lfTimeStamp)+this.activeFps/2:this.lfTimeStamp&&(this.activeFps=1e3/(e-this.lfTimeStamp))},pt.prototype.Put_Video_Data_Queue=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30;if(this.videoQueue){var r=this.videoQueue.GetQueue(e.ssrc);if(r||(r=this.videoQueue.AddQueue(e.ssrc)),r.enqueue(e),(this.Get_Logical_SSrc(this.currentactive)==this.Get_Logical_SSrc(e.ssrc)||this.Get_Logical_SSrc(this.audioPlaySsrc)==this.Get_Logical_SSrc(e.ssrc))&&(this.lfTimeStamp&&this.calCulateActiveFps(e.ntptime),this.lfTimeStamp=e.ntptime),this.lastActiveSSRC!=e.ssrc&&(this.lfTimeStamp=0,this.activeFps=0),this.lastActiveSSRC=e.ssrc,this.videoQueue&&this.videoQueue.ssrcInfo){var a=e.ssrc>>10;this.videoQueue.ssrcInfo.UpdateSSRCInfo(a,e.ntptime)}for(var i=this.videoQueue.GetQueueLength(e.ssrc)-t;i>=0;){let t=this.Get_Decoded_Video_Frame(e.ssrc);t.yuvdata instanceof de&&t.yuvdata.recycle(),i--}}else e.yuvdata&&e.yuvdata instanceof de&&e.yuvdata.recycle()},pt.prototype.Clear_OffScreenCanvas=function(e){e.contextLostHandler&&(e.removeEventListener("webglcontextlost",e.contextLostHandler),e.contextLostHandler=null),e.contextRestoredHandler&&(e.removeEventListener("webglcontextrestored",e.contextRestoredHandler),e.contextRestoredHandler=null),e.width=1,e.height=1},pt.prototype.Zoom_Render=function(e){},pt.prototype.Decode_Ssrc=function(e){return this.ssrcDisplayMap.has(this.Get_Logical_SSrc(e))||this.Get_Logical_SSrc(e)==this.Get_Logical_SSrc(this.selfvideossrc)};const mt="undefined"==typeof window;function gt(e){let t=Date.now(),r=vt;if(t-yt<30&&t-yt>0)r.Start_Request_Animation_Frame(e);else if(yt=t,r.rendingFlag){try{r.startCaptureVideo&&r.localVideoPtr&&r.Draw_LocalVideo(),r.ssrcDisplayMap.forEach((function(e,a){if(a!=r.Get_Logical_SSrc(1)||!r.ssrcDisplayMap.has(r.Get_Logical_SSrc(r.activeSpeakssrc)))if(a==r.Get_Logical_SSrc(1)&&(a=r.activeSpeakssrc),r.isActiveSsrcVideo(a))if(r.calPacingTime(t),t-r.timestart<r.pacingTime);else{r.timestart=t;let e=r.Get_Decoded_Video_Frame(r.Get_Logical_SSrc(a));e&&(r.Update_RemoteVideo_Texture(e),r.videoTimestamp=e.ntptime)}else{let e=r.Get_Decoded_Video_Frame(r.Get_Logical_SSrc(a));e&&r.Update_RemoteVideo_Texture(e)}})),r._render()}catch(e){r.Log_Error("Exception while rendering video",e)}r.Start_Request_Animation_Frame(e)}else r.rAFID&&r.Stop_Request_Animation_Frame()}var vt;pt.prototype.Check_Request_Animation=function(){mt&&this.rendingFlag&&this.prevRequestAnimationTimestap&&performance.now()-this.prevRequestAnimationTimestap>2e3&&!this.rAFIDBack&&(postMessage({status:_,data:"WCL_M,RCIF"}),this.rAFID&&(cancelAnimationFrame(this.rAFID),this.rAFID=0),this.rAFIDBack=setInterval(gt.bind(null,!0),30))},pt.prototype.Start_Request_Animation_Frame=function(e,t){if(!e&&this.rAFIDBack&&this.Stop_Request_Animation_Frame_Backup(),!this.rAFIDBack)return t||(this.retryRequestAnimationStep=2),this.prevRequestAnimationTimestap=performance.now(),this.rAFID=requestAnimationFrame(gt),this.rAFID},pt.prototype.Stop_Request_Animation_Frame_Backup=function(){this.rAFIDBack&&(clearInterval(this.rAFIDBack),this.rAFIDBack=null)},pt.prototype.Stop_Request_Animation_Frame=function(){this.rAFID&&cancelAnimationFrame(this.rAFID),this.rAFID=0,this.prevRequestAnimationTimestap=0,this.retryRequestAnimationStep=2,this.Stop_Request_Animation_Frame_Backup()},pt.prototype.Add_Pause=function(e){this.pauseSet.add(e.ssrc+" "+e.zone)},pt.prototype.Remove_Pause=function(e){const t=e.ssrc+" "+e.zone;this.pauseSet.has(t)&&this.pauseSet.delete(t)},pt.prototype.Zoom_Render_Paused=function(e){if(this.pauseSet.has(e.ssrc+" "+e.zone)&&this.zoneLastRenderedMap.get(e.ssrc+" "+e.zone)){let t=this.ssrcDisplayMap.get(this.Get_Logical_SSrc(e.ssrc));t[0].x=e.x,t[0].y=e.y,t[0].width=e.width,t[0].height=e.height}this.Draw_Last_Frame()},pt.prototype.Draw_Last_Frame=function(){for(const e of this.pauseSet.values()){const[t]=e.split(" "),r=this.zoneLastRenderedMap.get(e);if(r){let e=this.ssrcDisplayMap.get(this.Get_Logical_SSrc(t));const a=e&&e[0]&&e[0].display||null;if(a){const t=e[0];a.setVideoMode(1),this.Should_Update_Watermark(a,t.width,t.height,t.width,t.height)&&this.Update_Display_Watermark(a,t.width,t.height,t.width,t.height),a.updateRemoteVideoTextures(r.width,r.height,{top:r.r_y,left:r.r_x,height:r.r_h,width:r.r_w},r.yuvdata,r.rotation,r.yuv_limited,t),a.drawRemoteVideo({x:e[0].x,y:e[0].y,width:e[0].width,height:e[0].height})}}}},pt.prototype.Log_Error=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.globalTracingLogger?this.globalTracingLogger.error(e,t):te(e,t)},pt.prototype._render=function(){let e=this;e.ssrcDisplayMap.forEach((function(t,r){const a=e.isSelfVideo(r);t.forEach((t=>{var r;let i=t.display;if(i&&(null!==(r=i.isAvaiable)&&void 0!==r&&r.call(i)||setTimeout((()=>{var e;null===(e=i.restoreContext)||void 0===e||e.call(i)}),5),t.haddata&&i.getVideoMode()!=Fe))if(e.coordinate.x=t.x,e.coordinate.y=t.y,e.coordinate.width=t.width,e.coordinate.height=t.height,a&&-1!==[Pe,Ie].indexOf(i.getVideoMode()))i.drawSelfVideo(e.coordinate,!1,e.ismirror);else if(a)i.drawRemoteVideo(e.coordinate,e.ismirror);else{if(e.isLSSPlayer){e.firstFrameMap.get(t.ssrc)||(e.firstFrameMap.set(t.ssrc,!0),e.Notify_APPUI?e.Notify_APPUI(1190,{ssrc:t.ssrc,params:t.display.croppingParams}):postMessage({status:"FIRST_FRAME",ssrc:t.ssrc,params:t.display.croppingParams}));const r=e.ssrcCurrentRenderingMap.get(t.ssrc);r&&e.zoneLastRenderedMap.set(t.ssrc+" "+t.zone,r)}i.drawRemoteVideo(e.coordinate)}}))})),e.renderManager.renderFor(1)},pt.prototype._singleRender=function(){let e=this;this.videoRenderArray.forEach((t=>{const{x:r,y:a,width:i,ssrc:n,height:o,enableMultiDecodeVideoWithoutSAB:s}=t,d=t.display,l=e.isSelfVideo(n),c={x:r,y:a,width:i,height:o};s?l?d.drawSelfVideo(c):d.drawRemoteVideo(c):d.drawNextOutputPictureFrame(d.getTextureWidth(),d.getTextureHeight(),d.getCroppingParams(),null,d.getRotation(),void 0,c,!1)}))},pt.prototype.calPacingTime=function(e){if(this.pacingTime=30,this.activeFps>=1&&this.activeFps<=40&&(this.pacingTime=1e3/this.activeFps),this.timestamp&&this.videoTimestamp){let t=this.timestamp+e-this.audioPlayTime,r=this.videoTimestamp+this.pacingTime-t,a=this.currentactive?this.currentactive:this.audioPlaySsrc,i=this.videoQueue.GetQueueLength(this.Get_Logical_SSrc(a));r>65&&r<1e4&&i>=1&&(this.pacingTime=1.5*this.pacingTime),r<-65&&(this.pacingTime=1*this.pacingTime/2)}else this.timestamp||(this.pacingTime>150?this.pacingTime=1*this.pacingTime/2:this.pacingTime=this.pacingTime-10)},pt.prototype.getRenderManager=function(){return this.renderManager},pt.prototype.cleanup=function(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.renderManager.cleanup(e,t,r)},pt.prototype.setActiveSpeakerSsrc=function(e){this.activeSpeakssrc=e},pt.prototype.getActiveSpeakerSsrc=function(e){return this.activeSpeakssrc},pt.prototype.isActiveSeakerSsrc=function(e){return this.activeSpeakssrc&&this.activeSpeakssrc>>10==e>>10},pt.prototype.isActiveSsrcVideo=function(e){let t=e>>10;return t==this.currentactive>>10||t==this.audioPlaySsrc>>10},pt.prototype.clearDraw=function(e){e&&(this.clearColor[0]=255*e.R,this.clearColor[1]=255*e.G,this.clearColor[2]=255*e.B,this.clearColor[3]=255*e.A)},pt.prototype.isSelfVideo=function(e){return!!this.selfvideossrc&&(this.Get_Logical_SSrc(e)==this.Get_Logical_SSrc(this.selfvideossrc)||this.isActiveSeakerSsrc(this.selfvideossrc)&&!(e>>10))},pt.prototype.reDraw=function(){this.renderMode?this._singleRender():this._render()},pt.prototype.getUserIdVideo=function(e){let t=null,r=1==e||this.isActiveSeakerSsrc(e);for(let a=0;a<this.videoRenderArray.length;a++){const i=this.videoRenderArray[a];if(i.ssrc>>10==e>>10||r&&1==i.ssrc){const{width:e,height:r}=i;(!t||e*r>t.width*t.height)&&(t=i)}}if(!t||!t.display)return null;const a=t.canvas,i=t.rendercanvasID;let n=t.display.getTextureWidth(),o=t.display.getTextureHeight(),s=t.display.getRotation(),d=t.display.getViewPosition();if(1==s||3==s){let e=n;n=o,o=e}const{x:l,y:c,width:u,height:h}=t;let _=u,p=h,f=Math.floor(u*d[1]),m=Math.floor(h*d[0]);_=u-2*f,p=h-2*m;let g=a.height-h-c+m,v=l+f;return o=Math.floor(Math.min(p,o)),n=Math.floor(o*_/p),{canvasId:i,canvas:a,options:{x:v,y:g,width:_,height:p,displayWidth:n,displayHeight:o}}};var yt=0;const bt=pt;var wt,St,Mt,Et,Rt,Tt;function kt(){}function xt(e,t){let r=e;r.length<4||St&&Et(r,St,Mt,t)}function At(e){}function Ct(e,t){return!!St&&(e(St,t.ssrc,t.streamIndex,t.videoMode),!0)}function Ft(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function Pt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ft(Object(r),!0).forEach((function(t){d(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ft(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const It=8294400;function Ot(e,t){let r=e>>10;return t&&(r|=1<<23),r}function Dt(e){this.Notify_APPUI=e.Notify_APPUI,this.PubSub=e.PubSub,this.jsMediaEngine=e.jsMediaEngine,this.globalTracingLogger=e.globalTracingLogger,this.renderManager=e.renderManager,this.currentshareactive=0,this.isFromMainSession=0,this.sharingWidthAndHeightInfo={logicHeight:0,logicWidth:0},this.isCreateSharingWaterMark=!1,this.sharingWaterMarkName="",this.isWaterMarkRepeatedEnable=!1,this.waterMarkOpacity=.15,this.WaterMarkRGBA=new Qe,this.firstFrameForIOS=!1,this.timestart=0,this.asTime=0,this.rAFID=0,this.requestAnimation=!1,this.requestF=this.No_Bindthis_RAF.bind(this),this.cATimeStamp=0,this.lRTimeStamp=0,this.pacingtime=1,this.sharingFps=0,this.lfTimeStamp=0,this.maxQueueLength=0,this.vaTimeDelta=0,this.renderMode=0,this.SharingRenderInterval=0,this.RAFhealthCheckInterval=0,this.RAFLastTime=0,this.brefresh=!1,this.statisticObj=null,this.renderarray=new Map,this.sharingCanvasMap=new Map,this.mMonitorCount=0,this.canvasLogicSize=new Map,this.canvasrealSize=new Map}Dt.prototype.Start_Draw=function(){return this.requestAnimation=!0,this.Start_Request_Animation_Frame()},Dt.prototype.Stop_Draw=function(){return this.requestAnimation=!1,this.lRTimeStamp=0,this.cATimeStamp=0,this.Stop_Request_Animation_Frame()},Dt.prototype.Start_Request_Animation_Frame=function(){return this.rAFID=requestAnimationFrame(this.requestF),this.rAFID},Dt.prototype.Stop_Request_Animation_Frame=function(){this.rAFID&&(cancelAnimationFrame(this.rAFID),this.rAFID=0)},Dt.prototype.No_Bindthis_RAF=function(){let e=performance.now();this.RAFLastTime=e,this.requestAnimation?(this.calPacingTime(e),e-this.timestart>this.pacingtime&&(this.timestart=e,this.JsMediaSDK_SharingRender()),this.Start_Request_Animation_Frame()):this.Stop_Request_Animation_Frame()},Dt.prototype.addRender=function(e,t,r,a,i,n){let o=this.sharingCanvasMap.get(i);if(!o&&a&&this.sharingCanvasMap.set(i,a),!(a=a||o))return!1;a!=o&&o&&a&&this.replaceCanvas(i,a);const s=i||"0";this.canvasLogicSize.has(s)||this.UpdateCanvasSize(s,a.width,a.height,!1);const d=Ot(e,r),l=this.renderarray.get(d);if(l){if(l.canvasId==i)return l.logicViewPort=n,l.viewport=n,l.zone=t,n&&this.updateViewPort(Pt({ssrc:e,zone:t,ismainSession:r},n)),!1;this.removeRender(l.ssrc,l.zone,l.ismainSession)}a.canvasId=i;let c=this.renderManager.getRenderDisplay(a,i,10,this.Log_Error.bind(this),null);return!!c&&(this.renderarray.set(d,{ssrc:e,zone:t,ismainSession:r,display:c,logicViewPort:n,viewport:n,canvas:a,canvasId:i,renderInfo:{xratio:1,yratio:1,logic_w:0,logic_h:0,real_w:0,real_h:0},screenQueue:new Xe,mouseQueue:new Xe}),n&&this.updateViewPort(Pt({ssrc:e,zone:t,ismainSession:r},n)),this.renderarray.size>1&&(this.sharingWidthAndHeightInfo={logicHeight:0,logicWidth:0}),!0)},Dt.prototype.getRender=function(e,t,r){if(null!=t){const r=Ot(e,t);return this.renderarray.get(r)}return Array.from(this.renderarray.values()).find((t=>t.ssrc>>10==e>>10))},Dt.prototype.removeRender=function(e,t,r){var a,i;const n=this.getRender(e,r);if(!n||n.zone!=t)return!1;const o=Ot(n.ssrc,n.ismainSession);this.renderarray.delete(o);try{for(;!n.screenQueue.isEmpty();){let e=n.screenQueue.dequeue();e.yuvdata&&e.yuvdata instanceof de&&e.yuvdata.recycle(),e.dataptr&&Module._free(e.dataptr)}n.mouseQueue.clear()}catch(e){console.error("<<<< error",e)}null===(a=n.display)||void 0===a||null===(i=a.clearDisplay)||void 0===i||i.call(a),this.renderManager.recycleRenderDisplay(n.canvas,n.display,!1)},Dt.prototype.removeAllRender=function(){let e=[];this.renderarray.forEach(((t,r)=>{e.push(t)})),e.forEach((e=>{this.removeRender(e.ssrc,e.zone,e.ismainSession)}))},Dt.prototype.updateViewPort=function(e){const{ssrc:t,zone:r,isFromMainSession:a,rgba:i}=e,{x:n,y:o,width:s,height:d}=e,l=this.getRender(t,a);if(null!=l&&l.viewport&&(null==l?void 0:l.zone)==r){var c;const e=l.canvasId||"0",t=(null===(c=this.canvasrealSize.get(e))||void 0===c?void 0:c.ratio)||1;l.logicViewPort={x:n,y:o,width:s,height:d},l.viewport={x:Math.floor(n*t),y:Math.floor(o*t),width:Math.floor(s*t),height:Math.floor(d*t)}}},Dt.prototype._deleteOldCanvas=function(e,t){let r=[];return this.renderarray.forEach(((e,a)=>{e.canvasId==t&&r.push(e)})),r.forEach((e=>{this.removeRender(e.ssrc,e.zone,e.ismainSession)})),r},Dt.prototype.isHasRender=function(){return!!this.renderarray.size},Dt.prototype.isSharingCanvas=function(e){return!!this.sharingCanvasMap.get(e)},Dt.prototype.replaceCanvas=function(e,t){const r=this.sharingCanvasMap.get(e);if(r==t)return;let a=this._deleteOldCanvas(null,e);this.sharingCanvasMap.delete(e),this.renderManager.clearOffscreenCanvas(r),t?(this.sharingCanvasMap.set(e,t),a.forEach((r=>{const{ssrc:a,zone:i,ismainSession:n,viewport:o}=r;this.addRender(a,i,n,t,e,o)}))):(this.canvasLogicSize.delete(e),this.canvasrealSize.delete(e))},Dt.prototype.No_Bindthis_Interval=function(){let e=performance.now();this.calPacingTime(e),e-this.timestart>this.pacingtime&&(this.timestart=e,this.JsMediaSDK_SharingRender())},Dt.prototype.calPacingTime=function(e){this.pacingtime=30,this.sharingFps&&this.sharingFps>0&&this.sharingFps<100&&(this.pacingtime=1e3/this.sharingFps);let t=this.Get_Current_QueueLength();if(this.cATimeStamp&&this.lRTimeStamp){let r=this.cATimeStamp+e-this.asTime;this.vaTimeDelta=this.lRTimeStamp+this.pacingtime-r,this.vaTimeDelta>65&&this.vaTimeDelta<1e4&&t>1&&(this.pacingtime=1.5*this.pacingtime),this.vaTimeDelta<-65&&(this.pacingtime=1*this.pacingtime/2)}else this.cATimeStamp||(this.pacingtime>150||t>20?this.pacingtime=1*this.pacingtime/2:this.pacingtime=this.pacingtime-10)},Dt.prototype.render_monitor_log=function(e){this.jsMediaEngine?this.jsMediaEngine.Send_Render_Monitor_Log(e):postMessage({status:53,data:e})},Dt.prototype.JsMediaSDK_SharingRender=function(){var e;if(!this.renderarray.size)return;null===(e=this.statisticObj)||void 0===e||e.sample();const t=this.brefresh||Array.from(this.renderarray.values()).some((e=>e.screenQueue.getLength()||e.mouseQueue.getLength()));this.brefresh=!1,this.renderarray.forEach(((e,r)=>{var a;const{display:i,screenQueue:n,mouseQueue:o,canvas:s}=e,d=e.ssrc>>10<<10;var l;if(!1===(null===(a=i.isAvaiable)||void 0===a?void 0:a.call(i)))return void(null===(l=i.restoreContext)||void 0===l||l.call(i));const c=n.dequeue(),u=o.dequeue();var h=e.viewport;if(h||(h={x:0,y:0,width:null==s?void 0:s.width,height:null==s?void 0:s.height}),u){const{xratio:t,yratio:r}=e.renderInfo,a=u.r_x*t,n=u.r_y*r,o=u.width*t,s=u.height*r;i.updateCursor(u.width,u.height,u.buffer,u.sync_id),i.updateCursorPosInfo(1,a,n,o,s),++this.mMonitorCount%3e3==0&&this.render_monitor_log("SDSBM")}if(c){let t,r;this.lRTimeStamp=Math.max(c.ntptime,this.lRTimeStamp),c.yuvdata instanceof de?(t=c.yuvdata.yuvdata,r=c.yuvdata):(t=c.yuvdata,r=null);var _=c.logic_h,p=c.logic_w,f=c.r_h,m=c.r_w;e.renderInfo.xratio=m/p,e.renderInfo.yratio=f/_;const a={top:c.r_x,left:c.r_y,height:c.r_h,width:c.r_w},n=h.width,o=h.height;this.Should_Update_Watermark(i,n,o)&&this.Update_Display_Watermark(i,n,o),i.drawNextOutputPictureFrame(c.width,c.height,a,t,null,c.yuv_limited,h),r&&r.recycle(),c.dataptr&&Module._free(c.dataptr)}else if(t&&i.isHasWholeFrame()){const e=h.width,t=h.height;this.Should_Update_Watermark(i,e,t)&&this.Update_Display_Watermark(i,e,t),i.drawNextOutputPictureFrame(i.getTextureWidth(),i.getTextureHeight(),i.getCroppingParams(),null,null,!0,h,!1)}this.UpdateSharingLogicWidthHeightInfo(d,e.canvasId,e.renderInfo,!1)})),t&&this.renderManager.renderFor(2)},Dt.prototype.setOnlyAcceptUISize=function(e){this.bOnlyAcceptUISize=e},Dt.prototype.updateOffscreenCanvasSize=function(e,t,r){let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];const n=this.renderarray.size;if(void 0===e&&n>1&&(this.render_monitor_log("UASCANVASERROR:".concat(n)),this.Log_Error("Error updating OffscreenCanvas size > 1 canvasId is null")),!this.bOnlyAcceptUISize||a)try{this.UpdateCanvasSize(e,t,r,i,a),this.brefresh=!0}catch(e){this.Log_Error("Error updating OffscreenCanvas size",e)}},Dt.prototype.UpdateCanvasSize=function(e,t,r,a,i){var n;let o=[],s=Array.from(this.renderarray.values());for(let t=0;t<s.length;t++){const r=s[t];r.canvasId!=e&&void 0!==e||o.push(r)}if(void 0===e&&1!=o.length)return;const d=e||"0";this.canvasLogicSize.set(d,{width:t,height:r});const l="undefined"!=typeof DedicatedWorkerGlobalScope;let c={width:t,height:r,ratio:1};if(t*r>It&&l){const e=Math.sqrt(It/(t*r));c.width=Math.round(t*e),c.height=Math.round(r*e),c.ratio=e}this.canvasrealSize.set(d,c);const{width:u,height:h,ratio:_}=c;o.forEach((e=>{const t=null==e?void 0:e.logicViewPort;if(!i||!t)return;const{x:r,y:a,width:n,height:o}=t;e.viewport={x:Math.floor(r*_),y:Math.floor(a*_),width:Math.floor(n*_),height:Math.floor(o*_)}}));const p=null===(n=o[0])||void 0===n?void 0:n.canvas;var f;p&&p instanceof OffscreenCanvas&&(p.width!=u||p.height!=h)&&(p.width=u,p.height=h,null===(f=o[0].display)||void 0===f||f.resizeCanvasTo(u,h),a&&(this.brefresh=!0,this.JsMediaSDK_SharingRender()))},Dt.prototype.Change_Current_SSRC=function(e,t){this.currentshareactive=e,this.isFromMainSession=t;const r=Ot(e,t),a=this.renderarray.get(r);this.firstFrameForIOS=!1,a&&this.UpdateUserSharingInfo(a)},Dt.prototype.Set_WaterMark_Info=function(e){let{waterMarkCanvas:t,isCreateSharingWaterMark:r,sharingWaterMarkName:a,watermarkOpacity:i,watermarkRepeated:n,watermarkPosition:o}=e;this.Replace_WaterMark_Canvas(t),this.isCreateSharingWaterMark=r,this.sharingWaterMarkName=a,void 0!==n&&(this.isWaterMarkRepeatedEnable=!!n),void 0!==i&&(this.waterMarkOpacity=i),void 0!==o&&(this.watermarkPosition=o),this.renderarray.forEach(((e,t)=>{var r;null===(r=e.display)||void 0===r||r.setWatermarkFlag(this.isCreateSharingWaterMark?1:0)}))},Dt.prototype.Replace_WaterMark_Canvas=function(e){this.waterMarkCanvas=e},Dt.prototype.Should_Watermark_Repeated=function(e,t){return this.isWaterMarkRepeatedEnable&&e>306&&t>202};const Lt=function(e,t){if(e<640&&e){const r=640/e;e=640,t=Math.round(t*r)}return{width:e,height:t}};Dt.prototype.Update_Display_Watermark=function(e,t,r){if("function"==typeof OffscreenCanvas&&this.waterMarkCanvas instanceof OffscreenCanvas&&OffscreenCanvasRenderingContext2D&&!OffscreenCanvasRenderingContext2D.prototype.measureText)return;const a=t<st||r<dt?16:this.watermarkPosition,i=this.Should_Watermark_Repeated(t,r),n=Lt(t,r);t=n.width,r=n.height;const o=i?this.WaterMarkRGBA.Get_Repeated_WaterMarkRGBA({canvas:this.waterMarkCanvas,name:this.sharingWaterMarkName,width:t,height:r,opacity:this.waterMarkOpacity,position:a}):this.WaterMarkRGBA.Get_WaterMarkRGBA({canvas:this.waterMarkCanvas,name:this.sharingWaterMarkName,width:t,height:r,opacity:this.waterMarkOpacity,position:a});e.updateWatermark(t,r,o)},Dt.prototype.Should_Update_Watermark=function(e,t,r){if(!this.isCreateSharingWaterMark)return!1;let a=!1;const i=Lt(t,r);i.width===e.getWatermarkWidth()&&i.height===e.getWatermarkHeight()||(a=!0);const n=this.Should_Watermark_Repeated(t,r);e.isSetWatermark()||(a=!0),n!==e.isWatermarkRepeated()&&(a=!0,e.setWatermarkRepeated(n)),this.waterMarkOpacity&&this.waterMarkOpacity!==e.getWatermarkOpacity()&&(a=!0,e.setWatermarkOpacity(this.waterMarkOpacity),this.waterMarkOpacity=e.getWatermarkOpacity());const o=t<st||r<dt?16:this.watermarkPosition;return o!==e.getWatermarkPosition()&&(a=!0,e.setWatermarkPosition(o),this.watermarkPosition=e.getWatermarkPosition()),a},Dt.prototype.Put_Sharing_Data_From_Queue=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50;const r=Ot(e.ssrc,e.isFromMainSession);let a=this.renderarray.get(r);if(!a)return e.yuvdata instanceof de&&e.yuvdata.recycle(),void(e.dataptr&&Module._free(e.dataptr));this.firstFrameForIOS||e.ssrc>>10!=this.currentshareactive>>10||(this.firstFrameForIOS=!0,this.Notify_APPUI?this.Notify_APPUI(34,this.currentshareactive):postMessage({status:78,ssrc:this.currentshareactive})),this.brefresh=!0,a.screenQueue.enqueue(e);const i=e.ntptime-this.lfTimeStamp;this.lfTimeStamp&&i>0&&(this.sharingFps?this.sharingFps=500/i+this.sharingFps/2:this.sharingFps=1e3/i),this.sharingFps!=1/0&&this.sharingFps||(this.sharingFps=20),this.lfTimeStamp=e.ntptime;var n=a.screenQueue.getLength()-t;for(this.maxQueueLength=t;n>=0;){let e=a.screenQueue.dequeue();e.yuvdata instanceof de&&e.yuvdata.recycle(),e.dataptr&&Module._free(e.dataptr),n--}const o=a.renderInfo;o.real_h==e.r_h&&o.real_w==e.r_w&&o.logic_h==e.logic_h&&o.logic_w==e.logic_w||(o.real_h=e.r_h,o.real_w=e.r_w,o.logic_h=e.logic_h,o.logic_w=e.logic_w,this.UpdateUserSharingInfo(a))},Dt.prototype.UpdateUserSharingInfo=function(e){const t=e.ssrc>>10<<10,r=e.renderInfo;if(0==r.logic_w||0==r.logic_h)return;const a=1==this.renderarray.size;this.Notify_APPUI?this.Notify_APPUI(6,{body:{nodeid:t,absHeight:r.real_h,absWidth:r.real_w,height:r.logic_h,width:r.logic_w,logicHeight:r.logic_h,logicWidth:r.logic_w}}):(postMessage({status:g,logicWidth:r.logic_w,logicHeight:r.logic_h,absHeight:r.real_h,absWidth:r.real_w,nodeid:t,updateRemoteInfo:a}),a&&this.updateOffscreenCanvasSize(e.canvasId,r.logic_w,r.logic_h,!1,!0))},Dt.prototype.UpdateSharingLogicWidthHeightInfo=function(e,t,r,a){const i=1==this.renderarray.size,{logic_h:n,logic_w:o,real_w:s,real_h:d}=r;!i||this.sharingWidthAndHeightInfo.logicWidth==o&&this.sharingWidthAndHeightInfo.logicHeight==n||(this.updateOffscreenCanvasSize(t,o,n,!1,a),this.PubSub?PubSub.publish("SHARING_PARAM_INFO_FROM_SOCKET",{body:{width:o,height:n,logicWidth:o,logicHeight:n,absWidth:s,absHeight:d}}):postMessage({status:g,logicWidth:o,logicHeight:n,absWidth:s,absHeight:d,nodeid:e,updateRemoteInfo:i}),this.sharingWidthAndHeightInfo.logicWidth=o,this.sharingWidthAndHeightInfo.logicHeight=n)},Dt.prototype.Put_Mouse_Data_Into_Queue=function(e){const t=Ot(e.ssrc,e.isFromMainSession);let r=this.renderarray.get(t);if(r){r.mouseQueue.enqueue(e);for(var a=r.mouseQueue.getLength()-10;a>=0;)r.mouseQueue.dequeue(),a--}},Dt.prototype.Get_Current_QueueLength=function(){var e=Ot(this.currentshareactive,this.isFromMainSession);let t=this.renderarray.get(e);return t?t.screenQueue.getLength():0},Dt.prototype.SetcATimeStamp=function(e){this.cATimeStamp=e,this.asTime=performance.now()},Dt.prototype.Log_Error=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.globalTracingLogger?this.globalTracingLogger.error(e,t):te(e,t)},Dt.prototype.Log_DT=function(e){this.globalTracingLogger?this.globalTracingLogger.directReport(e):re(e)},Dt.prototype.setMode=function(e){this.Stop_Draw2(),this.renderMode=e},Dt.prototype.Start_Draw2=function(e){var t;null===(t=this.statisticObj)||void 0===t||t.start(),this.renderMode?(this.SharingRenderInterval&&(clearInterval(this.SharingRenderInterval),this.SharingRenderInterval=0),this.SharingRenderInterval=setInterval((()=>{this.No_Bindthis_Interval()}),20)):(this.Start_Draw(),this.startRAFHealthCheck())},Dt.prototype.Stop_Draw2=function(e){var t;null===(t=this.statisticObj)||void 0===t||t.stop(),this.renderMode?this.SharingRenderInterval&&(clearInterval(this.SharingRenderInterval),this.SharingRenderInterval=0):(this.Stop_Draw(),this.stopRAFHealthCheck())},Dt.prototype.startRAFHealthCheck=function(){this.RAFLastTime=performance.now(),this.RAFhealthCheckInterval=setInterval((()=>{let e=performance.now();!this.renderMode&&e-this.RAFLastTime>2e3&&(this.Stop_Draw2(),this.setMode(1),this.Start_Draw2(),this.Log_DT("Sharing RAF Failed"))}),2e3)},Dt.prototype.stopRAFHealthCheck=function(){this.RAFLastTime=0,this.RAFhealthCheckInterval&&clearInterval(this.RAFhealthCheckInterval)},Dt.prototype.reDraw=function(){this.brefresh=!0,this.JsMediaSDK_SharingRender()},Dt.prototype.getUserIdVideo=function(e,t){const r=this.getRender(e,t),{canvasId:a,display:i,canvas:n,viewport:o}=r;if(!n||!i)return null;if(o){const{x:e,y:t,width:r,height:i}=o;return{canvasId:a,canvas:n,options:{x:e,y:t,width:r,height:i,displayWidth:r,displayHeight:i}}}const{width:s,height:d}=n;return{canvasId:a,canvas:n,options:{x:0,y:0,width:s,height:d,displayWidth:s,displayHeight:d}}};const Wt=Dt;function Nt(e){return e[0]<<24|e[1]<<16|e[2]<<8|e[3]}const Ut=function(e){return 21==e[4]&&0==e[13]},Bt=function(e){return 104==e[0]||16!=e[4]&&1!=e[5]?Nt(e.slice(19,23)):Nt(e.slice(15,19))},Vt=function(e){return 103==e[0]};class Gt{constructor(e){let t=e||{};this.last_report_time=0,this.timeout_count=0,this.interval_report_time=t.interval||3e3,this.tag=t.tag||"monitor",this.max_timeout=0,this.min_timeout=2147483647,this.reportcallback=t.reportcallback,this._timeoutid=0}_report(){this.reportcallback&&this.reportcallback(this.tag,Math.ceil(this.max_timeout),Math.ceil(this.min_timeout),this.timeout_count),this.timeout_count=0,this.max_timeout=0,this.min_timeout=2147483647}timeoutReport(e,t){if(this.timeout_count++,e>this.max_timeout&&(this.max_timeout=e),e<this.min_timeout&&(this.min_timeout=e),this._timeoutid)return;let r=this;this._timeoutid=setTimeout((()=>{r._report(),r._timeoutid=0}),this.interval_report_time)}}class Ht{constructor(e){this._tag=e.tag||"MONITOR",this._base_time=0,this._interval_id=-1,this._timeout=Math.max(1e3,e.timeout||0),this._callback=e.callback}_report(){let e=Date.now(),t=this.getSamples(e);t||(t=[]);let r="".concat(this._base_time,":").concat(e-this._base_time,":").concat(t.join("|"));this._callback&&this._callback(this._tag,r)}getSamples(e){}onStart(){}onStop(){}start(){-1==this._interval_id&&(this._base_time=Date.now(),this._interval_id=setInterval(this._report.bind(this),this._timeout),this.onStart())}stop(){-1!=this._interval_id&&(clearInterval(this._interval_id),this._interval_id=-1,this._report(),this.onStop())}}class jt extends Ht{constructor(e){super(e),this._count=0}onStart(){this._count=0}sample(){this._count++}getSamples(e){return[this._count]}}var zt=function(e){let t=e||{};this._report_interval=t.interval||3e4,this._customer_callback=t.report_call,this._group_interval=t.group_interval||1e3,this._tag=t.tag||"WCL_M,V",this.last_capture_time=0,this._init_report_interval=t._report_interval<1e4?t._report_interval:1e4,this.threshold=200,this._enabled=!1,this.capture_fps=0,this.capture_fps_history=[],this.capture_total_fps=0,this.capture_timeout_report=new Gt({interval:this._report_interval,tag:this._tag+"CAPTUREDEL",reportcallback:this._capture_timeout_report.bind(this)}),this.close_frames=0,this.close_frames_history=[],this.close_total_frames=0,this.capture_ticket_count=0,this.ref_counts=0,this.unref_counts=0,this._interval_id=0,this._timeout_id=0,this._last_update_time=0};zt.prototype._capture_timeout_report=function(e,t,r,a){if(this._customer_callback){let i="".concat(t,",").concat(r,",").concat(a);this._customer_callback(e,i)}},zt.prototype._report=function(){if(!this._customer_callback)return;let e=(new Date).getTime(),t="".concat(this.capture_fps_history.length,"-").concat(this.capture_fps_history.join("|")),r="".concat(this.close_frames_history.length,"-").concat(this.close_frames_history.join("|")),a="".concat(e,"-").concat(this.capture_ticket_count,"-").concat(this.capture_total_fps,"-").concat(this.ref_counts,"-").concat(t),i="".concat(e,"-").concat(this.close_total_frames,"-").concat(this.unref_counts,"-").concat(r);this._customer_callback(this._tag+"CAPTURE",a),this._customer_callback(this._tag+"FCLOSE",i)},zt.prototype._timeout_report=function(){this._timeout_id=0,this._report()},zt.prototype._group=function(){this.capture_fps_history.push(this.capture_fps),this.close_frames_history.push(this.close_frames),this.capture_fps=0,this.close_frames=0;let e=performance.now();e>=this._last_update_time+this._init_report_interval&&(this._report(),this.capture_fps_history=[],this.close_frames_history=[],this._last_update_time=e,this._init_report_interval<this._report_interval&&(this._init_report_interval+=5e3,this._init_report_interval>this._report_interval&&(this._init_report_interval=this._report_interval)))},zt.prototype.closeSample=function(){this.close_frames++,this.close_total_frames++},zt.prototype.setCloseTotalFrames=function(e){this.close_total_frames=e},zt.prototype.captureTicket=function(){this._enabled&&this.capture_ticket_count++},zt.prototype.captureSample=function(){if(!this._enabled)return;this.capture_fps++,this.capture_total_fps++;let e=performance.now();if(this.last_capture_time){let t=e-this.last_capture_time;t>this.threshold&&this.capture_timeout_report.timeoutReport(t,e)}this.last_capture_time=e},zt.prototype.ref=function(){this.ref_counts++},zt.prototype.unref=function(){this.unref_counts++},zt.prototype.start=function(){this._enabled||(0!=this._last_update_time&&(clearTimeout(this._last_update_time),this._last_update_time=0,this._report()),this.capture_fps=0,this.capture_fps_history=[],this.capture_total_fps=0,this.close_frames=0,this.close_frames_history=[],this.close_total_frames=0,this.capture_ticket_count=0,this._last_update_time=performance.now(),this._interval_id=setInterval(this._group.bind(this),this._group_interval),this._enabled=!0)},zt.prototype.stop=function(){this._enabled&&(this._enabled=!1,this._interval_id&&clearInterval(this._interval_id),this._interval_id=0,(this.close_frames>0||this.capture_fps>0||this.capture_fps_history.length>0||this.close_frames_history>0)&&(this._timeout_id=setTimeout(this._timeout_report.bind(this),3e3)))};const $t={VIDEO_ENCODE:"0",VIDEO_DECODE:"1",AUDIO_ENCODE:"2",AUDIO_DECODE:"3",SHARING_ENCODE:"4",SHARING_DECODE:"5",WORKER_SERVICE:"6",COMMON:"7",NET:"net",MESH:"mesh"},qt=((()=>{const e={};for(const t in $t)e[$t[t]]="WCL_"+t})(),$t.AUDIO_ENCODE,$t.AUDIO_DECODE,$t.VIDEO_ENCODE,$t.VIDEO_DECODE,$t.SHARING_ENCODE,$t.SHARING_DECODE,$t.NET,$t.MESH,e=>btoa(String.fromCharCode(...new Uint8Array(e))));class Yt{constructor(e){d(this,"process",(async()=>{if(this.processList.length){const e=this.processList.splice(0,30),t=await this.encryptData(this.mergeBuffer(e));this.writeLog(qt(t)),this.writeLog(this.EOL)}requestAnimationFrame(this.process)})),this.textEncoder=new TextEncoder,this.textDecoder=new TextDecoder,this.EOL=this.textEncoder.encode("\n"),this.processList=[],this.writeLog=e,this.key=null,this.initEncryptPromise=this.initEncrypt()}addLogData(e,t){if(!e||!t)return;const r=this.textEncoder.encode(e);this.processList.push(r),this.processList.push(t),this.processList.push(this.EOL)}async initEncrypt(){this.key=await crypto.subtle.generateKey({name:"AES-GCM",length:256},!0,["encrypt","decrypt"]),this.iv=crypto.getRandomValues(new Uint8Array(12));const e=new Uint8Array(await crypto.subtle.exportKey("raw",this.key)),t=new Uint8Array([0]);this.writeLog("v"),this.writeLog(this.EOL),this.writeLog(qt(t.buffer)),this.writeLog(this.EOL);const r=[e,this.iv];this.writeLog("h"),this.writeLog(this.EOL),this.writeLog(qt(this.mergeBuffer(r).buffer)),this.writeLog(this.EOL),this.startProcess()}mergeBuffer(e){const t=e.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(t);let a=0;for(const t of e)r.set(t,a),a+=t.length;return r}async encryptData(e){return await this.initEncryptPromise,await crypto.subtle.encrypt({name:"AES-GCM",iv:this.iv},this.key,e)}startProcess(){requestAnimationFrame(this.process)}}class Qt{constructor(e){this.port=null,this.cache=[],this.stopCache=!1,e&&(this.logProcesser=new Yt(this.writeLog.bind(this)))}readyForLog(){}sendLog(e){}writeLog(e){this.readyForLog()?(this.stopCache||(this.cache.forEach((e=>this.sendLog(e))),this.clearCache()),this.sendLog(e)):this.stopCache||this.cache.push(e)}clearCache(){this.stopCache=!0,this.cache=[]}getTime(){const e=new Date;return e.getHours()+":"+e.getMinutes()+":"+e.getSeconds()+":"+e.getMilliseconds()}getLogData(e,t,r){if(t){var a=new Uint8Array(r?t+1:t),i=(self.GROWABLE_HEAP_I8?self.GROWABLE_HEAP_I8():Module.HEAP8).subarray(e+0,e+t);return a.set(i,0,t),r&&(a[t]=10),a}return e.data}writeWasmLog(e,t){const r=this.getTime(),a=this.getLogData(e,t);this.logProcesser?this.logProcesser.addLogData(r,a):(this.writeLog(r),this.writeLog(a),this.writeLog("\n"))}}class Kt extends Qt{constructor(){super(!0),this.port=null,this.ready=!1}init(){let e=0;const t=r=>{"local_log_port"===r.data.command?this.port||(this.port=r.data.data):"local_log_ready"===r.data.command&&(this.ready=!0,self.removeEventListener("message",t),clearTimeout(e),this.stopCache||(this.cache.forEach((e=>this.sendLog(e))),this.clearCache()))};self.addEventListener("message",t),e=setTimeout((()=>{self.removeEventListener("message",t),this.clearCache()}),6e4)}readyForLog(){return!!this.port&&this.ready}sendLog(e){this.port.postMessage(e)}}let Xt;const Zt=()=>Xt,Jt=function(e,t=""){if(e)return;const r=new Error(t);Zt().tracing.Log_Error(`Assert: ${t}`,r)},er=function(e){const t=new Error(e);Zt().tracing.Log_Error(`AssertWithFailed: ${e}`,t)};function tr(e,t){const r=Math.pow(10,t);return Math.floor(e*r)/r}function rr(e,t){const r=Math.pow(10,t);return Math.ceil(e*r)/r}const ar={NO_CONFIG:0,FALLBACK_TO_TAG_RENDERER_ON_CHROME:1,FALLBACK_TO_TAG_RENDERER_ON_SAFARI:2,FALLBACK_TO_TAG_RENDERER_ON_FIREFOX:4,LOWER_PERFORMANCE_DEVICE:8},ir={NO_CONFIG:0,TAG_RENDERER_ON_CHROME:1,TAG_RENDERER_ON_SAFARI:2,TAG_RENDERER_ON_FIREFOX:4},nr=new class{constructor(){d(this,"_platformDesc",{supportGraphicsAcceleration:!1,supportVideoFrame:!1,supportMediaStreamTrackGenerator:!1,supportTransferableStream:!1,supportDrawWatermark:!1,supportVideoFrameInWorker:!1,supportVideoTrackGeneratorInWorker:!1,supportOffscreenCanvasInWorker:!1,supportImageBitmapRenderingInWorker:!1,supportTransferableTrackAcrossWork:!1,supportsRequestAnimationFrameInWork:!1}),d(this,"_inferedDesc",{supportVideoTagRenderer:!1}),d(this,"_analyzing_promise",null),d(this,"_main_analyzed",!1),d(this,"_remote_analyzed",!1),d(this,"_analyzedPromise",void 0),d(this,"_resolveAnalyzedPromise",void 0),this._analyzedPromise=new Promise(((e,t)=>{this._resolveAnalyzedPromise=e}))}init(e){this._platformDesc=e.platform,this._inferedDesc=e.infered,this._main_analyzed=!0,this._remote_analyzed=!0,this._resolveAnalyzedPromise(this._remote_analyzed)}desc(){return{platform:this._platformDesc,infered:this._inferedDesc}}analyzed(){return this._remote_analyzed}analyzedPromise(){return this._analyzedPromise}_analyzeInferredCapabilites(){this._inferedDesc.supportVideoTagRenderer=this._platformDesc.supportVideoFrame&&this._platformDesc.supportVideoFrameInWorker&&(!0===this._platformDesc.supportMediaStreamTrackGenerator&&!0===this._platformDesc.supportTransferableStream||!0===this._platformDesc.supportVideoTrackGeneratorInWorker)}analyze(e){if(this._analyzing_promise)return this._analyzing_promise;const t=e.analyzeMainCapabilites();return Object.assign(this._platformDesc,t),this._main_analyzed=!0,this._analyzing_promise=new Promise(((t,r)=>{e.analyzeRemoteCapabilities().then((e=>{Object.assign(this._platformDesc,e),this._analyzeInferredCapabilites(),this._remote_analyzed=!0,this._resolveAnalyzedPromise(this._remote_analyzed),t(!0)})).catch((e=>{this._resolveAnalyzedPromise(this._remote_analyzed),t(!1)}))})),this._analyzing_promise}supportGraphicsAcceleration(){return Jt(this._main_analyzed),this._platformDesc.supportGraphicsAcceleration}supportTransferableStream(){return Jt(this._main_analyzed),this._platformDesc.supportTransferableStream}supportDrawWatermark(){return Jt(this._main_analyzed),this._platformDesc.supportDrawWatermark}supportVideoTagRenderer(){return!!this._remote_analyzed&&this._inferedDesc.supportVideoTagRenderer}supportMediaStreamTrackGenerator(){return Jt(this._main_analyzed),this._platformDesc.supportMediaStreamTrackGenerator}supportVideoTrackGeneratorInWorker(){return!!this._remote_analyzed&&this._platformDesc.supportVideoTrackGeneratorInWorker}supportTransferableTrackAcrossWork(){return!!this._remote_analyzed&&this._platformDesc.supportTransferableTrackAcrossWork}supportsRequestAnimationFrameInWork(){return!!this._remote_analyzed&&this._platformDesc.supportsRequestAnimationFrameInWork}supportMediaStreamTrackProcessor(){return!!this._remote_analyzed&&this._platformDesc.supportMediaStreamTrackProcessor}};var or=r(1265),sr=r.n(or);const dr=new class{constructor(){d(this,"_info",void 0),this._info={browser:{brand:"",version:"",isBlink:!1,isWebkit:!1},sysinfo:{osType:"",os:"",osVersion:""},gpuinfo:{vendor:"",renderInfo:"",isAstcSupported:!1,isWebGLContextInvalid:!1},browserVersionInfo:{ie:"",edge:"",firefox:"",opera:"",chrome:"",safari:""},isLowerPerformanceDevice:!1,isSwiftShader:!1,isMacIntelSafari:!1},this._derived={gpuArchitecture:"unknown",normalizedOS:"",normalizedBrowser:""},this._updateDerivedInfo()}init(e){this._info=e,this._updateDerivedInfo()}info(){return this._info}browserInfo(){return this._info.browser}browserVersionInfo(){return this._info.browserVersionInfo}browserName(){var e;return null===(e=this._info.browser.brand)||void 0===e?void 0:e.toLocaleLowerCase()}isChrome(){var e;return"chrome"===(null===(e=this._info.browser.brand)||void 0===e?void 0:e.toLocaleLowerCase())}isSafari(){var e;return"safari"===(null===(e=this._info.browser.brand)||void 0===e?void 0:e.toLocaleLowerCase())}isFirefox(){var e;return"firefox"===(null===(e=this._info.browser.brand)||void 0===e?void 0:e.toLocaleLowerCase())}isEdge(){var e;return"edge"===(null===(e=this._info.browser.brand)||void 0===e?void 0:e.toLocaleLowerCase())}isBlink(){return this._info.browser.isBlink}isWebkit(){return this._info.browser.isWebkit}isLowerPerformanceDevice(){return!!this._info.isLowerPerformanceDevice}_updateDerivedInfo(){this._derived.normalizedOS=this._computeNormalizedOS(),this._derived.normalizedBrowser=this._computeNormalizedBrowser(),this._derived.gpuArchitecture=this._computeGPUArchitecture()}_computeGPUArchitecture(){var e,t;const r=(null===(e=this._info.gpuinfo)||void 0===e?void 0:e.vendor)||"",a=(null===(t=this._info.gpuinfo)||void 0===t?void 0:t.renderInfo)||"",i=r.toLowerCase(),n=a.toLowerCase(),o=e=>i.includes(e)||n.includes(e);if(this.isSafari())return this._info.isMacIntelSafari?"intel":"apple";if(o("intel"))return"intel";if(o("nvidia")||o("geforce"))return"nvidia";if(o("amd")||o("radeon")||o("ati"))return"amd";if(o("apple")||o("m1")||o("m2")||o("m3"))return"apple";if(o("qualcomm")||o("adreno"))return"qualcomm";if(o("mediatek")||o("mtk"))return"mediatek";if(o("mali"))return"mali";if(o("arm"))return"arm";if(i){var s;const e=sr()(s=i.replace(/[^a-z0-9]+/g," ")).call(s).split(" ")[0];if(e)return e.toLowerCase()}return"unknown"}_computeNormalizedOS(){var e;const t=(null===(e=this._info.sysinfo)||void 0===e||null===(e=e.os)||void 0===e?void 0:e.toLowerCase())||"";return"ios"===t?"ios":t.includes("android")?"android":t.includes("chrome os")||t.includes("chromium os")?"chromeos":t.includes("mac")?"mac":t.includes("win")?"win":t.includes("linux")?"linux":t}_computeNormalizedBrowser(){var e,t;return(null===(e=this._info.browser)||void 0===e||null===(e=e.brand)||void 0===e||null===(t=e.toLocaleLowerCase)||void 0===t?void 0:t.call(e))||""}isOnWhitelist(e){if(!Array.isArray(e)||0===e.length)return!1;const t=this._derived.gpuArchitecture,r=this._derived.normalizedOS,a=this._derived.normalizedBrowser,i=!!this._info.isLowerPerformanceDevice,n=!!this._info.isSwiftShader;return e.some((e=>{var o;if("string"!=typeof e)return!1;const s=sr()(e).call(e).toLowerCase();if("low-device"===s)return i;if("swift-shader"===s)return n;const[d,l,c]=s.split("/");if(!d||!l)return!1;const u=sr()(d).call(d),h=sr()(l).call(l),_=sr()(o=c||"").call(o);return!(u&&u!==t||h&&!r.includes(h)&&!h.includes(r)||_&&_!==a)}))}},lr=new class{constructor(){d(this,"_desc",{blockConfig:void 0,defaultRendererType:1,isEnableCanvasCtxOptionsOpt:!1,isEnableFallbackToTagRender:!1,isEnableWasmTagRenderer:!1,safariYuvPaddingFixVer:void 0,chromeYuvLeftTopPaddingFixVer:void 0,disableVideoTagOnEdge:void 0,preferredUseSsrcStream:void 0,canUseSsrcStream:void 0,isUseSsrcStream:!1,shouldCropWasmFrameOnPosMismatch:void 0,shouldCropWasmFrameOnSizeMismatchOnly:void 0,avStreamMode:void 0,baseScriptUrl:"",cssPixelScale:1,isVideoHasWaterMark:!1,isSharingHasWaterMark:!1,videoWatermarkInfo:void 0,sharingWatermarkInfo:void 0}),d(this,"_configDone",!1),d(this,"_configDonePromise",void 0),d(this,"_resolveConfigDonePromise",void 0),this._configDonePromise=new Promise(((e,t)=>{this._resolveConfigDonePromise=e}))}_tryResetDerivedConfigIfNeeded(){this._configDone&&(this._desc.canUseSsrcStream=void 0,this._desc.shouldCropWasmFrameOnPosMismatch=void 0,this._desc.shouldCropWasmFrameOnSizeMismatchOnly=void 0)}init(e){this._desc=e,this._configDone=!0}setBlockConfig(e){if(!e)return;this._desc.blockConfig=e;const t=e.safariYuvPaddingFixVer;t&&this.setSafariYuvPaddingFixVer(t);const r=e.chromeYuvLeftTopPaddingFixVer;r&&this.setChromeYuvLeftTopPaddingFixVer(r);const a=e.disableVideoTagOnEdge;"true"===a&&this.setDisableVideoTagOnEdge(a)}configDone(){return this._configDone}configDonePromise(){return this._configDonePromise}markConfigDone(){this._configDone=!0,this._resolveConfigDonePromise(!0)}desc(){return this._desc}preferredUseSsrcStream(){var e;return void 0!==this._desc.preferredUseSsrcStream?!!this._desc.preferredUseSsrcStream:this.canUseSsrcStream()?(this._desc.preferredUseSsrcStream=dr.isOnWhitelist((null===(e=this._desc.blockConfig)||void 0===e?void 0:e.SsrcStreamPreferredWhitelist)||[]),this._desc.preferredUseSsrcStream):(this._desc.preferredUseSsrcStream=!1,!1)}defaultRendererType(){return this._desc.defaultRendererType}setDefaultRendererType(e){this._desc.defaultRendererType=e,this._tryResetDerivedConfigIfNeeded()}isEnableCanvasCtxOptionsOpt(){return this._desc.isEnableCanvasCtxOptionsOpt}setIsEnableCanvasCtxOptionsOpt(e){this._desc.isEnableCanvasCtxOptionsOpt=e,this._tryResetDerivedConfigIfNeeded()}isEnableWasmTagRenderer(){return this._desc.isEnableWasmTagRenderer}setWasmTagRendererFlags(e){let t=!1;dr.isBlink()?(t=!!(e&ir.TAG_RENDERER_ON_CHROME),dr.isEdge()&&this._desc.disableVideoTagOnEdge&&(t=!1)):dr.isWebkit()?t=!!(e&ir.TAG_RENDERER_ON_SAFARI):dr.isFirefox()&&(t=!!(e&ir.TAG_RENDERER_ON_FIREFOX)),this._desc.isEnableWasmTagRenderer=t,this._tryResetDerivedConfigIfNeeded()}isEnableFallbackToTagRender(){return this._desc.isEnableFallbackToTagRender}setFallbackToTagRenderFlags(e){let t=!1;dr.isBlink()?t=!!(e&ar.FALLBACK_TO_TAG_RENDERER_ON_CHROME):dr.isWebkit()?t=!!(e&ar.FALLBACK_TO_TAG_RENDERER_ON_SAFARI):dr.isFirefox()&&(t=!!(e&ar.FALLBACK_TO_TAG_RENDERER_ON_FIREFOX)),t||dr.isLowerPerformanceDevice()&&(t=!!(e&ar.LOWER_PERFORMANCE_DEVICE)),this._desc.isEnableFallbackToTagRender=t,this._tryResetDerivedConfigIfNeeded()}canUseSsrcStream(){return!!this._configDone&&(void 0!==this._desc.canUseSsrcStream?this._desc.canUseSsrcStream:nr.supportVideoTagRenderer()?nr.supportGraphicsAcceleration()&&!dr.isLowerPerformanceDevice()||!this.isEnableFallbackToTagRender()?this.isEnableWasmTagRenderer()?(this._desc.canUseSsrcStream=!0,this._desc.canUseSsrcStream):(this._desc.canUseSsrcStream=!1,!1):(this._desc.canUseSsrcStream=!0,this._desc.canUseSsrcStream):(this._desc.canUseSsrcStream=!1,!1))}isUseSsrcStream(){return this._desc.isUseSsrcStream}setIsUseSsrcStream(e){this._desc.isUseSsrcStream=e}setSafariYuvPaddingFixVer(e){"[object String]"===Object.prototype.toString.call(e)&&(this._desc.safariYuvPaddingFixVer=e)}setChromeYuvLeftTopPaddingFixVer(e){"[object String]"===Object.prototype.toString.call(e)&&(this._desc.chromeYuvLeftTopPaddingFixVer=e)}setDisableVideoTagOnEdge(e){this._desc.disableVideoTagOnEdge=e}_versionGreaterThan(e,t){const r=t.toString().split("."),a=e.toString().split("."),i=r.length,n=a.length,o=Math.min(i,n);for(let e=0;e<o;e++){const t=parseInt(r[e],10),i=parseInt(a[e],10);if(t!==i)return i>t}return n>=i}_logWasmFrameOnPosMismatch(e){Zt().tracing.Log_DT("[vtagq] WasmFrameOnPosMismatch: ".concat(e?"Crop":"No Crop"))}shouldCropWasmFrameOnPosMismatch(){return!!this._configDone&&(void 0!==this._desc.shouldCropWasmFrameOnPosMismatch?this._desc.shouldCropWasmFrameOnPosMismatch:this.isUseSsrcStream()?(this._desc.shouldCropWasmFrameOnPosMismatch=!0,dr.isChrome()?this._desc.chromeYuvLeftTopPaddingFixVer&&this._versionGreaterThan(dr.browserVersionInfo().chrome,this._desc.chromeYuvLeftTopPaddingFixVer)&&(this._desc.shouldCropWasmFrameOnPosMismatch=!1):dr.isSafari()&&this._desc.safariYuvPaddingFixVer&&this._versionGreaterThan(dr.browserVersionInfo().safari,this._desc.safariYuvPaddingFixVer)&&(this._desc.shouldCropWasmFrameOnPosMismatch=!1),this._logWasmFrameOnPosMismatch(this._desc.shouldCropWasmFrameOnPosMismatch),this._desc.shouldCropWasmFrameOnPosMismatch):(this._desc.shouldCropWasmFrameOnPosMismatch=!1,this._logWasmFrameOnPosMismatch(!1),!1))}_logWasmFrameOnSizeMismatch(e){Zt().tracing.Log_DT("[vtagq] WasmFrameOnSizeMismatch: ".concat(e?"Crop":"No Crop"))}shouldCropWasmFrameOnSizeMismatchOnly(){return!!this._configDone&&(void 0!==this._desc.shouldCropWasmFrameOnSizeMismatchOnly?this._desc.shouldCropWasmFrameOnSizeMismatchOnly:this.isUseSsrcStream()&&dr.isWebkit()?(dr.isSafari()&&this._desc.safariYuvPaddingFixVer&&this._versionGreaterThan(dr.browserVersionInfo().safari,this._desc.safariYuvPaddingFixVer)?this._desc.shouldCropWasmFrameOnSizeMismatchOnly=!1:this._desc.shouldCropWasmFrameOnSizeMismatchOnly=!0,this._logWasmFrameOnSizeMismatch(this._desc.shouldCropWasmFrameOnSizeMismatchOnly),this._desc.shouldCropWasmFrameOnSizeMismatchOnly):(this._desc.shouldCropWasmFrameOnSizeMismatchOnly=!1,this._logWasmFrameOnSizeMismatch(!1),!1))}shouldCropWasmFrame(e,t,r){return!!this._configDone&&(e!=r.width||t!=r.height)&&(lr.shouldCropWasmFrameOnSizeMismatchOnly()||lr.shouldCropWasmFrameOnPosMismatch()&&(0!=r.x||0!=r.y))}getAVStreamMode(){return this._configDone?(void 0!==this._desc.avStreamMode||(nr.supportTransferableStream()?this._desc.avStreamMode="writable-stream":nr.supportTransferableTrackAcrossWork()?this._desc.avStreamMode="track":this._desc.avStreamMode="none"),this._desc.avStreamMode):"none"}getBaseScriptUrl(){return this._desc.baseScriptUrl}setBaseScriptUrl(e){this._desc.baseScriptUrl=e}getCssPixelScale(){return this._desc.cssPixelScale}setCssPixelScale(e){this._desc.cssPixelScale=e}isVideoHasWaterMark(){return this._desc.isVideoHasWaterMark}setIsVideoHasWaterMark(e){this._desc.isVideoHasWaterMark=e,this._tryResetDerivedConfigIfNeeded()}isSharingHasWaterMark(){return this._desc.isSharingHasWaterMark}setIsSharingHasWaterMark(e){this._desc.isSharingHasWaterMark=e,this._tryResetDerivedConfigIfNeeded()}getVideoWatermarkInfo(){return this._desc.videoWatermarkInfo}setVideoWatermarkInfo(e){this._desc.videoWatermarkInfo=e}getSharingWatermarkInfo(){return this._desc.sharingWatermarkInfo}setSharingWatermarkInfo(e){this._desc.sharingWatermarkInfo=e}},cr={mgr:null,config:lr,capabilities:nr,userAgent:dr,tracing:{add_monitor(e){J(e)},globaltracing_error(e,t=null){te(e,t)},Log_Error(e,t=null){ee(e,t)},Log_DT(e){var t;t=e,Z?Q.directReport(t):re(t)}},graphics:{create_webgl_context_failed_monitor(e){ae(e)},calculateUVCoord:(e,t,r,a)=>function(e,t,r,a){if(!e||!t||!r)return null;const i=t.width/t.height;let n=t.width,o=t.height;if(t.width>e.width||t.height>e.height){const r=e.width/t.width,a=e.height/t.height,i=Math.min(r,a);n*=i,o*=i}let s=0,d=0;e.width/e.height>i?(d=Math.floor(e.height/o)*o,s=Math.floor(d*i/n)*n,s>e.width&&(s=Math.floor(e.width/n)*n,d=Math.floor(s/i/o)*o)):(s=Math.floor(e.width/n)*n,d=Math.floor(s/i/o)*o,d>e.height&&(d=Math.floor(e.height/o)*o,s=Math.floor(d*i/n)*n));let l=0,c=0,u=0,h=0,_={x:c,y:l,w:u,h};0==a?(l=1-(l+(o-1)/e.height),c=t.left/e.width,h=1-t.top/e.height,u=c+n/e.width,_.x=c,_.y=1-h,_.w=u,_.h=1-l):1==a?(c=1-(l+(o-1)/e.height),u=1-t.top/e.height,l=t.left/e.width,h=c+n/e.width):2==a?(l=t.top/e.height,c=t.left/e.width,h=l+(o-1)/e.height,u=c+n/e.width):3==a&&(c=t.top/e.height,u=l+(o-1)/e.height,l=t.left/e.width,h=c+n/e.width);let p=[],f=[{x:u,y:h},{x:u,y:l},{x:c,y:l},{x:u,y:h},{x:c,y:h},{x:c,y:l}];for(let e=0;e<f.length;++e){let t={u:f[e].x,v:f[e].y};p.push(t)}let m=[];for(let e=0;e<p.length;++e){let t=p[e];m.push(t.u),m.push(t.v)}return{uvCoords:m,uvRect:_}}(e,t,r,a),calculateUVCoordsForMultiView:(e,t,r,a,i,n)=>function(e,t,r,a,i,n){let o=0,s=0,d=0,l=0,c={x:s,y:o,w:d,h:l};if(e){const e=1==i||3==i?t.height/t.width:t.width/t.height,n=a.left||0,c=a.top||0;if(a.width/a.height>e){const t=a.height*e;o=c/r.height,s=(Math.round((a.width-t)/2)+n)/r.width,l=o+(a.height-1)/r.height,d=s+t/r.width}else{const t=a.width/e;o=(Math.round((a.height-t)/2)+c)/r.height,s=n/r.width,l=o+(t-1)/r.height,d=s+a.width/r.width}0==i?(o=1-(o+(a.height-1)/r.height),s=a.left/r.width,l=1-a.top/r.height,d=s+a.width/r.width):1==i?(s=1-(o+(a.height-1)/r.height),d=1-a.top/r.height,o=a.left/r.width,l=s+a.width/r.width):2==i?(o=a.top/r.height,s=a.left/r.width,l=o+(a.height-1)/r.height,d=s+a.width/r.width):3==i&&(s=a.top/r.height,d=o+(a.height-1)/r.height,o=a.left/r.width,l=s+a.width/r.width)}else{const e=a.width/a.height;let t=a.width,n=a.height;if(a.width>r.width||a.height>r.height){const e=r.width/a.width,i=r.height/a.height,o=Math.min(e,i);t*=o,n*=o}let u=0,h=0;r.width/r.height>e?(h=Math.floor(r.height/n)*n,u=Math.floor(h*e/t)*t,u>r.width&&(u=Math.floor(r.width/t)*t,h=Math.floor(u/e/n)*n)):(u=Math.floor(r.width/t)*t,h=Math.floor(u/e/n)*n,h>r.height&&(h=Math.floor(r.height/n)*n,u=Math.floor(h*e/t)*t)),0==i?(o=1-(o+(n-1)/r.height),s=a.left/r.width,l=1-a.top/r.height,d=s+t/r.width,c.x=s,c.y=1-l,c.w=d,c.h=1-o,a.height>a.width&&(s=rr(s,2),d=tr(d,2))):1==i?(s=1-(o+(n-1)/r.height),d=1-a.top/r.height,o=a.left/r.width,l=s+t/r.width):2==i?(o=a.top/r.height,s=a.left/r.width,l=o+(n-1)/r.height,d=s+t/r.width):3==i&&(s=a.top/r.height,d=o+(n-1)/r.height,o=a.left/r.width,l=s+t/r.width)}let u=[],h=[{x:d,y:l},{x:d,y:o},{x:s,y:o},{x:d,y:l},{x:s,y:l},{x:s,y:o}];for(let e=0;e<h.length;++e){let t=null;if(n){let r=-1*Math.abs(h[e].x);h[e].x=r,t={u:h[e].x+1,v:h[e].y}}else t={u:h[e].x,v:h[e].y};u.push(t)}let _=[];for(let e=0;e<u.length;++e){let t=u[e];_.push(t.u),_.push(t.v)}return{uvCoords:_,uvRect:c}}(e,t,r,a,i,n),calculateRenderRect:(e,t)=>function(e,t){let r=0,a=0,i=0,n=0;const o=t.width/t.height;return e.width/e.height>o?(a=e.height,r=a*o,i=(e.width-r)/2,n=0):(r=e.width,a=r/o,i=0,n=(e.height-a)/2),r<=e.canvas.width&&(i=(e.canvas.width-r)/2),a<=e.canvas.height&&(n=(e.canvas.height-a)/2),{x:i,y:n,width:r,height:a}}(e,t),evalCroppingRect:(e,t)=>function(e,t){if(!e||null==t)throw new Error("evalCroppingRect() invalid parameters!");return 1===t||3===t?{top:e.top,left:e.left,width:e.height,height:e.width}:e}(e,t)},assertion:{assert(e,t=""){Jt(e,t)},assertWithFailed(e){er(e)},abstractMethod(){!function(){const e=new Error("call abstract method!");Zt().tracing.Log_Error("AbstractMethod!",e)}()},unreachable(){!function(){const e=new Error("Unreachable code reached!");Zt().tracing.Log_Error("Unreachable!",e)}()}}},ur=new class{constructor(){this.moduleCache=new Map,globalThis.__dyn_modules__={}}loadModuleFromBlob(e,t,r){if(this.moduleCache.has(e))return this.moduleCache.get(e);this.moduleCache.set(e,void 0);try{let a;const i=URL.createObjectURL(t);return Jt("function"==typeof importScripts),importScripts(i),a=globalThis.__dyn_modules__[e],a&&"function"==typeof a.init&&(a.init(cr,r),this.moduleCache.set(e,a)),a}catch(t){ee(`[DynModuleMgr] loadModuleFromBlob Error: ${e}`,t)}}getModule(e){return this.moduleCache.get(e)||void 0}};function hr(e,t,r){_r(e,t),t.set(e,r)}function _r(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function pr(e,t,r){return e.set(mr(e,t),r),r}function fr(e,t){return e.get(mr(e,t))}function mr(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var gr=new WeakMap,vr=new WeakMap,yr=new WeakMap,br=new WeakMap,wr=new WeakSet;function Sr(){return!0}function Mr(){if(fr(yr,this)){let e={};return e.architecture=fr(yr,this).architecture,e.vendor=fr(yr,this).vendor,e}return null}async function Er(){if(!navigator.gpu)return pr(gr,this,1),!1;const e=await navigator.gpu.requestAdapter();return e?await e.requestDevice()?("function"==typeof e.requestAdapterInfo?(pr(yr,this,await e.requestAdapterInfo()),fr(yr,this)&&console.log("adapter info: ".concat(fr(yr,this).architecture,", ").concat(fr(yr,this).vendor))):"info"in e&&pr(yr,this,e.info),pr(gr,this,0),!0):(pr(gr,this,3),!1):(pr(gr,this,2),!1)}function Rr(e){if(!e)return!1;const t=e.vendor;return-1!==qe.indexOf(t)}function Tr(e,t,r){return kr.produce(e,t,r)}class kr{static produce(e,t,r){let a=null;return 2===e&&(a=ur.getModule("webgpu_renderer_dynmod").exports.createWebGPURenderer(t,r)),a}}const xr=class{constructor(){var e;_r(this,e=wr),e.add(this),hr(this,gr,0),hr(this,vr,1),hr(this,yr,null),hr(this,br,new Map)}async evaluate(e){if(pr(vr,this,1),!mr(wr,this,Sr).call(this))return fr(vr,this);if(!e.allowedOnTargetPlatforms)return fr(vr,this);if(!e.allowedOnTargetBrowsers)return fr(vr,this);if(!await mr(wr,this,Er).call(this))return fr(vr,this);const t=mr(wr,this,Mr).call(this);if(!mr(wr,this,Rr).call(this,t))return fr(vr,this);let r=new OffscreenCanvas(1,1);return r.getContext("webgpu")?(r=null,pr(vr,this,2),fr(vr,this)):(r=null,fr(vr,this))}acquireRenderer(e,t){let r=null;return arguments.length>2&&void 0!==arguments[2]&&arguments[2]&&fr(br,this).clear(),fr(br,this).has(e)&&(r=fr(br,this).get(e),r&&(e&&(r.setCanvas(e),r.initialize(e)),t&&r.setDevice(t.acquireGPUDevice()))),null==r&&(r=mr(wr,this,Tr).call(this,fr(vr,this),e,t),r&&fr(br,this).set(e,r)),r}rendererReinitialize(){if(fr(br,this))for(const[e,t]of fr(br,this))t&&t.initialize(e)}rendererUnconfigureGPUContext(){if(fr(br,this))for(const[e,t]of fr(br,this))t&&t.unconfigureGPUContext()}getRendererType(){return fr(vr,this)}loadRenderModuleFromBlob(e,t){t&&(2===e?ur.loadModuleFromBlob("webgpu_renderer_dynmod",t):er("Invalid render module for ".concat(e)))}setRendererType(e){pr(vr,this,e)}isWebGPURendererType(){return 2===fr(vr,this)}isWebGLRendererType(){return 1===fr(vr,this)}isWebGL2RendererType(){return 3===fr(vr,this)}cleanup(){for(const[e,t]of fr(br,this))t&&t.cleanup();fr(br,this).clear()}};function Ar(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var Cr=new WeakSet;function Fr(e){e.forEach((e=>{e.consumePendingGPUEvents()}))}function Pr(e){return!e||0==e.length||-1==e.findIndex((e=>!!e&&(!!e.getTextureLayerByZIndex(0)&&e.isRenderingStateReady())))}const Ir=class{constructor(){var e,t;(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e=this,t=Cr),t.add(e)}render(e,t){e?e.isGPUDeviceReady()?t&&0!=t.length?(Ar(Cr,this,Fr).call(this,t),Ar(Cr,this,Pr).call(this,t)||e.render(t)):J("WGPU RendererController_render() displays are not available!"):J("WGPU RendererController_render() GPU device is not ready!"):J("WGPU RendererController_render() renderer is not attached!")}};function Or(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function Dr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Or(Object(r),!0).forEach((function(t){d(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Or(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}let Lr=new Map,Wr=[];function Nr(e){e.preventDefault()}function Ur(e,t,r,a,i,n,o){let s=arguments.length>7&&void 0!==arguments[7]&&arguments[7];this.canvasElement=e,this.canvasID=t,this.contextOptions=i,this.textureindex=r||0,this.initmask=!!o,this.isEnableCanvasAlphaChannel=s,Ur.prototype.ROTATION_CLOCK0=0,Ur.prototype.ROTATION_CLOCK90=1,Ur.prototype.ROTATION_CLOCK180=2,Ur.prototype.ROTATION_CLOCK270=3,this.webGLResources=n,n||(this.initContextGL(),this.contextGL&&(this.webGLContextLostProtect(),this.contextGL.isContextLost()&&this.restoreContext())),this.webglVertexPos=[0,0,0,0],this.webglTexturePos=[0,0,0,0],this.vertexPos=[0,0,0,0],this.texturePos=[0,0,0,0],this.reinit(n);var d=new ArrayBuffer(4);this.dummpyCursor=new Uint8Array(d),this.dummpyWaterMark=new Uint8Array(d),this.cursorWidth=0,this.cursorHeight=0,this.hasCursor=0,this.lastcursorSyncId=-1,this.hasWaterMark=0,this.watermarkOpacity=.15,this.watermarkWidth=0,this.watermarkHeight=0,this.isMultiView=!1,this.hasWholeFrame=0,this.croppingParams={},this.croppingParams.top=0,this.croppingParams.left=0,this.croppingParams.width=0,this.croppingParams.height=0,this.textureWidth=0,this.textureHeight=0,this.viewWidth=0,this.viewHeight=0,this.picRotation=-1,this.bgColor=[0,0,0],this.cx=0,this.cy=0,this.cw=0,this.ch=0,this.colorRange=-1,this.videoMode=Fe,this.rotation=this.ROTATION_CLOCK0,this.fillMode=0,this.fillModeForResolution=0,this.viewPostion=null,this.enable_rounded_corner=0,this.radius_lt_x=0,this.radius_lt_y=0,this.radius_lb_x=0,this.radius_lb_y=0,this.radius_rt_x=0,this.radius_rt_y=0,this.radius_rb_x=0,this.radius_rb_y=0,this.aa_width=Ye,this.viewport_rect=null}Ur.prototype.isLocalDisplay=function(){return 0==this.textureindex},Ur.prototype.reinit=function(e){if(this.webGLResources=e,!this.contextGL||this.contextGL.isContextLost()||this.contextGL.glInitSucceed||this.webGLResources){if(this.webGLResources&&this.webGLResources.contextgl&&!this.webGLResources.contextgl.isContextLost()){this.contextGL=this.webGLResources.contextgl,this.shaderProgram=this.webGLResources.program,this.vertexPosBuffer=this.webGLResources.vBuffer,this.texturePosBuffer=this.webGLResources.tBuffer,this.webglTexturePos=this.webGLResources.webglTexturePos,this.webglVertexPos=this.webGLResources.webglVertexPos,this.initTextures(!1);let e=this.contextGL.getError();this.contextGL.glInitSucceed=e!=this.contextGL.NO_ERROR&&e!=this.contextGL.CONTEXT_LOST_WEBGL?0:1}}else{this.initProgram(),this.initmask?this.initTextures(!1):this.initTextures(!0),this.initBuffers();let e=this.contextGL.getError();this.contextGL.glInitSucceed=e!=this.contextGL.NO_ERROR&&e!=this.contextGL.CONTEXT_LOST_WEBGL?0:1}},Ur.prototype.webGLContextLostSimulate=function(){const e=ce(this.contextGL,"WEBGL_lose_context");null==e||e.loseContext()},Ur.prototype.restoreContext=function(){if(this.contextGL)try{var e,t;null!==(e=this.canvasElement)&&void 0!==e&&e.loseContextExtension&&!this.canvasElement.restoreTimeoutId&&this.contextGL.isContextLost()&&(this.canvasElement.restoreTimeoutId=setTimeout((()=>{this.canvasElement.reportcontextloss||(this.canvasElement.reportcontextloss=!0,ae("WebGLRestoreTimeout")),this.canvasElement.restoreTimeoutId=0}),1500),null===(t=this.canvasElement)||void 0===t||t.loseContextExtension.restoreContext())}catch(e){ee("webgl restoreContext exception",e)}},Ur.prototype.webgGLContextLostCallback=function(e){re("webglcontextlost event: canvas listener size=".concat(Wr.length,", canvas id: ").concat(this.canvasID,", , ids:").concat(Wr.join())),e.preventDefault(),this.contextGL.glInitSucceed=0,this.contextOptions&&this.contextOptions.webglcontextlostCallback&&this.contextOptions.webglcontextlostCallback(e,this.contextOptions.params)},Ur.prototype.removeEventListener=function(e,t){if(e&&t){e.restoreTimeoutId&&(clearTimeout(e.restoreTimeoutId),e.restoreTimeoutId=void 0),e.removeEventListener("webglcontextlost",t.contextLostHandler),e.removeEventListener("webglcontextrestored",t.contextRestoredHandler);const r=Wr.indexOf(this.canvasID);Wr.splice(r,1),Lr.delete(e)}},Ur.prototype.webGLContextRestoredCallback=function(e){var t,r;re("webglcontextrestored event from canvas id: ".concat(this.canvasID)),this.canvasElement.restoreTimeoutId&&(clearTimeout(this.canvasElement.restoreTimeoutId),this.canvasElement.restoreTimeoutId=void 0),this.webglVertexPos=[0,0,0,0],this.webglTexturePos=[0,0,0,0],this.reinit(),null===(t=this.contextOptions)||void 0===t||null===(r=t.webglcontextrestoredCallback)||void 0===r||r.call(t,e,this.contextOptions.params)},Ur.prototype.webGLContextLostProtect=function(){this.canvasElement&&!this.canvasElement.loseContextExtension&&(this.canvasElement.loseContextExtension=ce(this.contextGL,"WEBGL_lose_context"));let e=this.canvasElement,t=Lr.get(e);t&&this.removeEventListener(e,t),Lr.set(e,this),this.contextLostHandler=this.webgGLContextLostCallback.bind(this),this.contextRestoredHandler=this.webGLContextRestoredCallback.bind(this),e.addEventListener("webglcontextlost",this.contextLostHandler,{capture:!1}),e.addEventListener("webglcontextrestored",this.contextRestoredHandler,{capture:!1}),-1===Wr.indexOf(this.canvasID)&&(Wr.push(this.canvasID),Wr.length>4&&re("webglcanvas listener size=".concat(Wr.length,", ids:").concat(Wr.join())))},Ur.prototype.isWebGL=function(){return this.contextGL},Ur.prototype.isAvaiable=function(){return this.contextGL&&!this.contextGL.isContextLost()&&this.contextGL.glInitSucceed},Ur.prototype.initContextGL=function(){for(var e,t,r,a=this.canvasElement,i=null,n=["webgl","experimental-webgl","moz-webgl","webkit-3d"],o=0;!i&&o<n.length;){var s=n[o];try{if(Zt().config.isEnableCanvasCtxOptionsOpt()){let e={depth:!1,stencil:!1,antialias:!1,alpha:this.isEnableCanvasAlphaChannel};if(this.contextOptions){let t=Dr(Dr({},this.contextOptions),e);i=a.getContext(s,t)}else i=a.getContext(s,e)}else i=this.contextOptions?a.getContext(s,this.contextOptions):a.getContext(s)}catch(e){i=null}i&&"function"==typeof i.getParameter||(i=null),++o}if(this.contextGL=i,!i||i.isContextLost())return ee("Failed when trying to get WebGLContext on canvas(".concat(null===(e=this.canvasElement)||void 0===e?void 0:e.width,",").concat(null===(t=this.canvasElement)||void 0===t?void 0:t.height,"), gl=").concat(i,", lost=").concat(null===(r=i)||void 0===r?void 0:r.isContextLost())),void ae("InitWebGLFail");i.glInitSucceed=0},Ur.prototype.initProgram=function(){var e=this.contextGL,t=e.createShader(e.VERTEX_SHADER);e.shaderSource(t,"\n attribute vec4 vertexPos;\n attribute vec4 texturePos;\n attribute vec4 masktexturePos;\n varying vec2 textureCoord;\n varying vec2 masktextureCoord;\n\n void main() {\n gl_Position = vertexPos;\n textureCoord = texturePos.xy;\n masktextureCoord = masktexturePos.xy;\n }\n "),e.compileShader(t),e.getShaderParameter(t,e.COMPILE_STATUS)||e.isContextLost()||re("webgl Vertex shader failed to compile: "+e.getShaderInfoLog(t));var r=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(r,"\n precision highp float;\n varying highp vec2 textureCoord;\n varying highp vec2 masktextureCoord;\n\n uniform sampler2D ySampler;\n uniform sampler2D uSampler;\n uniform sampler2D vSampler;\n uniform sampler2D cursorSampler;\n uniform sampler2D waterMarkSampler;\n uniform sampler2D previewVideoSampler;\n uniform sampler2D maskSampler;\n\n uniform vec4 cursorInfo;\n uniform int onlyRGBA;\n uniform int bgraMode;\n uniform int colorRange;\n uniform int waterMarkFlag;\n uniform int cursorFlag;\n uniform int yuvmode;\n\n const int MAX_ELLIPSE_COUNT = 10;\n uniform int maskFlag; // 0: mask disabled; 1: mask enabled;\n uniform int maskMode; // 0: static mask; 1: dynamic mask;\n uniform vec4 uEllipses[MAX_ELLIPSE_COUNT]; // each ellipse contains (cx, cy, rx, ry) 4-coords\n uniform int uEllipseCount; // how many ellipses will draw\n\n // rounded corner feature in gl shader\n uniform float u_enable_rounded_corner;\n uniform float u_radius_lt_x;\n uniform float u_radius_lt_y;\n uniform float u_radius_lb_x;\n uniform float u_radius_lb_y;\n uniform float u_radius_rt_x;\n uniform float u_radius_rt_y;\n uniform float u_radius_rb_x;\n uniform float u_radius_rb_y;\n uniform float u_aa_width;\n uniform vec4 u_viewport_rect;\n\n const mat4 YUV2RGB_L = mat4(\n 1.1643828125, 0, 1.59602734375, -0.87078515625,\n 1.1643828125, -0.39176171875, -0.81296875, 0.52959375,\n 1.1643828125, 2.017234375, 0, -1.081390625,\n 0, 0, 0, 1\n );\n\n const mat4 YUV2RGB_F = mat4(\n 1.0, 0, 1.402, -0.701,\n 1.0, -0.34413, -0.71414, 0.529135,\n 1.0, 1.772, 0, -0.886,\n 0, 0, 0, 1\n );\n\n void main(void) {\n vec4 c;\n if (waterMarkFlag != 1) {\n if (onlyRGBA == 0) {\n highp float y = texture2D(ySampler, textureCoord).r;\n highp float u;\n highp float v;\n\n if (yuvmode == 1) {\n u = texture2D(uSampler, textureCoord).r;\n v = texture2D(vSampler, textureCoord).r;\n } else {\n u = texture2D(uSampler, textureCoord).r;\n v = texture2D(uSampler, textureCoord).a;\n }\n\n if (colorRange == 0) {\n c = vec4(y, u, v, 1) * YUV2RGB_L;\n } else {\n c = vec4(y, u, v, 1) * YUV2RGB_F;\n }\n\n if (cursorFlag == 1) {\n if (cursorInfo.z > 0.0 &&\n textureCoord.x >= cursorInfo.x &&\n textureCoord.y >= cursorInfo.y &&\n textureCoord.x < cursorInfo.x + cursorInfo.z &&\n textureCoord.y < cursorInfo.y + cursorInfo.w) {\n\n vec2 cursorCoord = textureCoord - cursorInfo.xy;\n cursorCoord /= cursorInfo.zw;\n vec4 cursor = texture2D(cursorSampler, cursorCoord);\n c = c * (1.0 - cursor.a) + cursor * cursor.a;\n }\n }\n } else {\n c = texture2D(previewVideoSampler, textureCoord);\n if (bgraMode == 1) {\n c = vec4(c.b, c.g, c.r, c.a);\n }\n }\n } else {\n c = texture2D(waterMarkSampler, textureCoord);\n if (c.r == 0.0 && c.g == 0.0 && c.b == 0.0) {\n c.a = 0.0;\n }\n }\n\n if (maskFlag == 1 && waterMarkFlag != 1) {\n vec4 mask = texture2D(maskSampler, masktextureCoord);\n if (maskMode == 0) {\n // -- handle static mask --\n if (mask.r != 0.0 || mask.g != 0.0 || mask.b != 0.0) {\n c = mask * mask.a + c * (1.0 - mask.a);\n }\n } else if (maskMode == 1) {\n // -- handle dynamic mask --\n bool inEllipse = false; // variable for checking whether the pixel to be drawn hits ellipse\n for (int i = 0; i < MAX_ELLIPSE_COUNT; i++) {\n if (i > uEllipseCount) break;\n\n vec2 ellipseCenter = uEllipses[i].xy;\n vec2 ellipseRadii = uEllipses[i].zw;\n vec2 ellipsePos = masktextureCoord - ellipseCenter;\n\n float ellipseEq = (ellipsePos.x * ellipsePos.x) / (ellipseRadii.x * ellipseRadii.x) +\n (ellipsePos.y * ellipsePos.y) / (ellipseRadii.y * ellipseRadii.y);\n if (ellipseEq <= 1.0) {\n // the pixel in the ellipse range\n inEllipse = true;\n break;\n }\n }\n\n if (inEllipse) {\n c = mask * mask.a + c * (1.0 - mask.a);\n }\n }\n }\n\n if (waterMarkFlag != 1) {\n c.a = 1.0;\n }\n\n if (u_enable_rounded_corner < 0.5) {\n gl_FragColor = c;\n return;\n }\n\n // step 1: viewport coordinate mapping\n // convert the fragment coordinate(canvas coordinate) to the viewport coordinate\n // for example, a viewport={x: 100, y: 100, w: 200, h: 160}, a fragCoord.xy={x:120, y: 120}\n // we can get the pos={x: 20, y: 20}\n vec2 pos = gl_FragCoord.xy - u_viewport_rect.xy;\n vec2 viewportSize = u_viewport_rect.zw;\n\n // convert the normalized radius to pixel value\n float r_lt_x = u_radius_lt_x * viewportSize.x;\n float r_lt_y = u_radius_lt_y * viewportSize.y;\n float r_rt_x = u_radius_rt_x * viewportSize.x;\n float r_rt_y = u_radius_rt_y * viewportSize.y;\n float r_lb_x = u_radius_lb_x * viewportSize.x;\n float r_lb_y = u_radius_lb_y * viewportSize.y;\n float r_rb_x = u_radius_rb_x * viewportSize.x;\n float r_rb_y = u_radius_rb_y * viewportSize.y;\n\n // step 2: calculate the rounded corner mask (as alpha)\n float alpha = 1.0;\n\n // --- calculation of the left-top corner ---\n // Condition: if (pos.x < r_lt_x && pos.y < r_lt_y)\n float in_lt = (1.0 - step(r_lt_x, pos.x)) * (1.0 - step(r_lt_y, pos.y));\n // the circle center of the left-top corner in pixel coordinate\n vec2 center_lt = vec2(r_lt_x, r_lt_y);\n // calculate and normalize the distance between the fragment and the center\n vec2 diff_lt = (pos - center_lt) / vec2(r_lt_x, r_lt_y);\n float normDist_lt = length(diff_lt);\n // smoothstep function is used to calculate the alpha value\n float mask_lt = 1.0 - smoothstep(1.0 - u_aa_width, 1.0, normDist_lt);\n float final_lt = mix(1.0, mask_lt, in_lt);\n\n // --- calculation of the right-top corner ---\n float in_rt = (1.0 - step(r_rt_x, viewportSize.x - pos.x)) * (1.0 - step(r_rt_y, pos.y));\n vec2 center_rt = vec2(viewportSize.x - r_rt_x, r_rt_y);\n vec2 diff_rt = (pos - center_rt) / vec2(r_rt_x, r_rt_y);\n float normDist_rt = length(diff_rt);\n float mask_rt = 1.0 - smoothstep(1.0 - u_aa_width, 1.0, normDist_rt);\n float final_rt = mix(1.0, mask_rt, in_rt);\n\n // --- calculation of the left-bottom corner ---\n float in_lb = (1.0 - step(r_lb_x, pos.x)) * (1.0 - step(r_lb_y, viewportSize.y - pos.y));\n vec2 center_lb = vec2(r_lb_x, viewportSize.y - r_lb_y);\n vec2 diff_lb = (pos - center_lb) / vec2(r_lb_x, r_lb_y);\n float normDist_lb = length(diff_lb);\n float mask_lb = 1.0 - smoothstep(1.0 - u_aa_width, 1.0, normDist_lb);\n float final_lb = mix(1.0, mask_lb, in_lb);\n\n // --- calculation of the right-bottom corner ---\n float in_rb = (1.0 - step(r_rb_x, viewportSize.x - pos.x)) * (1.0 - step(r_rb_y, viewportSize.y - pos.y));\n vec2 center_rb = vec2(viewportSize.x - r_rb_x, viewportSize.y - r_rb_y);\n vec2 diff_rb = (pos - center_rb) / vec2(r_rb_x, r_rb_y);\n float normDist_rb = length(diff_rb);\n float mask_rb = 1.0 - smoothstep(1.0 - u_aa_width, 1.0, normDist_rb);\n float final_rb = mix(1.0, mask_rb, in_rb);\n\n // Get the minimum value from the four corners (to ensure that if any corner requires transparency it is applied)\n float finalAlpha = min(min(final_lt, final_rt), min(final_lb, final_rb));\n\n // Final output color\n gl_FragColor = vec4(c.rgb, c.a * finalAlpha);\n }\n"),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS)||e.isContextLost()||re("webgl Fragment shader failed to compile: "+e.getShaderInfoLog(r));var a=e.createProgram();e.attachShader(a,t),e.attachShader(a,r),e.linkProgram(a),e.getProgramParameter(a,e.LINK_STATUS)||e.isContextLost()||re("webgl Program failed to compile: "+e.getProgramInfoLog(a)),e.useProgram(a),this.shaderProgram=a},Ur.prototype.initBuffers=function(){var e=this.contextGL,t=this.shaderProgram,r=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,r),e.bufferData(e.ARRAY_BUFFER,new Float32Array([1,1,-1,1,1,-1,-1,-1,1,1,-1,1,1,-1,-1,-1]),e.STATIC_DRAW);var a=e.getAttribLocation(t,"vertexPos");e.enableVertexAttribArray(a),e.vertexAttribPointer(a,2,e.FLOAT,!1,0,0),this.vertexPosBuffer=r;var i=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,i),e.bufferData(e.ARRAY_BUFFER,new Float32Array([1,0,0,0,1,1,0,1,1,0,0,0,1,1,0,1]),e.STATIC_DRAW);var n=e.getAttribLocation(t,"texturePos");if(e.enableVertexAttribArray(n),e.vertexAttribPointer(n,2,e.FLOAT,!1,0,0),this.initmask&&!this.masktexturePosBuffer){var o=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,o),e.bufferData(e.ARRAY_BUFFER,new Float32Array([1,0,0,0,1,1,0,1]),e.STATIC_DRAW);var s=e.getAttribLocation(t,"masktexturePos");e.enableVertexAttribArray(s),e.vertexAttribPointer(s,2,e.FLOAT,!1,0,0),this.masktexturePosBuffer=o}this.texturePosBuffer=i},Ur.prototype.initTextures=function(e){var t=this.contextGL,r=this.shaderProgram;t.pixelStorei(t.UNPACK_ALIGNMENT,1);var a=this.initTexture();this.yTextureRef=a,this.oyTextureRef=a;var i=this.initTexture();this.uTextureRef=i,this.ouTextureRef=i;var n=this.initTexture();this.vTextureRef=n,this.ovTextureRef=n,e&&this.BindTextures(1),this.waterMarkTextureRef=this.initTexture();var o=t.getUniformLocation(r,"waterMarkSampler");t.uniform1i(o,5),this.waterMarkSamplerRef=o;var s=this.initTexture(),d=t.getUniformLocation(r,"cursorSampler");if(t.uniform1i(d,4),this.cursorTextureRef=s,this.cursorSamplerRef=d,this.cursorInfoRef=t.getUniformLocation(r,"cursorInfo"),this.initmask){t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,1);var l=this.initTexture(),c=t.getUniformLocation(r,"maskSampler");t.uniform1i(c,4),this.maskTextureRef=l}this.colorRangeRef=t.getUniformLocation(r,"colorRange"),this.onlyRGBARef=t.getUniformLocation(r,"onlyRGBA"),this.bgraModeRef=t.getUniformLocation(r,"bgraMode"),this.waterMarkFlagRef=t.getUniformLocation(r,"waterMarkFlag"),this.maskFlagRef=t.getUniformLocation(r,"maskFlag"),this.cursorFlagRef=t.getUniformLocation(r,"cursorFlag"),this.yuvmodeRef=t.getUniformLocation(r,"yuvmode"),this.ul_enable_rounded_corner=t.getUniformLocation(r,"u_enable_rounded_corner"),this.ul_radius_lt_x=t.getUniformLocation(r,"u_radius_lt_x"),this.ul_radius_lt_y=t.getUniformLocation(r,"u_radius_lt_y"),this.ul_radius_lb_x=t.getUniformLocation(r,"u_radius_lb_x"),this.ul_radius_lb_y=t.getUniformLocation(r,"u_radius_lb_y"),this.ul_radius_rt_x=t.getUniformLocation(r,"u_radius_rt_x"),this.ul_radius_rt_y=t.getUniformLocation(r,"u_radius_rt_y"),this.ul_radius_rb_x=t.getUniformLocation(r,"u_radius_rb_x"),this.ul_radius_rb_y=t.getUniformLocation(r,"u_radius_rb_y"),this.ul_aa_width=t.getUniformLocation(r,"u_aa_width"),this.ul_viewport_rect=t.getUniformLocation(r,"u_viewport_rect")},Ur.prototype.BindTextures=function(e){var t=this.contextGL,r=this.shaderProgram;if(t.pixelStorei(t.UNPACK_ALIGNMENT,1),t.activeTexture(t.TEXTURE0+0),t.bindTexture(t.TEXTURE_2D,this.yTextureRef),t.activeTexture(t.TEXTURE0+1),t.bindTexture(t.TEXTURE_2D,this.uTextureRef),t.activeTexture(t.TEXTURE0+2),t.bindTexture(t.TEXTURE_2D,this.vTextureRef),1==e){let e=t.getUniformLocation(r,"ySampler");t.uniform1i(e,0);let a=t.getUniformLocation(r,"uSampler");t.uniform1i(a,1);let i=t.getUniformLocation(r,"vSampler");t.uniform1i(i,2)}else if(this.isRGBAMode(e)){let e=t.getUniformLocation(r,"previewVideoSampler");t.uniform1i(e,0);let a=t.getUniformLocation(r,"ySampler");t.uniform1i(a,0);let i=t.getUniformLocation(r,"uSampler");t.uniform1i(i,0);let n=t.getUniformLocation(r,"vSampler");t.uniform1i(n,0)}else if(2==e){let e=t.getUniformLocation(r,"ySampler");t.uniform1i(e,0);let a=t.getUniformLocation(r,"uSampler");t.uniform1i(a,1);let i=t.getUniformLocation(r,"vSampler");t.uniform1i(i,0)}let a=t.getUniformLocation(r,"previewVideoSampler");t.uniform1i(a,0);let i=t.getUniformLocation(r,"maskSampler");this.initmask?(t.activeTexture(t.TEXTURE0+4),t.bindTexture(t.TEXTURE_2D,this.maskTextureRef),t.uniform1i(i,4)):t.uniform1i(i,0);let n=t.getUniformLocation(r,"cursorSampler");t.uniform1i(n,0);let o=t.getUniformLocation(this.shaderProgram,"waterMarkSampler");t.uniform1i(o,5)},Ur.prototype.initTexture=function(){var e=this.contextGL,t=e.createTexture();return e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.bindTexture(e.TEXTURE_2D,null),t},Ur.prototype.clearDisplay=function(){var e=this.contextGL;e&&(e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT))},Ur.prototype.cleanup=function(){let e=this.canvasElement,t=Lr.get(e);if(t&&this.removeEventListener(e,t),e.defaultContextLostHandler||(e.defaultContextLostHandler=Nr,e.addEventListener("webglcontextlost",Nr,{capture:!1})),this.cleanupRoundedCornerRadius(),this.isAvaiable()){var r=this.contextGL;r.deleteProgram(this.program),r.activeTexture(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,null),r.activeTexture(r.TEXTURE1),r.bindTexture(r.TEXTURE_2D,null),r.activeTexture(r.TEXTURE2),r.bindTexture(r.TEXTURE_2D,null),r.activeTexture(r.TEXTURE3),r.bindTexture(r.TEXTURE_2D,null),r.activeTexture(r.TEXTURE4),r.bindTexture(r.TEXTURE_2D,null),r.activeTexture(r.TEXTURE5),r.bindTexture(r.TEXTURE_2D,null),r.bindBuffer(r.ARRAY_BUFFER,null),r.deleteTexture(this.yTextureRef),r.deleteTexture(this.uTextureRef),r.deleteTexture(this.vTextureRef),r.deleteTexture(this.cursorTextureRef),r.deleteTexture(this.waterMarkTextureRef),r.deleteBuffer(this.vertexPosBuffer),r.deleteBuffer(this.texturePosBuffer),this.maskTextureRef&&r.deleteTexture(this.maskTextureRef),this.masktexturePosBuffer&&r.deleteBuffer(this.masktexturePosBuffer),r.glInitSucceed=0}},Ur.prototype.updataVertexInfoForSharing=function(){const[e,t,r,a]=this.vertexPos,i=this.webglVertexPos[0],n=this.webglVertexPos[3];if(e!=i||n!=a){this.webglVertexPos[0]=e,this.webglVertexPos[1]=t,this.webglVertexPos[2]=r,this.webglVertexPos[3]=a;var o=new Float32Array([r,t,e,t,r,a,e,a,1,1,-1,1,1,-1,-1,-1]),s=this.contextGL;s.bindBuffer(s.ARRAY_BUFFER,this.vertexPosBuffer),s.bufferData(s.ARRAY_BUFFER,o,s.DYNAMIC_DRAW)}},Ur.prototype.updateTextureInfoForSharing=function(){const[e,t,r,a]=this.texturePos,i=this.webglTexturePos[0],n=this.webglTexturePos[3];if(e!=i||n!=a){this.webglTexturePos[0]=e,this.webglTexturePos[1]=t,this.webglTexturePos[2]=r,this.webglTexturePos[3]=a;var o=new Float32Array([r,t,e,t,r,a,e,a,1,0,0,0,1,1,0,1]),s=this.contextGL;s.bindBuffer(s.ARRAY_BUFFER,this.texturePosBuffer),s.bufferData(s.ARRAY_BUFFER,o,s.DYNAMIC_DRAW)}},Ur.prototype.updateVertexInfoForMultiView=function(e,t,r,a,i){var n,o,s,d,l=this.contextGL;if(this.isUseFillMode({width:r,height:a,rotation:i}))n=0,o=0,s=1,d=1;else{var c=i==this.ROTATION_CLOCK90||i==this.ROTATION_CLOCK270?a:r,u=i==this.ROTATION_CLOCK90||i==this.ROTATION_CLOCK270?r:a,h=c/u*t;h>e?(n=0,s=1,d=1-(o=(t-u/c*e)/2/t)):(o=0,d=1,s=1-(n=(e-h)/2/e))}n=2*n-1,s=2*s-1,o=1-2*o,d=1-2*d;var _=new Float32Array([s,o,n,o,s,d,n,d,1,1,-1,1,1,-1,-1,-1]);this.viewPostion=_,l.bindBuffer(l.ARRAY_BUFFER,this.vertexPosBuffer),l.bufferData(l.ARRAY_BUFFER,_,l.DYNAMIC_DRAW)},Ur.prototype.getViewPosition=function(){let e=[0,0,1,1];if(!this.viewPostion)return e;const t=this.viewPostion[0],r=this.viewPostion[1],a=this.viewPostion[2],i=this.viewPostion[5];return e[0]=(1-r)/2,e[1]=(1+a)/2,e[2]=(1-i)/2,e[3]=(1+t)/2,e},Ur.prototype.updateTextureInfoForMultiView=function(e,t,r,a,i,n,o){var s,d,l,c,u=this.contextGL;if(this.isUseFillMode({width:r.width,height:r.height,rotation:a})){const i=a==this.ROTATION_CLOCK90||a==this.ROTATION_CLOCK270?o/n:n/o,u=r.left||0,h=r.top||0;if(r.width/r.height>i){const a=r.height*i;s=h/t,d=(Math.round((r.width-a)/2)+u)/e,l=(h+r.height)/t,c=d+a/e}else{const a=r.width/i;l=(s=(Math.round((r.height-a)/2)+h)/t)+a/t,c=(d=u/e)+r.width/e}}else s=rr(r.top/t,2),d=rr(r.left/e,2),l=tr((r.top+r.height)/t,2),c=tr((r.width+r.left)/e,2);var h=[d,s,c,s,c,l,d,l];a==this.ROTATION_CLOCK90&&(h.unshift(h[6],h[7]),h=h.slice(0,8)),a==this.ROTATION_CLOCK180&&(h.unshift(h[4],h[5],h[6],h[7]),h=h.slice(0,8)),a==this.ROTATION_CLOCK270&&(h.push(h[0],h[1]),h=h.slice(2,10));var _=h[0],p=h[1];if(h[0]=h[2],h[1]=h[3],h[2]=_,h[3]=p,i)if(a==this.ROTATION_CLOCK90||a==this.ROTATION_CLOCK270){let e=h[1];h[1]=h[3],h[3]=e,e=h[5],h[5]=h[7],h[7]=e}else h[0]=1-h[0],h[2]=1-h[2],h[4]=1-h[4],h[6]=1-h[6];var f=new Float32Array([...h,1,0,0,0,1,1,0,1]);u.bindBuffer(u.ARRAY_BUFFER,this.texturePosBuffer),u.bufferData(u.ARRAY_BUFFER,f,u.DYNAMIC_DRAW)},Ur.prototype.drawNextOutputPictureFrame=function(e,t,r,a,i){let n=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],o=arguments.length>6?arguments[6]:void 0,s=!(arguments.length>7&&void 0!==arguments[7])||arguments[7];if(!this.isAvaiable())return;var d=this.contextGL,l=this.yTextureRef,c=this.uTextureRef,u=this.vTextureRef;d.enable(d.BLEND),d.blendFunc(d.SRC_ALPHA,d.ONE_MINUS_SRC_ALPHA),i=i||this.ROTATION_CLOCK0;var h=(r=r||{top:0,left:0,width:e,height:t}).width!=this.croppingParams.width||r.height!=this.croppingParams.height,_=(r.top!=this.croppingParams.top||(r.left,this.croppingParams.left),o.width!=this.viewWidth||o.height!=this.viewHeight),p=(e!=this.textureWidth||this.textureHeight,i!=this.picRotation);(h||_||p)&&function(e,t,r,a,i){let n=i.width,o=i.height;var s,d,l,c,u=a==e.ROTATION_CLOCK90||a==e.ROTATION_CLOCK270?r:t,h=a==e.ROTATION_CLOCK90||a==e.ROTATION_CLOCK270?t:r,_=u/h*o;_>n?(s=0,l=1,c=1-(d=(o-h/u*n)/2/o)):(d=0,c=1,l=1-(s=(n-_)/2/n)),s=parseFloat((2*s-1).toFixed(3)),l=parseFloat((2*l-1).toFixed(3)),d=parseFloat((1-2*d).toFixed(3)),c=parseFloat((1-2*c).toFixed(3)),e.vertexPos=[s,d,l,c]}(this,r.width,r.height,i,o),this.updataVertexInfoForSharing(),function(e,t,r,a,i){var n=a.top/r,o=a.left/t,s=(a.top+a.height)/r,d=(a.left+a.width)/t,l=[o,n,d,n,d,s,o,s];i==e.ROTATION_CLOCK90&&(l.unshift(l[6],l[7]),l=l.slice(0,8)),i==e.ROTATION_CLOCK180&&(l.unshift(l[4],l[5],l[6],l[7]),l=l.slice(0,8)),i==e.ROTATION_CLOCK270&&(l.push(l[0],l[1]),l=l.slice(2));var c=l[0],u=l[1];l[0]=l[2],l[1]=l[3],l[2]=c,l[3]=u;var h=new Float32Array([...l,1,0,0,0,1,1,0,1]),_=e.contextGL;_.bindBuffer(_.ARRAY_BUFFER,e.texturePosBuffer),_.bufferData(_.ARRAY_BUFFER,h,_.DYNAMIC_DRAW)}(this,e,t,r,i);let f=n?0:1;f!=this.colorRange&&(d.uniform1i(this.colorRangeRef,f),this.colorRange=f),d.viewport(o.x,o.y,o.width,o.height),this.viewport_rect||(this.viewport_rect=new Float32Array(4)),this.viewport_rect.set([o.x,o.y,o.width,o.height],0),d.uniform4fv(this.ul_viewport_rect,this.viewport_rect),d.uniform1i(this.onlyRGBARef,0),d.uniform1i(this.yuvmodeRef,1),Object.assign(this.croppingParams,r),this.textureWidth=e,this.textureHeight=t,this.picRotation=i,this.viewWidth=o.width,this.viewHeight=o.height;var m=a,g=e*t;if(d.activeTexture(d.TEXTURE0),d.bindTexture(d.TEXTURE_2D,l),s){var v=m.subarray(0,g);d.texImage2D(d.TEXTURE_2D,0,d.LUMINANCE,e,t,0,d.LUMINANCE,d.UNSIGNED_BYTE,v)}var y=e/2*t/2;if(d.activeTexture(d.TEXTURE1),d.bindTexture(d.TEXTURE_2D,c),s){var b=m.subarray(g,g+y);d.texImage2D(d.TEXTURE_2D,0,d.LUMINANCE,e/2,t/2,0,d.LUMINANCE,d.UNSIGNED_BYTE,b)}var w=y;if(d.activeTexture(d.TEXTURE2),d.bindTexture(d.TEXTURE_2D,u),s){var S=m.subarray(g+y,g+y+w);d.texImage2D(d.TEXTURE_2D,0,d.LUMINANCE,e/2,t/2,0,d.LUMINANCE,d.UNSIGNED_BYTE,S)}d.activeTexture(d.TEXTURE0+4),d.bindTexture(d.TEXTURE_2D,this.cursorTextureRef),this.hasCursor?d.uniform1i(this.cursorFlagRef,1):s&&d.texImage2D(d.TEXTURE_2D,0,d.RGBA,1,1,0,d.RGBA,d.UNSIGNED_BYTE,this.dummpyCursor),d.uniform4f(this.cursorInfoRef,this.cx,this.cy,this.cw,this.ch),this.render(),this.hasWholeFrame=1},Ur.prototype.updateCursor=function(e,t,r,a){if(this.isAvaiable()){var i=this.contextGL;e<=0||t<=0||!r||r.length!=e*t*4||a!=this.lastcursorSyncId&&(this.lastcursorSyncId=a,i.activeTexture(i.TEXTURE0+4),i.bindTexture(i.TEXTURE_2D,this.cursorTextureRef),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,e,t,0,i.RGBA,i.UNSIGNED_BYTE,r),this.cursorWidth=e,this.cursorHeight=t,this.hasCursor=1)}},Ur.prototype.updateCursorPosInfo=function(e,t,r,a,i){if(e&&this.hasCursor){let e=t/this.croppingParams.width,n=r/this.croppingParams.height,o=a/this.croppingParams.width,s=i/this.croppingParams.height;this.cx=e,this.cy=n,this.cw=o,this.ch=s}else this.cx=0,this.cy=0,this.cw=0,this.ch=0},Ur.prototype.isHasWholeFrame=function(){return this.hasWholeFrame},Ur.prototype.updateWatermark=function(e,t,r){if(this.isAvaiable()){var a=this.contextGL;e<=0||t<=0||!r||r.length!=e*t*4||(this.hasWaterMark=1,this.watermarkWidth=e,this.watermarkHeight=t,a.activeTexture(a.TEXTURE0+5),a.bindTexture(a.TEXTURE_2D,this.waterMarkTextureRef),a.texImage2D(a.TEXTURE_2D,0,a.RGBA,this.watermarkWidth,this.watermarkHeight,0,a.RGBA,a.UNSIGNED_BYTE,r))}},Ur.prototype.drawWatermark=function(){if(this.isAvaiable()){var e=this.contextGL;this.isSetWatermark()&&this.watermarkWidth&&this.watermarkHeight&&(e.uniform1i(this.waterMarkFlagRef,1),e.activeTexture(e.TEXTURE0+5),e.bindTexture(e.TEXTURE_2D,this.waterMarkTextureRef),e.enable(e.BLEND),e.blendFunc(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA),e.drawArrays(e.TRIANGLE_STRIP,4,4))}},Ur.prototype.drawRoundedCorner=function(){if(this.isAvaiable()){var e=this.contextGL;e.enable(e.BLEND),e.blendFunc(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA),e.uniform1f(this.ul_enable_rounded_corner,this.enable_rounded_corner),e.uniform1f(this.ul_radius_lt_x,this.radius_lt_x),e.uniform1f(this.ul_radius_lt_y,this.radius_lt_y),e.uniform1f(this.ul_radius_lb_x,this.radius_lb_x),e.uniform1f(this.ul_radius_lb_y,this.radius_lb_y),e.uniform1f(this.ul_radius_rt_x,this.radius_rt_x),e.uniform1f(this.ul_radius_rt_y,this.radius_rt_y),e.uniform1f(this.ul_radius_rb_x,this.radius_rb_x),e.uniform1f(this.ul_radius_rb_y,this.radius_rb_y),e.uniform1f(this.ul_aa_width,this.aa_width)}},Ur.prototype.cleanupRoundedCornerRadius=function(){this.enable_rounded_corner=0,this.radius_lt_x=0,this.radius_lt_y=0,this.radius_lb_x=0,this.radius_lb_y=0,this.radius_rt_x=0,this.radius_rt_y=0,this.radius_rb_x=0,this.radius_rb_y=0,this.aa_width=Ye,this.viewport_rect=null},Ur.prototype.render=function(){if(this.isAvaiable()){var e=this.contextGL;this.drawRoundedCorner(),e.uniform1i(this.waterMarkFlagRef,0),e.drawArrays(e.TRIANGLE_STRIP,0,4),this.drawWatermark()}},Ur.prototype.clear=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.hasCursor=0,this.watermarkHeight=0,this.watermarkWidth=0,this.watermarkRepeated=!1,this.hasWholeFrame=0,this.lastcursorSyncId=-1,this.cleanupRoundedCornerRadius(),e&&this.clearCanvas({R:0,G:0,B:0,A:0})},Ur.prototype.clearCanvas=function(e){if(this.cleanupRoundedCornerRadius(),this.isAvaiable()){var t=this.contextGL;e?t.clearColor(e.R,e.G,e.B,e.A):t.clearColor(this.bgColor[0],this.bgColor[1],this.bgColor[2],255),t.clear(t.COLOR_BUFFER_BIT)}},Ur.prototype.isRGBAMode=function(e){return-1!==[Pe,Ie].indexOf(e)},Ur.prototype.updateRemoteVideoTextures=function(e,t,r,a,i){let n=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],o=arguments.length>6?arguments[6]:void 0,s=!(arguments.length>8&&void 0!==arguments[8])||arguments[8];if(!this.isAvaiable())return;var d=this.contextGL,l=this.yTextureRef,c=this.uTextureRef,u=this.vTextureRef;d.enable(d.BLEND),d.blendFunc(d.SRC_ALPHA,d.ONE_MINUS_SRC_ALPHA);const h=this.isRGBAMode(this.videoMode);if(e<=0||t<=0||!a||!a.length||a.length!=e*t*3/2&&!h||r&&(r.top<0||r.left<0||r.left+r.width>e||r.top+r.height>t))return!1;let _=n?0:1;if(this.colorRange=_,this.rotation=i,Object.assign(this.croppingParams,r),this.textureWidth=e,this.textureHeight=t,this.viewWidth=o.width,this.viewHeight=o.height,!s)return;if(d.bindTexture(d.TEXTURE_2D,l),h)return void d.texImage2D(d.TEXTURE_2D,0,d.RGBA,e,t,0,d.RGBA,d.UNSIGNED_BYTE,a);var p=a,f=e*t,m=p.subarray(0,f);d.texImage2D(d.TEXTURE_2D,0,d.LUMINANCE,e,t,0,d.LUMINANCE,d.UNSIGNED_BYTE,m);let g=0,v=0;1==this.videoMode?(g=e/2*t/2,v=g):2==this.videoMode&&(g=e*t/2,v=0);var y=p.subarray(f,f+g);if(d.bindTexture(d.TEXTURE_2D,c),v){d.texImage2D(d.TEXTURE_2D,0,d.LUMINANCE,e/2,t/2,0,d.LUMINANCE,d.UNSIGNED_BYTE,y);var b=p.subarray(f+g,f+g+v);d.bindTexture(d.TEXTURE_2D,u),d.texImage2D(d.TEXTURE_2D,0,d.LUMINANCE,e/2,t/2,0,d.LUMINANCE,d.UNSIGNED_BYTE,b)}else d.texImage2D(d.TEXTURE_2D,0,d.LUMINANCE_ALPHA,e/2,t/2,0,d.LUMINANCE_ALPHA,d.UNSIGNED_BYTE,y);return!0},Ur.prototype.updateRemoteVideoTexturesImageBitmap=function(e,t,r,a,i){let n=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];if(e<=0||t<=0||!r)return;if(!this.isAvaiable())return;var o=this.contextGL;if(this.textureWidth=e,this.textureHeight=t,Number.isNaN(i)||(this.rotation=i),Object.assign(this.croppingParams,a),!n)return;o.bindTexture(o.TEXTURE_2D,this.yTextureRef);const s=o.RGBA,d=o.RGBA,l=o.UNSIGNED_BYTE;o.texImage2D(o.TEXTURE_2D,0,s,d,l,r)},Ur.prototype.updateSelfMaskImage=function(e,t,r){if(!(e<=0||t<=0)&&r&&r.length==e*t*4&&this.isAvaiable()){var a=this.contextGL;a.bindTexture(a.TEXTURE_2D,this.maskTextureRef),a.texImage2D(a.TEXTURE_2D,0,a.RGBA,e,t,0,a.RGBA,a.UNSIGNED_BYTE,r)}},Ur.prototype.VideoFlip=function(){if(this.isAvaiable()){var e=this.contextGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,1)}},Ur.prototype.drawRemoteVideo=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.isAvaiable())return;var r=this.contextGL;let a=this.isRGBAMode(this.videoMode)?1:0;r.uniform1i(this.colorRangeRef,this.colorRange),this.setUniformFlag(a,this.hasCursor,this.videoMode),this.initmask&&r.uniform1i(this.maskFlagRef,1),this.updateTextureInfoForMultiView(this.textureWidth,this.textureHeight,this.croppingParams,this.rotation,t,e.width,e.height),r.viewport(e.x,e.y,e.width,e.height),this.viewport_rect||(this.viewport_rect=new Float32Array(4)),this.viewport_rect.set([e.x,e.y,e.width,e.height],0),r.uniform4fv(this.ul_viewport_rect,this.viewport_rect),this.updateVertexInfoForMultiView(e.width,e.height,this.croppingParams.width,this.croppingParams.height,this.rotation),this.BindTextures(this.videoMode),r.enable(r.BLEND),r.blendFunc(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA),this.render()},Ur.prototype.readPixelsSyncRequest=function(e,t,r,a){if(this.isAvaiable()){var i,n=this.contextGL;return this.destination&&this.destination.length==r*a*4||(this.destination=new Uint8Array(r*a*4)),i=this.destination,n.flush(),n.readPixels(e,t,r,a,n.RGBA,n.UNSIGNED_BYTE,i),i}},Ur.prototype.updateSelfVideoTextures=function(e,t,r,a){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(!(e<=0||t<=0)&&r&&r.length%4==0&&this.isAvaiable()){var o=this.contextGL;this.textureWidth=e,this.textureHeight=t,this.rotation=n,Object.assign(this.croppingParams,a),i&&(o.bindTexture(o.TEXTURE_2D,this.yTextureRef),o.texImage2D(o.TEXTURE_2D,0,o.RGBA,e,t,0,o.RGBA,o.UNSIGNED_BYTE,r))}},Ur.prototype.drawSelfVideo=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.isAvaiable()){var a=this.contextGL;this.setUniformFlag(1,this.hasCursor,this.videoMode),this.updateTextureInfoForMultiView(this.textureWidth,this.textureHeight,this.croppingParams,this.rotation,r,e.width,e.height),a.viewport(e.x,e.y,e.width,e.height),this.viewport_rect||(this.viewport_rect=new Float32Array(4)),this.viewport_rect.set([e.x,e.y,e.width,e.height],0),a.uniform4fv(this.ul_viewport_rect,this.viewport_rect),t?(a.enable(a.BLEND),a.blendFunc(a.ZERO,a.ZERO),this.updateVertexInfoForMultiView(e.width,e.height,e.width,e.height,this.ROTATION_CLOCK0)):(a.enable(a.BLEND),a.blendFunc(a.SRC_ALPHA,a.ONE_MINUS_SRC_ALPHA),this.updateVertexInfoForMultiView(e.width,e.height,this.croppingParams.width,this.croppingParams.height,this.rotation)),this.BindTextures(Pe),this.render()}},Ur.prototype.isSetWatermark=function(){return this.hasWaterMark},Ur.prototype.setWatermarkFlag=function(e){this.hasWaterMark=e,e||(this.setWatermarkRepeated(!1),this.setWatermarkOpacity(),this.setWatermarkPosition(16))},Ur.prototype.setUniformFlag=function(e,t,r){if(this.isAvaiable()){var a=this.contextGL;a.uniform1i(this.onlyRGBARef,e),a.uniform1i(this.bgraModeRef,e&&r===Ie?1:0),a.uniform1i(this.cursorFlagRef,t),e||a.uniform1i(this.yuvmodeRef,r)}},Ur.prototype.setVideoMode=function(e){this.videoMode=e},Ur.prototype.getVideoMode=function(e){return this.videoMode},Ur.prototype.setWatermarkRepeated=function(e){this.watermarkRepeated=e},Ur.prototype.isWatermarkRepeated=function(){return!!this.watermarkRepeated},Ur.prototype.setWatermarkOpacity=function(e){this.watermarkOpacity=e||.15},Ur.prototype.getWatermarkOpacity=function(){return this.watermarkOpacity},Ur.prototype.setWatermarkPosition=function(e){this.watermarkPosition=e||16},Ur.prototype.getWatermarkPosition=function(){return this.watermarkPosition},Ur.prototype.setMultiView=function(e){return this.isMultiView=e},Ur.prototype.getRepeatedWatermarkUniformValue=function(){return this.isMultiView?30:7},Ur.prototype.getRepeatedWatermarkTextureValue=function(e){return this.isMultiView?e.TEXTURE30:e.TEXTURE7},Ur.prototype.setFillMode=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.fillMode=e,this.fillModeForResolution=t},Ur.prototype.getFillMode=function(){return this.fillMode},Ur.prototype.getFillModeForResolution=function(){return this.fillModeForResolution},Ur.prototype.getTextureIndex=function(){return this.textureindex},Ur.prototype.getTextureWidth=function(){return this.textureWidth},Ur.prototype.getTextureHeight=function(){return this.textureHeight},Ur.prototype.getRotation=function(){return this.rotation},Ur.prototype.getCroppingParams=function(){return this.croppingParams},Ur.prototype.getIndex=function(){return this.textureindex},Ur.prototype.getWatermarkWidth=function(){return this.watermarkWidth},Ur.prototype.getWatermarkHeight=function(){return this.watermarkHeight},Ur.prototype.getWatermarkOpacity=function(){return this.watermarkOpacity},Ur.prototype.getAttachedCanvas=function(){return this.canvasElement},Ur.prototype.getCanvasId=function(){return this.canvasID},Ur.prototype.resizeCanvasTo=function(e,t){this.contextGL.canvas.width=e,this.contextGL.canvas.height=t},Ur.prototype.isUseFillMode=function(e){let{width:t,height:r,rotation:a}=e;if(!this.fillMode)return!1;if(!this.fillModeForResolution)return!0;if(!t||!r)return!1;const i=a===this.ROTATION_CLOCK90||a==this.ROTATION_CLOCK270?r/t:t/r;return(Array.isArray(this.fillModeForResolution)?this.fillModeForResolution:[this.fillModeForResolution]).some((e=>Math.abs(i-e)<.01))},Ur.prototype.setRoundedCornerRadius=function(e){e?(this.radius_lt_x=e.radius_lt_x,this.radius_lt_y=e.radius_lt_y,this.radius_lb_x=e.radius_lb_x,this.radius_lb_y=e.radius_lb_y,this.radius_rt_x=e.radius_rt_x,this.radius_rt_y=e.radius_rt_y,this.radius_rb_x=e.radius_rb_x,this.radius_rb_y=e.radius_rb_y,0===this.radius_lt_x&&0===this.radius_lt_y&&0===this.radius_lb_x&&0===this.radius_lb_y&&0===this.radius_rt_x&&0===this.radius_rt_y&&0===this.radius_rb_x&&0===this.radius_rb_y?this.enable_rounded_corner=0:this.enable_rounded_corner=1):this.enable_rounded_corner=0},Ur.prototype.setAntialiasWidth=function(e){(e<=0||e>=1)&&(e=Ye),this.aa_width=e};const Br=Ur;class Vr{getVideoRenderDisplay(e,t,r,a,i){throw new Error("getVideoRenderDisplay() should be implemented by subclass.")}getRenderDisplay(e,t,r){throw new Error("getRenderDisplay() should be implemented by subclass.")}createVideoRenderDisplay(e,t,r){throw new Error("createVideoRenderDisplay() should be implemented by subclass.")}}function Gr(e,t,r){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function Hr(e,t){return e.get(zr(e,t))}function jr(e,t,r){return e.set(zr(e,t),r),r}function zr(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var $r=new WeakMap,qr=new WeakMap;class Yr extends Vr{constructor(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];super(),Gr(this,$r,new Map),Gr(this,qr,!1),jr(qr,this,e)}setCanvasAlphaChannelEnability(e){jr(qr,this,e)}createVideoRenderDisplay(e,t,r){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i=null,n=null,o=null,s=!1;return a&&(i=a.forceNoGL,n=a.contextOptions,o=a.webGLResources,s=a.initMask),new Br(e,t,r,i,n,o,s,Hr(qr,this))}getVideoRenderDisplay(e,t,r,a){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,n=Hr($r,this).get(e);if(!n){let a=[];n=[a,[]],Hr($r,this).set(e,n);let o=new Br(e,t,0,void 0,void 0,void 0,void 0,Hr(qr,this));o.setMultiView(!0),i&&i.set(e,o);let s=1;for(;s<=r;s++){const r=new Br(e,t,s,void 0,void 0,{program:o.shaderProgram,contextgl:o.contextGL,vBuffer:o.vertexPosBuffer,tBuffer:o.texturePosBuffer,waterMarkTextureRef:o.waterMarkTextureRef,repeatedWaterMarkTextureRef:o.repeatedWaterMarkTextureRef},void 0,Hr(qr,this));r.setMultiView(!0),a.push(r)}}let o,s=Hr($r,this).get(e),d=s[0],l=s[1];if(s&&d[0]&&(o=d.pop(),l.push(o)),!o){const e=s?"".concat(s.length):"undefined",t=d?"".concat(d.length):"undefined";a("No Display obtained from VideoRender.Get_Display. canvasRenderArray:".concat(e," unusedRenderArray:").concat(t))}return o}onWebglContextLostForMulti(e,t){const{canvas:r}=t;let a=Hr($r,this).get(r);var[i,n,o]=a;[...i,...n].forEach((e=>e.clear()))}onRestoredFromLostForMulti(e,t){if(!t)return;const{canvas:r}=t;let a=Hr($r,this).get(r);var[i,n,o]=a;const s=[...i,...n];let d=s.find((e=>e.isLocalDisplay()));d.webglVertexPos=[0,0,0,0],d.webglTexturePos=[0,0,0,0],o.args={program:d.shaderProgram,contextgl:d.contextGL,vBuffer:d.vertexPosBuffer,tBuffer:d.texturePosBuffer,webglVertexPos:d.webglVertexPos,webglTexturePos:d.webglTexturePos},s.forEach((e=>{e!=d&&e.reinit(o.args)}))}getRenderDisplay(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=Hr($r,this).get(e);if(!a){let i=[],n={canvasId:t,size:1,args:{}};a=[i,[],n],Hr($r,this).set(e,a);const o={webglcontextlostCallback:this.onWebglContextLostForMulti.bind(this),webglcontextrestoredCallback:this.onRestoredFromLostForMulti.bind(this),params:{canvas:e,rendercanvasID:t}};let s=new Br(e,t,0,void 0,o,void 0,void 0,Hr(qr,this));r&&r.set(e,s),i.push(s),n.args={program:s.shaderProgram,contextgl:s.contextGL,vBuffer:s.vertexPosBuffer,tBuffer:s.texturePosBuffer,webglVertexPos:s.webglVertexPos,webglTexturePos:s.webglTexturePos}}if(!a[0].length){const r=new Br(e,t,a[2].size,void 0,void 0,a[2].args,void 0,Hr(qr,this));a[2].size++,a[0].push(r)}let i=a[0].pop();return a[1].push(i),i}recycleRenderDisplay(e,t,r){t.setWatermarkFlag(0),t.setVideoMode(Fe),t.clear(r);let a=Hr($r,this).get(e);if(a){let e=a[0],r=a[1];r&&r.some((function(e,a){if(e===t)return r.splice(a,1),!0})),e.push(t)}}onRestoredFromContextLost(e,t,r,a,i){let n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,o=Hr($r,this).get(r);(!o||o.length<2)&&i("canvasRenderArray:".concat(o,", length:").concat(null==o?void 0:o.length));let s=n.get(t);if(s){s.reinit();for(let e=0;e<(null==o?void 0:o.length);e++)o[e].forEach((e=>{null==e||e.reinit({program:s.shaderProgram,contextgl:s.contextGL,vBuffer:s.vertexPosBuffer,tBuffer:s.texturePosBuffer,waterMarkTextureRef:s.waterMarkTextureRef,repeatedWaterMarkTextureRef:s.repeatedWaterMarkTextureRef})}));return r!==t&&(Hr($r,this).delete(r),Hr($r,this).set(t,o),n&&(n.delete(r),n.set(t,s))),null}}getRenderDisplayMap(){return Hr($r,this)}cleanup(e,t){var r;null==t||null===(r=t.cleanup)||void 0===r||r.call(t,null);for(const[e,t]of Hr($r,this)){const e=t[0],r=t[1];for(const t of e)t.cleanup();for(const e of r)e.cleanup()}jr($r,this,new Map)}cleanupByCanvas(e){if(Hr($r,this).get(e)){let t=Hr($r,this).get(e);if(t){let r=t[0],a=t[1];a.forEach((function(e){var t;null==e||null===(t=e.cleanup)||void 0===t||t.call(e)})),r.forEach((function(e){var t;null==e||null===(t=e.cleanup)||void 0===t||t.call(e)})),r=[],a=[],Hr($r,this).delete(e)}}else{var t,r;null===(t=e.display)||void 0===t||null===(r=t.cleanup)||void 0===r||r.call(t)}}}function Qr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function Kr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Qr(Object(r),!0).forEach((function(t){d(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}let Xr=new Map,Zr=[];function Jr(e){e.preventDefault()}function ea(e,t,r,a,i,n,o){let s=arguments.length>7&&void 0!==arguments[7]&&arguments[7];this.canvasElement=e,this.canvasID=t,this.contextOptions=i,this.textureindex=r||0,this.initmask=!!o,this.isEnableCanvasAlphaChannel=s,ea.prototype.ROTATION_CLOCK0=0,ea.prototype.ROTATION_CLOCK90=1,ea.prototype.ROTATION_CLOCK180=2,ea.prototype.ROTATION_CLOCK270=3,this.webGLResources=n,n||(this.initContextGL(),this.contextGL&&(this.webGLContextLostProtect(),this.contextGL.isContextLost()&&this.restoreContext())),this.webglVertexPos=[0,0,0,0],this.webglTexturePos=[0,0,0,0],this.vertexPos=[0,0,0,0],this.texturePos=[0,0,0,0],this.reinit(n);var d=new ArrayBuffer(4);this.dummpyCursor=new Uint8Array(d),this.dummpyWaterMark=new Uint8Array(d),this.cursorWidth=0,this.cursorHeight=0,this.hasCursor=0,this.lastcursorSyncId=-1,this.hasWaterMark=0,this.watermarkOpacity=.15,this.watermarkData=null,this.watermarkWidth=0,this.watermarkHeight=0,this.isMultiView=!1,this.hasWholeFrame=0,this.croppingParams={},this.croppingParams.top=0,this.croppingParams.left=0,this.croppingParams.width=0,this.croppingParams.height=0,this.textureWidth=0,this.textureHeight=0,this.viewWidth=0,this.viewHeight=0,this.picRotation=-1,this.bgColor=[0,0,0],this.cx=0,this.cy=0,this.cw=0,this.ch=0,this.colorRange=-1,this.videoMode=Fe,this.rotation=this.ROTATION_CLOCK0,this.fillMode=0,this.fillModeForResolution=0,this.viewPostion=null,this.enable_rounded_corner=0,this.radius_lt_x=0,this.radius_lt_y=0,this.radius_lb_x=0,this.radius_lb_y=0,this.radius_rt_x=0,this.radius_rt_y=0,this.radius_rb_x=0,this.radius_rb_y=0,this.aa_width=Ye,this.uv_rect=null}ea.prototype.isLocalDisplay=function(){return 0==this.textureindex},ea.prototype.reinit=function(e){if(this.webGLResources=e,!this.contextGL||this.contextGL.isContextLost()||this.contextGL.glInitSucceed||this.webGLResources){if(this.webGLResources&&this.webGLResources.contextgl&&!this.webGLResources.contextgl.isContextLost()){this.contextGL=this.webGLResources.contextgl,this.shaderProgram=this.webGLResources.program,this.vertexPosBuffer=this.webGLResources.vBuffer,this.texturePosBuffer=this.webGLResources.tBuffer,this.webglTexturePos=this.webGLResources.webglTexturePos,this.webglVertexPos=this.webGLResources.webglVertexPos,this.initTextures(!1);let e=this.contextGL.getError();this.contextGL.glInitSucceed=e!=this.contextGL.NO_ERROR&&e!=this.contextGL.CONTEXT_LOST_WEBGL?0:1}}else{this.initProgram(),this.initmask?this.initTextures(!1):this.initTextures(!0),this.initBuffers();let e=this.contextGL.getError();this.contextGL.glInitSucceed=e!=this.contextGL.NO_ERROR&&e!=this.contextGL.CONTEXT_LOST_WEBGL?0:1}},ea.prototype.webGLContextLostSimulate=function(){let e="undefined"==typeof window?self:window;e.webGLEXTSimulate=e.webGLEXTSimulate||[],e.webGLEXTSimulate.push(ce(this.contextGL,"WEBGL_lose_context"))},ea.prototype.restoreContext=function(){if(this.contextGL)try{var e;null!==(e=this.canvasElement)&&void 0!==e&&e.loseContextExtension&&!this.canvasElement.restoreTimeoutId&&this.contextGL.isContextLost()&&(this.canvasElement.restoreTimeoutId=setTimeout((()=>{this.canvasElement.reportcontextloss||(this.canvasElement.reportcontextloss=!0,ae("WebGL2RestoreTimeout")),this.canvasElement.restoreTimeoutId=0}),1500),this.canvasElement.loseContextExtension.restoreContext())}catch(e){ee("webgl restoreContext exception2",e)}},ea.prototype.webgGLContextLostCallback=function(e){re("webglcontextlost2 event: canvas listener size=".concat(Zr.length,", canvas id: ").concat(this.canvasID,", , ids:").concat(Zr.join())),e.preventDefault(),this.contextGL.glInitSucceed=0,this.contextOptions&&this.contextOptions.webglcontextlostCallback&&this.contextOptions.webglcontextlostCallback(e,this.contextOptions.params)},ea.prototype.removeEventListener=function(e,t){if(e&&t){e.restoreTimeoutId&&(clearTimeout(e.restoreTimeoutId),e.restoreTimeoutId=void 0),e.removeEventListener("webglcontextlost",t.contextLostHandler),e.removeEventListener("webglcontextrestored",t.contextRestoredHandler);const r=Zr.indexOf(this.canvasID);Zr.splice(r,1),Xr.delete(e)}},ea.prototype.webGLContextRestoredCallback=function(e){var t,r;re("webglcontextrestored2 event from canvas id: ".concat(this.canvasID)),this.canvasElement.restoreTimeoutId&&(clearTimeout(this.canvasElement.restoreTimeoutId),this.canvasElement.restoreTimeoutId=void 0),this.webglVertexPos=[0,0,0,0],this.webglTexturePos=[0,0,0,0],this.reinit(),null===(t=this.contextOptions)||void 0===t||null===(r=t.webglcontextrestoredCallback)||void 0===r||r.call(t,e,this.contextOptions.params)},ea.prototype.webGLContextLostProtect=function(){this.canvasElement&&!this.canvasElement.loseContextExtension&&(this.canvasElement.loseContextExtension=ce(this.contextGL,"WEBGL_lose_context"));let e=this.canvasElement,t=Xr.get(e);t&&this.removeEventListener(e,t),Xr.set(e,this),this.contextLostHandler=this.webgGLContextLostCallback.bind(this),this.contextRestoredHandler=this.webGLContextRestoredCallback.bind(this),e.addEventListener("webglcontextlost",this.contextLostHandler,{capture:!1}),e.addEventListener("webglcontextrestored",this.contextRestoredHandler,{capture:!1}),-1===Zr.indexOf(this.canvasID)&&(Zr.push(this.canvasID),Zr.length>4&&re("webgl2canvas listener size=".concat(Zr.length,", ids:").concat(Zr.join())))},ea.prototype.isWebGL2=function(){return this.contextGL},ea.prototype.isAvaiable=function(){return this.contextGL&&!this.contextGL.isContextLost()&&this.contextGL.glInitSucceed},ea.prototype.initContextGL=function(){for(var e,t,r,a=this.canvasElement,i=null,n=["webgl2"],o=0;!i&&o<n.length;){var s=n[o];try{if(Zt().config.isEnableCanvasCtxOptionsOpt()){let e={depth:!1,stencil:!1,antialias:!1,alpha:this.isEnableCanvasAlphaChannel};if(this.contextOptions){let t=Kr(Kr({},this.contextOptions),e);i=a.getContext(s,t)}else i=a.getContext(s,e)}else i=this.contextOptions?a.getContext(s,this.contextOptions):a.getContext(s)}catch(e){i=null}i&&"function"==typeof i.getParameter||(i=null),++o}if(this.contextGL=i,!i||i.isContextLost())return ee("Failed when trying to get WebGLContext2 on canvas(".concat(null===(e=this.canvasElement)||void 0===e?void 0:e.width,",").concat(null===(t=this.canvasElement)||void 0===t?void 0:t.height,"), gl=").concat(i,", lost=").concat(null===(r=i)||void 0===r?void 0:r.isContextLost())),void ae("initWebGL2Fail");i.glInitSucceed=0},ea.prototype.initProgram=function(){var e=this.contextGL,t=e.createShader(e.VERTEX_SHADER);e.shaderSource(t,"#version 300 es\n in vec4 vertexPos;\n in vec4 texturePos;\n in vec4 masktexturePos;\n out vec2 textureCoord;\n out vec2 masktextureCoord;\n\n void main() {\n gl_Position = vertexPos;\n textureCoord = texturePos.xy;\n masktextureCoord = masktexturePos.xy;\n }\n "),e.compileShader(t),e.getShaderParameter(t,e.COMPILE_STATUS)||e.isContextLost()||re("webgl2 Vertex shader failed to compile: "+e.getShaderInfoLog(t));var r=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(r,"#version 300 es\n precision highp float;\n\n in highp vec2 textureCoord;\n in highp vec2 masktextureCoord;\n uniform sampler2D ySampler;\n uniform sampler2D uSampler;\n uniform sampler2D vSampler;\n uniform sampler2D cursorSampler;\n uniform sampler2D waterMarkSampler;\n uniform sampler2D previewVideoSampler;\n uniform sampler2D maskSampler;\n uniform vec4 cursorInfo;\n uniform int onlyRGBA;\n uniform int bgraMode;\n uniform int colorRange;\n uniform int waterMarkFlag;\n uniform int cursorFlag;\n uniform int maskFlag;\n uniform int yuvmode;\n\n // rounded corner feature in gl shader\n uniform float u_enable_rounded_corner;\n uniform float u_radius_lt_x;\n uniform float u_radius_lt_y;\n uniform float u_radius_lb_x;\n uniform float u_radius_lb_y;\n uniform float u_radius_rt_x;\n uniform float u_radius_rt_y;\n uniform float u_radius_rb_x;\n uniform float u_radius_rb_y;\n uniform float u_aa_width;\n uniform vec4 u_viewport_rect;\n\n const mat4 YUV2RGB_L = mat4(\n 1.1643828125, 0, 1.59602734375, -.87078515625,\n 1.1643828125, -.39176171875, -.81296875, .52959375,\n 1.1643828125, 2.017234375, 0, -1.081390625,\n 0, 0, 0, 1\n );\n\n const mat4 YUV2RGB_F = mat4(\n 1.0, 0, 1.402, -.701,\n 1.0, -.34413, -.71414, .529135,\n 1.0, 1.772, 0, -.886,\n 0, 0, 0, 1\n );\n\n out vec4 outputColor;\n\n void main(void) {\n vec4 c;\n if (waterMarkFlag != 1) {\n if (onlyRGBA == 0) {\n highp float y = texture(ySampler, textureCoord).r;\n highp float u;\n highp float v;\n if (yuvmode == 1) {\n u = texture(uSampler, textureCoord).r;\n v = texture(vSampler, textureCoord).r;\n } else {\n u = texture(uSampler, textureCoord).r;\n v = texture(uSampler, textureCoord).a;\n }\n\n if (colorRange == 0) {\n c = vec4(y, u, v, 1) * YUV2RGB_L;\n } else {\n c = vec4(y, u, v, 1) * YUV2RGB_F;\n }\n\n if (cursorFlag == 1) {\n if (cursorInfo.z > 0.0 && textureCoord.x >= cursorInfo.x && textureCoord.y >= cursorInfo.y &&\n textureCoord.x < cursorInfo.x+cursorInfo.z && textureCoord.y < cursorInfo.y+cursorInfo.w) {\n vec2 cursorCoord = textureCoord - cursorInfo.xy;\n cursorCoord /= cursorInfo.zw;\n vec4 cursor = texture(cursorSampler, cursorCoord);\n c = c*(1.0-cursor.a) + cursor*cursor.a;\n }\n }\n } else {\n c = texture(previewVideoSampler, textureCoord);\n if (bgraMode == 1) {\n c = vec4(c.b, c.g, c.r, c.a);\n }\n }\n }\n\n if (waterMarkFlag == 1) {\n c = texture(waterMarkSampler, textureCoord);\n if (c.r == 0.0 && c.g == 0.0 && c.b == 0.0) {\n c.a = 0.0;\n }\n }\n\n if (maskFlag == 1 && waterMarkFlag != 1) {\n vec4 mask = texture(maskSampler, masktextureCoord);\n if (mask.r != 0.0 || mask.g != 0.0 || mask.b != 0.0) {\n c = mask * mask.a + c * (1.0 - mask.a);\n }\n }\n\n if (waterMarkFlag != 1) {\n c.a = 1.0;\n }\n\n if (u_enable_rounded_corner < 0.5) {\n outputColor = c;\n return;\n }\n\n // step 1: viewport coordinate mapping\n // convert the fragment coordinate(canvas coordinate) to the viewport coordinate\n // for example, a viewport={x: 100, y: 100, w: 200, h: 160}, a fragCoord.xy={x:120, y: 120}\n // we can get the pos={x: 20, y: 20}\n vec2 pos = gl_FragCoord.xy - u_viewport_rect.xy;\n vec2 viewportSize = u_viewport_rect.zw;\n\n // convert the normalized radius to pixel value\n float r_lt_x = u_radius_lt_x * viewportSize.x;\n float r_lt_y = u_radius_lt_y * viewportSize.y;\n float r_rt_x = u_radius_rt_x * viewportSize.x;\n float r_rt_y = u_radius_rt_y * viewportSize.y;\n float r_lb_x = u_radius_lb_x * viewportSize.x;\n float r_lb_y = u_radius_lb_y * viewportSize.y;\n float r_rb_x = u_radius_rb_x * viewportSize.x;\n float r_rb_y = u_radius_rb_y * viewportSize.y;\n\n // step 2: calculate the rounded corner mask (as alpha)\n float alpha = 1.0;\n\n // --- calculation of the left-top corner ---\n // Condition: if (pos.x < r_lt_x && pos.y < r_lt_y)\n float in_lt = (1.0 - step(r_lt_x, pos.x)) * (1.0 - step(r_lt_y, pos.y));\n // the circle center of the left-top corner in pixel coordinate\n vec2 center_lt = vec2(r_lt_x, r_lt_y);\n // calculate and normalize the distance between the fragment and the center\n vec2 diff_lt = (pos - center_lt) / vec2(r_lt_x, r_lt_y);\n float normDist_lt = length(diff_lt);\n // smoothstep function is used to calculate the alpha value\n float mask_lt = 1.0 - smoothstep(1.0 - u_aa_width, 1.0, normDist_lt);\n float final_lt = mix(1.0, mask_lt, in_lt);\n\n // --- calculation of the right-top corner ---\n float in_rt = (1.0 - step(r_rt_x, viewportSize.x - pos.x)) * (1.0 - step(r_rt_y, pos.y));\n vec2 center_rt = vec2(viewportSize.x - r_rt_x, r_rt_y);\n vec2 diff_rt = (pos - center_rt) / vec2(r_rt_x, r_rt_y);\n float normDist_rt = length(diff_rt);\n float mask_rt = 1.0 - smoothstep(1.0 - u_aa_width, 1.0, normDist_rt);\n float final_rt = mix(1.0, mask_rt, in_rt);\n\n // --- calculation of the left-bottom corner ---\n float in_lb = (1.0 - step(r_lb_x, pos.x)) * (1.0 - step(r_lb_y, viewportSize.y - pos.y));\n vec2 center_lb = vec2(r_lb_x, viewportSize.y - r_lb_y);\n vec2 diff_lb = (pos - center_lb) / vec2(r_lb_x, r_lb_y);\n float normDist_lb = length(diff_lb);\n float mask_lb = 1.0 - smoothstep(1.0 - u_aa_width, 1.0, normDist_lb);\n float final_lb = mix(1.0, mask_lb, in_lb);\n\n // --- calculation of the right-bottom corner ---\n float in_rb = (1.0 - step(r_rb_x, viewportSize.x - pos.x)) * (1.0 - step(r_rb_y, viewportSize.y - pos.y));\n vec2 center_rb = vec2(viewportSize.x - r_rb_x, viewportSize.y - r_rb_y);\n vec2 diff_rb = (pos - center_rb) / vec2(r_rb_x, r_rb_y);\n float normDist_rb = length(diff_rb);\n float mask_rb = 1.0 - smoothstep(1.0 - u_aa_width, 1.0, normDist_rb);\n float final_rb = mix(1.0, mask_rb, in_rb);\n\n // step 3: Get the minimum value from the four corners (to ensure that if any corner requires transparency it is applied)\n float finalAlpha = min(min(final_lt, final_rt), min(final_lb, final_rb));\n\n // step 4: Final output color\n outputColor = vec4(c.rgb, c.a * finalAlpha);\n }\n "),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS)||e.isContextLost()||re("webgl2 Fragment shader failed to compile: "+e.getShaderInfoLog(r));var a=e.createProgram();e.attachShader(a,t),e.attachShader(a,r),e.linkProgram(a),e.getProgramParameter(a,e.LINK_STATUS)||e.isContextLost()||re("webgl2 Program failed to compile: "+e.getProgramInfoLog(a)),e.useProgram(a),this.shaderProgram=a},ea.prototype.initBuffers=function(){var e=this.contextGL,t=this.shaderProgram,r=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,r),e.bufferData(e.ARRAY_BUFFER,new Float32Array([1,1,-1,1,1,-1,-1,-1,1,1,-1,1,1,-1,-1,-1]),e.STATIC_DRAW);var a=e.getAttribLocation(t,"vertexPos");e.enableVertexAttribArray(a),e.vertexAttribPointer(a,2,e.FLOAT,!1,0,0),this.vertexPosBuffer=r;var i=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,i),e.bufferData(e.ARRAY_BUFFER,new Float32Array([1,0,0,0,1,1,0,1,1,0,0,0,1,1,0,1]),e.STATIC_DRAW);var n=e.getAttribLocation(t,"texturePos");if(e.enableVertexAttribArray(n),e.vertexAttribPointer(n,2,e.FLOAT,!1,0,0),this.initmask&&!this.masktexturePosBuffer){var o=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,o),e.bufferData(e.ARRAY_BUFFER,new Float32Array([1,0,0,0,1,1,0,1]),e.STATIC_DRAW);var s=e.getAttribLocation(t,"masktexturePos");e.enableVertexAttribArray(s),e.vertexAttribPointer(s,2,e.FLOAT,!1,0,0),this.masktexturePosBuffer=o}this.texturePosBuffer=i},ea.prototype.initTextures=function(e){var t=this.contextGL,r=this.shaderProgram;t.pixelStorei(t.UNPACK_ALIGNMENT,1);var a=this.initTexture();this.yTextureRef=a,this.oyTextureRef=a;var i=this.initTexture();this.uTextureRef=i,this.ouTextureRef=i;var n=this.initTexture();this.vTextureRef=n,this.ovTextureRef=n,e&&this.BindTextures(1),this.waterMarkTextureRef=this.initTexture();var o=t.getUniformLocation(r,"waterMarkSampler");t.uniform1i(o,5),this.waterMarkSamplerRef=o;var s=this.initTexture(),d=t.getUniformLocation(r,"cursorSampler");if(t.uniform1i(d,4),this.cursorTextureRef=s,this.cursorSamplerRef=d,this.cursorInfoRef=t.getUniformLocation(r,"cursorInfo"),this.initmask){t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,1);var l=this.initTexture(),c=t.getUniformLocation(r,"maskSampler");t.uniform1i(c,4),this.maskTextureRef=l}this.colorRangeRef=t.getUniformLocation(r,"colorRange"),this.onlyRGBARef=t.getUniformLocation(r,"onlyRGBA"),this.bgraModeRef=t.getUniformLocation(r,"bgraMode"),this.waterMarkFlagRef=t.getUniformLocation(r,"waterMarkFlag"),this.maskFlagRef=t.getUniformLocation(r,"maskFlag"),this.cursorFlagRef=t.getUniformLocation(r,"cursorFlag"),this.yuvmodeRef=t.getUniformLocation(r,"yuvmode"),this.ul_enable_rounded_corner=t.getUniformLocation(r,"u_enable_rounded_corner"),this.ul_radius_lt_x=t.getUniformLocation(r,"u_radius_lt_x"),this.ul_radius_lt_y=t.getUniformLocation(r,"u_radius_lt_y"),this.ul_radius_lb_x=t.getUniformLocation(r,"u_radius_lb_x"),this.ul_radius_lb_y=t.getUniformLocation(r,"u_radius_lb_y"),this.ul_radius_rt_x=t.getUniformLocation(r,"u_radius_rt_x"),this.ul_radius_rt_y=t.getUniformLocation(r,"u_radius_rt_y"),this.ul_radius_rb_x=t.getUniformLocation(r,"u_radius_rb_x"),this.ul_radius_rb_y=t.getUniformLocation(r,"u_radius_rb_y"),this.ul_aa_width=t.getUniformLocation(r,"u_aa_width"),this.ul_viewport_rect=t.getUniformLocation(r,"u_viewport_rect")},ea.prototype.BindTextures=function(e){var t=this.contextGL,r=this.shaderProgram;if(t.pixelStorei(t.UNPACK_ALIGNMENT,1),t.activeTexture(t.TEXTURE0+0),t.bindTexture(t.TEXTURE_2D,this.yTextureRef),t.activeTexture(t.TEXTURE0+1),t.bindTexture(t.TEXTURE_2D,this.uTextureRef),t.activeTexture(t.TEXTURE0+2),t.bindTexture(t.TEXTURE_2D,this.vTextureRef),1==e){let e=t.getUniformLocation(r,"ySampler");t.uniform1i(e,0);let a=t.getUniformLocation(r,"uSampler");t.uniform1i(a,1);let i=t.getUniformLocation(r,"vSampler");t.uniform1i(i,2)}else if(this.isRGBAMode(e)){let e=t.getUniformLocation(r,"previewVideoSampler");t.uniform1i(e,0);let a=t.getUniformLocation(r,"ySampler");t.uniform1i(a,0);let i=t.getUniformLocation(r,"uSampler");t.uniform1i(i,0);let n=t.getUniformLocation(r,"vSampler");t.uniform1i(n,0)}else if(2==e){let e=t.getUniformLocation(r,"ySampler");t.uniform1i(e,0);let a=t.getUniformLocation(r,"uSampler");t.uniform1i(a,1);let i=t.getUniformLocation(r,"vSampler");t.uniform1i(i,0)}let a=t.getUniformLocation(r,"previewVideoSampler");t.uniform1i(a,0);let i=t.getUniformLocation(r,"maskSampler");this.initmask?(t.activeTexture(t.TEXTURE0+4),t.bindTexture(t.TEXTURE_2D,this.maskTextureRef),t.uniform1i(i,4)):t.uniform1i(i,0);let n=t.getUniformLocation(r,"cursorSampler");t.uniform1i(n,0);let o=t.getUniformLocation(this.shaderProgram,"waterMarkSampler");t.uniform1i(o,5)},ea.prototype.initTexture=function(){var e=this.contextGL,t=e.createTexture();return e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.bindTexture(e.TEXTURE_2D,null),t},ea.prototype.clearDisplay=function(){var e=this.contextGL;e&&(e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT))},ea.prototype.cleanup=function(){let e=this.canvasElement,t=Xr.get(e);if(t&&this.removeEventListener(e,t),e.defaultContextLostHandler||(e.defaultContextLostHandler=Jr,e.addEventListener("webglcontextlost",Jr,{capture:!1})),this.cleanupRoundedCornerRadius(),this.isAvaiable()){var r=this.contextGL;r.deleteProgram(this.program),r.activeTexture(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,null),r.activeTexture(r.TEXTURE1),r.bindTexture(r.TEXTURE_2D,null),r.activeTexture(r.TEXTURE2),r.bindTexture(r.TEXTURE_2D,null),r.activeTexture(r.TEXTURE3),r.bindTexture(r.TEXTURE_2D,null),r.activeTexture(r.TEXTURE4),r.bindTexture(r.TEXTURE_2D,null),r.activeTexture(r.TEXTURE5),r.bindTexture(r.TEXTURE_2D,null),r.deleteTexture(this.yTextureRef),r.deleteTexture(this.uTextureRef),r.deleteTexture(this.vTextureRef),r.deleteTexture(this.cursorTextureRef),r.deleteTexture(this.waterMarkTextureRef),r.bindBuffer(r.ARRAY_BUFFER,null),r.deleteBuffer(this.vertexPosBuffer),r.deleteBuffer(this.texturePosBuffer),this.maskTextureRef&&r.deleteTexture(this.maskTextureRef),this.masktexturePosBuffer&&r.deleteBuffer(this.masktexturePosBuffer),r.glInitSucceed=0}},ea.prototype.updateVertexInfoForSharing=function(){const[e,t,r,a]=this.vertexPos,i=this.webglVertexPos[0],n=this.webglVertexPos[3];if(e!=i||n!=a){this.webglVertexPos[0]=e,this.webglVertexPos[1]=t,this.webglVertexPos[2]=r,this.webglVertexPos[3]=a;var o=new Float32Array([r,t,e,t,r,a,e,a,1,1,-1,1,1,-1,-1,-1]),s=this.contextGL;s.bindBuffer(s.ARRAY_BUFFER,this.vertexPosBuffer),s.bufferData(s.ARRAY_BUFFER,o,s.DYNAMIC_DRAW)}},ea.prototype.updateTextureInfoForSharing=function(){const[e,t,r,a]=this.texturePos,i=this.webglTexturePos[0],n=this.webglTexturePos[3];if(e!=i||n!=a){this.webglTexturePos[0]=e,this.webglTexturePos[1]=t,this.webglTexturePos[2]=r,this.webglTexturePos[3]=a;var o=new Float32Array([r,t,e,t,r,a,e,a,1,0,0,0,1,1,0,1]),s=this.contextGL;s.bindBuffer(s.ARRAY_BUFFER,this.texturePosBuffer),s.bufferData(s.ARRAY_BUFFER,o,s.DYNAMIC_DRAW)}},ea.prototype.updateVertexInfoForMultiView=function(e,t,r,a,i){var n,o,s,d,l=this.contextGL;if(this.isUseFillMode({width:r,height:a,rotation:i}))n=0,o=0,s=1,d=1;else{var c=i==this.ROTATION_CLOCK90||i==this.ROTATION_CLOCK270?a:r,u=i==this.ROTATION_CLOCK90||i==this.ROTATION_CLOCK270?r:a,h=c/u*t;h>e?(n=0,s=1,d=1-(o=(t-u/c*e)/2/t)):(o=0,d=1,s=1-(n=(e-h)/2/e))}n=2*n-1,s=2*s-1,o=1-2*o,d=1-2*d;var _=new Float32Array([s,o,n,o,s,d,n,d,1,1,-1,1,1,-1,-1,-1]);this.viewPostion=_,l.bindBuffer(l.ARRAY_BUFFER,this.vertexPosBuffer),l.bufferData(l.ARRAY_BUFFER,_,l.DYNAMIC_DRAW)},ea.prototype.updateTextureInfoForMultiView=function(e,t,r,a,i,n,o){var s,d,l,c,u=this.contextGL;if(this.isUseFillMode({width:r.width,height:r.height,rotation:a})){const i=a==this.ROTATION_CLOCK90||a==this.ROTATION_CLOCK270?o/n:n/o,u=r.left||0,h=r.top||0;if(r.width/r.height>i){const a=r.height*i;s=h/t,d=(Math.round((r.width-a)/2)+u)/e,l=(h+r.height)/t,c=d+a/e}else{const a=r.width/i;l=(s=(Math.round((r.height-a)/2)+h)/t)+a/t,c=(d=u/e)+r.width/e}}else s=rr(r.top/t,2),d=rr(r.left/e,2),l=tr((r.top+r.height)/t,2),c=tr((r.width+r.left)/e,2);var h=[d,s,c,s,c,l,d,l];a==this.ROTATION_CLOCK90&&(h.unshift(h[6],h[7]),h=h.slice(0,8)),a==this.ROTATION_CLOCK180&&(h.unshift(h[4],h[5],h[6],h[7]),h=h.slice(0,8)),a==this.ROTATION_CLOCK270&&(h.push(h[0],h[1]),h=h.slice(2,10));var _=h[0],p=h[1];if(h[0]=h[2],h[1]=h[3],h[2]=_,h[3]=p,i)if(a==this.ROTATION_CLOCK90||a==this.ROTATION_CLOCK270){let e=h[1];h[1]=h[3],h[3]=e,e=h[5],h[5]=h[7],h[7]=e}else h[0]=1-h[0],h[2]=1-h[2],h[4]=1-h[4],h[6]=1-h[6];var f=new Float32Array([...h,1,0,0,0,1,1,0,1]);u.bindBuffer(u.ARRAY_BUFFER,this.texturePosBuffer),u.bufferData(u.ARRAY_BUFFER,f,u.DYNAMIC_DRAW)},ea.prototype.getViewPosition=function(){let e=[0,0,1,1];if(!this.viewPostion)return e;const t=this.viewPostion[0],r=this.viewPostion[1],a=this.viewPostion[2],i=this.viewPostion[5];return e[0]=(1-r)/2,e[1]=(1+a)/2,e[2]=(1-i)/2,e[3]=(1+t)/2,e},ea.prototype.drawNextOutputPictureFrame=function(e,t,r,a,i){let n=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],o=arguments.length>6?arguments[6]:void 0,s=!(arguments.length>7&&void 0!==arguments[7])||arguments[7];if(!this.isAvaiable())return;var d=this.contextGL,l=this.yTextureRef,c=this.uTextureRef,u=this.vTextureRef;d.enable(d.BLEND),d.blendFunc(d.SRC_ALPHA,d.ONE_MINUS_SRC_ALPHA),i=i||this.ROTATION_CLOCK0;var h=(r=r||{top:0,left:0,width:e,height:t}).width!=this.croppingParams.width||r.height!=this.croppingParams.height,_=(r.top!=this.croppingParams.top||(r.left,this.croppingParams.left),o.width!=this.viewWidth||o.height!=this.viewHeight),p=(e!=this.textureWidth||this.textureHeight,i!=this.picRotation);(h||_||p)&&function(e,t,r,a,i){e.contextGL;let n=i.width,o=i.height;var s,d,l,c,u=a==e.ROTATION_CLOCK90||a==e.ROTATION_CLOCK270?r:t,h=a==e.ROTATION_CLOCK90||a==e.ROTATION_CLOCK270?t:r,_=u/h*o;_>n?(s=0,l=1,c=1-(d=(o-h/u*n)/2/o)):(d=0,c=1,l=1-(s=(n-_)/2/n)),s=parseFloat((2*s-1).toFixed(3)),l=parseFloat((2*l-1).toFixed(3)),d=parseFloat((1-2*d).toFixed(3)),c=parseFloat((1-2*c).toFixed(3)),e.vertexPos=[s,d,l,c]}(this,r.width,r.height,i,o),this.updateVertexInfoForSharing(),function(e,t,r,a,i){var n=a.top/r,o=a.left/t,s=(a.height+a.top)/r,d=(a.left+a.width)/t,l=[o,n,d,n,d,s,o,s];i==e.ROTATION_CLOCK90&&(l.unshift(l[6],l[7]),l=l.slice(0,8)),i==e.ROTATION_CLOCK180&&(l.unshift(l[4],l[5],l[6],l[7]),l=l.slice(0,8)),i==e.ROTATION_CLOCK270&&(l.push(l[0],l[1]),l=l.slice(2));var c=l[0],u=l[1];l[0]=l[2],l[1]=l[3],l[2]=c,l[3]=u;var h=new Float32Array([...l,1,0,0,0,1,1,0,1]),_=e.contextGL;_.bindBuffer(_.ARRAY_BUFFER,e.texturePosBuffer),_.bufferData(_.ARRAY_BUFFER,h,_.DYNAMIC_DRAW)}(this,e,t,r,i);let f=n?0:1;f!=this.colorRange&&(d.uniform1i(this.colorRangeRef,f),this.colorRange=f),d.viewport(o.x,o.y,o.width,o.height),this.viewport_rect||(this.viewport_rect=new Float32Array(4)),this.viewport_rect.set([o.x,o.y,o.width,o.height],0),d.uniform4fv(this.ul_viewport_rect,this.viewport_rect),d.uniform1i(this.onlyRGBARef,0),d.uniform1i(this.yuvmodeRef,1),Object.assign(this.croppingParams,r),this.textureWidth=e,this.textureHeight=t,this.picRotation=i,this.viewWidth=o.width,this.viewHeight=o.height;var m=a,g=e*t;if(d.activeTexture(d.TEXTURE0),d.bindTexture(d.TEXTURE_2D,l),s){var v=m.subarray(0,g);d.texImage2D(d.TEXTURE_2D,0,d.LUMINANCE,e,t,0,d.LUMINANCE,d.UNSIGNED_BYTE,v)}var y=e/2*t/2;if(d.activeTexture(d.TEXTURE1),d.bindTexture(d.TEXTURE_2D,c),s){var b=m.subarray(g,g+y);d.texImage2D(d.TEXTURE_2D,0,d.LUMINANCE,e/2,t/2,0,d.LUMINANCE,d.UNSIGNED_BYTE,b)}var w=y;if(d.activeTexture(d.TEXTURE2),d.bindTexture(d.TEXTURE_2D,u),s){var S=m.subarray(g+y,g+y+w);d.texImage2D(d.TEXTURE_2D,0,d.LUMINANCE,e/2,t/2,0,d.LUMINANCE,d.UNSIGNED_BYTE,S)}d.activeTexture(d.TEXTURE0+4),d.bindTexture(d.TEXTURE_2D,this.cursorTextureRef),d.uniform1i(this.cursorSamplerRef,4),this.hasCursor?d.uniform1i(this.cursorFlagRef,1):s&&d.texImage2D(d.TEXTURE_2D,0,d.RGBA,1,1,0,d.RGBA,d.UNSIGNED_BYTE,this.dummpyCursor),d.uniform4f(this.cursorInfoRef,this.cx,this.cy,this.cw,this.ch),this.render(),this.hasWholeFrame=1},ea.prototype.updateCursor=function(e,t,r,a){if(this.isAvaiable()){var i=this.contextGL;e<=0||t<=0||!r||r.length!=e*t*4||a!=this.lastcursorSyncId&&(this.lastcursorSyncId=a,i.activeTexture(i.TEXTURE0+4),i.bindTexture(i.TEXTURE_2D,this.cursorTextureRef),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,e,t,0,i.RGBA,i.UNSIGNED_BYTE,r),this.cursorWidth=e,this.cursorHeight=t,this.hasCursor=1)}},ea.prototype.updateCursorPosInfo=function(e,t,r,a,i){if(e&&this.hasCursor){let e=t/this.croppingParams.width,n=r/this.croppingParams.height,o=a/this.croppingParams.width,s=i/this.croppingParams.height;this.cx=e,this.cy=n,this.cw=o,this.ch=s}else this.cx=0,this.cy=0,this.cw=0,this.ch=0},ea.prototype.isHasWholeFrame=function(){return this.hasWholeFrame},ea.prototype.updateWatermark=function(e,t,r){if(this.isAvaiable()){var a=this.contextGL;e<=0||t<=0||!r||r.length!=e*t*4||(this.hasWaterMark=1,this.watermarkWidth=e,this.watermarkHeight=t,a.activeTexture(a.TEXTURE0+5),a.bindTexture(a.TEXTURE_2D,this.waterMarkTextureRef),a.texImage2D(a.TEXTURE_2D,0,a.RGBA,this.watermarkWidth,this.watermarkHeight,0,a.RGBA,a.UNSIGNED_BYTE,r))}},ea.prototype.drawWatermark=function(){if(this.isAvaiable()){var e=this.contextGL;this.isSetWatermark()&&this.watermarkWidth&&this.watermarkHeight&&(e.uniform1i(this.waterMarkFlagRef,1),e.activeTexture(e.TEXTURE0+5),e.bindTexture(e.TEXTURE_2D,this.waterMarkTextureRef),e.enable(e.BLEND),e.blendFunc(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA),e.drawArrays(e.TRIANGLE_STRIP,4,4))}},ea.prototype.drawRoundedCorner=function(){if(this.isAvaiable()){var e=this.contextGL;e.enable(e.BLEND),e.blendFunc(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA),e.uniform1f(this.ul_enable_rounded_corner,this.enable_rounded_corner),e.uniform1f(this.ul_radius_lt_x,this.radius_lt_x),e.uniform1f(this.ul_radius_lt_y,this.radius_lt_y),e.uniform1f(this.ul_radius_lb_x,this.radius_lb_x),e.uniform1f(this.ul_radius_lb_y,this.radius_lb_y),e.uniform1f(this.ul_radius_rt_x,this.radius_rt_x),e.uniform1f(this.ul_radius_rt_y,this.radius_rt_y),e.uniform1f(this.ul_radius_rb_x,this.radius_rb_x),e.uniform1f(this.ul_radius_rb_y,this.radius_rb_y),e.uniform1f(this.ul_aa_width,this.aa_width)}},ea.prototype.cleanupRoundedCornerRadius=function(){this.enable_rounded_corner=0,this.radius_lt_x=0,this.radius_lt_y=0,this.radius_lb_x=0,this.radius_lb_y=0,this.radius_rt_x=0,this.radius_rt_y=0,this.radius_rb_x=0,this.radius_rb_y=0,this.aa_width=Ye,this.viewport_rect=null},ea.prototype.render=function(){if(this.isAvaiable()){var e=this.contextGL;this.drawRoundedCorner(),e.uniform1i(this.waterMarkFlagRef,0),e.drawArrays(e.TRIANGLE_STRIP,0,4),this.drawWatermark()}},ea.prototype.clear=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.hasCursor=0,this.watermarkHeight=0,this.watermarkWidth=0,this.watermarkRepeated=!1,this.hasWholeFrame=0,this.lastcursorSyncId=-1,this.cleanupRoundedCornerRadius(),e&&this.clearCanvas({R:0,G:0,B:0,A:0})},ea.prototype.clearCanvas=function(e){if(this.cleanupRoundedCornerRadius(),this.isAvaiable()){var t=this.contextGL;e?t.clearColor(e.R,e.G,e.B,e.A):t.clearColor(this.bgColor[0],this.bgColor[1],this.bgColor[2],255),t.clear(t.COLOR_BUFFER_BIT)}},ea.prototype.isRGBAMode=function(e){return-1!==[Pe,Ie].indexOf(e)},ea.prototype.updateRemoteVideoTextures=function(e,t,r,a,i){let n=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],o=arguments.length>6?arguments[6]:void 0,s=!(arguments.length>8&&void 0!==arguments[8])||arguments[8];if(!this.isAvaiable())return;var d=this.contextGL,l=this.yTextureRef,c=this.uTextureRef,u=this.vTextureRef;d.enable(d.BLEND),d.blendFunc(d.SRC_ALPHA,d.ONE_MINUS_SRC_ALPHA);const h=this.isRGBAMode(this.videoMode);if(e<=0||t<=0||!a||!a.length||a.length!=e*t*3/2&&!h||r&&(r.top<0||r.left<0||r.left+r.width>e||r.top+r.height>t))return!1;let _=n?0:1;if(this.colorRange=_,this.rotation=i,Object.assign(this.croppingParams,r),this.textureWidth=e,this.textureHeight=t,this.viewWidth=o.width,this.viewHeight=o.height,!s)return;if(d.bindTexture(d.TEXTURE_2D,l),h)return void d.texImage2D(d.TEXTURE_2D,0,d.RGBA,e,t,0,d.RGBA,d.UNSIGNED_BYTE,a);var p=a,f=e*t,m=p.subarray(0,f);d.texImage2D(d.TEXTURE_2D,0,d.LUMINANCE,e,t,0,d.LUMINANCE,d.UNSIGNED_BYTE,m);let g=0,v=0;1==this.videoMode?(g=e/2*t/2,v=g):2==this.videoMode&&(g=e*t/2,v=0);var y=p.subarray(f,f+g);if(d.bindTexture(d.TEXTURE_2D,c),v){d.texImage2D(d.TEXTURE_2D,0,d.LUMINANCE,e/2,t/2,0,d.LUMINANCE,d.UNSIGNED_BYTE,y);var b=p.subarray(f+g,f+g+v);d.bindTexture(d.TEXTURE_2D,u),d.texImage2D(d.TEXTURE_2D,0,d.LUMINANCE,e/2,t/2,0,d.LUMINANCE,d.UNSIGNED_BYTE,b)}else d.texImage2D(d.TEXTURE_2D,0,d.LUMINANCE_ALPHA,e/2,t/2,0,d.LUMINANCE_ALPHA,d.UNSIGNED_BYTE,y);return!0},ea.prototype.updateRemoteVideoTexturesImageBitmap=function(e,t,r,a,i){let n=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];if(e<=0||t<=0||!r)return;if(!this.isAvaiable())return;var o=this.contextGL;if(this.textureWidth=e,this.textureHeight=t,Number.isNaN(i)||(this.rotation=i),Object.assign(this.croppingParams,a),!n)return;o.bindTexture(o.TEXTURE_2D,this.yTextureRef);const s=o.RGBA,d=o.RGBA,l=o.UNSIGNED_BYTE;o.texImage2D(o.TEXTURE_2D,0,s,d,l,r)},ea.prototype.updateSelfMaskImage=function(e,t,r){if(!(e<=0||t<=0)&&r&&r.length==e*t*4&&this.isAvaiable()){var a=this.contextGL;a.bindTexture(a.TEXTURE_2D,this.maskTextureRef),a.texImage2D(a.TEXTURE_2D,0,a.RGBA,e,t,0,a.RGBA,a.UNSIGNED_BYTE,r)}},ea.prototype.VideoFlip=function(){if(this.isAvaiable()){var e=this.contextGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,1)}},ea.prototype.drawRemoteVideo=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.isAvaiable())return;var r=this.contextGL;let a=this.isRGBAMode(this.videoMode)?1:0;r.uniform1i(this.colorRangeRef,this.colorRange),this.setUniformFlag(a,this.hasCursor,this.videoMode),this.initmask&&r.uniform1i(this.maskFlagRef,1),this.updateTextureInfoForMultiView(this.textureWidth,this.textureHeight,this.croppingParams,this.rotation,t,e.width,e.height),r.viewport(e.x,e.y,e.width,e.height),this.viewport_rect||(this.viewport_rect=new Float32Array(4)),this.viewport_rect.set([e.x,e.y,e.width,e.height],0),r.uniform4fv(this.ul_viewport_rect,this.viewport_rect),this.updateVertexInfoForMultiView(e.width,e.height,this.croppingParams.width,this.croppingParams.height,this.rotation),this.BindTextures(this.videoMode),r.enable(r.BLEND),r.blendFunc(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA),this.render()},ea.prototype.readPixelsSyncRequest=function(e,t,r,a){if(this.isAvaiable()){var i,n=this.contextGL;return this.destination&&this.destination.length==r*a*4||(this.destination=new Uint8Array(r*a*4)),i=this.destination,n.flush(),n.readPixels(e,t,r,a,n.RGBA,n.UNSIGNED_BYTE,i),i}},ea.prototype.updateSelfVideoTextures=function(e,t,r,a){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(!(e<=0||t<=0)&&r&&r.length%4==0&&this.isAvaiable()){var o=this.contextGL;this.textureWidth=e,this.textureHeight=t,this.rotation=n,Object.assign(this.croppingParams,a),i&&(o.bindTexture(o.TEXTURE_2D,this.yTextureRef),o.texImage2D(o.TEXTURE_2D,0,o.RGBA,e,t,0,o.RGBA,o.UNSIGNED_BYTE,r))}},ea.prototype.drawSelfVideo=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.isAvaiable()){var a=this.contextGL;this.setUniformFlag(1,this.hasCursor,this.videoMode),this.updateTextureInfoForMultiView(this.textureWidth,this.textureHeight,this.croppingParams,this.rotation,r,e.width,e.height),a.viewport(e.x,e.y,e.width,e.height),this.viewport_rect||(this.viewport_rect=new Float32Array(4)),this.viewport_rect.set([e.x,e.y,e.width,e.height],0),a.uniform4fv(this.ul_viewport_rect,this.viewport_rect),t?(a.enable(a.BLEND),a.blendFunc(a.ZERO,a.ZERO),this.updateVertexInfoForMultiView(e.width,e.height,e.width,e.height,this.ROTATION_CLOCK0)):(a.enable(a.BLEND),a.blendFunc(a.SRC_ALPHA,a.ONE_MINUS_SRC_ALPHA),this.updateVertexInfoForMultiView(e.width,e.height,this.croppingParams.width,this.croppingParams.height,this.rotation)),this.BindTextures(Pe),this.render()}},ea.prototype.isSetWatermark=function(){return this.hasWaterMark},ea.prototype.setWatermarkFlag=function(e){this.hasWaterMark=e,e||(this.setWatermarkRepeated(!1),this.setWatermarkOpacity(),this.setWatermarkPosition(16))},ea.prototype.setUniformFlag=function(e,t,r){if(this.isAvaiable()){var a=this.contextGL;a.uniform1i(this.onlyRGBARef,e),a.uniform1i(this.bgraModeRef,e&&r===Ie?1:0),a.uniform1i(this.cursorFlagRef,t),e||a.uniform1i(this.yuvmodeRef,r)}},ea.prototype.setVideoMode=function(e){this.videoMode=e},ea.prototype.getVideoMode=function(e){return this.videoMode},ea.prototype.setWatermarkRepeated=function(e){this.watermarkRepeated=e},ea.prototype.isWatermarkRepeated=function(){return!!this.watermarkRepeated},ea.prototype.setWatermarkOpacity=function(e){this.watermarkOpacity=e||.15},ea.prototype.getWatermarkOpacity=function(){return this.watermarkOpacity},ea.prototype.setWatermarkPosition=function(e){this.watermarkPosition=e||16},ea.prototype.getWatermarkPosition=function(){return this.watermarkPosition},ea.prototype.setMultiView=function(e){return this.isMultiView=e},ea.prototype.getRepeatedWatermarkUniformValue=function(){return this.isMultiView?30:7},ea.prototype.getRepeatedWatermarkTextureValue=function(e){return this.isMultiView?e.TEXTURE30:e.TEXTURE7},ea.prototype.setFillMode=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.fillMode=e,this.fillModeForResolution=t},ea.prototype.getFillMode=function(){return this.fillMode},ea.prototype.getFillModeForResolution=function(){return this.fillModeForResolution},ea.prototype.getTextureIndex=function(){return this.textureindex},ea.prototype.getIndex=function(){return this.textureindex},ea.prototype.getWatermarkWidth=function(){return this.watermarkWidth},ea.prototype.getWatermarkHeight=function(){return this.watermarkHeight},ea.prototype.getTextureWidth=function(){return this.textureWidth},ea.prototype.getTextureHeight=function(){return this.textureHeight},ea.prototype.getRotation=function(){return this.rotation},ea.prototype.getCroppingParams=function(){return this.croppingParams},ea.prototype.getWatermarkOpacity=function(){return this.watermarkOpacity},ea.prototype.getAttachedCanvas=function(){return this.canvasElement},ea.prototype.getCanvasId=function(){return this.canvasID},ea.prototype.resizeCanvasTo=function(e,t){this.contextGL.canvas.width=e,this.contextGL.canvas.height=t},ea.prototype.isUseFillMode=function(e){let{width:t,height:r,rotation:a}=e;if(!this.fillMode)return!1;if(!this.fillModeForResolution)return!0;if(!t||!r)return!1;const i=a===this.ROTATION_CLOCK90||a==this.ROTATION_CLOCK270?r/t:t/r;return(Array.isArray(this.fillModeForResolution)?this.fillModeForResolution:[this.fillModeForResolution]).some((e=>Math.abs(i-e)<.01))},ea.prototype.setRoundedCornerRadius=function(e){e?(this.radius_lt_x=e.radius_lt_x,this.radius_lt_y=e.radius_lt_y,this.radius_lb_x=e.radius_lb_x,this.radius_lb_y=e.radius_lb_y,this.radius_rt_x=e.radius_rt_x,this.radius_rt_y=e.radius_rt_y,this.radius_rb_x=e.radius_rb_x,this.radius_rb_y=e.radius_rb_y,0===this.radius_lt_x&&0===this.radius_lt_y&&0===this.radius_lb_x&&0===this.radius_lb_y&&0===this.radius_rt_x&&0===this.radius_rt_y&&0===this.radius_rb_x&&0===this.radius_rb_y?this.enable_rounded_corner=0:this.enable_rounded_corner=1):this.enable_rounded_corner=0},ea.prototype.setAntialiasWidth=function(e){(e<=0||e>=1)&&(e=Ye),this.aa_width=e};const ta=ea;function ra(e,t,r){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function aa(e,t){return e.get(na(e,t))}function ia(e,t,r){return e.set(na(e,t),r),r}function na(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var oa=new WeakMap,sa=new WeakMap;class da extends Vr{constructor(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];super(),ra(this,oa,new Map),ra(this,sa,!1),ia(sa,this,e)}setCanvasAlphaChannelEnability(e){ia(sa,this,e)}createVideoRenderDisplay(e,t,r){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i=null,n=null,o=null,s=!1;return a&&(i=a.forceNoGL,n=a.contextOptions,o=a.webGLResources,s=a.initMask),new ta(e,t,r,i,n,o,s,aa(sa,this))}getVideoRenderDisplay(e,t,r,a){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,n=aa(oa,this).get(e);if(!n){let a=[];n=[a,[]],aa(oa,this).set(e,n);let o=new ta(e,t,0,void 0,void 0,void 0,void 0,aa(sa,this));o.setMultiView(!0),i&&i.set(e,o);let s=1;for(;s<=r;s++){const r=new ta(e,t,s,void 0,void 0,{program:o.shaderProgram,contextgl:o.contextGL,vBuffer:o.vertexPosBuffer,tBuffer:o.texturePosBuffer,waterMarkTextureRef:o.waterMarkTextureRef,repeatedWaterMarkTextureRef:o.repeatedWaterMarkTextureRef},void 0,void 0,aa(sa,this));r.setMultiView(!0),a.push(r)}}let o,s=aa(oa,this).get(e),d=s[0],l=s[1];if(s&&d[0]&&(o=d.pop(),l.push(o)),!o){const e=s?"".concat(s.length):"undefined",t=d?"".concat(d.length):"undefined";a("No Display obtained from VideoRender.Get_Display. canvasRenderArray:".concat(e," unusedRenderArray:").concat(t))}return o}onWebglContextLostForMulti(e,t){const{canvas:r}=t;let a=aa(oa,this).get(r);var[i,n,o]=a;[...i,...n].forEach((e=>e.clear()))}onRestoredFromLostForMulti(e,t){if(!t)return;const{canvas:r}=t;let a=aa(oa,this).get(r);var[i,n,o]=a;const s=[...i,...n];let d=s.find((e=>e.isLocalDisplay()));d.webglVertexPos=[0,0,0,0],d.webglTexturePos=[0,0,0,0],o.args={program:d.shaderProgram,contextgl:d.contextGL,vBuffer:d.vertexPosBuffer,tBuffer:d.texturePosBuffer,webglVertexPos:d.webglVertexPos,webglTexturePos:d.webglTexturePos},s.forEach((e=>{e!=d&&e.reinit(o.args)}))}getRenderDisplay(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=aa(oa,this).get(e);if(!a){let i=[],n={canvasId:t,size:1,args:{}};a=[i,[],n],aa(oa,this).set(e,a);const o={webglcontextlostCallback:this.onWebglContextLostForMulti.bind(this),webglcontextrestoredCallback:this.onRestoredFromLostForMulti.bind(this),params:{canvas:e,rendercanvasID:t}};let s=new ta(e,t,0,void 0,o,void 0,void 0,aa(sa,this));r&&r.set(e,s),i.push(s),n.args={program:s.shaderProgram,contextgl:s.contextGL,vBuffer:s.vertexPosBuffer,tBuffer:s.texturePosBuffer,webglVertexPos:s.webglVertexPos,webglTexturePos:s.webglTexturePos}}if(!a[0].length){const r=new ta(e,t,a[2].size,void 0,void 0,a[2].args,void 0,aa(sa,this));a[2].size++,a[0].push(r)}let i=a[0].pop();return a[1].push(i),i}recycleRenderDisplay(e,t,r){t.setWatermarkFlag(0),t.setVideoMode(Fe),t.clear(r);let a=aa(oa,this).get(e);if(a){let e=a[0],r=a[1];r&&r.some((function(e,a){if(e===t)return r.splice(a,1),!0})),e.push(t)}}onRestoredFromContextLost(e,t,r,a,i){let n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,o=aa(oa,this).get(r);(!o||o.length<2)&&i("canvasRenderArray:".concat(o,", length:").concat(null==o?void 0:o.length));let s=n.get(t);if(s){s.reinit();for(let e=0;e<(null==o?void 0:o.length);e++)o[e].forEach((e=>{null==e||e.reinit({program:s.shaderProgram,contextgl:s.contextGL,vBuffer:s.vertexPosBuffer,tBuffer:s.texturePosBuffer,waterMarkTextureRef:s.waterMarkTextureRef,repeatedWaterMarkTextureRef:s.repeatedWaterMarkTextureRef})}));return r!==t&&(aa(oa,this).delete(r),aa(oa,this).set(t,o),n&&(n.delete(r),n.set(t,s))),null}}getRenderDisplayMap(){return aa(oa,this)}cleanup(e,t){var r;null==t||null===(r=t.cleanup)||void 0===r||r.call(t);for(const[e,t]of aa(oa,this)){const e=t[0],r=t[1];for(const t of e)t.cleanup();for(const e of r)e.cleanup()}ia(oa,this,new Map)}cleanupByCanvas(e){if(aa(oa,this).get(e)){let t=aa(oa,this).get(e);if(t){let r=t[0],a=t[1];a.forEach((function(e){var t;null==e||null===(t=e.cleanup)||void 0===t||t.call(e)})),r.forEach((function(e){var t;null==e||null===(t=e.cleanup)||void 0===t||t.call(e)})),r=[],a=[],aa(oa,this).delete(e)}}else{var t,r;null===(t=e.display)||void 0===t||null===(r=t.cleanup)||void 0===r||r.call(t)}}}function la(e,t,r){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function ca(e,t){return e.get(ha(e,t))}function ua(e,t,r){return e.set(ha(e,t),r),r}function ha(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var _a=new WeakMap,pa=new WeakMap,fa=new WeakMap,ma=new WeakMap,ga=new WeakMap;const va=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];la(this,_a,null),la(this,pa,null),la(this,fa,null),la(this,ma,null),la(this,ga,!1),ua(ga,this,e)}setGPUResourceMgrGetter(e){ua(ma,this,e)}isEnableCanvasAlphaChannel(){return ca(ga,this)}setCanvasAlphaChannelEnability(e){ua(ga,this,e),ca(_a,this)&&ca(_a,this).setCanvasAlphaChannelEnability(e),ca(pa,this)&&ca(pa,this).setCanvasAlphaChannelEnability(e)}getWebGLRenderDisplayMgr(){return ca(_a,this)||(ua(_a,this,new Yr(ca(ga,this))),J("[Render] getWebGLRenderDisplayMgr")),ca(_a,this)}getWebGL2RenderDisplayMgr(){return ca(pa,this)||ua(pa,this,new da(ca(ga,this))),ca(pa,this)}getWebGPURenderDisplayMgr(){if(!ca(fa,this)){const e=ur.getModule("webgpu_renderer_dynmod");ua(fa,this,e.exports.createWebGPURenderDisplayMgr()),ca(fa,this).setGPUResourceMgrGetter(ca(ma,this).call(this,2))}return ca(fa,this)}getRenderDisplayMgr(e){switch(e){case 1:return this.getWebGLRenderDisplayMgr();case 3:return this.getWebGL2RenderDisplayMgr();case 2:return this.getWebGPURenderDisplayMgr();case 4:return er("VIDEO_TAG has no RenderDisplayMgr!"),null;default:return null}}getVideoRenderDisplay(e,t,r,a,i){let n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,s=this.getRenderDisplayMgr(e).getVideoRenderDisplay(t,r,a,i,o);return s&&2===e&&(s.addRenderer(n),s.attachCanvas(t,r),s.setGPUResMgr(ca(ma,this).call(this,e))),s}getRenderDisplay(e,t,r){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,n=this.getRenderDisplayMgr(e).getRenderDisplay(t,r,i);return n&&2===e&&(n.addRenderer(a),n.attachCanvas(t,r),n.setGPUResMgr(ca(ma,this).call(this,e))),n}createVideoRenderDisplay(e,t,r,a){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,o=this.getRenderDisplayMgr(e).createVideoRenderDisplay(t,r,a,i,n);return o&&2===e&&(o.addRenderer(i),o.attachCanvas(t,r),o.setGPUResMgr(ca(ma,this).call(this,e))),o}recycleRenderDisplay(e,t,r,a){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];switch(e){case 2:ca(fa,this)&&ca(fa,this).recycleRenderDisplay(r,a,i);break;case 1:ca(_a,this)&&ca(_a,this).recycleRenderDisplay(t,r,i);break;case 3:ca(pa,this)&&ca(pa,this).recycleRenderDisplay(t,r,i);break;case 4:er("VIDEO_TAG has no display")}}collectInUseRenderDisplays(e,t){let r=null;return 2===e&&ca(fa,this)&&(r=ca(fa,this).collectInUseRenderDisplays(t)),r}collectInUseRenderDisplaysByCanvas(e,t,r){let a=null;return 2===e&&ca(fa,this)&&(a=ca(fa,this).collectInUseRenderDisplaysByCanvas(t,r)),a}getRenderDisplayMap(e,t){if(1===e){if(ca(_a,this))return ca(_a,this).getRenderDisplayMap()}else if(2===e){if(ca(fa,this))return ca(fa,this).getRenderDisplayMap(t)}else if(3===e&&ca(pa,this))return ca(pa,this).getRenderDisplayMap(t);return null}onRestoredFromContextLost(e,t,r,a,i){let n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null;return ca(_a,this)?ca(_a,this).onRestoredFromContextLost(e,t,r,a,i,n):ca(pa,this)?ca(pa,this).onRestoredFromContextLost(e,t,r,a,i,n):null}cleanup(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];null!==ca(_a,this)&&ca(_a,this).cleanup(e,t),ca(pa,this)&&ca(pa,this).cleanup(e,t),null!==ca(fa,this)&&ca(fa,this).cleanup(t,r)}cleanupByCanvas(e){null!==ca(_a,this)&&ca(_a,this).cleanupByCanvas(e),null!==ca(pa,this)&&ca(pa,this).cleanupByCanvas(e),null!==ca(fa,this)&&ca(fa,this).cleanupByCanvas(e)}};function ya(e,t,r){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function ba(e,t){return e.get(Sa(e,t))}function wa(e,t,r){return e.set(Sa(e,t),r),r}function Sa(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var Ma=new WeakMap,Ea=new WeakMap,Ra=new WeakMap,Ta=new WeakMap,ka=new WeakMap;class xa{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.checkInterval=0,this.hasRTPPackets=!1,this.callBackEvent=e,this.subforme=!1,this.lastsubformetime=0,this.videoType=t,this.paused=!1,this.isVbEnabled=!1,this.isVideoCaptured=!1,this.hasWasmMemoryError=!1}startCheck(){this.checkInterval&&(clearInterval(this.checkInterval),this.hasRTPPackets=!1,this.subforme=!1,this.paused=!1),this.checkInterval=setInterval((()=>{if((this.videoType&&this.subforme||!this.videoType)&&!this.hasRTPPackets&&!this.paused){let e=!1;this.videoType&&this.isVbEnabled&&this.isVideoCaptured&&!this.hasWasmMemoryError&&(e=!0),performance.now()-this.lastsubformetime>2e4&&postMessage({status:this.callBackEvent,videoType:this.videoType,subforme:this.subforme,hasRTPPackets:this.hasRTPPackets,vberror:e})}this.hasRTPPackets=!1,this.isVideoCaptured=!1}),3e4)}stopCheck(){this.checkInterval&&clearInterval(this.checkInterval),this.checkSharingInterval=0,this.subforme=!1,this.paused=!1}setRtpPackets(){this.hasRTPPackets=!0}setSubForMe(e){let t=e>=0;this.subforme!==t&&(this.subforme=t,this.lastsubformetime=performance.now())}setVBFlag(e){this.isVbEnabled=e}setVideoCaptured(e){this.isVideoCaptured=e}setWasmMemoryError(e){this.hasWasmMemoryError=e}setPaused(e){e||(this.lastsubformetime=performance.now()),this.paused=e,this.hasRTPPackets=!1}}var Aa=r(7201),Ca=r.n(Aa);function Fa(e){let t=e||{};this._samples=[],this._interval_id=0,this._lasted_update_time=0,this._lasted_group_time=0,this._enable=!1,this._interval_time=t.interval||3e4,this._customer_callback=t.report_call,this._tag=t.tag||"netreport",this._group_interval=t.group_interval||1e3,this._enable_advanced=t.advanced||!1,this._current_count=0,this._qos_report=new Gt({tag:"jitter",interval:3e4,reportcallback:this._qos_report_timeout.bind(this)}),this._qos_report_samples=[],this._cureen_qos_report=0}Fa.prototype._qos_report_timeout=function(e,t,r,a){if(this._customer_callback){let i="".concat(e,",").concat(t,",").concat(r,",").concat(a);this._customer_callback(this._tag+"TimeOut",i)}},Fa.prototype._report=function(){let e=(new Date).getTime(),t="".concat(e,"-").concat(this._samples.length,"-").concat(this._samples),r="".concat(e,"-").concat(this._qos_report_samples.length,"-").concat(this._qos_report_samples);t=Ca()(t).call(t,",","|"),r=Ca()(r).call(r,",","|"),this._customer_callback?(this._customer_callback(this._tag,t),this._enable_advanced&&this._customer_callback(this._tag+"QOS",r)):console.error("tag:".concat(this._tag,",").concat(t))},Fa.prototype._group=function(){let e=performance.now();if(e>=this._lasted_group_time+1700){let t=Math.round((e-this._lasted_group_time)/1e3)-1;for(let e=0;e<t;e++)this._samples.push(-1)}this._lasted_group_time=e,this._samples.push(this._current_count),this._qos_report_samples.push(this._cureen_qos_report),this._cureen_qos_report=0,this._current_count=0,e>=this._lasted_update_time+this._interval_time&&(this._lasted_update_time=e,this._report(),this._samples=[],this._qos_report_samples=[])},Fa.prototype.start=function(){this._enable||(this._lasted_update_time=performance.now(),this._lasted_group_time=this._lasted_update_time,this._samples=[],this._current_count=0,this._qos_report_samples=[],this._cureen_qos_report=0,this._interval_id=setInterval(this._group.bind(this),this._group_interval),this._enable=!0)},Fa.prototype.stop=function(){this._enable&&(clearInterval(this._interval_id),this._interval_id=0,this._enable=!1)},Fa.prototype.sample=function(e){if(this._enable&&(this._current_count++,this._enable_advanced)){if(Ut(e))return void this._cureen_qos_report++;if(Vt(e)){let t=Bt(e),r=performance.now();if(this._lasted_qos_ts){let e=r-this._lasted_sys_ts-(t-this._lasted_qos_ts);e>30&&this._qos_report.timeoutReport(e,r)}this._lasted_qos_ts=t,this._lasted_sys_ts=r,this._lasted_data=e}}};class Pa{constructor(e,t){this.sendsize=0,this.dropsize=0,this.presamples={sendsize:0,drop:0,time:0,size:0,nosendcount:0,dckbps:0,updatetime:0,smoothsend:0},this.channel=t,this.id=0,this.wraper=e,this.overusetime=0}send(e){this.sendsize+=e}drop(e){this.dropsize+=e}setbuffer(e){const t=performance.now(),{sendsize:r,drop:a,size:i,time:n}=this.presamples,o=t-n,s=this.sendsize-r,d=this.dropsize-a,l=e-i;if(o>150&&s>5e3){const r=100*d/s,a=8e3*(s-d-l)/(o*(this.presamples.nosendcount+1)),i=8e3*s/o,n=8e3*(e+d+Math.max(l/2,0)),c=0==a?5e3:n/a;if(0==a?this.presamples.nosendcount++:(this.presamples.nosendcount=0,this.presamples.dckbps=a),0==this.presamples.smoothsend)this.presamples.smoothsend=i;else{const e=.5;this.presamples.smoothsend=e*this.presamples.smoothsend+i*(1-e)}r>10&&e>16384||o<500&&c>500?0==this.overusetime?this.overusetime=Math.min(250,o)/2:this.overusetime+=Math.min(250,o):e<16384&&c<100&&(this.overusetime=0);const u=a||this.presamples.dckbps/(this.presamples.nosendcount+1),h=u/this.presamples.smoothsend;if(this.overusetime>700&&h<.75&&t>this.presamples.updatetime+3e3){const e={status:1,dckbps:u,sendkbps:this.presamples.smoothsend,overusetime:this.overusetime,nosendcount:this.presamples.nosendcount};this.wraper._onbadnet(e),this.presamples.updatetime=t}this.presamples.sendsize=this.sendsize,this.presamples.drop=this.dropsize,this.presamples.size=e,this.presamples.time=t}}start(){this.id||(this.presamples.time=performance.now(),this.id=setInterval((()=>{let e=this.channel.bufferedAmount;this.setbuffer(e)}),100))}stop(){this.id&&(clearInterval(this.id),this.id=0)}}class Ia{constructor(e,t,r,a,i,n){this.id=e,this.tag=i||"",this.type=t,this.datachannel=r,this._recv_statistic=null,this.onmessageFn=()=>{},this.disconnectedFn=null,this.connectedFn=null,this._status=Ia.UNINIT,this.target_thread=a,this.transfered=!1,this._listener=null,this.transportlists=[],this._send_statistic=null,this.report_monitor_func=()=>{},this.bsuppend=!1,this.mgr=n,this.bufferIncreaseCount=0,this.lastBufferedAmount=0,this.highWaterMarkCount=0,this.sendcount=0,this.sendStatic=null,this.enableSendStatic=!1,this.onnetbadFn=e=>{}}isReady(){return this._status===Ia.CONNECTED}isTransfered(){return!!this.transfered}send(e){if(this.enableSendStatic){if(this.sendcount++,this.sendStatic.send(e.length),this.datachannel.bufferedAmount>65536)return void this.sendStatic.drop(e.length);if(this.datachannel.bufferedAmount>32768&&(this.sendcount%5==0||21==e[4]&&1==e[1]&&51==e[13]))return void this.sendStatic.drop(e.length)}this.datachannel.send(e),this._send_statistic.sample(!1)}open(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.target_thread)try{var t;return this.target_thread.postMessage({command:134,id:this.id,type:this.type,channel:this.datachannel,transportlists:this.transportlists,tag:this.tag},[this.datachannel]),this.transfered=!0,this.datachannel=null,void(null===(t=this.mgr)||void 0===t||t.addRTCChannel(this))}catch(e){this.target_thread=null}this._addEventListener(e)}close(){var e;null===(e=this.mgr)||void 0===e||e.removeRTCChannel(this);let t=this.disconnectedFn;this.transfered&&this.target_thread&&this.target_thread.postMessage({command:135,id:this.id,type:this.type}),this._status!=Ia.DISCONNECT&&this._clear(),this._status=Ia.DISCONNECT,null==t||t()}onmessage(e){this.onmessageFn=e}onopen(e){this.connectedFn=e}onclose(e){this.disconnectedFn=e}onerror(e){this.errorFn=e}onbadnet(e){this.onnetbadFn=e||(e=>{})}_onbadnet(e){this.onnetbadFn(e)}_addEventListener(e){this.datachannel.onmessage=e?this._onmessage2.bind(this):this._onmessage.bind(this),this.datachannel.onopen=this._onopen.bind(this),this.datachannel.onclose=this._onclose.bind(this),this.datachannel.onclosing=this._onclose.bind(this),this.datachannel.onerror=this._onerror.bind(this),"open"==this.datachannel.readyState&&this._status==Ia.UNINIT&&this._onopen()}_onmessage2(e){this._status==Ia.UNINIT&&this._onopen(),this._recv_statistic.sample(!1),this.onmessageFn(e)}_onmessage(e){this._recv_statistic.sample(!1),this.onmessageFn(e)}_onopen(e){let t=this._status;if(this._status=Ia.CONNECTED,!this.transfered){const e=this.report_monitor_func;if(!this._send_statistic){const t=this.tag?this.tag+"_SEND":3==this.type?"VDCS":"ADCS";this._send_statistic=new Fa({tag:t,report_call:e})}if(!this._recv_statistic){const t=this.tag?this.tag+"_RECV":3==this.type?"VDCR":"ADCR";this._recv_statistic=new Fa({tag:t,report_call:e})}this._send_statistic.start(),this._recv_statistic.start(),this.enableSendStatic=3==this.type,this.sendStatic=new Pa(this,this.datachannel),this.enableSendStatic&&this.sendStatic.start()}var r;t!=Ia.CONNECTED&&(null===(r=this.connectedFn)||void 0===r||r.call(this))}_onerror(e){var t;null===(t=this.errorFn)||void 0===t||t.call(this,e),this._onclose(e)}_onclose(e){let t=this._status;this._status=Ia.DISCONNECT;let r=this.disconnectedFn;this._clear(),t!=Ia.DISCONNECT&&(null==r||r())}_clear(){var e,t,r;!this.transfered&&this.datachannel&&(this.datachannel.onmessage=null,this.datachannel.onopen=null,this.datachannel.onclose=null,this.datachannel.onclosing=null,this.datachannel.onerror=null),this.onmessageFn=null,this.connectedFn=null,this.disconnectedFn=null,this.errorFn=null;let a=this.datachannel;this.datachannel=null,null===(e=this._send_statistic)||void 0===e||e.stop(),null===(t=this._recv_statistic)||void 0===t||t.stop(),null===(r=this.sendStatic)||void 0===r||r.stop(),null==a||a.close()}mesagelistener(e){let t=e.data;if(t&&t.id==this.id)switch(t.cmd){case 126:this._onclose();break;case 124:this._onopen();break;case 125:this._onerror(t.ev);break;case _:this.report_monitor_func(t.tag,t.data)}}}d(Ia,"UNINIT",0),d(Ia,"CONNECTED",1),d(Ia,"DISCONNECT",2);class Oa{static getStorageForCapacity(){return new SharedArrayBuffer(8+((arguments.length>0&&void 0!==arguments[0]?arguments[0]:80)+1)*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:1500))}constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1500,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:e.byteLength,o=arguments.length>6?arguments[6]:void 0;this.offset=i,this._BYTES_PER_ELEMENT=t,this.capacity=(n-8)/t,this.usableCapacity=this.capacity-1,this.buf=e,this.write_ptr=new Uint32Array(this.buf,i,1),this.read_ptr=new Uint32Array(this.buf,i+4,1),this.storageUint8sByteOffset=i+8,this.storageUint8s=new Uint8Array(this.buf,this.storageUint8sByteOffset,n-8),this.byteLength=n,this.label=r,this.usingOneElementBuffer=a,o&&(this.wasmMemory=o),a&&(this.oneElementBuffer=new ArrayBuffer(t)),this.repushhander=0,this.repushlogcount=0,this.monitorpace=0}checkBuffer(){this.wasmMemory&&this.wasmMemory.buffer!=this.buf&&(this.buf=this.wasmMemory.buffer,this.storageUint8s=new Uint8Array(this.buf,this.storageUint8sByteOffset,this.byteLength-8))}enqueue(e){return this.available_write()>0&&this.push(e),{rd:Atomics.load(this.read_ptr,0),wr:Atomics.load(this.write_ptr,0)}}enqueueSafe(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;for(this.dataBuffer||(this.dataBuffer=new Xe);this.dataBuffer.getLength()>0&&this.available_write()>0;){let e=this.dataBuffer.dequeue();e&&this.push(e)}let a=this.dataBuffer.getLength();if(e){if(this.available_write()>0&&0==a)return this.push(e),!0;if(!t)return!1;this.dataBuffer.enqueue(e),++a}if(a>0&&!this.repushhander&&(this.repushhander=setTimeout((()=>{this.repushlogcount%10==0&&console.warn("<<< retry consume cache data"),this.repushlogcount++,this.repushhander=0,this.enqueueSafe(null)}),30)),a>=1e3&&(Q.warn("Cached data in SAB reached critical value, will be cleared"),this.dataBuffer.clear(),r&&r("vqslclear")),a>0&&r){let e=performance.now();(!this.monitorpace||e-this.monitorpace>2e4)&&(this.monitorpace=e,r&&r("vqsl"+a))}return!0}push(e){return e instanceof Array?this._pushArray(e):this._push(e)}_pushArray(e){var t=Atomics.load(this.write_ptr,0);this.checkBuffer();let r=0;e.forEach((e=>{this.storageUint8s.set(e,t*this._BYTES_PER_ELEMENT+8+4+r),r+=e.byteLength})),new Uint32Array(this.buf,this.offset+t*this._BYTES_PER_ELEMENT+8,1)[0]=r;let a=(t+1)%this.capacity;return Atomics.store(this.write_ptr,0,a),!0}_push(e){var t=Atomics.load(this.write_ptr,0);this.checkBuffer(),this.storageUint8s.set(e,t*this._BYTES_PER_ELEMENT+8+4,e.byteLength),new Uint32Array(this.buf,this.offset+t*this._BYTES_PER_ELEMENT+8,1)[0]=e.byteLength;let r=(t+1)%this.capacity;return Atomics.store(this.write_ptr,0,r),!0}addReadPtr(){var e=Atomics.load(this.read_ptr,0);Atomics.store(this.read_ptr,0,(e+1)%this.capacity)}dequeue(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];var t=Atomics.load(this.read_ptr,0);this.checkBuffer();let r,a,i,n=new Uint32Array(this.buf,this.offset+t*this._BYTES_PER_ELEMENT+8,1);if(e){r=this.oneElementBuffer?new Uint8Array(this.oneElementBuffer,0,n[0]):new Uint8Array(n[0]);let e=new Uint8Array(this.storageUint8s.buffer,t*this._BYTES_PER_ELEMENT+8+4+this.storageUint8sByteOffset,r.byteLength);r.set(e,0)}else r=this.storageUint8s.subarray(t*this._BYTES_PER_ELEMENT+8+4,t*this._BYTES_PER_ELEMENT+8+4+n[0]),a=t*this._BYTES_PER_ELEMENT+8+4+this.storageUint8sByteOffset,i=t*this._BYTES_PER_ELEMENT+8+4+n[0]+this.storageUint8sByteOffset;return e&&Atomics.store(this.read_ptr,0,(t+1)%this.capacity),e?r:{bCopyData:e,uint8s:r,begin:a,end:i}}available_read(){var e=Atomics.load(this.read_ptr,0),t=Atomics.load(this.write_ptr,0);return this._available_read(e,t)}available_write(){var e=Atomics.load(this.read_ptr,0),t=Atomics.load(this.write_ptr,0);return this._available_write(e,t)}is_available_write(){var e=Atomics.load(this.read_ptr,0),t=Atomics.load(this.write_ptr,0);return this._is_available_write(e,t)}_available_read(e,t){return(t+this.capacity-e)%this.capacity}_available_write(e,t){return this.usableCapacity-this._available_read(e,t)}_is_available_write(e,t){return this._available_write(e,t)>0}_storage_capacity(){return this.capacity}}class Da{constructor(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:50,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:80;if(!(e instanceof Oa))throw new Error("RingBuffer required");this.rb=e,this.dataCallback=t,this.interval=null,this.requestID=null,this.timeout_call=r,this.tick_lasted_time=0,this.timeoutMS=a,this.maxCount=i}setDataCallback(e){this.dataCallback=e}consume(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.interval||(this.bCopyData=t,this.interval=setInterval((()=>{let e=performance.now();if(this.timeout_call){if(0!=this.tick_lasted_time){let t=e-this.tick_lasted_time;t>=this.timeoutMS&&this.timeout_call(t,e)}this.tick_lasted_time=e}this._dequeue()}),e))}consumeAll(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.bCopyData=e,this._dequeue()}_dequeue(){let e=Math.min(this.rb.available_read(),this.maxCount);for(this.consoume_count=0;this.consoume_count<e;){this.consoume_count++;let e=this.rb.dequeue(this.bCopyData);this.dataCallback(e),this.bCopyData||this.rb.addReadPtr()}}_consumeForAnimationFrame(){this._dequeue(),this.requestID=requestAnimationFrame(this._consumeForAnimationFrame.bind(this))}consumeUsingRequestAnimationFrame(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.requestID||(this.bCopyData=e,this._consumeForAnimationFrame())}cancelConsume(){console.log("cancelConsume interval ".concat(this.interval," requestID ").concat(this.requestID)),this.tick_lasted_time=0,clearInterval(this.interval),this.requestID&&cancelAnimationFrame(this.requestID),this.interval=null,this.requestID=null}}function La(e,t,r){if(!e)return;let a=Ha.dataTransportMgr;a.type===Wa.THREAD_MAIN?(a.setSabBuffer(e,t,r),e.remote.postMessage({cmd:I,transportId:e.id,sender:r,reciver:t})):(e.setSabBuffer(t,r),a.mainThread.postMessage({cmd:I,transportId:e.id,sender:r,reciver:t}))}class Wa{constructor(e){let t=e||{};this.type=t.type||Wa.THREAD_MAIN,this.refs={},this.transportlists=[],this.mainThread=t.remote,this.subthreadlistner=null,this.transportListeners=[],this.onRemoteTransportFn=()=>{}}_onrecvmainthreadlistener(e){let{cmd:t,transportId:r,data:a}=e.data,i=this.transportlists.find((e=>e.id===r));if(i||t==P)switch(t){case P:this.addRemoteTransport(e.data,null);break;case 136:i.setMsgPort(a||new ja);break;case I:i.setSabBuffer(e.data.sender,e.data.reciver);break;case 132:i.remote=null,this.removeTransport(i)}}_onrecvsubthreadlistener(e,t){let{cmd:r,transportId:a}=t.data,i=this.transportlists.find((e=>e.id===a));switch(r){case P:this.addRemoteTransport(t.data,e);break;case I:this.setSabBufferInfo(i,t.data.sender,t.data.reciver);break;case 132:i.remote==e&&(i.remote=null),this.removeTransport(i)}}createTransport(e){this.transportlists.push(e),setTimeout((()=>{this.transportListeners.forEach((t=>{t.TransportListChange(e,!0)}))}),0)}transportIsExit(e){return-1!=this.transportlists.indexOf(e)}closeTransport(e){let t=this.transportlists.indexOf(e);return-1!=t&&(this.transportlists.splice(t,1),setTimeout((()=>{this.transportListeners.forEach((t=>{t.TransportListChange(e,!1)}))}),0),!0)}createRemoteTransportRPC(e,t){let r={cmd:P,transportType:e.type,transportId:e.id};e.portInfo?(r.port=e.portInfo,t.postMessage(r,[e.portInfo])):t.postMessage(r)}closeRemoteTransportRPC(e,t){t.postMessage({cmd:132,transportType:e.type,transportId:e.id})}setRemoteTransportSABBUfferRPC(e,t){var r,a,i,n;(null!==(r=e.sabInfo)&&void 0!==r&&r.sender||null!==(a=e.sabInfo)&&void 0!==a&&a.reciver)&&t.postMessage({cmd:I,transportId:e.id,sender:null===(i=e.sabInfo)||void 0===i?void 0:i.sender,reciver:null===(n=e.sabInfo)||void 0===n?void 0:n.reciver})}addRemoteTransport(e,t){let{transportId:r,port:a,transportType:i}=e,n=this.createMsgSocketTransport(i,r);var o;n.id=r,n.remote=t,n.portInfo=a,a?n.setMsgPort(n.portInfo):this.bindMessageChannel(n),a&&(null===(o=this.onRemoteTransportFn)||void 0===o||o.call(this,n))}removeTransport(e){-1!=this.transportlists.indexOf(e)&&(this.closeTransport(e),e.close(),e.remote&&this.closeRemoteTransportRPC(e,e.remote),this.closeTransportForTargetThread(e))}createMsgSocketTransport(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=null;return r=new Ha({mgr:this,sock:new Va,type:e,local:!0,id:t}),r}bindMessageChannel(e){if(this.type!=Wa.THREAD_MAIN)return void console.error("error this call only in main thread");let t=new MessageChannel;e.portInfo=t.port1,e.remote.postMessage({cmd:136,transportId:e.id,data:t.port2},[t.port2])}setSabBufferInfo(e,t,r){this.type==Wa.THREAD_MAIN&&(e.sabInfo||(e.sabInfo={}),r&&(r.useCopy=!0),t&&(t.useCopy=!0),e.sabInfo={sender:t,reciver:r},0!=e.target_thread&&(1!=e.target_thread?this.setRemoteTransportSABBUfferRPC(e,e.target_thread):e.setSabBuffer(t,r)))}removeTransportByRemote(e){let t=[];for(let r=0;r<this.transportlists.length;r++){let a=this.transportlists[r];a.remote===e&&t.push(a)}for(let e=0;e<t.length;e++)this.removeTransport(t[e])}reinit(){let e=[...this.transportlists];for(let t=0;t<e.length;t++)this.removeTransport(e[t])}getTransportByType(e){for(let t in this.transportlists){let r=this.transportlists[t],a=1==r.target_thread;if(r.type==e&&a)return r}return null}addTransportListChangeListener(e){-1==this.transportListeners.indexOf(e)&&this.transportListeners.push(e)}remoteTransportListChangeListener(e){let t=this.transportListeners.indexOf(e);-1!=t&&this.transportListeners.splice(t,1)}checkTransport(e){this.transportlists.forEach((t=>{if(!e.transportlists.includes(t.type))return;let r=e.target_thread||1;this.addTransportForTargetThread(t,r)}))}checkTransportForThread(){setTimeout((()=>{this.transportlists.forEach((e=>{this.transportListeners.forEach((t=>{t.TransportListChange(e,!0)}))}))}),0)}addTransportForTargetThread(e,t){const r=t;var a,i,n,o;e.target_thread!=r&&0!=r&&(this.type==Wa.THREAD_MAIN&&0!=e.target_thread&&e.target_thread!=r&&(this.closeTransportForTargetThread(e),this.bindMessageChannel(e)),e.target_thread=r,1!=r?(this.createRemoteTransportRPC(e,r),this.setRemoteTransportSABBUfferRPC(e,r)):(e.portInfo&&e.setMsgPort(e.portInfo),(null!==(a=e.sabInfo)&&void 0!==a&&a.sender||null!==(i=e.sabInfo)&&void 0!==i&&i.reciver)&&e.setSabBuffer(null===(n=e.sabInfo)||void 0===n?void 0:n.sender,null===(o=e.sabInfo)||void 0===o?void 0:o.reciver)))}closeTransportForTargetThread(e){0!=e.target_thread&&1!=e.target_thread&&this.type==Wa.THREAD_MAIN&&this.closeRemoteTransportRPC(e,e.target_thread),e.target_thread=0}}d(Wa,"THREAD_MAIN",1),d(Wa,"THREAD_SUB",2);const Na={AUDIO_ENCODE:4,AUDIO_DECODE:5,MAUDIO_DECODE:7,SHARE_ENCODE:8,SHARE_DECODE:9,MSHARE_DECODE:11,VIDEO_ENCODE:12,VIDEO_DECODE:13,AUDIO_NETRTC:64,VIDEO_NETRTC:128,MESH_NETRTC:256,CUSTOME_TYPE:1<<31,MESHBRIDGEAUDIO:1<<31|1,MESHBRIDGE:1<<31|2},Ua=e=>{};class Ba{constructor(){this.onmessage=Ua,this.status=Ba.CLOSED,this.onopen=Ua,this.onclose=Ua,this.onwer=null}send(e){}delete(){this.onmessage=Ua,this.onopen=Ua,this.onclose=Ua,this.close()}sendVideo(e,t){}sendWasm(e){}sendCommand(e){}open(){this.status=Ba.OPEN,this.onopen()}close(){this.status=Ba.CLOSED,this.onclose()}isReady(){return!1}}d(Ba,"OPEN",1),d(Ba,"CLOSED",2);class Va extends Ba{constructor(){super({}),this.sab={},this.port=null,this.onmessage=Ua,this.sender=Ua,this.videoSender=Ua,this.reciver=Ua,this.wasmSender=Ua,this.oncommand=e=>{}}sendCommand(e){var t;null===(t=this.port)||void 0===t||t.postMessage({cmd:130,data:e})}send(e){this.sender(e)}sendVideo(e,t){this.videoSender(e,t)}sendWasm(e){this.wasmSender(e)}delete(){try{var e,t;this.onmessage=Ua,this.sender=Ua,this.videoSender=Ua,this.reciver=Ua,this.wasmSender=Ua;let{consumer:r}=(null===(e=this.sab)||void 0===e?void 0:e.reciver)||{};null==r||r.setDataCallback(Ua),null==r||r.cancelConsume(),this.sab={},this.port&&(this.port.onmessage=Ua),null===(t=this.port)||void 0===t||t.close()}catch(e){}}open(){this.status!=Ba.OPEN||this.onopen()}close(){this.status=Ba.CLOSED,this.delete(),this.onclose()}_onmessage(e){let{cmd:t,data:r}=e.data;switch(t){case F:this.reciver();break;case C:this.onmessage(r,0);break;case 129:this.status=r,this.status==Ba.OPEN?this.onopen():this.onclose();break;case 130:this.oncommand(r)}}createSendAndReceive(){if(!this.port)return;let{sender:e,reciver:t}=this.sab,{sabqueue:r,interval:a}=e||{};r?a?(this.sender=e=>{r.enqueue(e)},this.wasmSender=e=>{r.enqueue(e)},this.videoSender=(e,t)=>{if(!r.enqueueSafe([e,t],!1)){let a=new Uint8Array(t.length+e.length);a.set(e,0),a.set(t,e.length),r.enqueueSafe(a)}}):(this.sender=e=>{r.enqueue(e),this.port.postMessage({cmd:F})},this.wasmSender=e=>{r.enqueue(e),this.port.postMessage({cmd:F})},this.videoSender=(e,t)=>{if(!r.enqueueSafe([e,t],!1)){let a=new Uint8Array(t.length+e.length);a.set(e,0),a.set(t,e.length),r.enqueueSafe(a)}this.port.postMessage({cmd:F})}):(this.sender=e=>{this.port.postMessage({cmd:C,data:e},[e.buffer])},this.wasmSender=e=>{let t=new Uint8Array(e.length);t.set(e,0),this.port.postMessage({cmd:C,data:t},[t.buffer])},this.videoSender=(e,t)=>{let r=new Uint8Array(t.length+e.length);r.set(e,0),r.set(t,e.length),this.port.postMessage({cmd:C,data:r},[r.buffer])});let{sabqueue:i,consumer:n,useCopy:o,interval:s,offset:d}=t||{};if(n&&(n.cancelConsume(),n=null),i){const e=o?e=>{this.onmessage(e,0)}:d?e=>{this.onmessage(e.uint8s,e.begin)}:e=>{this.onmessage(e.uint8s,0)};let r=null,a=Ha.dataTransportMgr.monitorlogfn;if(s&&a){var l;let e=new Gt({tag:"WCL_M,VDRB"+(null===(l=this.onwer)||void 0===l?void 0:l.type),interval:1e4,reportcallback:za});r=e.timeoutReport.bind(e)}n=new Da(i,e,r),t.consumer=n,s?n.consume(s,o):this.reciver=()=>{n.consumeAll(o)}}}setMsgPort(e){e!=this.port&&(this.port&&(this.port.onmessage=Ua,this.port.close(),this.port=null),this.port=e,this.port&&(this._listeners||(this._listeners=this._onmessage.bind(this)),this.port.onmessage=this._listeners,this.createSendAndReceive()))}setSabBuffer(e,t){if(null!=e&&e.sab){let{sab:t,useCopy:r,interval:a,offset:i,length:n,useOneElement:o}=e,s=new Oa(i>0?t.buffer:t,void 0,void 0,!!o,i,n,i>0?t:null);this.sab.sender={sabqueue:s,interval:a,useCopy:r,offset:i}}if(null!=t&&t.sab){var r;let{sab:e,useCopy:a,interval:i,offset:n,length:o,useOneElement:s}=t,d=new Oa(n>0?e.buffer:e,void 0,void 0,!!s,n,o,n>0?e:null),{consumer:l}=(null===(r=this.sab)||void 0===r?void 0:r.reciver)||{};l&&(l.cancelConsume(),this.sab.reciver.consumer=null,this.sab.reciver.sabqueue=null),this.sab.reciver={sabqueue:d,interval:i,useCopy:a,offset:n}}this.createSendAndReceive()}setStatus(e){this.port?this.status!=e&&(this.status=e,this.port.postMessage({cmd:129,data:e})):console.error("MsgQueueSocket not initialized")}}class Ga{constructor(){}TransportListChange(e,t){}}class Ha{constructor(e){this.onmessage=Ua,this.onopen=Ua,this.onclose=Ua,this.oncommand=Ua,this.type=e.type,this.id=e.id||Math.floor(performance.now())<<10|e.type,this.sock=e.sock||new Ba,this.mgr=e.mgr,this.sock.onmessage=this._onmessage.bind(this),this.sock.onclose=this._onclose.bind(this),this.sock.onopen=this._onopen.bind(this),this.sock.oncommand=this._oncommand.bind(this),this.sock.onwer=this,this.remote=e.remote,this.sabInfo=null,this.portInfo=null,this.target_thread=0,this.local=!!e.local,this.args=e.args,this._create()}_create(){let e=Ha.dataTransportMgr;e.createTransport(this),!this.local&&e&&e.mainThread&&e.type==Wa.THREAD_SUB&&e.createRemoteTransportRPC(this,e.mainThread)}_close(){let e=Ha.dataTransportMgr;const t=e.transportIsExit(this);!this.local&&t&&e.type==Wa.THREAD_SUB&&e.closeRemoteTransportRPC(this,e.mainThread),t&&e.closeTransport(this)}_oncommand(e){this.oncommand(e)}_onmessage(e,t){this.onmessage(e,t)}_onclose(){this.onclose()}_onopen(){this.onopen()}isReady(){return!0}send(e){this.sock.send(e)}sendCommand(e){this.sock.sendCommand(e)}sendVideo(e,t){this.sock.sendVideo(e,t)}sendWasmData(e){this.sock.sendWasm(e)}setSocket(e){let t=this.sock;this.sock=e,this.sock&&(this.sock.onwer=this,this.sock.onmessage=this._onmessage.bind(this),this.sock.onclose=this._onclose.bind(this),this.sock.onopen=this._onopen.bind(this)),t&&t.delete()}open(){this.sock.open()}close(){this._close(),this.sock.close()}setMsgPort(e){if(!(this.sock instanceof Va))throw new Error("tansport sock is not a MsgQueueSocket");this.sock.setMsgPort(e)}setSabBuffer(e,t){if(!(this.sock instanceof Va))throw new Error("tansport sock is not a MsgQueueSocket");this.sock.setSabBuffer(e,t)}setStatus(e){this.sock instanceof Va&&this.sock.setStatus(e)}}d(Ha,"UDP",0),d(Ha,"TCP",1),d(Ha,"RLB_UDP",2),d(Ha,"dataTransportMgr",null);class ja{constructor(e){this.sock=null,this.onmessage=Ua}isReady(){return!1}send(){}sendVideo(){}sendCommand(){}setStatus(e){}}function za(e,t,r,a){var i;null===(i=Wa.monitorlogfn)||void 0===i||i.call(Wa,e,"".concat(t,",").concat(r,",").concat(a))}class $a extends Ga{constructor(){super()}TransportListChange(e,t){}TransportStatus(e,t,r){}DataChannelStatus(e,t){}}class qa extends Ga{constructor(e){super(),this.transportMap={},this.type=e.type,this.mgr=e,this.channellists=[],this.channelListeners=[]}addDataChannel(e){if(e instanceof Ia){if(-1==this.channellists.findIndex((t=>t==e))){this.channellists.push(e);try{this.mgr.checkTransport(e)}catch(e){console.error("addDataChannel error",e)}this.channelListeners.forEach((t=>{t.DataChannelStatus(e,!0)}))}}else console.error("channel must be a DataChannelWrapper")}TransportListChange(e,t){let r=this.getChannelByTransportType(e.type);if(t&&null!=r&&r.isReady()){let t=r.target_thread||1;this.mgr.addTransportForTargetThread(e,t)}t||this.mgr.closeTransportForTargetThread(e),r&&this.channelListeners.forEach((a=>{a.TransportStatus(e,r,t)})),this.channelListeners.forEach((r=>{r.TransportListChange(e,t)}))}removeDataChannel(e){if(!(e instanceof Ia))return void console.error("channel must be a DataChannelWrapper");let t=this.channellists.indexOf(e);-1!==t&&this.channellists.splice(t,1),this.channelListeners.forEach((t=>{t.DataChannelStatus(e,!1)}))}addMediaChannelController(e){e instanceof $a?-1==this.channelListeners.findIndex((t=>t==e))&&this.channelListeners.push(e):console.error("controller must be a MediaChannelController")}rmMediaChannelController(e){let t=this.channelListeners.findIndex((t=>t==e));-1!=t&&this.channelListeners.splice(t,1)}getChannelByTransportType(e){for(let t=0;t<this.channellists.length;t++){let r=this.channellists[t];if(r.isReady()&&r.transportlists.includes(e))return r}return null}reinit(){let e=this.channellists;this.channellists=[],e.forEach((e=>{e.isReady()&&(e.close(),this.channelListeners.forEach((t=>{t.DataChannelStatus(e,!1)})))}))}}d(qa,"target",null);class Ya{constructor(){this._interval=-1,this.monitorworkers={},this.timeoutcallbackfn=(e,t)=>{}}setTimeoutCallback(e){this.timeoutcallbackfn=e}registerWorker(e,t){if(e in this.monitorworkers){let t=this.monitorworkers[e];t.worker.removeEventListener("message",t.listener),delete this.monitorworkers[e]}let r={id:e,worker:t},a=this._recvheartbeat.bind(this,r);r.listener=a,r.lastedtimestamp=Date.now(),r.timeoutcount=0,r.worker.addEventListener("message",r.listener),this.monitorworkers[e]=r}unRegisterWorker(e){if(!(e in this.monitorworkers))return;let t=this.monitorworkers[e];delete this.monitorworkers[e],t.worker.removeEventListener("message",t.listener)}_recvheartbeat(e,t){let r=t.data;137===r.cmd&&(e.lastedtimestamp=r.timestamp,e.timeoutcount=0)}start(e){const t="undefined"!=typeof DedicatedWorkerGlobalScope&&e&&e instanceof DedicatedWorkerGlobalScope;if(-1!=this._interval)return;if(t)return void(this._interval=setInterval((()=>{e.postMessage({cmd:137,timestamp:Date.now()})}),Ya.INTREVAL_TIME_MS));const r=()=>{this._interval=setTimeout((()=>{r();let e=Ya.instance,t=Object.keys(e.monitorworkers),a=Date.now();t.forEach((t=>{let r=e.monitorworkers[t];r.timeoutcount>5?a-r.lastedtimestamp>Ya.HEART_TIMEOUT_MS&&(e.timeoutcallbackfn(r.id,a-r.lastedtimestamp),r.lastedtimestamp=a):(r.timeoutcount++,r.worker.postMessage({command:138}))}))}),Ya.INTREVAL_TIME_MS)};r()}close(){try{this._interval&&clearTimeout(this._interval),this._interval=-1,Object.keys(this.monitorworkers).forEach((e=>{let t=this.monitorworkers[e];delete this.monitorworkers[e],t.worker.removeEventListener("message",t.listener)}))}catch(e){}}}var Qa,Ka,Xa,Za;d(Ya,"INTREVAL_TIME_MS",3e3),d(Ya,"HEART_TIMEOUT_MS",15e3),d(Ya,"MAX_HEART_TIMEOUT_MS",3e4),d(Ya,"instance",null),function(e){e.ADD_VIDEO_PORT="add_video_port",e.ADD_SHADOW_PORT="add_shadow_port",e.ADD_VIDEO_PROCESSOR="add_video_processor",e.PROCESSOR_READY="processor_ready",e.PROCESSOR_ERROR="processor_error"}(Qa||(Qa={})),function(e){e.ADD_SHARE_PORT="add_share_port",e.ADD_SHADOW_PORT="add_shadow_port",e.ADD_SHARE_PROCESSOR="add_share_processor",e.ADD_SHARE_ENCODE_PORT="add_share_encode_port",e.PROCESSOR_READY="processor_ready",e.PROCESSOR_ERROR="processor_error"}(Ka||(Ka={})),function(e){e.INIT_PROCESSOR="init_processor",e.UNINIT_PROCESSOR="uninit_processor",e.INIT_OUTPUT_CANVAS="init_output_canvas",e.OUTPUT_WRITABLE_STREAM="output_writable_stream",e.INPUT_READABLE_STREAM="input_readable_stream",e.FRAME_DATA="frame_data",e.START_REQUEST_FRAME="start_request_frame",e.STOP_REQUEST_FRAME="stop_request_frame",e.REQUEST_FRAME="request_frame",e.FRAME_CALLBACK="frame_callback",e.RESOLUTION_CHANGE="RESOLUTION_CHANGE",e.PROCESSOR_WORKER_ERROR="PROCESSOR_WORKER_ERROR",e.PROCESSOR_STOP_COMPLETE="PROCESSOR_STOP_COMPLETE"}(Xa||(Xa={})),Za||(Za={});class Ja{constructor(e,t,r){this.port=e,this.name=t,this.VideoFrameNeeded=r}setStream(e){const t=e.getVideoTracks()[0],r=t.getSettings(),{frameRate:a=24}=r;this.trackProcessor=new MediaStreamTrackProcessor({track:t});const i=this.trackProcessor.readable;this.port.postMessage({cmd:Xa.INPUT_READABLE_STREAM,frameRate:Math.min(a,24),readableStream:i,processorName:this.name},[i]),this.port.postMessage({cmd:Xa.START_REQUEST_FRAME,frameRate:a,processorName:this.name,VideoFrameNeeded:this.VideoFrameNeeded})}removeStream(){this.port.postMessage({cmd:Xa.STOP_REQUEST_FRAME,processorName:this.name})}destroy(){this.removeStream()}}class ei{constructor(e,t,r=!1,a=!1){this.port=e,this.name=t,this.isIOSDevice=r,this.VideoFrameNeeded=a,this.onMessage=e=>{if(e.data.cmd===Xa.REQUEST_FRAME&&this.captureVideoEleLoaded){let e=this.captureVideoEle.videoWidth,t=this.captureVideoEle.videoHeight;if(e<=0||t<=0)return;this.isIOSDevice&&(this.captureCanvasEle.width=e,this.captureCanvasEle.height=t,this.captureCanvasEleCtx.drawImage(this.captureVideoEle,0,0,e,t));const r=new VideoFrame(this.isIOSDevice?this.captureCanvasEle:this.captureVideoEle,{timestamp:1e3*performance.now()});this.port.postMessage({cmd:Xa.FRAME_DATA,frame:r,processorName:this.name}),r.close()}},this.port.addEventListener("message",this.onMessage)}createCaptureVideoElement(e){this.captureVideoEle=document.querySelector("#video-processor-video"),this.captureVideoEle||(this.captureVideoEle=document.createElement("video"),this.captureVideoEle.autoplay=!0,this.captureVideoEle.playsInline=!0,this.captureVideoEle.id="video-processor-video",this.captureVideoEle.style.position="fixed",this.captureVideoEle.style.width="1px",this.captureVideoEle.style.height="1px",this.captureVideoEle.style.bottom="0px",this.captureVideoEle.style.right="0px",this.captureVideoEle.muted=!0,document.body.appendChild(this.captureVideoEle)),this.isIOSDevice&&!this.captureCanvasEle&&(this.captureCanvasEle=document.createElement("canvas"),this.captureCanvasEleCtx=this.captureCanvasEle.getContext("2d")),this.captureVideoEle.srcObject=e,this.captureVideoEle.addEventListener("loadedmetadata",(()=>{this.captureVideoEleLoaded=!0})),this.captureVideoEle.play()}setStream(e){const t=e.getVideoTracks()[0].getSettings(),{frameRate:r=24}=t;this.createCaptureVideoElement(e),this.port.postMessage({cmd:Xa.START_REQUEST_FRAME,frameRate:Math.min(r,24),processorName:this.name,VideoFrameNeeded:this.VideoFrameNeeded})}removeStream(){this.port.postMessage({cmd:Xa.STOP_REQUEST_FRAME,processorName:this.name})}destroy(){this.port.removeEventListener("message",this.onMessage)}}class ti{constructor(e,t,r=!1,a=!1){this.port=e,this.name=t,this.isIOSDevice=r,this.VideoFrameNeeded=a,this.onMessage=e=>{if(e.data.cmd===Xa.REQUEST_FRAME&&this.captureVideoEleLoaded){let e=this.captureVideoEle.videoWidth,t=this.captureVideoEle.videoHeight;if(e<=0||t<=0)return;this.isIOSDevice&&(this.captureCanvasEle.width=e,this.captureCanvasEle.height=t,this.captureCanvasEleCtx.drawImage(this.captureVideoEle,0,0,e,t));const r=new VideoFrame(this.isIOSDevice?this.captureCanvasEle:this.captureVideoEle,{timestamp:1e3*performance.now()});this.port.postMessage({cmd:Xa.FRAME_DATA,frame:r,processorName:this.name}),r.close()}},this.port.addEventListener("message",this.onMessage)}createCaptureVideoElement(e){this.captureVideoEle=document.querySelector("#share-processor-video"),this.captureVideoEle||(this.captureVideoEle=document.createElement("video"),this.captureVideoEle.autoplay=!0,this.captureVideoEle.playsInline=!0,this.captureVideoEle.id="share-processor-video",this.captureVideoEle.style.position="fixed",this.captureVideoEle.style.width="1px",this.captureVideoEle.style.height="1px",this.captureVideoEle.style.bottom="0px",this.captureVideoEle.style.right="0px",this.captureVideoEle.muted=!0,document.body.appendChild(this.captureVideoEle)),this.isIOSDevice&&!this.captureCanvasEle&&(this.captureCanvasEle=document.createElement("canvas"),this.captureCanvasEleCtx=this.captureCanvasEle.getContext("2d")),this.captureVideoEle.srcObject=e,this.captureVideoEle.addEventListener("loadedmetadata",(()=>{this.captureVideoEleLoaded=!0})),this.captureVideoEle.play()}setStream(e){const t=e.getVideoTracks()[0].getSettings(),{frameRate:r=24}=t;this.createCaptureVideoElement(e),this.port.postMessage({cmd:Xa.START_REQUEST_FRAME,frameRate:Math.min(r,24),processorName:this.name,VideoFrameNeeded:this.VideoFrameNeeded})}removeStream(){this.port.postMessage({cmd:Xa.STOP_REQUEST_FRAME,processorName:this.name})}destroy(){this.port.removeEventListener("message",this.onMessage)}}class ri{constructor(e,t){this.trackGenerator=new MediaStreamTrackGenerator({kind:"video"});const r=this.trackGenerator.writable;e.postMessage({cmd:Xa.OUTPUT_WRITABLE_STREAM,writableStream:r,processorName:t},[r]),this.stream=new MediaStream([this.trackGenerator])}getStream(){return this.stream}}class ai{constructor(e,t,r){this.canvas=document.createElement("canvas"),this.canvas.width=1,this.canvas.height=1,this.stream=this.canvas.captureStream(24),r?r.canCanvasAsOffscreenAfterCaptureStream?this.offScreenCanvas=this.canvas.transferControlToOffscreen():this.offScreenCanvas=null:this.offScreenCanvas=this.canvas.transferControlToOffscreen()}getOutputCanvas(){return this.offScreenCanvas}getStream(){return this.stream}getStreamingCanvas(){return this.canvas}}class ii{constructor(e,t,r=!1,a=!1){this.processorName=e,this.port=t,this.isIOSDevice=r,this.VideoFrameNeeded=a,this.frameCallback=null,this.callback=null,this.onMessage=e=>{var t,r;e.data.cmd===Xa.FRAME_CALLBACK?null===(t=this.frameCallback)||void 0===t||t.call(this,e.data.frame):null===(r=this.callback)||void 0===r||r.call(this,e.data.cmd,e.data.data)},this.port.start(),this.port.addEventListener("message",this.onMessage);const i=this.getOutPutCanvas();i?this.port.postMessage({cmd:Xa.INIT_OUTPUT_CANVAS,canvas:i,processorName:e},[i]):this.port.postMessage({cmd:Xa.INIT_OUTPUT_CANVAS,processorName:e})}init(){this.port.postMessage({cmd:Xa.INIT_PROCESSOR,processorName:this.processorName})}addCallback(e){this.callback=e}removeCallback(){this.callback=null}uninit(){this.port.postMessage({cmd:Xa.UNINIT_PROCESSOR,processorName:this.processorName}),this.port.removeEventListener("message",this.onMessage)}getOutPutCanvas(){return null}getStream(){throw new Error("Method not implemented.")}setStream(e){throw new Error("Method not implemented.")}removeStream(){}onFrame(e){throw new Error("Method not implemented.")}addFrameCallback(e){throw new Error("Method not implemented.")}removeFrameCallback(){}}class ni extends ii{constructor(e,t){super(e,t),this.processorName=e,this.port=t}onFrame(e){this.port.postMessage({cmd:Xa.FRAME_DATA,frame:e,processorName:this.processorName})}addFrameCallback(e){this.frameCallback=e}removeFrameCallback(){this.frameCallback=null}}class oi extends ii{constructor(e,t,r,a){super(e,t,r,a),this.processorName=e,this.port=t,this.isIOSDevice=r,this.VideoFrameNeeded=a,this.initGenerator()}initGenerator(){this.originGenerator||(this.originGenerator="function"==typeof MediaStreamTrackProcessor?new Ja(this.port,this.processorName,this.VideoFrameNeeded):new ei(this.port,this.processorName,this.isIOSDevice,this.VideoFrameNeeded)),this.targetGenerator||(this.targetGenerator="function"==typeof MediaStreamTrackGenerator?new ri(this.port,this.processorName):new ai(this.port,this.processorName))}uninit(){var e,t,r,a;null===(t=null===(e=this.originGenerator)||void 0===e?void 0:e.destroy)||void 0===t||t.call(e),null===(a=null===(r=this.targetGenerator)||void 0===r?void 0:r.destroy)||void 0===a||a.call(r),super.uninit()}getOutPutCanvas(){var e,t;return this.initGenerator(),null===(t=(e=this.targetGenerator).getOutputCanvas)||void 0===t?void 0:t.call(e)}getStream(){return this.targetGenerator.getStream()}setStream(e){this.originGenerator.setStream(e)}removeStream(){this.originGenerator.removeStream()}addFrameCallback(e){this.frameCallback=e}}class si{constructor(){this.status="pending",this.promise=new Promise(((e,t)=>{this.reject=e=>(this.status="rejected",t(e)),this.resolve=t=>(this.status="fullfilled",e(t))})),this.then=this.promise.then,this.catch=this.promise.catch}}var di=function(e,t,r,a){return new(r||(r=Promise))((function(i,n){function o(e){try{d(a.next(e))}catch(e){n(e)}}function s(e){try{d(a.throw(e))}catch(e){n(e)}}function d(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}d((a=a.apply(e,t||[])).next())}))};class li{constructor(e,t,r){this.processorName=e,this.port=t,this.config=r,this.frameCallback=null,this.callback=null,this._config=null,this.onMessage=e=>{var t,r,a,i;if(e.data.cmd===Xa.FRAME_CALLBACK)if(this.frameCallback)this.frameCallback(e.data.frame);else if(this instanceof ci)if(this.getOutPutCanvas())null===(r=e.data.frame)||void 0===r||r.close();else{const r=e.data.frame;if(r instanceof VideoFrame){const a=r.displayWidth,i=r.displayHeight,n=this.getTargetGenerator();if(n instanceof ai){const e=n.getStreamingCanvas();e.width!==a&&(e.width=a),e.height!==i&&(e.height=i);const t=e.getContext("2d");if(!t)return console.error("cannot get canvas context!"),void r.close();createImageBitmap(r).then((e=>{t.clearRect(0,0,a,i),t.drawImage(e,0,0,a,i),e.close(),r.close()})).catch((e=>{console.error("failed in rendering frame! e:",e),r.close()}))}else null===(t=e.data.frame)||void 0===t||t.close()}}else null===(a=e.data.frame)||void 0===a||a.close();else e.data.cmd===Xa.PROCESSOR_STOP_COMPLETE?this instanceof ci&&this.resolveEndCompleteDeferred():null===(i=this.callback)||void 0===i||i.call(this,e.data.cmd,e.data.data)},this.port.start(),this.port.addEventListener("message",this.onMessage),this._config=r;const a=this.getOutPutCanvas();a?this.port.postMessage({cmd:Xa.INIT_OUTPUT_CANVAS,canvas:a,processorName:e},[a]):this.port.postMessage({cmd:Xa.INIT_OUTPUT_CANVAS,processorName:e})}init(){this.port.postMessage({cmd:Xa.INIT_PROCESSOR,processorName:this.processorName})}addCallback(e){this.callback=e}removeCallback(){this.callback=null}uninit(){this.port.postMessage({cmd:Xa.UNINIT_PROCESSOR,processorName:this.processorName}),this.port.removeEventListener("message",this.onMessage)}getOutPutCanvas(){return null}getConfig(){return this._config}getStream(){throw new Error("Method not implemented.")}setStream(e){throw new Error("Method not implemented.")}removeStream(){return di(this,void 0,void 0,(function*(){}))}onFrame(e){throw new Error("Method not implemented.")}addFrameCallback(e){throw new Error("Method not implemented.")}removeFrameCallback(){}}class ci extends li{constructor(e,t,r){super(e,t,r),this.processorName=e,this.port=t,this.endCompleteDeferred=null,this.initGenerator()}initGenerator(){var e;const t=this.getConfig(),r=null!==(e=null==t?void 0:t.needFixedCaptureRate)&&void 0!==e?e:void 0;this.originGenerator||(this.originGenerator=!0===r?new ti(this.port,this.processorName,!1,!0):"function"==typeof MediaStreamTrackProcessor?new Ja(this.port,this.processorName,!0):new ti(this.port,this.processorName,!1,!0)),this.targetGenerator||(this.targetGenerator=!0===r?new ai(this.port,this.processorName,t):"function"==typeof MediaStreamTrackGenerator?new ri(this.port,this.processorName):new ai(this.port,this.processorName,t))}uninit(){var e,t,r,a;null===(t=null===(e=this.originGenerator)||void 0===e?void 0:e.destroy)||void 0===t||t.call(e),null===(a=null===(r=this.targetGenerator)||void 0===r?void 0:r.destroy)||void 0===a||a.call(r),super.uninit()}getOutPutCanvas(){var e,t;return this.initGenerator(),null===(t=(e=this.targetGenerator).getOutputCanvas)||void 0===t?void 0:t.call(e)}getStream(){return this.targetGenerator.getStream()}setStream(e){this.originGenerator.setStream(e)}removeStream(){return di(this,void 0,void 0,(function*(){this.originGenerator.removeStream(),this.endCompleteDeferred||(this.endCompleteDeferred=new si),yield this.endCompleteDeferred.promise}))}resolveEndCompleteDeferred(){this.endCompleteDeferred&&this.endCompleteDeferred.resolve(),this.endCompleteDeferred=null}addFrameCallback(e){this.frameCallback=e}getTargetGenerator(){return this.targetGenerator}}class ui extends li{constructor(e,t,r){super(e,t,r),this.processorName=e,this.port=t,this.config=r}onFrame(e){this.port.postMessage({cmd:Xa.FRAME_DATA,frame:e,processorName:this.processorName})}addFrameCallback(e){this.frameCallback=e}removeFrameCallback(){this.frameCallback=null}}class hi{static hasProcessor(){return this.videoProcessorAgentMap.size>0}static hasMediaStreamFrameProcessor(){return[...this.videoProcessorAgentMap.values()].some((e=>e instanceof oi))}static addFrameCallback(e,t){this.frameCallbackMap.set(e,t),this.getProcessor(e)&&this.getProcessor(e).addFrameCallback(t)}static addCallback(e,t){this.callbackMap.set(e,t),this.getProcessor(e)&&this.getProcessor(e).addCallback(t)}static onFrame(e){for(const t of this.videoProcessorAgentMap.values())t.onFrame(e)}static getStream(){return[...this.videoProcessorAgentMap.values()].pop().getStream()}static setStream(e){for(const t of this.videoProcessorAgentMap.values())t.setStream(e)}static removeStream(){for(const e of this.videoProcessorAgentMap.values())e.removeStream()}static getProcessor(e){return this.videoProcessorAgentMap.get(e)}static startProcessor(e,t){t.init();const r=this.frameCallbackMap.get(e);r&&t.addFrameCallback(r);const a=this.callbackMap.get(e);a&&t.addCallback(a),this.videoProcessorAgentMap.set(e,t)}static stopProcessor(e){const t=this.getProcessor(e);t&&(t.removeFrameCallback(),t.removeCallback(),this.frameCallbackMap.delete(e),this.callbackMap.delete(e),t.removeStream(),t.uninit()),this.videoProcessorAgentMap.delete(e)}static resetProcessorManager(){for(const e of this.videoProcessorAgentMap.keys())this.stopProcessor(e)}}hi.videoProcessorAgentMap=new Map,hi.frameCallbackMap=new Map,hi.callbackMap=new Map;var _i,pi,fi,mi,gi=function(e,t,r,a){return new(r||(r=Promise))((function(i,n){function o(e){try{d(a.next(e))}catch(e){n(e)}}function s(e){try{d(a.throw(e))}catch(e){n(e)}}function d(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}d((a=a.apply(e,t||[])).next())}))};class vi{static hasProcessor(){return this.shareProcessorAgentMap.size>0}static isProcessorStarted(e){return this.shareProcessorAgentMap.has(e)}static setProcessorOptions(e,t){this.shareProcessorOptionsMap.set(e,t)}static getProcessorOptions(e){return this.shareProcessorOptionsMap.get(e)}static hasMediaStreamFrameProcessor(){return[...this.shareProcessorAgentMap.values()].some((e=>e instanceof ci))}static addFrameCallback(e,t){this.shareFrameCallbackMap.set(e,t),this.getProcessor(e)&&this.getProcessor(e).addFrameCallback(t)}static addCallback(e,t){this.shareCallbackMap.set(e,t),this.getProcessor(e)&&this.getProcessor(e).addCallback(t)}static getProcessor(e){return this.shareProcessorAgentMap.get(e)}static onFrame(e){for(const t of this.shareProcessorAgentMap.values())t.onFrame(e)}static getStream(){return[...this.shareProcessorAgentMap.values()].pop().getStream()}static setStream(e){for(const t of this.shareProcessorAgentMap.values())t.setStream(e)}static removeStream(){return gi(this,void 0,void 0,(function*(){const e=[];for(const t of this.shareProcessorAgentMap.values())e.push(t.removeStream());yield Promise.all(e)}))}static startProcessor(e,t){t.init();const r=this.shareFrameCallbackMap.get(e);r&&t.addFrameCallback(r);const a=this.shareCallbackMap.get(e);a&&t.addCallback(a),this.shareProcessorAgentMap.set(e,t)}static stopProcessor(e){return gi(this,void 0,void 0,(function*(){const t=this.getProcessor(e);t&&(t.removeFrameCallback(),t.removeCallback(),this.shareFrameCallbackMap.delete(e),this.shareCallbackMap.delete(e),this.shareProcessorOptionsMap.delete(e),yield t.removeStream(),t.uninit()),this.shareProcessorAgentMap.delete(e)}))}static resetProcessorManager(){for(const e of this.shareFrameCallbackMap.keys())this.stopProcessor(e)}}vi.shareProcessorAgentMap=new Map,vi.shareProcessorOptionsMap=new Map,vi.shareFrameCallbackMap=new Map,vi.shareCallbackMap=new Map;class yi{constructor(e,t,r,a){var i;this.url=e,this.onopen=()=>{},this.onclose=()=>{},this.oncommand=()=>{},this.transportopened=!1,this.websockClosed=!1,this.dataTransport=(i=t,new Ha({sock:new Va,type:i,local:!1,userArgs:undefined})),this.dataTransport.onopen=this._dataTransportOpen.bind(this),this.dataTransport.onclose=this._dataTransportClose.bind(this),this.dataTransport.oncommand=this._dataTransportCommand.bind(this),this.websocketopen=!1,this.senderSab=null,this.reciverSab=null,this.webtransporturl=null,this.disabletcp=!!r,this.isLSSPlayer=!!a}_dataTransportCommand(e){let{cmd:t}=e;182!=t||this.websockClosed||(this.websocketopen=!0,this.onopen()),183==t&&this.onclose(),this.oncommand(e)}_dataTransportOpen(){this.transportopened=!0,this.disabletcp&&this.onopen();{const e=this.isLSSPlayer,t={cmd:175,data:this.disabletcp,isLSSPlayer:e};this.dataTransport.sendCommand(t)}const e={cmd:180,data:this.url};this.url&&!this.disabletcp&&this.dataTransport.sendCommand(e);const t={cmd:176,data:this.webtransporturl};this.webtransporturl&&this.dataTransport.sendCommand(t),(this.senderSab||this.reciverSab)&&La(this.dataTransport,this.senderSab,this.reciverSab)}_dataTransportClose(){this.transportopened=!1}resetURL(e){this.websockClosed=!1;let t=this.url;this.url=e;const r={cmd:180,data:this.url};this.transportopened&&this.url&&t!=this.url&&this.dataTransport.sendCommand(r)}resetWebrTransportUrl(e){let t=this.webtransporturl;this.webtransporturl=e;const r={cmd:176,data:e};this.transportopened&&this.webtransporturl&&t!=this.webtransporturl&&this.dataTransport.sendCommand(r)}closeWebsocket(){let e=this.url;this.websockClosed=!0,this.url=null;const t={cmd:181,data:this.url};this.transportopened&&e&&this.dataTransport.sendCommand(t)}closeWebTransport(){let e=this.webtransporturl;this.webtransporturl=null;const t={cmd:177,data:e};this.transportopened&&e&&this.dataTransport.sendCommand(t)}isReady(){return this.websocketopen||this.disabletcp&&this.transportopened}setOnMessage(e){this.dataTransport.onmessage=e}sendWasm(e){this.dataTransport.sendWasmData(e)}send(e){this.dataTransport.send(e)}sendVideo(e,t){this.dataTransport.sendVideo(e,t)}sendCommand(e){this.transportopened&&this.dataTransport.sendCommand(e)}close(){this.dataTransport&&(this.dataTransport.onopen=()=>{},this.dataTransport.onclose=()=>{},this.dataTransport.oncommand=()=>{},this.dataTransport.sendCommand({cmd:181}),this.dataTransport.sendCommand({cmd:177}),this.dataTransport.close())}setSabBuffer(e,t){this.senderSab=e,this.reciverSab=t,this.transportopened&&La(this.dataTransport,e,t)}sendCmdData(e){const t={cmd:198,data:new Uint8Array(e)};this.dataTransport.sendCommand(t)}}!function(e){e[e.Unknow=0]="Unknow",e[e.MediaCommand=1]="MediaCommand",e[e.P2PControl=2]="P2PControl",e[e.MeshControl=3]="MeshControl"}(_i||(_i={})),function(e){e[e.normal=0]="normal",e[e.child=1]="child",e[e.parent=2]="parent",e[e.invalid=31]="invalid"}(pi||(pi={})),function(e){e[e.bridge=0]="bridge",e[e.setRole=1]="setRole",e[e.connectTestParams=2]="connectTestParams",e[e.reportConnectedSet=3]="reportConnectedSet",e[e.notifyChildParentLeave=4]="notifyChildParentLeave",e[e.notifyParentChildLeave=5]="notifyParentChildLeave",e[e.availableParents=6]="availableParents",e[e.updateNodeStatus=7]="updateNodeStatus",e[e.joinSuccess=8]="joinSuccess",e[e.kickChild=9]="kickChild",e[e.leaveParent=10]="leaveParent",e[e.subscriptionMap=11]="subscriptionMap",e[e.channelopt=12]="channelopt",e[e.joinSuccessConfirm=13]="joinSuccessConfirm",e[e.registerMeshNode=14]="registerMeshNode",e[e.meshAllowTalk=15]="meshAllowTalk",e[e.statInfo=16]="statInfo",e[e.adapt=17]="adapt",e[e.refershConnectParams=18]="refershConnectParams",e[e.joinConnectedSetConfirm=19]="joinConnectedSetConfirm",e[e.registerMeshNodeResult=20]="registerMeshNodeResult",e[e.meshSigType=21]="meshSigType",e[e.meshSigKey=22]="meshSigKey",e[e.mediaAccess=23]="mediaAccess",e[e.unknown=1e3]="unknown"}(fi||(fi={})),function(e){e[e.Unknow=0]="Unknow",e[e.Offer=1]="Offer",e[e.Answer=2]="Answer"}(mi||(mi={}));var bi=Object.defineProperty,wi=(e,t,r)=>((e,t,r)=>t in e?bi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);const Si=new class{constructor(){wi(this,"_enabled",!1),wi(this,"_reportLog",(()=>{})),wi(this,"_cacheName",""),wi(this,"_enableLocalDebugLog",!1),wi(this,"_resourcePath","")}get enabled(){return this._enabled}set enabled(e){this._enabled=e}get reportLog(){return this._reportLog}set reportLog(e){this._reportLog=e}get cacheName(){return this._cacheName}set cacheName(e){this._cacheName=e}get enableLocalDebugLog(){return this._enableLocalDebugLog}set enableLocalDebugLog(e){this._enableLocalDebugLog=e}get resourcePath(){return this._resourcePath}set resourcePath(e){this._resourcePath=e}},Mi=(...e)=>{if(!Si.enableLocalDebugLog)return;const t=e[0];console.log(`FWB | ${t} -`,...e.slice(1))},Ei=e=>{let t=`/${e.fileName}`;e.hash&&(t=`/${e.fileName}/${e.hash}`);const r=[];return e.cdnPath&&r.push(`v=${e.cdnPath}`),e.timestamp&&r.push(`t=${e.timestamp}`),r.length>0?`${t}?${r.join("&")}`:t},Ri=()=>Si.cacheName,Ti=e=>"function"==typeof e,ki=void 0!==self.caches&&void 0!==self.Cache&&!!(Ti(self.caches.open)&&Ti(self.caches.delete)&&Ti(self.Cache.prototype.match)&&Ti(self.Cache.prototype.put)&&Ti(self.Cache.prototype.delete)&&Ti(self.Cache.prototype.keys)),xi=e=>new Promise((t=>setTimeout(t,e))),Ai=(e,t,r)=>Number.isInteger(null==r?void 0:r.maxRetries)&&(null==r?void 0:r.maxRetries)>1?(async(e,t,r)=>{let a;const i=null==r?void 0:r.maxRetries,n=(null==r?void 0:r.delayMs)??-1;for(let r=0;r<i;r++)try{const r=await self.fetch(e,t);if(!r.ok)throw new Error(`Fetch resource error: ${r.status}`);return r}catch(e){if(a=e,"AbortError"===(null==e?void 0:e.name))break;r<i-1&&n>=0&&await xi(n)}throw a})(e,t,r):self.fetch(e,t),Ci=async({cdnPath:e,fileName:t,hash:r,size:a,fetchOptions:i,fetchCustomOptions:n})=>{try{const i=await(async(e,t)=>(async e=>{const t=await caches.open(Ri()),r=new URL(e,self.location.origin),a=await t.match(r,{ignoreSearch:!0});if(!a)throw new Error("Not Found");return a})(Ei({fileName:e,hash:t})))(t,r),n=i.url||"",o=n.slice(0,n.length-t.length-1);return Mi(`/${e}/${t}`,"get file from cache"),Si.reportLog({isHitCache:!0,isCrossRelease:o!==e,fileName:t,hash:r,size:a}),i}catch{try{const o=await(async({cdnPath:e,fileName:t,hash:r,fetchOptions:a,fetchCustomOptions:i})=>{const n=`${e}/${t}`,o=await Ai(n,a,i),s=Ei({cdnPath:e,fileName:t,hash:r,timestamp:Date.now()});try{await(async(e,t)=>{try{const r=await caches.open(Ri()),a=new URL(e,self.location.origin);await r.put(a,t.clone())}catch(e){console.error("Failed to save to cache",e)}})(s,o)}catch(r){Mi(`/${e}/${t}`,"save to cache failed",r)}return o})({cdnPath:e,fileName:t,hash:r,fetchOptions:i,fetchCustomOptions:n});return Mi(`/${e}/${t}`,"get file from network"),Si.reportLog({isHitCache:!1,isCrossRelease:!1,fileName:t,hash:r,size:a,cachedVersion:""}),o}catch(r){throw Mi(`/${e}/${t}`,"get file from network - Failed"),r}}},Fi={},Pi=async(e,t)=>{Fi[e]||(Fi[e]={}),Mi(`/${e}/${t}`,"start to get manifest");let r=Fi[e].manifest;return r?(Mi(`/${e}/${t}`,"get manifest from memory"),{manifest:r}):(r=await(async(e,t)=>{const r=Fi[e];if(null==r?void 0:r.manifest)return r.manifest;const a=await(async(e,t)=>{const r=`${e}/manifest.json`,a=Fi[e];let i=null==a?void 0:a.ongoingPromise;return i?(Mi(`/${e}/${t}`,"fetchManifest","existing fetch pending"),i):(i=fetch(r,{headers:{Accept:"application/json"}}).then((async r=>{if(Mi(`/${e}/${t}`,"fetchManifest","get response",r.status),Fi[e].lastResponseStatus=r.status,!r.ok)throw r;const a=await r.json();return Fi[e].manifest=a,Mi(`/${e}/${t}`,"fetchManifest","success"),a})).finally((()=>{Fi[e].ongoingPromise=void 0})),Fi[e].ongoingPromise=i,Mi(`/${e}/${t}`,"fetchManifest","send request"),i)})(e,t);return a})(e,t),Mi(`/${e}/${t}`,"get manifest from network"),{manifest:r})},Ii=async(e,t,r)=>{const a=((e,t)=>{if(!e.startsWith(t))return null;t.endsWith("/")&&(t=t.slice(0,-1));const r=e.slice(t.length+1);return r?{cdnPath:t,fileName:r}:null})(new URL(e.toString()).href,Si.resourcePath);if(!a)return Ai(e,t,r);const{cdnPath:i,fileName:n}=a;Mi(`/${i}/${n}`,"get file request");let o=null;try{const{manifest:e}=await Pi(i,n);o=e,Mi(`/${i}/${n}`,"get manifest success")}catch{return Mi(`/${i}/${n}`,"get manifest failed => fallback to browser"),Ai(e,t,r)}const s=null==o?void 0:o[n];return(null==s?void 0:s.hash)?Ci({cdnPath:i,fileName:n,hash:s.hash,size:s.size,fetchOptions:t,fetchCustomOptions:r}):Ai(e,t,r)};let Oi;self.setTimeout((async()=>{const e=Ri(),t=await caches.open(e);let r=[];try{r=await t.keys()}catch{return}const a=new Map;for(const e of r){const t=new URL(e.url),r=t.searchParams.get("t");if(!r)continue;const i=parseInt(r,10);if(isNaN(i))continue;const n=t.pathname.split("/").slice(0,-1).join("/");n&&(a.has(n)||a.set(n,[]),a.get(n).push({request:e,timestamp:i}))}for(const[e,r]of a){if(r.sort(((e,t)=>t.timestamp-e.timestamp)),r.length<=1)continue;let e=r.slice(2);r[0].timestamp-r[1].timestamp>5184e6&&(e=r.slice(1));for(const r of e){try{await t.delete(r.request)}catch{continue}Mi(`delete from cache: ${r.request.url}`)}}}),6e4);const Di=(e,t)=>Oi&&"function"==typeof Oi?Oi(e,t):(console.log("initializeFetchWithCache not initialized: ",e),fetch(e,t));var Li=function(e,t,r,a){return new(r||(r=Promise))((function(i,n){function o(e){try{d(a.next(e))}catch(e){n(e)}}function s(e){try{d(a.throw(e))}catch(e){n(e)}}function d(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}d((a=a.apply(e,t||[])).next())}))};function Wi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}const Ni=r(1668);var Ui=null,Bi=0,Vi=!1;function Gi(e){return e&&0!=e.length?(e.length>Bi&&(Bi=2*e.length,Ui&&_free(Ui),Ui=_malloc(Bi)),writeArrayToMemory(e,Ui),Ui):null}function Hi(e){console.log(e)}self.wasmSuccessEvent=7,self.wasmFailEvent=-7,self.downloadAndInstantiateWebAssembly=async function(e,t){try{const r=await new Promise(((e,t)=>{const r=a=>{let i=a.data;"DOWNLOAD_WASM_FROM_MAIN_THREAD_OK"===i.command?(J("DE"),self.removeEventListener("message",r),e(i.data)):"DOWNLOAD_WASM_FROM_MAIN_THREAD_FAILED"===i.command&&(self.removeEventListener("message",r),t(new Error("Failed to download WASM file: ".concat(wasmUrl," from main thread"))))};self.addEventListener("message",r),J("DS"),postMessage({status:30,url:wasmUrl})}));let a=await WebAssembly.instantiate(r,e);a.instance?(self.wasmModuleToShare=a.module,t(a.instance)):(self.wasmModuleToShare=r,t(a))}catch(e){J("IF"),te("E:H Failed to download and instantiate WASM file: ".concat(wasmUrl),e)}},self.addEventListener("unhandledrejection",(e=>{te("Unhandled rejection in video worker: ".concat(JSON.stringify(e.reason)),e.reason instanceof Error?e.reason:null),Se()})),self.addEventListener("error",(e=>{te("Unhandled exception in video worker",e),Se()}));var ji,zi,$i,qi,Yi,Qi,Ki,Xi,Zi,Ji,en,tn,rn,an,nn,on,sn,dn,ln,cn,un,hn,_n,pn,fn,mn,gn,vn,yn,bn,wn,Sn,Mn,En,Rn,Tn,kn,xn,An,Cn,Fn,Pn,In,On,Dn,Ln,Wn,Nn,Un,Bn,Vn,Gn,Hn,jn,zn,$n,qn,Yn,Qn,Kn,Xn,Zn,Jn,eo,to,ro,ao,io,no,oo,so,lo,co,uo,ho,_o,po,fo,mo,go,vo=new Xe,yo=!0,bo=We,wo=new Map,So=He.DESKTOP_SOURCE,Mo=0,Eo=!1,Ro={status:71,width:0,height:0},To=!1;const ko=new class{constructor(e){ya(this,Ma,""),ya(this,Ea,new xr),ya(this,Ra,new va),ya(this,Ta,new Ir),ya(this,ka,null),wa(Ma,this,e),ba(Ra,this).setGPUResourceMgrGetter((()=>this.getWebGPUResMgr()))}isEnableCanvasAlphaChannel(){return ba(Ra,this).isEnableCanvasAlphaChannel()}setCanvasAlphaChannelEnability(e){ba(Ra,this).setCanvasAlphaChannelEnability(e)}async evalRendererType(e){const t=await ba(Ea,this).evaluate(e);console.log("[RenderManager] rendererType is ".concat(t))}getVideoRenderDisplay(e,t,r,a){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;const n=ba(Ea,this).getRendererType(),o=ba(Ea,this).acquireRenderer(e,this.getWebGPUResMgr(n));return ba(Ra,this).getVideoRenderDisplay(n,e,t,r,a,o,i)}getRenderDisplay(e,t,r,a){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;const n=ba(Ea,this).getRendererType(),o=ba(Ea,this).acquireRenderer(e,ba(ka,this));return ba(Ra,this).getRenderDisplay(n,e,t,o,i)}createWebGLVideoRenderDisplay(e,t,r){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return ba(Ea,this).isWebGL2RendererType()?ba(Ra,this).getWebGL2RenderDisplayMgr().createVideoRenderDisplay(e,t,r,null,a):ba(Ea,this).isWebGLRendererType()?ba(Ra,this).getWebGLRenderDisplayMgr().createVideoRenderDisplay(e,t,r,null,a):(er("Can not create webgl display!!"),null)}createVideoRenderDisplay(e,t,r){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;const i=ba(Ea,this).getRendererType(),n=ba(Ea,this).acquireRenderer(e,this.getWebGPUResMgr(i));return ba(Ra,this).createVideoRenderDisplay(i,e,t,r,n,a)}recycleRenderDisplay(e,t,r){const a=ba(Ea,this).getRendererType();ba(Ra,this).recycleRenderDisplay(a,e,t,this.getWebGPUResMgr(a),r)}renderFor(e){if(ba(Ea,this).isWebGPURendererType()){const t=ba(Ea,this).getRendererType(),r=ba(Ra,this).collectInUseRenderDisplays(t,e);r&&r.forEach((e=>{const r=ba(Ea,this).acquireRenderer(e.canvas,this.getWebGPUResMgr(t));ba(Ta,this).render(r,e.renderDisplays)}))}}renderWith(e){if(ba(Ea,this).isWebGPURendererType()){const t=e.getAttachedCanvas();if(t){const r=ba(Ea,this).getRendererType(),a=ba(Ea,this).acquireRenderer(t,this.getWebGPUResMgr(r)),i=[];i.push(e),ba(Ta,this).render(a,i)}}}getRenderDisplayMap(e){const t=ba(Ea,this).getRendererType();return ba(Ra,this).getRenderDisplayMap(t,e)}onRestoredFromContextLost(e,t,r,a,i){let n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null;return ba(Ea,this).isWebGLRendererType()||ba(Ea,this).isWebGL2RendererType()?ba(Ra,this).onRestoredFromContextLost(e,t,r,a,i,n):null}destroyUnusedVideoFrame(e){"undefined"!=typeof VideoFrame&&e instanceof VideoFrame&&ba(Ea,this).isWebGPURendererType()&&e.close()}getRendererProvider(){return ba(Ea,this)}getRenderDisplayManager(){return ba(Ra,this)}getWebGPUResMgr(e){if(ba(ka,this))return ba(ka,this);if(2===e){const e=ur.getModule("webgpu_renderer_dynmod");wa(ka,this,e.exports.createWebGPUResManager()),ba(ka,this).addRendererProviderModule(ba(Ea,this)),ba(ka,this).setLabel(ba(Ma,this))}return ba(ka,this)}cleanup(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];ba(Ea,this)&&ba(Ea,this).cleanup(),ba(Ra,this)&&ba(Ra,this).cleanup(e,t,r),r||ba(ka,this)&&ba(ka,this).cleanup()}clearOffscreenCanvas(e){ba(Ra,this)&&ba(Ra,this).cleanupByCanvas(e)}}("videoShare");var xo,Ao,Co=null,Fo=new xa(-129,!0),Po=new xa(-130,!0),Io=!1,Oo=!1,Do=!1,Lo=-1,Wo=new Map;const No="meetingNumber";self.onWasmModuleReady=()=>{ji=Module.cwrap("_Video_Try_Analysis","number",["number","array","number","boolean"]),zi=Module.cwrap("_Video_Try_Analysis","number",["number","number","number","boolean"]),$i=Module.cwrap("_Video_Start_Encode","number",["number","number","number","number","number"]),Module.cwrap("_Video_Stop_Encode","number",["number"]),qi=Module.cwrap("_Video_Update_Format","number",["number","number","number","number","number"]),Ji=Module.cwrap("_Request_Video_Qos_Data","number",["number","boolean"]),en=Module.cwrap("_Request_Sharing_Qos_Data","number",["number","boolean","boolean"]),Yi=Module.cwrap("_Video_Set_Data_Encryption","number",["number","number"]),Qi=Module.cwrap("_Add_Video_Cooker_info","number",["number","number","number","number","boolean"]),Ki=Module.cwrap("_Remove_Video_Cooker_Info","number",["number","number"]),no=Module.cwrap("_Sharing_Set_Data_Encryption","number",["number","number"]),oo=Module.cwrap("_set_annotation_action","number",["number","number","number","number"]),ao=Module.cwrap("_Sharing_Encode_Init","number",["number","number","number","number","number","number","boolean"]),io=Module.cwrap("_Sharing_Encode_Uninit","number",["number"]),Module.cwrap("_Set_Max_Receiving_Channel_Num","number",["number","number"]),Xi=Module.cwrap("_update_sync_time","number",["number","number","number"]),Zi=Module.cwrap("_release_video_receiving_channel","number",["number","number"]),gn=Module.cwrap("_signal_video_controller_encode_hw_info","number",["number"]),yn=Module.cwrap("_signal_sharing_controller_encode_hw_info","number",["number"]),bn=Module.cwrap("_signal_video_controller_encode_hw_retry_info","number",["number"]),wn=Module.cwrap("_signal_sharing_controller_encode_hw_retry_info","number",["number"]),vn=Module.cwrap("_signal_video_controller_decode_hw_info","number",["number"]),Module.cwrap("_change_hw_status","number",["number","boolean"]),tn=Module.cwrap("_create_vb_thread","number",[]),rn=Module.cwrap("_create_video_encode_thread","number",[]),go=Module.cwrap("_Create_HW_Encode","number",[]),an=Module.cwrap("_create_sharing_encode_thread","number",[]),nn=Module.cwrap("_signal_vb_thread_bg","number",["number","number","number","number"]),on=Module.cwrap("_signal_vb_thread_blur","number",["number","number"]),sn=Module.cwrap("_signal_vb_thread_video_yuv","number",["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"]),dn=Module.cwrap("_signal_vb_thread_video_rgba","number",["number","number","number","number","number","number","number","number"]),ln=Module.cwrap("_update_video_cropping_mode","number",["number","number"]),cn=Module.cwrap("_signal_video_controller_encode_init_info","number",["number","number","number","number","number","number","number","number","number","boolean","boolean","boolean","number"]),un=Module.cwrap("_signal_video_controller_decode_init_info","number",["number","number","number","number","string","string","number","number","number","boolean","boolean","boolean","number","boolean","boolean"]),Module.cwrap("_signal_video_controller_enocde_start_or_stop_encode","number",["number","number","number","number","boolean"]),fn=Module.cwrap("_signal_video_controller_encode_yuv","number",["number","number","number","number","number","number","number","number","number","number","number","number","boolean","number","number","boolean"]),mn=Module.cwrap("_signal_video_controller_encode_rgba","number",["number","number","number","number","number","number","number","number","number","boolean","number","number","boolean"]),Tn=Module.cwrap("_Sharing_Encode_Try_Analysis","number",["number","array","number"]),kn=Module.cwrap("_signal_sharing_controller_encode_init_info","number",["number","number","number","number","number","number","number","number","number","boolean","boolean","boolean","number"]),Cn=Module.cwrap("_Set_Sharing_Encryption_Key_Directly","number",["number","number","number","number"]),Fn=Module.cwrap("_Add_Roster_Info_Directly","number",["number","number","number","number"]),Pn=Module.cwrap("_Sharing_Encode","number",["number","number","number","number","number","number"]),_o=Module.cwrap("_Sharing_Encode_Mouse_Data","number",["number","number","number"]),In=Module.cwrap("_signal_video_share_flag","number",["boolean"]),On=Module.cwrap("_signal_sharing_controller_enocde_request_check_one_type","number",["number"]),Dn=Module.cwrap("_signal_video_controller_enocde_request_check_one_type","number",["number"]),Ln=Module.cwrap("_create_sharing_decode_thread","number",[]),Wn=Module.cwrap("_signal_sharing_controller_decode_init_info","number",["number","string","string","number","number","number","boolean"]),Nn=Module.cwrap("_signal_sharing_controller_decode_meeting_key","number",["number","number","number","boolean"]),Un=Module.cwrap("_signal_sharing_controller_decode_meeting_cooker","number",["number","number","number","number"]),Bn=Module.cwrap("_signal_sharing_controller_decode_roster_info","number",["number","number","number","boolean","number"]),Vn=Module.cwrap("_signal_sharing_controller_decode_rev_channel","number",["number","number","number","number","boolean"]),Gn=Module.cwrap("_signal_sharing_controller_decode_pdu_info","number",["number","number","boolean"]),ro=Module.cwrap("_create_video_decode_thread","number",[]),Hn=Module.cwrap("_singal_sharing_controller_decode_close","number",[]),pn=Module.cwrap("_signal_video_controller_decode_close","number",[]),po=Module.cwrap("_collect_video_monitor_info","number",["number","boolean"]),fo=Module.cwrap("_collect_sharing_monitor_info","number",["number","boolean","boolean"]),mo=Module.cwrap("_signal_vb_thread_close","number",[]),lo=Module.cwrap("_Jpeg_Init","number",[]),Module.cwrap("_Jpeg_Uninit","number",["number"]),co=Module.cwrap("_Jpeg_HeardInfo","number",["number","number","number"]),uo=Module.cwrap("_Jpeg_Decode","number",["number","number","number","number","number","number"]),hn=Module.cwrap("_signal_video_controller_encode_uninit","number",[]),_n=Module.cwrap("_signal_video_controller_decode_uninit","number",[]),xn=Module.cwrap("_signal_sharing_controller_encode_uninit","number",[]),An=Module.cwrap("_signal_sharing_controller_decode_uninit","number",["boolean"]),Rn=Module.cwrap("_set_video_network_info","number",["number","number","number","number","number","number","number","number","number"]),Mn=Module.cwrap("_set_video_fec_info","number",["number","number","number","number"]),Sn=Module.cwrap("_set_video_bandwidth_alloc","number",["number","number","number","number"]),En=Module.cwrap("_set_video_retran_info","number",["number","number","boolean","boolean","number"]),Yn=Module.cwrap("_set_sharing_network_info","number",["number","boolean","boolean","number","number","number","number","number","number","number"]),Qn=Module.cwrap("_set_sharing_fec_info","number",["number","boolean","number","number"]),Kn=Module.cwrap("_set_sharing_bandwidth_alloc","number",["number","boolean","number","number"]),Xn=Module.cwrap("_set_sharing_retran_info","number",["number","boolean","boolean","boolean","number"]),Zn=Module.cwrap("_set_mmr_signature_info","number",["number","number","array","number"]),Jn=Module.cwrap("_set_singature_info","number",["number","number","number"]),eo=Module.cwrap("_set_meeting_uuid_for_signature","number",["number","number","string","number"]),to=Module.cwrap("_update_signagure_verify_action","number",["number","number","boolean"]),$n=Module.cwrap("_signal_sharing_controller_encode_statistics_flag","number",["boolean"]),qn=Module.cwrap("_signal_sharing_controller_decode_statistics_flag","number",["boolean"]),jn=Module.cwrap("_signal_video_controller_encode_statistics_flag","number",["boolean"]),zn=Module.cwrap("_signal_video_controller_decode_statistics_flag","number",["boolean"]),Module._malloc=function(){let e=Module.asm.malloc.apply(null,arguments);return e||Eo||(Eo=!0,J("MEMERR:VIDEO-".concat(cs,"-").concat(wasmMemory.buffer.byteLength,"-").concat(arguments[0])),te("memry malloc error",new Error("memry malloc error VIDEO-".concat(cs,"-").concat(wasmMemory.buffer.byteLength,"-").concat(arguments[0])))),e},"undefined"!=typeof _malloc&&(_malloc=Module._malloc),Gi(new Uint8Array(1500))};var Uo=null,Bo=null,Vo=0,Go=null,Ho=0,jo=null,zo=null,$o=0,qo=!1,Yo=!1,Qo=null,Ko=0,Xo=0,Zo=0,Jo=null;var es,ts,rs,as,is,ns,os,ss,ds,ls,cs=!1,us=!1,hs=!1,_s=!1,ps=!1,fs=!1,ms=null,gs=null,vs=null,ys=new Map,bs=null,ws=new Map,Ss=null,Ms=[],Es=!1,Rs="",Ts=!1,ks={ssrc:null,firstflag:!1},xs=1,As=2,Cs=new ge,Fs=0,Ps=!1,Is=!1,Os=!1,Ds=!1,Ls=!1,Ws=!1,Ns=new Map,Us=navigator.hardwareConcurrency||4,Bs=30,Vs=0,Gs={rgba_x:0,rgba_y:0,rgba_stride:0};self.isPreviewMode=!1;var Hs,js,zs={qosIntervalId:0,sharingqosIntervalId:0,renderFlag:!1,monitorPanelFlag:!1,sharingmonitorPanelFlag:!1,messageIndex:0,sharingmessageIndex:0,panelpollingInterval:0},$s={sharingStatisticsFlag:!1,videoStatisticsFlag:!1},qs=null,Ys={videoReadStream:new ge,sharing_handle:0,keyAndrosterInfo:null,sharing_encode_encrypt:null,isSupportMediaStreamTrackProcessor:null,pdu_queue:new Xe,sharing_raw_data_width:null,sharing_raw_data_height:null,sharing_memory_ptr:null,dataFormat:0,isCreateHandleFlag:!1,threadState:Re,vloadedThreadCount:0,SharingEncThreadWorker:null,totalCapturedFrame:0,bpause:!0,isWhiteboardSharing:!1,startFlag:!1,videocaptureticknumb:0,visibleRect:{rect:{x:0,y:0,width:0,height:0}},threadarray:[],encodeflag:!1,can_capture_sharing:!1,capture_promise_count:0},Qs={canIReceiveFirstSharingFrameMap:new Map,monitor_sharingD_width:0,monitor_sharingD_height:0,pduBuffer:new Xe,currentshareactive:null,bssrcMainSession:!1,sharing_decoder:null,sharing_cppHandler:null,mainSession_decoder:null,mainSession_cppHander:null,sharing_mouse_buffer:null,sharing_mouse_buffer_available:null,sharing_connect_type:-1,startFlag:!1,sharingRTPRTCPnumb:0,MasterRecvChanleList:[],AsRecvChannelList:[],sharingrecvchannel:[],keyAndrosterInfo:null},Ks=null,Xs=0,Zs=!1,Js=!1,ed=0,td=0,rd=!1;const ad=new class{constructor(){this.intervalTimer=null}start(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30;this.stop(),this.intervalTimer=setInterval(e,t)}stop(){this.intervalTimer&&(clearInterval(this.intervalTimer),this.intervalTimer=null)}};let id=null;function nd(e,t){var r;if(postMessage({status:l}),os){const e={cmd:V,data:os};zo.sendCommand(e)}cs&&null!==(r=jd)&&void 0!==r&&r.startFlag&&Mh(Oe.SESSION_TYPE_VIDEO,!0)}var od,sd,dd=!1,ld={threadCreatedFlag:!1};ld.threadPoolBufferMGR=new Map,ld.SSrcWaitForThread=[],ld.initParseThread=!1,ld.unusedworkerarray=[],ld.totalNumbofParseThread=3,ld.newworker=0,ld.helpWorker=null,ld.totalthread=0,ld.preusedcount=0,ld.realusedcount=0,ld.zombiethreadssrc=0,ld.videodecodethreadnumb=1,ld.isSupportMultiThread=!1,ld.isSupportOffscreenCanvas=!1,ld.isVideoCodecHelpThreadWorker=null,ld.decodeMainWorker=null,ld.threadState=Re,ld.kk=null,ld.startFlag=!1,ld.videoRTPRTCPnumb=0,ld.isEnableVideoDecodeHardWareThread=!1,ld.binitvideo=!1;var cd=1,ud={isTeslaMode:!1};function hd(){}let _d=new Map;function pd(e){if(!(e=e>>10<<10))return;let t=ld.threadPoolBufferMGR.get(e);if(t&&e!=ld.zombiethreadssrc){ld.threadPoolBufferMGR.delete(e);let r=_d.get(e);r?r.push(t):_d.set(e,[t])}}function fd(){}function md(e){e=e>>10<<10;let t=ld.threadPoolBufferMGR.get(e);return t?t.threadState!=ke||0==ld.unusedworkerarray.length?-1:0:-1}const gd=(()=>{let e=null,t=null;return{inited:!1,start(){this.inited=!0,this.clear(),e=setTimeout((()=>{Pc||postMessage({status:"VBPredictAbout3s"})}),3e3),t=setTimeout((()=>{Pc||postMessage({status:"VBPredictAbout10s",isVBPredictIn5s:!0})}),1e4)},clear(){clearTimeout(e),clearTimeout(t),e=null,t=null}}})();function vd(e){gn(e),yn(e)}function yd(e,t){J("".concat(e,":").concat(t,":F"))}function bd(e,t,r,a){ve(e,"".concat(t,",").concat(r,",").concat(a))}var wd=new Gt({tag:"WCL_M,SCAPTIMEOUT",interval:5e3,reportcallback:bd}),Sd=(new Gt({interval:1e4,tag:"WCL_M,SMOOTH",reportcallback:bd}),new zt({report_call:ve})),Md=new zt({tag:"WCL,AS",report_call:ve});function Ed(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];PThread.loadWasmModuleToWorker=function(e,t){e.onmessage=r=>{if(!Zs){var a=r.data,i=a.cmd;if(e.pthread_ptr&&(PThread.currentProxiedOperationCallerThread=e.pthread_ptr),a.targetThread&&a.targetThread!=_pthread_self()){var n=PThread.pthreads[a.targetThread];return n?n.postMessage(a,a.transferList):te('Internal error! Worker sent a message "'+i+'" to target pthread '+a.targetThread+", but that thread no longer exists!"),void(PThread.currentProxiedOperationCallerThread=void 0)}if("processProxyingQueue"===i)executeNotifiedProxyingQueue(a.queue);else if("spawnThread"===i)spawnThread(a);else if("cleanupThread"===i)cleanupThread(a.thread);else if("killThread"===i)killThread(a.thread);else if("cancelThread"===i)cancelThread(a.thread);else if("loaded"===i)e.loaded=!0,t&&t(e),e.runPthread&&e.runPthread();else if("print"===i)out("Thread "+a.threadId+": "+a.text);else if("printErr"===i)err("Thread "+a.threadId+": "+a.text);else if("alert"===i)alert("Thread "+a.threadId+": "+a.text);else if("setimmediate"===a.target)e.postMessage(a);else if("callHandler"===i)Module[a.handler](...a.args);else if("sharing-size"==i){if(Module.decode_callback){const{ssrc:e,size:t,ptr:a,videomode:i}=r.data;Module.decode_callback(e,t,a,i)}}else if("size"==i)Module.decode_callback&&Module.decode_callback(r.data.ssrc,r.data.size);else if("decoded"==i)Module.put_data&&Module.put_data(r.data);else if("js_info_from_wcl"==i)Module.js_info_from_wcl_thread&&Module.js_info_from_wcl_thread(r.data);else if("wcl_trace_log"==i)Module.wcl_trace_log&&Module.wcl_trace_log(r.data);else if("on_psl_mix_share_info_changed"===i){let e=r.data.shared_source_id,t=r.data.rect_x_norm,a=r.data.rect_y_norm,i=r.data.rect_cx_norm,n=r.data.rect_cy_norm;Module.on_psl_mix_share_info_changed(e,t,a,i,n)}else if("js_info_from_wcl_video_data"===i){let e=r.data.ssrc,t=r.data.data,a=r.data.is_sent_by_data;Module.js_info_from_wcl_video_data(e,t,0,void 0,void 0,a,!0)}else if("change_capture_resolution"==i)Module.change_capture_resolution&&Module.change_capture_resolution(r.data.type);else if("APP_Troubleshoting_Info"==i)Module.APP_Troubleshoting_Info&&Module.APP_Troubleshoting_Info(r.data.data,r.data.len,!0);else if("SAVE_IV"==i){let e=r.data.ptr,t=r.data.len;Module.SAVE_IV(e,t)}else if("processed_capture_data_callback"==i){let e=r.data.ssrc,t=r.data.data,a=r.data.len_of_data,i=r.data.format_width,n=r.data.format_height,o=r.data.valid_x,s=r.data.valid_y,d=r.data.valid_width,l=r.data.valid_height,c=r.data.yuv_limited;Module.processed_capture_data_callback(e,t,a,i,n,o,s,d,l,c)}else if("Send_Data"==i)Module.Send_Data&&Module.Send_Data(r.data);else if("modelReady"===i)Cc=performance.now(),gd.start();else if("vbInitializeFailed"===i)postMessage({status:"vbInitializeFailed"});else if("addMonitorLog"===i)J(a.log);else if("vbPredictDone"===i)Pc=!0,Fc=performance.now()-Cc,jd.nextWorker=jd.vbThreadWorker,jd.nextWorker.postMessage({cmd:"vb"}),jd.encodeflag=!1,tn(),jd.vbThreadCreatedFlag=!0,postMessage({status:"VBPredictDone",predictCostTime:Fc}),zl&&(Ls||Wc({data:Zl}));else if("decoded_webcodec"===r.data.cmd){const{id:e,data:t,frameIndex:a,ssrc:i}=r.data||{};Module.codecMRG.put_data({id:e,ssrc:i,data:t,frameIndex:a})}else if("decoded_webcodec_render"===r.data.cmd){const{id:e,ssrc:t,iFrameNum:a,rotation:i,rendering_x:n,rendering_y:o,rendering_width:s,rendering_height:d,format_width:l,format_height:c}=r.data||{};Module.codecMRG.render({id:e,iFrameNum:a,ssrc:t,rotation:i,x:n,y:o,vwidth:s,vheight:d,format_width:l,format_height:c})}else if("RVQD"===r.data.cmd){let e=r.data;Module.responseVideoQosData(e.width,e.height,e.fps,e.rtt,e.jitter,e.avg_loss,e.max_loss,e.bandwidth,e.rate)}else if("URBW"==r.data.cmd){let e=r.data;Module.Qos_Update_Bandwidth(e.id,e.min,e.max)}else if("UVHI"==r.data.cmd){let e=r.data.qos_hd_info;Module.Qos_Update_Video_Hd_info(e)}else if("dv"==r.data.cmd)r.data.type&&(Ys.can_capture_sharing=!0);else if("dv2"==r.data.cmd){let e=r.data;Sd.setCloseTotalFrames(e.data)}else if("wcl_sharing_inited"==r.data.cmd){let e=r.data.ptr;r.data.ismainSession?Qs.mainSession_cppHander=e:Qs.sharing_cppHandler=e}else if("RVSQD"===r.data.cmd){let e=r.data;Module.responseSharingQosData(e.width,e.height,e.fps,e.rtt,e.jitter,e.avg_loss,e.max_loss,e.bandwidth,e.rate)}else if("sharing_decode_render"==r.data.cmd)if(Module.frame_callback_video_mode){let e=r.data;Module.frame_callback_video_mode(e.data,e.data_len,e.ts,e.ssrc,e.format_width,e.format_height,e.rgnvalid_x,e.rgnvalid_y,e.rgnvalid_width,e.rgnvalid_height,e.logical_width,e.logical_heigth,e.yuv_limited,e.ptr)}else Module._free(r.data.data);else if("sharing_decode_mouse_buffer_change"==r.data.cmd)Qs.sharing_mouse_buffer=r.data.data,Qs.sharing_mouse_buffer_available=new Int32Array(Qs.sharing_mouse_buffer,0,1);else if("sharing_decode_mouse_data"==r.data.cmd){if(Module.frame_callback_mouse_video_mode){let e=r.data;Module.frame_callback_mouse_video_mode(e.data,e.len_of_data,e.timestamp,e.ssrc,e.logical_width,e.logical_height,e.logical_x,e.logical_y,e.data_width,e.data_heigth,e.sync_id,e.handle)}}else if("release_video_channel_callback"==r.data.cmd){let e=r.data.ssrc;Module.release_video_channel_callback(e)}else if("MCM_VIDEO_LOG"==r.data.cmd){let e=r.data;Module.MCMMonitor_Video_LOG(e.data)}else if("MCM_SHARING_LOG"==r.data.cmd){let e=r.data;Module.MCMMonitor_Sharing_LOG(e.data)}else if("tCrashed"==r.data.cmd){let e="WCL_M,"+r.data.data.toString();postMessage({status:_,data:e})}else"WCES"==r.data.cmd?re("webcodec encode start, config ".concat(Wd)):"THWEC"==r.data.cmd?postMessage({status:109,type:0}):"TFJSWLF"==r.data.cmd?J("TFJSWLF"):"globalTracingError"===r.data.cmd?te("Error from pthread worker: ".concat(r.data.data),r.data.error):"GlobalTracingDT"===r.data.cmd?re("Message from pthread worker: ".concat(r.data.data)):"WCEF"==r.data.cmd?su(r.data.data,r.data.code,r.data.retry,r.data.subCode,r.data.inHWThread):"WCDF"==r.data.cmd?(te("E:H webcodec decode failed ".concat(r.data.data)),J("WCDF:".concat(r.data.data)),Th(!1,r.data.data)):"SubSharingInfo"==r.data.cmd?Module.SubScribeUpdateSharing(r.data.data):"SubVideoInfo"==r.data.cmd?Module.SubScribeUpdateVideo(r.data.data):-35==r.data.cmd?(Po.setWasmMemoryError(!0),postMessage(r.data)):202==r.data.cmd||203==r.data.cmd||204==r.data.cmd||205==r.data.cmd?postMessage(r.data):"webcodecperformance"==r.data.cmd?postMessage({status:123,data:r.data}):i&&err("worker sent an unknown command "+i);PThread.currentProxiedOperationCallerThread=void 0}};var r=[];for(var a of["onExit","onAbort","print","printErr"])Object.prototype.hasOwnProperty.call(Module,a)&&r.push(a);e.postMessage({cmd:"load",handlers:r,urlOrBlob:Module.mainScriptUrlOrBlob||_scriptDir,wasmMemory,wasmModule:self.wasmModuleToShare,isTeslaMode:!!ud.isTeslaMode,is360penablehwenc:!!Od,is360penablehwdec:!!Dd,isAndroid:!0,currentTime:ed+performance.now(),encAdditionalConfig:Ld,encAddConIdx:Wd,supportHWEncRetry:Nd,encRetryConIdx:Ud,encRetryConfig:Bd})},e?(PThread.getNewWorker=function(){return jd.encodeflag?jd.nextWorker=jd.threadarray.shift():jd.encodeflag=!0,jd.nextWorker||te("No newWorker found to send video: ".concat(!!cs)),jd.nextWorker},PThread.returnWorkerToPool=function(e){var t=e.pthread_ptr;delete PThread.pthreads[t],e.pthread_ptr=0,__emscripten_thread_free_data(t),jd.threadarray.push(e),PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(e),1)}):(PThread.getNewWorker=function(){if(ld.helpWorker)return ld.helpWorker;let e=null;return ld.newworker?(e=ld.newworker,ld.newworker=null):e=ld.unusedworkerarray.shift(),e?ld.realusedcount++:te("Unable to get new worker"),e},PThread.returnWorkerToPool=function(e){if(ld.isVideoCodecHelpThreadWorker!=e){var t=e.pthread_ptr;delete PThread.pthreads[t],e.pthread_ptr=0,__emscripten_thread_free_data(t),ld.realusedcount--,setTimeout((()=>{Fd(e,!1)}),0),PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(e),1)}else te("video decode codec help thread worker was released")})}function Rd(e){return e?e>>10<<10:-1}function Td(e){let{canvas:t,oldCanvas:r,newDisplayMap:a}=e;for(let e=0;e<Ms.length;e++)if(Ms[e].canvas===r||Ms[e].canvas===t){r!==t&&(Ms[e].canvas=t);const i=Ms[e].display.getFillMode();Ms[e].display=a?a.get(Ms[e].display.getTextureIndex()):this._Create_WebGL_Canvas({videoRenderArrayIndex:e,canvas:t,canvasId:Ms[e].rendercanvasID}),i&&Ms[e].display&&Ms[e].display.setFillMode(i,Ms[e].display.getFillModeForResolution()),Ms[e].borderRadius&&Ms[e].display&&Ms[e].display.setRoundedCornerRadius(Ms[e].borderRadius)}}function kd(e){ld.threadPoolBufferMGR.set(ld.zombiethreadssrc,{pduBuffer:new Xe,threadState:Re,threadnumb:1,workerArray:[]});let t=ld.threadPoolBufferMGR.get(ld.zombiethreadssrc);e&&(t.threadState=Te)}function xd(e,t,r){if(e)if(t.threadState===Te){let r=new Uint8Array(e);t.pduBuffer.enqueue(r)}else{let a=t.pduBuffer.dequeue();for(;a;)ji(0,a,a.length,!0),a=t.pduBuffer.dequeue();r?zi(0,r,e.length,!0):ji(0,e,e.length,!0)}else{let e=t.pduBuffer.dequeue();for(;e;)ji(0,e,e.length,!0),e=t.pduBuffer.dequeue()}}function Ad(e,t){e.threadState=Te,ld.SSrcWaitForThread.push(t),e.isCreateWorkers=!0;{let t=e.threadnumb;for(let e=0;e<t;e++)ld.preusedcount<ld.totalthread?Fd(null,!1):ld.totalthread<cd&&(PThread.allocateUnusedWorker(),PThread.loadWasmModuleToWorker(PThread.unusedWorkers[ld.totalthread],Fd),ld.preusedcount++,ld.totalthread=ld.totalthread+1)}}function Cd(e){return lr.isUseSsrcStream()?Ms.filter((t=>bh.ssrcEquals(t.ssrc,e))).length>0:!!Ss&&Ss.Decode_Ssrc(e)}function Fd(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(ld.SSrcWaitForThread.length&&ld.SSrcWaitForThread[0]===ld.zombiethreadssrc&&!ld.isVideoCodecHelpThreadWorker){let t=ld.threadPoolBufferMGR.get(ld.zombiethreadssrc);return t.threadnumb=t.threadnumb-1,e&&e.postMessage({cmd:"webcodec",decHAOption:lu}),ld.isVideoCodecHelpThreadWorker=e,ld.newworker=e,void go()}e&&-1==ld.unusedworkerarray.indexOf(e)&&ld.unusedworkerarray.push(e),function(e,t){if(e&&!e.msc&&ld.isVideoCodecHelpThreadWorker){let r=new MessageChannel;e.msc=!0,e.postMessage({cmd:"vdmsc1"},[r.port1]),t.postMessage({cmd:"vdmsc2"},[r.port2])}}(e,ld.isVideoCodecHelpThreadWorker);let r=!1;for(;ld.SSrcWaitForThread.length;){let e=ld.SSrcWaitForThread[0];if(!(e===ld.zombiethreadssrc||Cd(e)||ks.ssrc&&e==ks.ssrc>>10<<10)){ld.SSrcWaitForThread.shift(),ld.threadPoolBufferMGR.delete(e);continue}let a=ld.threadPoolBufferMGR.get(e);a&&(a.threadnumb=a.threadnumb-1,t||ld.preusedcount++,r=!0,a.threadnumb||(ld.SSrcWaitForThread.shift(),a.threadState=ke,fh()?xd(null,a,0):console.error("ExecutePdu Session is not ready")));break}!r&&t&&ld.preusedcount--}function Pd(e,t){if(Zs)return;let r=!1,a=ld.zombiethreadssrc,i=null;if(2!=e[0]||(a=e[12]<<24|e[13]<<16|e[14]<<8|e[15],(Cd(a)||dh(a))&&fh())){if(a=a>>10<<10,r=ld.threadPoolBufferMGR.get(a),hl(),!r&&a){if(Qu.delete(a>>10<<10),i={},i.isCreateWorkers=!1,i.threadState=Re,i.pduBuffer=new Xe,i.create_time=(new Date).getTime(),!ld.initParseThread){let e=ld.threadPoolBufferMGR.get(ld.zombiethreadssrc);e.threadnumb=ld.totalNumbofParseThread,Ad(e,ld.zombiethreadssrc),ld.initParseThread=!0}i.threadnumb=1,i.workerArray=[],ld.threadPoolBufferMGR.set(a,i),vl.set(a>>10<<10,2),Ad(i,a)}i=ld.threadPoolBufferMGR.get(a),i&&xd(e,i,t)}}function Id(e,t){const r=e[0];if((16==r||142==r)&&e.length>5&&(Do!=e[4]&&(Do=!!e[4]),Qo=e),fh())if(jd.videoEncodeHandleFlag)t?zi(0,t,e.length,!1):ji(0,e,e.length,!1);else if(19!=r){let t=new Uint8Array(e);jd.encodequeue.enqueue(t)}}Md.threshold=300;var Od=!1,Dd=!1;let Ld={},Wd=0,Nd=!1,Ud=0,Bd={};var Vd=!1,Gd=!0,Hd=!0,jd=null,zd=!1;function $d(e,t,r){let a=jd.threadPoolBufferMGR.get(e);if(a)a.threadState==ke&&(postMessage({status:8}),Pc&&postMessage({status:"VBPredictDone",predictCostTime:0}));else{jd.threadPoolBufferMGR.set(e,{threadState:Re,workerArray:[],threadnumb:t});var i=jd.threadPoolBufferMGR.get(e);if(i.threadState==Re){i.threadState=Te,jd.waitingThread.push(e);for(let e=0;e<t;e++){PThread.allocateUnusedWorker();let e=PThread.unusedWorkers.pop();PThread.loadWasmModuleToWorker(e,(e=>{e.postMessage({cmd:"vbFlag",enableVBWasmBackend:r}),Yd(e)}))}}}}const qd=function(){let e=null;return async t=>{e||(e=new Promise(((e,t)=>{if(!dd)return void e(!0);jd.threadState=Te;let r=jd.videoencodethreadnumb;jd.Signal_Encode_Thread.status=Te;let a=!1;r+=8,jd.hwencThreadWorkerFlag||(jd.hwencThreadWorkerFlag=!0,r++,a=!0);for(var i=0;i<r;i++){PThread.allocateUnusedWorker();let t=PThread.unusedWorkers.pop();PThread.loadWasmModuleToWorker(t,(function(t){jd.vloadedThreadCount++,a?1==jd.vloadedThreadCount?(jd.hwencThreadWorker=t,Uc()):2==jd.vloadedThreadCount?(jd.encThreadWorker=t,Nc()):jd.threadarray.push(t):1==jd.vloadedThreadCount?(jd.encThreadWorker=t,Nc()):jd.threadarray.push(t),jd.vloadedThreadCount==r&&(J("ECWS"),jd.threadState=ke,e(!0))}))}}))),await e,ql(t)}}();function Yd(e){let t=jd.waitingThread[0];if(void 0!==t){let r=jd.threadPoolBufferMGR.get(t);r&&(r.threadnumb=r.threadnumb-1,r.workerArray.push(e),r.threadnumb||(jd.waitingThread.shift(),r.threadState=ke,"VB"==t&&(postMessage({status:8}),jd.vbThreadWorker=e,Dc(0),Dc(1),Dc(2))))}}function Qd(){return 0}function Kd(){return navigator.hardwareConcurrency||1}function Xd(){return ld.videodecodethreadnumb>1&&ld.isEnableVideoDecodeHardWareThread?1:0}function Zd(){return Hs}function Jd(){return js}function el(){return uu}function tl(){return!hu}function rl(){return!!Od}function al(){return!!Dd}function il(){return!!ud.isTeslaMode}function nl(){return 1}function ol(){return 8}function sl(e,t){102!=e[0]?cs?Id(e,t):Pd(e,t):Js&&nu(e.subarray(12),cs)}function dl(e,t){postMessage({status:108})}function ll(e){var t;const r=(null===(t=jd)||void 0===t?void 0:t.videoEncodeHandleFlag)||(null==ld?void 0:ld.binitvideo),{cmd:a}=e;switch(a){case 184:{const{rtt:t,jitter:a,avg_loss:i,max_loss:n,bandwidth:o,rate:s,issend:d,lost_packet_num:l}=e;r&&Rn(0,d,t,a,i,n,o,s,l);break}case 185:{const{type:t,payload_type:a,issend:i}=e;r&&Mn(0,i,t,a);break}case 187:{const{retran:t,retran_switched:a,lostrate:i,issend:n}=e;r&&En(0,n,t,a,i);break}case 186:{const{bandwidth:t,lostrate:a,issend:i}=e;r&&Sn(0,i,t,a);break}case 189:us=e.data,function(){let e=us||hs;e!=_s&&J("VQOS-S-"+(e?1:0)+"-"+(us?1:0)+"-"+(hs?1:0)),_s=e}();break;case 183:postMessage({status:-9}),te("NetWork is Bad, Don't to reconnect the serer!");break;case 178:postMessage({status:105}),hs=!0;break;case 179:postMessage({status:106}),hs=!1;break;case 196:{const{type:t,networkLevel:r,bwLevel:a}=e;postMessage({status:A,isUplink:0===t,networkLevel:r,bwLevel:a});break}}}function cl(e){e==Ae&&Vd?(Ro.width=1280,Ro.height=720,postMessage(Ro)):e==Ce&&Vd&&Gd?(Ro.width=1920,Ro.height=1080,postMessage(Ro)):e==xe&&(Ro.width=640,Ro.height=360,postMessage(Ro))}var ul=0;function hl(){hs&&1!==ul?(ul=1,postMessage({status:k,type:ul})):us&&!hs&&2!==ul?(ul=2,postMessage({status:k,type:ul})):us||hs||3===ul||(ul=3,postMessage({status:k,type:ul}))}function _l(e,t,r,a,i){rd=!!e,postMessage({status:O,data:{shared_source_id:e,rect_x_norm:t,rect_y_norm:r,rect_cx_norm:a,rect_cy_norm:i}})}function pl(e,t,r,a,i,n,o){if(!isPreviewMode)if(o)zo.send(t);else{let e=new Uint8Array(4);e[0]=a,e[1]=i;let n=GROWABLE_HEAP_I8().subarray(t+0,t+r);zo.sendVideo(e,n)}}function fl(e,t,r,a,i,n,o,s,d,l){if(!ps&&!lc&&!Ds)return void(t&&Module._free(t));if(!jd.hwencThreadWorker)return void(t&&Module._free(t));if(!Ws)return void(t&&Module._free(t));let c=GROWABLE_HEAP_U8().subarray(t+0,t+r),u=a*i,h=a*i/4,_=a*i/4,p=a,f=a/2,m=a/2,g=n,v=o;2==xs&&Ko==s&&Xo==d||(Ko=s,Xo=d,xs=2,jc());let y=null;try{var b;y=new VideoFrame(c,{format:"I420",timestamp:1e3*performance.now(),duration:0,codedWidth:a,codedHeight:i,visibleRect:{left:n,top:o,width:s,height:d}}),ho&&postMessage({status:q,frame:y}),Sd.captureSample(),Sd.ref(),lr.isUseSsrcStream()?yh.pushLocalVideoFrame(y,{mirror:Ps}):(null===(b=sd)||void 0===b||b.postMessage({data:y}),Ds&&qc(a,i,c,{top:o,left:n,width:s,height:d},As-1)),Wl(y),fn(t,u,t+u,h,t+u+h,_,p,f,m,g,v,xs,true,0,Nl++,Oo)}catch(e){t&&Module._free(t),y&&(y.close(),Sd.closeSample())}}function ml(e){let t=e.data;zo.send(t)}function gl(e){let t=_d.get(e);if(null!=t&&t.length){let e=t.shift();(null==e?void 0:e.threadState)==ke&&ld.preusedcount--}else console.error(".... no waiting ssrc for release",e)}var vl=new Map;function yl(e,t,r,a){if(r){let i=!(r==Qs.sharing_cppHandler);postMessage({status:m,ssrc:e,size:t,isFromMainSession:i,videomode:a})}else{vl.set(e>>10<<10,t);let r=Array.from(vl.values()),a=Math.max.apply(null,r);Zo!==a&&(Zo=a,postMessage({status:u,ssrc:e,size:Zo}))}}function bl(e,t){var r;if(arguments.length>2&&void 0!==arguments[2]&&arguments[2])r=e;else{r=new Uint8Array(t);var a=GROWABLE_HEAP_I8().subarray(e+0,e+t);r.set(a,0,t)}postMessage({status:p,data:kl(r)})}function wl(e,t){postMessage({status:_,data:kl(e)})}function Sl(e,t){postMessage({status:_,data:kl(e)})}function Ml(e,t){var r=new Uint8Array(t),a=GROWABLE_HEAP_I8().subarray(e+0,e+t);r.set(a,0,t),postMessage({status:x,data:r},[r.buffer])}function El(e,t,r){var a=new Uint8Array(r+8),i=GROWABLE_HEAP_I8().subarray(t+0,t+r);a.set(i,8),a[0]=109;var n=new Uint32Array(1);n[0]=e;var o=new Uint8Array(n.buffer);a.set(o,4),qs.send(a),Fo.setRtpPackets()}function Rl(e,t){Jo&&Jo.writeWasmLog(e,t)}function Tl(e,t){Jo&&Jo.writeWasmLog(e,t)}function kl(e){var t,r,a,i,n,o;for(t="",a=e.length,r=0;r<a;)switch((i=e[r++])>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:t+=String.fromCharCode(i);break;case 12:case 13:n=e[r++],t+=String.fromCharCode((31&i)<<6|63&n);break;case 14:n=e[r++],o=e[r++],t+=String.fromCharCode((15&i)<<12|(63&n)<<6|63&o)}return t}function xl(e,t){}function Al(e){if(!e||!e.length)return 0;let t=Module._malloc(e.length);return t&&writeArrayToMemory(e,t),t}function Cl(e){e&&Module._free(e)}let Fl=!1,Pl=!0;function Il(e){if(Es&&(Ss||lr.isUseSsrcStream()))if(Xu(e.ssrc,e.width,e.height),td&&rd&&e.ssrc===td&&we(e.ssrc,e.r_w,e.r_h,e.rotation),Fl&&pe(e,Pl),dh(e.ssrc)&&!ks.firstflag&&(postMessage({status:"NewActiveSpeakerFirstframeCallback",ssrc:ks.ssrc}),ks.firstflag=!0),lr.isUseSsrcStream()){let t;t=e.enableMultiDecodeVideoWithoutSAB?e.data:ie().subarray(e.yuvdataptr,e.yuvdataptr+e.yuvlength),yh.pushRemoteVideoData(e.ssrc,t,"I420",e.width,e.height,{left:e.r_x,top:e.r_y,width:e.r_w,height:e.r_h},{rotation:e.rotation}),e.yuvdataptr&&Module._free(e.yuvdataptr)}else Ss.Update_RemoteVideo_Texture(e);else e.yuvdataptr&&(Module._free(e.yuvdataptr),e.yuvdataptr=null)}var Ol,Dl=null,Ll=null;function Wl(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;jd.hwencThreadWorker&&jd.hwencThreadWorker.postMessage({cmd:"videoframe",data:e,type:t}),e&&e.close()}var Nl=0;async function Ul(e){Sd.captureSample();let t,r,a,i=null,n=null,o=0,s=0,d=0,l=0,c=0,u=0,h=0,p=0,f=0,m=0,g=0,v=0;if(Ws){let e=8294400;i=Module._malloc(e),n=i,Us<8&&Bs>De&&(Bs=De,Sd.start(),ad.start(jl,1e3/Bs))}else n=function(){if(ld.isSupportMultiThread){let e=8294400,t=Module._malloc(e);return t||console.error("CheckVideoEncodeSharedArrayBuffer error, size=".concat(e)),t}if(!vs){let e=8294400,t=Module._malloc(e);return t||console.error("CheckVideoEncodeSharedArrayBuffer error, size=".concat(e)),t}}(),i=n;if(n)if(Po.setVideoCaptured(!0),e.frame&&e.format){let b=e.frame;if(p=jd.visibleRect.rect.width,f=jd.visibleRect.rect.height,m=0,g=0,p!==Ko||f!==Xo)return b.close(),Sd.closeSample(),void(i&&Module._free(i));let w=1;5===e.format||1===e.format?(v=p*f*4,t=v,s=p,o=f,m=0,g=0,w=5==e.format?4:1):3!=e.format?(s=p,o=f,d=s/2,l=s/2,c=p*f,u=p*f/4,h=p*f/4,v=p*f*3/2,t=v,m=0,g=0,w=2):(s=p,o=f,d=s,c=p*f,u=p*f/2,v=p*f*3/2,t=v,m=0,g=0,w=3);let S=!1;if(function(){const e=bo===Ne||bo===Ue;let t=zd&&Do&&Lo>1&&!Ls&&!Ws&&!lc&&!Ds&&jd.Signal_Encode_Thread.latestflag&&!(Ys.startFlag&&e);if(t!=Oo){let r="WCL_M,UEP|abOption:".concat(zd,"|dualCall:").concat(Do,"|mask:").concat(Ls,"|vb:").concat(Ws,"|setting:").concat(lc||Ds,"|webcodec:").concat(jd.Signal_Encode_Thread.latestflag,"|video:").concat(Ys.startFlag&&e,"|maxSubVideo:").concat(Lo,"|optCopyFrame:").concat(t);postMessage({status:_,data:r}),re(r),Oo=t}}(),Ls){let t={top:g,left:m,width:p,height:f},r=null,d=!0;if(as)r=Mc(b,t,n,d),Sd.captureSample();else{if(4==e.format){let e=p*f*5/2;Kl&&a&&a.length==e||(Kl&&Module._free(Kl),Kl=Module._malloc(e))}else cc&&cc.length==v||(cc=new Uint8Array(v));try{if(4==e.format){let e=p*f*5/2;a=GROWABLE_HEAP_U8().subarray(Kl,Kl+e),await b.copyTo(a,jd.visibleRect),cc=new Uint8Array(a.buffer,Kl,v)}else await b.copyTo(cc,jd.visibleRect)}catch(e){return te("Exception when calling frame.copyTo",e),b.close(),Sd.closeSample(),void(i&&Module._free(i))}r=Ac(s,o,cc,n,t,w,d),Sd.captureSample()}const l=1;var y;Ws||xs==l||(xs=l,jc()),Sd.ref(),lr.isUseSsrcStream()?yh.pushLocalVideoFrame(r,{mirror:Ps}):null===(y=sd)||void 0===y||y.postMessage({data:r}),ps?(S=!0,S&&Wl(r),mn(null,n,ic,Ko,Xo,4*Gs.rgba_stride,Gs.rgba_x,Gs.rgba_y,xs,S,0,Nl++,Oo)):Module._free(n),!S&&r&&(Sd.closeSample(),r.close()),S=!1,Hd=!0,s=Ko,o=Xo,p=Ko,f=Xo,m=0,g=0}else{try{if(!Oo){if(4==e.format){let e=p*f*5/2;r=GROWABLE_HEAP_U8().subarray(i,i+e)}else r=GROWABLE_HEAP_U8().subarray(i,i+v);await b.copyTo(r,jd.visibleRect)}}catch(e){return te("Exception when calling frame.copyTo",e),b.close(),Sd.closeSample(),void(i&&Module._free(i))}let a=w;if(Ws||xs==a||(xs=a,jc()),!Ws&&Ds&&!lr.isUseSsrcStream()){let e={top:g,left:m,width:p,height:f};qc(s,o,new Uint8Array(GROWABLE_HEAP_U8().subarray(n,n+t)),e,xs-1)}Ws?5==e.format||1==e.format?dn(i,v,Ko,Xo,4*Gs.rgba_stride,Gs.rgba_x,Gs.rgba_y,a):3==e.format?sn(i,0,Ko,Xo,i,c,i+c,u,i+c,u,s,d,d,m,g,3):sn(i,0,Ko,Xo,i,c,i+c,u,i+c+u,u,s,d,d,m,g,a):ps?(S=!0,S&&Wl(b),5===e.format||1===e.format?mn(null,i,v,Ko,Xo,4*Gs.rgba_stride,Gs.rgba_x,Gs.rgba_y,xs,S,0,Nl++,Oo):3==e.format?fn(i,c,i+c,u,i+c,u,s,d,d,m,g,xs,S,0,Nl++,Oo):fn(i,c,i+c,u,i+c+u,h,s,d,l,m,g,xs,S,0,Nl++,Oo)):Module._free(i),Hd=!0}S||(b.close(),Sd.closeSample())}else{Ws||1==xs||(xs=1,jc()),s=Ko,o=Xo,p=Ko,f=Xo,m=0,g=0;let r=GROWABLE_HEAP_U8().subarray(i,i+e.length);t=e.length,ic=e.length,r.set(e,0,t),mn(null,i,ic,Ko,Xo,4*Gs.rgba_stride,Gs.rgba_x,Gs.rgba_y,xs,!1,0,Nl++,Oo)}else e.frame&&(e.frame.close(),Sd.closeSample())}function Bl(e){!function(e){e!==We&&e!==Ne&&e!==Ue||(bo=e)}(e),$o&&Tu()}function Vl(e){Lo=e,Po.setSubForMe(e)}function Gl(e){Fo.setSubForMe(e)}function Hl(e){let{done:t,value:r,processed:a}=e;if(Hd=!0,t)return void(r&&r.close());if(hi.hasProcessor()&&!a&&!Ws)return hi.onFrame(r),void r.close();let i,n=r;if("undefined"==n||null==n||null==n.format||"undefined"==n.format)return te("frame reader read null video frame"),void n.close();if(n.format&&"I420"==n.format)i={frame:n,format:2};else if(n.format&&"NV12"==n.format)i={frame:n,format:3};else if(n.format&&"I420A"==n.format)i={frame:n,format:4};else if(n.format&&"BGRA"==n.format)i={frame:n,format:5};else if("RGBA"==(null==n?void 0:n.format))i={frame:n,format:1};else if(n.format)return te("Frame format ".concat(n.format," is not supported")),Os||(Os=!0,postMessage({status:T,format:n.format})),void n.close();n.visibleRect.left%2!=0?jd.visibleRect.rect.x=n.visibleRect.left-1:jd.visibleRect.rect.x=n.visibleRect.left,n.visibleRect.top%2!=0?jd.visibleRect.rect.y=n.visibleRect.top-1:jd.visibleRect.rect.y=n.visibleRect.top,n.visibleRect.width%2!=0?jd.visibleRect.rect.width=n.visibleRect.width-1:jd.visibleRect.rect.width=n.visibleRect.width,n.visibleRect.height%2!=0?jd.visibleRect.rect.height=n.visibleRect.height-1:jd.visibleRect.rect.height=n.visibleRect.height;let o=jd.visibleRect.rect.width,s=jd.visibleRect.rect.height;var d;Ko===o&&Xo===s||(Ko=o,Xo=s,Gs.rgba_stride=o,Gs.rgba_x=0,Gs.rgba_y=0,jc(),postMessage({status:w,width:Ko,height:Xo})),3e3==Fs&&(postMessage({status:E}),Fs=0),Fs%Bs==0&&Dn(7),Fs++,Ls||Ws||(Sd.ref(),lr.isUseSsrcStream()?yh.pushLocalVideoFrame(n,{mirror:Ps}):null===(d=sd)||void 0===d||d.postMessage({data:n})),Ul(i)}function jl(){for(jd.videocaptureticknumb++,jd.videocaptureticknumb%1440==0&&postMessage({status:_,data:"WCL_M,VCTN"+jd.videocaptureticknumb});vo.getLength()>2;){let e=vo.dequeue();e&&e.frame?e.frame.close():rs||!Yo&&null!=e&&e.data&&postMessage({data:e.data},[e.data.buffer])}if(dd&&(jd.isSupportVirtualBackground&&Zl&&!Ls&&!jd.vbThreadCreatedFlag||jd.threadState==Re)){let e=vo.dequeue();e&&e.frame?e.frame.close():!Yo&&null!=e&&e.data?postMessage({status:h,data:e.data},[e.data.buffer]):postMessage({status:h})}else{if(rs&&Cs.reader&&Hd)Sd.captureTicket(),Hd=!1,Cs.reader.read().then(Hl).catch((()=>{Hd=!0}));else{const t=vo.dequeue();var e=null==t?void 0:t.data;if(e){const{stride:r,x:a,y:i,frame_width:n,frame_height:o}=t;Gs.rgba_stride==r&&Gs.rgba_x==a&&Gs.rgba_y==i||(Gs.rgba_stride=r,Gs.rgba_x=a,Gs.rgba_y=i),n==Ko&&o==Xo||(Ko=n,Xo=o,jc()),Ul(e)}else t&&Ul(t)}0!=ys.size||rs||(!Yo&&e&&e.length?postMessage({status:h,data:e},[e.buffer]):postMessage({status:h}))}}var zl=!1,$l=null;function ql(e){if(jd.videoEncodeHandleFlag&&e.ssid!=ss&&e.ssid&&(jd.videoEncodeHandleFlag=!1,hn()),!jd.videoEncodeHandleFlag&&fh()&&e.ssid){let t,r=ls;t=r?r.length:0;let a=0;if(a=Al(r),$l||($l=_malloc(20480)),cn(0,0,e.ssid,e.mtu_size,$l,10,a,t,jd.videoencodethreadmaxnumb,fs,cs,!1,Vs),gn(jd.Signal_Encode_Thread.latestflag?1:0),bn(hu,uu),Cl(a),ld.kk&&ji(0,ld.kk,ld.kk.length,!1),ns){let e=Gi(ns);Qi(jo,os,e,ns.length,!cs)}for(ss=e.ssid,jd.videoEncodeHandleFlag=!0;!jd.encodequeue.isEmpty();)Id(jd.encodequeue.dequeue(),0);Qo&&ji(jo,Qo,Qo.length,!1),Yi(jo,qo?1:0),Ko=e.width,Xo=e.height,Gs.rgba_stride=e.width,zl=!0,$i(jo,e.width,e.height,e.fps,xs),Hc(),jn(Vi)}Po.startCheck(),rs||postMessage({status:h}),Us<4&&Bs>Le&&(Bs=Le),J("HCIW=".concat(Us)),Sd.start(),ad.start(jl,1e3/Bs)}var Yl,Ql,Kl,Xl=null,Zl=null,Jl=null,ec=null,tc={vcanvas:null,mcanvas:null},rc=null,ac=null,ic=0,nc=0,oc=0,sc=0,dc={dx:0,dy:0,dWidth:0,dHeight:0},lc=!1,cc=null,uc=new Uint8Array(4),hc={sx:0,sy:0,sw:0,sh:0};function _c(e){"BgImage"==e.imagename?Zl=e.data:"MaskImage"==e.imagename&&(Xl=e.data,dc=Object.assign(dc,e.maskCoordinate),Ko=Ko||e.width,Xo=Xo||e.height,Gs.rgba_stride=Ko),wc(dc,Ko,Xo)}class pc{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.id=e,this.decodeInputIndex=1,this.context=null,this.decodeOutputIndex=0,this.videoFrameBuffer=[]}destory(){this.videoFrameBuffer.forEach((e=>e.videoFrame.close())),this.videoFrameBuffer=[]}getFrameIdData(e){let t=0;return this.videoFrameBuffer.some(((r,a)=>{if(r.frameIndex<e)r.videoFrame.close();else if(r.frameIndex===e)return t=r.videoFrame,this.videoFrameBuffer.splice(0,a+1),!0;return!1})),t}putFrameIdData(e,t){this.videoFrameBuffer.push({videoFrame:e,frameIndex:t})}deleteOneFrame(){if(this.videoFrameBuffer.length){let e=this.videoFrameBuffer.shift();if(e)return e.videoFrame.close(),1}return 0}getVideoFrameNumbers(){return this.videoFrameBuffer.length}}var fc,mc,gc,vc,yc,bc=new class{constructor(){this.decodeCodecHandles=new Map,this.encodeCodecHandles=new Map,this.ssrcToMap=new Map,this.totalVideoFrameNumbers=0,this.activeIds=[],this.usingVideoFrameList=[],this.videowebcodecencodestate=1}_checkUnusefulId(e,t){if(this.ssrcToMap.has(e)&&this.ssrcToMap.get(e)!==t){const r=this.decodeCodecHandles.get(t);r&&(r.destory(),this._deleteActiveId(t)),this.ssrcToMap.delete(e)}this.ssrcToMap.has(e)||this.ssrcToMap.set(e,t)}_getTotalVideoFrameNumbers(){let e=0;for(let t of this.decodeCodecHandles.keys()){let r=this.decodeCodecHandles.get(t);r&&(e+=r.getVideoFrameNumbers())}return e}_setActiveIds(e){this._deleteActiveId(e),this.activeIds.unshift(e),this.activeIds.length>9&&this.activeIds.splice(9,this.activeIds.length-9)}_deleteActiveId(e){this.activeIds.some(((t,r)=>{if(t===e)return this.activeIds.splice(r,1),!0}))}render(e){let{id:t,iFrameNum:r,ssrc:a,rotation:i,x:n,y:o,vwidth:s,vheight:d,format_width:l,format_height:c}=e;a=Rd(a),t=a,this._checkUnusefulId(a,t);const u=this.decodeCodecHandles.get(a);if(!u)return;this._setActiveIds(t);let h=u.getFrameIdData(r);if(h){this.totalVideoFrameNumbers=this._getTotalVideoFrameNumbers();const{displayWidth:e,displayHeight:t}=h;if(Xu(a,e,t),td&&rd&&a===td&&we(a,e,t,i),Fl&&pe({ssrc:a,r_w:e,r_h:t,rotation:i},Pl),dh(a)&&!ks.firstflag&&(postMessage({status:"NewActiveSpeakerFirstframeCallback",ssrc:ks.ssrc}),ks.firstflag=!0),lr.isUseSsrcStream())yh.pushRemoteVideoFrame(a,h,{rotation:i});else if(Ss){let e=l==h.codedWidth?{x:n,y:o,width:s,height:d}:null;Ss.Update_RemoteVideo_Texture(h,!0,a,i,e)}ko.getRendererProvider().isWebGPURendererType()||h.close()}}closeFrame(e){try{const t=this.usingVideoFrameList.indexOf(e);-1!==t&&this.usingVideoFrameList.splice(t,1),e.close&&e.close()}catch(e){te("Exception when closing video frame",e)}}_checkMaxVideoFrameNumbers(e){if(this.totalVideoFrameNumbers>9-this.usingVideoFrameList.length)for(let e=this.activeIds.length-1;e>=0;e--){const t=this.activeIds[e],r=this.decodeCodecHandles.get(t);if(r||this._deleteActiveId(),r.getVideoFrameNumbers()>1){r.deleteOneFrame(),this.totalVideoFrameNumbers=this._getTotalVideoFrameNumbers();break}}if(this.totalVideoFrameNumbers>9-this.usingVideoFrameList.length){const t=this.decodeCodecHandles.get(e);t&&(t.deleteOneFrame(),this.totalVideoFrameNumbers=this._getTotalVideoFrameNumbers())}}put_data(e){let{id:t,ssrc:r,data:a,frameIndex:i}=e;if(r=Rd(r),!Cd(r)&&Rd(null==ks?void 0:ks.ssrc)!==r)return void a.close();let n=this.decodeCodecHandles.get(r);n?t!=n.id&&(n.destory(),n.id=t):(n=new pc(t),this.decodeCodecHandles.set(r,n)),n.putFrameIdData(a,i),this.totalVideoFrameNumbers++,this._checkMaxVideoFrameNumbers(r)}clearAll(){for(let e of this.decodeCodecHandles.keys()){const t=this.decodeCodecHandles.get(e);t&&t.destory()}this.decodeCodecHandles.clear(),this.ssrcToMap.clear(),this.activeIds=[]}clear(e){const t=this.decodeCodecHandles.get(e);t&&(t.destory(),this.decodeCodecHandles.delete(e));const r=this.ssrcToMap.get(e);r&&(this.ssrcToMap.delete(e),this._deleteActiveId(r))}get_context(e){var t=this.encodeCodecHandles.get(0);if(t)return t.get_context()}closeVideoEncode(){var e=this.encodeCodecHandles.get(0);e&&e.close()}clear_encodestate(){this.encodeCodecHandles&&this.encodeCodecHandles.clear()}};function wc(e,t,r){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;try{"object"==typeof t&&t.ideal&&(t=t.ideal),"object"==typeof r&&r.ideal&&(r=r.ideal),Jl&&ec||(Jl=new OffscreenCanvas(t,r),ec=se(Jl)),Jl.width==t&&Jl.height==r||(Jl.width=t,Jl.height=r)}catch(e){te("Update_Mask_Texture, width=$".concat(JSON.stringify(t),", height=").concat(JSON.stringify(r),". "),e),t=Jl.width,r=Jl.height}if(ec.clearRect(0,0,t,r),Yl=null,Xl&&Zl&&"blur"!==Zl){if(e.dWidth>0&&e.dHeight>0&&oc>0&&sc>0&&t>0&&r>0){let a=e.dx/(oc/t),i=e.dy/(sc/r),n=e.dWidth/(oc/t),o=e.dHeight/(sc/r);ec.drawImage(Xl,a,i,n,o)}let i,n,o,s;if(ec.globalCompositeOperation="source-out",Sc(),i=hc.sx,n=hc.sy,o=hc.sw,s=hc.sh,ec.drawImage(Zl,i,n,o,s,0,0,t,r),a){let e=ec.getImageData(0,0,t,r);Yl=new Uint8Array(e.data.buffer),a.updateSelfMaskImage(t,r,Yl)}}else a&&(Yl=uc,a.updateSelfMaskImage(1,1,Yl))}function Sc(){let e,t,r,a=0,i=16/9,n=Zl.width,o=Zl.height;i*o>=n?(r=n,a=n/i,e=0,t=(o-a)/2):(r=o*i,a=o,e=(n-r)/2,t=0),hc.sx=e,hc.sy=t,hc.sw=r,hc.sh=a}function Mc(e,t,r){let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=t.width,n=t.height;if(tc.mcanvas&&rc||(tc.mcanvas=new OffscreenCanvas(i,n),rc=se(tc.mcanvas)),rc&&rc.isContextLost())return;tc.mcanvas.width==i&&tc.mcanvas.height==n||(tc.mcanvas.width=i,tc.mcanvas.height=n),rc.clearRect(0,0,i,n),rc.drawImage(e,0,0,i,n),Jl?rc.drawImage(Jl,0,0,i,n):wc(dc,i,n),Ns.get(Ql)&&Ns.get(Ql).canvas&&function(e){if(!Ns.get(Ql)||!Ns.get(Ql).canvas)return;Ns.get(Ql).display||(Ns.get(Ql).display=Ns.get(Ql).canvas.getContext("2d"));const t=nc?ut(e.width,e.height,void 0,void 0,Ns.get(Ql).canvas.width/Ns.get(Ql).canvas.height):Vc?ut(e.width,e.height):null;Ps?(Is||(Ns.get(Ql).display.scale(-1,1),Is=!0),Ns.get(Ql).display.clearRect(0-Ns.get(Ql).canvas.width,0,Ns.get(Ql).canvas.width,Ns.get(Ql).canvas.height),Ns.get(Ql).display.drawImage(e,...t?[t.left,t.top,t.width,t.height]:[],0-Ns.get(Ql).canvas.width,0,Ns.get(Ql).canvas.width,Ns.get(Ql).canvas.height)):(Is&&(Ns.get(Ql).display.setTransform(1,0,0,1,0,0),Is=!1),Ns.get(Ql).display.clearRect(0,0,Ns.get(Ql).canvas.width,Ns.get(Ql).canvas.height),Ns.get(Ql).display.drawImage(e,...t?[t.left,t.top,t.width,t.height]:[],0,0,Ns.get(Ql).canvas.width,Ns.get(Ql).canvas.height))}(tc.mcanvas);let o=rc.getImageData(0,0,i,n),s=new Uint8Array(o.data.buffer);return GROWABLE_HEAP_U8().subarray(r,r+s.length).set(s,0,s.length),ic=s.length,a?new VideoFrame(tc.mcanvas,{timestamp:1e3*performance.now()}):null}function Ec(){}function Rc(){var e,t;if(ac){if(!1===(null===(e=(t=ac).isAvaiable)||void 0===e?void 0:e.call(t))){var r,a;null===(r=(a=ac).restoreContext)||void 0===r||r.call(a)}}else{const e={forceNoGL:void 0,contextOptions:{webglcontextlostCallback:Ec,webglcontextrestoredCallback:Tc},webGLResources:void 0,initMask:!0};ac=ko.createWebGLVideoRenderDisplay(tc.vcanvas,"MixMask",0,e)}}function Tc(){ac=null,Rc()}function kc(e,t){let{canvas:r,rendercanvasID:a}=t;ne(a)}function xc(e,t){let{canvas:r,rendercanvasID:a}=t;oe(a)}function Ac(e,t,r,a,i,n){var o;let s=arguments.length>6&&void 0!==arguments[6]&&arguments[6],d=i.width,l=i.height;if(tc.vcanvas||(tc.vcanvas=new OffscreenCanvas(d,l)),null===(o=ac)||void 0===o||!o.isAvaiable())return void Rc();tc.vcanvas.width==d&&tc.vcanvas.height==l||(tc.vcanvas.width=d,tc.vcanvas.height=l),ac.setVideoMode(n-1),Yl?ac.updateSelfMaskImage(d,l,Yl):wc(dc,d,l,ac);let c={x:0,y:0,width:d,height:l};ac.updateRemoteVideoTextures(e,t,i,r,0,!0,c,!1),ac.drawRemoteVideo(c);let u=ac.readPixelsSyncRequest(0,0,d,l);if(Ql&&Ns.get(Ql)&&Ns.get(Ql).canvas){!function(e,t){var r,a;if(Ns.get(t).display){if(!1===(null===(r=(a=Ns.get(t).display).isAvaiable)||void 0===r?void 0:r.call(a))){var i,n;null===(i=(n=Ns.get(t).display).restoreContext)||void 0===i||i.call(n)}}else{const r={forceNoGL:void 0,contextOptions:{webglcontextlostCallback:kc,webglcontextrestoredCallback:xc,params:{canvas:e,rendercanvasID:t}},webGLResources:void 0,initMask:!1};Ns.get(t).display=ko.createVideoRenderDisplay(e,t,0,r)}Ns.get(t).display.setFillMode(nc)}(Ns.get(Ql).canvas,Ql);let e={left:0,top:0,width:d,height:l},t={x:0,y:0,width:Ns.get(Ql).canvas.width,height:Ns.get(Ql).canvas.height};Ns.get(Ql).display.setVideoMode(0),Ns.get(Ql).display.updateSelfVideoTextures(d,l,u,e),Ns.get(Ql).display.drawSelfVideo(t,!1,Ps)}return GROWABLE_HEAP_U8().subarray(a,a+u.length).set(u,0,u.length),ic=u.length,s?new VideoFrame(u,{format:"RGBA",timestamp:1e3*performance.now(),codedWidth:d,codedHeight:l}):null}var Cc,Fc,Pc=!1,Ic=(new Object,[{dataReady:!1,configReady:!1,modelArtifacts:new Object,modelJSON:null},{dataReady:!1,configReady:!1,modelArtifacts:new Object,modelJSON:null},{dataReady:!1,configReady:!1,modelArtifacts:new Object,modelJSON:null}]);async function Oc(e,t){if(!Ic[t].dataReady||!Ic[t].configReady){if(Ic[t].dataReady=!0,Ic[t].modelJSON=JSON.parse(e.json),Ic[t].modelArtifacts.modelTopology=Ic[t].modelJSON.modelTopology,Ic[t].modelArtifacts.format=Ic[t].modelJSON.format,Ic[t].modelArtifacts.generatedBy=Ic[t].modelJSON.generatedBy,Ic[t].modelArtifacts.convertedBy=Ic[t].modelJSON.convertedBy,null!=Ic[t].modelJSON.weightsManifest)for(const e of Ic[t].modelJSON.weightsManifest)Ic[t].modelArtifacts.weightSpecs=e.weights;null!=Ic[t].modelJSON.trainingConfig&&(Ic[t].modelArtifacts.trainingConfig=Ic[t].modelJSON.trainingConfig),null!=Ic[t].modelJSON.userDefinedMetadata&&(Ic[t].modelArtifacts.userDefinedMetadata=Ic[t].modelJSON.userDefinedMetadata),Ic[t].configReady=!0,Ic[t].modelArtifacts.weightData=e.bin,gc&&Dc(t)}}function Dc(e){Ic[e].dataReady&&Ic[e].configReady&&gc&&jd&&!jd.vbThreadCreatedFlag&&jd.vbThreadWorker&&(jd.vbThreadWorker.postMessage({cmd:"vbObj"+e,tfjsUrl:vc,modelJSON:Ic[e].modelJSON,weightData:Ic[e].modelArtifacts.weightData,vbBaseUrl:yc}),Ic[e].modelArtifacts.weightData=null,Ic[e].modelJSON=null)}async function Lc(e){if(gc)return;yc=e.substr(0,e.lastIndexOf("/")+1);const t=await function(e){return Li(this,void 0,void 0,(function*(){const t=yield Di(e);return yield t.blob()}))}(e);vc=t,gc=!0,Dc(0),Dc(1),Dc(2)}function Wc(e){if(e.data){if("blur"==(Zl=e.data))on(0,0);else{let e,r,a,i,n,o;Sc(),e=hc.sx,r=hc.sy,a=hc.sw,i=hc.sh,a>1280?(n=1280,o=720):(n=a,o=i),mc||(mc=new OffscreenCanvas(n,o)),mc.width=n,mc.height=o;var t=se(mc);t.drawImage(Zl,e,r,a,i,0,0,mc.width,mc.height);let s=t.getImageData(0,0,mc.width,mc.height);if(!(fc=Module._malloc(s.data.length)))return Zl=null,Ws=!1,void console.error("Set_VB_Bg_Image malloc error, size=".concat(s.data.length));let d=new Uint8Array(s.data);GROWABLE_HEAP_U8().subarray(fc,fc+s.data.length).set(d,0,s.data.length),nn(fc,d.length,mc.width,mc.height)}Ws=!0,Po.setVBFlag(!0)}else Zl=null,Ws=!1,Po.setVBFlag(!1)}function Nc(){jd.encodeflag=!1,jd.nextWorker=jd.encThreadWorker,jd.nextWorker.postMessage({cmd:"vmch"},[jd.videoEncChannel.port1]),rn()}function Uc(){jd.encodeflag=!1,jd.nextWorker=jd.hwencThreadWorker,jd.nextWorker.postMessage({cmd:"vmch"},[jd.videoEncChannel.port2]),jd.nextWorker.postMessage({cmd:"smch"},[jd.sharingEncChannel.port2]),jd.nextWorker.postMessage({cmd:"webcodec"}),go()}function Bc(){Ys.SharingEncThreadWorker&&Ys.SharingEncThreadWorker.postMessage({cmd:"smch"},[jd.sharingEncChannel.port1]),jd.encodeflag=!1,jd.nextWorker=Ys.SharingEncThreadWorker,an()}let Vc=!1,Gc=!0;function Hc(){let e=Ko,t=Xo,r=function(e,t){return e&&t?Math.abs(e/t-4/3)<.01?2:Math.abs(e/t-16/9)<.01?3:1:1}(e,t),a=Od||il(),i=function(e,t,r,a,i){if(!i&&!a||1==e)return!1;let n=a&&t>=640,o=i&&t>=1280;return 2!=e||640==t&&480==r?n||o:((n||o)&&ee("ratio is 4:3 but wencodec not supported width: ".concat(t,", height: ").concat(r)),!1)}(r,e,t,Gc&&a&&fs,Gc&&fs);Vc&&(i=i&&3==r,r=3),ln(jo,r),jd.isEnableVideoEncodeHardWareThread&&(jd.Signal_Encode_Thread.latestflag=Gc&&i,vd(jd.Signal_Encode_Thread.latestflag?1:0))}function jc(){qi(jo,Ko,Xo,Bs,xs),Hc()}function zc(e,t){let{canvas:r,rendercanvasID:a}=t;ne(a)}function $c(e,t){let{canvas:r,rendercanvasID:a}=t;oe(a)}function qc(e,t,r,a,i){var n,o;if(!Ns.get(is)||!Ns.get(is).canvas)return;if(function(e,t){var r,a;if(Ns.get(t).display){if(!1===(null===(r=(a=Ns.get(t).display).isAvaiable)||void 0===r?void 0:r.call(a))){var i,n;null===(i=(n=Ns.get(t).display).restoreContext)||void 0===i||i.call(n)}}else{const r={forceNoGL:void 0,contextOptions:{preserveDrawingBuffer:!1,webglcontextlostCallback:zc,webglcontextrestoredCallback:$c,params:{canvas:e,rendercanvasID:t}},webGLResources:void 0,initMask:!1};Ns.get(t).display=ko.createVideoRenderDisplay(e,t,0,r)}Ns.get(t).display.setFillMode(nc)}(Ns.get(is).canvas,is),null===(n=Ns.get(is).display)||void 0===n||null===(o=n.isAvaiable)||void 0===o||!o.call(n))return;let s={x:0,y:0,width:Ns.get(is).canvas.width,height:Ns.get(is).canvas.height};Ns.get(is).display.setVideoMode(i);const d=Vc?ut(a.width,a.height):null,l=Ns.get(is).display;i===Pe?l.updateSelfVideoTextures(e,t,r,a):l.updateRemoteVideoTextures(e,t,d||a,r,0,!0,s,!1),l.drawRemoteVideo(s,Ps),ko.renderWith(l)}function Yc(){if(vo)for(;vo.getLength()>0;){let e=vo.dequeue();e.frame&&e.frame.close()}vo=new Xe}function Qc(e,t,r,a,i,n,o,s,d){zs.sharingmonitorPanelFlag&&postMessage({status:$,data:{width:e,height:t,fps:r,rtt:a,jitter:i,avg_loss:n,max_loss:o,bandwidth:s,rate:d}})}function Kc(e,t,r,a,i,n,o,s,d){zs.monitorPanelFlag&&postMessage({status:z,data:{width:e,height:t,fps:r,rtt:a,jitter:i,avg_loss:n,max_loss:o,bandwidth:s,rate:d}})}function Xc(e,t,r){const a=e?qs:zo,i=e?Oe.SESSION_TYPE_DESKSHARE:Oe.SESSION_TYPE_VIDEO,n={cmd:U,min:t,max:r,appid:i};a.sendCommand(n)}function Zc(e){const t={cmd:N,data:e};zo.sendCommand(t)}function Jc(){const e=()=>{Ji(jo,!!cs)};if(zs.qosIntervalId&&clearInterval(zs.qosIntervalId),zs.monitorPanelFlag||zs.renderFlag){if(zs.monitorPanelFlag)return void(zs.qosIntervalId=setInterval(e,zs.panelpollingInterval||Me));if(zs.renderFlag)return void(zs.qosIntervalId=setInterval(e,Ee*Me))}}function eu(){zs.sharingqosIntervalId&&clearInterval(zs.sharingqosIntervalId),zs.sharingmonitorPanelFlag&&(zs.sharingqosIntervalId=setInterval((()=>{let e=Qs.bssrcMainSession;cs&&!Ys.bpause?en(null,!0):!cs&&Ks.sharingRender.isSharingPlayWork&&en(null,!1,e)}),zs.panelpollingInterval||Me))}function tu(e){cs&&Ys.sharing_handle?$n(e):cs||qn(e)}function ru(e){cs&&ms?jn(e):!cs&&gs&&zn(e),Vi=e}var au;function iu(){if(Ns.size>4){let e=Array.from(Ns.keys());te("settingRenderCanvas set more than 4 canvas, size=".concat(Ns.size,", ids:").concat(e.join()))}}function nu(e,t){let r=new Uint8Array(44);r[0]=102,r[4]=2,r[8]=32,r.set(e,12,e.length),ld.kk=r,cs?jd.videoEncodeHandleFlag&&ji(0,r,r.length,!t):ld.threadState==ke&&ji(0,r,r.length,!t)}function ou(e){switch(e.status){case 0:Es&&Ss&&(Ss.Set_SSRC_Latest_Time_Stamp(e.data),lr.isUseSsrcStream());break;case 1:{var t;if(null===(t=Module)||void 0===t||null===(t=t.asm)||void 0===t||!t.malloc)break;let a=Module._malloc(e.data.length);if(GROWABLE_HEAP_U8().subarray(a,a+e.data.length).set(e.data),Xi(0,a,e.data.length),Ks&&Ks.sharingRender.SharingRenderObj&&Qs.startFlag){let t=new Uint32Array(e.data.buffer),r=null;for(let a=0;a<e.data.length/16;a++)if(512&t[4*a]){r=t.subarray(4*a,4*a+4);break}if(!r)return;let a=232.8*r[1]/1e9+1e3*r[2];Ks.sharingRender.SharingRenderObj.SetcATimeStamp(a-30)}Wo||(Wo=new Map);const i=new DataView(e.data.buffer,e.data.byteOffset,e.data.byteLength),n=e.data.length/16;for(let e=0;e<n;e++){var r;const t=16*e,a=i.getUint32(t,!0),n=i.getUint32(t+4,!0),o=i.getUint32(t+8,!0),s=1e3*o+n/4294967.296,d=performance.now();let l=(null===(r=Wo.get(a))||void 0===r?void 0:r.diffcount)||0;if(Wo.has(a)){const e=Wo.get(a),t=s-e.ntpTimeMs,r=d-e.realTime,i=Math.abs(t-r);r>5e3||i<=2e3||(l++,!(l&l-1)&&te("[NTP Monitor] Unreasonable time difference for SSRC ".concat(a,",").concat(JSON.stringify({ssrc:a,realTimeDiff:r.toFixed(2)+" ms",ntpTimeDiff:t.toFixed(2)+" ms",drift:i.toFixed(2)+" ms",expected:"Expected NTP diff ≈ ".concat(r.toFixed(2)," ms"),actual:"Actual NTP diff = ".concat(t.toFixed(2)," ms"),lastNtpTime:e.ntpTimeMs.toFixed(2)+" ms",currentNtpTime:s.toFixed(2)+" ms"}))))}Wo.set(a,{ntpTimeMs:s,ntpSeconds:o,ntpFraction:n,realTime:d,diffcount:l})}}break;case 2:var a;Es&&Ss&&e.data&&(Ss.Set_SSRC_Latest_Time_Stamp(e.data,e.ssrc),lr.isUseSsrcStream()),null!==(a=Ks)&&void 0!==a&&null!==(a=a.sharingRender)&&void 0!==a&&a.SharingRenderObj&&e.sdata&&Ks.sharingRender.SharingRenderObj.SetcATimeStamp(e.sdata-30)}}function su(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(te("E:H webcodec encode failed code ".concat(t," ").concat(e,", config ").concat(Wd,", retry ").concat(r,", subCode ").concat(a,", inHWThread=").concat(i)),r){Wd=Ud,Ld=Bd,hu=!1;try{let e=JSON.stringify(Ld);uu=e.includes("L1T2")?1:0}catch(e){}J("WCEF-retry=".concat(!hu,"|code=").concat(t,"|id=").concat(e,"|subCode=").concat(a,"|l1t2=").concat(uu,"|inHWThread=").concat(i))}else Th(!0,e,t),J("WCEF-code=".concat(t,"|id=").concat(e,"|subCode=").concat(a,"|l1t2=").concat(uu,"|inHWThread=").concat(i))}function du(e,t,r){postMessage({status:A,isUplink:0===e,networkLevel:t,bwLevel:r})}var lu,cu=-1;let uu=1,hu=!1;self.addEventListener("message",(function(e){var t=e.data;let r=e.data;switch(t.command){case"start_video_processor":hi.addFrameCallback(r.name,(e=>{Hl({done:!1,value:e,processed:!0})})),hi.startProcessor(r.name,new ni(r.name,xo));break;case"start_share_processor":vi.startProcessor(r.name,new ui(r.name,Ao));break;case"stop_video_processor":hi.stopProcessor(r.name);break;case"stop_share_processor":vi.stopProcessor(r.name);break;case"processor_message_port":xo=t.data;break;case"share_processor_message_port":Ao=t.data;break;case 136:cu=r.workerType;break;case 1:try{var a;if(S={enabled:!!r.enableFetchWithCache,reportLog(e){re("FetchCache: ".concat(JSON.stringify(e)))},resourcePath:r.mediaSDKCDNPath},M=Object.assign({enabled:!0,cacheName:"zm-media",reportLog(e){console.log("FetchCache",e)}},S),Si.enabled=M.enabled??!1,Si.reportLog=M.reportLog??Mi,Si.cacheName=M.cacheName??"zm-media",Si.enableLocalDebugLog=M.enableLocalDebugLog??!1,Si.resourcePath=M.resourcePath,Oi=ki&&Si.enabled&&Si.resourcePath?Ii:Ai,Io=r.webrtcvideo,J("STARTMEDIA:".concat(function(e){let t=e.confId,r=!!e.isPreviewMode?1:0;return r|=fh()?2:0,"".concat(t,":").concat(r)}(r))),r.pslVideoId&&(td=r.pslVideoId),Xs||(Xs=setInterval((()=>{fh()&&((jd&&jd.startFlag||ld.startFlag)&&po(0,!!cs),(Ys.startFlag||Qs.startFlag)&&fo(0,!!cs,Qs&&Qs.bssrcMainSession))}),1e3)),isPreviewMode&&!r.isPreviewMode&&(gd.inited&&(gd.clear(),gd.start()),Ls=!1),isPreviewMode=!!r.isPreviewMode,function(e){let t=e;if(ed=e.currentTime-performance.now(),t._id,Hs=e.graphicalname,js=e.vendorname,Yo=!!t.isChromeOrEdge,cs=!!t.sendvideo,Vs=t.uplimit?t.uplimit:0,es=t.meetingnumb+"",ts=t.meetingid,yo=!!t.enableMultiDecodeVideoWithoutSAB,To=e.isWebCodecDecoderOnWhitelist,ld.videodecodethreadnumb=t.videodecodethreadnumb,1==ld.videodecodethreadnumb&&(ld.videodecodethreadnumb=2),ld.isSupportMultiThread=!!t.isSupportMultiThread,ld.isSupportOffscreenCanvas=!!t.isSupportOffscreenCanvas,ud.isTeslaMode=e.isTeslaMode,os=t.confId,Js=e.isVDIWebview,Xt=cr,dr.init(e.renderUserAgentInfo),nr.init(e.renderCapabilitiesDesc),lr.init(e.renderConfigDesc),4===e.rendererType){lr.setIsUseSsrcStream(!0);const t=ur.loadModuleFromBlob("wasm_ssrc_stream_service_dynmod",e.wasmSsrcStreamServiceDynmodBlob);vh=t,bh=vh.exports.getSsrcManager(),yh=vh.exports.getWasmSsrcStreamPublisher(),vh.exports.setRegistryServicePort(e.registryServicePort),vh.exports.exposeService(cs?"local":"remote|default")}if(cs){jd||((jd={}).encodeThreadCreatedFlag=!1,jd.codecThreadCreatedFlag=!1,jd.threadPoolBufferMGR=new Map,jd.waitingThread=[],jd.vbThreadWorker=null,jd.encThreadWorker=null,jd.hwencThreadWorkerFlag=!1,jd.hwencThreadWorker=null,jd.SharingEncThreadWorker=null,jd.vbReadySetSpecialActionTrue=!1,jd.threadState=Re,jd.isEnableVideoEncodeHardWareThread=!1,jd.isSupportVirtualBackground=!1,jd.enableVBWasmBackend=!1,jd.videoencodethreadnumb=1,jd.nextWorker=null,jd.vloadedThreadCount=0,jd.vbThreadCreatedFlag=!1,jd.videoEncChannel="function"==typeof SharedArrayBuffer?new MessageChannel:null,jd.sharingEncChannel="function"==typeof SharedArrayBuffer?new MessageChannel:null,jd.videoEncodeHandleFlag=!1,jd.Signal_Encode_Thread={status:Re,handle:null,initwebcodecflag:!1,latestflag:!1,mscflag:!1},jd.sharingmode=0,jd.encodequeue=new Xe,jd.startFlag=!1,jd.videocaptureticknumb=0,jd.visibleRect={rect:{x:0,y:0,width:0,height:0}},jd.encodeflag=!1,jd.threadarray=[]),Od=e.is360penablehwenc,Vd=e.enable720p,zd=!!e.enableOptCopyFrame,ld.videodecodethreadnumb=1,jd.isSupportVirtualBackground=t.isSupportVirtualBackground,jd.videoencodethreadmaxnumb=e.videoencodethreadnumb,fs=e.initWebCodecFlag,jd.Signal_Encode_Thread.initwebcodecflag=fs,jd.Signal_Encode_Thread.latestflag=fs,jd.isEnableVideoEncodeHardWareThread=e.isSupportWebCodecEnocde,jd.videoencodethreadnumb=2,jd.enableVBWasmBackend=e.enableVBWasmBackend,Ld=e.hwEncAdditionalConfig,Wd=e.hwEncAddConIdx,Nd=e.supportHWEncRetry,Ud=e.hwEncRetryConIdx,Bd=e.hwEncRetryConfig,hu=Nd&&Wd<Ud;try{let e=JSON.stringify(Ld);uu=e.includes("L1T2")?1:0}catch(e){}}else Dd=e.is360penablehwdec,cd=ld.videodecodethreadnumb>1?ld.videodecodethreadnumb+3:1,fs=!!(t.isenablehw&&ld.videodecodethreadnumb>1),ld.isEnableVideoDecodeHardWareThread=t.isEnableVideoDecodeHardWareThread,ld.isEnableVideoDecodeHardWareThread||(ld.totalNumbofParseThread=3,fs=!1)}(r),Sh||(function(e){var t;Jo||null===(t=Jo=function(){let e=!1;try{e=!1}catch(e){}return e?new Kt:null}())||void 0===t||t.init({workerType:e})}(cs?$t.VIDEO_ENCODE:$t.VIDEO_DECODE),Module.MCMMonitor_Video_LOG=wl,Module.MCMMonitor_Sharing_LOG=Sl,Module.codecMRG=bc,Module.wcl_trace_log=Tl,Module.on_psl_mix_share_info_changed=_l,Module.js_info_from_wcl_video_data=pl,Module.release_video_channel_callback=gl,Module.Qos_Update_Video_Hd_info=Zc,Module.js_info_from_wcl_thread=ml,Module.decode_callback=yl,Module.responseVideoQosData=Kc,Module.Send_Data=Au,Module.change_capture_resolution=cl,Module.APP_Troubleshoting_Info=bl,Module.SAVE_IV=xl,Module.processed_capture_data_callback=fl,Module.Qos_Update_Bandwidth=Xc,Module.put_data=Il,Module.frame_callback_video_mode=eh,Module.frame_callback_mouse_video_mode=th,Module.responseSharingQosData=Qc,Module.SubScribeUpdateVideo=Vl,Module.SubScribeUpdateSharing=Gl,Sh=!0),function(e){wh||(cs?(kd(!1),e.videoencodethreadnumb>1&&(Ed(!0),dd=!0)):(kd(!0),Ed(!1)),wh=!0)}(r),isPreviewMode){!function(e){postMessage({status:27}),cs&&jd.isSupportVirtualBackground?cs&&jd.isSupportVirtualBackground&&$d("VB",1,jd.enableVBWasmBackend):postMessage({status:8}),mh(e),gh(e)}(r);break}const e={cmd:V,data:os};null===(a=zo)||void 0===a||a.sendCommand(e),fh()||(ph=!1,J("RSTHOLD")),cs?jd.isSupportVirtualBackground?jd.isSupportVirtualBackground&&$d("VB",1,jd.enableVBWasmBackend):postMessage({status:8}):(lu=r.decHAOption,J("decHAOption:".concat(lu)),Io?postMessage({status:8}):function(){if(ld.threadState==Te)return void console.error("<<<<< video decode main thread creating");if(ld.threadState==ke)return void sh();ld.threadState=Te,PThread.allocateUnusedWorker("video main decode");let e=PThread.unusedWorkers.pop();PThread.loadWasmModuleToWorker(e,(function(t){ld.decodeMainWorker=t,e.postMessage({cmd:"multiThreadFlag",multiThreadFlag:0,webcodecdecodeflag:ld.isEnableVideoDecodeHardWareThread,graphicalname:Hs,vendorname:js,isWebCodecDecoderOnWhitelist:To}),ld.helpWorker=t,ro(),ld.threadState=ke,ld.helpWorker=null,sh()}))}()),gh(r),mh(r),setTimeout((()=>{const e=us||hs;re("VIDEO_NETWORK_".concat(cs?"SEND":"RECV",":").concat(e))}),3e4)}catch(e){te("Error in startMedia",e)}break;case 3:var i;null===(i=zo)||void 0===i||i.closeWebsocket();break;case 6:var n;t.webtransportURL&&(null===(n=zo)||void 0===n||n.resetWebrTransportUrl(t.webtransportURL));break;case 4:var o;null===(o=zo)||void 0===o||o.closeWebTransport();break;case"failover":Lh(t.websocket_ip_address);break;case 2:Zs=!0,jd&&jd.hwencThreadWorker&&jd.hwencThreadWorker.postMessage({cmd:"closeMedia"}),Fo.stopCheck(),Po.stopCheck(),Xs&&(clearInterval(Xs),Xs=null),id&&(id.forceClose(),id=null),zo&&(zo.close(),zo=null),cs?(On(17),Dn(16),mo(),ad&&(Sd.stop(),ad.stop()),$o&&(clearInterval($o),$o=0)):(Hn(),pn()),console.log("videoShare.closeMedia"),function(){try{const e=!1;Ss&&Ms.length?Ms.forEach((t=>{Ss.cleanup(t.canvas,t.display,e)})):ko.cleanup(null,null,e)}catch(e){console.error("VideoShare cleanup:",e)}}();break;case 5:Lh(t.websocket_ip_address,!0);break;case"encodeVideoFrame":vo.enqueue(t.data);break;case"startVideoEncode":if(J("startVideoEncode:".concat(!!cs)),void 0!==t.disableOriginalRatio&&(Vc=!!t.disableOriginalRatio),lr.isUseSsrcStream()&&bh.setLocalVideoSsrc(t.ssid),!cs)return void(Ss&&(Ss.Set_Capture_Video_Flag(!0),Ss.Set_LocalVideo_SSRC(t.ssid),Ss.Set_Cropping_Mode(!!Vc)));jd.startFlag=!0,Hd=!0,rs=!!t.isSupportMediaStreamTrackProcessor,as=!!t.isSupport2DCanvasDrawFrame,Bs=t.fps||Bs,qd(t),ps=!0,Mh(Oe.SESSION_TYPE_VIDEO,!0);break;case"releaseStream":Cs.closeReadStream();break;case"frameStream":Cs.setReadStream(t.data);break;case"DOWNLOAD_JSON_FROM_MAIN_THREAD_OK":if("js"==t.type){Lc(t.data);break}Oc(t.data,t.index);break;case"updateVideoPara":jo&&(Yc(),Ko=t.width,Xo=t.height,Gs.rgba_stride=t.width,Gs.rgba_x=0,Gs.rgba_y=0,jc());break;case"stopVideoEncode":J("stopVideoEncode:".concat(!!cs)),hh();break;case"ENCRYPT":jo&&(qo=t.encrypt,Yi(jo,qo?1:0));break;case"SOCKET_RECONNECT":self.IS_DISABLE_SOCKET_RECONNECT=!0===r.disable;break;case 7:!function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!(e.length<4)){var r;if(130!=e[0])return r=e,Gu.includes(r[0])?function(e){cs||(Qs.sharingRTPRTCPnumb++,Qs.sharingRTPRTCPnumb%24e4==0&&postMessage({status:_,data:"WCL_M,RTCPSN"+Qs.sharingRTPRTCPnumb}));let t=2&e[1],r=null;r=t?Qs.mainSession_decoder:Qs.sharing_decoder,r?Hu(r,e,e.length):te("Session handler is null is main: ".concat(t))}(e):void Pd(e,t);vu(e)}}(t.data);break;case"OfflineCanvas":t.canvasname&&t.canvas.getContext("2d")&&ys.set(t.canvasname,t.canvas.getContext("2d"));break;case"mirrorMyVideo":Ps=t.isMirrorMyVideo,!cs&&t.isSupportOffscreenCanvas&&Ss&&Ss.setMirrorMyVideoOption(Ps);break;case"yuvVideoFrame":console.error("<<< not implemented"),t.data.close();break;case"VideoPlayStatus":Es=t.data.isVideoPlayWork;break;case"startvideointerval":rs=!!t.isSupportMediaStreamTrackProcessor,as=!!t.isSupport2DCanvasDrawFrame,Ds=!!t.isVBSettingOn,lc=!!t.isMaskSettingOn,Bs=t.fps||Bs,Hd=!0,qd(t);break;case"StartVBSetting":Ds=!0,lc=!1,Ls=!1,Us<4&&Bs>Le&&(Bs=Le),Sd.start(),ad.start(jl,1e3/Bs);break;case"VBOfflineCanvas":if(t.canvas){let e=Ns.get(t.rendercanvasID);e&&ko.cleanup(e.canvas,e.display);let r=null;(ko.getRendererProvider().isWebGLRendererType()||ko.getRendererProvider().isWebGL2RendererType())&&(r={forceNoGL:void 0,contextOptions:{preserveDrawingBuffer:!1,webglcontextlostCallback:zc,webglcontextrestoredCallback:$c,params:{canvas:t.canvas,rendercanvasID:t.rendercanvasID}},webGLResources:void 0,initMask:!1});const a=ko.createVideoRenderDisplay(t.canvas,t.rendercanvasID,0,r);Ns.set(t.rendercanvasID,{canvas:t.canvas,id:t.rendercanvasID,display:a}),iu()}is=t.rendercanvasID;break;case"MaskOfflineCanvas":if(t.canvas){let e=Ns.get(t.rendercanvasID);e&&ko.cleanup(e.canvas,e.display),Ns.set(t.rendercanvasID,{canvas:t.canvas,id:t.rendercanvasID,display:null}),iu()}Ql=t.rendercanvasID,oc=Ns.get(t.rendercanvasID).canvas.width,sc=Ns.get(t.rendercanvasID).canvas.height;break;case"vbbgimagebitmap":Wc(t);break;case"addExtVbReceiver":ho=!0;break;case"removeExtVbReceiver":ho=!1;break;case"finishVBSetting":Ns.get(is)&&Ns.get(is).display&&Ns.get(is).display.clearDisplay(),is=null,Ds=!1,ps||lc||(ac&&ac.clearDisplay(),rc&&rc.clearRect(0,0,tc.mcanvas.width,tc.mcanvas.height),self.resizeCanvas&&self.resizeCanvas());break;case"StartMaskSetting":lc=!!t.enabled,Ds=!1,Ws=!1,Ls=!0,nc=t.fillMode?1:0,Ns.get(Ql)&&Ns.get(Ql).display&&Ns.get(Ql).display.setFillMode&&Ns.get(Ql).display.setFillMode(nc),t.isSwitch&&wc(dc,Ko,Xo);break;case"update_setting_canvas_size":Ns.get(t.rendercanvasID)&&Ns.get(t.rendercanvasID).canvas&&(t.rendercanvasID===Ql||t.rendercanvasID===is)&&(Ns.get(t.rendercanvasID).canvas.width=t.width,Ns.get(t.rendercanvasID).canvas.height=t.height);break;case"maskandbgimagebitmap":lc=!0,_c(t);break;case"finishMaskSetting":Ns.get(Ql)&&Ns.get(Ql).display&&Ns.get(Ql).canvas&&(as?(Ns.get(Ql).display.setTransform(1,0,0,1,0,0),Ns.get(Ql).display.clearRect(0,0,Ns.get(Ql).canvas.width,Ns.get(Ql).canvas.height)):Ns.get(Ql).display.clearDisplay()),Ql=null,lc=!1,Is=!1,Zl||(Ls=!1),ps||Ds||(ac&&ac.clearDisplay(),rc&&rc.clearRect(0,0,tc.mcanvas.width,tc.mcanvas.height),ad.stop(),Sd.stop(),Po.stopCheck(),Yc());break;case"healthCheck":if(t.type===$e)switch(t.op){case 0:ad.stop(),Sd.stop(),Po.setPaused(!0);break;case 1:ad.start(jl,1e3/Bs),Sd.start(),Po.setPaused(!1);break;case 2:ad.stop(),Sd.stop(),Po.stopCheck()}break;case"renderOfflineCanvas":if(!t.ssrc)return;if(Qu.delete(t.ssrc>>10<<10),t.canvas)ws.get(t.rendercanvasID)&&uh(Ss,t.rendercanvasID),ws.set(t.rendercanvasID,{canvas:t.canvas});else{let e=ws.get(t.rendercanvasID);e&&(t.canvas=e.canvas)}var s,d;if(t.canvas||J("NoCanvas:".concat(t.ssrc)),1!=t.ssrc||ks.ssrc||(lr.isUseSsrcStream()?ks.ssrc=bh.getActiveSpeakerSsrc():ks.ssrc=null===(s=Ss)||void 0===s?void 0:s.getActiveSpeakerSsrc()),Es=!0,lr.isUseSsrcStream()||(Rs=t.waterMarkText,Ts=t.isCreateVideoWaterMark,null===(d=Ss)||void 0===d||d.Set_WaterMark_Info({waterMarkCanvas:!1,isCreateVideoWaterMark:Ts,videoWaterMarkName:Rs,watermarkOpacity:t.watermarkOpacity,watermarkRepeated:t.watermarkRepeated,watermarkPosition:t.watermarkPosition}),zu(Ss)),Ms.length)for(let e=0;e<Ms.length;e++)if(Ms[e].ssrc==t.ssrc&&Ms[e].zone==t.zone)return;if(Ms.push(t),!lr.isUseSsrcStream()){if((yo||ld.videodecodethreadnumb>1)&&(t.display=Ss.Get_Display(t.canvas,t.rendercanvasID,t.ssrc,Td),t.display?(t.display.setFillMode(t.fillMode,t.fillModeForResolution),ko.getRendererProvider().isWebGPURendererType()&&t.display.bindSsrc(t.ssrc)):J("NoRender:".concat(t.ssrc))),t.borderRadius){var l;const e=ht(t.borderRadius,t.width,t.height);t.borderRadius=e,null===(l=t.display)||void 0===l||l.setRoundedCornerRadius(e)}Ms.length>0&&Ss.Set_Render_Array(Ms)}Eh()&&(ld.startFlag=!0,zs.renderFlag||(zs.renderFlag=!0,Jc()));break;case 128:{var c;const e=t.rendercanvasID,r=null===(c=Ks)||void 0===c||null===(c=c.sharingRender)||void 0===c?void 0:c.SharingRenderObj;null!=r&&r.isSharingCanvas(e)&&(null==r||r.replaceCanvas(e,null)),uh(Ss,e)}break;case 153:{var u;let e=null===(u=t.data)||void 0===u?void 0:u.ssrc;if(!e||ks.ssrc==e)break;var h;lh(ks.ssrc),ks.ssrc=e,ks.firstflag=!1,Es=!0,lr.isUseSsrcStream()?bh.setActiveSpeakerSsrc(ks.ssrc):null===(h=Ss)||void 0===h||h.setActiveSpeakerSsrc(e)}break;case"cancelNewActiveSpeakerSsrcBefreCallback":lh(t.ssrc),ks.ssrc==t.ssrc&&(ks.ssrc=null,ks.firstflag=!1),0==Ms.length&&(Es=!1);break;case"CHANGE_CURRENT_ACTIVE_SSRC":au=t.ssrc,Ss&&Ss.Change_Current_SSRC(t.ssrc);break;case"stopVideoRender":if(!t.ssrc)break;if(Ts=!1,Rs="",Ms.length){let e=ws.get(t.canvas);for(let r=0;(e||lr.isUseSsrcStream())&&r<Ms.length;r++)if(Ms[r].ssrc==t.ssrc&&Ms[r].zone==t.zone){let e=Ms.splice(r,1);ch(Ss,e,t.RGBA)}}break;case"removeVideoPlay":bs&&(bs=null,Ss&&$u(Ss),Es=!1);break;case"decodeVideoPortWithAudio":t.port.onmessage=function(e){ou(e.data)};break;case"audioDecodeTime":ou(t);break;case 129:{let e=r.data.userNodeList;e&&e.forEach((e=>{let t=parseInt(e.userid);if(e.bremove)return void Ki(jo,t);let r=e.sn;if(16!=r.length&&32!=r.length)return;const a=Rd(os),i=Rd(t);if(cs&&a!==i)return;let n=Gi(r);Qi(jo,t,n,r.length,!cs),cs&&a==i&&(ns=r)}));break}case 149:{const e=601508;if(null==ms){if(null==(ms=Module._malloc(e)))return void console.log("malloc failed");Atomics.store(GROWABLE_HEAP_U32().subarray(ms/4,ms/4+e),0,0),Atomics.store(GROWABLE_HEAP_U32().subarray(ms/4,ms/4+e),1,0)}let t=r.data.interval;xh.sender={sab:wasmMemory,offset:ms,length:e,useCopy:!1,usingOneElement:!1,interval:t?10:0},zo&&zo.setSabBuffer(xh.sender,null);break}case 11:r.data.isVideo?zs.monitorPanelFlag=r.data.enable:zs.sharingmonitorPanelFlag=r.data.enable,zs.panelpollingInterval=r.data.pollingInterval,r.data.isVideo?Jc():eu();break;case 160:r.data.isVideo?($s.videoStatisticsFlag=r.data.enable,ru($s.videoStatisticsFlag)):($s.sharingStatisticsFlag=r.data.enable,tu($s.sharingStatisticsFlag));break;case 150:{const e=601508;if(gs)break;if(null==(gs=Module._malloc(e)))return void console.log("malloc failed");Atomics.store(GROWABLE_HEAP_U32().subarray(gs/4,gs/4+e),0,0),Atomics.store(GROWABLE_HEAP_U32().subarray(gs/4,gs/4+e),1,0),xh.reciver={sab:wasmMemory,offset:gs,length:e,interval:10,useCopy:!1,useOneElement:!1},zo&&zo.setSabBuffer(null,xh.reciver);break}case"mirrorSendVideo":break;case"decodeVideoPort":od&&od.close(),(od=e.ports[0]).onmessage=function(e){var t;if(Ss&&null!==(t=e.data)&&void 0!==t&&t.data){Ss.Update_LocalVideo(e.data.data);const t=ko.getRendererProvider().isWebGLRendererType(),r=ko.getRendererProvider().isWebGL2RendererType(),a=lr.isUseSsrcStream();(t||r||a)&&e.data.data.close()}else{var r;null===(r=e.data)||void 0===r||null===(r=r.data)||void 0===r||r.close()}od.postMessage({cmd:"video_un_ref"})};break;case"encodeVideoPort":sd&&(sd.close(),sd=null),(sd=e.ports[0]).onmessage=function(e){e.data&&"video_un_ref"===e.data.cmd&&Sd.unref()};break;case"update_canvas_size":{let e=ws.get(r.rendercanvasID);e?(e.canvas.width=r.width,e.canvas.height=r.height):J("USNC:".concat(r.rendercanvasID))}break;case"encodedimagebitmapwasmptr":Dl=r.data,Ll=r.wasmMemory,Ss&&(Ss.Set_LocalVideo_Buffer(Ll),Ss.Set_LocalVideo_Ptr(Dl)),lr.isUseSsrcStream()&&er("SsrcStream can not support encodedimagebitmapwasmptr!!");break;case"zoomrender":if(Ms.length){let e=ws.get(t.canvas);for(let r=0;e&&r<Ms.length;r++)if(Ms[r].ssrc==t.ssrc&&Ms[r].zone==t.zone){var p=[Ms[r]];let e={};const a=ko.getRendererProvider().isWebGLRendererType(),i=ko.getRendererProvider().isWebGL2RendererType();if((a||i)&&(e.x=Ms[r].x,e.y=Ms[r].y,e.width=Ms[r].width,e.height=Ms[r].height),Ms[r].x=t.x,Ms[r].y=t.y,Ms[r].width=t.width,Ms[r].height=t.height,t.borderRadius){var f;const e=ht(t.borderRadius,t.width,t.height);Ms[r].borderRadius=e,null===(f=Ms[r].display)||void 0===f||f.setRoundedCornerRadius(e)}Ss&&(Ss.clearUseridRender(p,t.RGBA,e),Ss.Zoom_Render(Ms[r]));break}}break;case"update_border_radius":if(Ms.length&&t.borderRadius)for(let e=0;e<Ms.length;e++)if(Ms[e].ssrc==t.ssrc&&Ms[e].zone==t.zone){if(t.borderRadius){var m;const r=ht(t.borderRadius,Ms[e].width,Ms[e].height);Ms[e].borderRadius=r,null===(m=Ms[e].display)||void 0===m||m.setRoundedCornerRadius(r)}break}break;case"hwstatus":(cs&&jd.isEnableVideoEncodeHardWareThread||ld.videodecodethreadnumb>1&&ld.isEnableVideoDecodeHardWareThread)&&fs!=t.enable&&(fs=t.enable,cs?(jd.Signal_Encode_Thread.latestflag=fs&&Gc,vd(jd.Signal_Encode_Thread.latestflag?1:0)):cs||vn(fs&&Gc?1:0));break;case"videohd":Vd=t.videohd;break;case"videofullhd":!(Gd=t.videofullhd)&&Ro.width>=1920&&postMessage({status:71,width:1280,height:720});break;case"SWITCH_WATER_MARK_FLAG":lr.isUseSsrcStream()&&(lr.setIsVideoHasWaterMark(r.isCreateSharingWaterMark),lr.setVideoWatermarkInfo({name:r.videoWaterMarkName,opacity:r.watermarkOpacity,repeated:r.watermarkRepeated,position:r.watermarkPosition})),Ss&&(Ts=r.isCreateVideoWaterMark,Rs=r.videoWaterMarkName||"",Ts||Ss.Set_WaterMark_Flag(!1),Ss.Set_WaterMark_Info({waterMarkCanvas:!1,isCreateVideoWaterMark:Ts,videoWaterMarkName:Rs,watermarkOpacity:r.watermarkOpacity,watermarkRepeated:r.watermarkRepeated,watermarkPosition:r.watermarkPosition}));break;case"sharingframeStream":Ys.videoReadStream.setReadStream(r.data);break;case"startSharingEncode":ps&&Ro.width>=1920&&postMessage({status:71,width:640,height:360}),Ys.startFlag=!0,Ys.dataFormat=1,r.isSupportMediaStreamTrackProcessor?Ys.isSupportMediaStreamTrackProcessor=!0:Ys.isSupportMediaStreamTrackProcessor=!1,Ys.isWhiteboardSharing=r.isWhiteboardSharing,Cu(r),In(!0),Mh(Oe.SESSION_TYPE_DESKSHARE,!0),Ys.can_capture_sharing=!0,Ys.capture_promise_count=0,Tu(),Md.start(),Ys.bpause=!1,Ys.isWhiteboardSharing||Fo.startCheck();break;case 9:{let e=r.data;cs&&(Ys.keyAndrosterInfo=e,Ys.isCreateHandleFlag&&Mu(Ys.sharing_handle,Ys.keyAndrosterInfo.updateParams.userId,Ys.keyAndrosterInfo.updateParams.sn,Ys.keyAndrosterInfo.updateParams.encryptKey,Ys.keyAndrosterInfo.updateParams.encryptType))}break;case"stopsharing":_h();break;case"pause":Ys.bpause=!0,Fo.stopCheck();break;case"resume":Ys.bpause=!1,Fo.startCheck();break;case"SWITCH_SHARING_TYPE":{let e=t.data;Bl(bo=e)}break;case 127:{const{canvas:e,canvasId:t}=r.data||{};if(e){if(t&&t===Ql)Ns.set(Ql,{canvas:e,id:Ql,display:null}),Ql=t,oc=Ns.get(Ql).canvas.width,sc=Ns.get(Ql).canvas.height;else if(!cs){var g;const r=Ks.sharingRender;var v;null!==(g=r.SharingRenderObj)&&void 0!==g&&g.isSharingCanvas(t)?null===(v=r.SharingRenderObj)||void 0===v||v.replaceCanvas(t,e):Ms.length>0&&(Ss.Replace_Canvas(e,t),ws.get(t)&&ws.set(t,{canvas:e}))}}else if(cs){if(tc.mcanvas&&rc){const{width:e,height:t}=tc.mcanvas;tc.mcanvas=new OffscreenCanvas(e,t),rc=tc.mcanvas.getContext("2d")}if(Jl){const{width:e,height:t}=Jl;Jl=new OffscreenCanvas(e,t),ec=Jl.getContext("2d"),wc(dc,Ko,Xo)}if(mc){const{width:e,height:t}=mc;mc=new OffscreenCanvas(e,t)}Ns.get(Ql)&&Ns.get(Ql).canvas&&ne(Ql)}break}case"ENABLE_VIDEO_OBSERVER":Fl=!!r.data,Pl=!!r.enablefps;break;case 156:if(Js)return;nu(r.data.KK,cs);break;case"WHITEBOARD_JOIN_MESSAGE":if(so||Eu(so=ao(r.nodeId,0,0,0,0,0,!1,!0,!1),r.nodeId,r.sn,r.encryptKey,2),!wo.get(r.dcsId)){wo.set(r.dcsId,!0);let e=Gi(r.EncodedSn);Fn(so,r.dcsId,e,r.EncodedSn.length),no(so,1)}if(so&&(r.dcsId&&oo(so,0,r.dcsId,0),r.data)){let e=Gi(r.data);oo(so,1,e,r.data.length)}break;case 130:{let e=r.data||{},t=!!e.hold;J("HOLD:".concat(t,":").concat(e.userid,":").concat(e.reinit)),t?(E=e,ph||(os&&E.userid&&E.userid>>10!=os>>10?J("HOLDINVALID"):(ph=!0,ns=null,hh(),so&&(io(so),so=null),wo.clear(),cs?(_h(),jd.videoEncodeHandleFlag&&(hn(),jd.videoEncodeHandleFlag=!1),Ys.isCreateHandleFlag&&(xn(),Ys.isCreateHandleFlag=!1),Ys.keyAndrosterInfo=null,Mh(Oe.SESSION_TYPE_VIDEO,!1),Mh(Oe.SESSION_TYPE_DESKSHARE,!1)):(ws.forEach(((e,t)=>{uh(Ss,t)})),_n(),Qs.sharing_cppHandler=null,null===(R=Qs.sharing_decoder)||void 0===R||R.Destroy(),Qs.sharing_decoder=null,Qs.mainSession_cppHander=null,null===(T=Qs.mainSession_decoder)||void 0===T||T.Destroy(),Qs.mainSession_decoder=null)))):function(e){ph&&(Ku=!1,ph=!1,null!=e&&e.reinit&&(os=e.userid,cs?(jd.videoEncodeHandleFlag&&(jd.videoEncodeHandleFlag=!1,hn()),postMessage({status:62}),jd.isSupportVirtualBackground?$d("VB",1,jd.enableVBWasmBackend):postMessage({status:8})):(_d.size&&console.warn("has decode thread not released",..._d.keys()),sh(),Du({confId:os,meetingnumb:es,meetingid:ts}))))}(e)}break;case"SEND_ANNOTATION_PDU":var y,b;r.data instanceof Uint8Array&&(r.isPresenter?null===(y=qs)||void 0===y||y.send(r.data):null===(b=qs)||void 0===b||b.send(r.data));break;case 133:!function(e){let t=e.content_type,r=e.cmd,a=e.type;"PDU"==t&&(r=fe(r),2==a&&sl(r),4==a&&(cs?vu(r):Uu(r)))}(r.data);break;case 138:self.postMessage({cmd:137,timestamp:Date.now()});break;case 139:{const{ssrc:e,type:t,id:a}=r;let i=null;var w;i="sharing"==t?null===(w=Ks.sharingRender)||void 0===w?void 0:w.SharingRenderObj:Ss,function(e,t,r,a){let i={id:a,status:138,success:!1};try{const{canvasId:r,options:a}=(null==e?void 0:e.getUserIdVideo(t))||{};i.success=!!r,i.data={canvasId:r,options:a},postMessage(i)}catch(e){postMessage(i)}}(i,e,0,a);break}case 144:(_u=r.data)!=pi.child&&null!=ld&&ld.binitvideo&&(to(0,3,!1),to(0,2,!1));break;case 147:!function(e){const{type:t,meetinguuid:r,mmrsigkey:a,appid:i}=e,n=2==t||1==t;let o=!1;if(3==i&&(o=null==ld?void 0:ld.binitvideo),2==i&&(o=!!Qs.sharing_decoder),_u==pi.child&&o&&n){if(eo(0,i,r,r.length),2==t){let e=fe(a);Zn(0,i,e,e.length)}Jn(0,i,t),to(0,i,n)}else o&&to(0,i,!1)}(r);break;case 158:td=r.data;break;case 159:td=0}var S,M,E,R,T;!function(e){var t,r,a,i,n;switch(e.command){case 1:if(e.isPreviewMode)break;cs?postMessage({status:62}):function(e){if(Qs.isCreateWorkers)Du(e);else{Qs.isCreateWorkers=!0,Qs.threadState=Te,PThread.allocateUnusedWorker("mainsharingdecode");let t=PThread.unusedWorkers.pop();PThread.loadWasmModuleToWorker(t,(function(t){Qs.SharingDecThreadWorker=t,Qs.SharingDecThreadWorker.postMessage({cmd:"multiThreadFlag",multiThreadFlag:0,graphicalname:Hs,vendorname:js}),ld.SharingDecThreadWorker=Qs.SharingDecThreadWorker,ld.helpWorker=ld.SharingDecThreadWorker,Ln(),ld.helpWorker=null,Qs.threadState=ke,Du(e)}))}if(!e.websocket_ip_address)return;let t=e.websocket_ip_address.replace("type=v","type=s");t=t.replace("mode=5","mode=1"),me(qs,t)&&(Qs.address=t,qs?qs.resetURL(t):qs=fu(t,Nu,Uu,Su,Bu))}(e);break;case"failover":qs?qs.resetURL(Qs.address):qs=fu(Qs.address,Nu,Uu,Vu,Bu);break;case 2:null===(t=qs)||void 0===t||t.close(),qs=null;break;case 129:{let t=e.data.userNodeList;t&&!cs&&Qs.sharing_decoder&&function(e,t){t.forEach((t=>{let r=parseInt(t.userid);if(t.bremove)return void e.RemoveCookerInfo(r);let a=t.sn;if(16!=a.length&&32!=a.length)return;let i=Gi(a);e.AddCookerInfo(r,i,a.length)}))}(Qs.sharing_decoder,t)}break;case 9:{let t=e.data;if("5"!=t.mediaActionType){ah("not sharing decode type");break}if(!cs)if(Qs.keyAndrosterInfo=t,t.isFromMainSession)!function(e,t,r,a,i){if(Rt=a,Tt=i,e){St=arguments.length>5&&void 0!==arguments[5]&&arguments[5]?e(r.userId,0,0,0,0,!1,0,!0):e(r.userId,0,0,0,0,0,!1,!1,!0);let a=Rt(r.encryptKey);t(St,a,r.encryptKey.length,r.encryptType),Tt(a)}}(Lu,Ou,t.updateParams,Al,Cl,!0),Qs.MasterRecvChanleList.length>0&&(te("retry add recv channel for master share"),Qs.MasterRecvChanleList.forEach((e=>{Ct(Fu,e)})),Qs.MasterRecvChanleList=[]);else{let e=Al(t.updateParams.encryptKey);Ou(null,e,t.updateParams.encryptKey.length,t.updateParams.encryptType,!1),Cl(e)}}break;case 10:cs||function(e){let t=e.data;if(!t.isFromMainSession||Qs.mainSession_decoder)if(t.isFromMainSession||Qs.sharing_decoder){if(t.isFromMainSession)!function(e,t){if(St&&t.body){if(t.body.add){let r=0,a=t.body.add;for(;r<a.length;r++){let t=Rt(a[r].sn);e(St,a[r].userid,t,a[r].sn.length),Tt(t)}}t.body.remove}}(Iu,t);else if(t.body){if(t.body.add){let e=0,r=t.body.add;for(;e<r.length;e++){let t=Gi(r[e].sn);Iu(Qs.sharing_decoder,r[e].userid,t,r[e].sn.length)}}t.body.remove}}else console.warn("SharingDecodeRosterInfo session handler is null");else console.warn("SharingDecodeRosterInfo main session handler is null")}(e);break;case 17:Qs.currentshareactive=e.ssrc,Qs.bssrcMainSession=e.isFromMainSession,J("ASU:".concat(e.ssrc,":").concat(!!e.isFromMainSession));break;case"BUILD_MS_CHANNEL_IN_BO":r=Nh,a=e.data,i=ju,n=Hu,wt=r(a,kt,xt,At),Et=i,Mt=n;break;case 157:{let t=e.data;J("ASC:".concat(t.ssrc,":").concat(!!t.isFromMainSession)),t.isFromMainSession?St?Ct(Fu,t):(console.warn("add sharing recv channel master handle is null"),Qs.MasterRecvChanleList.push(t)):Qs.sharing_decoder?Fu(Qs.sharing_decoder,t.ssrc,t.streamIndex,t.videoMode):(console.warn("add sharing recv channel handle is null"),Qs.AsRecvChannelList.push(t))}break;case"SHARING_REMOVE_REV_CHANNEL_TYPE":{let t=e.data;J("ASD:".concat(t.ssrc,":").concat(!!t.isFromMainSession)),t.isFromMainSession?St&&Pu(St,t.ssrc):Pu(Qs.sharing_decoder,t.ssrc)}break;case"encodeSharingFrame":e&&xu(e)}}(r),Ks&&Ks.Listener(r)}));var _u=pi.normal,pu=null;function fu(e,t,r,a,i){if(J("WSURL:".concat(!!isPreviewMode,":").concat(e.replace(/(\/media\/)\d+/,"$1".concat(No)))),isPreviewMode)return null;const n=cu==$t.VIDEO_ENCODE?Na.SHARE_ENCODE:Na.SHARE_DECODE;var o=new yi(e,n);return o.setOnMessage(r),o.onopen=t,o.onclose=i,o.oncommand=a,o}function mu(){postMessage({status:c}),cs&&null!=Ys&&Ys.startFlag&&Mh(Oe.SESSION_TYPE_DESKSHARE,!0)}let gu=!0;function vu(e,t){let r=e;if(!(102==r[0]||r.length<4)){if(r[0]==je.SHARE_REMOTE_CONTROL_UAC_JPEG_FRAME){if(!Ys.startFlag||So!=He.UAC_SOURCE)return;let e,t=0;if(gu?(e=Ni.inflate(Buffer.from(r.subarray(4,r.length)),{windowBits:31}),t=e.length):t=r.length-4,t>Vo&&(Bo&&Module._free(Bo),Vo=3*t/2,Bo=Module._malloc(Vo)),!Bo)return Vo=0,void console.error("Couldn't allocate memory");let a=gu?e:r.subarray(4,r.length);writeArrayToMemory(a,Bo);let i=co(Uo,Bo,t);if(0==i)return;let n=65535&i,o=i>>16&65535,s=n*o*4;Mo++;let d=Module._malloc(s);if(null==d&&console.error("<<<< memroy malloc error"),i=uo(Uo,Bo,t,o,n,d),0!=i)return;return 1!=Ys.dataFormat&&(Ys.dataFormat=1),Ah(o,n),void Pn(0,d,s,o,n,Ys.dataFormat)}if(r[0]!=je.SHARE_REMOTE_CONTROL_UAC_MOUSE)if(111!=r[0])if(109!=r[0])if(37!==r[0])if(Ys.isCreateHandleFlag){Ys.pdu_queue.enqueue(r);let e=Ys.pdu_queue.dequeue();for(;e;)Tn(Ys.sharing_handle,e,e.length),e=Ys.pdu_queue.dequeue()}else 66!=r[0]&&Ys.pdu_queue.enqueue(r);else postMessage({status:L,data:r});else so&&Tn(so,r,r.length);else 1==r[4]?(Mo=0,J("UAC_START"),Uo||(Uo=lo()),So=He.UAC_SOURCE):(J("UAC_STOP"),J("UAC_ASCAPTURE:".concat(Mo)),So=He.DESKTOP_SOURCE,Ys.bpause=!1,Bo&&Module._free(Bo),Bo=null,Vo=0,Go&&Module._free(Go),Go=0,Ho=0);else if(Ys.startFlag&&So==He.UAC_SOURCE){if(r.length>Ho&&(Go&&Module._free(Go),Ho=3*r.length/2,Go=Module._malloc(Ho)),!Go)return void(Ho=0);writeArrayToMemory(r,Go),_o(0,Go,r.length)}}}function yu(){return!0}function bu(){return 1}function wu(e){Hi("sharing_websocket_on_close")}function Su(e){const{cmd:t}=e;switch(t){case 184:{const{rtt:t,jitter:r,avg_loss:a,max_loss:i,bandwidth:n,rate:o,lost_packet_num:s,issend:d,ismain:l}=e;Yn(0,d,l,t,r,a,i,n,o,s);break}case 185:{const{type:t,payload_type:r,issend:a}=e;Qn(0,a,t,r);break}case 187:{const{retran:t,retran_switched:r,lostrate:a,issend:i}=e;Xn(0,i,t,r,a);break}case 186:{const{bandwidth:t,lostrate:r,issend:a}=e;Kn(0,a,t,r);break}case 196:{const{type:t,networkLevel:r,bwLevel:a}=e;postMessage({status:209,isUplink:0===t,networkLevel:r,bwLevel:a});break}case 183:postMessage({status:-15}),te("NetWork is Bad, Don't to reconnect the serer!")}}function Mu(e,t,r,a,i){let n=Gi(a);Cn(0,n,a.length,i),n=Gi(r),Fn(0,t,n,r.length)}function Eu(e,t,r,a,i){let n=Gi(a);Cn(e,n,a.length,i),n=Gi(r),Fn(e,t,n,r.length)}function Ru(e){let{done:t,value:r}=e;if(Ys.capture_promise_count--,t||Ys.bpause)return r&&r.close(),void(Ys.can_capture_sharing=!0);xu({data:r})}function Tu(){Ys.isSupportMediaStreamTrackProcessor&&Ys.videoReadStream.reader?($o&&(clearInterval($o),$o=0),$o=setInterval((function(){Ys.videocaptureticknumb++,Ys&&Ys.videocaptureticknumb%1440==0&&postMessage({status:_,data:"WCL_M,SCTN"+Ys.videocaptureticknumb});let e=performance.now();Md.captureTicket(),ku&&e-ku>1e3?(On(14),Ys.can_capture_sharing||(Ys.capture_promise_count<2&&(Ys.can_capture_sharing=!0),wd.timeoutReport(e-ku)),ku=e):Ys.can_capture_sharing&&(Ys.videoReadStream.reader.read().then(Ru).catch((e=>{Ys.can_capture_sharing=!0,te("Error trying to process sharing frame",e)})),Ys.capture_promise_count++,Ys.can_capture_sharing=!1)}),1e3/(bo===Ue?Ge:bo===Ne?Ve:Be))):Ys.isWhiteboardSharing&&($o=setInterval((function(){postMessage({status:v})}),1e3))}let ku=0;async function xu(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:He.DESKTOP_SOURCE,r=performance.now();if(ku=r,t<So){if(e&&e.data&&e.data.format)try{e.data.close()}catch(e){}return void te("UAC sharing capture format error")}Md.captureSample();let a=null;if((bo==Ne&&Ys.totalCapturedFrame%Ve==0||bo==Ue&&Ys.totalCapturedFrame%Ge==0)&&On(6),Ys.totalCapturedFrame++,e&&e.data&&Ys.isSupportMediaStreamTrackProcessor){let t,r=e.data,i=0,n=0,o=0,s=0,l=0,c=0,u=0,h=0;if(r.visibleRect.x%2!=0?Ys.visibleRect.rect.x=r.visibleRect.x-1:Ys.visibleRect.rect.x=r.visibleRect.x,r.visibleRect.y%2!=0?Ys.visibleRect.rect.y=r.visibleRect.y-1:Ys.visibleRect.rect.y=r.visibleRect.y,r.visibleRect.width%2!=0?Ys.visibleRect.rect.width=r.visibleRect.width-1:Ys.visibleRect.rect.width=r.visibleRect.width,r.visibleRect.height%2!=0?Ys.visibleRect.rect.height=r.visibleRect.height-1:Ys.visibleRect.rect.height=r.visibleRect.height,"I420"==r.format){if(2!=Ys.dataFormat&&(Ys.dataFormat=2),s=Ys.visibleRect.rect.width,l=Ys.visibleRect.rect.height,c=s,u=l,i=s*l,n=s*l/4,o=s*l/4,h=s*l*3/2,a=Module._malloc(h),!a)return Md.closeSample(),r.close(),void(Ys.can_capture_sharing=!0);Ah(c,u);try{t=GROWABLE_HEAP_U8().subarray(a,a+h),await r.copyTo(t,Ys.visibleRect)}catch(e){return Module._free(a),Md.closeSample(),r.close(),Ys.can_capture_sharing=!0,void te("Exception calling frame.copyTo",e)}Wl(r,ze),Pn(0,a,h,c,u,Ys.dataFormat)}else if("NV12"==r.format){if(3!=Ys.dataFormat&&(Ys.dataFormat=3),s=Ys.visibleRect.rect.width,l=Ys.visibleRect.rect.height,c=s,u=l,i=s*l,n=s*l/2,h=s*l*3/2,a=Module._malloc(h),!a)return Ys.can_capture_sharing=!0,Md.closeSample(),void r.close();Ah(c,u);try{t=GROWABLE_HEAP_U8().subarray(a,a+h),await r.copyTo(t,Ys.visibleRect)}catch(e){return Module._free(a),r.close(),Md.closeSample(),Ys.can_capture_sharing=!0,void te("Exception calling frame.copyTo",e)}Wl(r,ze),Pn(0,a,h,c,u,Ys.dataFormat)}else if("BGRA"==r.format||"RGBA"==r.format){if(s=Ys.visibleRect.rect.width,l=Ys.visibleRect.rect.height,c=s,u=l,h=s*l*4,a=Module._malloc(h),!a)return Md.closeSample(),r.close(),void(Ys.can_capture_sharing=!0);Ah(c,u);try{t=GROWABLE_HEAP_U8().subarray(a,a+h),await r.copyTo(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Wi(Object(r),!0).forEach((function(t){d(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Wi(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},Ys.visibleRect)),Ys.dataFormat=4,"RGBA"==r.format&&(Ys.dataFormat=1)}catch(e){return Module._free(a),Md.closeSample(),r.close(),Ys.can_capture_sharing=!0,void te("Exception calling frame.copyTo",e)}Wl(r,ze),Pn(0,a,h,Ys.sharing_raw_data_width,Ys.sharing_raw_data_height,Ys.dataFormat)}else r.format&&(console.log("dataformat:",r.format,"is not supported"),Os||(Os=!0,postMessage({status:R,format:r.format})),Md.closeSample(),r.close())}else"encodeSharingFrame"==e.command&&e.data&&(a=Module._malloc(e.data.length),1!=Ys.dataFormat&&(Ys.dataFormat=1),GROWABLE_HEAP_U8().subarray(a,a+e.data.length).set(e.data),Pn(0,a,e.data.length,e.width,e.height,Ys.dataFormat))}function Au(e){let t=e.len,r=e.ptr,a=e.sPtr;var i=new Uint8Array(t),n=GROWABLE_HEAP_U8().subarray(r+0,r+t);i.set(n,0,t),Module._free(r),cs?qs.send(i):Wu(i,Qs.sharing_cppHandler!=a)}const Cu=function(){let e=null;return async t=>{e||(e=new Promise(((e,t)=>{if(!dd)return void e(!0);Ys.threadState=Te;let r=1,a=!1;r+=8,jd.hwencThreadWorkerFlag||(jd.hwencThreadWorkerFlag=!0,r++,a=!0);for(var i=0;i<r;i++){PThread.allocateUnusedWorker();let t=PThread.unusedWorkers.pop();PThread.loadWasmModuleToWorker(t,(function(t){Ys.vloadedThreadCount++,a?1==Ys.vloadedThreadCount?(jd.hwencThreadWorker=t,Uc()):2==Ys.vloadedThreadCount?(Ys.SharingEncThreadWorker=t,Bc()):jd.threadarray.push(t):1==Ys.vloadedThreadCount?(Ys.SharingEncThreadWorker=t,Bc()):jd.threadarray.push(t),Ys.vloadedThreadCount==r&&(Ys.threadState=ke,e(!0))}))}}))),await e,function(e){if(!Ys.isCreateHandleFlag||ds!=e.ssid){Ys.isCreateHandleFlag&&xn();let t=0,r=0;pu||(pu=_malloc(20480)),Ys.isCreateHandleFlag=!0,kn(0,0,e.ssid,1100,pu,10,r,t,0,!1,!0,!0,0),yn(jd.Signal_Encode_Thread.latestflag?1:0),wn(hu,uu),ds=e.ssid,Ys.keyAndrosterInfo&&Mu(Ys.sharing_handle,Ys.keyAndrosterInfo.updateParams.userId,Ys.keyAndrosterInfo.updateParams.sn,Ys.keyAndrosterInfo.updateParams.encryptKey,Ys.keyAndrosterInfo.updateParams.encryptType)}}(t)}}();function Fu(e,t,r,a){if(!e)return J("ASNULL"),void te("sharing decode handle is null");-1!=Qs.sharingrecvchannel.findIndex((r=>r.ptr==e&&r.ssrc==t))&&(Pu(e,t),console.error("Duplicate add sharing recv ".concat(t))),e.AddRevChannel(t,r,a),Qs.sharingrecvchannel.push({ptr:e,ssrc:t}),J("ASCHANNEL:".concat(t))}function Pu(e,t){if(!e)return;let r=Qs.sharingrecvchannel.findIndex((r=>r.ptr==e&&r.ssrc==t));-1!=r&&Qs.sharingrecvchannel.splice(r,1),e.RemoveRevChannel(t),J("RMASCHANNEL:".concat(t))}function Iu(e,t,r,a){e&&e.AddRosterInfo(t,r,a)}function Ou(e,t,r,a){Nn(t,r,a,!(arguments.length>4&&void 0!==arguments[4])||arguments[4])}function Du(e){if(Qs.threadState!=ke)return;if(!fh())return void J("NOTREADY");if(Qs.sharing_decoder&&ds==e.confId)return void postMessage({status:62});Qs.sharing_decoder&&(Qs.sharing_decoder.Destroy(),Qs.sharing_decoder=null);let t=e.iv;t&&(t=new Uint8Array(t));let r,a=0;t?(ls=t,r=t.length):r=0,a=Gi(t),Qs.sharing_decoder=Lu(os,es,ts,a,r,!1,0,!1),ds=os,postMessage({status:62}),Qs.AsRecvChannelList.length>0&&(te("retry add recv channel for share decode"),Qs.AsRecvChannelList.forEach((e=>{Fu(Qs.sharing_decoder,e.ssrc,e.streamIndex,e.videoMode)})),Qs.AsRecvChannelList=[])}function Lu(e,t,r,a,i,n,o){let s=!(arguments.length>7&&void 0!==arguments[7])||arguments[7];if(s&&Qs.mainSession_decoder)return Qs.mainSession_decoder;let d=new ih({mainSession:s});d.Init(e,t,r,a,i,o),s&&(Qs.mainSession_decoder=d);let l=Qs.keyAndrosterInfo;return!l||l.isFromMainSession||s||Ou(null,Gi(l.updateParams.encryptKey),l.updateParams.encryptKey.length,l.updateParams.encryptType,s),d}function Wu(e,t){var r;t?null===(r=wt)||void 0===r||r.send(e):qs.send(e)}function Nu(){postMessage({status:c})}function Uu(e,t){var r=e;37!==r[0]?ju(r,Qs.sharing_decoder,Hu):postMessage({status:L,data:r})}function Bu(e){Hi("sharing_decode_websocket_on_close")}function Vu(e){Hi("sharing_decode_websocket_on_error")}const Gu=[66,77,78,79,133];function Hu(e,t,r){t&&e&&(0!=t[0]?fh()&&e.AnalysisData(t,r):e==Qs.sharing_decoder?qs.send(t):wt.send(t))}function ju(e,t,r,a){if(Qs.threadState!=ke)Qs.pduBuffer.enqueue(e);else{let a=Qs.pduBuffer.dequeue();for(;a;)r(t,a,a.length),a=Qs.pduBuffer.dequeue();r(t,e,e.length)}}function zu(e){if(!Ol&&e){Ol=!0;let t=e.Start_Draw.bind(e);bs=yo||ld.videodecodethreadnumb>1?t(0):t(1,30),Es=!0}}function $u(e){Ol&&(Ol=!1,e.Stop_Draw.bind(e)(),bs=null,e.ClearQueue(),e.Set_WaterMark_Info({waterMarkCanvas:!1,isCreateVideoWaterMark:Ts,videoWaterMarkName:Rs}),Es=!1)}function qu(e){J("WGLFSTOPRAF"),e&&(e.videoRenderWGLFSTOP=!0,$u(e))}function Yu(e){J("WGLRESTORE"),e&&e.videoRenderWGLFSTOP&&(zu(e),e.videoRenderWGLFSTOP=!1)}var Qu=new Set;let Ku=!1;const Xu=(e,t,r)=>{!Ku&&e&&t&&r&&(Ku=!0,postMessage({status:"FIRST_VIDEO_FRAME"}))};var Zu=-1,Ju=-1;function eh(e,t,r,a,i,n,o,s,d,l,c,u,h,_){let p=Qs.bssrcMainSession;if(!Ks||!Ks.sharingRender)return te("renderMgr.sharingRender is null"),void Module._free(e);Ks.sharingRender.canIReceiveFirstSharingFrameMap.get(a)||(Ks.sharingRender.canIReceiveFirstSharingFrameMap.set(a,!0),postMessage({status:M,ssrc:a}));let f=GROWABLE_HEAP_U8().subarray(e,e+t);var m=a,v=i,y=n;if(lr.isUseSsrcStream()){yh.pushSharingVideoData(a,f,"I420",v,y,{left:o,top:s,width:d,height:l});const t=1===yh.getSinksCount("sharing");return t?c==Zu&&u==Ju||(postMessage({status:g,logicWidth:c,logicHeight:u,absWidth:d,absHeight:l,updateRemoteInfo:t}),Zu=c,Ju=u):(Zu=-1,Ju=-1),void(e&&Module._free(e))}if(Ks.sharingRender.isSharingPlayWork&&Ks.sharingRender.SharingRenderObj){if(p!=Ks.sharingRender.SharingRenderObj.isFromMainSession)return ah("<<< SharingRenderObj.isFromMainSession error",Ks.sharingRender.SharingRenderObj.isFromMainSession,p),void(e&&Module._free(e));var b={yuvdata:f,ntptime:r,ssrc:m,width:v,height:y,r_x:o,r_y:s,r_w:d,r_h:l,logic_w:c,logic_h:u,yuv_limited:h,isFromMainSession:p,dataptr:e};Ks.sharingRender.SharingRenderObj.Put_Sharing_Data_From_Queue(b,10)}else e&&Module._free(e)}function th(e,t,r,a,i,n,o,s,d,l,c,u){if(!Ks||!Ks.sharingRender)return te("renderMgr.sharingRender is null"),Atomics.store(Qs.sharing_mouse_buffer_available,0,0),void Atomics.notify(Qs.sharing_mouse_buffer_available,0);var h=a,_=i,p=n;let f=Qs.bssrcMainSession;if(0==Atomics.load(Qs.sharing_mouse_buffer_available,0))return void ah("frame_callback_mouse_video_mode data unavailable ");const m=new Uint8Array(t),g=GROWABLE_HEAP_U8().subarray(e,e+t);m.set(g,0),Atomics.store(Qs.sharing_mouse_buffer_available,0,0),Atomics.notify(Qs.sharing_mouse_buffer_available,0);const v=c>>>0;if(lr.isUseSsrcStream())yh.pushRemoteCursorFrame(h,m,_,p,v),yh.pushRemoteCursorPosition(h,o,s,d,l);else if(Ks.sharingRender.SharingRenderObj){var y={type:"mouse_data",buffer:m,ntptime:r,ssrc:h,width:_,height:p,r_x:o,r_y:s,mLogic_w:d,mLogic_h:l,sync_id:v,isFromMainSession:f};Ks.sharingRender.SharingRenderObj.Put_Mouse_Data_Into_Queue(y)}}function rh(e,t,r,a){let i={ismain:a==Qs.mainSession_cppHander,cmd:B,mode:r};qs.sendCommand(i)}function ah(){console.warn(...arguments)}var ih=function(e){this.mainSession=!!e.mainSession};ih.prototype={Init:function(e,t,r,a,i,n){Wn(e,t,r,a,i,n,this.mainSession)},UnInit:function(){An(this.mainSession)},Destroy:function(){this.UnInit()},AddRevChannel:function(e,t,r){Vn(e,t,r,1,this.mainSession)},RemoveRevChannel:function(e){Vn(e,0,0,0,this.mainSession)},AddRosterInfo:function(e,t,r){Bn(e,t,r,this.mainSession,1)},RemvoeRosterInfo:function(e){Bn(e,0,0,this.mainSession,0)},AddCookerInfo:function(e,t,r){Un(e,t,r,1)},RemoveCookerInfo:function(e){Un(e,0,0,0)},AnalysisData:function(e,t){let r=Module._malloc(t);r&&(writeArrayToMemory(e,r),Gn(r,t,this.mainSession))}};var nh=function(e){this.sharingRenderContext=null,this.SharingRenderObj=null,this.rendercanvasID=0,this.isSharingPlayWork=!1,this.isSupportOffscreenCanvas=!1,this.isCreateSharingWaterMark=!1,this.sharingWaterMarkName=null,this.currentshareactive=null,this.waterMarkCanvasInWorker=null,this.sharingRenderInterval=null,this.canIReceiveFirstSharingFrameMap=new Map,this.sharingCanvasMap=new Map},oh=function(e){this.sharingRender=new nh};function sh(){fh()?ld.threadState==ke&&(ld.binitvideo&&ss==os||(ld.binitvideo&&_n(),un(0,0,os,1500,es,ts,0,0,ld.videodecodethreadnumb,fs,!1,!0,0,lr.shouldCropWasmFrameOnPosMismatch(),lr.shouldCropWasmFrameOnSizeMismatchOnly()),ld.binitvideo=!0,ss=os),ld.kk&&ji(0,ld.kk,ld.kk.length,!0),postMessage({status:8})):J("NOTREADY")}function dh(e){return ks.ssrc&&Rd(ks.ssrc)==Rd(e)}function lh(e){if((e=e>>10<<10)&&!Cd(e)){let t=ld.threadPoolBufferMGR.get(e);if((null==t?void 0:t.threadState)==ke)Zi(jo,e),pd(e);else if((null==t?void 0:t.threadState)==Te){let t=ld.SSrcWaitForThread.findIndex((t=>t>>10==e>>10));t>=0&&ld.SSrcWaitForThread.splice(t,1),ld.threadPoolBufferMGR.delete(e)}bc&&(bc.clear(e),vl.delete(e))}}function ch(e,t,r){if(!e)return;lr.isUseSsrcStream()||(e.clearUseridRender(t,r),e.GiveBack_Display(t,0==Ms.length),e.Set_Render_Array(Ms));let a=t[0].ssrc;ks.ssrc>>10!=a>>10&&1!=a&&lh(a),ks.ssrc&&ks.ssrc>>10==a>>10&&!Cd(1)&&lh(a),1!=a||Cd(a)||(lh(ks.ssrc),a=ks.ssrc,ks.ssrc=0),0==Ms.length&&(bc&&bc.clearAll(),Ss&&$u(Ss)),Eh()||(ld.startFlag=!1,zs.renderFlag&&(zs.renderFlag=!1,Jc()))}function uh(e,t){let r=ws.get(t)||Ns.get(t);if(r&&null!=Ms&&Ms.length){let r=e.clearColor.map((e=>e/255));for(let a=0;a<Ms.length;)if(Ms[a].rendercanvasID==t){let t=Ms.splice(a,1);try{ch(e,t,r)}catch(e){te("StopUserVideo has error: ",e)}}else a++}r&&ko.clearOffscreenCanvas(r),e&&r&&e.Clear_OffScreenCanvas(r.canvas),r&&(ws.delete(t),Ns.delete(t))}function hh(){if(cs)jd.startFlag=!1,ps=!1,lc||(ac&&ac.clearDisplay(),rc&&rc.clearRect(0,0,tc.mcanvas.width,tc.mcanvas.height)),Ds||(Ns.get(is)&&Ns.get(is).display&&Ns.get(is).display.clearDisplay(),is=null),lc||Ds||(Sd.stop(),Po.stopCheck(),ad.stop(),Yc());else if(Ss)return void Ss.Set_Capture_Video_Flag(!1)}function _h(){Ys.startFlag=!1,So=He.DESKTOP_SOURCE,ps&&Ro.width>=1920&&postMessage(Ro),$o&&(clearInterval($o),$o=0),ku=0,On(15),Ys.bpause=!1,Ys.isWhiteboardSharing=!1,In(!1),On(5),Md.stop(),Fo.stopCheck()}oh.prototype={Listener:function(e){this.SharingRenderListener(e)},SharingRenderListener:function(e){switch(e.command){case 16:{J("ASCANVAS:".concat(e.ssrc,":").concat(e.isFromMainSession,":").concat(e.rendercanvasID,":").concat(!!e.canvas)),Co||(Co=new jt({timeout:3e4,tag:"ASRENDER",callback:yd})),this.sharingRender.isSharingPlayWork=!0,this.sharingRender.isSupportOffscreenCanvas=!0,this.sharingRender.isCreateSharingWaterMark=e.isCreateSharingWaterMark,this.sharingRender.sharingWaterMarkName=e.sharingWaterMarkName,this.sharingRender.currentshareactive=e.ssrc,Qs.bssrcMainSession=e.isFromMainSession,Qs.currentshareactive=e.ssrc,this.sharingRender.waterMarkCanvasInWorker||(this.sharingRender.waterMarkCanvasInWorker=new OffscreenCanvas(0,0));let t=this.sharingRender.SharingRenderObj;t||(t=this.sharingRender.SharingRenderObj=new Wt(Object.assign({},{Notify_APPUI:null,PubSub:null,jsMediaEngine:null,renderManager:ko})),t.statisticObj=Co);const{ssrc:r,zone:a=0,isFromMainSession:i,rendercanvasID:n,canvas:o,viewPort:s}=e;t.addRender(r,a,i,o,n,s),t.Change_Current_SSRC(Qs.currentshareactive,e.isFromMainSession),t.Set_WaterMark_Info({waterMarkCanvas:this.sharingRender.waterMarkCanvasInWorker,isCreateSharingWaterMark:this.sharingRender.isCreateSharingWaterMark,sharingWaterMarkName:this.sharingRender.sharingWaterMarkName,watermarkOpacity:e.watermarkOpacity,watermarkRepeated:e.watermarkRepeated,watermarkPosition:e.watermarkPosition}),lr.isUseSsrcStream()||(t.Stop_Draw2(),t.Start_Draw2())}break;case 15:{const{ssrc:t,zone:r=0,isFromMainSession:a}=e,i=this.sharingRender.SharingRenderObj;t?i.removeRender(t,r,a):i.removeAllRender(),null!=i&&i.isHasRender()&&t||(Qs.startFlag=!1,this.sharingRender.isSharingPlayWork=!1,null==i||i.Stop_Draw2(),this.sharingRender.canIReceiveFirstSharingFrameMap=new Map)}break;case 19:this.sharingRender.canIReceiveFirstSharingFrameMap.delete(e.ssrc);break;case 14:{const t=this.sharingRender.SharingRenderObj;null==t||t.updateViewPort(e);break}case 13:this.sharingRender.isSharingPlayWork=!0,Qs.startFlag=!0;break;case"SWITCH_SHARING_WATER_MARK_FLAG":lr.setIsSharingHasWaterMark(e.isCreateSharingWaterMark),lr.setSharingWatermarkInfo({name:e.videoWaterMarkName,opacity:e.watermarkOpacity,repeated:e.watermarkRepeated,position:e.watermarkPosition}),this.sharingRender.SharingRenderObj&&(e.isCreateSharingWaterMark&&(this.sharingRender.waterMarkCanvasInWorker||(this.sharingRender.waterMarkCanvasInWorker=new OffscreenCanvas(0,0))),this.sharingRender.SharingRenderObj.Set_WaterMark_Info({waterMarkCanvas:this.sharingRender.waterMarkCanvasInWorker,isCreateSharingWaterMark:e.isCreateSharingWaterMark,sharingWaterMarkName:e.sharingWaterMarkName||"",watermarkOpacity:e.watermarkOpacity,watermarkRepeated:e.watermarkRepeated,watermarkPosition:e.watermarkPosition}));break;case 17:this.sharingRender.currentshareactive=e.ssrc,this.sharingRender.SharingRenderObj||(this.sharingRender.SharingRenderObj=new Wt(Object.assign({},{Notify_APPUI:null,PubSub:null,jsMediaEngine:null,renderManager:ko}))),this.sharingRender.SharingRenderObj.Change_Current_SSRC(this.sharingRender.currentshareactive,e.isFromMainSession);break;case 18:{const{id:t,width:r,height:a}=e.data;this.sharingRender.SharingRenderObj&&(this.sharingRender.SharingRenderObj.setOnlyAcceptUISize(!0),this.sharingRender.SharingRenderObj.updateOffscreenCanvasSize(t,r,a,!0));break}}}};var ph=!1;function fh(){return!ph}function mh(e){let t=e;var r;if(Io?postMessage({status:l}):(Lh(t.websocket_ip_address),t.webtransportURL&&(null===(r=zo)||void 0===r||r.resetWebrTransportUrl(t.webtransportURL))),!t.websocket_ip_address)return;let a=t.websocket_ip_address.replace("type=v","type=s");cs&&me(qs,a)&&(qs?qs.resetURL(a):qs=fu(a,mu,vu,Su,wu))}function gh(e){cs||ko.getRendererProvider().setRendererType(e.rendererType),e.rendererDynModBlob&&ko.getRendererProvider().loadRenderModuleFromBlob(e.rendererType,e.rendererDynModBlob),ko.setCanvasAlphaChannelEnability(e.isEnableCanvasAlphaChannel),ko.getRendererProvider().isWebGPURendererType()&&ko.getWebGPUResMgr(2).initialize(),ld.isSupportOffscreenCanvas&&(Ss||((Ss=new bt({Notify_APPUI:null,isSupportOffscreenCanvas:!0,jsMediaEngine:null,videodecodethreadnumb:yo?25:ld.videodecodethreadnumb,onStopDrawCallback:qu,onReStoreCallback:Yu,renderManager:ko})).setMirrorMyVideoOption(Ps),au&&Ss.Change_Current_SSRC(o.ssrc),null!=ks&&ks.ssrc&&(lr.isUseSsrcStream()?bh.setActiveSpeakerSsrc(ks.ssrc):Ss.setActiveSpeakerSsrc(ks.ssrc)))),Ks||(Ks=new oh)}let vh,yh,bh;var wh=!1,Sh=!1;function Mh(e,t){var r,a;const i={cmd:G,appid:e,enable:t};3==e&&(null===(r=zo)||void 0===r||r.sendCommand(i)),2==e&&(null===(a=qs)||void 0===a||a.sendCommand(i))}function Eh(){return!(1==Ms.length&&Ms[0].ssrc>>10==os>>10||0==Ms.length)}let Rh=0;function Th(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=e?jd.hwencThreadWorker:ld.isVideoCodecHelpThreadWorker;a&&a.postMessage({cmd:"webcodecfailed",encode:e,id:t,code:r}),e?(Gc=!1,jd.Signal_Encode_Thread.latestflag=!1,vd(0)):(Rh++,Rh>=4&&(Gc=!1,vn(0)))}!function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;try{const t="undefined"!=typeof DedicatedWorkerGlobalScope;if(Ha.dataTransportMgr)return;let r=new Wa({type:t?Wa.THREAD_SUB:Wa.THREAD_MAIN,remote:t?self:null});Ha.dataTransportMgr=r,r.monitorlogfn=e,qa.target||(qa.target=new qa(r),r.addTransportListChangeListener(qa.target)),t&&self.addEventListener("message",r._onrecvmainthreadlistener.bind(r))}catch(e){console.error("<<<< InitDataTransportModule",e)}}(ve);var kh,xh={};function Ah(e,t){return(Ys.sharing_raw_data_width!=e||Ys.sharing_raw_data_height!=t)&&(postMessage({status:S,width:e,height:t}),Ys.sharing_raw_data_width=e,Ys.sharing_raw_data_height=t,!0)}kh=self,Ya.instance||(Ya.instance=new Ya),Ya.instance.start(kh);let Ch=function(){let e=0;try{const t="function"==typeof MediaStreamTrack,r="function"==typeof MediaStreamTrackProcessor,a="function"==typeof VideoTrackGenerator;if(e|="function"==typeof OffscreenCanvas?1:0,e|=r&&t?4:0,e|=a&&t?8:0,1&e){let t=new OffscreenCanvas(1,1),r=t.getContext("webgl");e|=null!=r?2:0,r=null,t=null}}catch(e){}return e}();function Fh(e,t){const r={cmd:W,data:t};qs.sendCommand(r)}function Ph(e,t){let r=pu-2048;Fo.setRtpPackets();for(let t=0;t<e;t++){r+=2048;const e=ie().subarray(r,r+2048),t=e[0]|e[1]<<8;qs.sendWasm(e.subarray(2,t+2))}}function Ih(e,t,r,a){var i,n;let o=new Uint8Array(4);o[0]=r;const s=Qs.sharing_cppHandler!=a,d=ie().subarray(e,e+t);s?null===(i=Wh)||void 0===i||i.sendVideo(o,d):null===(n=qs)||void 0===n||n.sendVideo(o,d)}function Oh(e,t){Po.setRtpPackets();let r=$l-2048;for(let t=0;t<e;t++){r+=2048;const e=ie().subarray(r,r+2048),t=e[0]|e[1]<<8;zo.sendWasm(e.subarray(2,t+2))}}function Dh(e,t,r){let a=new Uint8Array(4);a[0]=r;const i=ie().subarray(e,e+t);zo.sendVideo(a,i)}function Lh(e,t){var r;e&&(J("WSURL:".concat(!(!isPreviewMode||t),":").concat(e.replace(/(\/media\/)\d+/,"$1".concat(No)))),zo?(zo.url&&zo.url!=e&&te("video websocket cid changed"),zo.resetURL(e)):(zo=function(e,t,r,a,i){const n=cu==$t.VIDEO_ENCODE?Na.VIDEO_ENCODE:Na.VIDEO_DECODE;var o=new yi(e,n);return o.setOnMessage(r),o.onopen=t,o.onclose=i,o.oncommand=a,o}(e,nd,sl,ll,dl),(xh.sender||xh.reciver)&&(null===(r=zo)||void 0===r||r.setSabBuffer(xh.sender,xh.reciver))))}self.postMessage({status:139,data:Ch});var Wh=null;function Nh(e,t,r,a){if(cu!=$t.VIDEO_DECODE)return;if(J("WSURL:false:".concat(e.replace(/(\/media\/)\d+/,"$1".concat(No)))),Wh)return i.setOnMessage(r),Wh.resetURL(e),Wh.onopen=t,void(Wh.onclose=a);let i=new yi(e,Na.MSHARE_DECODE);return i.setOnMessage(r),i.onopen=t,i.onclose=a,i.oncommand=Su,Wh=i,i}Object.keys(e).forEach((t=>self[t]=e[t]))})()})(),self.__wasmCodeDataEndFlag=1;var Module=void 0!==Module?Module:{};Module.locateFile=function(e){return e.endsWith("wasm")?wasmUrl:URL.createObjectURL(new Blob(['class webcodecDecodeWorkerMessageChannel{static handleVDMSCMessage(e){let t=e.data;switch(t.cmd){case"init":{let e=t.id,o=t.context;WebcodecDecoders[e]||(WebcodecDecoders[e]=new WebcodecDecoder(e)),WebcodecDecoders[e].init(o)}break;case"configure":{let e=t.id,o=t.buffer,a=t.extraDataLen,i=t.Width,d=t.Height,r=new Uint8Array(a),c=GROWABLE_HEAP_U8().subarray(o,o+a);return r.set(c),_free(o),WebcodecDecoders[e].configure(r,i,d),"configured"==WebcodecDecoders[e].videoDecoder.state?0:(globalTracingError("Failed to configure VideoDecoder, state:"+WebcodecDecoders[e].videoDecoder.state+", width:"+i+", height:"+d+",config_data:"+r),-1)}case"decode":{let e=t.id,o=t.NewIDR,a=t.buffer,i=t.vclBufferSize,d=(t.vclNalCount,t.ssrc),r=GROWABLE_HEAP_U8().subarray(a,a+i),c=new Uint8Array(i);c.set(r),WebcodecDecoders[e].decode(c,o,d)}}}constructor(){this.decodeMSCManager=[]}addMSC(e){this.decodeMSCManager.push(e),e.onmessage=webcodecDecodeWorkerMessageChannel.handleVDMSCMessage}}const FRAME_ENC_SUCCEED=0,FRAME_ENC_OVERTIME=1,FRAME_ENC_FAILED=2,FRAME_DEC_SUCCEED=0,FRAME_DEC_OVERTIME=1,FRAME_DEC_FAILED=2,MONITOR_TIMEOUT_MS=32e3,MAX_TIMEOUT_MS=40,TIMEOUT_UP_STEP=20,SLOW_START_TIMEOUT=100,MAX_CACHE_SIZE=20;var timeOrigin=0;const WASM_INIT_ERROR=1,BITSTREAM_ERROR=2,WEBCODEC_ERROR=3,WEBCODEC_TIMEOUT_ERROR=4,WEBCODEC_RETRY=5,WEBCODEC_ENCODE_CHECK_LENGTH=30,WEBCODEC_ENCODE_OVERTIME_THRESHOLD=10,WEBCODEC_ENCODE_STATISTICS_INTERVAL=3e3;function globalTracingError(e,t){if(t){const o={name:t?.name,code:t?.code,message:t?.message,stack:t?.stack};try{e=e+", errInfo:"+JSON.stringify(o)}catch(e){}}postMessage({cmd:"globalTracingError",data:e})}function globalTraingReport(e){postMessage({cmd:"GlobalTracingDT",data:e})}function printError(e){postMessage({cmd:"printError",data:e})}class WebCodecPerformanceStatus{constructor({encode:e,id:t}){this.inputIndex=0,this.outputIndex=0,this.timeoutIndex=0,this.timeout_id=-1,this.enabled=!1,this.startTs=0,this.isFailed=!1,this.sumDelay=0,this.maxDelay=0,this.minDelay=1e6,this.encode=e,this.id=t||0,this.inputTS=0,this.outputTS=0,this.errCode=0,this.keyFrameIdx=0,this.deltaFrameIdx=0,this.totalCodecTime=0,this._timeInterval=null,this.dropped=0,this.frameTimeoutCount=0,this.keyFrameTimeoutCount=0,this.sharingNoDataCount=0}_report(e){let t=performance.now();this.enabled=!1;let o=Math.round((t-this.startTs)/1e3*10)/10,a=Math.round(this.totalCodecTime/1e3*10)/10,i=a>0?a:o,d=Math.round(this.inputIndex/i*10)/10,r=Math.round(this.outputIndex/i*10)/10,c=Math.round(this.sumDelay/(this.outputIndex||1)*10)/10,n=Math.max(0,this.inputIndex-this.outputIndex-this.dropped),s=Module.codecMRG.getEncodeConfig(this.id);postMessage({cmd:"webcodecperformance",id:this.id,encode:this.encode,failed:this.isFailed,width:s.width,height:s.height,bitrate:s.bitrate,avgDelay:c,minDelay:this.minDelay,maxDelay:this.maxDelay,inputIndex:this.inputIndex,outputIndex:this.outputIndex,dropped:this.dropped,timeout:n,inavgFps:d,outavgFps:r,elapsed:o,codeced:a,errCode:this.errCode,subCode:webcodec_encode_subcode,configIdx:e,deltaTimeout:this.frameTimeoutCount,keyTimeout:this.keyFrameTimeoutCount,sharingNoDataCount:this.sharingNoDataCount,retried:!retry_flag,l1t2:l1t2_flag,vsId:video_share_encode_id})}start(){if(this.isFailed=!1,this.errCode=0,webcodec_encode_subcode=0,-1==this.timeout_id){this.enabled=!0,this.startTs=performance.now();let e=Module.encAddConIdx;this.timeout_id=setTimeout((()=>{this._report(e)}),32e3)}this.encode&&(this._interval=setInterval((()=>{(this.keyFrameIdx>0||this.deltaFrameIdx>5)&&(this.totalCodecTime+=3e3,this.keyFrameIdx=0,this.deltaFrameIdx=0)}),3e3))}stop(e){this.isFailed=e,-1!=this.timeout_id&&(clearTimeout(this.timeout_id),this.timeout_id=-1),this._timeInterval&&(clearInterval(this._timeInterval),this._timeInterval=null),this._report(Module.encAddConIdx)}inputInc(e=!1){this.inputIndex++,e?this.keyFrameIdx++:this.deltaFrameIdx++}outputInc(e=0){this.outputIndex++,e>0&&(this.sumDelay+=e,e>this.maxDelay&&(this.maxDelay=e),e<this.minDelay&&(this.minDelay=e))}}var Module={},codecMRG=new CodecMRG;Module.codecMRG=codecMRG;var model,tfjsUrl,vbBaseUrl,afnModel,baseModel,prob,mask,firstpayload,enableVBWasmBackend=0,multiThreadFlag=1,graphicName="",vendorName="",isWebCodecDecoderOnWhitelist=!1,webcodecdecodeflag=0,modelArtifacts={},IOhandle={},afnModelArtifacts={},afnIOHandle={},baseModelArtifacts={},baseIOHandle={},vwebcodecmsc=null,swebcodecmsc=null,vframearray=[],vSignalArray=[],sframearray=[],sSignalArray=[],dualModelOKCount=0,tfLoad=!1,VideoType=0;let tfInitPromise,decHAOption,decodeThreadSSRC,webcodecDecodeWorkerMSC,webcodecDecodeFlag=!1,webcodecEncodeFlag=!1,l1t2_flag=1,retry_flag=!1,webcodec_encode_subcode=0,video_share_encode_id=0,wasmDecodeWorkerMSC=null;IOhandle.load=function(){return modelArtifacts},IOhandle.save=function(){};var initializedJS=!1,pendingNotifiedProxyingQueues=[];function threadPrintErr(){var e=Array.prototype.slice.call(arguments).join(" ");console.error(e)}function threadAlert(){var e=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:e,threadId:Module._pthread_self()})}function initTf(e){if(!tfLoad){if("string"==typeof e)importScripts(e);else{var t=URL.createObjectURL(e);importScripts(t),URL.revokeObjectURL(t)}tfLoad=!0,tfInitPromise=tf.setBackend("webgl").then((e=>{if(!e)return Promise.reject("init tf fail 1");tf.env().set("WEBGL_PACK_CONV2DTRANSPOSE",!1)})).catch((()=>{if(!enableVBWasmBackend)return postMessage({cmd:"vbInitializeFailed"}),Promise.reject("init tf fail 2");const e=vbBaseUrl;return importScripts(e+"tf-backend-wasm.min.js"),tf.wasm.setWasmPaths(e),tf.setBackend("wasm").then((e=>{if(!e)return postMessage({cmd:"vbInitializeFailed"}),Promise.reject("init tf fail 3")}),(()=>(postMessage({cmd:"vbInitializeFailed"}),Promise.reject("init tf fail 4"))))}))}}afnIOHandle.load=function(){return afnModelArtifacts},afnIOHandle.save=function(){},baseIOHandle.load=function(){return baseModelArtifacts},baseIOHandle.save=function(){};var chunk,err=threadPrintErr;self.alert=threadAlert,Module.instantiateWasm=function(e,t){var o=new WebAssembly.Instance(Module.wasmModule,e);return t(o),Module.wasmModule=null,o.exports},self.addEventListener("unhandledrejection",(function(e){let t="";const o=e?.reason;(o instanceof Error||o instanceof ErrorEvent)&&(t+=" Message: "+o?.message+" Stack: "+(o?.error?.stack??o?.stack)),globalTracingError("Unhandled Rejection: "+JSON.stringify(e?.reason??e)+t)})),self.addEventListener("error",(e=>{globalTracingError("Message: "+e?.message+" Stack:"+e?.error?.stack)})),self.onmessage=function(e){try{if("load"===e.data.cmd){Module.wasmModule=e.data.wasmModule;for(const t of e.data.handlers)Module[t]=function(){postMessage({cmd:"callHandler",handler:t,args:[...arguments]})};if(Module.wasmMemory=e.data.wasmMemory,Module.buffer=Module.wasmMemory.buffer,Module.ENVIRONMENT_IS_PTHREAD=!0,Module.isTeslaMode=e.data.isTeslaMode,Module.is360penablehwenc=e.data.is360penablehwenc,Module.is360penablehwdec=e.data.is360penablehwdec,Module.isAndroid=e.data.isAndroid,timeOrigin=e.data.currentTime-performance.now(),"string"==typeof e.data.urlOrBlob)importScripts(e.data.urlOrBlob);else{var t=URL.createObjectURL(e.data.urlOrBlob);importScripts(t),URL.revokeObjectURL(t)}Module.encAdditionalConfig=e.data.encAdditionalConfig,Module.encAddConIdx=e.data.encAddConIdx,Module.encRetryConIdx=e.data.encRetryConIdx,Module.encRetryConfig=e.data.encRetryConfig,Module.supportHWEncRetry=e.data.supportHWEncRetry,retry_flag=e.data.supportHWEncRetry&&e.data.encAddConIdx<e.data.encRetryConIdx;try{let e=JSON.stringify(Module.encAdditionalConfig);l1t2_flag=e.includes("L1T2")?1:0}catch(e){}}else if("run"===e.data.cmd){Module.__performance_now_clock_drift=performance.now()-e.data.time,Module.__emscripten_thread_init(e.data.pthread_ptr,0,0,1),Module.establishStackSpace(),Module.PThread.receiveObjectTransfer(e.data),Module.PThread.threadInitTLS(),initializedJS||(pendingNotifiedProxyingQueues.forEach((e=>{Module.executeNotifiedProxyingQueue(e)})),pendingNotifiedProxyingQueues=[],initializedJS=!0);try{Module.invokeEntryPoint(e.data.start_routine,e.data.arg)}catch(e){if("unwind"!=e){if(!(e instanceof Module.ExitStatus))throw e;Module.keepRuntimeAlive()||Module.__emscripten_thread_exit(e.status)}}}else if("videoframe"===e.data.cmd)ProcessDataAndSignal(e.data.type,e.data);else if("vmch"===e.data.cmd)(vwebcodecmsc=e.ports[0]).onmessage=handleMessagePort;else if("smch"===e.data.cmd)(swebcodecmsc=e.ports[0]).onmessage=handleMessagePort;else if("vdmsc1"===e.data.cmd)wasmDecodeWorkerMSC=e.ports[0];else if("vdmsc2"===e.data.cmd)webcodecDecodeWorkerMSC||(webcodecDecodeWorkerMSC=new webcodecDecodeWorkerMessageChannel),webcodecDecodeWorkerMSC.addMSC(e.ports[0]);else if("multiThreadFlag"===e.data.cmd)multiThreadFlag=e.data.multiThreadFlag,e.data.webcodecdecodeflag&&(webcodecdecodeflag=e.data.webcodecdecodeflag),graphicName=e.data.graphicalname,vendorName=e.data.vendorname,isWebCodecDecoderOnWhitelist=e.data.isWebCodecDecoderOnWhitelist;else if("vbObj0"===e.data.cmd){tfjsUrl=e.data.tfjsUrl;var o=e.data.modelJSON;if(modelArtifacts.modelTopology=o.modelTopology,modelArtifacts.format=o.format,modelArtifacts.generatedBy=o.generatedBy,modelArtifacts.convertedBy=o.convertedBy,o.weightsManifest)for(var a=0;a<o.weightsManifest.length;a++)modelArtifacts.weightSpecs=o.weightsManifest[a].weights;o.trainingConfig&&(modelArtifacts.trainingConfig=o.trainingConfig),o.userDefinedMetadata&&(modelArtifacts.userDefinedMetadata=o.userDefinedMetadata),modelArtifacts.weightData=e.data.weightData,initTf(tfjsUrl),tfInitPromise.then((()=>{postMessage({cmd:"addMonitorLog",log:"TFBE-"+tf.getBackend()}),tf.loadGraphModel(IOhandle).then((function(e){model=e,postMessage({cmd:"modelReady"});var t=new Float32Array(110592),o=tf.tensor4d(t,[1,144,256,3],"float32");model.predict(o),postMessage({cmd:"vbPredictDone"})}))}))}else if("vbObj1"===e.data.cmd){tfjsUrl=e.data.tfjsUrl,vbBaseUrl=e.data.vbBaseUrl;let t=e.data.modelJSON;if(afnModelArtifacts.modelTopology=t.modelTopology,afnModelArtifacts.format=t.format,afnModelArtifacts.generatedBy=t.generatedBy,afnModelArtifacts.convertedBy=t.convertedBy,t.weightsManifest)for(let e=0;e<t.weightsManifest.length;e++)afnModelArtifacts.weightSpecs=t.weightsManifest[e].weights;t.trainingConfig&&(afnModelArtifacts.trainingConfig=t.trainingConfig),t.userDefinedMetadata&&(afnModelArtifacts.userDefinedMetadata=t.userDefinedMetadata),afnModelArtifacts.weightData=e.data.weightData,initTf(tfjsUrl),tfInitPromise.then((()=>{postMessage({cmd:"addMonitorLog",log:"TFBE-"+tf.getBackend()}),tf.loadGraphModel(afnIOHandle).then((function(e){afnModel=e,0==dualModelOKCount&&postMessage({cmd:"modelReady"});var t=new Float32Array(110592),o=new Float32Array(110592),a=new Float32Array(36864),i=tf.tensor4d(t,[1,144,256,3],"float32"),d=tf.tensor4d(o,[1,144,256,3],"float32"),r=tf.tensor4d(a,[1,144,256,1],"float32");afnModel.predict([i,d,r]),2==++dualModelOKCount&&postMessage({cmd:"vbPredictDone"})}))}))}else if("vbObj2"===e.data.cmd){tfjsUrl=e.data.tfjsUrl,vbBaseUrl=e.data.vbBaseUrl;let t=e.data.modelJSON;if(baseModelArtifacts.modelTopology=t.modelTopology,baseModelArtifacts.format=t.format,baseModelArtifacts.generatedBy=t.generatedBy,baseModelArtifacts.convertedBy=t.convertedBy,t.weightsManifest)for(let e=0;e<t.weightsManifest.length;e++)baseModelArtifacts.weightSpecs=t.weightsManifest[e].weights;t.trainingConfig&&(baseModelArtifacts.trainingConfig=t.trainingConfig),t.userDefinedMetadata&&(baseModelArtifacts.userDefinedMetadata=t.userDefinedMetadata),baseModelArtifacts.weightData=e.data.weightData,initTf(tfjsUrl),tfInitPromise.then((()=>{tf.loadGraphModel(baseIOHandle).then((function(e){baseModel=e,0==dualModelOKCount&&postMessage({cmd:"modelReady"});var t=new Float32Array(110592),o=tf.tensor4d(t,[1,144,256,3],"float32");baseModel.predict(o),2==++dualModelOKCount&&postMessage({cmd:"vbPredictDone"})}))}))}else if("vb"==e.data.cmd)multiThreadFlag=!1;else if("vbFlag"==e.data.cmd)enableVBWasmBackend=e.data.enableVBWasmBackend;else if("webcodec"==e.data.cmd)noExitRuntime=!0,decHAOption=e.data.decHAOption;else if("closeMedia"==e.data.cmd)closeVideoFrame(vframearray),closeVideoFrame(sframearray);else if("webcodecfailed"==e.data.cmd){let t=e.data.encode,o=e.data.id,a=e.data.code;t?codecMRG?.webcodecFailed(o,a):WebcodecDecoders[o]?.failed()}else globalTracingError("worker.js received unknown command "+e.data.cmd)}catch(e){throw postMessage({cmd:"tCrashed",data:e.toString()}),Module.__emscripten_thread_crashed,e}};var WebcodecDecoders=[],totalCloseVideoframe=0;function WebcodecDecoder(e){this.id=e,this.videoDecoder=null,this.context=null,this.decodeOutputIndex=0,this.ssrc=0,this.continuoustimeout=0,this.timeout=MAX_TIMEOUT_MS,this.timeoutCount=0,this.webcodecStatus=new WebCodecPerformanceStatus({encode:!1,id:e}),this.paintFrameToCanvas=function(e){if(this.webcodecStatus.outputInc(),this.timeout_id){this.continuoustimeout=0;try{postMessage({cmd:"decoded_webcodec",data:e,id:this.id,frameIndex:this.decodeOutputIndex,ssrc:this.ssrc},[e])}catch(e){globalTracingError("Failed to close video frame",e)}Module._OnVideoFrameOutputCallback(this.context,FRAME_DEC_SUCCEED,this.decodeOutputIndex),this.closeTimeout(),this.decodeOutputIndex++}else e.close()},this.onDecoderError=function(e){globalTracingError("onDecoderError",e),Module._OnVideoFrameOutputCallback(this.context,FRAME_DEC_FAILED,0),this.closeTimeout()}}function setCurrentThreadSsrc_js(e){decodeThreadSSRC=e}function InitVideoDecoder_js(e,t){return wasmDecodeWorkerMSC?(wasmDecodeWorkerMSC.postMessage({cmd:"init",id:e,context:t}),0):-1}function VideoDecoderConfigure_js(e,t,o,a,i){if(wasmDecodeWorkerMSC){let r=_malloc(o);if(!r)return-1;var d=GROWABLE_HEAP_U8().subarray(t,t+o);return writeArrayToMemory(d,r),wasmDecodeWorkerMSC.postMessage({cmd:"configure",id:e,buffer:r,extraDataLen:o,Width:a,Height:i}),0}return-1}function VideoDecoder_js(e,t,o,a,i){return wasmDecodeWorkerMSC?(wasmDecodeWorkerMSC.postMessage({cmd:"decode",id:e,buffer:t,vclBufferSize:o,NewIDR:a,vclNalCount:i,ssrc:decodeThreadSSRC}),0):-1}function GetEncThreadNum(){return 1}function GetCscThreadNum(){return 1}function js_info_from_wcl(e,t,o){var a=new Uint8Array(o),i=GROWABLE_HEAP_I8().subarray(t+0,t+o);a.set(i,0,o),postMessage({cmd:"js_info_from_wcl",data:a},[a.buffer])}function decode_callback(e,t,o,a){o?postMessage({cmd:"sharing-size",ssrc:e,size:t,ptr:o,videomode:a}):postMessage({cmd:"size",ssrc:e,size:t})}function frame_callback(e,t,o,a,i,d,r,c,n,s,l,u){var h=a;h=h>>10<<10,postMessage({cmd:"decoded",status:0,yuvdataptr:e,yuvdata:e,yuvlength:t,ntptime:0,ssrc:h,width:i,height:d,r_x:r,r_y:c,r_w:n,r_h:s,rotation:l,yuv_limited:u})}function frame_callback_webcodec(e,t,o,a,i,d,r,c,n,s,l,u){postMessage({cmd:"decoded_webcodec_render",status:0,id:e,iFrameNum:t,timestamp:o,ssrc:a,format_width:i,format_height:d,rendering_x:r,rendering_y:c,rendering_width:n,rendering_height:s,rotation:l,yuv_limited:u})}function WebcodecEncoder(e){this.id=e,this.handle=null,this.context=null,this.bsBuffer=null,this.encodereclaim=0,this.timeoutid=-1,this.webcodecStatus=new WebCodecPerformanceStatus({encode:!0,id:e}),this.chunkArr=[],this.timing=[],this.lastKeyTS=0,this.callbackInvoked=!0,this.retryFlag=!1,this.config={bitrate:15e5,framerate:30,width:1280,height:720,buffer:0}}function CodecMRG(){this.decodeCodecHandles=new Map,this.encodeCodecHandles=new Map}function UserAgentIsTesla_js(){return Module.isTeslaMode}function GetWebCodecsEncoderL1T2Flag_js(){return l1t2_flag}function GetWebCodecsEncoderFallbackFlag_js(){return!retry_flag}function LimitWebCodecsEncoderTo360_js(){return Module.is360penablehwenc}function LimitWebCodecsDecoderTo360_js(){return Module.is360penablehwdec}function IsSupportMultiThreadForWebcodec(){return webcodecdecodeflag}function getGraphicName(){return graphicName}function getVendorName(){return vendorName}function videocodec_create_helpthread(){__proxy_videocodec_create_helpthread()}function video_hw_retry_info(e,t){retry_flag=e,l1t2_flag=t}function on_psl_mix_share_info_changed(e,t,o,a,i){postMessage({cmd:"on_psl_mix_share_info_changed",shared_source_id:e,rect_x_norm:t,rect_y_norm:o,rect_cx_norm:a,rect_cy_norm:i})}function js_info_from_wcl_video_data(e,t,o,a,i,d){var r=new Uint8Array(o+4),c=GROWABLE_HEAP_I8().subarray(t+0,t+o);r[0]=a,r[1]=i,r.set(c,4,o),postMessage({cmd:"js_info_from_wcl_video_data",ssrc:e,data:r,is_sent_by_data:d},[r.buffer])}function processed_capture_data_callback(e,t,o,a,i,d,r,c,n,s){postMessage({cmd:"processed_capture_data_callback",ssrc:e,data:t,len_of_data:o,format_width:a,format_height:i,valid_x:d,valid_y:r,valid_width:c,valid_height:n,yuv_limited:s})}function SAVE_IV(e,t){postMessage({cmd:"SAVE_IV",ptr:e,len:t})}function change_capture_resolution(e){postMessage({cmd:"change_capture_resolution",type:e})}function APP_Troubleshoting_Info(e,t){let o=new Uint8Array(t);var a=GROWABLE_HEAP_I8().subarray(e+0,e+t);o.set(a,0,t),postMessage({cmd:"APP_Troubleshoting_Info",data:o,len:t})}function Set_Share_Mode_js(e){multiThreadFlag=e?0:1}function IsSupportMultiThread(){return multiThreadFlag?1:0}function hardcodecpunumber(){return navigator.hardwareConcurrency||1}function execute(e,t,o,a){if(model)try{var i=new Float32Array(GROWABLE_HEAP_U8().buffer,e,t),d=tf.tensor4d(i,[1,144,256,3],"float32"),r=model.predict(d),c=Float32Array.from(r.as1D(36864).arraySync());return GROWABLE_HEAP_F32().set(c,o>>2),d.dispose(),r.dispose(),0}catch(e){return globalTracingError("Multi Thread VB error",e),-1}}function execute_base(e,t,o,a){return tf.tidy((()=>{var i=new Float32Array(wasmMemory.buffer,e,t),d=tf.tensor4d(i,[1,144,256,3],"float32"),r=baseModel.predict(d);1==r[1].size?(mask=Float32Array.from(r[0].as1D(36864).arraySync()),prob=Float32Array.from(r[1].as1D(1).arraySync())):(mask=Float32Array.from(r[1].as1D(36864).arraySync()),prob=Float32Array.from(r[0].as1D(1).arraySync()));let c=new Float32Array(wasmMemory.buffer);c.set(mask,o>>2),c.set(prob,a>>2)})),0}function execute_afn(e,t,o,a,i){return tf.tidy((()=>{var d=new Float32Array(GROWABLE_HEAP_U8().buffer,e,a),r=new Float32Array(GROWABLE_HEAP_U8().buffer,t,a),c=new Float32Array(GROWABLE_HEAP_U8().buffer,o,a/3),n=tf.tensor4d(d,[1,144,256,3],"float32"),s=tf.tensor4d(r,[1,144,256,3],"float32"),l=tf.tensor4d(c,[1,144,256,1],"float32"),u=afnModel.predict([n,s,l]);mask=Float32Array.from(u.as1D(36864).arraySync()),GROWABLE_HEAP_F32().set(mask,i>>2)})),0}function wcl_trace_log(e,t){var o=new Uint8Array(t),a=GROWABLE_HEAP_I8().subarray(e+0,e+t);o.set(a,0,t),postMessage({cmd:"wcl_trace_log",data:o},[o.buffer])}function LOG_OUT(e,t){var o=new Uint8Array(t),a=GROWABLE_HEAP_I8().subarray(e+0,e+t);o.set(a,0,t),postMessage({cmd:"wcl_trace_log",data:o},[o.buffer])}function share_mouse_data(e,t,o){postMessage({cmd:"Send_Data",ptr:e,len:t,sPtr:o})}function on_keyframe_request(e,t,o){postMessage({cmd:"Send_Data",ptr:e,len:t,sPtr:o})}function on_keyframe_request_ex(e,t,o){postMessage({cmd:"Send_Data",ptr:e,len:t,sPtr:o})}function getNTPBaseTime(){return timeOrigin}function reportSenderNTPTime(e,t){postMessage({cmd:"addMonitorLog",log:"TO:"+timeOrigin+", CT:"+performance.now()+", NT:"+(e>>>0)+","+(t>>>0)})}function videoencode_create_helpthread(){}function closeVideoFrame_js(e){}function InitVideoEncoder_js(e,t){let o;return vwebcodecmsc?(o=vwebcodecmsc,e=0):(o=swebcodecmsc,e=1),o&&o.postMessage({cmd:"VideoEncodeInit",id:e,context:t}),0}function VideoEncoderConfigure_js(e,t,o,a,i,d){let r;return vwebcodecmsc?(r=vwebcodecmsc,e=0):(r=swebcodecmsc,e=1),r&&r.postMessage({cmd:"VideoEncodeConfigure",id:e,Bitrate:t,Framerate:o,Width:a,Height:i,bsBuffer:d}),0}function VideoEncodeWebcodeRetry(e,t,o){let a;return vwebcodecmsc?(a=vwebcodecmsc,id=0):(a=swebcodecmsc,id=1),a&&a.postMessage({cmd:"VideoEncodeRetry",id:id,idx:e,config:t,code:o}),0}WebcodecDecoder.prototype.failed=function(){this.webcodecStatus.stop(!0),this.closeTimeout()},WebcodecDecoder.prototype.init=function(e){this.videoDecoder=new VideoDecoder({output:this.paintFrameToCanvas.bind(this),error:this.onDecoderError.bind(this)}),this.videoDecoder||globalTracingError("Failed to create VideoDecoder"),this.context=e,this.webcodecStatus.start()},WebcodecDecoder.prototype.configure=function(e,t,o){try{let a={codec:"avc1.640028",description:e,codedWidth:t,codedHeight:o,optimizeForLatency:!0,hardwareAcceleration:decHAOption||"prefer-hardware"};this.videoDecoder.configure(a),this.closeTimeout()}catch(e){globalTracingError("Error configuring VideoDecoder",e),this.context&&Module._OnVideoFrameOutputCallback(this.context,FRAME_DEC_FAILED,0)}},WebcodecDecoder.prototype.decode=function(e,t,o){try{this.ssrc=o,1==t?(chunk=new EncodedVideoChunk({type:"key",timestamp:0,duration:0,data:e}),firstpayload=0):chunk=new EncodedVideoChunk({type:"delta",timestamp:0,duration:0,data:e}),webcodecDecodeFlag||(webcodecDecodeFlag=!0,globalTraingReport("webcodec decode start")),this.videoDecoder.decode(chunk),this.webcodecStatus.inputInc(),this.checkTimoutRatio(),this.closeTimeout(),this.startTimeout()}catch(e){globalTracingError("Error decoding in WebcodecDecoder",e),this.context&&Module._OnVideoFrameOutputCallback(this.context,FRAME_DEC_FAILED,0)}return 0},WebcodecDecoder.prototype.startTimeout=function(){UserWebCodecController_js()&&(this.getTimeout(),this.timeout_id=setTimeout((()=>{this.timeout_id=0,this.continuoustimeout++,this.webcodecStatus.timeoutIndex++,Module._OnVideoFrameOutputCallback(this.context,1,0),this.checkAvailability()}),this.timeout))},WebcodecDecoder.prototype.getTimeout=function(){this.continuoustimeout>1?this.webcodecStatus.inputIndex<5?this.timeout=100:this.timeout+=20:this.timeout=MAX_TIMEOUT_MS},WebcodecDecoder.prototype.closeTimeout=function(){this.timeout_id&&(clearTimeout(this.timeout_id),this.timeout_id=0)},WebcodecDecoder.prototype.checkTimoutRatio=function(){if(this.webcodecStatus.inputIndex%50)return;let e=this.webcodecStatus.timeoutIndex-this.timeoutCount;this.timeoutCount=this.webcodecStatus.timeoutIndex,e>=15&&(globalTracingError("webcodec decode timed out ratio: "+Math.round(100*e/50)),this.closeTimeout(),Module._OnVideoFrameOutputCallback(this.context,FRAME_DEC_FAILED,0))},WebcodecDecoder.prototype.checkAvailability=function(){this.webcodecStatus.inputIndex-this.webcodecStatus.outputIndex>=20&&setTimeout((()=>{this.webcodecStatus.inputIndex-this.webcodecStatus.outputIndex>=20&&(globalTracingError("webcodec decode failed exceeded maximum cache frame"),this.closeTimeout(),Module._OnVideoFrameOutputCallback(this.context,FRAME_DEC_FAILED,0))}),1e3)},WebcodecEncoder.prototype.FeedbackEncodeChunk=function(){if(0===this.chunkArr.length||-1===this.timeoutid)return;if(this._stopTimeout(),this.callbackInvoked)return;const e=this.chunkArr.shift();let t=e.byteLength,o=GROWABLE_HEAP_U8().subarray(this.bsBuffer,this.bsBuffer+t);e.copyTo(o),this.callback(this.context,0,t)},WebcodecEncoder.prototype.init=function(e,t){this.id=e,this.context=t,this.handle=new VideoEncoder({output:this.EncodedVideoChunkOutputCallback.bind(this),error:this.onEncoderError.bind(this)}),this.webcodecStatus.start()},WebcodecEncoder.prototype.retry=function(e,t){if(globalTraingReport("webcodec encode retry, config "+e+", retry "+retry_flag),retry_flag){this.webcodecStatus.errCode=t,this.webcodecStatus.stop(!0),retry_flag=!1,Module.encAddConIdx=e,this.webcodecStatus=new WebCodecPerformanceStatus({encode:!0,id:this.id}),webcodecEncodeFlag=!1,this.retryFlag=!0;try{let e=JSON.stringify(Module.encAdditionalConfig);l1t2_flag=e.includes("L1T2")?1:0}catch(e){}this.webcodecStatus.start()}},WebcodecEncoder.prototype.sharingNoData=function(){if(globalTracingError("webcodec encode sharing no data"),!this._checkTimoutRatio())return this._stopTimeout(),void WebCodecsEncoderFail_js(this.id,4,!0);this.webcodecStatus.sharingNoDataCount++,this.context&&Module._OnEncodedVideoChunkOutputCallback(this.context,1,0)},WebcodecEncoder.prototype.EncodedVideoChunkOutputCallback=function(e){let t=e.timestamp;if(t<this.lastKeyTS)return void(this.chunkArr=[]);for(;this.timing.length>0&&this.timing[0].captureTS<t;)this.webcodecStatus.dropped++,this.timing.shift();if(0==this.timing.length)return void globalTraingReport("webcodec encode error: timing is empty, iid="+this.webcodecStatus.inputIndex+", oid="+this.webcodecStatus.outputIndex+", its="+this.webcodecStatus.inputTS+", ots="+this.webcodecStatus.outputTS+", dropped="+this.webcodecStatus.dropped);1==this.timing[0].isKeyFrame&&"key"!==e.type&&globalTraingReport("webcodec encode error: not key frame, key="+this.timing[0].isKeyFrame+", type="+e.type+", iid="+this.webcodecStatus.inputIndex+", oid="+this.webcodecStatus.outputIndex+", its="+this.webcodecStatus.inputTS+", ots="+this.webcodecStatus.outputTS);const o=Math.round(performance.now()-this.timing[0].encodeTS);this.timing.shift(),this.webcodecStatus.outputInc(o),this.webcodecStatus.outputTS=t,this.webcodecStatus.frameTimeoutCount=0,this.webcodecStatus.keyFrameTimeoutCount=0,this.chunkArr.push(e),this.FeedbackEncodeChunk()},WebcodecEncoder.prototype.onEncoderError=function(e){this.encodereclaim=e&&-1!==e.toString().indexOf("reclaimed"),this.encodereclaim?globalTracingError("VideoEncoder reclaimed"):(WebCodecsEncoderFail_js(this.id,3,!0),globalTracingError("webcodec encode error: VideoEncoder error, codecSize:("+this.config.width+","+this.config.height+")",e),codecMRG.closeVideoEncode(this.id))},WebcodecEncoder.prototype.configure=function(e,t,o,a,i){try{if((this.encodereclaim||this.retryFlag)&&("closed"!=this.handle.state&&this.handle.close(),this.handle=new VideoEncoder({output:this.EncodedVideoChunkOutputCallback.bind(this),error:this.onEncoderError.bind(this)}),this.encodereclaim&&(this.encodereclaim=0)),this.config={bitrate:e,framerate:t,width:o,height:a,buffer:i},this.handle){let d={...{bitrate:e,width:o,height:a,avc:{format:"annexb"},framerate:t,hardwareAcceleration:"no-preference",latencyMode:"realtime"},...Module.encAdditionalConfig};this.handle.configure(d),this.bsBuffer=i}}catch(e){this.onEncoderError(e)}},WebcodecEncoder.prototype.callback=function(e,t,o){this.callbackInvoked||(this.callbackInvoked=!0,e&&Module._OnEncodedVideoChunkOutputCallback(e,t,o))},WebcodecEncoder.prototype.encode=function(e,t,o,a,i,d){if(this.callbackInvoked=!1,(this.encodereclaim||this.retryFlag)&&this.configure(this.config.bitrate,this.config.framerate,this.config.width,this.config.height,this.config.buffer),this.retryFlag&&(t=1,this.retryFlag=!1),this._startTimeout(t,d),this.webcodecStatus.isFailed||!this._checkTimoutRatio())return this._stopTimeout(),this.webcodecStatus.isFailed||WebCodecsEncoderFail_js(this.id,4,!0),void this.callback(this.context,1,0);if(this.handle){var r={keyFrame:!1},c=VideoType?sframearray[0].data:vframearray[0].data;c&&(webcodecEncodeFlag||(webcodecEncodeFlag=!0,postMessage({cmd:"WCES"})),this.webcodecStatus.inputInc(t),this.webcodecStatus.inputTS=c.timestamp,this.webcodecStatus.inputIndex%200==0&&postMessage({cmd:"THWEC"}),1==t&&(r.keyFrame=!0,this.chunkArr=[],this.lastKeyTS=c.timestamp),this.timing.push({captureTS:c.timestamp,encodeTS:Math.round(performance.now()),isKeyFrame:t}),this.handle.encode(c,r),this.FeedbackEncodeChunk())}else globalTracingError("webcodec encode error: handle is null")},WebcodecEncoder.prototype._stopTimeout=function(){-1!=this.timeoutid&&(clearTimeout(this.timeoutid),this.timeoutid=-1)},WebcodecEncoder.prototype._checkTimoutRatio=function(){if(this.webcodecStatus.frameTimeoutCount>=6||this.webcodecStatus.keyFrameTimeoutCount>=3||this.webcodecStatus.sharingNoDataCount>=3)return webcodec_encode_subcode=1,globalTracingError("webcodec encode error: many frames timeout in webcodec, iid="+this.webcodecStatus.inputIndex+", oid="+this.webcodecStatus.outputIndex+", its="+this.webcodecStatus.inputTS+", ots="+this.webcodecStatus.outputTS+", timeout="+this.webcodecStatus.frameTimeoutCount+", keyTimeout="+this.webcodecStatus.keyFrameTimeoutCount+", sharingNoDataCount="+this.webcodecStatus.sharingNoDataCount),!1;if(this.webcodecStatus.inputIndex%30)return!0;let e=this.webcodecStatus.timeoutIndex-this.timeoutCount;return this.timeoutCount=this.webcodecStatus.timeoutIndex,!(e>=10)||(webcodec_encode_subcode=2,globalTracingError("webcodec encode error: timed out ratio: "+Math.round(100*e/30)),!1)},WebcodecEncoder.prototype._startTimeout=function(e,t){this._stopTimeout(),this.timeoutid=setTimeout((()=>{e&&this.webcodecStatus.keyFrameTimeoutCount++,this.timeoutid=-1,this.webcodecStatus.frameTimeoutCount++,this.callback(this.context,1,0),this.webcodecStatus.timeoutIndex++}),t)},WebcodecEncoder.prototype.close=function(){"closed"!=this.handle.state&&(this.handle.close(),this.handle=null),this.callbackInvoked=!0,codecMRG.clear_encodestate()},WebcodecEncoder.prototype.failed=function(e){this.webcodecStatus.errCode=e,this.webcodecStatus.stop(!0),this.context&&Module._OnEncodedVideoChunkOutputCallback(this.context,2,0)},WebcodecEncoder.prototype.getConfig=function(){return this.config},CodecMRG.prototype.initEncodeWebCodec=function(e,t){var o=this.encodeCodecHandles.get(e);o||(o=new WebcodecEncoder(e),this.encodeCodecHandles.set(e,o)),o.init(e,t)},CodecMRG.prototype.configEncodeWebCodec=function(e,t,o,a,i,d){var r=this.encodeCodecHandles.get(e);r&&r.configure(t,o,a,i,d)},CodecMRG.prototype.getEncodeConfig=function(e){var t=this.encodeCodecHandles.get(e);return t?t.getConfig():{}},CodecMRG.prototype.encodeVideoFrame=function(e,t,o,a,i,d){var r=this.encodeCodecHandles.get(e);r&&r.encode(t,o,a,i,e,d)},CodecMRG.prototype.webcodecFailed=function(e,t){var o=this.encodeCodecHandles.get(e);o&&o.failed(t)},CodecMRG.prototype.webcodecRetry=function(e,t,o){var a=this.encodeCodecHandles.get(e);a&&a.retry(t,o)},CodecMRG.prototype.sharingNoData=function(e){var t=this.encodeCodecHandles.get(e);return t?t.sharingNoData():{}},CodecMRG.prototype.closeVideoEncode=function(e){var t=this.encodeCodecHandles.get(e);t&&t.close()},CodecMRG.prototype.clear_encodestate=function(){this.encodeCodecHandles&&this.encodeCodecHandles.clear()};let count_=0;function VideoEncoder_js(e,t,o,a,i,d){let r;return vwebcodecmsc?(r=vwebcodecmsc,e=0):(r=swebcodecmsc,e=1),r&&r.postMessage({cmd:"VideoEncode",id:e,videoFrameId:t,NewIDR:o,rawData:a,dataLength:i,timeout:d}),0}function CloseVideoEncoder_js(){let e;vwebcodecmsc?(e=vwebcodecmsc,id=0):(e=swebcodecmsc,id=1),e&&e.postMessage({cmd:"CloseVideoEncode",id:id})}function BigLog_js(){return!1}function GetEncoderState_js(){return 1}function EncodeVideoFrameID_js(e,t){let o;vwebcodecmsc?(o=vwebcodecmsc,id=0):(o=swebcodecmsc,id=1,postMessage({cmd:"dv",type:e})),o&&o.postMessage({cmd:"dv",type:e})}function handleMessagePort(e){var t=e.data;switch(t.cmd){case"VideoEncodeConfigure":var o=e.data.Width,a=e.data.Height;video_share_encode_id=e.data.id;var i=e.data.Bitrate,d=e.data.Framerate,r=e.data.bsBuffer;Module.codecMRG.configEncodeWebCodec(0,i,d,o,a,r);break;case"VideoEncodeInit":{let t=0,o=e.data.context;Module.codecMRG.initEncodeWebCodec(t,o)}break;case"VideoEncode":{if(MatchDataAndSignal(t.id,e)){if(1==video_share_encode_id){let e=0;sSignalArray.shift(),Module.codecMRG.sharingNoData(e)}return}var c=e.data.videoFrameId,n=e.data.dataLength;let o=0;var s=e.data.NewIDR,l=e.data.rawData,u=e.data.timeout;VideoType=e.data.id,Module.codecMRG.encodeVideoFrame(o,c,s,l,n,u)}break;case"CloseVideoEncode":Module.codecMRG.closeVideoEncode(e.data.id);break;case"VideoEncodeRetry":{let t=0,o=e.data.code;Module.encAdditionalConfig=Module.encRetryConfig,Module.codecMRG.webcodecRetry(t,Module.encRetryConIdx,o);try{let e=JSON.stringify(Module.encRetryConfig);l1t2_flag=e.includes("L1T2")?1:0}catch(e){}}break;case"dv":if(MatchDataAndSignal(t.type,e))return;var h;0==t.type?(++totalCloseVideoframe%200==0&&postMessage({cmd:"dv2",data:totalCloseVideoframe}),h=vframearray.shift()):h=sframearray.shift(),h&&h.data&&h.data.close()}}function MatchDataAndSignal(e,t){return vframearray[0]||e?!(sframearray[0]||!e)&&(sSignalArray.push(t),!0):(vSignalArray.push(t),!0)}function ProcessDataAndSignal(e,t){e?(sframearray.push(t),sSignalArray.length&&handleMessagePort(sSignalArray.shift())):(vframearray.push(t),vSignalArray.length&&handleMessagePort(vSignalArray.shift()))}function send_data(){}function responseVideoQosData(e,t,o,a,i,d,r,c,n){postMessage({width:e,height:t,fps:o,rtt:a,jitter:i,avg_loss:d,max_loss:r,bandwidth:c,rate:n,cmd:"RVQD"})}function responseSharingQosData(e,t,o,a,i,d,r,c,n){postMessage({width:e,height:t,fps:o,rtt:a,jitter:i,avg_loss:d,max_loss:r,cmd:"RVSQD",bandwidth:c,rate:n})}function Update_Required_Bandwidth(e,t){id=vwebcodecmsc?0:1,postMessage({id:id,min:e,max:t,cmd:"URBW"})}function Update_Video_Hd_Info(e){postMessage({cmd:"UVHI",qos_hd_info:e})}function wcl_sharing_inited(e,t){postMessage({cmd:"wcl_sharing_inited",ptr:e,ismainSession:t})}var sharing_video_buffer=null,sharing_video_buffer_available=null;function frame_callback_video_mode(e,t,o,a,i,d,r,c,n,s,l,u,h,f){for(var m=GROWABLE_HEAP_U8().subarray(o,o+8),g=0,_=0;_<8;_++)g+=m[_]*Math.pow(256,_);postMessage({cmd:"sharing_decode_render",data:e,data_len:t,ts:g,ssrc:a,format_width:i,format_height:d,rgnvalid_x:r,rgnvalid_y:c,rgnvalid_width:n,rgnvalid_height:s,logical_width:l,logical_heigth:u,yuv_limited:h,ptr:f})}var sharing_mouse_buffer=null,sharing_mouse_buffer_available=null;function frame_callback_mouse_video_mode(e,t,o,a,i,d,r,c,n,s,l,u){sharing_mouse_buffer||(sharing_mouse_buffer=new SharedArrayBuffer(4),sharing_mouse_buffer_available=new Int32Array(sharing_mouse_buffer,0,1),postMessage({cmd:"sharing_decode_mouse_buffer_change",data:sharing_mouse_buffer})),Atomics.store(sharing_mouse_buffer_available,0,1),postMessage({cmd:"sharing_decode_mouse_data",data:e,len_of_data:t,timestamp:o,ssrc:a,logical_width:i,logical_height:d,logical_x:r,logical_y:c,data_width:n,data_heigth:s,sync_id:l,handle:u}),"timed-out"==Atomics.wait(sharing_mouse_buffer_available,0,1,50)&&(console.warn("<<< frame_callback_mouse_video_mode render timeout"),Atomics.store(sharing_mouse_buffer_available,0,0))}function Sharing_Encode_Start(e,t,o){}function release_video_receiving_channle(e){postMessage({cmd:"release_video_channel_callback",ssrc:e})}function MCMMonitor_Video_LOG(e,t){var o=new Uint8Array(t),a=GROWABLE_HEAP_I8().subarray(e+0,e+t);o.set(a),postMessage({cmd:"MCM_VIDEO_LOG",data:o},[o.buffer])}function MCMMonitor_Sharing_LOG(e,t){var o=new Uint8Array(t),a=GROWABLE_HEAP_I8().subarray(e+0,e+t);o.set(a),postMessage({cmd:"MCM_SHARING_LOG",data:o},[o.buffer])}function WebCodecsEncoderFail_js(e,t,o=0){let a=0==e&&(5===t||4===t)&&Module.supportHWEncRetry&&Module.encAddConIdx<Module.encRetryConIdx,i=1,d=webcodec_encode_subcode;try{i=JSON.stringify(Module.encRetryConfig).includes("L1T2")?1:0}catch(e){}a&&(o?(Module.encAdditionalConfig=Module.encRetryConfig,Module.codecMRG.webcodecRetry(e,Module.encRetryConIdx,t),__signal_video_controller_encode_hw_retry_info(retry_flag,i),__signal_sharing_controller_encode_hw_retry_info(retry_flag,i)):(VideoEncodeWebcodeRetry(Module.encRetryConIdx,Module.encRetryConfig,t),Module.encAddConIdx=Module.encRetryConIdx,l1t2_flag=i,retry_flag=!1)),postMessage({cmd:"WCEF",data:e,code:t,subCode:d,retry:a,inHWThread:o})}function WebCodecsDecoderFail_js(e){postMessage({cmd:"WCDF",data:e})}function SubScribeUpdateSharing(e){postMessage({cmd:"SubSharingInfo",data:e})}function SubScribeUpdateVideo(e){postMessage({cmd:"SubVideoInfo",data:e})}function closeVideoFrame(e){for(var t=0;t<e.length;t++)e[t]&&e[t].data&&e[t].data.close()}function Recieve_Wb_Packet(e,t){postMessage({cmd:"addMonitorLog",log:"wbunreachable"})}function checkWebCodecWhitelist_js(){if(!IsSupportMultiThreadForWebcodec())return-1;if(UserAgentIsTesla_js())return 0;if("function"!=typeof OffscreenCanvas)return-1;var e=getGraphicName(),t=getVendorName();return e&&t&&isWebCodecDecoderOnWhitelist?0:-1}function UserWebCodecController_js(){return Module.isAndroid}function sender_stats_log(e,t,o,a,i,d,r,c,n,s,l,u,h,f,m){postMessage({nodeId:e,timestamp:t,roundTripTime:o,jitter:a,frameWidthInput:i,frameHeightInput:d,frameWidthSent:r,frameHeightSent:c,frameRateInput:n,framesPerSecond:s,bytesSent:l,packetsSent:u,totalPacketSendDelay:h,totalEncodeTime:f,framesEncoded:m,cmd:202,status:202,kind:"video",type:"outbound-rtp",isSharing:!1})}function receiver_stats_log(e,t,o,a,i,d,r,c,n,s,l,u,h,f,m){postMessage({nodeId:e,timestamp:t,rtt:o,jitter:a,frameWidth:i,frameHeight:d,framesPerSecond:r,bytesReceived:c,packetsLost:n,packetsReceived:s,estimatedPlayoutTimestamp:l,totalDecodeTime:u,framesDecoded:h,jitterBufferDelay:f,jitterBufferEmittedCount:m,cmd:203,status:203,kind:"video",type:"inbound-rtp",isSharing:!1})}'],{type:"application/javascript",label:"sharing.thread"}))},Module.mainScriptUrlOrBlob=String.raw`function GROWABLE_HEAP_I8(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer)}return HEAP8}function GROWABLE_HEAP_U8(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer)}return HEAPU8}function GROWABLE_HEAP_I16(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer)}return HEAP16}function GROWABLE_HEAP_I32(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer)}return HEAP32}function GROWABLE_HEAP_U32(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer)}return HEAPU32}function GROWABLE_HEAP_F32(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer)}return HEAPF32}function GROWABLE_HEAP_F64(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer)}return HEAPF64}var Module=typeof Module!="undefined"?Module:{};var moduleOverrides=Object.assign({},Module);var arguments_=[];var thisProgram="./this.program";var quit_=(status,toThrow)=>{throw toThrow};var ENVIRONMENT_IS_WEB=typeof window=="object";var ENVIRONMENT_IS_WORKER=typeof importScripts=="function";var ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string";var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1)}else{scriptDirectory=""}{read_=url=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=url=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=(url,onload,onerror)=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=()=>{if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=title=>document.title=title}else{}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);Object.assign(Module,moduleOverrides);moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var POINTER_SIZE=4;var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort(text)}}var UTF8Decoder=typeof TextDecoder!="undefined"?new TextDecoder("utf8"):undefined;function UTF8ArrayToString(heapOrArray,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var endPtr=idx;while(heapOrArray[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&heapOrArray.buffer&&UTF8Decoder){return UTF8Decoder.decode(heapOrArray.buffer instanceof SharedArrayBuffer?heapOrArray.slice(idx,endPtr):heapOrArray.subarray(idx,endPtr))}var str="";while(idx<endPtr){var u0=heapOrArray[idx++];if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heapOrArray[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heapOrArray[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heapOrArray[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(GROWABLE_HEAP_U8(),ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i<str.length;++i){var u=str.charCodeAt(i);if(u>=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,GROWABLE_HEAP_U8(),outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i<str.length;++i){var c=str.charCodeAt(i);if(c<=127){len++}else if(c<=2047){len+=2}else if(c>=55296&&c<=57343){len+=4;++i}else{len+=3}}return len}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||67108864;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":2097152e3/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){err("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and/or recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;function keepRuntimeAlive(){return noExitRuntime}function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();FS.ignorePermissions=false;TTY.init();PIPEFS.root=FS.mount(PIPEFS,{},null);callRuntimeCallbacks(__ATINIT__)}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}what="Aborted("+what+")";err(what);ABORT=true;EXITSTATUS=1;what+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile;wasmBinaryFile="video.mtsimd.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}throw"both async and sync fetching of the wasm failed"}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch=="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"env":asmLibraryArg,"wasi_snapshot_preview1":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;registerTLSInit(Module["asm"]["_emscripten_tls_init"]);wasmTable=Module["asm"]["__indirect_function_table"];addOnInit(Module["asm"]["__wasm_call_ctors"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){return WebAssembly.instantiate(binary,info)}).then(function(instance){return instance}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming=="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch=="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={556480:$0=>{console.log("Video Version: ",$0)},556517:($0,$1,$2)=>{js_info_from_wcl($0,$1,$2)},556551:$0=>{change_capture_resolution($0)},556586:($0,$1,$2,$3,$4,$5,$6,$7,$8,$9)=>{processed_capture_data_callback($0,$1,$2,$3,$4,$5,$6,$7,$8,$9)},556663:($0,$1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11)=>{frame_callback($0,$1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11)},556733:($0,$1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11)=>{frame_callback_webcodec($0,$1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11)},556812:($0,$1)=>{decode_callback($0,$1)},556841:($0,$1,$2)=>{js_info_from_wcl($0,$1,$2)},556875:($0,$1)=>{video_rtp_data($0,$1)},556900:($0,$1,$2)=>{video_rtcp_data($0,$1,$2)},556930:($0,$1,$2,$3,$4,$5)=>{js_info_from_wcl_video_data($0,$1,$2,$3,$4,$5)},556987:$0=>{Exit_Thread($0)},557005:$0=>{return Before_Create_Thread($0)},557042:$0=>{return Before_Create_Thread($0)},557079:($0,$1)=>{APP_Troubleshoting_Info($0,$1)},557113:($0,$1,$2)=>{network_quality_callback($0,$1,$2)},557153:($0,$1)=>{MCMMonitor_Video_LOG($0,$1)},557183:($0,$1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14)=>{sender_stats_log($0,$1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14)},557273:($0,$1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14)=>{receiver_stats_log($0,$1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14)},557365:$0=>{SubScribeUpdateVideo($0)},557393:($0,$1)=>{send_data($0,$1)},557416:$0=>{SubScribeUpdateVideo($0)},557444:($0,$1,$2,$3,$4,$5,$6,$7,$8,$9)=>{responseVideoQosData($0,$1,$2,$3,$4,$5,$6,$7,$8,$9)},557505:($0,$1)=>{SAVE_IV($0,$1)},557523:()=>{return Date.now()},557546:()=>{return getNTPBaseTime()},557575:()=>{return performance.now()},557605:($0,$1)=>{reportSenderNTPTime($0,$1)},557638:($0,$1)=>{Update_Required_Bandwidth($0,$1)},557674:$0=>{Update_Video_Hd_Info($0)},557702:($0,$1,$2,$3,$4)=>{on_psl_mix_share_info_changed($0,$1,$2,$3,$4)},557754:$0=>{console.log("Sharing Version: ",$0)},557793:($0,$1)=>{share_rtp_data($0,$1)},557818:($0,$1,$2)=>{SAVE_IV($0,$1,$2)},557840:($0,$1,$2)=>{share_rtp_raw_data($0,$1,$2)},557873:($0,$1,$2,$3)=>{share_rtcp_data($0,$1,$2,$3)},557906:($0,$1,$2,$3)=>{share_rtcp_raw_data($0,$1,$2,$3)},557943:($0,$1,$2,$3)=>{share_mouse_data($0,$1,$2,$3)},557978:($0,$1,$2)=>{share_mouse_raw_data($0,$1,$2)},558013:($0,$1,$2)=>{APP_Troubleshoting_Info($0,$1,$2)},558051:($0,$1,$2,$3)=>{decode_callback($0,$1,$2,$3)},558088:($0,$1,$2)=>{on_keyframe_request($0,$1,$2)},558125:($0,$1,$2)=>{on_keyframe_request_ex($0,$1,$2)},558165:($0,$1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13)=>{frame_callback_video_mode($0,$1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13)},558256:($0,$1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11)=>{frame_callback_mouse_video_mode($0,$1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11)},558343:($0,$1)=>{MCMMonitor_Sharing_LOG($0,$1)},558375:($0,$1,$2,$3,$4,$5,$6)=>{Send_Out_Qos($0,$1,$2,$3,$4,$5,$6)},558420:$0=>{SubScribeUpdateSharing($0)},558450:$0=>{SubScribeUpdateSharing($0)},558480:$0=>{Update_WebSokcet_Speed($0)},558512:($0,$1,$2,$3,$4,$5,$6,$7,$8,$9)=>{responseSharingQosData($0,$1,$2,$3,$4,$5,$6,$7,$8,$9)},558575:($0,$1)=>{SAVE_IV($0,$1)},558593:$0=>{console.error("tjDecompressHeader3 error %d ",$0)},558646:$0=>{console.error("tjDecompress2 error %d ",$0)},558693:($0,$1)=>{on_share_encode_start($0,$1)},558725:($0,$1)=>{on_share_encode_start($0,$1)},558757:($0,$1,$2,$3)=>{sharing_decode_channel_change($0,$1,$2,$3)},558804:($0,$1,$2,$3)=>{sharing_decode_channel_change($0,$1,$2,$3)},558851:($0,$1)=>{Update_Required_Bandwidth($0,$1)},558887:($0,$1,$2)=>{Send_Wb_Rtp_Packet($0,$1,$2)},558918:($0,$1)=>{Recieve_Wb_Packet($0,$1)},558945:($0,$1)=>{video_hw_retry_info($0,$1)},558978:$0=>{release_video_receiving_channle($0)},559018:()=>{videocodec_create_helpthread()},559052:($0,$1)=>{video_hw_retry_info($0,$1)},559085:()=>{console.error("_do_sharing_controller_decode: start")},559141:()=>{console.error("_do_sharing_controller_decode: waiting msg ")},559204:$0=>{console.error("_do_sharing_controller_decode: ",$0)},559259:($0,$1,$2)=>{console.error("_do_sharing_controller_decode: Try_Analysis ",$0,$1,$2)},559334:()=>{console.error("_do_sharing_controller_decode: main session _Set_Sharing_Encryption_Key_Directly ")},559435:()=>{console.error("_do_sharing_controller_decode: _Set_Sharing_Encryption_Key_Directly ")},559523:()=>{console.error("SHARING_DECODE_NETWORK_INFO WCLSharing is null")},559589:()=>{console.error("SHARING_DECODE_REQUEST_CHECK_ONE_TYPE WCLSharing is null")},559665:($0,$1)=>{console.error("SHARING_DECODE_MEDIA_DATA WCLSharing is null",$0,$1)},559738:($0,$1)=>{console.error("SHARING_DECODE_MEDIA_DATA type unknwon",$0,$1)},559805:($0,$1)=>{wcl_sharing_inited($0,$1)},559834:($0,$1)=>{COMMIT_PRINT($0,$1)},559856:()=>{return Module.getRandomValue()},559892:()=>{if(Module.getRandomValue===undefined){try{var window_="object"===typeof window?window:self;var crypto_=typeof window_.crypto!=="undefined"?window_.crypto:window_.msCrypto;var randomValuesStandard=function(){var buf=new Uint32Array(1);crypto_.getRandomValues(buf);return buf[0]>>>0};randomValuesStandard();Module.getRandomValue=randomValuesStandard}catch(e){try{var crypto=require("crypto");var randomValueNodeJS=function(){var buf=crypto["randomBytes"](4);return(buf[0]<<24|buf[1]<<16|buf[2]<<8|buf[3])>>>0};randomValueNodeJS();Module.getRandomValue=randomValueNodeJS}catch(e){throw"No secure random number generator found"}}}},560614:()=>{videoencode_create_helpthread()},560649:($0,$1)=>{LOG_OUT($0,$1)},560670:($0,$1)=>{wcl_trace_log($0,$1)}};function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}function killThread(pthread_ptr){var worker=PThread.pthreads[pthread_ptr];delete PThread.pthreads[pthread_ptr];worker.terminate();__emscripten_thread_free_data(pthread_ptr);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);worker.pthread_ptr=0}function cancelThread(pthread_ptr){var worker=PThread.pthreads[pthread_ptr];worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){var worker=PThread.pthreads[pthread_ptr];assert(worker);PThread.returnWorkerToPool(worker)}function zeroMemory(address,size){GROWABLE_HEAP_U8().fill(0,address,address+size);return address}function spawnThread(threadParams){var worker=PThread.getNewWorker();if(!worker){return 6}PThread.runningWorkers.push(worker);PThread.pthreads[threadParams.pthread_ptr]=worker;worker.pthread_ptr=threadParams.pthread_ptr;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"pthread_ptr":threadParams.pthread_ptr};worker.runPthread=()=>{msg.time=performance.now();worker.postMessage(msg,threadParams.transferList);delete worker.runPthread};if(worker.loaded){worker.runPthread()}return 0}var PATH={isAbs:path=>path.charAt(0)==="/",splitPath:filename=>{var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:(parts,allowAboveRoot)=>{var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:path=>{var isAbsolute=PATH.isAbs(path),trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(p=>!!p),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:path=>{var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:path=>{if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},join:function(){var paths=Array.prototype.slice.call(arguments);return PATH.normalize(paths.join("/"))},join2:(l,r)=>{return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto=="object"&&typeof crypto["getRandomValues"]=="function"){var randomBuffer=new Uint8Array(1);return()=>{crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else return()=>abort("randomDevice")}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=PATH.isAbs(path)}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(p=>!!p),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:(from,to)=>{from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start<arr.length;start++){if(arr[start]!=="")break}var end=arr.length-1;for(;end>=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i<length;i++){if(fromParts[i]!==toParts[i]){samePartsLength=i;break}}var outputParts=[];for(var i=samePartsLength;i<fromParts.length;i++){outputParts.push("..")}outputParts=outputParts.concat(toParts.slice(samePartsLength));return outputParts.join("/")}};function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var TTY={ttys:[],init:function(){},shutdown:function(){},register:function(dev,ops){TTY.ttys[dev]={input:[],output:[],ops:ops};FS.registerDevice(dev,TTY.stream_ops)},stream_ops:{open:function(stream){var tty=TTY.ttys[stream.node.rdev];if(!tty){throw new FS.ErrnoError(43)}stream.tty=tty;stream.seekable=false},close:function(stream){stream.tty.ops.fsync(stream.tty)},fsync:function(stream){stream.tty.ops.fsync(stream.tty)},read:function(stream,buffer,offset,length,pos){if(!stream.tty||!stream.tty.ops.get_char){throw new FS.ErrnoError(60)}var bytesRead=0;for(var i=0;i<length;i++){var result;try{result=stream.tty.ops.get_char(stream.tty)}catch(e){throw new FS.ErrnoError(29)}if(result===undefined&&bytesRead===0){throw new FS.ErrnoError(6)}if(result===null||result===undefined)break;bytesRead++;buffer[offset+i]=result}if(bytesRead){stream.node.timestamp=Date.now()}return bytesRead},write:function(stream,buffer,offset,length,pos){if(!stream.tty||!stream.tty.ops.put_char){throw new FS.ErrnoError(60)}try{for(var i=0;i<length;i++){stream.tty.ops.put_char(stream.tty,buffer[offset+i])}}catch(e){throw new FS.ErrnoError(29)}if(length){stream.node.timestamp=Date.now()}return i}},default_tty_ops:{get_char:function(tty){if(!tty.input.length){var result=null;if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},fsync:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},fsync:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function alignMemory(size,alignment){return Math.ceil(size/alignment)*alignment}function mmapAlloc(size){size=alignMemory(size,65536);var ptr=_emscripten_builtin_memalign(65536,size);if(!ptr)return 0;return zeroMemory(ptr,size)}var MEMFS={ops_table:null,mount:function(mount){return MEMFS.createNode(null,"/",16384|511,0)},createNode:function(parent,name,mode,dev){if(FS.isBlkdev(mode)||FS.isFIFO(mode)){throw new FS.ErrnoError(63)}if(!MEMFS.ops_table){MEMFS.ops_table={dir:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,lookup:MEMFS.node_ops.lookup,mknod:MEMFS.node_ops.mknod,rename:MEMFS.node_ops.rename,unlink:MEMFS.node_ops.unlink,rmdir:MEMFS.node_ops.rmdir,readdir:MEMFS.node_ops.readdir,symlink:MEMFS.node_ops.symlink},stream:{llseek:MEMFS.stream_ops.llseek}},file:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:{llseek:MEMFS.stream_ops.llseek,read:MEMFS.stream_ops.read,write:MEMFS.stream_ops.write,allocate:MEMFS.stream_ops.allocate,mmap:MEMFS.stream_ops.mmap,msync:MEMFS.stream_ops.msync}},link:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,readlink:MEMFS.node_ops.readlink},stream:{}},chrdev:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:FS.chrdev_stream_ops}}}var node=FS.createNode(parent,name,mode,dev);if(FS.isDir(node.mode)){node.node_ops=MEMFS.ops_table.dir.node;node.stream_ops=MEMFS.ops_table.dir.stream;node.contents={}}else if(FS.isFile(node.mode)){node.node_ops=MEMFS.ops_table.file.node;node.stream_ops=MEMFS.ops_table.file.stream;node.usedBytes=0;node.contents=null}else if(FS.isLink(node.mode)){node.node_ops=MEMFS.ops_table.link.node;node.stream_ops=MEMFS.ops_table.link.stream}else if(FS.isChrdev(node.mode)){node.node_ops=MEMFS.ops_table.chrdev.node;node.stream_ops=MEMFS.ops_table.chrdev.stream}node.timestamp=Date.now();if(parent){parent.contents[name]=node;parent.timestamp=node.timestamp}return node},getFileDataAsTypedArray:function(node){if(!node.contents)return new Uint8Array(0);if(node.contents.subarray)return node.contents.subarray(0,node.usedBytes);return new Uint8Array(node.contents)},expandFileStorage:function(node,newCapacity){var prevCapacity=node.contents?node.contents.length:0;if(prevCapacity>=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity<CAPACITY_DOUBLING_MAX?2:1.125)>>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i<size;i++)buffer[offset+i]=contents[position+i]}return size},write:function(stream,buffer,offset,length,position,canOwn){if(buffer.buffer===GROWABLE_HEAP_I8().buffer){canOwn=false}if(!length)return 0;var node=stream.node;node.timestamp=Date.now();if(buffer.subarray&&(!node.contents||node.contents.subarray)){if(canOwn){node.contents=buffer.subarray(offset,offset+length);node.usedBytes=length;return length}else if(node.usedBytes===0&&position===0){node.contents=buffer.slice(offset,offset+length);node.usedBytes=length;return length}else if(position+length<=node.usedBytes){node.contents.set(buffer.subarray(offset,offset+length),position);return length}}MEMFS.expandFileStorage(node,position+length);if(node.contents.subarray&&buffer.subarray){node.contents.set(buffer.subarray(offset,offset+length),position)}else{for(var i=0;i<length;i++){node.contents[position+i]=buffer[offset+i]}}node.usedBytes=Math.max(node.usedBytes,position+length);return length},llseek:function(stream,offset,whence){var position=offset;if(whence===1){position+=stream.position}else if(whence===2){if(FS.isFile(stream.node.mode)){position+=stream.node.usedBytes}}if(position<0){throw new FS.ErrnoError(28)}return position},allocate:function(stream,offset,length){MEMFS.expandFileStorage(stream.node,offset+length);stream.node.usedBytes=Math.max(stream.node.usedBytes,offset+length)},mmap:function(stream,length,position,prot,flags){if(!FS.isFile(stream.node.mode)){throw new FS.ErrnoError(43)}var ptr;var allocated;var contents=stream.node.contents;if(!(flags&2)&&contents.buffer===buffer){allocated=false;ptr=contents.byteOffset}else{if(position>0||position+length<contents.length){if(contents.subarray){contents=contents.subarray(position,position+length)}else{contents=Array.prototype.slice.call(contents,position,position+length)}}allocated=true;ptr=mmapAlloc(length);if(!ptr){throw new FS.ErrnoError(48)}GROWABLE_HEAP_I8().set(contents,ptr)}return{ptr:ptr,allocated:allocated}},msync:function(stream,buffer,offset,length,mmapFlags){MEMFS.stream_ops.write(stream,buffer,0,length,offset,false);return 0}}};function asyncLoad(url,onload,onerror,noRunDep){var dep=!noRunDep?getUniqueRunDependency("al "+url):"";readAsync(url,arrayBuffer=>{assert(arrayBuffer,'Loading data file "'+url+'" failed (no arrayBuffer).');onload(new Uint8Array(arrayBuffer));if(dep)removeRunDependency(dep)},event=>{if(onerror){onerror()}else{throw'Loading data file "'+url+'" failed.'}});if(dep)addRunDependency(dep)}var FS={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:false,ignorePermissions:true,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(path,opts={})=>{path=PATH_FS.resolve(path);if(!path)return{path:"",node:null};var defaults={follow_mount:true,recurse_count:0};opts=Object.assign(defaults,opts);if(opts.recurse_count>8){throw new FS.ErrnoError(32)}var parts=path.split("/").filter(p=>!!p);var current=FS.root;var current_path="/";for(var i=0;i<parts.length;i++){var islast=i===parts.length-1;if(islast&&opts.parent){break}current=FS.lookupNode(current,parts[i]);current_path=PATH.join2(current_path,parts[i]);if(FS.isMountpoint(current)){if(!islast||islast&&opts.follow_mount){current=current.mounted.root}}if(!islast||opts.follow){var count=0;while(FS.isLink(current.mode)){var link=FS.readlink(current_path);current_path=PATH_FS.resolve(PATH.dirname(current_path),link);var lookup=FS.lookupPath(current_path,{recurse_count:opts.recurse_count+1});current=lookup.node;if(count++>40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:node=>{var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:(parentid,name)=>{var hash=0;for(var i=0;i<name.length;i++){hash=(hash<<5)-hash+name.charCodeAt(i)|0}return(parentid+hash>>>0)%FS.nameTable.length},hashAddNode:node=>{var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:node=>{var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:(parent,name)=>{var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:(parent,name,mode,rdev)=>{var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:node=>{FS.hashRemoveNode(node)},isRoot:node=>{return node===node.parent},isMountpoint:node=>{return!!node.mounted},isFile:mode=>{return(mode&61440)===32768},isDir:mode=>{return(mode&61440)===16384},isLink:mode=>{return(mode&61440)===40960},isChrdev:mode=>{return(mode&61440)===8192},isBlkdev:mode=>{return(mode&61440)===24576},isFIFO:mode=>{return(mode&61440)===4096},isSocket:mode=>{return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:str=>{var flags=FS.flagModes[str];if(typeof flags=="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:flag=>{var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:(node,perms)=>{if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:dir=>{var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:(dir,name)=>{try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:(dir,name,isdir)=>{var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:(node,flags)=>{if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:(fd_start=0,fd_end=FS.MAX_OPEN_FDS)=>{for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:fd=>FS.streams[fd],createStream:(stream,fd_start,fd_end)=>{if(!FS.FSStream){FS.FSStream=function(){this.shared={}};FS.FSStream.prototype={};Object.defineProperties(FS.FSStream.prototype,{object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}},flags:{get:function(){return this.shared.flags},set:function(val){this.shared.flags=val}},position:{get:function(){return this.shared.position},set:function(val){this.shared.position=val}}})}stream=Object.assign(new FS.FSStream,stream);var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:fd=>{FS.streams[fd]=null},chrdev_stream_ops:{open:stream=>{var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:()=>{throw new FS.ErrnoError(70)}},major:dev=>dev>>8,minor:dev=>dev&255,makedev:(ma,mi)=>ma<<8|mi,registerDevice:(dev,ops)=>{FS.devices[dev]={stream_ops:ops}},getDevice:dev=>FS.devices[dev],getMounts:mount=>{var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:(populate,callback)=>{if(typeof populate=="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(mount=>{if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:(type,opts,mountpoint)=>{var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:mountpoint=>{var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(hash=>{var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:(parent,name)=>{return parent.node_ops.lookup(parent,name)},mknod:(path,mode,dev)=>{var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:(path,mode)=>{mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:(path,mode)=>{mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:(path,mode)=>{var dirs=path.split("/");var d="";for(var i=0;i<dirs.length;++i){if(!dirs[i])continue;d+="/"+dirs[i];try{FS.mkdir(d,mode)}catch(e){if(e.errno!=20)throw e}}},mkdev:(path,mode,dev)=>{if(typeof dev=="undefined"){dev=mode;mode=438}mode|=8192;return FS.mknod(path,mode,dev)},symlink:(oldpath,newpath)=>{if(!PATH_FS.resolve(oldpath)){throw new FS.ErrnoError(44)}var lookup=FS.lookupPath(newpath,{parent:true});var parent=lookup.node;if(!parent){throw new FS.ErrnoError(44)}var newname=PATH.basename(newpath);var errCode=FS.mayCreate(parent,newname);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.symlink){throw new FS.ErrnoError(63)}return parent.node_ops.symlink(parent,newname,oldpath)},rename:(old_path,new_path)=>{var old_dirname=PATH.dirname(old_path);var new_dirname=PATH.dirname(new_path);var old_name=PATH.basename(old_path);var new_name=PATH.basename(new_path);var lookup,old_dir,new_dir;lookup=FS.lookupPath(old_path,{parent:true});old_dir=lookup.node;lookup=FS.lookupPath(new_path,{parent:true});new_dir=lookup.node;if(!old_dir||!new_dir)throw new FS.ErrnoError(44);if(old_dir.mount!==new_dir.mount){throw new FS.ErrnoError(75)}var old_node=FS.lookupNode(old_dir,old_name);var relative=PATH_FS.relative(old_path,new_dirname);if(relative.charAt(0)!=="."){throw new FS.ErrnoError(28)}relative=PATH_FS.relative(new_path,old_dirname);if(relative.charAt(0)!=="."){throw new FS.ErrnoError(55)}var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(old_node===new_node){return}var isdir=FS.isDir(old_node.mode);var errCode=FS.mayDelete(old_dir,old_name,isdir);if(errCode){throw new FS.ErrnoError(errCode)}errCode=new_node?FS.mayDelete(new_dir,new_name,isdir):FS.mayCreate(new_dir,new_name);if(errCode){throw new FS.ErrnoError(errCode)}if(!old_dir.node_ops.rename){throw new FS.ErrnoError(63)}if(FS.isMountpoint(old_node)||new_node&&FS.isMountpoint(new_node)){throw new FS.ErrnoError(10)}if(new_dir!==old_dir){errCode=FS.nodePermissions(old_dir,"w");if(errCode){throw new FS.ErrnoError(errCode)}}FS.hashRemoveNode(old_node);try{old_dir.node_ops.rename(old_node,new_dir,new_name)}catch(e){throw e}finally{FS.hashAddNode(old_node)}},rmdir:path=>{var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);var node=FS.lookupNode(parent,name);var errCode=FS.mayDelete(parent,name,true);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.rmdir){throw new FS.ErrnoError(63)}if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}parent.node_ops.rmdir(parent,name);FS.destroyNode(node)},readdir:path=>{var lookup=FS.lookupPath(path,{follow:true});var node=lookup.node;if(!node.node_ops.readdir){throw new FS.ErrnoError(54)}return node.node_ops.readdir(node)},unlink:path=>{var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;if(!parent){throw new FS.ErrnoError(44)}var name=PATH.basename(path);var node=FS.lookupNode(parent,name);var errCode=FS.mayDelete(parent,name,false);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.unlink){throw new FS.ErrnoError(63)}if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}parent.node_ops.unlink(parent,name);FS.destroyNode(node)},readlink:path=>{var lookup=FS.lookupPath(path);var link=lookup.node;if(!link){throw new FS.ErrnoError(44)}if(!link.node_ops.readlink){throw new FS.ErrnoError(28)}return PATH_FS.resolve(FS.getPath(link.parent),link.node_ops.readlink(link))},stat:(path,dontFollow)=>{var lookup=FS.lookupPath(path,{follow:!dontFollow});var node=lookup.node;if(!node){throw new FS.ErrnoError(44)}if(!node.node_ops.getattr){throw new FS.ErrnoError(63)}return node.node_ops.getattr(node)},lstat:path=>{return FS.stat(path,true)},chmod:(path,mode,dontFollow)=>{var node;if(typeof path=="string"){var lookup=FS.lookupPath(path,{follow:!dontFollow});node=lookup.node}else{node=path}if(!node.node_ops.setattr){throw new FS.ErrnoError(63)}node.node_ops.setattr(node,{mode:mode&4095|node.mode&~4095,timestamp:Date.now()})},lchmod:(path,mode)=>{FS.chmod(path,mode,true)},fchmod:(fd,mode)=>{var stream=FS.getStream(fd);if(!stream){throw new FS.ErrnoError(8)}FS.chmod(stream.node,mode)},chown:(path,uid,gid,dontFollow)=>{var node;if(typeof path=="string"){var lookup=FS.lookupPath(path,{follow:!dontFollow});node=lookup.node}else{node=path}if(!node.node_ops.setattr){throw new FS.ErrnoError(63)}node.node_ops.setattr(node,{timestamp:Date.now()})},lchown:(path,uid,gid)=>{FS.chown(path,uid,gid,true)},fchown:(fd,uid,gid)=>{var stream=FS.getStream(fd);if(!stream){throw new FS.ErrnoError(8)}FS.chown(stream.node,uid,gid)},truncate:(path,len)=>{if(len<0){throw new FS.ErrnoError(28)}var node;if(typeof path=="string"){var lookup=FS.lookupPath(path,{follow:true});node=lookup.node}else{node=path}if(!node.node_ops.setattr){throw new FS.ErrnoError(63)}if(FS.isDir(node.mode)){throw new FS.ErrnoError(31)}if(!FS.isFile(node.mode)){throw new FS.ErrnoError(28)}var errCode=FS.nodePermissions(node,"w");if(errCode){throw new FS.ErrnoError(errCode)}node.node_ops.setattr(node,{size:len,timestamp:Date.now()})},ftruncate:(fd,len)=>{var stream=FS.getStream(fd);if(!stream){throw new FS.ErrnoError(8)}if((stream.flags&2097155)===0){throw new FS.ErrnoError(28)}FS.truncate(stream.node,len)},utime:(path,atime,mtime)=>{var lookup=FS.lookupPath(path,{follow:true});var node=lookup.node;node.node_ops.setattr(node,{timestamp:Math.max(atime,mtime)})},open:(path,flags,mode)=>{if(path===""){throw new FS.ErrnoError(44)}flags=typeof flags=="string"?FS.modeStringToFlags(flags):flags;mode=typeof mode=="undefined"?438:mode;if(flags&64){mode=mode&4095|32768}else{mode=0}var node;if(typeof path=="object"){node=path}else{path=PATH.normalize(path);try{var lookup=FS.lookupPath(path,{follow:!(flags&131072)});node=lookup.node}catch(e){}}var created=false;if(flags&64){if(node){if(flags&128){throw new FS.ErrnoError(20)}}else{node=FS.mknod(path,mode,0);created=true}}if(!node){throw new FS.ErrnoError(44)}if(FS.isChrdev(node.mode)){flags&=~512}if(flags&65536&&!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}if(!created){var errCode=FS.mayOpen(node,flags);if(errCode){throw new FS.ErrnoError(errCode)}}if(flags&512&&!created){FS.truncate(node,0)}flags&=~(128|512|131072);var stream=FS.createStream({node:node,path:FS.getPath(node),flags:flags,seekable:true,position:0,stream_ops:node.stream_ops,ungotten:[],error:false});if(stream.stream_ops.open){stream.stream_ops.open(stream)}if(Module["logReadFiles"]&&!(flags&1)){if(!FS.readFiles)FS.readFiles={};if(!(path in FS.readFiles)){FS.readFiles[path]=1}}return stream},close:stream=>{if(FS.isClosed(stream)){throw new FS.ErrnoError(8)}if(stream.getdents)stream.getdents=null;try{if(stream.stream_ops.close){stream.stream_ops.close(stream)}}catch(e){throw e}finally{FS.closeStream(stream.fd)}stream.fd=null},isClosed:stream=>{return stream.fd===null},llseek:(stream,offset,whence)=>{if(FS.isClosed(stream)){throw new FS.ErrnoError(8)}if(!stream.seekable||!stream.stream_ops.llseek){throw new FS.ErrnoError(70)}if(whence!=0&&whence!=1&&whence!=2){throw new FS.ErrnoError(28)}stream.position=stream.stream_ops.llseek(stream,offset,whence);stream.ungotten=[];return stream.position},read:(stream,buffer,offset,length,position)=>{if(length<0||position<0){throw new FS.ErrnoError(28)}if(FS.isClosed(stream)){throw new FS.ErrnoError(8)}if((stream.flags&2097155)===1){throw new FS.ErrnoError(8)}if(FS.isDir(stream.node.mode)){throw new FS.ErrnoError(31)}if(!stream.stream_ops.read){throw new FS.ErrnoError(28)}var seeking=typeof position!="undefined";if(!seeking){position=stream.position}else if(!stream.seekable){throw new FS.ErrnoError(70)}var bytesRead=stream.stream_ops.read(stream,buffer,offset,length,position);if(!seeking)stream.position+=bytesRead;return bytesRead},write:(stream,buffer,offset,length,position,canOwn)=>{if(length<0||position<0){throw new FS.ErrnoError(28)}if(FS.isClosed(stream)){throw new FS.ErrnoError(8)}if((stream.flags&2097155)===0){throw new FS.ErrnoError(8)}if(FS.isDir(stream.node.mode)){throw new FS.ErrnoError(31)}if(!stream.stream_ops.write){throw new FS.ErrnoError(28)}if(stream.seekable&&stream.flags&1024){FS.llseek(stream,0,2)}var seeking=typeof position!="undefined";if(!seeking){position=stream.position}else if(!stream.seekable){throw new FS.ErrnoError(70)}var bytesWritten=stream.stream_ops.write(stream,buffer,offset,length,position,canOwn);if(!seeking)stream.position+=bytesWritten;return bytesWritten},allocate:(stream,offset,length)=>{if(FS.isClosed(stream)){throw new FS.ErrnoError(8)}if(offset<0||length<=0){throw new FS.ErrnoError(28)}if((stream.flags&2097155)===0){throw new FS.ErrnoError(8)}if(!FS.isFile(stream.node.mode)&&!FS.isDir(stream.node.mode)){throw new FS.ErrnoError(43)}if(!stream.stream_ops.allocate){throw new FS.ErrnoError(138)}stream.stream_ops.allocate(stream,offset,length)},mmap:(stream,length,position,prot,flags)=>{if((prot&2)!==0&&(flags&2)===0&&(stream.flags&2097155)!==2){throw new FS.ErrnoError(2)}if((stream.flags&2097155)===1){throw new FS.ErrnoError(2)}if(!stream.stream_ops.mmap){throw new FS.ErrnoError(43)}return stream.stream_ops.mmap(stream,length,position,prot,flags)},msync:(stream,buffer,offset,length,mmapFlags)=>{if(!stream.stream_ops.msync){return 0}return stream.stream_ops.msync(stream,buffer,offset,length,mmapFlags)},munmap:stream=>0,ioctl:(stream,cmd,arg)=>{if(!stream.stream_ops.ioctl){throw new FS.ErrnoError(59)}return stream.stream_ops.ioctl(stream,cmd,arg)},readFile:(path,opts={})=>{opts.flags=opts.flags||0;opts.encoding=opts.encoding||"binary";if(opts.encoding!=="utf8"&&opts.encoding!=="binary"){throw new Error('Invalid encoding type "'+opts.encoding+'"')}var ret;var stream=FS.open(path,opts.flags);var stat=FS.stat(path);var length=stat.size;var buf=new Uint8Array(length);FS.read(stream,buf,0,length,0);if(opts.encoding==="utf8"){ret=UTF8ArrayToString(buf,0)}else if(opts.encoding==="binary"){ret=buf}FS.close(stream);return ret},writeFile:(path,data,opts={})=>{opts.flags=opts.flags||577;var stream=FS.open(path,opts.flags,opts.mode);if(typeof data=="string"){var buf=new Uint8Array(lengthBytesUTF8(data)+1);var actualNumBytes=stringToUTF8Array(data,buf,0,buf.length);FS.write(stream,buf,0,actualNumBytes,undefined,opts.canOwn)}else if(ArrayBuffer.isView(data)){FS.write(stream,data,0,data.byteLength,undefined,opts.canOwn)}else{throw new Error("Unsupported data type")}FS.close(stream)},cwd:()=>FS.currentPath,chdir:path=>{var lookup=FS.lookupPath(path,{follow:true});if(lookup.node===null){throw new FS.ErrnoError(44)}if(!FS.isDir(lookup.node.mode)){throw new FS.ErrnoError(54)}var errCode=FS.nodePermissions(lookup.node,"x");if(errCode){throw new FS.ErrnoError(errCode)}FS.currentPath=lookup.path},createDefaultDirectories:()=>{FS.mkdir("/tmp");FS.mkdir("/home");FS.mkdir("/home/web_user")},createDefaultDevices:()=>{FS.mkdir("/dev");FS.registerDevice(FS.makedev(1,3),{read:()=>0,write:(stream,buffer,offset,length,pos)=>length});FS.mkdev("/dev/null",FS.makedev(1,3));TTY.register(FS.makedev(5,0),TTY.default_tty_ops);TTY.register(FS.makedev(6,0),TTY.default_tty1_ops);FS.mkdev("/dev/tty",FS.makedev(5,0));FS.mkdev("/dev/tty1",FS.makedev(6,0));var random_device=getRandomDevice();FS.createDevice("/dev","random",random_device);FS.createDevice("/dev","urandom",random_device);FS.mkdir("/dev/shm");FS.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{FS.mkdir("/proc");var proc_self=FS.mkdir("/proc/self");FS.mkdir("/proc/self/fd");FS.mount({mount:()=>{var node=FS.createNode(proc_self,"fd",16384|511,73);node.node_ops={lookup:(parent,name)=>{var fd=+name;var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);var ret={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>stream.path}};ret.parent=ret;return ret}};return node}},{},"/proc/self/fd")},createStandardStreams:()=>{if(Module["stdin"]){FS.createDevice("/dev","stdin",Module["stdin"])}else{FS.symlink("/dev/tty","/dev/stdin")}if(Module["stdout"]){FS.createDevice("/dev","stdout",null,Module["stdout"])}else{FS.symlink("/dev/tty","/dev/stdout")}if(Module["stderr"]){FS.createDevice("/dev","stderr",null,Module["stderr"])}else{FS.symlink("/dev/tty1","/dev/stderr")}var stdin=FS.open("/dev/stdin",0);var stdout=FS.open("/dev/stdout",1);var stderr=FS.open("/dev/stderr",1)},ensureErrnoError:()=>{if(FS.ErrnoError)return;FS.ErrnoError=function ErrnoError(errno,node){this.node=node;this.setErrno=function(errno){this.errno=errno};this.setErrno(errno);this.message="FS error"};FS.ErrnoError.prototype=new Error;FS.ErrnoError.prototype.constructor=FS.ErrnoError;[44].forEach(code=>{FS.genericErrors[code]=new FS.ErrnoError(code);FS.genericErrors[code].stack="<generic error, no stack>"})},staticInit:()=>{FS.ensureErrnoError();FS.nameTable=new Array(4096);FS.mount(MEMFS,{},"/");FS.createDefaultDirectories();FS.createDefaultDevices();FS.createSpecialDirectories();FS.filesystems={"MEMFS":MEMFS}},init:(input,output,error)=>{FS.init.initialized=true;FS.ensureErrnoError();Module["stdin"]=input||Module["stdin"];Module["stdout"]=output||Module["stdout"];Module["stderr"]=error||Module["stderr"];FS.createStandardStreams()},quit:()=>{FS.init.initialized=false;for(var i=0;i<FS.streams.length;i++){var stream=FS.streams[i];if(!stream){continue}FS.close(stream)}},getMode:(canRead,canWrite)=>{var mode=0;if(canRead)mode|=292|73;if(canWrite)mode|=146;return mode},findObject:(path,dontResolveLastLink)=>{var ret=FS.analyzePath(path,dontResolveLastLink);if(!ret.exists){return null}return ret.object},analyzePath:(path,dontResolveLastLink)=>{try{var lookup=FS.lookupPath(path,{follow:!dontResolveLastLink});path=lookup.path}catch(e){}var ret={isRoot:false,exists:false,error:0,name:null,path:null,object:null,parentExists:false,parentPath:null,parentObject:null};try{var lookup=FS.lookupPath(path,{parent:true});ret.parentExists=true;ret.parentPath=lookup.path;ret.parentObject=lookup.node;ret.name=PATH.basename(path);lookup=FS.lookupPath(path,{follow:!dontResolveLastLink});ret.exists=true;ret.path=lookup.path;ret.object=lookup.node;ret.name=lookup.node.name;ret.isRoot=lookup.path==="/"}catch(e){ret.error=e.errno}return ret},createPath:(parent,path,canRead,canWrite)=>{parent=typeof parent=="string"?parent:FS.getPath(parent);var parts=path.split("/").reverse();while(parts.length){var part=parts.pop();if(!part)continue;var current=PATH.join2(parent,part);try{FS.mkdir(current)}catch(e){}parent=current}return current},createFile:(parent,name,properties,canRead,canWrite)=>{var path=PATH.join2(typeof parent=="string"?parent:FS.getPath(parent),name);var mode=FS.getMode(canRead,canWrite);return FS.create(path,mode)},createDataFile:(parent,name,data,canRead,canWrite,canOwn)=>{var path=name;if(parent){parent=typeof parent=="string"?parent:FS.getPath(parent);path=name?PATH.join2(parent,name):parent}var mode=FS.getMode(canRead,canWrite);var node=FS.create(path,mode);if(data){if(typeof data=="string"){var arr=new Array(data.length);for(var i=0,len=data.length;i<len;++i)arr[i]=data.charCodeAt(i);data=arr}FS.chmod(node,mode|146);var stream=FS.open(node,577);FS.write(stream,data,0,data.length,0,canOwn);FS.close(stream);FS.chmod(node,mode)}return node},createDevice:(parent,name,input,output)=>{var path=PATH.join2(typeof parent=="string"?parent:FS.getPath(parent),name);var mode=FS.getMode(!!input,!!output);if(!FS.createDevice.major)FS.createDevice.major=64;var dev=FS.makedev(FS.createDevice.major++,0);FS.registerDevice(dev,{open:stream=>{stream.seekable=false},close:stream=>{if(output&&output.buffer&&output.buffer.length){output(10)}},read:(stream,buffer,offset,length,pos)=>{var bytesRead=0;for(var i=0;i<length;i++){var result;try{result=input()}catch(e){throw new FS.ErrnoError(29)}if(result===undefined&&bytesRead===0){throw new FS.ErrnoError(6)}if(result===null||result===undefined)break;bytesRead++;buffer[offset+i]=result}if(bytesRead){stream.node.timestamp=Date.now()}return bytesRead},write:(stream,buffer,offset,length,pos)=>{for(var i=0;i<length;i++){try{output(buffer[offset+i])}catch(e){throw new FS.ErrnoError(29)}}if(length){stream.node.timestamp=Date.now()}return i}});return FS.mkdev(path,mode,dev)},forceLoadFile:obj=>{if(obj.isDevice||obj.isFolder||obj.link||obj.contents)return true;if(typeof XMLHttpRequest!="undefined"){throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.")}else if(read_){try{obj.contents=intArrayFromString(read_(obj.url),true);obj.usedBytes=obj.contents.length}catch(e){throw new FS.ErrnoError(29)}}else{throw new Error("Cannot load without read() or XMLHttpRequest.")}},createLazyFile:(parent,name,url,canRead,canWrite)=>{function LazyUint8Array(){this.lengthKnown=false;this.chunks=[]}LazyUint8Array.prototype.get=function LazyUint8Array_get(idx){if(idx>this.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=(from,to)=>{if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}return intArrayFromString(xhr.responseText||"",true)};var lazyArray=this;lazyArray.setDataGetter(chunkNum=>{var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]=="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]=="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(key=>{var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});function writeChunks(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i<size;i++){buffer[offset+i]=contents[position+i]}}else{for(var i=0;i<size;i++){buffer[offset+i]=contents.get(position+i)}}return size}stream_ops.read=(stream,buffer,offset,length,position)=>{FS.forceLoadFile(node);return writeChunks(stream,buffer,offset,length,position)};stream_ops.mmap=(stream,length,position,prot,flags)=>{FS.forceLoadFile(node);var ptr=mmapAlloc(length);if(!ptr){throw new FS.ErrnoError(48)}writeChunks(stream,GROWABLE_HEAP_I8(),ptr,length,position);return{ptr:ptr,allocated:true}};node.stream_ops=stream_ops;return node},createPreloadedFile:(parent,name,url,canRead,canWrite,onload,onerror,dontCreateFile,canOwn,preFinish)=>{var fullname=name?PATH_FS.resolve(PATH.join2(parent,name)):parent;var dep=getUniqueRunDependency("cp "+fullname);function processData(byteArray){function finish(byteArray){if(preFinish)preFinish();if(!dontCreateFile){FS.createDataFile(parent,name,byteArray,canRead,canWrite,canOwn)}if(onload)onload();removeRunDependency(dep)}if(Browser.handledByPreloadPlugin(byteArray,fullname,finish,()=>{if(onerror)onerror();removeRunDependency(dep)})){return}finish(byteArray)}addRunDependency(dep);if(typeof url=="string"){asyncLoad(url,byteArray=>processData(byteArray),onerror)}else{processData(url)}},indexedDB:()=>{return window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB},DB_NAME:()=>{return"EM_FS_"+window.location.pathname},DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(paths,onload,onerror)=>{onload=onload||(()=>{});onerror=onerror||(()=>{});var indexedDB=FS.indexedDB();try{var openRequest=indexedDB.open(FS.DB_NAME(),FS.DB_VERSION)}catch(e){return onerror(e)}openRequest.onupgradeneeded=()=>{out("creating db");var db=openRequest.result;db.createObjectStore(FS.DB_STORE_NAME)};openRequest.onsuccess=()=>{var db=openRequest.result;var transaction=db.transaction([FS.DB_STORE_NAME],"readwrite");var files=transaction.objectStore(FS.DB_STORE_NAME);var ok=0,fail=0,total=paths.length;function finish(){if(fail==0)onload();else onerror()}paths.forEach(path=>{var putRequest=files.put(FS.analyzePath(path).object.contents,path);putRequest.onsuccess=()=>{ok++;if(ok+fail==total)finish()};putRequest.onerror=()=>{fail++;if(ok+fail==total)finish()}});transaction.onerror=onerror};openRequest.onerror=onerror},loadFilesFromDB:(paths,onload,onerror)=>{onload=onload||(()=>{});onerror=onerror||(()=>{});var indexedDB=FS.indexedDB();try{var openRequest=indexedDB.open(FS.DB_NAME(),FS.DB_VERSION)}catch(e){return onerror(e)}openRequest.onupgradeneeded=onerror;openRequest.onsuccess=()=>{var db=openRequest.result;try{var transaction=db.transaction([FS.DB_STORE_NAME],"readonly")}catch(e){onerror(e);return}var files=transaction.objectStore(FS.DB_STORE_NAME);var ok=0,fail=0,total=paths.length;function finish(){if(fail==0)onload();else onerror()}paths.forEach(path=>{var getRequest=files.get(path);getRequest.onsuccess=()=>{if(FS.analyzePath(path).exists){FS.unlink(path)}FS.createDataFile(PATH.dirname(path),PATH.basename(path),getRequest.result,true,true,true);ok++;if(ok+fail==total)finish()};getRequest.onerror=()=>{fail++;if(ok+fail==total)finish()}});transaction.onerror=onerror};openRequest.onerror=onerror}};var SYSCALLS={DEFAULT_POLLMASK:5,calculateAt:function(dirfd,path,allowEmpty){if(PATH.isAbs(path)){return path}var dir;if(dirfd===-100){dir=FS.cwd()}else{var dirstream=SYSCALLS.getStreamFromFD(dirfd);dir=dirstream.path}if(path.length==0){if(!allowEmpty){throw new FS.ErrnoError(44)}return dir}return PATH.join2(dir,path)},doStat:function(func,path,buf){try{var stat=func(path)}catch(e){if(e&&e.node&&PATH.normalize(path)!==PATH.normalize(FS.getPath(e.node))){return-54}throw e}GROWABLE_HEAP_I32()[buf>>2]=stat.dev;GROWABLE_HEAP_I32()[buf+8>>2]=stat.ino;GROWABLE_HEAP_I32()[buf+12>>2]=stat.mode;GROWABLE_HEAP_U32()[buf+16>>2]=stat.nlink;GROWABLE_HEAP_I32()[buf+20>>2]=stat.uid;GROWABLE_HEAP_I32()[buf+24>>2]=stat.gid;GROWABLE_HEAP_I32()[buf+28>>2]=stat.rdev;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],GROWABLE_HEAP_I32()[buf+40>>2]=tempI64[0],GROWABLE_HEAP_I32()[buf+44>>2]=tempI64[1];GROWABLE_HEAP_I32()[buf+48>>2]=4096;GROWABLE_HEAP_I32()[buf+52>>2]=stat.blocks;tempI64=[Math.floor(stat.atime.getTime()/1e3)>>>0,(tempDouble=Math.floor(stat.atime.getTime()/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],GROWABLE_HEAP_I32()[buf+56>>2]=tempI64[0],GROWABLE_HEAP_I32()[buf+60>>2]=tempI64[1];GROWABLE_HEAP_U32()[buf+64>>2]=0;tempI64=[Math.floor(stat.mtime.getTime()/1e3)>>>0,(tempDouble=Math.floor(stat.mtime.getTime()/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],GROWABLE_HEAP_I32()[buf+72>>2]=tempI64[0],GROWABLE_HEAP_I32()[buf+76>>2]=tempI64[1];GROWABLE_HEAP_U32()[buf+80>>2]=0;tempI64=[Math.floor(stat.ctime.getTime()/1e3)>>>0,(tempDouble=Math.floor(stat.ctime.getTime()/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],GROWABLE_HEAP_I32()[buf+88>>2]=tempI64[0],GROWABLE_HEAP_I32()[buf+92>>2]=tempI64[1];GROWABLE_HEAP_U32()[buf+96>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],GROWABLE_HEAP_I32()[buf+104>>2]=tempI64[0],GROWABLE_HEAP_I32()[buf+108>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){if(!FS.isFile(stream.node.mode)){throw new FS.ErrnoError(43)}if(flags&2){return 0}var buffer=GROWABLE_HEAP_U8().slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=GROWABLE_HEAP_I32()[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream}};function _proc_exit(code){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,code);EXITSTATUS=code;if(!keepRuntimeAlive()){PThread.terminateAllThreads();if(Module["onExit"])Module["onExit"](code);ABORT=true}quit_(code,new ExitStatus(code))}function exitJS(status,implicit){EXITSTATUS=status;if(!implicit){if(ENVIRONMENT_IS_PTHREAD){exitOnMainThread(status);throw"unwind"}else{}}_proc_exit(status)}var _exit=exitJS;function handleException(e){if(e instanceof ExitStatus||e=="unwind"){return EXITSTATUS}quit_(1,e)}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],pthreads:{},init:function(){if(ENVIRONMENT_IS_PTHREAD){PThread.initWorker()}else{PThread.initMainThread()}},initMainThread:function(){},initWorker:function(){noExitRuntime=false},setExitStatus:function(status){EXITSTATUS=status},terminateAllThreads:function(){for(var worker of Object.values(PThread.pthreads)){PThread.returnWorkerToPool(worker)}for(var worker of PThread.unusedWorkers){worker.terminate()}PThread.unusedWorkers=[]},returnWorkerToPool:function(worker){var pthread_ptr=worker.pthread_ptr;delete PThread.pthreads[pthread_ptr];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);worker.pthread_ptr=0;__emscripten_thread_free_data(pthread_ptr)},receiveObjectTransfer:function(data){},threadInitTLS:function(){PThread.tlsInitFunctions.forEach(f=>f())},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=e=>{var d=e["data"];var cmd=d["cmd"];if(worker.pthread_ptr)PThread.currentProxiedOperationCallerThread=worker.pthread_ptr;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var targetWorker=PThread.pthreads[d.targetThread];if(targetWorker){targetWorker.postMessage(d,d["transferList"])}else{err('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processProxyingQueue"){executeNotifiedProxyingQueue(d["queue"])}else if(cmd==="spawnThread"){spawnThread(d)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread()}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(d.target==="setimmediate"){worker.postMessage(d)}else if(cmd==="callHandler"){Module[d["handler"]](...d["args"])}else if(cmd){err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=e=>{var message="worker sent an error!";err(message+" "+e.filename+":"+e.lineno+": "+e.message);throw e};var handlers=[];var knownHandlers=["onExit","onAbort","print","printErr"];for(var handler of knownHandlers){if(Module.hasOwnProperty(handler)){handlers.push(handler)}}worker.postMessage({"cmd":"load","handlers":handlers,"urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("video.mtsimd.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()}};Module["PThread"]=PThread;function callRuntimeCallbacks(callbacks){while(callbacks.length>0){callbacks.shift()(Module)}}function withStackSave(f){var stack=stackSave();var ret=f();stackRestore(stack);return ret}function demangle(func){demangle.recursionGuard=(demangle.recursionGuard|0)+1;if(demangle.recursionGuard>1)return func;return withStackSave(function(){try{var s=func;if(s.startsWith("__Z"))s=s.substr(1);var len=lengthBytesUTF8(s)+1;var buf=stackAlloc(len);stringToUTF8(s,buf,len);var status=stackAlloc(4);var ret=___cxa_demangle(buf,0,0,status);if(GROWABLE_HEAP_I32()[status>>2]===0&&ret){return UTF8ToString(ret)}}catch(e){}finally{_free(ret);if(demangle.recursionGuard<2)--demangle.recursionGuard}return func})}function establishStackSpace(){var pthread_ptr=_pthread_self();var stackTop=GROWABLE_HEAP_I32()[pthread_ptr+52>>2];var stackSize=GROWABLE_HEAP_I32()[pthread_ptr+56>>2];var stackMax=stackTop-stackSize;_emscripten_stack_set_limits(stackTop,stackMax);stackRestore(stackTop)}Module["establishStackSpace"]=establishStackSpace;function exitOnMainThread(returnCode){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,0,returnCode);try{_exit(returnCode)}catch(e){handleException(e)}}var wasmTableMirror=[];function getWasmTableEntry(funcPtr){var func=wasmTableMirror[funcPtr];if(!func){if(funcPtr>=wasmTableMirror.length)wasmTableMirror.length=funcPtr+1;wasmTableMirror[funcPtr]=func=wasmTable.get(funcPtr)}return func}function invokeEntryPoint(ptr,arg){var result=getWasmTableEntry(ptr)(arg);if(keepRuntimeAlive()){PThread.setExitStatus(result)}else{__emscripten_thread_exit(result)}}Module["invokeEntryPoint"]=invokeEntryPoint;function registerTLSInit(tlsInitFunc){PThread.tlsInitFunctions.push(tlsInitFunc)}function jsStackTrace(){var error=new Error;if(!error.stack){try{throw new Error}catch(e){error=e}if(!error.stack){return"(no stack trace available)"}}return error.stack.toString()}function demangleAll(text){var regex=/\b_Z[\w\d_]+/g;return text.replace(regex,function(x){var y=demangle(x);return x===y?x:y+" ["+x+"]"})}function _AdapterWhiteListCheck(){return checkWebCodecWhitelist_js()}function _CloseVideoEncoder(id){CloseVideoEncoder_js(id)}function _CreateGltPlatform(){err("missing function: CreateGltPlatform");abort(-1)}function _DestroyGltPlatform(){err("missing function: DestroyGltPlatform");abort(-1)}function _EncodeVideoFrameID(type,numb){return EncodeVideoFrameID_js(type,numb)}function _GetEncoderState(id){return GetEncoderState_js(id)}function _GetLogLevel(){return GetLogLevel_js()}function _GetWebCodecsEncoderFallbackFlag(){return GetWebCodecsEncoderFallbackFlag_js()}function _GetWebCodecsEncoderL1T2Flag(){return GetWebCodecsEncoderL1T2Flag_js()}function _InitVideoDecoder(id,context){return InitVideoDecoder_js(id,context)}function _InitVideoEncoder(id,context){return InitVideoEncoder_js(id,context)}function _LimitWebCodecsDecoderTo360(){return LimitWebCodecsDecoderTo360_js()}function _LimitWebCodecsEncoderTo360(){return LimitWebCodecsEncoderTo360_js()}function _Set_Share_Mode(flag){return Set_Share_Mode_js(flag)}function _UserAgentIsTesla(){return UserAgentIsTesla_js()}function _VideoDecoder(id,VclNalBuffer,vclBufferSize,NewIDR,vclNalCount){return VideoDecoder_js(id,VclNalBuffer,vclBufferSize,NewIDR,vclNalCount)}function _VideoDecoderConfigure(id,extradata,extraDataLen,Width,Height){return VideoDecoderConfigure_js(id,extradata,extraDataLen,Width,Height)}function _VideoEncoderConfigure(id,Bitrate,Framerate,Width,Height,bsBuffer){return VideoEncoderConfigure_js(id,Bitrate,Framerate,Width,Height,bsBuffer)}function _WebCodecsDecoderFail(m_iID){WebCodecsDecoderFail_js(m_iID)}function _WebCodecsEncoderFail(m_iID,code){WebCodecsEncoderFail_js(m_iID,code)}function _WebCodecsVideoEncoder(id,videoFrameId,NewIDR,rawData,dataLength,timeout){return VideoEncoder_js(id,videoFrameId,NewIDR,rawData,dataLength,timeout)}function __ZN11cpt_generic6thread4joinEv(){err("missing function: _ZN11cpt_generic6thread4joinEv");abort(-1)}function __ZN11cpt_generic6threadD1Ev(){err("missing function: _ZN11cpt_generic6threadD1Ev");abort(-1)}function __ZN5Nydus16CWCLWallRenderer14CreateInstanceEPvRKNS_9NydusRectEPPNS_13IWallRendererE(){err("missing function: _ZN5Nydus16CWCLWallRenderer14CreateInstanceEPvRKNS_9NydusRectEPPNS_13IWallRendererE");abort(-1)}function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___cxa_allocate_exception(size){return _malloc(size+24)+24}var exceptionCaught=[];function exception_addRef(info){info.add_ref()}var uncaughtExceptionCount=0;function ___cxa_begin_catch(ptr){var info=new ExceptionInfo(ptr);if(!info.get_caught()){info.set_caught(true);uncaughtExceptionCount--}info.set_rethrown(false);exceptionCaught.push(info);exception_addRef(info);return info.get_exception_ptr()}var exceptionLast=0;function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-24;this.set_type=function(type){GROWABLE_HEAP_U32()[this.ptr+4>>2]=type};this.get_type=function(){return GROWABLE_HEAP_U32()[this.ptr+4>>2]};this.set_destructor=function(destructor){GROWABLE_HEAP_U32()[this.ptr+8>>2]=destructor};this.get_destructor=function(){return GROWABLE_HEAP_U32()[this.ptr+8>>2]};this.set_refcount=function(refcount){GROWABLE_HEAP_I32()[this.ptr>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;GROWABLE_HEAP_I8()[this.ptr+12>>0]=caught};this.get_caught=function(){return GROWABLE_HEAP_I8()[this.ptr+12>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;GROWABLE_HEAP_I8()[this.ptr+13>>0]=rethrown};this.get_rethrown=function(){return GROWABLE_HEAP_I8()[this.ptr+13>>0]!=0};this.init=function(type,destructor){this.set_adjusted_ptr(0);this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(GROWABLE_HEAP_I32(),this.ptr+0>>2,1)};this.release_ref=function(){var prev=Atomics.sub(GROWABLE_HEAP_I32(),this.ptr+0>>2,1);return prev===1};this.set_adjusted_ptr=function(adjustedPtr){GROWABLE_HEAP_U32()[this.ptr+16>>2]=adjustedPtr};this.get_adjusted_ptr=function(){return GROWABLE_HEAP_U32()[this.ptr+16>>2]};this.get_exception_ptr=function(){var isPointer=___cxa_is_pointer_type(this.get_type());if(isPointer){return GROWABLE_HEAP_U32()[this.excPtr>>2]}var adjusted=this.get_adjusted_ptr();if(adjusted!==0)return adjusted;return this.excPtr}}function ___cxa_free_exception(ptr){return _free(new ExceptionInfo(ptr).ptr)}function exception_decRef(info){if(info.release_ref()&&!info.get_rethrown()){var destructor=info.get_destructor();if(destructor){getWasmTableEntry(destructor)(info.excPtr)}___cxa_free_exception(info.excPtr)}}function ___cxa_end_catch(){_setThrew(0);var info=exceptionCaught.pop();exception_decRef(info);exceptionLast=0}function ___resumeException(ptr){if(!exceptionLast){exceptionLast=ptr}throw ptr}function ___cxa_find_matching_catch_2(){var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0}var info=new ExceptionInfo(thrown);info.set_adjusted_ptr(thrown);var thrownType=info.get_type();if(!thrownType){setTempRet0(0);return thrown}for(var i=0;i<arguments.length;i++){var caughtType=arguments[i];if(caughtType===0||caughtType===thrownType){break}var adjusted_ptr_addr=info.ptr+16;if(___cxa_can_catch(caughtType,thrownType,adjusted_ptr_addr)){setTempRet0(caughtType);return thrown}}setTempRet0(thrownType);return thrown}function ___cxa_find_matching_catch_3(){var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0}var info=new ExceptionInfo(thrown);info.set_adjusted_ptr(thrown);var thrownType=info.get_type();if(!thrownType){setTempRet0(0);return thrown}for(var i=0;i<arguments.length;i++){var caughtType=arguments[i];if(caughtType===0||caughtType===thrownType){break}var adjusted_ptr_addr=info.ptr+16;if(___cxa_can_catch(caughtType,thrownType,adjusted_ptr_addr)){setTempRet0(caughtType);return thrown}}setTempRet0(thrownType);return thrown}function ___cxa_find_matching_catch_4(){var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0}var info=new ExceptionInfo(thrown);info.set_adjusted_ptr(thrown);var thrownType=info.get_type();if(!thrownType){setTempRet0(0);return thrown}for(var i=0;i<arguments.length;i++){var caughtType=arguments[i];if(caughtType===0||caughtType===thrownType){break}var adjusted_ptr_addr=info.ptr+16;if(___cxa_can_catch(caughtType,thrownType,adjusted_ptr_addr)){setTempRet0(caughtType);return thrown}}setTempRet0(thrownType);return thrown}function ___cxa_rethrow(){var info=exceptionCaught.pop();if(!info){abort("no exception to throw")}var ptr=info.excPtr;if(!info.get_rethrown()){exceptionCaught.push(info);info.set_rethrown(true);info.set_caught(false);uncaughtExceptionCount++}exceptionLast=ptr;throw ptr}function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function ___cxa_uncaught_exceptions(){return uncaughtExceptionCount}function ___emscripten_init_main_thread_js(tb){__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1,!ENVIRONMENT_IS_WEB);PThread.threadInitTLS()}function ___emscripten_thread_cleanup(thread){if(!ENVIRONMENT_IS_PTHREAD)cleanupThread(thread);else postMessage({"cmd":"cleanupThread","thread":thread})}function pthreadCreateProxied(pthread_ptr,attr,startRoutine,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,pthread_ptr,attr,startRoutine,arg);return ___pthread_create_js(pthread_ptr,attr,startRoutine,arg)}function ___pthread_create_js(pthread_ptr,attr,startRoutine,arg){if(typeof SharedArrayBuffer=="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return pthreadCreateProxied(pthread_ptr,attr,startRoutine,arg)}if(error)return error;var threadParams={startRoutine:startRoutine,pthread_ptr:pthread_ptr,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function ___stack_chk_fail(){err("missing function: __stack_chk_fail");abort(-1)}function setErrNo(value){GROWABLE_HEAP_I32()[___errno_location()>>2]=value;return value}function ___syscall_fcntl64(fd,cmd,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,fd,cmd,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(cmd){case 0:{var arg=SYSCALLS.get();if(arg<0){return-28}var newStream;newStream=FS.createStream(stream,arg);return newStream.fd}case 1:case 2:return 0;case 3:return stream.flags;case 4:{var arg=SYSCALLS.get();stream.flags|=arg;return 0}case 5:{var arg=SYSCALLS.get();var offset=0;GROWABLE_HEAP_I16()[arg+offset>>1]=2;return 0}case 6:case 7:return 0;case 16:case 8:return-28;case 9:setErrNo(28);return-1;default:{return-28}}}catch(e){if(typeof FS=="undefined"||!(e instanceof FS.ErrnoError))throw e;return-e.errno}}function ___syscall_fstat64(fd,buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd,buf);try{var stream=SYSCALLS.getStreamFromFD(fd);return SYSCALLS.doStat(FS.stat,stream.path,buf)}catch(e){if(typeof FS=="undefined"||!(e instanceof FS.ErrnoError))throw e;return-e.errno}}function ___syscall_getcwd(buf,size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,buf,size);try{if(size===0)return-28;var cwd=FS.cwd();var cwdLengthInBytes=lengthBytesUTF8(cwd)+1;if(size<cwdLengthInBytes)return-68;stringToUTF8(cwd,buf,size);return cwdLengthInBytes}catch(e){if(typeof FS=="undefined"||!(e instanceof FS.ErrnoError))throw e;return-e.errno}}function ___syscall_getdents64(fd,dirp,count){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,dirp,count);try{var stream=SYSCALLS.getStreamFromFD(fd);if(!stream.getdents){stream.getdents=FS.readdir(stream.path)}var struct_size=280;var pos=0;var off=FS.llseek(stream,0,1);var idx=Math.floor(off/struct_size);while(idx<stream.getdents.length&&pos+struct_size<=count){var id;var type;var name=stream.getdents[idx];if(name==="."){id=stream.node.id;type=4}else if(name===".."){var lookup=FS.lookupPath(stream.path,{parent:true});id=lookup.node.id;type=4}else{var child=FS.lookupNode(stream.node,name);id=child.id;type=FS.isChrdev(child.mode)?2:FS.isDir(child.mode)?4:FS.isLink(child.mode)?10:8}tempI64=[id>>>0,(tempDouble=id,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],GROWABLE_HEAP_I32()[dirp+pos>>2]=tempI64[0],GROWABLE_HEAP_I32()[dirp+pos+4>>2]=tempI64[1];tempI64=[(idx+1)*struct_size>>>0,(tempDouble=(idx+1)*struct_size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],GROWABLE_HEAP_I32()[dirp+pos+8>>2]=tempI64[0],GROWABLE_HEAP_I32()[dirp+pos+12>>2]=tempI64[1];GROWABLE_HEAP_I16()[dirp+pos+16>>1]=280;GROWABLE_HEAP_I8()[dirp+pos+18>>0]=type;stringToUTF8(name,dirp+pos+19,256);pos+=struct_size;idx+=1}FS.llseek(stream,idx*struct_size,0);return pos}catch(e){if(typeof FS=="undefined"||!(e instanceof FS.ErrnoError))throw e;return-e.errno}}function ___syscall_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();GROWABLE_HEAP_I32()[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:return-28}}catch(e){if(typeof FS=="undefined"||!(e instanceof FS.ErrnoError))throw e;return-e.errno}}function ___syscall_lstat64(path,buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,path,buf);try{path=SYSCALLS.getStr(path);return SYSCALLS.doStat(FS.lstat,path,buf)}catch(e){if(typeof FS=="undefined"||!(e instanceof FS.ErrnoError))throw e;return-e.errno}}function ___syscall_mkdirat(dirfd,path,mode){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(10,1,dirfd,path,mode);try{path=SYSCALLS.getStr(path);path=SYSCALLS.calculateAt(dirfd,path);path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0}catch(e){if(typeof FS=="undefined"||!(e instanceof FS.ErrnoError))throw e;return-e.errno}}function ___syscall_newfstatat(dirfd,path,buf,flags){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(11,1,dirfd,path,buf,flags);try{path=SYSCALLS.getStr(path);var nofollow=flags&256;var allowEmpty=flags&4096;flags=flags&~6400;path=SYSCALLS.calculateAt(dirfd,path,allowEmpty);return SYSCALLS.doStat(nofollow?FS.lstat:FS.stat,path,buf)}catch(e){if(typeof FS=="undefined"||!(e instanceof FS.ErrnoError))throw e;return-e.errno}}function ___syscall_openat(dirfd,path,flags,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(12,1,dirfd,path,flags,varargs);SYSCALLS.varargs=varargs;try{path=SYSCALLS.getStr(path);path=SYSCALLS.calculateAt(dirfd,path);var mode=varargs?SYSCALLS.get():0;return FS.open(path,flags,mode).fd}catch(e){if(typeof FS=="undefined"||!(e instanceof FS.ErrnoError))throw e;return-e.errno}}var PIPEFS={BUCKET_BUFFER_SIZE:8192,mount:function(mount){return FS.createNode(null,"/",16384|511,0)},createPipe:function(){var pipe={buckets:[],refcnt:2};pipe.buckets.push({buffer:new Uint8Array(PIPEFS.BUCKET_BUFFER_SIZE),offset:0,roffset:0});var rName=PIPEFS.nextname();var wName=PIPEFS.nextname();var rNode=FS.createNode(PIPEFS.root,rName,4096,0);var wNode=FS.createNode(PIPEFS.root,wName,4096,0);rNode.pipe=pipe;wNode.pipe=pipe;var readableStream=FS.createStream({path:rName,node:rNode,flags:0,seekable:false,stream_ops:PIPEFS.stream_ops});rNode.stream=readableStream;var writableStream=FS.createStream({path:wName,node:wNode,flags:1,seekable:false,stream_ops:PIPEFS.stream_ops});wNode.stream=writableStream;return{readable_fd:readableStream.fd,writable_fd:writableStream.fd}},stream_ops:{poll:function(stream){var pipe=stream.node.pipe;if((stream.flags&2097155)===1){return 256|4}if(pipe.buckets.length>0){for(var i=0;i<pipe.buckets.length;i++){var bucket=pipe.buckets[i];if(bucket.offset-bucket.roffset>0){return 64|1}}}return 0},ioctl:function(stream,request,varargs){return 28},fsync:function(stream){return 28},read:function(stream,buffer,offset,length,position){var pipe=stream.node.pipe;var currentLength=0;for(var i=0;i<pipe.buckets.length;i++){var bucket=pipe.buckets[i];currentLength+=bucket.offset-bucket.roffset}assert(buffer instanceof ArrayBuffer||buffer instanceof SharedArrayBuffer||ArrayBuffer.isView(buffer));var data=buffer.subarray(offset,offset+length);if(length<=0){return 0}if(currentLength==0){throw new FS.ErrnoError(6)}var toRead=Math.min(currentLength,length);var totalRead=toRead;var toRemove=0;for(var i=0;i<pipe.buckets.length;i++){var currBucket=pipe.buckets[i];var bucketSize=currBucket.offset-currBucket.roffset;if(toRead<=bucketSize){var tmpSlice=currBucket.buffer.subarray(currBucket.roffset,currBucket.offset);if(toRead<bucketSize){tmpSlice=tmpSlice.subarray(0,toRead);currBucket.roffset+=toRead}else{toRemove++}data.set(tmpSlice);break}else{var tmpSlice=currBucket.buffer.subarray(currBucket.roffset,currBucket.offset);data.set(tmpSlice);data=data.subarray(tmpSlice.byteLength);toRead-=tmpSlice.byteLength;toRemove++}}if(toRemove&&toRemove==pipe.buckets.length){toRemove--;pipe.buckets[toRemove].offset=0;pipe.buckets[toRemove].roffset=0}pipe.buckets.splice(0,toRemove);return totalRead},write:function(stream,buffer,offset,length,position){var pipe=stream.node.pipe;assert(buffer instanceof ArrayBuffer||buffer instanceof SharedArrayBuffer||ArrayBuffer.isView(buffer));var data=buffer.subarray(offset,offset+length);var dataLen=data.byteLength;if(dataLen<=0){return 0}var currBucket=null;if(pipe.buckets.length==0){currBucket={buffer:new Uint8Array(PIPEFS.BUCKET_BUFFER_SIZE),offset:0,roffset:0};pipe.buckets.push(currBucket)}else{currBucket=pipe.buckets[pipe.buckets.length-1]}assert(currBucket.offset<=PIPEFS.BUCKET_BUFFER_SIZE);var freeBytesInCurrBuffer=PIPEFS.BUCKET_BUFFER_SIZE-currBucket.offset;if(freeBytesInCurrBuffer>=dataLen){currBucket.buffer.set(data,currBucket.offset);currBucket.offset+=dataLen;return dataLen}else if(freeBytesInCurrBuffer>0){currBucket.buffer.set(data.subarray(0,freeBytesInCurrBuffer),currBucket.offset);currBucket.offset+=freeBytesInCurrBuffer;data=data.subarray(freeBytesInCurrBuffer,data.byteLength)}var numBuckets=data.byteLength/PIPEFS.BUCKET_BUFFER_SIZE|0;var remElements=data.byteLength%PIPEFS.BUCKET_BUFFER_SIZE;for(var i=0;i<numBuckets;i++){var newBucket={buffer:new Uint8Array(PIPEFS.BUCKET_BUFFER_SIZE),offset:PIPEFS.BUCKET_BUFFER_SIZE,roffset:0};pipe.buckets.push(newBucket);newBucket.buffer.set(data.subarray(0,PIPEFS.BUCKET_BUFFER_SIZE));data=data.subarray(PIPEFS.BUCKET_BUFFER_SIZE,data.byteLength)}if(remElements>0){var newBucket={buffer:new Uint8Array(PIPEFS.BUCKET_BUFFER_SIZE),offset:data.byteLength,roffset:0};pipe.buckets.push(newBucket);newBucket.buffer.set(data)}return dataLen},close:function(stream){var pipe=stream.node.pipe;pipe.refcnt--;if(pipe.refcnt===0){pipe.buckets=null}}},nextname:function(){if(!PIPEFS.nextname.current){PIPEFS.nextname.current=0}return"pipe["+PIPEFS.nextname.current+++"]"}};function ___syscall_pipe(fdPtr){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(13,1,fdPtr);try{if(fdPtr==0){throw new FS.ErrnoError(21)}var res=PIPEFS.createPipe();GROWABLE_HEAP_I32()[fdPtr>>2]=res.readable_fd;GROWABLE_HEAP_I32()[fdPtr+4>>2]=res.writable_fd;return 0}catch(e){if(typeof FS=="undefined"||!(e instanceof FS.ErrnoError))throw e;return-e.errno}}function ___syscall_poll(fds,nfds,timeout){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(14,1,fds,nfds,timeout);try{var nonzero=0;for(var i=0;i<nfds;i++){var pollfd=fds+8*i;var fd=GROWABLE_HEAP_I32()[pollfd>>2];var events=GROWABLE_HEAP_I16()[pollfd+4>>1];var mask=32;var stream=FS.getStream(fd);if(stream){mask=SYSCALLS.DEFAULT_POLLMASK;if(stream.stream_ops.poll){mask=stream.stream_ops.poll(stream)}}mask&=events|8|16;if(mask)nonzero++;GROWABLE_HEAP_I16()[pollfd+6>>1]=mask}return nonzero}catch(e){if(typeof FS=="undefined"||!(e instanceof FS.ErrnoError))throw e;return-e.errno}}function ___syscall_stat64(path,buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(15,1,path,buf);try{path=SYSCALLS.getStr(path);return SYSCALLS.doStat(FS.stat,path,buf)}catch(e){if(typeof FS=="undefined"||!(e instanceof FS.ErrnoError))throw e;return-e.errno}}function __emscripten_default_pthread_stack_size(){return 2097152}var nowIsMonotonic=true;function __emscripten_get_now_is_monotonic(){return nowIsMonotonic}function executeNotifiedProxyingQueue(queue){Atomics.store(GROWABLE_HEAP_I32(),queue>>2,1);if(_pthread_self()){__emscripten_proxy_execute_task_queue(queue)}Atomics.compareExchange(GROWABLE_HEAP_I32(),queue>>2,1,0)}Module["executeNotifiedProxyingQueue"]=executeNotifiedProxyingQueue;function __emscripten_notify_task_queue(targetThreadId,currThreadId,mainThreadId,queue){if(targetThreadId==currThreadId){setTimeout(()=>executeNotifiedProxyingQueue(queue))}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processProxyingQueue","queue":queue})}else{var worker=PThread.pthreads[targetThreadId];if(!worker){return}worker.postMessage({"cmd":"processProxyingQueue","queue":queue})}return 1}function __emscripten_set_offscreencanvas_size(target,width,height){return-1}function __emscripten_throw_longjmp(){throw Infinity}function readI53FromI64(ptr){return GROWABLE_HEAP_U32()[ptr>>2]+GROWABLE_HEAP_I32()[ptr+4>>2]*4294967296}function __gmtime_js(time,tmPtr){var date=new Date(readI53FromI64(time)*1e3);GROWABLE_HEAP_I32()[tmPtr>>2]=date.getUTCSeconds();GROWABLE_HEAP_I32()[tmPtr+4>>2]=date.getUTCMinutes();GROWABLE_HEAP_I32()[tmPtr+8>>2]=date.getUTCHours();GROWABLE_HEAP_I32()[tmPtr+12>>2]=date.getUTCDate();GROWABLE_HEAP_I32()[tmPtr+16>>2]=date.getUTCMonth();GROWABLE_HEAP_I32()[tmPtr+20>>2]=date.getUTCFullYear()-1900;GROWABLE_HEAP_I32()[tmPtr+24>>2]=date.getUTCDay();var start=Date.UTC(date.getUTCFullYear(),0,1,0,0,0,0);var yday=(date.getTime()-start)/(1e3*60*60*24)|0;GROWABLE_HEAP_I32()[tmPtr+28>>2]=yday}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}var __MONTH_DAYS_LEAP_CUMULATIVE=[0,31,60,91,121,152,182,213,244,274,305,335];var __MONTH_DAYS_REGULAR_CUMULATIVE=[0,31,59,90,120,151,181,212,243,273,304,334];function __yday_from_date(date){var isLeapYear=__isLeapYear(date.getFullYear());var monthDaysCumulative=isLeapYear?__MONTH_DAYS_LEAP_CUMULATIVE:__MONTH_DAYS_REGULAR_CUMULATIVE;var yday=monthDaysCumulative[date.getMonth()]+date.getDate()-1;return yday}function __localtime_js(time,tmPtr){var date=new Date(readI53FromI64(time)*1e3);GROWABLE_HEAP_I32()[tmPtr>>2]=date.getSeconds();GROWABLE_HEAP_I32()[tmPtr+4>>2]=date.getMinutes();GROWABLE_HEAP_I32()[tmPtr+8>>2]=date.getHours();GROWABLE_HEAP_I32()[tmPtr+12>>2]=date.getDate();GROWABLE_HEAP_I32()[tmPtr+16>>2]=date.getMonth();GROWABLE_HEAP_I32()[tmPtr+20>>2]=date.getFullYear()-1900;GROWABLE_HEAP_I32()[tmPtr+24>>2]=date.getDay();var yday=__yday_from_date(date)|0;GROWABLE_HEAP_I32()[tmPtr+28>>2]=yday;GROWABLE_HEAP_I32()[tmPtr+36>>2]=-(date.getTimezoneOffset()*60);var start=new Date(date.getFullYear(),0,1);var summerOffset=new Date(date.getFullYear(),6,1).getTimezoneOffset();var winterOffset=start.getTimezoneOffset();var dst=(summerOffset!=winterOffset&&date.getTimezoneOffset()==Math.min(winterOffset,summerOffset))|0;GROWABLE_HEAP_I32()[tmPtr+32>>2]=dst}function __munmap_js(addr,len,prot,flags,fd,offset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(16,1,addr,len,prot,flags,fd,offset);try{var stream=SYSCALLS.getStreamFromFD(fd);if(prot&2){SYSCALLS.doMsync(addr,stream,len,flags,offset)}FS.munmap(stream)}catch(e){if(typeof FS=="undefined"||!(e instanceof FS.ErrnoError))throw e;return-e.errno}}function allocateUTF8(str){var size=lengthBytesUTF8(str)+1;var ret=_malloc(size);if(ret)stringToUTF8Array(str,GROWABLE_HEAP_I8(),ret,size);return ret}function __tzset_js(timezone,daylight,tzname){var currentYear=(new Date).getFullYear();var winter=new Date(currentYear,0,1);var summer=new Date(currentYear,6,1);var winterOffset=winter.getTimezoneOffset();var summerOffset=summer.getTimezoneOffset();var stdTimezoneOffset=Math.max(winterOffset,summerOffset);GROWABLE_HEAP_U32()[timezone>>2]=stdTimezoneOffset*60;GROWABLE_HEAP_I32()[daylight>>2]=Number(winterOffset!=summerOffset);function extractZone(date){var match=date.toTimeString().match(/\(([A-Za-z ]+)\)$/);return match?match[1]:"GMT"}var winterName=extractZone(winter);var summerName=extractZone(summer);var winterNamePtr=allocateUTF8(winterName);var summerNamePtr=allocateUTF8(summerName);if(summerOffset<winterOffset){GROWABLE_HEAP_U32()[tzname>>2]=winterNamePtr;GROWABLE_HEAP_U32()[tzname+4>>2]=summerNamePtr}else{GROWABLE_HEAP_U32()[tzname>>2]=summerNamePtr;GROWABLE_HEAP_U32()[tzname+4>>2]=winterNamePtr}}function _abort(){abort("")}var readEmAsmArgsArray=[];function readEmAsmArgs(sigPtr,buf){readEmAsmArgsArray.length=0;var ch;buf>>=2;while(ch=GROWABLE_HEAP_U8()[sigPtr++]){buf+=ch!=105&buf;readEmAsmArgsArray.push(ch==105?GROWABLE_HEAP_I32()[buf]:GROWABLE_HEAP_F64()[buf++>>1]);++buf}return readEmAsmArgsArray}function runEmAsmFunction(code,sigPtr,argbuf){var args=readEmAsmArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_asm_const_double(code,sigPtr,argbuf){return runEmAsmFunction(code,sigPtr,argbuf)}function _emscripten_asm_const_int(code,sigPtr,argbuf){return runEmAsmFunction(code,sigPtr,argbuf)}function runMainThreadEmAsm(code,sigPtr,argbuf,sync){var args=readEmAsmArgs(sigPtr,argbuf);if(ENVIRONMENT_IS_PTHREAD){return _emscripten_proxy_to_main_thread_js.apply(null,[-1-code,sync].concat(args))}return ASM_CONSTS[code].apply(null,args)}function _emscripten_asm_const_int_sync_on_main_thread(code,sigPtr,argbuf){return runMainThreadEmAsm(code,sigPtr,argbuf,1)}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_date_now(){return Date.now()}function getHeapMax(){return 2097152e3}function _emscripten_get_heap_max(){return getHeapMax()}var _emscripten_get_now;if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=()=>performance.now()-Module["__performance_now_clock_drift"]}else _emscripten_get_now=()=>performance.now();function _emscripten_memcpy_big(dest,src,num){GROWABLE_HEAP_U8().copyWithin(dest,src,src+num)}function _emscripten_num_logical_cores(){return navigator["hardwareConcurrency"]}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var outerArgs=arguments;return withStackSave(()=>{var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i<numCallArgs;i++){var arg=outerArgs[2+i];GROWABLE_HEAP_F64()[b+i]=arg}return _emscripten_run_in_main_runtime_thread_js(index,serializedNumCallArgs,args,sync)})}var _emscripten_receive_on_main_thread_js_callArgs=[];function _emscripten_receive_on_main_thread_js(index,numCallArgs,args){_emscripten_receive_on_main_thread_js_callArgs.length=numCallArgs;var b=args>>3;for(var i=0;i<numCallArgs;i++){_emscripten_receive_on_main_thread_js_callArgs[i]=GROWABLE_HEAP_F64()[b+i]}var isEmAsmConst=index<0;var func=!isEmAsmConst?proxiedFunctionTable[index]:ASM_CONSTS[-index-1];return func.apply(null,_emscripten_receive_on_main_thread_js_callArgs)}function emscripten_realloc_buffer(size){try{wasmMemory.grow(size-buffer.byteLength+65535>>>16);updateGlobalBufferAndViews(wasmMemory.buffer);return 1}catch(e){postMessage({status:-35,cmd:-35})}}function _emscripten_resize_heap(requestedSize){var oldSize=GROWABLE_HEAP_U8().length;requestedSize=requestedSize>>>0;if(requestedSize<=oldSize){return false}var maxHeapSize=getHeapMax();if(requestedSize>maxHeapSize){return false}let alignUp=(x,multiple)=>x+(multiple-x%multiple)%multiple;for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+1/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignUp(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=emscripten_realloc_buffer(newSize);if(replacement){return true}}return false}function _emscripten_unwind_to_js_event_loop(){throw"unwind"}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){if(ENV[x]===undefined)delete env[x];else env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i<str.length;++i){GROWABLE_HEAP_I8()[buffer++>>0]=str.charCodeAt(i)}if(!dontAddNull)GROWABLE_HEAP_I8()[buffer>>0]=0}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(17,1,__environ,environ_buf);var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;GROWABLE_HEAP_U32()[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(18,1,penviron_count,penviron_buf_size);var strings=getEnvStrings();GROWABLE_HEAP_U32()[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});GROWABLE_HEAP_U32()[penviron_buf_size>>2]=bufSize;return 0}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(19,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS=="undefined"||!(e instanceof FS.ErrnoError))throw e;return e.errno}}function doReadv(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i<iovcnt;i++){var ptr=GROWABLE_HEAP_U32()[iov>>2];var len=GROWABLE_HEAP_U32()[iov+4>>2];iov+=8;var curr=FS.read(stream,GROWABLE_HEAP_I8(),ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr<len)break}return ret}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(20,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=doReadv(stream,iov,iovcnt);GROWABLE_HEAP_U32()[pnum>>2]=num;return 0}catch(e){if(typeof FS=="undefined"||!(e instanceof FS.ErrnoError))throw e;return e.errno}}function convertI32PairToI53Checked(lo,hi){return hi+2097152>>>0<4194305-!!lo?(lo>>>0)+hi*4294967296:NaN}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(21,1,fd,offset_low,offset_high,whence,newOffset);try{var offset=convertI32PairToI53Checked(offset_low,offset_high);if(isNaN(offset))return 61;var stream=SYSCALLS.getStreamFromFD(fd);FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],GROWABLE_HEAP_I32()[newOffset>>2]=tempI64[0],GROWABLE_HEAP_I32()[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS=="undefined"||!(e instanceof FS.ErrnoError))throw e;return e.errno}}function doWritev(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i<iovcnt;i++){var ptr=GROWABLE_HEAP_U32()[iov>>2];var len=GROWABLE_HEAP_U32()[iov+4>>2];iov+=8;var curr=FS.write(stream,GROWABLE_HEAP_I8(),ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(22,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=doWritev(stream,iov,iovcnt);GROWABLE_HEAP_U32()[pnum>>2]=num;return 0}catch(e){if(typeof FS=="undefined"||!(e instanceof FS.ErrnoError))throw e;return e.errno}}function _llvm_eh_typeid_for(type){return type}function _setCurrentThreadSsrc(ssrc){setCurrentThreadSsrc_js(ssrc)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function writeArrayToMemory(array,buffer){GROWABLE_HEAP_I8().set(array,buffer)}function _strftime(s,maxsize,format,tm){var tm_zone=GROWABLE_HEAP_I32()[tm+40>>2];var date={tm_sec:GROWABLE_HEAP_I32()[tm>>2],tm_min:GROWABLE_HEAP_I32()[tm+4>>2],tm_hour:GROWABLE_HEAP_I32()[tm+8>>2],tm_mday:GROWABLE_HEAP_I32()[tm+12>>2],tm_mon:GROWABLE_HEAP_I32()[tm+16>>2],tm_year:GROWABLE_HEAP_I32()[tm+20>>2],tm_wday:GROWABLE_HEAP_I32()[tm+24>>2],tm_yday:GROWABLE_HEAP_I32()[tm+28>>2],tm_isdst:GROWABLE_HEAP_I32()[tm+32>>2],tm_gmtoff:GROWABLE_HEAP_I32()[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value=="number"?value.toString():value||"";while(str.length<digits){str=character[0]+str}return str}function leadingNulls(value,digits){return leadingSomething(value,digits,"0")}function compareByDay(date1,date2){function sgn(value){return value<0?-1:value>0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}return thisDate.getFullYear()}return thisDate.getFullYear()-1}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}return"PM"},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var days=date.tm_yday+7-date.tm_wday;return leadingNulls(Math.floor(days/7),2)},"%V":function(date){var val=Math.floor((date.tm_yday+7-(date.tm_wday+6)%7)/7);if((date.tm_wday+371-date.tm_yday-2)%7<=2){val++}if(!val){val=52;var dec31=(date.tm_wday+7-date.tm_yday-1)%7;if(dec31==4||dec31==5&&__isLeapYear(date.tm_year%400-1)){val++}}else if(val==53){var jan1=(date.tm_wday+371-date.tm_yday)%7;if(jan1!=4&&(jan1!=3||!__isLeapYear(date.tm_year)))val=1}return leadingNulls(val,2)},"%w":function(date){return date.tm_wday},"%W":function(date){var days=date.tm_yday+7-(date.tm_wday+6)%7;return leadingNulls(Math.floor(days/7),2)},"%y":function(date){return(date.tm_year+1900).toString().substring(2)},"%Y":function(date){return date.tm_year+1900},"%z":function(date){var off=date.tm_gmtoff;var ahead=off>=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};pattern=pattern.replace(/%%/g,"\0\0");for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}pattern=pattern.replace(/\0\0/g,"%");var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm,loc){return _strftime(s,maxsize,format,tm)}function _zlt_tfjs_execute_afn(input_img,input_ref,input_msk,len,output_buffer){return execute_afn(input_img,input_ref,input_msk,len,output_buffer)}function _zlt_tfjs_execute_base_cls(input_buffer,len,output_buffer,output_len){return execute_base(input_buffer,len,output_buffer,output_len)}async function _zlt_tfjs_init(){}function _zoom_wcl_get_cpu_num(){return hardcodecpunumber()}function _zoom_wcl_get_csc_thread_num(){return 1}function _zoom_wcl_support_multi_thread(){return IsSupportMultiThread()}function getCFunc(ident){var func=Module["_"+ident];return func}function ccall(ident,returnType,argTypes,args,opts){var toC={"string":str=>{var ret=0;if(str!==null&&str!==undefined&&str!==0){var len=(str.length<<2)+1;ret=stackAlloc(len);stringToUTF8(str,ret,len)}return ret},"array":arr=>{var ret=stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}};function convertReturnValue(ret){if(returnType==="string"){return UTF8ToString(ret)}if(returnType==="boolean")return Boolean(ret);return ret}var func=getCFunc(ident);var cArgs=[];var stack=0;if(args){for(var i=0;i<args.length;i++){var converter=toC[argTypes[i]];if(converter){if(stack===0)stack=stackSave();cArgs[i]=converter(args[i])}else{cArgs[i]=args[i]}}}var ret=func.apply(null,cArgs);function onDone(ret){if(stack!==0)stackRestore(stack);return convertReturnValue(ret)}ret=onDone(ret);return ret}function cwrap(ident,returnType,argTypes,opts){argTypes=argTypes||[];var numericArgs=argTypes.every(type=>type==="number"||type==="boolean");var numericRet=returnType!=="string";if(numericRet&&numericArgs&&!opts){return getCFunc(ident)}return function(){return ccall(ident,returnType,argTypes,arguments,opts)}}PThread.init();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var proxiedFunctionTable=[null,_proc_exit,exitOnMainThread,pthreadCreateProxied,___syscall_fcntl64,___syscall_fstat64,___syscall_getcwd,___syscall_getdents64,___syscall_ioctl,___syscall_lstat64,___syscall_mkdirat,___syscall_newfstatat,___syscall_openat,___syscall_pipe,___syscall_poll,___syscall_stat64,__munmap_js,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];var asmLibraryArg={"AdapterWhiteListCheck":_AdapterWhiteListCheck,"CloseVideoEncoder":_CloseVideoEncoder,"CreateGltPlatform":_CreateGltPlatform,"DestroyGltPlatform":_DestroyGltPlatform,"EncodeVideoFrameID":_EncodeVideoFrameID,"GetEncoderState":_GetEncoderState,"GetLogLevel":_GetLogLevel,"GetWebCodecsEncoderFallbackFlag":_GetWebCodecsEncoderFallbackFlag,"GetWebCodecsEncoderL1T2Flag":_GetWebCodecsEncoderL1T2Flag,"InitVideoDecoder":_InitVideoDecoder,"InitVideoEncoder":_InitVideoEncoder,"LimitWebCodecsDecoderTo360":_LimitWebCodecsDecoderTo360,"LimitWebCodecsEncoderTo360":_LimitWebCodecsEncoderTo360,"Set_Share_Mode":_Set_Share_Mode,"UserAgentIsTesla":_UserAgentIsTesla,"VideoDecoder":_VideoDecoder,"VideoDecoderConfigure":_VideoDecoderConfigure,"VideoEncoderConfigure":_VideoEncoderConfigure,"WebCodecsDecoderFail":_WebCodecsDecoderFail,"WebCodecsEncoderFail":_WebCodecsEncoderFail,"WebCodecsVideoEncoder":_WebCodecsVideoEncoder,"_ZN11cpt_generic6thread4joinEv":__ZN11cpt_generic6thread4joinEv,"_ZN11cpt_generic6threadD1Ev":__ZN11cpt_generic6threadD1Ev,"_ZN5Nydus16CWCLWallRenderer14CreateInstanceEPvRKNS_9NydusRectEPPNS_13IWallRendererE":__ZN5Nydus16CWCLWallRenderer14CreateInstanceEPvRKNS_9NydusRectEPPNS_13IWallRendererE,"__assert_fail":___assert_fail,"__cxa_allocate_exception":___cxa_allocate_exception,"__cxa_begin_catch":___cxa_begin_catch,"__cxa_end_catch":___cxa_end_catch,"__cxa_find_matching_catch_2":___cxa_find_matching_catch_2,"__cxa_find_matching_catch_3":___cxa_find_matching_catch_3,"__cxa_find_matching_catch_4":___cxa_find_matching_catch_4,"__cxa_free_exception":___cxa_free_exception,"__cxa_rethrow":___cxa_rethrow,"__cxa_throw":___cxa_throw,"__cxa_uncaught_exceptions":___cxa_uncaught_exceptions,"__emscripten_init_main_thread_js":___emscripten_init_main_thread_js,"__emscripten_thread_cleanup":___emscripten_thread_cleanup,"__pthread_create_js":___pthread_create_js,"__resumeException":___resumeException,"__stack_chk_fail":___stack_chk_fail,"__syscall_fcntl64":___syscall_fcntl64,"__syscall_fstat64":___syscall_fstat64,"__syscall_getcwd":___syscall_getcwd,"__syscall_getdents64":___syscall_getdents64,"__syscall_ioctl":___syscall_ioctl,"__syscall_lstat64":___syscall_lstat64,"__syscall_mkdirat":___syscall_mkdirat,"__syscall_newfstatat":___syscall_newfstatat,"__syscall_openat":___syscall_openat,"__syscall_pipe":___syscall_pipe,"__syscall_poll":___syscall_poll,"__syscall_stat64":___syscall_stat64,"_emscripten_default_pthread_stack_size":__emscripten_default_pthread_stack_size,"_emscripten_get_now_is_monotonic":__emscripten_get_now_is_monotonic,"_emscripten_notify_task_queue":__emscripten_notify_task_queue,"_emscripten_set_offscreencanvas_size":__emscripten_set_offscreencanvas_size,"_emscripten_throw_longjmp":__emscripten_throw_longjmp,"_gmtime_js":__gmtime_js,"_localtime_js":__localtime_js,"_munmap_js":__munmap_js,"_tzset_js":__tzset_js,"abort":_abort,"emscripten_asm_const_double":_emscripten_asm_const_double,"emscripten_asm_const_int":_emscripten_asm_const_int,"emscripten_asm_const_int_sync_on_main_thread":_emscripten_asm_const_int_sync_on_main_thread,"emscripten_check_blocking_allowed":_emscripten_check_blocking_allowed,"emscripten_date_now":_emscripten_date_now,"emscripten_get_heap_max":_emscripten_get_heap_max,"emscripten_get_now":_emscripten_get_now,"emscripten_memcpy_big":_emscripten_memcpy_big,"emscripten_num_logical_cores":_emscripten_num_logical_cores,"emscripten_receive_on_main_thread_js":_emscripten_receive_on_main_thread_js,"emscripten_resize_heap":_emscripten_resize_heap,"emscripten_unwind_to_js_event_loop":_emscripten_unwind_to_js_event_loop,"environ_get":_environ_get,"environ_sizes_get":_environ_sizes_get,"exit":_exit,"fd_close":_fd_close,"fd_read":_fd_read,"fd_seek":_fd_seek,"fd_write":_fd_write,"invoke_diii":invoke_diii,"invoke_fiii":invoke_fiii,"invoke_i":invoke_i,"invoke_ii":invoke_ii,"invoke_iii":invoke_iii,"invoke_iiii":invoke_iiii,"invoke_iiiii":invoke_iiiii,"invoke_iiiiii":invoke_iiiiii,"invoke_iiiiiii":invoke_iiiiiii,"invoke_iiiiiiii":invoke_iiiiiiii,"invoke_iiiiiiiiiii":invoke_iiiiiiiiiii,"invoke_iiiiiiiiiiii":invoke_iiiiiiiiiiii,"invoke_iiiiiiiiiiiii":invoke_iiiiiiiiiiiii,"invoke_jiiii":invoke_jiiii,"invoke_v":invoke_v,"invoke_vi":invoke_vi,"invoke_vii":invoke_vii,"invoke_viii":invoke_viii,"invoke_viiii":invoke_viiii,"invoke_viiiiiii":invoke_viiiiiii,"invoke_viiiiiiiiii":invoke_viiiiiiiiii,"invoke_viiiiiiiiiiiiiii":invoke_viiiiiiiiiiiiiii,"invoke_viiiij":invoke_viiiij,"invoke_viijii":invoke_viijii,"invoke_vij":invoke_vij,"llvm_eh_typeid_for":_llvm_eh_typeid_for,"memory":wasmMemory,"setCurrentThreadSsrc":_setCurrentThreadSsrc,"strftime":_strftime,"strftime_l":_strftime_l,"zlt_tfjs_execute_afn":_zlt_tfjs_execute_afn,"zlt_tfjs_execute_base_cls":_zlt_tfjs_execute_base_cls,"zlt_tfjs_init":_zlt_tfjs_init,"zoom_wcl_get_cpu_num":_zoom_wcl_get_cpu_num,"zoom_wcl_get_csc_thread_num":_zoom_wcl_get_csc_thread_num,"zoom_wcl_support_multi_thread":_zoom_wcl_support_multi_thread};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["__wasm_call_ctors"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["malloc"]).apply(null,arguments)};var __Video_Init=Module["__Video_Init"]=function(){return(__Video_Init=Module["__Video_Init"]=Module["asm"]["_Video_Init"]).apply(null,arguments)};var __Video_UnInit=Module["__Video_UnInit"]=function(){return(__Video_UnInit=Module["__Video_UnInit"]=Module["asm"]["_Video_UnInit"]).apply(null,arguments)};var __Video_Decode=Module["__Video_Decode"]=function(){return(__Video_Decode=Module["__Video_Decode"]=Module["asm"]["_Video_Decode"]).apply(null,arguments)};var __Change_Connect_Type=Module["__Change_Connect_Type"]=function(){return(__Change_Connect_Type=Module["__Change_Connect_Type"]=Module["asm"]["_Change_Connect_Type"]).apply(null,arguments)};var __Smooth_Send_For_Qos=Module["__Smooth_Send_For_Qos"]=function(){return(__Smooth_Send_For_Qos=Module["__Smooth_Send_For_Qos"]=Module["asm"]["_Smooth_Send_For_Qos"]).apply(null,arguments)};var __Video_Try_Analysis=Module["__Video_Try_Analysis"]=function(){return(__Video_Try_Analysis=Module["__Video_Try_Analysis"]=Module["asm"]["_Video_Try_Analysis"]).apply(null,arguments)};var __signal_video_controller_encode_pdu_info=Module["__signal_video_controller_encode_pdu_info"]=function(){return(__signal_video_controller_encode_pdu_info=Module["__signal_video_controller_encode_pdu_info"]=Module["asm"]["_signal_video_controller_encode_pdu_info"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["free"]).apply(null,arguments)};var __Video_Encode=Module["__Video_Encode"]=function(){return(__Video_Encode=Module["__Video_Encode"]=Module["asm"]["_Video_Encode"]).apply(null,arguments)};var __rotate_video=Module["__rotate_video"]=function(){return(__rotate_video=Module["__rotate_video"]=Module["asm"]["_rotate_video"]).apply(null,arguments)};var __Video_Encode_YUV=Module["__Video_Encode_YUV"]=function(){return(__Video_Encode_YUV=Module["__Video_Encode_YUV"]=Module["asm"]["_Video_Encode_YUV"]).apply(null,arguments)};var __Video_VirtualBackground_Special_Action=Module["__Video_VirtualBackground_Special_Action"]=function(){return(__Video_VirtualBackground_Special_Action=Module["__Video_VirtualBackground_Special_Action"]=Module["asm"]["_Video_VirtualBackground_Special_Action"]).apply(null,arguments)};var __Qos_Sender_Send_Data_In_Main_Thread=Module["__Qos_Sender_Send_Data_In_Main_Thread"]=function(){return(__Qos_Sender_Send_Data_In_Main_Thread=Module["__Qos_Sender_Send_Data_In_Main_Thread"]=Module["asm"]["_Qos_Sender_Send_Data_In_Main_Thread"]).apply(null,arguments)};var __Video_Websocket_Speed=Module["__Video_Websocket_Speed"]=function(){return(__Video_Websocket_Speed=Module["__Video_Websocket_Speed"]=Module["asm"]["_Video_Websocket_Speed"]).apply(null,arguments)};var __Video_Start_Encode=Module["__Video_Start_Encode"]=function(){return(__Video_Start_Encode=Module["__Video_Start_Encode"]=Module["asm"]["_Video_Start_Encode"]).apply(null,arguments)};var __signal_video_controller_enocde_start_or_stop_encode=Module["__signal_video_controller_enocde_start_or_stop_encode"]=function(){return(__signal_video_controller_enocde_start_or_stop_encode=Module["__signal_video_controller_enocde_start_or_stop_encode"]=Module["asm"]["_signal_video_controller_enocde_start_or_stop_encode"]).apply(null,arguments)};var __Video_Stop_Encode=Module["__Video_Stop_Encode"]=function(){return(__Video_Stop_Encode=Module["__Video_Stop_Encode"]=Module["asm"]["_Video_Stop_Encode"]).apply(null,arguments)};var __Request_Video_Qos_Data=Module["__Request_Video_Qos_Data"]=function(){return(__Request_Video_Qos_Data=Module["__Request_Video_Qos_Data"]=Module["asm"]["_Request_Video_Qos_Data"]).apply(null,arguments)};var __signal_video_controller_enocde_request_check_one_type=Module["__signal_video_controller_enocde_request_check_one_type"]=function(){return(__signal_video_controller_enocde_request_check_one_type=Module["__signal_video_controller_enocde_request_check_one_type"]=Module["asm"]["_signal_video_controller_enocde_request_check_one_type"]).apply(null,arguments)};var __Video_Update_Format=Module["__Video_Update_Format"]=function(){return(__Video_Update_Format=Module["__Video_Update_Format"]=Module["asm"]["_Video_Update_Format"]).apply(null,arguments)};var __Video_Set_Data_Encryption=Module["__Video_Set_Data_Encryption"]=function(){return(__Video_Set_Data_Encryption=Module["__Video_Set_Data_Encryption"]=Module["asm"]["_Video_Set_Data_Encryption"]).apply(null,arguments)};var __Add_Video_Cooker_info=Module["__Add_Video_Cooker_info"]=function(){return(__Add_Video_Cooker_info=Module["__Add_Video_Cooker_info"]=Module["asm"]["_Add_Video_Cooker_info"]).apply(null,arguments)};var __signal_video_controller_encode_cooker_info=Module["__signal_video_controller_encode_cooker_info"]=function(){return(__signal_video_controller_encode_cooker_info=Module["__signal_video_controller_encode_cooker_info"]=Module["asm"]["_signal_video_controller_encode_cooker_info"]).apply(null,arguments)};var __Remove_Video_Cooker_Info=Module["__Remove_Video_Cooker_Info"]=function(){return(__Remove_Video_Cooker_Info=Module["__Remove_Video_Cooker_Info"]=Module["asm"]["_Remove_Video_Cooker_Info"]).apply(null,arguments)};var __Get_Video_Meat_Weight=Module["__Get_Video_Meat_Weight"]=function(){return(__Get_Video_Meat_Weight=Module["__Get_Video_Meat_Weight"]=Module["asm"]["_Get_Video_Meat_Weight"]).apply(null,arguments)};var __Set_Max_Receiving_Channel_Num=Module["__Set_Max_Receiving_Channel_Num"]=function(){return(__Set_Max_Receiving_Channel_Num=Module["__Set_Max_Receiving_Channel_Num"]=Module["asm"]["_Set_Max_Receiving_Channel_Num"]).apply(null,arguments)};var __update_sync_time=Module["__update_sync_time"]=function(){return(__update_sync_time=Module["__update_sync_time"]=Module["asm"]["_update_sync_time"]).apply(null,arguments)};var __release_video_receiving_channel=Module["__release_video_receiving_channel"]=function(){return(__release_video_receiving_channel=Module["__release_video_receiving_channel"]=Module["asm"]["_release_video_receiving_channel"]).apply(null,arguments)};var __change_hw_status=Module["__change_hw_status"]=function(){return(__change_hw_status=Module["__change_hw_status"]=Module["asm"]["_change_hw_status"]).apply(null,arguments)};var __update_video_uplink_bandwidth_limitation_by_server=Module["__update_video_uplink_bandwidth_limitation_by_server"]=function(){return(__update_video_uplink_bandwidth_limitation_by_server=Module["__update_video_uplink_bandwidth_limitation_by_server"]=Module["asm"]["_update_video_uplink_bandwidth_limitation_by_server"]).apply(null,arguments)};var __create_vb_thread=Module["__create_vb_thread"]=function(){return(__create_vb_thread=Module["__create_vb_thread"]=Module["asm"]["_create_vb_thread"]).apply(null,arguments)};var __create_vb_no_sab_thread=Module["__create_vb_no_sab_thread"]=function(){return(__create_vb_no_sab_thread=Module["__create_vb_no_sab_thread"]=Module["asm"]["_create_vb_no_sab_thread"]).apply(null,arguments)};var __signal_vb_thread_blur=Module["__signal_vb_thread_blur"]=function(){return(__signal_vb_thread_blur=Module["__signal_vb_thread_blur"]=Module["asm"]["_signal_vb_thread_blur"]).apply(null,arguments)};var __signal_vb_thread_bg=Module["__signal_vb_thread_bg"]=function(){return(__signal_vb_thread_bg=Module["__signal_vb_thread_bg"]=Module["asm"]["_signal_vb_thread_bg"]).apply(null,arguments)};var __signal_vb_thread_video_yuv=Module["__signal_vb_thread_video_yuv"]=function(){return(__signal_vb_thread_video_yuv=Module["__signal_vb_thread_video_yuv"]=Module["asm"]["_signal_vb_thread_video_yuv"]).apply(null,arguments)};var __signal_vb_thread_video_rgba=Module["__signal_vb_thread_video_rgba"]=function(){return(__signal_vb_thread_video_rgba=Module["__signal_vb_thread_video_rgba"]=Module["asm"]["_signal_vb_thread_video_rgba"]).apply(null,arguments)};var __signal_vb_thread_close=Module["__signal_vb_thread_close"]=function(){return(__signal_vb_thread_close=Module["__signal_vb_thread_close"]=Module["asm"]["_signal_vb_thread_close"]).apply(null,arguments)};var __update_video_cropping_mode=Module["__update_video_cropping_mode"]=function(){return(__update_video_cropping_mode=Module["__update_video_cropping_mode"]=Module["asm"]["_update_video_cropping_mode"]).apply(null,arguments)};var __collect_video_monitor_info=Module["__collect_video_monitor_info"]=function(){return(__collect_video_monitor_info=Module["__collect_video_monitor_info"]=Module["asm"]["_collect_video_monitor_info"]).apply(null,arguments)};var __request_nack_t_periodically_for_qos=Module["__request_nack_t_periodically_for_qos"]=function(){return(__request_nack_t_periodically_for_qos=Module["__request_nack_t_periodically_for_qos"]=Module["asm"]["_request_nack_t_periodically_for_qos"]).apply(null,arguments)};var __Create_HW_Encode=Module["__Create_HW_Encode"]=function(){return(__Create_HW_Encode=Module["__Create_HW_Encode"]=Module["asm"]["_Create_HW_Encode"]).apply(null,arguments)};var __set_video_network_info=Module["__set_video_network_info"]=function(){return(__set_video_network_info=Module["__set_video_network_info"]=Module["asm"]["_set_video_network_info"]).apply(null,arguments)};var __set_video_fec_info=Module["__set_video_fec_info"]=function(){return(__set_video_fec_info=Module["__set_video_fec_info"]=Module["asm"]["_set_video_fec_info"]).apply(null,arguments)};var __set_video_retran_info=Module["__set_video_retran_info"]=function(){return(__set_video_retran_info=Module["__set_video_retran_info"]=Module["asm"]["_set_video_retran_info"]).apply(null,arguments)};var __set_video_bandwidth_alloc=Module["__set_video_bandwidth_alloc"]=function(){return(__set_video_bandwidth_alloc=Module["__set_video_bandwidth_alloc"]=Module["asm"]["_set_video_bandwidth_alloc"]).apply(null,arguments)};var __set_video_statistics_flag=Module["__set_video_statistics_flag"]=function(){return(__set_video_statistics_flag=Module["__set_video_statistics_flag"]=Module["asm"]["_set_video_statistics_flag"]).apply(null,arguments)};var __Sharing_Encode_Init=Module["__Sharing_Encode_Init"]=function(){return(__Sharing_Encode_Init=Module["__Sharing_Encode_Init"]=Module["asm"]["_Sharing_Encode_Init"]).apply(null,arguments)};var __Sharing_Encode_Try_Analysis=Module["__Sharing_Encode_Try_Analysis"]=function(){return(__Sharing_Encode_Try_Analysis=Module["__Sharing_Encode_Try_Analysis"]=Module["asm"]["_Sharing_Encode_Try_Analysis"]).apply(null,arguments)};var __signal_sharing_controller_encode_pdu_info=Module["__signal_sharing_controller_encode_pdu_info"]=function(){return(__signal_sharing_controller_encode_pdu_info=Module["__signal_sharing_controller_encode_pdu_info"]=Module["asm"]["_signal_sharing_controller_encode_pdu_info"]).apply(null,arguments)};var __Sharing_Encode_Uninit=Module["__Sharing_Encode_Uninit"]=function(){return(__Sharing_Encode_Uninit=Module["__Sharing_Encode_Uninit"]=Module["asm"]["_Sharing_Encode_Uninit"]).apply(null,arguments)};var __Sharing_Encode=Module["__Sharing_Encode"]=function(){return(__Sharing_Encode=Module["__Sharing_Encode"]=Module["asm"]["_Sharing_Encode"]).apply(null,arguments)};var __signal_sharing_controller_encode_yuv=Module["__signal_sharing_controller_encode_yuv"]=function(){return(__signal_sharing_controller_encode_yuv=Module["__signal_sharing_controller_encode_yuv"]=Module["asm"]["_signal_sharing_controller_encode_yuv"]).apply(null,arguments)};var __Sharing_Encode_Mouse_Data=Module["__Sharing_Encode_Mouse_Data"]=function(){return(__Sharing_Encode_Mouse_Data=Module["__Sharing_Encode_Mouse_Data"]=Module["asm"]["_Sharing_Encode_Mouse_Data"]).apply(null,arguments)};var __signal_sharing_controller_encode_mouse_data=Module["__signal_sharing_controller_encode_mouse_data"]=function(){return(__signal_sharing_controller_encode_mouse_data=Module["__signal_sharing_controller_encode_mouse_data"]=Module["asm"]["_signal_sharing_controller_encode_mouse_data"]).apply(null,arguments)};var __Request_Sharing_Qos_Data=Module["__Request_Sharing_Qos_Data"]=function(){return(__Request_Sharing_Qos_Data=Module["__Request_Sharing_Qos_Data"]=Module["asm"]["_Request_Sharing_Qos_Data"]).apply(null,arguments)};var __signal_sharing_controller_enocde_request_check_one_type=Module["__signal_sharing_controller_enocde_request_check_one_type"]=function(){return(__signal_sharing_controller_enocde_request_check_one_type=Module["__signal_sharing_controller_enocde_request_check_one_type"]=Module["asm"]["_signal_sharing_controller_enocde_request_check_one_type"]).apply(null,arguments)};var __signal_sharing_controller_decode_request_check_one_type=Module["__signal_sharing_controller_decode_request_check_one_type"]=function(){return(__signal_sharing_controller_decode_request_check_one_type=Module["__signal_sharing_controller_decode_request_check_one_type"]=Module["asm"]["_signal_sharing_controller_decode_request_check_one_type"]).apply(null,arguments)};var __Sharing_Set_Data_Encryption=Module["__Sharing_Set_Data_Encryption"]=function(){return(__Sharing_Set_Data_Encryption=Module["__Sharing_Set_Data_Encryption"]=Module["asm"]["_Sharing_Set_Data_Encryption"]).apply(null,arguments)};var __Sharing_Pause_Encode=Module["__Sharing_Pause_Encode"]=function(){return(__Sharing_Pause_Encode=Module["__Sharing_Pause_Encode"]=Module["asm"]["_Sharing_Pause_Encode"]).apply(null,arguments)};var __Sharing_Resume_Encode=Module["__Sharing_Resume_Encode"]=function(){return(__Sharing_Resume_Encode=Module["__Sharing_Resume_Encode"]=Module["asm"]["_Sharing_Resume_Encode"]).apply(null,arguments)};var __Sharing_Stop_Encode=Module["__Sharing_Stop_Encode"]=function(){return(__Sharing_Stop_Encode=Module["__Sharing_Stop_Encode"]=Module["asm"]["_Sharing_Stop_Encode"]).apply(null,arguments)};var __Sharing_Websocket_Speed=Module["__Sharing_Websocket_Speed"]=function(){return(__Sharing_Websocket_Speed=Module["__Sharing_Websocket_Speed"]=Module["asm"]["_Sharing_Websocket_Speed"]).apply(null,arguments)};var __Add_Sharing_Cooker_info=Module["__Add_Sharing_Cooker_info"]=function(){return(__Add_Sharing_Cooker_info=Module["__Add_Sharing_Cooker_info"]=Module["asm"]["_Add_Sharing_Cooker_info"]).apply(null,arguments)};var __Remove_Sharing_Cooker_Info=Module["__Remove_Sharing_Cooker_Info"]=function(){return(__Remove_Sharing_Cooker_Info=Module["__Remove_Sharing_Cooker_Info"]=Module["asm"]["_Remove_Sharing_Cooker_Info"]).apply(null,arguments)};var __Get_Sharing_Meat_Weight=Module["__Get_Sharing_Meat_Weight"]=function(){return(__Get_Sharing_Meat_Weight=Module["__Get_Sharing_Meat_Weight"]=Module["asm"]["_Get_Sharing_Meat_Weight"]).apply(null,arguments)};var __Set_Sharing_Encryption_Key_Directly=Module["__Set_Sharing_Encryption_Key_Directly"]=function(){return(__Set_Sharing_Encryption_Key_Directly=Module["__Set_Sharing_Encryption_Key_Directly"]=Module["asm"]["_Set_Sharing_Encryption_Key_Directly"]).apply(null,arguments)};var __Add_Roster_Info_Directly=Module["__Add_Roster_Info_Directly"]=function(){return(__Add_Roster_Info_Directly=Module["__Add_Roster_Info_Directly"]=Module["asm"]["_Add_Roster_Info_Directly"]).apply(null,arguments)};var __Add_Rev_Channel=Module["__Add_Rev_Channel"]=function(){return(__Add_Rev_Channel=Module["__Add_Rev_Channel"]=Module["asm"]["_Add_Rev_Channel"]).apply(null,arguments)};var __Remove_Rev_Channel=Module["__Remove_Rev_Channel"]=function(){return(__Remove_Rev_Channel=Module["__Remove_Rev_Channel"]=Module["asm"]["_Remove_Rev_Channel"]).apply(null,arguments)};var __update_sharing_uplink_bandwidth_limitation_by_server=Module["__update_sharing_uplink_bandwidth_limitation_by_server"]=function(){return(__update_sharing_uplink_bandwidth_limitation_by_server=Module["__update_sharing_uplink_bandwidth_limitation_by_server"]=Module["asm"]["_update_sharing_uplink_bandwidth_limitation_by_server"]).apply(null,arguments)};var __collect_sharing_monitor_info=Module["__collect_sharing_monitor_info"]=function(){return(__collect_sharing_monitor_info=Module["__collect_sharing_monitor_info"]=Module["asm"]["_collect_sharing_monitor_info"]).apply(null,arguments)};var __set_sharing_statistics_flag=Module["__set_sharing_statistics_flag"]=function(){return(__set_sharing_statistics_flag=Module["__set_sharing_statistics_flag"]=Module["asm"]["_set_sharing_statistics_flag"]).apply(null,arguments)};var __set_annotation_action=Module["__set_annotation_action"]=function(){return(__set_annotation_action=Module["__set_annotation_action"]=Module["asm"]["_set_annotation_action"]).apply(null,arguments)};var __request_nack_t_periodically_for_sharing_qos=Module["__request_nack_t_periodically_for_sharing_qos"]=function(){return(__request_nack_t_periodically_for_sharing_qos=Module["__request_nack_t_periodically_for_sharing_qos"]=Module["asm"]["_request_nack_t_periodically_for_sharing_qos"]).apply(null,arguments)};var __Change_Connect_Type_For_Sharing=Module["__Change_Connect_Type_For_Sharing"]=function(){return(__Change_Connect_Type_For_Sharing=Module["__Change_Connect_Type_For_Sharing"]=Module["asm"]["_Change_Connect_Type_For_Sharing"]).apply(null,arguments)};var __Jpeg_Init=Module["__Jpeg_Init"]=function(){return(__Jpeg_Init=Module["__Jpeg_Init"]=Module["asm"]["_Jpeg_Init"]).apply(null,arguments)};var __Jpeg_Uninit=Module["__Jpeg_Uninit"]=function(){return(__Jpeg_Uninit=Module["__Jpeg_Uninit"]=Module["asm"]["_Jpeg_Uninit"]).apply(null,arguments)};var __Jpeg_HeardInfo=Module["__Jpeg_HeardInfo"]=function(){return(__Jpeg_HeardInfo=Module["__Jpeg_HeardInfo"]=Module["asm"]["_Jpeg_HeardInfo"]).apply(null,arguments)};var __Jpeg_Decode=Module["__Jpeg_Decode"]=function(){return(__Jpeg_Decode=Module["__Jpeg_Decode"]=Module["asm"]["_Jpeg_Decode"]).apply(null,arguments)};var __set_sharing_network_info=Module["__set_sharing_network_info"]=function(){return(__set_sharing_network_info=Module["__set_sharing_network_info"]=Module["asm"]["_set_sharing_network_info"]).apply(null,arguments)};var __set_sharing_fec_info=Module["__set_sharing_fec_info"]=function(){return(__set_sharing_fec_info=Module["__set_sharing_fec_info"]=Module["asm"]["_set_sharing_fec_info"]).apply(null,arguments)};var __set_sharing_retran_info=Module["__set_sharing_retran_info"]=function(){return(__set_sharing_retran_info=Module["__set_sharing_retran_info"]=Module["asm"]["_set_sharing_retran_info"]).apply(null,arguments)};var __set_sharing_bandwidth_alloc=Module["__set_sharing_bandwidth_alloc"]=function(){return(__set_sharing_bandwidth_alloc=Module["__set_sharing_bandwidth_alloc"]=Module["asm"]["_set_sharing_bandwidth_alloc"]).apply(null,arguments)};var __signal_video_controller_encode_init_info=Module["__signal_video_controller_encode_init_info"]=function(){return(__signal_video_controller_encode_init_info=Module["__signal_video_controller_encode_init_info"]=Module["asm"]["_signal_video_controller_encode_init_info"]).apply(null,arguments)};var __signal_video_controller_encode_yuv=Module["__signal_video_controller_encode_yuv"]=function(){return(__signal_video_controller_encode_yuv=Module["__signal_video_controller_encode_yuv"]=Module["asm"]["_signal_video_controller_encode_yuv"]).apply(null,arguments)};var __signal_video_controller_encode_rgba=Module["__signal_video_controller_encode_rgba"]=function(){return(__signal_video_controller_encode_rgba=Module["__signal_video_controller_encode_rgba"]=Module["asm"]["_signal_video_controller_encode_rgba"]).apply(null,arguments)};var __signal_video_controller_encode_hw_info=Module["__signal_video_controller_encode_hw_info"]=function(){return(__signal_video_controller_encode_hw_info=Module["__signal_video_controller_encode_hw_info"]=Module["asm"]["_signal_video_controller_encode_hw_info"]).apply(null,arguments)};var __signal_video_controller_change_connect_type=Module["__signal_video_controller_change_connect_type"]=function(){return(__signal_video_controller_change_connect_type=Module["__signal_video_controller_change_connect_type"]=Module["asm"]["_signal_video_controller_change_connect_type"]).apply(null,arguments)};var __create_video_encode_thread=Module["__create_video_encode_thread"]=function(){return(__create_video_encode_thread=Module["__create_video_encode_thread"]=Module["asm"]["_create_video_encode_thread"]).apply(null,arguments)};var __signal_video_share_flag=Module["__signal_video_share_flag"]=function(){return(__signal_video_share_flag=Module["__signal_video_share_flag"]=Module["asm"]["_signal_video_share_flag"]).apply(null,arguments)};var __signal_video_controller_encode_uninit=Module["__signal_video_controller_encode_uninit"]=function(){return(__signal_video_controller_encode_uninit=Module["__signal_video_controller_encode_uninit"]=Module["asm"]["_signal_video_controller_encode_uninit"]).apply(null,arguments)};var __signal_video_controller_encode_statistics_flag=Module["__signal_video_controller_encode_statistics_flag"]=function(){return(__signal_video_controller_encode_statistics_flag=Module["__signal_video_controller_encode_statistics_flag"]=Module["asm"]["_signal_video_controller_encode_statistics_flag"]).apply(null,arguments)};var __signal_video_controller_encode_hw_retry_info=Module["__signal_video_controller_encode_hw_retry_info"]=function(){return(__signal_video_controller_encode_hw_retry_info=Module["__signal_video_controller_encode_hw_retry_info"]=Module["asm"]["_signal_video_controller_encode_hw_retry_info"]).apply(null,arguments)};var __set_mmr_signature_info=Module["__set_mmr_signature_info"]=function(){return(__set_mmr_signature_info=Module["__set_mmr_signature_info"]=Module["asm"]["_set_mmr_signature_info"]).apply(null,arguments)};var __set_singature_info=Module["__set_singature_info"]=function(){return(__set_singature_info=Module["__set_singature_info"]=Module["asm"]["_set_singature_info"]).apply(null,arguments)};var __set_meeting_uuid_for_signature=Module["__set_meeting_uuid_for_signature"]=function(){return(__set_meeting_uuid_for_signature=Module["__set_meeting_uuid_for_signature"]=Module["asm"]["_set_meeting_uuid_for_signature"]).apply(null,arguments)};var __update_signagure_verify_action=Module["__update_signagure_verify_action"]=function(){return(__update_signagure_verify_action=Module["__update_signagure_verify_action"]=Module["asm"]["_update_signagure_verify_action"]).apply(null,arguments)};var __create_video_decode_thread=Module["__create_video_decode_thread"]=function(){return(__create_video_decode_thread=Module["__create_video_decode_thread"]=Module["asm"]["_create_video_decode_thread"]).apply(null,arguments)};var __signal_video_controller_decode_init_info=Module["__signal_video_controller_decode_init_info"]=function(){return(__signal_video_controller_decode_init_info=Module["__signal_video_controller_decode_init_info"]=Module["asm"]["_signal_video_controller_decode_init_info"]).apply(null,arguments)};var __signal_video_controller_decode_close=Module["__signal_video_controller_decode_close"]=function(){return(__signal_video_controller_decode_close=Module["__signal_video_controller_decode_close"]=Module["asm"]["_signal_video_controller_decode_close"]).apply(null,arguments)};var __signal_video_controller_decode_hw_info=Module["__signal_video_controller_decode_hw_info"]=function(){return(__signal_video_controller_decode_hw_info=Module["__signal_video_controller_decode_hw_info"]=Module["asm"]["_signal_video_controller_decode_hw_info"]).apply(null,arguments)};var __signal_video_controller_decode_uninit=Module["__signal_video_controller_decode_uninit"]=function(){return(__signal_video_controller_decode_uninit=Module["__signal_video_controller_decode_uninit"]=Module["asm"]["_signal_video_controller_decode_uninit"]).apply(null,arguments)};var __proxy_videocodec_create_helpthread=Module["__proxy_videocodec_create_helpthread"]=function(){return(__proxy_videocodec_create_helpthread=Module["__proxy_videocodec_create_helpthread"]=Module["asm"]["_proxy_videocodec_create_helpthread"]).apply(null,arguments)};var __signal_video_controller_decode_statistics_flag=Module["__signal_video_controller_decode_statistics_flag"]=function(){return(__signal_video_controller_decode_statistics_flag=Module["__signal_video_controller_decode_statistics_flag"]=Module["asm"]["_signal_video_controller_decode_statistics_flag"]).apply(null,arguments)};var __create_sharing_encode_thread=Module["__create_sharing_encode_thread"]=function(){return(__create_sharing_encode_thread=Module["__create_sharing_encode_thread"]=Module["asm"]["_create_sharing_encode_thread"]).apply(null,arguments)};var __signal_sharing_controller_encode_init_info=Module["__signal_sharing_controller_encode_init_info"]=function(){return(__signal_sharing_controller_encode_init_info=Module["__signal_sharing_controller_encode_init_info"]=Module["asm"]["_signal_sharing_controller_encode_init_info"]).apply(null,arguments)};var __signal_sharing_controller_encode_statistics_flag=Module["__signal_sharing_controller_encode_statistics_flag"]=function(){return(__signal_sharing_controller_encode_statistics_flag=Module["__signal_sharing_controller_encode_statistics_flag"]=Module["asm"]["_signal_sharing_controller_encode_statistics_flag"]).apply(null,arguments)};var __signal_sharing_controller_encode_uninit=Module["__signal_sharing_controller_encode_uninit"]=function(){return(__signal_sharing_controller_encode_uninit=Module["__signal_sharing_controller_encode_uninit"]=Module["asm"]["_signal_sharing_controller_encode_uninit"]).apply(null,arguments)};var __signal_sharing_controller_encode_hw_info=Module["__signal_sharing_controller_encode_hw_info"]=function(){return(__signal_sharing_controller_encode_hw_info=Module["__signal_sharing_controller_encode_hw_info"]=Module["asm"]["_signal_sharing_controller_encode_hw_info"]).apply(null,arguments)};var __signal_sharing_controller_encode_hw_retry_info=Module["__signal_sharing_controller_encode_hw_retry_info"]=function(){return(__signal_sharing_controller_encode_hw_retry_info=Module["__signal_sharing_controller_encode_hw_retry_info"]=Module["asm"]["_signal_sharing_controller_encode_hw_retry_info"]).apply(null,arguments)};var __create_sharing_decode_thread=Module["__create_sharing_decode_thread"]=function(){return(__create_sharing_decode_thread=Module["__create_sharing_decode_thread"]=Module["asm"]["_create_sharing_decode_thread"]).apply(null,arguments)};var __signal_sharing_controller_decode_init_info=Module["__signal_sharing_controller_decode_init_info"]=function(){return(__signal_sharing_controller_decode_init_info=Module["__signal_sharing_controller_decode_init_info"]=Module["asm"]["_signal_sharing_controller_decode_init_info"]).apply(null,arguments)};var __signal_sharing_controller_decode_meeting_key=Module["__signal_sharing_controller_decode_meeting_key"]=function(){return(__signal_sharing_controller_decode_meeting_key=Module["__signal_sharing_controller_decode_meeting_key"]=Module["asm"]["_signal_sharing_controller_decode_meeting_key"]).apply(null,arguments)};var __signal_sharing_controller_decode_pdu_info=Module["__signal_sharing_controller_decode_pdu_info"]=function(){return(__signal_sharing_controller_decode_pdu_info=Module["__signal_sharing_controller_decode_pdu_info"]=Module["asm"]["_signal_sharing_controller_decode_pdu_info"]).apply(null,arguments)};var __signal_sharing_controller_decode_meeting_cooker=Module["__signal_sharing_controller_decode_meeting_cooker"]=function(){return(__signal_sharing_controller_decode_meeting_cooker=Module["__signal_sharing_controller_decode_meeting_cooker"]=Module["asm"]["_signal_sharing_controller_decode_meeting_cooker"]).apply(null,arguments)};var __signal_sharing_controller_decode_roster_info=Module["__signal_sharing_controller_decode_roster_info"]=function(){return(__signal_sharing_controller_decode_roster_info=Module["__signal_sharing_controller_decode_roster_info"]=Module["asm"]["_signal_sharing_controller_decode_roster_info"]).apply(null,arguments)};var __signal_sharing_controller_decode_rev_channel=Module["__signal_sharing_controller_decode_rev_channel"]=function(){return(__signal_sharing_controller_decode_rev_channel=Module["__signal_sharing_controller_decode_rev_channel"]=Module["asm"]["_signal_sharing_controller_decode_rev_channel"]).apply(null,arguments)};var __singal_sharing_controller_decode_close=Module["__singal_sharing_controller_decode_close"]=function(){return(__singal_sharing_controller_decode_close=Module["__singal_sharing_controller_decode_close"]=Module["asm"]["_singal_sharing_controller_decode_close"]).apply(null,arguments)};var __signal_sharing_controller_decode_uninit=Module["__signal_sharing_controller_decode_uninit"]=function(){return(__signal_sharing_controller_decode_uninit=Module["__signal_sharing_controller_decode_uninit"]=Module["asm"]["_signal_sharing_controller_decode_uninit"]).apply(null,arguments)};var __signal_sharing_controller_decode_statistics_flag=Module["__signal_sharing_controller_decode_statistics_flag"]=function(){return(__signal_sharing_controller_decode_statistics_flag=Module["__signal_sharing_controller_decode_statistics_flag"]=Module["asm"]["_signal_sharing_controller_decode_statistics_flag"]).apply(null,arguments)};var _GIT_COMMIT_VERSION=Module["_GIT_COMMIT_VERSION"]=function(){return(_GIT_COMMIT_VERSION=Module["_GIT_COMMIT_VERSION"]=Module["asm"]["GIT_COMMIT_VERSION"]).apply(null,arguments)};var getTempRet0=Module["getTempRet0"]=function(){return(getTempRet0=Module["getTempRet0"]=Module["asm"]["getTempRet0"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["__errno_location"]).apply(null,arguments)};var _htonl=Module["_htonl"]=function(){return(_htonl=Module["_htonl"]=Module["asm"]["htonl"]).apply(null,arguments)};var _ntohs=Module["_ntohs"]=function(){return(_ntohs=Module["_ntohs"]=Module["asm"]["ntohs"]).apply(null,arguments)};var _htons=Module["_htons"]=function(){return(_htons=Module["_htons"]=Module["asm"]["htons"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["pthread_self"]).apply(null,arguments)};var _OnVideoFrameOutputCallback=Module["_OnVideoFrameOutputCallback"]=function(){return(_OnVideoFrameOutputCallback=Module["_OnVideoFrameOutputCallback"]=Module["asm"]["OnVideoFrameOutputCallback"]).apply(null,arguments)};var _OnEncodedVideoChunkOutputCallback=Module["_OnEncodedVideoChunkOutputCallback"]=function(){return(_OnEncodedVideoChunkOutputCallback=Module["_OnEncodedVideoChunkOutputCallback"]=Module["asm"]["OnEncodedVideoChunkOutputCallback"]).apply(null,arguments)};var _saveSetjmp=Module["_saveSetjmp"]=function(){return(_saveSetjmp=Module["_saveSetjmp"]=Module["asm"]["saveSetjmp"]).apply(null,arguments)};var setTempRet0=Module["setTempRet0"]=function(){return(setTempRet0=Module["setTempRet0"]=Module["asm"]["setTempRet0"]).apply(null,arguments)};var __emscripten_tls_init=Module["__emscripten_tls_init"]=function(){return(__emscripten_tls_init=Module["__emscripten_tls_init"]=Module["asm"]["_emscripten_tls_init"]).apply(null,arguments)};var _emscripten_builtin_memalign=Module["_emscripten_builtin_memalign"]=function(){return(_emscripten_builtin_memalign=Module["_emscripten_builtin_memalign"]=Module["asm"]["emscripten_builtin_memalign"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["_emscripten_thread_init"]).apply(null,arguments)};var __emscripten_thread_crashed=Module["__emscripten_thread_crashed"]=function(){return(__emscripten_thread_crashed=Module["__emscripten_thread_crashed"]=Module["asm"]["_emscripten_thread_crashed"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["emscripten_main_thread_process_queued_calls"]).apply(null,arguments)};var _emscripten_main_browser_thread_id=Module["_emscripten_main_browser_thread_id"]=function(){return(_emscripten_main_browser_thread_id=Module["_emscripten_main_browser_thread_id"]=Module["asm"]["emscripten_main_browser_thread_id"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["emscripten_run_in_main_runtime_thread_js"]).apply(null,arguments)};var _emscripten_dispatch_to_thread_=Module["_emscripten_dispatch_to_thread_"]=function(){return(_emscripten_dispatch_to_thread_=Module["_emscripten_dispatch_to_thread_"]=Module["asm"]["emscripten_dispatch_to_thread_"]).apply(null,arguments)};var __emscripten_proxy_execute_task_queue=Module["__emscripten_proxy_execute_task_queue"]=function(){return(__emscripten_proxy_execute_task_queue=Module["__emscripten_proxy_execute_task_queue"]=Module["asm"]["_emscripten_proxy_execute_task_queue"]).apply(null,arguments)};var __emscripten_thread_free_data=Module["__emscripten_thread_free_data"]=function(){return(__emscripten_thread_free_data=Module["__emscripten_thread_free_data"]=Module["asm"]["_emscripten_thread_free_data"]).apply(null,arguments)};var __emscripten_thread_exit=Module["__emscripten_thread_exit"]=function(){return(__emscripten_thread_exit=Module["__emscripten_thread_exit"]=Module["asm"]["_emscripten_thread_exit"]).apply(null,arguments)};var _setThrew=Module["_setThrew"]=function(){return(_setThrew=Module["_setThrew"]=Module["asm"]["setThrew"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["emscripten_stack_set_limits"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["stackSave"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["stackRestore"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["stackAlloc"]).apply(null,arguments)};var ___cxa_demangle=Module["___cxa_demangle"]=function(){return(___cxa_demangle=Module["___cxa_demangle"]=Module["asm"]["__cxa_demangle"]).apply(null,arguments)};var ___cxa_can_catch=Module["___cxa_can_catch"]=function(){return(___cxa_can_catch=Module["___cxa_can_catch"]=Module["asm"]["__cxa_can_catch"]).apply(null,arguments)};var ___cxa_is_pointer_type=Module["___cxa_is_pointer_type"]=function(){return(___cxa_is_pointer_type=Module["___cxa_is_pointer_type"]=Module["asm"]["__cxa_is_pointer_type"]).apply(null,arguments)};var dynCall_iijiiiiiiiiiiii=Module["dynCall_iijiiiiiiiiiiii"]=function(){return(dynCall_iijiiiiiiiiiiii=Module["dynCall_iijiiiiiiiiiiii"]=Module["asm"]["dynCall_iijiiiiiiiiiiii"]).apply(null,arguments)};var dynCall_iijiiiiiiiiii=Module["dynCall_iijiiiiiiiiii"]=function(){return(dynCall_iijiiiiiiiiii=Module["dynCall_iijiiiiiiiiii"]=Module["asm"]["dynCall_iijiiiiiiiiii"]).apply(null,arguments)};var dynCall_iij=Module["dynCall_iij"]=function(){return(dynCall_iij=Module["dynCall_iij"]=Module["asm"]["dynCall_iij"]).apply(null,arguments)};var dynCall_iijii=Module["dynCall_iijii"]=function(){return(dynCall_iijii=Module["dynCall_iijii"]=Module["asm"]["dynCall_iijii"]).apply(null,arguments)};var dynCall_iiijiji=Module["dynCall_iiijiji"]=function(){return(dynCall_iiijiji=Module["dynCall_iiijiji"]=Module["asm"]["dynCall_iiijiji"]).apply(null,arguments)};var dynCall_iiijiii=Module["dynCall_iiijiii"]=function(){return(dynCall_iiijiii=Module["dynCall_iiijiii"]=Module["asm"]["dynCall_iiijiii"]).apply(null,arguments)};var dynCall_iiiji=Module["dynCall_iiiji"]=function(){return(dynCall_iiiji=Module["dynCall_iiiji"]=Module["asm"]["dynCall_iiiji"]).apply(null,arguments)};var dynCall_iiij=Module["dynCall_iiij"]=function(){return(dynCall_iiij=Module["dynCall_iiij"]=Module["asm"]["dynCall_iiij"]).apply(null,arguments)};var dynCall_vij=Module["dynCall_vij"]=function(){return(dynCall_vij=Module["dynCall_vij"]=Module["asm"]["dynCall_vij"]).apply(null,arguments)};var dynCall_viiiij=Module["dynCall_viiiij"]=function(){return(dynCall_viiiij=Module["dynCall_viiiij"]=Module["asm"]["dynCall_viiiij"]).apply(null,arguments)};var dynCall_viiijii=Module["dynCall_viiijii"]=function(){return(dynCall_viiijii=Module["dynCall_viiijii"]=Module["asm"]["dynCall_viiijii"]).apply(null,arguments)};var dynCall_iiijii=Module["dynCall_iiijii"]=function(){return(dynCall_iiijii=Module["dynCall_iiijii"]=Module["asm"]["dynCall_iiijii"]).apply(null,arguments)};var dynCall_iiiiiiiiij=Module["dynCall_iiiiiiiiij"]=function(){return(dynCall_iiiiiiiiij=Module["dynCall_iiiiiiiiij"]=Module["asm"]["dynCall_iiiiiiiiij"]).apply(null,arguments)};var dynCall_iiiiiijiji=Module["dynCall_iiiiiijiji"]=function(){return(dynCall_iiiiiijiji=Module["dynCall_iiiiiijiji"]=Module["asm"]["dynCall_iiiiiijiji"]).apply(null,arguments)};var dynCall_iiiiiiiiiiiij=Module["dynCall_iiiiiiiiiiiij"]=function(){return(dynCall_iiiiiiiiiiiij=Module["dynCall_iiiiiiiiiiiij"]=Module["asm"]["dynCall_iiiiiiiiiiiij"]).apply(null,arguments)};var dynCall_viiiiiij=Module["dynCall_viiiiiij"]=function(){return(dynCall_viiiiiij=Module["dynCall_viiiiiij"]=Module["asm"]["dynCall_viiiiiij"]).apply(null,arguments)};var dynCall_viji=Module["dynCall_viji"]=function(){return(dynCall_viji=Module["dynCall_viji"]=Module["asm"]["dynCall_viji"]).apply(null,arguments)};var dynCall_iiiiiiji=Module["dynCall_iiiiiiji"]=function(){return(dynCall_iiiiiiji=Module["dynCall_iiiiiiji"]=Module["asm"]["dynCall_iiiiiiji"]).apply(null,arguments)};var dynCall_iiiiijiji=Module["dynCall_iiiiijiji"]=function(){return(dynCall_iiiiijiji=Module["dynCall_iiiiijiji"]=Module["asm"]["dynCall_iiiiijiji"]).apply(null,arguments)};var dynCall_iiiiiiiiiiij=Module["dynCall_iiiiiiiiiiij"]=function(){return(dynCall_iiiiiiiiiiij=Module["dynCall_iiiiiiiiiiij"]=Module["asm"]["dynCall_iiiiiiiiiiij"]).apply(null,arguments)};var dynCall_iiiiiiiij=Module["dynCall_iiiiiiiij"]=function(){return(dynCall_iiiiiiiij=Module["dynCall_iiiiiiiij"]=Module["asm"]["dynCall_iiiiiiiij"]).apply(null,arguments)};var dynCall_iiji=Module["dynCall_iiji"]=function(){return(dynCall_iiji=Module["dynCall_iiji"]=Module["asm"]["dynCall_iiji"]).apply(null,arguments)};var dynCall_ji=Module["dynCall_ji"]=function(){return(dynCall_ji=Module["dynCall_ji"]=Module["asm"]["dynCall_ji"]).apply(null,arguments)};var dynCall_jiiiiii=Module["dynCall_jiiiiii"]=function(){return(dynCall_jiiiiii=Module["dynCall_jiiiiii"]=Module["asm"]["dynCall_jiiiiii"]).apply(null,arguments)};var dynCall_jiji=Module["dynCall_jiji"]=function(){return(dynCall_jiji=Module["dynCall_jiji"]=Module["asm"]["dynCall_jiji"]).apply(null,arguments)};var dynCall_viijii=Module["dynCall_viijii"]=function(){return(dynCall_viijii=Module["dynCall_viijii"]=Module["asm"]["dynCall_viijii"]).apply(null,arguments)};var dynCall_jiiii=Module["dynCall_jiiii"]=function(){return(dynCall_jiiii=Module["dynCall_jiiii"]=Module["asm"]["dynCall_jiiii"]).apply(null,arguments)};var dynCall_iiiiij=Module["dynCall_iiiiij"]=function(){return(dynCall_iiiiij=Module["dynCall_iiiiij"]=Module["asm"]["dynCall_iiiiij"]).apply(null,arguments)};var dynCall_iiiiijj=Module["dynCall_iiiiijj"]=function(){return(dynCall_iiiiijj=Module["dynCall_iiiiijj"]=Module["asm"]["dynCall_iiiiijj"]).apply(null,arguments)};var dynCall_iiiiiijj=Module["dynCall_iiiiiijj"]=function(){return(dynCall_iiiiiijj=Module["dynCall_iiiiiijj"]=Module["asm"]["dynCall_iiiiiijj"]).apply(null,arguments)};function invoke_vii(index,a1,a2){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiii(index,a1,a2,a3,a4){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiii(index,a1,a2,a3){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iii(index,a1,a2){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_ii(index,a1){var sp=stackSave();try{return getWasmTableEntry(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiii(index,a1,a2,a3,a4){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_vi(index,a1){var sp=stackSave();try{getWasmTableEntry(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_v(index){var sp=stackSave();try{getWasmTableEntry(index)()}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viii(index,a1,a2,a3){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiiiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_i(index){var sp=stackSave();try{return getWasmTableEntry(index)()}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiiiiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_fiii(index,a1,a2,a3){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_diii(index,a1,a2,a3){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_vij(index,a1,a2,a3){var sp=stackSave();try{dynCall_vij(index,a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiij(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{dynCall_viiiij(index,a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viijii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{dynCall_viijii(index,a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_jiiii(index,a1,a2,a3,a4){var sp=stackSave();try{return dynCall_jiiii(index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}Module["keepRuntimeAlive"]=keepRuntimeAlive;Module["wasmMemory"]=wasmMemory;Module["cwrap"]=cwrap;Module["ExitStatus"]=ExitStatus;var calledRun;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}run();
|
|
2
|
+
`,Module.instantiateWasm=function(e,t){return self.downloadAndInstantiateWebAssembly(e,t),{}},Module.onRuntimeInitialized=function(){postMessage({status:wasmSuccessEvent}),self.onWasmModuleReady()},Module.onAbort=function(e){postMessage({status:wasmFailEvent,data:e})};var objectUrl=URL.createObjectURL(new Blob([Module.mainScriptUrlOrBlob],{type:"application/javascript"}));Module.mainScriptUrlOrBlob=new Blob([Module.mainScriptUrlOrBlob],{type:"application/javascript"}),function(){let e=self;return new Promise(((t,r)=>{postMessage({status:"WFMO"});const a=r=>{let i=r.data;"wasmMemory"===i.command&&(Module.wasmMemory=i.data,e.removeEventListener("message",a),t())};e.addEventListener("message",a)}))}().then((()=>{importScripts(objectUrl),URL.revokeObjectURL(objectUrl)}));
|
|
3
|
+
//# sourceMappingURL=https://d1cdksi819e9z7.cloudfront.net/sourcemap/video_share_mtsimd.min.js-61e1f6bf17228453d90e.map
|