@vinay.kumar.ha/videosdk-ui-toolkit 2.3.5-1.4 → 2.3.5-1.6
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/favicon.ico +0 -0
- package/dist/image/SanFrancisco.jpg +0 -0
- package/dist/image/Zoom_Logo_Bloom_RGB.png +0 -0
- package/dist/image/av/android/android-permission-1.png +0 -0
- package/dist/image/av/android/android-permission-2.png +0 -0
- package/dist/image/av/android/android-permission-3.jpg +0 -0
- package/dist/image/av/android/android-permission-3.png +0 -0
- package/dist/image/av/android/android-permission-ask.png +0 -0
- package/dist/image/av/chrome-operation.jpg +0 -0
- package/dist/image/av/ios/ios-permission-ask.png +0 -0
- package/dist/image/av/safari-operation1.png +0 -0
- package/dist/image/av/safari-operation2.png +0 -0
- package/dist/image/av/share_disallow_image_1.png +0 -0
- package/dist/image/av/share_disallow_image_2.png +0 -0
- package/dist/image/blur.png +0 -0
- package/dist/image/earth.jpg +0 -0
- package/dist/image/grass.jpg +0 -0
- 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.css +1 -0
- package/dist/videosdk-ui-toolkit.min.esm.js +141319 -0
- package/dist/videosdk-ui-toolkit.min.umd.js +629 -0
- package/package.json +1 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
(()=>{var e={1668:(e,t,r)=>{"use strict";const{Deflate:n,deflate:i,deflateRaw:a,gzip:o}=r(3303),{Inflate:s,inflate:l,inflateRaw:d,ungzip:c}=r(7083),u=r(9681);e.exports.Deflate=n,e.exports.deflate=i,e.exports.deflateRaw=a,e.exports.gzip=o,e.exports.Inflate=s,e.exports.inflate=l,e.exports.inflateRaw=d,e.exports.ungzip=c,e.exports.constants=u},3303:(e,t,r)=>{"use strict";const n=r(8411),i=r(9805),a=r(1996),o=r(4674),s=r(4442),l=Object.prototype.toString,{Z_NO_FLUSH:d,Z_SYNC_FLUSH:c,Z_FULL_FLUSH:u,Z_FINISH:_,Z_OK:h,Z_STREAM_END:f,Z_DEFAULT_COMPRESSION:p,Z_DEFAULT_STRATEGY:m,Z_DEFLATED:g}=r(9681);function v(e){this.options=i.assign({level:p,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=n.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==h)throw new Error(o[r]);if(t.header&&n.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?a.string2buf(t.dictionary):"[object ArrayBuffer]"===l.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,r=n.deflateSetDictionary(this.strm,e),r!==h)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?_:d,"string"==typeof e?r.input=a.string2buf(e):"[object ArrayBuffer]"===l.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=n.deflate(r,s),o===f)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),o=n.deflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===h;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===h&&(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 n=r(1447),i=r(9805),a=r(1996),o=r(4674),s=r(4442),l=r(7414),d=Object.prototype.toString,{Z_NO_FLUSH:c,Z_FINISH:u,Z_OK:_,Z_STREAM_END:h,Z_NEED_DICT:f,Z_STREAM_ERROR:p,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=n.inflateInit2(this.strm,t.windowBits);if(r!==_)throw new Error(o[r]);if(this.header=new l,n.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=a.string2buf(t.dictionary):"[object ArrayBuffer]"===d.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=n.inflateSetDictionary(this.strm,t.dictionary),r!==_)))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,l,v;if(this.ended)return!1;for(l=t===~~t?t:!0===t?u:c,"[object ArrayBuffer]"===d.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=n.inflate(r,l),s===f&&o&&(s=n.inflateSetDictionary(r,o),s===_?s=n.inflate(r,l):s===m&&(s=f));r.avail_in>0&&s===h&&r.state.wrap>0&&0!==e[r.next_in];)n.inflateReset(r),s=n.inflate(r,l);switch(s){case p:case m:case f:case g:return this.onEnd(s),this.ended=!0,!1}if(v=r.avail_out,r.next_out&&(0===r.avail_out||s===h))if("string"===this.options.to){let e=a.utf8border(r.output,r.next_out),t=r.next_out-e,n=a.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(n)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(s!==_||0!==v){if(s===h)return s=n.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===_&&("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 n=r.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(const r in n)t(n,r)&&(e[r]=n[r])}}return e},e.exports.flattenChunks=e=>{let t=0;for(let r=0,n=e.length;r<n;r++)t+=e[r].length;const r=new Uint8Array(t);for(let t=0,n=0,i=e.length;t<i;t++){let i=e[t];r.set(i,n),n+=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,n,i,a,o=e.length,s=0;for(i=0;i<o;i++)r=e.charCodeAt(i),55296==(64512&r)&&i+1<o&&(n=e.charCodeAt(i+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),i++)),s+=r<128?1:r<2048?2:r<65536?3:4;for(t=new Uint8Array(s),a=0,i=0;a<s;i++)r=e.charCodeAt(i),55296==(64512&r)&&i+1<o&&(n=e.charCodeAt(i+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),i++)),r<128?t[a++]=r:r<2048?(t[a++]=192|r>>>6,t[a++]=128|63&r):r<65536?(t[a++]=224|r>>>12,t[a++]=128|r>>>6&63,t[a++]=128|63&r):(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63,t[a++]=128|r>>>6&63,t[a++]=128|63&r);return t},e.exports.buf2string=(e,n)=>{const i=n||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,n));let a,o;const s=new Array(2*i);for(o=0,a=0;a<i;){let t=e[a++];if(t<128){s[o++]=t;continue}let n=r[t];if(n>4)s[o++]=65533,a+=n-1;else{for(t&=2===n?31:3===n?15:7;n>1&&a<i;)t=t<<6|63&e[a++],n--;n>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 n="";for(let t=0;t<r;t++)n+=String.fromCharCode(e[t]);return n})(s,o)},e.exports.utf8border=(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);let n=t-1;for(;n>=0&&128==(192&e[n]);)n--;return n<0||0===n?t:n+r[e[n]]>t?n:t}},3269:e=>{"use strict";e.exports=(e,t,r,n)=>{let i=65535&e,a=e>>>16&65535,o=0;for(;0!==r;){o=r>2e3?2e3:r,r-=o;do{i=i+t[n++]|0,a=a+i|0}while(--o);i%=65521,a%=65521}return i|a<<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 n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t})());e.exports=(e,r,n,i)=>{const a=t,o=i+n;e^=-1;for(let t=i;t<o;t++)e=e>>>8^a[255&(e^r[t])];return~e}},8411:(e,t,r)=>{"use strict";const{_tr_init:n,_tr_stored_block:i,_tr_flush_block:a,_tr_tally:o,_tr_align:s}=r(3665),l=r(3269),d=r(4823),c=r(4674),{Z_NO_FLUSH:u,Z_PARTIAL_FLUSH:_,Z_FULL_FLUSH:h,Z_FINISH:f,Z_BLOCK:p,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:E,Z_HUFFMAN_ONLY:S,Z_RLE:M,Z_FIXED:x,Z_DEFAULT_STRATEGY:T,Z_UNKNOWN:R,Z_DEFLATED:k}=r(9681),A=258,C=262,F=42,P=113,I=666,O=(e,t)=>(e.msg=c[t],t),L=e=>2*e-(e>4?9:0),D=e=>{let t=e.length;for(;--t>=0;)e[t]=0},U=e=>{let t,r,n,i=e.w_size;t=e.hash_size,n=t;do{r=e.head[--n],e.head[n]=r>=i?r-i:0}while(--t);t=i,n=t;do{r=e.prev[--n],e.prev[n]=r>=i?r-i:0}while(--t)};let N=(e,t,r)=>(t<<e.hash_shift^r)&e.hash_mask;const W=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)=>{a(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,W(e.strm)},G=(e,t)=>{e.pending_buf[e.pending++]=t},j=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},H=(e,t,r,n)=>{let i=e.avail_in;return i>n&&(i=n),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=l(e.adler,t,i,r):2===e.state.wrap&&(e.adler=d(e.adler,t,i,r)),e.next_in+=i,e.total_in+=i,i)},V=(e,t)=>{let r,n,i=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match;const l=e.strstart>e.w_size-C?e.strstart-(e.w_size-C):0,d=e.window,c=e.w_mask,u=e.prev,_=e.strstart+A;let h=d[a+o-1],f=d[a+o];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(r=t,d[r+o]===f&&d[r+o-1]===h&&d[r]===d[a]&&d[++r]===d[a+1]){a+=2,r++;do{}while(d[++a]===d[++r]&&d[++a]===d[++r]&&d[++a]===d[++r]&&d[++a]===d[++r]&&d[++a]===d[++r]&&d[++a]===d[++r]&&d[++a]===d[++r]&&d[++a]===d[++r]&&a<_);if(n=A-(_-a),a=_-A,n>o){if(e.match_start=t,o=n,n>=s)break;h=d[a+o-1],f=d[a+o]}}}while((t=u[t&c])>l&&0!=--i);return o<=e.lookahead?o:e.lookahead},z=e=>{const t=e.w_size;let r,n,i;do{if(n=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-C)&&(e.window.set(e.window.subarray(t,t+t-n),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),U(e),n+=t),0===e.strm.avail_in)break;if(r=H(e.strm,e.window,e.strstart+e.lookahead,n),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,n,a,o=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,s=0,l=e.strm.avail_in;do{if(r=65535,a=e.bi_valid+42>>3,e.strm.avail_out<a)break;if(a=e.strm.avail_out-a,n=e.strstart-e.block_start,r>n+e.strm.avail_in&&(r=n+e.strm.avail_in),r>a&&(r=a),r<o&&(0===r&&t!==f||t===u||r!==n+e.strm.avail_in))break;s=t===f&&r===n+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,W(e.strm),n&&(n>r&&(n=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+n),e.strm.next_out),e.strm.next_out+=n,e.strm.avail_out-=n,e.strm.total_out+=n,e.block_start+=n,r-=n),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 l-=e.strm.avail_in,l&&(l>=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<=l&&(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-l,e.strm.next_in),e.strstart),e.strstart+=l,e.insert+=l>e.w_size-e.insert?e.w_size-e.insert:l),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),s?4:t!==u&&t!==f&&0===e.strm.avail_in&&e.strstart===e.block_start?2:(a=e.window_size-e.strstart,e.strm.avail_in>a&&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++,a+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),a>e.strm.avail_in&&(a=e.strm.avail_in),a&&(H(e.strm,e.window,e.strstart,a),e.strstart+=a,e.insert+=a>e.w_size-e.insert?e.w_size-e.insert:a),e.high_water<e.strstart&&(e.high_water=e.strstart),a=e.bi_valid+42>>3,a=e.pending_buf_size-a>65535?65535:e.pending_buf_size-a,o=a>e.w_size?e.w_size:a,n=e.strstart-e.block_start,(n>=o||(n||t===f)&&t!==u&&0===e.strm.avail_in&&n<=a)&&(r=n>a?a:n,s=t===f&&0===e.strm.avail_in&&r===n?1:0,i(e,e.block_start,r,s),e.block_start+=r,W(e.strm)),s?3:1)},q=(e,t)=>{let r,n;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=V(e,r)),e.match_length>=3)if(n=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 n=o(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(B(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===f?(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,n,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=V(e,r),e.match_length<=5&&(e.strategy===E||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,n=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++,n&&(B(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(n=o(e,0,e.window[e.strstart-1]),n&&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&&(n=o(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===f?(B(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(B(e,!1),0===e.strm.avail_out)?1:2};function X(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}const K=[new X(0,0,0,0,$),new X(4,4,8,4,q),new X(4,5,16,8,q),new X(4,6,32,32,q),new X(4,4,16,16,Y),new X(8,16,32,32,Y),new X(8,16,128,128,Y),new X(8,32,128,256,Y),new X(32,128,258,1024,Y),new X(32,258,258,4096,Y)];function Z(){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=k,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),D(this.dyn_ltree),D(this.dyn_dtree),D(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),D(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),D(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 Q=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(Q(e))return O(e,v);e.total_in=e.total_out=0,e.data_type=R;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,n(t),m},ee=e=>{const t=J(e);var r;return t===m&&((r=e.state).window_size=2*r.w_size,D(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,n,i,a)=>{if(!e)return v;let o=1;if(t===w&&(t=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),i<1||i>9||r!==k||n<8||n>15||t<0||t>9||a<0||a>x||8===n&&1!==o)return O(e,v);8===n&&(n=9);const s=new Z;return e.state=s,s.strm=e,s.status=F,s.wrap=o,s.gzhead=null,s.w_bits=n,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=a,s.method=r,ee(e)};e.exports.deflateInit=(e,t)=>te(e,t,k,15,8,T),e.exports.deflateInit2=te,e.exports.deflateReset=ee,e.exports.deflateResetKeep=J,e.exports.deflateSetHeader=(e,t)=>Q(e)||2!==e.state.wrap?v:(e.state.gzhead=t,m),e.exports.deflate=(e,t)=>{if(Q(e)||t>p||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!==f)return O(e,0===e.avail_out?b:v);const n=r.last_flush;if(r.last_flush=t,0!==r.pending){if(W(e),0===e.avail_out)return r.last_flush=-1,m}else if(0===e.avail_in&&L(t)<=L(n)&&t!==f)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=k+(r.w_bits-8<<4)<<8,n=-1;if(n=r.strategy>=S||r.level<2?0:r.level<6?1:6===r.level?2:3,t|=n<<6,0!==r.strstart&&(t|=32),t+=31-t%31,j(r,t),0!==r.strstart&&(j(r,e.adler>>>16),j(r,65535&e.adler)),e.adler=1,r.status=P,W(e),0!==r.pending)return r.last_flush=-1,m}if(57===r.status)if(e.adler=0,G(r,31),G(r,139),G(r,8),r.gzhead)G(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)),G(r,255&r.gzhead.time),G(r,r.gzhead.time>>8&255),G(r,r.gzhead.time>>16&255),G(r,r.gzhead.time>>24&255),G(r,9===r.level?2:r.strategy>=S||r.level<2?4:0),G(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(G(r,255&r.gzhead.extra.length),G(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=d(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69;else if(G(r,0),G(r,0),G(r,0),G(r,0),G(r,0),G(r,9===r.level?2:r.strategy>=S||r.level<2?4:0),G(r,3),r.status=P,W(e),0!==r.pending)return r.last_flush=-1,m;if(69===r.status){if(r.gzhead.extra){let t=r.pending,n=(65535&r.gzhead.extra.length)-r.gzindex;for(;r.pending+n>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=d(e.adler,r.pending_buf,r.pending-t,t)),r.gzindex+=i,W(e),0!==r.pending)return r.last_flush=-1,m;t=0,n-=i}let i=new Uint8Array(r.gzhead.extra);r.pending_buf.set(i.subarray(r.gzindex,r.gzindex+n),r.pending),r.pending+=n,r.gzhead.hcrc&&r.pending>t&&(e.adler=d(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,n=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>n&&(e.adler=d(e.adler,r.pending_buf,r.pending-n,n)),W(e),0!==r.pending)return r.last_flush=-1,m;n=0}t=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,G(r,t)}while(0!==t);r.gzhead.hcrc&&r.pending>n&&(e.adler=d(e.adler,r.pending_buf,r.pending-n,n)),r.gzindex=0}r.status=91}if(91===r.status){if(r.gzhead.comment){let t,n=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>n&&(e.adler=d(e.adler,r.pending_buf,r.pending-n,n)),W(e),0!==r.pending)return r.last_flush=-1,m;n=0}t=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,G(r,t)}while(0!==t);r.gzhead.hcrc&&r.pending>n&&(e.adler=d(e.adler,r.pending_buf,r.pending-n,n))}r.status=103}if(103===r.status){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(W(e),0!==r.pending))return r.last_flush=-1,m;G(r,255&e.adler),G(r,e.adler>>8&255),e.adler=0}if(r.status=P,W(e),0!==r.pending)return r.last_flush=-1,m}if(0!==e.avail_in||0!==r.lookahead||t!==u&&r.status!==I){let n=0===r.level?$(r,t):r.strategy===S?((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===f?(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===M?((e,t)=>{let r,n,i,a;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,n=s[i],n===s[++i]&&n===s[++i]&&n===s[++i])){a=e.strstart+A;do{}while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&i<a);e.match_length=A-(a-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===f?(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!==n&&4!==n||(r.status=I),1===n||3===n)return 0===e.avail_out&&(r.last_flush=-1),m;if(2===n&&(t===_?s(r):t!==p&&(i(r,0,0,!1),t===h&&(D(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),W(e),0===e.avail_out))return r.last_flush=-1,m}return t!==f?m:r.wrap<=0?g:(2===r.wrap?(G(r,255&e.adler),G(r,e.adler>>8&255),G(r,e.adler>>16&255),G(r,e.adler>>24&255),G(r,255&e.total_in),G(r,e.total_in>>8&255),G(r,e.total_in>>16&255),G(r,e.total_in>>24&255)):(j(r,e.adler>>>16),j(r,65535&e.adler)),W(e),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?m:g)},e.exports.deflateEnd=e=>{if(Q(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(Q(e))return v;const n=e.state,i=n.wrap;if(2===i||1===i&&n.status!==F||n.lookahead)return v;if(1===i&&(e.adler=l(e.adler,t,r,0)),n.wrap=0,r>=n.w_size){0===i&&(D(n.head),n.strstart=0,n.block_start=0,n.insert=0);let e=new Uint8Array(n.w_size);e.set(t.subarray(r-n.w_size,r),0),t=e,r=n.w_size}const a=e.avail_in,o=e.next_in,s=e.input;for(e.avail_in=r,e.next_in=0,e.input=t,z(n);n.lookahead>=3;){let e=n.strstart,t=n.lookahead-2;do{n.ins_h=N(n,n.ins_h,n.window[e+3-1]),n.prev[e&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=e,e++}while(--t);n.strstart=e,n.lookahead=2,z(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,e.next_in=o,e.input=s,e.avail_in=a,n.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 n,i,a,o,s,l,d,c,u,_,h,f,p,m,g,v,y,b,w,E,S,M,x,T;const R=e.state;n=e.next_in,x=e.input,i=n+(e.avail_in-5),a=e.next_out,T=e.output,o=a-(r-e.avail_out),s=a+(e.avail_out-257),l=R.dmax,d=R.wsize,c=R.whave,u=R.wnext,_=R.window,h=R.hold,f=R.bits,p=R.lencode,m=R.distcode,g=(1<<R.lenbits)-1,v=(1<<R.distbits)-1;e:do{f<15&&(h+=x[n++]<<f,f+=8,h+=x[n++]<<f,f+=8),y=p[h&g];t:for(;;){if(b=y>>>24,h>>>=b,f-=b,b=y>>>16&255,0===b)T[a++]=65535&y;else{if(!(16&b)){if(64&b){if(32&b){R.mode=16191;break e}e.msg="invalid literal/length code",R.mode=t;break e}y=p[(65535&y)+(h&(1<<b)-1)];continue t}for(w=65535&y,b&=15,b&&(f<b&&(h+=x[n++]<<f,f+=8),w+=h&(1<<b)-1,h>>>=b,f-=b),f<15&&(h+=x[n++]<<f,f+=8,h+=x[n++]<<f,f+=8),y=m[h&v];;){if(b=y>>>24,h>>>=b,f-=b,b=y>>>16&255,16&b){if(E=65535&y,b&=15,f<b&&(h+=x[n++]<<f,f+=8,f<b&&(h+=x[n++]<<f,f+=8)),E+=h&(1<<b)-1,E>l){e.msg="invalid distance too far back",R.mode=t;break e}if(h>>>=b,f-=b,b=a-o,E>b){if(b=E-b,b>c&&R.sane){e.msg="invalid distance too far back",R.mode=t;break e}if(S=0,M=_,0===u){if(S+=d-b,b<w){w-=b;do{T[a++]=_[S++]}while(--b);S=a-E,M=T}}else if(u<b){if(S+=d+u-b,b-=u,b<w){w-=b;do{T[a++]=_[S++]}while(--b);if(S=0,u<w){b=u,w-=b;do{T[a++]=_[S++]}while(--b);S=a-E,M=T}}}else if(S+=u-b,b<w){w-=b;do{T[a++]=_[S++]}while(--b);S=a-E,M=T}for(;w>2;)T[a++]=M[S++],T[a++]=M[S++],T[a++]=M[S++],w-=3;w&&(T[a++]=M[S++],w>1&&(T[a++]=M[S++]))}else{S=a-E;do{T[a++]=T[S++],T[a++]=T[S++],T[a++]=T[S++],w-=3}while(w>2);w&&(T[a++]=T[S++],w>1&&(T[a++]=T[S++]))}break}if(64&b){e.msg="invalid distance code",R.mode=t;break e}y=m[(65535&y)+(h&(1<<b)-1)]}}break}}while(n<i&&a<s);w=f>>3,n-=w,f-=w<<3,h&=(1<<f)-1,e.next_in=n,e.next_out=a,e.avail_in=n<i?i-n+5:5-(n-i),e.avail_out=a<s?s-a+257:257-(a-s),R.hold=h,R.bits=f}},1447:(e,t,r)=>{"use strict";const n=r(3269),i=r(4823),a=r(7293),o=r(1998),{Z_FINISH:s,Z_BLOCK:l,Z_TREES:d,Z_OK:c,Z_STREAM_END:u,Z_NEED_DICT:_,Z_STREAM_ERROR:h,Z_DATA_ERROR:f,Z_MEM_ERROR:p,Z_BUF_ERROR:m,Z_DEFLATED:g}=r(9681),v=16180,y=16190,b=16191,w=16192,E=16194,S=16199,M=16200,x=16206,T=16209,R=16210,k=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 h;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 h;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 h;const n=e.state;return t<0?(r=0,t=-t):(r=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?h:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,P(e))},O=(e,t)=>{if(!e)return h;const r=new A;e.state=r,r.strm=e,r.window=null,r.mode=v;const n=I(e,t);return n!==c&&(e.state=null),n};let L,D,U=!0;const N=e=>{if(U){L=new Int32Array(512),D=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,L,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;o(2,e.lens,0,32,D,0,e.work,{bits:5}),U=!1}e.lencode=L,e.lenbits=9,e.distcode=D,e.distbits=5},W=(e,t,r,n)=>{let i;const a=e.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),n>=a.wsize?(a.window.set(t.subarray(r-a.wsize,r),0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>n&&(i=n),a.window.set(t.subarray(r-n,r-n+i),a.wnext),(n-=i)?(a.window.set(t.subarray(r-n,r),0),a.wnext=n,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.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,L,D,U,B,G,j,H,V,z,$,q,Y,X,K,Z,Q,J=0;const ee=new Uint8Array(4);let te,re;const ne=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 h;r=e.state,r.mode===b&&(r.mode=w),I=e.next_out,F=e.output,L=e.avail_out,P=e.next_in,A=e.input,O=e.avail_in,D=r.hold,U=r.bits,B=O,G=L,Q=c;e:for(;;)switch(r.mode){case v:if(0===r.wrap){r.mode=w;break}for(;U<16;){if(0===O)break e;O--,D+=A[P++]<<U,U+=8}if(2&r.wrap&&35615===D){0===r.wbits&&(r.wbits=15),r.check=0,ee[0]=255&D,ee[1]=D>>>8&255,r.check=i(r.check,ee,2,0),D=0,U=0,r.mode=16181;break}if(r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&D)<<8)+(D>>8))%31){e.msg="incorrect header check",r.mode=T;break}if((15&D)!==g){e.msg="unknown compression method",r.mode=T;break}if(D>>>=4,U-=4,Z=8+(15&D),0===r.wbits&&(r.wbits=Z),Z>15||Z>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&D?16189:b,D=0,U=0;break;case 16181:for(;U<16;){if(0===O)break e;O--,D+=A[P++]<<U,U+=8}if(r.flags=D,(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=D>>8&1),512&r.flags&&4&r.wrap&&(ee[0]=255&D,ee[1]=D>>>8&255,r.check=i(r.check,ee,2,0)),D=0,U=0,r.mode=16182;case 16182:for(;U<32;){if(0===O)break e;O--,D+=A[P++]<<U,U+=8}r.head&&(r.head.time=D),512&r.flags&&4&r.wrap&&(ee[0]=255&D,ee[1]=D>>>8&255,ee[2]=D>>>16&255,ee[3]=D>>>24&255,r.check=i(r.check,ee,4,0)),D=0,U=0,r.mode=16183;case 16183:for(;U<16;){if(0===O)break e;O--,D+=A[P++]<<U,U+=8}r.head&&(r.head.xflags=255&D,r.head.os=D>>8),512&r.flags&&4&r.wrap&&(ee[0]=255&D,ee[1]=D>>>8&255,r.check=i(r.check,ee,2,0)),D=0,U=0,r.mode=16184;case 16184:if(1024&r.flags){for(;U<16;){if(0===O)break e;O--,D+=A[P++]<<U,U+=8}r.length=D,r.head&&(r.head.extra_len=D),512&r.flags&&4&r.wrap&&(ee[0]=255&D,ee[1]=D>>>8&255,r.check=i(r.check,ee,2,0)),D=0,U=0}else r.head&&(r.head.extra=null);r.mode=16185;case 16185:if(1024&r.flags&&(j=r.length,j>O&&(j=O),j&&(r.head&&(Z=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+j),Z)),512&r.flags&&4&r.wrap&&(r.check=i(r.check,A,j,P)),O-=j,P+=j,r.length-=j),r.length))break e;r.length=0,r.mode=16186;case 16186:if(2048&r.flags){if(0===O)break e;j=0;do{Z=A[P+j++],r.head&&Z&&r.length<65536&&(r.head.name+=String.fromCharCode(Z))}while(Z&&j<O);if(512&r.flags&&4&r.wrap&&(r.check=i(r.check,A,j,P)),O-=j,P+=j,Z)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;j=0;do{Z=A[P+j++],r.head&&Z&&r.length<65536&&(r.head.comment+=String.fromCharCode(Z))}while(Z&&j<O);if(512&r.flags&&4&r.wrap&&(r.check=i(r.check,A,j,P)),O-=j,P+=j,Z)break e}else r.head&&(r.head.comment=null);r.mode=16188;case 16188:if(512&r.flags){for(;U<16;){if(0===O)break e;O--,D+=A[P++]<<U,U+=8}if(4&r.wrap&&D!==(65535&r.check)){e.msg="header crc mismatch",r.mode=T;break}D=0,U=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(;U<32;){if(0===O)break e;O--,D+=A[P++]<<U,U+=8}e.adler=r.check=k(D),D=0,U=0,r.mode=y;case y:if(0===r.havedict)return e.next_out=I,e.avail_out=L,e.next_in=P,e.avail_in=O,r.hold=D,r.bits=U,_;e.adler=r.check=1,r.mode=b;case b:if(t===l||t===d)break e;case w:if(r.last){D>>>=7&U,U-=7&U,r.mode=x;break}for(;U<3;){if(0===O)break e;O--,D+=A[P++]<<U,U+=8}switch(r.last=1&D,D>>>=1,U-=1,3&D){case 0:r.mode=16193;break;case 1:if(N(r),r.mode=S,t===d){D>>>=2,U-=2;break e}break;case 2:r.mode=16196;break;case 3:e.msg="invalid block type",r.mode=T}D>>>=2,U-=2;break;case 16193:for(D>>>=7&U,U-=7&U;U<32;){if(0===O)break e;O--,D+=A[P++]<<U,U+=8}if((65535&D)!=(D>>>16^65535)){e.msg="invalid stored block lengths",r.mode=T;break}if(r.length=65535&D,D=0,U=0,r.mode=E,t===d)break e;case E:r.mode=16195;case 16195:if(j=r.length,j){if(j>O&&(j=O),j>L&&(j=L),0===j)break e;F.set(A.subarray(P,P+j),I),O-=j,P+=j,L-=j,I+=j,r.length-=j;break}r.mode=b;break;case 16196:for(;U<14;){if(0===O)break e;O--,D+=A[P++]<<U,U+=8}if(r.nlen=257+(31&D),D>>>=5,U-=5,r.ndist=1+(31&D),D>>>=5,U-=5,r.ncode=4+(15&D),D>>>=4,U-=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(;U<3;){if(0===O)break e;O--,D+=A[P++]<<U,U+=8}r.lens[ne[r.have++]]=7&D,D>>>=3,U-=3}for(;r.have<19;)r.lens[ne[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,te={bits:r.lenbits},Q=o(0,r.lens,0,19,r.lencode,0,r.work,te),r.lenbits=te.bits,Q){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[D&(1<<r.lenbits)-1],z=J>>>24,$=J>>>16&255,q=65535&J,!(z<=U);){if(0===O)break e;O--,D+=A[P++]<<U,U+=8}if(q<16)D>>>=z,U-=z,r.lens[r.have++]=q;else{if(16===q){for(re=z+2;U<re;){if(0===O)break e;O--,D+=A[P++]<<U,U+=8}if(D>>>=z,U-=z,0===r.have){e.msg="invalid bit length repeat",r.mode=T;break}Z=r.lens[r.have-1],j=3+(3&D),D>>>=2,U-=2}else if(17===q){for(re=z+3;U<re;){if(0===O)break e;O--,D+=A[P++]<<U,U+=8}D>>>=z,U-=z,Z=0,j=3+(7&D),D>>>=3,U-=3}else{for(re=z+7;U<re;){if(0===O)break e;O--,D+=A[P++]<<U,U+=8}D>>>=z,U-=z,Z=0,j=11+(127&D),D>>>=7,U-=7}if(r.have+j>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=T;break}for(;j--;)r.lens[r.have++]=Z}}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},Q=o(1,r.lens,0,r.nlen,r.lencode,0,r.work,te),r.lenbits=te.bits,Q){e.msg="invalid literal/lengths set",r.mode=T;break}if(r.distbits=6,r.distcode=r.distdyn,te={bits:r.distbits},Q=o(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,te),r.distbits=te.bits,Q){e.msg="invalid distances set",r.mode=T;break}if(r.mode=S,t===d)break e;case S:r.mode=M;case M:if(O>=6&&L>=258){e.next_out=I,e.avail_out=L,e.next_in=P,e.avail_in=O,r.hold=D,r.bits=U,a(e,G),I=e.next_out,F=e.output,L=e.avail_out,P=e.next_in,A=e.input,O=e.avail_in,D=r.hold,U=r.bits,r.mode===b&&(r.back=-1);break}for(r.back=0;J=r.lencode[D&(1<<r.lenbits)-1],z=J>>>24,$=J>>>16&255,q=65535&J,!(z<=U);){if(0===O)break e;O--,D+=A[P++]<<U,U+=8}if($&&!(240&$)){for(Y=z,X=$,K=q;J=r.lencode[K+((D&(1<<Y+X)-1)>>Y)],z=J>>>24,$=J>>>16&255,q=65535&J,!(Y+z<=U);){if(0===O)break e;O--,D+=A[P++]<<U,U+=8}D>>>=Y,U-=Y,r.back+=Y}if(D>>>=z,U-=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;U<re;){if(0===O)break e;O--,D+=A[P++]<<U,U+=8}r.length+=D&(1<<r.extra)-1,D>>>=r.extra,U-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=16202;case 16202:for(;J=r.distcode[D&(1<<r.distbits)-1],z=J>>>24,$=J>>>16&255,q=65535&J,!(z<=U);){if(0===O)break e;O--,D+=A[P++]<<U,U+=8}if(!(240&$)){for(Y=z,X=$,K=q;J=r.distcode[K+((D&(1<<Y+X)-1)>>Y)],z=J>>>24,$=J>>>16&255,q=65535&J,!(Y+z<=U);){if(0===O)break e;O--,D+=A[P++]<<U,U+=8}D>>>=Y,U-=Y,r.back+=Y}if(D>>>=z,U-=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;U<re;){if(0===O)break e;O--,D+=A[P++]<<U,U+=8}r.offset+=D&(1<<r.extra)-1,D>>>=r.extra,U-=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===L)break e;if(j=G-L,r.offset>j){if(j=r.offset-j,j>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=T;break}j>r.wnext?(j-=r.wnext,H=r.wsize-j):H=r.wnext-j,j>r.length&&(j=r.length),V=r.window}else V=F,H=I-r.offset,j=r.length;j>L&&(j=L),L-=j,r.length-=j;do{F[I++]=V[H++]}while(--j);0===r.length&&(r.mode=M);break;case 16205:if(0===L)break e;F[I++]=r.length,L--,r.mode=M;break;case x:if(r.wrap){for(;U<32;){if(0===O)break e;O--,D|=A[P++]<<U,U+=8}if(G-=L,e.total_out+=G,r.total+=G,4&r.wrap&&G&&(e.adler=r.check=r.flags?i(r.check,F,G,I-G):n(r.check,F,G,I-G)),G=L,4&r.wrap&&(r.flags?D:k(D))!==r.check){e.msg="incorrect data check",r.mode=T;break}D=0,U=0}r.mode=16207;case 16207:if(r.wrap&&r.flags){for(;U<32;){if(0===O)break e;O--,D+=A[P++]<<U,U+=8}if(4&r.wrap&&D!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=T;break}D=0,U=0}r.mode=16208;case 16208:Q=u;break e;case T:Q=f;break e;case R:return p;default:return h}return e.next_out=I,e.avail_out=L,e.next_in=P,e.avail_in=O,r.hold=D,r.bits=U,(r.wsize||G!==e.avail_out&&r.mode<T&&(r.mode<x||t!==s))&&W(e,e.output,e.next_out,G-e.avail_out)?(r.mode=R,p):(B-=e.avail_in,G-=e.avail_out,e.total_in+=B,e.total_out+=G,r.total+=G,4&r.wrap&&G&&(e.adler=r.check=r.flags?i(r.check,F,G,e.next_out-G):n(r.check,F,G,e.next_out-G)),e.data_type=r.bits+(r.last?64:0)+(r.mode===b?128:0)+(r.mode===S||r.mode===E?256:0),(0===B&&0===G||t===s)&&Q===c&&(Q=m),Q)},e.exports.inflateEnd=e=>{if(C(e))return h;let t=e.state;return t.window&&(t.window=null),e.state=null,c},e.exports.inflateGetHeader=(e,t)=>{if(C(e))return h;const r=e.state;return 2&r.wrap?(r.head=t,t.done=!1,c):h},e.exports.inflateSetDictionary=(e,t)=>{const r=t.length;let i,a,o;return C(e)?h:(i=e.state,0!==i.wrap&&i.mode!==y?h:i.mode===y&&(a=1,a=n(a,t,r,0),a!==i.check)?f:(o=W(e,t,r,r),o?(i.mode=R,p):(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]),n=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,a,o,s,l,d,c,u)=>{const _=u.bits;let h,f,p,m,g,v,y=0,b=0,w=0,E=0,S=0,M=0,x=0,T=0,R=0,k=0,A=null;const C=new Uint16Array(16),F=new Uint16Array(16);let P,I,O,L=null;for(y=0;y<=15;y++)C[y]=0;for(b=0;b<s;b++)C[a[o+b]]++;for(S=_,E=15;E>=1&&0===C[E];E--);if(S>E&&(S=E),0===E)return l[d++]=20971520,l[d++]=20971520,u.bits=1,0;for(w=1;w<E&&0===C[w];w++);for(S<w&&(S=w),T=1,y=1;y<=15;y++)if(T<<=1,T-=C[y],T<0)return-1;if(T>0&&(0===e||1!==E))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!==a[o+b]&&(c[F[a[o+b]]++]=b);if(0===e?(A=L=c,v=20):1===e?(A=t,L=r,v=257):(A=n,L=i,v=0),k=0,b=0,y=w,g=d,M=S,x=0,p=-1,R=1<<S,m=R-1,1===e&&R>852||2===e&&R>592)return 1;for(;;){P=y-x,c[b]+1<v?(I=0,O=c[b]):c[b]>=v?(I=L[c[b]-v],O=A[c[b]-v]):(I=96,O=0),h=1<<y-x,f=1<<M,w=f;do{f-=h,l[g+(k>>x)+f]=P<<24|I<<16|O}while(0!==f);for(h=1<<y-1;k&h;)h>>=1;if(0!==h?(k&=h-1,k+=h):k=0,b++,0==--C[y]){if(y===E)break;y=a[o+c[b]]}if(y>S&&(k&m)!==p){for(0===x&&(x=S),g+=w,M=y-x,T=1<<M;M+x<E&&(T-=C[M+x],!(T<=0));)M++,T<<=1;if(R+=1<<M,1===e&&R>852||2===e&&R>592)return 1;p=k&m,l[p]=S<<24|M<<16|g-d}}return 0!==k&&(l[g+k]=y-x<<24|64<<16),u.bits=S,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]),n=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]),a=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 l=new Array(512);t(l);const d=new Array(256);t(d);const c=new Array(29);t(c);const u=new Array(30);function _(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}let h,f,p;function m(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}t(u);const g=e=>e<256?l[e]:l[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},E=(e,t,r)=>{const n=new Array(16);let i,a,o=0;for(i=1;i<=15;i++)o=o+r[i-1]<<1,n[i]=o;for(a=0;a<=t;a++){let t=e[2*a+1];0!==t&&(e[2*a]=w(n[t]++,t))}},S=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},M=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},x=(e,t,r,n)=>{const i=2*t,a=2*r;return e[i]<e[a]||e[i]===e[a]&&n[t]<=n[r]},T=(e,t,r)=>{const n=e.heap[r];let i=r<<1;for(;i<=e.heap_len&&(i<e.heap_len&&x(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!x(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n},R=(e,t,i)=>{let a,o,s,l,_=0;if(0!==e.sym_next)do{a=255&e.pending_buf[e.sym_buf+_++],a+=(255&e.pending_buf[e.sym_buf+_++])<<8,o=e.pending_buf[e.sym_buf+_++],0===a?b(e,o,t):(s=d[o],b(e,s+256+1,t),l=r[s],0!==l&&(o-=c[s],y(e,o,l)),a--,s=g(a),b(e,s,i),l=n[s],0!==l&&(a-=u[s],y(e,a,l)))}while(_<e.sym_next);b(e,256,t)},k=(e,t)=>{const r=t.dyn_tree,n=t.stat_desc.static_tree,i=t.stat_desc.has_stree,a=t.stat_desc.elems;let o,s,l,d=-1;for(e.heap_len=0,e.heap_max=573,o=0;o<a;o++)0!==r[2*o]?(e.heap[++e.heap_len]=d=o,e.depth[o]=0):r[2*o+1]=0;for(;e.heap_len<2;)l=e.heap[++e.heap_len]=d<2?++d:0,r[2*l]=1,e.depth[l]=0,e.opt_len--,i&&(e.static_len-=n[2*l+1]);for(t.max_code=d,o=e.heap_len>>1;o>=1;o--)T(e,r,o);l=a;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*l]=r[2*o]+r[2*s],e.depth[l]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1,r[2*o+1]=r[2*s+1]=l,e.heap[1]=l++,T(e,r,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const r=t.dyn_tree,n=t.max_code,i=t.stat_desc.static_tree,a=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,l=t.stat_desc.max_length;let d,c,u,_,h,f,p=0;for(_=0;_<=15;_++)e.bl_count[_]=0;for(r[2*e.heap[e.heap_max]+1]=0,d=e.heap_max+1;d<573;d++)c=e.heap[d],_=r[2*r[2*c+1]+1]+1,_>l&&(_=l,p++),r[2*c+1]=_,c>n||(e.bl_count[_]++,h=0,c>=s&&(h=o[c-s]),f=r[2*c],e.opt_len+=f*(_+h),a&&(e.static_len+=f*(i[2*c+1]+h)));if(0!==p){do{for(_=l-1;0===e.bl_count[_];)_--;e.bl_count[_]--,e.bl_count[_+1]+=2,e.bl_count[l]--,p-=2}while(p>0);for(_=l;0!==_;_--)for(c=e.bl_count[_];0!==c;)u=e.heap[--d],u>n||(r[2*u+1]!==_&&(e.opt_len+=(_-r[2*u+1])*r[2*u],r[2*u+1]=_),c--)}})(e,t),E(r,d,e.bl_count)},A=(e,t,r)=>{let n,i,a=-1,o=t[1],s=0,l=7,d=4;for(0===o&&(l=138,d=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=o,o=t[2*(n+1)+1],++s<l&&i===o||(s<d?e.bl_tree[2*i]+=s:0!==i?(i!==a&&e.bl_tree[2*i]++,e.bl_tree[32]++):s<=10?e.bl_tree[34]++:e.bl_tree[36]++,s=0,a=i,0===o?(l=138,d=3):i===o?(l=6,d=3):(l=7,d=4))},C=(e,t,r)=>{let n,i,a=-1,o=t[1],s=0,l=7,d=4;for(0===o&&(l=138,d=3),n=0;n<=r;n++)if(i=o,o=t[2*(n+1)+1],!(++s<l&&i===o)){if(s<d)do{b(e,i,e.bl_tree)}while(0!=--s);else 0!==i?(i!==a&&(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,a=i,0===o?(l=138,d=3):i===o?(l=6,d=3):(l=7,d=4)}};let F=!1;const P=(e,t,r,n)=>{y(e,0+(n?1:0),3),M(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,a,m,g;const v=new Array(16);for(a=0,m=0;m<28;m++)for(c[m]=a,e=0;e<1<<r[m];e++)d[a++]=m;for(d[a-1]=m,g=0,m=0;m<16;m++)for(u[m]=g,e=0;e<1<<n[m];e++)l[g++]=m;for(g>>=7;m<30;m++)for(u[m]=g<<7,e=0;e<1<<n[m]-7;e++)l[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(E(o,287,v),e=0;e<30;e++)s[2*e+1]=5,s[2*e]=w(e,5);h=new _(o,r,257,286,15),f=new _(s,n,0,30,15),p=new _(new Array(0),i,0,19,7)})(),F=!0),e.l_desc=new m(e.dyn_ltree,h),e.d_desc=new m(e.dyn_dtree,f),e.bl_desc=new m(e.bl_tree,p),e.bi_buf=0,e.bi_valid=0,S(e)},e.exports._tr_stored_block=P,e.exports._tr_flush_block=(e,t,r,n)=>{let i,l,d=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)),k(e,e.l_desc),k(e,e.d_desc),d=(e=>{let t;for(A(e,e.dyn_ltree,e.l_desc.max_code),A(e,e.dyn_dtree,e.d_desc.max_code),k(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*a[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),i=e.opt_len+3+7>>>3,l=e.static_len+3+7>>>3,l<=i&&(i=l)):i=l=r+5,r+4<=i&&-1!==t?P(e,t,r,n):4===e.strategy||l===i?(y(e,2+(n?1:0),3),R(e,o,s)):(y(e,4+(n?1:0),3),((e,t,r,n)=>{let i;for(y(e,t-257,5),y(e,r-1,5),y(e,n-4,4),i=0;i<n;i++)y(e,e.bl_tree[2*a[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,d+1),R(e,e.dyn_ltree,e.dyn_dtree)),S(e),n&&M(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*(d[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 n=r(2222);e.exports=n},6040:(e,t,r)=>{"use strict";var n=r(8251);e.exports=n},7264:(e,t,r)=>{"use strict";var n=r(4139);r(768),r(8549),r(7152),r(1372),e.exports=n},9692:(e,t,r)=>{"use strict";var n=r(7045);e.exports=n},5663:(e,t,r)=>{"use strict";var n=r(70);e.exports=n},6823:(e,t,r)=>{"use strict";var n=r(8280),i=r(2017),a=String.prototype;e.exports=function(e){var t=e.replaceAll;return"string"==typeof e||e===a||n(a,e)&&t===a.replaceAll?i:t}},1042:(e,t,r)=>{"use strict";var n=r(8280),i=r(7511),a=String.prototype;e.exports=function(e){var t=e.trim;return"string"==typeof e||e===a||n(a,e)&&t===a.trim?i:t}},1926:(e,t,r)=>{"use strict";r(6750);var n=r(2046).Object,i=e.exports=function(e,t,r){return n.defineProperty(e,t,r)};n.defineProperty.sham&&(i.sham=!0)},2017:(e,t,r)=>{"use strict";r(1398),r(1995),r(929);var n=r(1747);e.exports=n("String","replaceAll")},7511:(e,t,r)=>{"use strict";r(727);var n=r(1747);e.exports=n("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 n=r(2046);e.exports=n.Symbol},1730:(e,t,r)=>{"use strict";r(9363),r(3643),r(7057),r(4954);var n=r(560);e.exports=n.f("iterator")},1661:(e,t,r)=>{"use strict";r(8537),r(3669);var n=r(560);e.exports=n.f("toPrimitive")},3042:(e,t,r)=>{"use strict";e.exports=r(9604)},9604:(e,t,r)=>{"use strict";r(6038);var n=r(1829);e.exports=n},4997:(e,t,r)=>{"use strict";var n=r(6040);e.exports=n},2321:(e,t,r)=>{"use strict";var n=r(7264);r(3939),r(1785),r(1697),r(4664),r(3422),r(36),r(8703),r(6878),r(9671),r(359),e.exports=n},2231:(e,t,r)=>{"use strict";var n=r(9692);e.exports=n},9280:(e,t,r)=>{"use strict";var n=r(5663);e.exports=n},2159:(e,t,r)=>{"use strict";var n=r(2250),i=r(4640),a=TypeError;e.exports=function(e){if(n(e))return e;throw new a(i(e)+" is not a function")}},43:(e,t,r)=>{"use strict";var n=r(4018),i=String,a=TypeError;e.exports=function(e){if(n(e))return e;throw new a("Can't set "+i(e)+" as a prototype")}},2156:e=>{"use strict";e.exports=function(){}},6624:(e,t,r)=>{"use strict";var n=r(6285),i=String,a=TypeError;e.exports=function(e){if(n(e))return e;throw new a(i(e)+" is not an object")}},4436:(e,t,r)=>{"use strict";var n=r(7374),i=r(4849),a=r(575),o=function(e){return function(t,r,o){var s=n(t),l=a(s);if(0===l)return!e&&-1;var d,c=i(o,l);if(e&&r!=r){for(;l>c;)if((d=s[c++])!=d)return!0}else for(;l>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 n=r(8311),i=r(1907),a=r(6946),o=r(9298),s=r(575),l=r(6968),d=i([].push),c=function(e){var t=1===e,r=2===e,i=3===e,c=4===e,u=6===e,_=7===e,h=5===e||u;return function(f,p,m,g){for(var v,y,b=o(f),w=a(b),E=s(w),S=n(p,m),M=0,x=g||l,T=t?x(f,E):r||_?x(f,0):void 0;E>M;M++)if((h||M in w)&&(y=S(v=w[M],M,b),e))if(t)T[M]=y;else if(y)switch(e){case 3:return!0;case 5:return v;case 6:return M;case 2:d(T,v)}else switch(e){case 4:return!1;case 7:d(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 n=r(8828),i=r(6264),a=r(798),o=i("species");e.exports=function(e){return a>=51||!n((function(){var t=[];return(t.constructor={})[o]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},3427:(e,t,r)=>{"use strict";var n=r(1907);e.exports=n([].slice)},4010:(e,t,r)=>{"use strict";var n=r(1793),i=r(5468),a=r(6285),o=r(6264)("species"),s=Array;e.exports=function(e){var t;return n(e)&&(t=e.constructor,(i(t)&&(t===s||n(t.prototype))||a(t)&&null===(t=t[o]))&&(t=void 0)),void 0===t?s:t}},6968:(e,t,r)=>{"use strict";var n=r(4010);e.exports=function(e,t){return new(n(e))(0===t?0:t)}},5807:(e,t,r)=>{"use strict";var n=r(1907),i=n({}.toString),a=n("".slice);e.exports=function(e){return a(i(e),8,-1)}},3948:(e,t,r)=>{"use strict";var n=r(2623),i=r(2250),a=r(5807),o=r(6264)("toStringTag"),s=Object,l="Arguments"===a(function(){return arguments}());e.exports=n?a:function(e){var t,r,n;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:l?a(t):"Object"===(n=a(t))&&i(t.callee)?"Arguments":n}},7382:(e,t,r)=>{"use strict";var n=r(8828);e.exports=!n((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 n=r(9447),i=r(4284),a=r(5817);e.exports=n?function(e,t,r){return i.f(e,t,a(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 n=r(9447),i=r(4284),a=r(5817);e.exports=function(e,t,r){n?i.f(e,t,a(0,r)):e[t]=r}},9251:(e,t,r)=>{"use strict";var n=r(4284);e.exports=function(e,t,r){return n.f(e,t,r)}},8055:(e,t,r)=>{"use strict";var n=r(1626);e.exports=function(e,t,r,i){return i&&i.enumerable?e[t]=r:n(e,t,r),e}},2532:(e,t,r)=>{"use strict";var n=r(5951),i=Object.defineProperty;e.exports=function(e,t){try{i(n,e,{value:t,configurable:!0,writable:!0})}catch(r){n[e]=t}return t}},9447:(e,t,r)=>{"use strict";var n=r(8828);e.exports=!n((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},9552:(e,t,r)=>{"use strict";var n=r(5951),i=r(6285),a=n.document,o=i(a)&&i(a.createElement);e.exports=function(e){return o?a.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 n=r(5951).navigator,i=n&&n.userAgent;e.exports=i?String(i):""},798:(e,t,r)=>{"use strict";var n,i,a=r(5951),o=r(6794),s=a.process,l=a.Deno,d=s&&s.versions||l&&l.version,c=d&&d.v8;c&&(i=(n=c.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!i&&o&&(!(n=o.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=o.match(/Chrome\/(\d+)/))&&(i=+n[1]),e.exports=i},1091:(e,t,r)=>{"use strict";var n=r(5951),i=r(6024),a=r(2361),o=r(2250),s=r(3846).f,l=r(7463),d=r(2046),c=r(8311),u=r(1626),_=r(9724);r(6128);var h=function(e){var t=function(r,n,a){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(r);case 2:return new e(r,n)}return new e(r,n,a)}return i(e,this,arguments)};return t.prototype=e.prototype,t};e.exports=function(e,t){var r,i,f,p,m,g,v,y,b,w=e.target,E=e.global,S=e.stat,M=e.proto,x=E?n:S?n[w]:n[w]&&n[w].prototype,T=E?d:d[w]||u(d,w,{})[w],R=T.prototype;for(p in t)i=!(r=l(E?p:w+(S?".":"#")+p,e.forced))&&x&&_(x,p),g=T[p],i&&(v=e.dontCallGetSet?(b=s(x,p))&&b.value:x[p]),m=i&&v?v:t[p],(r||M||typeof g!=typeof m)&&(y=e.bind&&i?c(m,n):e.wrap&&i?h(m):M&&o(m)?a(m):m,(e.sham||m&&m.sham||g&&g.sham)&&u(y,"sham",!0),u(T,p,y),M&&(_(d,f=w+"Prototype")||u(d,f,{}),u(d[f],p,m),e.real&&R&&(r||!R[p])&&u(R,p,m)))}},8828:e=>{"use strict";e.exports=function(e){try{return!!e()}catch(e){return!0}}},6024:(e,t,r)=>{"use strict";var n=r(1505),i=Function.prototype,a=i.apply,o=i.call;e.exports="object"==typeof Reflect&&Reflect.apply||(n?o.bind(a):function(){return o.apply(a,arguments)})},8311:(e,t,r)=>{"use strict";var n=r(2361),i=r(2159),a=r(1505),o=n(n.bind);e.exports=function(e,t){return i(e),void 0===t?e:a?o(e,t):function(){return e.apply(t,arguments)}}},1505:(e,t,r)=>{"use strict";var n=r(8828);e.exports=!n((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},3930:(e,t,r)=>{"use strict";var n=r(1505),i=Function.prototype.call;e.exports=n?i.bind(i):function(){return i.apply(i,arguments)}},6833:(e,t,r)=>{"use strict";var n=r(9447),i=r(9724),a=Function.prototype,o=n&&Object.getOwnPropertyDescriptor,s=i(a,"name"),l=s&&"something"===function(){}.name,d=s&&(!n||n&&o(a,"name").configurable);e.exports={EXISTS:s,PROPER:l,CONFIGURABLE:d}},1871:(e,t,r)=>{"use strict";var n=r(1907),i=r(2159);e.exports=function(e,t,r){try{return n(i(Object.getOwnPropertyDescriptor(e,t)[r]))}catch(e){}}},2361:(e,t,r)=>{"use strict";var n=r(5807),i=r(1907);e.exports=function(e){if("Function"===n(e))return i(e)}},1907:(e,t,r)=>{"use strict";var n=r(1505),i=Function.prototype,a=i.call,o=n&&i.bind.bind(a,a);e.exports=n?o:function(e){return function(){return a.apply(e,arguments)}}},1747:(e,t,r)=>{"use strict";var n=r(5951),i=r(2046);e.exports=function(e,t){var r=i[e+"Prototype"],a=r&&r[t];if(a)return a;var o=n[e],s=o&&o.prototype;return s&&s[t]}},5582:(e,t,r)=>{"use strict";var n=r(2046),i=r(5951),a=r(2250),o=function(e){return a(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?o(n[e])||o(i[e]):n[e]&&n[e][t]||i[e]&&i[e][t]}},6656:(e,t,r)=>{"use strict";var n=r(1907),i=r(1793),a=r(2250),o=r(5807),s=r(160),l=n([].push);e.exports=function(e){if(a(e))return e;if(i(e)){for(var t=e.length,r=[],n=0;n<t;n++){var d=e[n];"string"==typeof d?l(r,d):"number"!=typeof d&&"Number"!==o(d)&&"String"!==o(d)||l(r,s(d))}var c=r.length,u=!0;return function(e,t){if(u)return u=!1,t;if(i(this))return t;for(var n=0;n<c;n++)if(r[n]===e)return t}}}},9367:(e,t,r)=>{"use strict";var n=r(2159),i=r(7136);e.exports=function(e,t){var r=e[t];return i(r)?void 0:n(r)}},7703:(e,t,r)=>{"use strict";var n=r(1907),i=r(9298),a=Math.floor,o=n("".charAt),s=n("".replace),l=n("".slice),d=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,c=/\$([$&'`]|\d{1,2})/g;e.exports=function(e,t,r,n,u,_){var h=r+e.length,f=n.length,p=c;return void 0!==u&&(u=i(u),p=d),s(_,p,(function(i,s){var d;switch(o(s,0)){case"$":return"$";case"&":return e;case"`":return l(t,0,r);case"'":return l(t,h);case"<":d=u[l(s,1,-1)];break;default:var c=+s;if(0===c)return i;if(c>f){var _=a(c/10);return 0===_?i:_<=f?void 0===n[_-1]?o(s,1):n[_-1]+o(s,1):i}d=n[c-1]}return void 0===d?"":d}))}},5951:function(e,t,r){"use strict";var n=function(e){return e&&e.Math===Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof r.g&&r.g)||n("object"==typeof this&&this)||function(){return this}()||Function("return this")()},9724:(e,t,r)=>{"use strict";var n=r(1907),i=r(9298),a=n({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return a(i(e),t)}},8530:e=>{"use strict";e.exports={}},2416:(e,t,r)=>{"use strict";var n=r(5582);e.exports=n("document","documentElement")},3648:(e,t,r)=>{"use strict";var n=r(9447),i=r(8828),a=r(9552);e.exports=!n&&!i((function(){return 7!==Object.defineProperty(a("div"),"a",{get:function(){return 7}}).a}))},6946:(e,t,r)=>{"use strict";var n=r(1907),i=r(8828),a=r(5807),o=Object,s=n("".split);e.exports=i((function(){return!o("z").propertyIsEnumerable(0)}))?function(e){return"String"===a(e)?s(e,""):o(e)}:o},2647:(e,t,r)=>{"use strict";var n=r(1907),i=r(2250),a=r(6128),o=n(Function.toString);i(a.inspectSource)||(a.inspectSource=function(e){return o(e)}),e.exports=a.inspectSource},4932:(e,t,r)=>{"use strict";var n,i,a,o=r(551),s=r(5951),l=r(6285),d=r(1626),c=r(9724),u=r(6128),_=r(2522),h=r(8530),f="Object already initialized",p=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,n=function(e,t){if(g.has(e))throw new p(f);return t.facade=e,g.set(e,t),t},i=function(e){return g.get(e)||{}},a=function(e){return g.has(e)}}else{var v=_("state");h[v]=!0,n=function(e,t){if(c(e,v))throw new p(f);return t.facade=e,d(e,v,t),t},i=function(e){return c(e,v)?e[v]:{}},a=function(e){return c(e,v)}}e.exports={set:n,get:i,has:a,enforce:function(e){return a(e)?i(e):n(e,{})},getterFor:function(e){return function(t){var r;if(!l(t)||(r=i(t)).type!==e)throw new p("Incompatible receiver, "+e+" required");return r}}}},1793:(e,t,r)=>{"use strict";var n=r(5807);e.exports=Array.isArray||function(e){return"Array"===n(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 n=r(1907),i=r(8828),a=r(2250),o=r(3948),s=r(5582),l=r(2647),d=function(){},c=s("Reflect","construct"),u=/^\s*(?:class|function)\b/,_=n(u.exec),h=!u.test(d),f=function(e){if(!a(e))return!1;try{return c(d,[],e),!0}catch(e){return!1}},p=function(e){if(!a(e))return!1;switch(o(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return h||!!_(u,l(e))}catch(e){return!0}};p.sham=!0,e.exports=!c||i((function(){var e;return f(f.call)||!f(Object)||!f((function(){e=!0}))||e}))?p:f},7463:(e,t,r)=>{"use strict";var n=r(8828),i=r(2250),a=/#|\.prototype\./,o=function(e,t){var r=l[s(e)];return r===c||r!==d&&(i(t)?n(t):!!t)},s=o.normalize=function(e){return String(e).replace(a,".").toLowerCase()},l=o.data={},d=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 n=r(2250);e.exports=function(e){return"object"==typeof e?null!==e:n(e)}},4018:(e,t,r)=>{"use strict";var n=r(6285);e.exports=function(e){return n(e)||null===e}},7376:e=>{"use strict";e.exports=!0},2087:(e,t,r)=>{"use strict";var n=r(6285),i=r(5807),a=r(6264)("match");e.exports=function(e){var t;return n(e)&&(void 0!==(t=e[a])?!!t:"RegExp"===i(e))}},5594:(e,t,r)=>{"use strict";var n=r(5582),i=r(2250),a=r(8280),o=r(1175),s=Object;e.exports=o?function(e){return"symbol"==typeof e}:function(e){var t=n("Symbol");return i(t)&&a(t.prototype,s(e))}},7181:(e,t,r)=>{"use strict";var n=r(5116).IteratorPrototype,i=r(8075),a=r(5817),o=r(4840),s=r(3742),l=function(){return this};e.exports=function(e,t,r,d){var c=t+" Iterator";return e.prototype=i(n,{next:a(+!d,r)}),o(e,c,!1,!0),s[c]=l,e}},183:(e,t,r)=>{"use strict";var n=r(1091),i=r(3930),a=r(7376),o=r(6833),s=r(2250),l=r(7181),d=r(5972),c=r(9192),u=r(4840),_=r(1626),h=r(8055),f=r(6264),p=r(3742),m=r(5116),g=o.PROPER,v=o.CONFIGURABLE,y=m.IteratorPrototype,b=m.BUGGY_SAFARI_ITERATORS,w=f("iterator"),E="keys",S="values",M="entries",x=function(){return this};e.exports=function(e,t,r,o,f,m,T){l(r,t,o);var R,k,A,C=function(e){if(e===f&&L)return L;if(!b&&e&&e in I)return I[e];switch(e){case E:case S:case M: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"]||f&&I[f],L=!b&&O||C(f),D="Array"===t&&I.entries||O;if(D&&(R=d(D.call(new e)))!==Object.prototype&&R.next&&(a||d(R)===y||(c?c(R,y):s(R[w])||h(R,w,x)),u(R,F,!0,!0),a&&(p[F]=x)),g&&f===S&&O&&O.name!==S&&(!a&&v?_(I,"name",S):(P=!0,L=function(){return i(O,this)})),f)if(k={values:C(S),keys:m?L:C(E),entries:C(M)},T)for(A in k)(b||P||!(A in I))&&h(I,A,k[A]);else n({target:t,proto:!0,forced:b||P},k);return a&&!T||I[w]===L||h(I,w,L,{name:f}),p[t]=L,k}},5116:(e,t,r)=>{"use strict";var n,i,a,o=r(8828),s=r(2250),l=r(6285),d=r(8075),c=r(5972),u=r(8055),_=r(6264),h=r(7376),f=_("iterator"),p=!1;[].keys&&("next"in(a=[].keys())?(i=c(c(a)))!==Object.prototype&&(n=i):p=!0),!l(n)||o((function(){var e={};return n[f].call(e)!==e}))?n={}:h&&(n=d(n)),s(n[f])||u(n,f,(function(){return this})),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:p}},3742:e=>{"use strict";e.exports={}},575:(e,t,r)=>{"use strict";var n=r(3121);e.exports=function(e){return n(e.length)}},1176:e=>{"use strict";var t=Math.ceil,r=Math.floor;e.exports=Math.trunc||function(e){var n=+e;return(n>0?r:t)(n)}},8075:(e,t,r)=>{"use strict";var n,i=r(6624),a=r(2220),o=r(376),s=r(8530),l=r(2416),d=r(9552),c=r(2522),u="prototype",_="script",h=c("IE_PROTO"),f=function(){},p=function(e){return"<"+_+">"+e+"</"+_+">"},m=function(e){e.write(p("")),e.close();var t=e.parentWindow.Object;return e=null,t},g=function(){try{n=new ActiveXObject("htmlfile")}catch(e){}var e,t,r;g="undefined"!=typeof document?document.domain&&n?m(n):(t=d("iframe"),r="java"+_+":",t.style.display="none",l.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(p("document.F=Object")),e.close(),e.F):m(n);for(var i=o.length;i--;)delete g[u][o[i]];return g()};s[h]=!0,e.exports=Object.create||function(e,t){var r;return null!==e?(f[u]=i(e),r=new f,f[u]=null,r[h]=e):r=g(),void 0===t?r:a.f(r,t)}},2220:(e,t,r)=>{"use strict";var n=r(9447),i=r(8661),a=r(4284),o=r(6624),s=r(7374),l=r(2875);t.f=n&&!i?Object.defineProperties:function(e,t){o(e);for(var r,n=s(t),i=l(t),d=i.length,c=0;d>c;)a.f(e,r=i[c++],n[r]);return e}},4284:(e,t,r)=>{"use strict";var n=r(9447),i=r(3648),a=r(8661),o=r(6624),s=r(470),l=TypeError,d=Object.defineProperty,c=Object.getOwnPropertyDescriptor,u="enumerable",_="configurable",h="writable";t.f=n?a?function(e,t,r){if(o(e),t=s(t),o(r),"function"==typeof e&&"prototype"===t&&"value"in r&&h in r&&!r[h]){var n=c(e,t);n&&n[h]&&(e[t]=r.value,r={configurable:_ in r?r[_]:n[_],enumerable:u in r?r[u]:n[u],writable:!1})}return d(e,t,r)}:d:function(e,t,r){if(o(e),t=s(t),o(r),i)try{return d(e,t,r)}catch(e){}if("get"in r||"set"in r)throw new l("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},3846:(e,t,r)=>{"use strict";var n=r(9447),i=r(3930),a=r(2574),o=r(5817),s=r(7374),l=r(470),d=r(9724),c=r(3648),u=Object.getOwnPropertyDescriptor;t.f=n?u:function(e,t){if(e=s(e),t=l(t),c)try{return u(e,t)}catch(e){}if(d(e,t))return o(!i(a.f,e,t),e[t])}},5407:(e,t,r)=>{"use strict";var n=r(5807),i=r(7374),a=r(4443).f,o=r(3427),s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return s&&"Window"===n(e)?function(e){try{return a(e)}catch(e){return o(s)}}(e):a(i(e))}},4443:(e,t,r)=>{"use strict";var n=r(3045),i=r(376).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,i)}},7170:(e,t)=>{"use strict";t.f=Object.getOwnPropertySymbols},5972:(e,t,r)=>{"use strict";var n=r(9724),i=r(2250),a=r(9298),o=r(2522),s=r(7382),l=o("IE_PROTO"),d=Object,c=d.prototype;e.exports=s?d.getPrototypeOf:function(e){var t=a(e);if(n(t,l))return t[l];var r=t.constructor;return i(r)&&t instanceof r?r.prototype:t instanceof d?c:null}},8280:(e,t,r)=>{"use strict";var n=r(1907);e.exports=n({}.isPrototypeOf)},3045:(e,t,r)=>{"use strict";var n=r(1907),i=r(9724),a=r(7374),o=r(4436).indexOf,s=r(8530),l=n([].push);e.exports=function(e,t){var r,n=a(e),d=0,c=[];for(r in n)!i(s,r)&&i(n,r)&&l(c,r);for(;t.length>d;)i(n,r=t[d++])&&(~o(c,r)||l(c,r));return c}},2875:(e,t,r)=>{"use strict";var n=r(3045),i=r(376);e.exports=Object.keys||function(e){return n(e,i)}},2574:(e,t)=>{"use strict";var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,i=n&&!r.call({1:2},1);t.f=i?function(e){var t=n(this,e);return!!t&&t.enumerable}:r},9192:(e,t,r)=>{"use strict";var n=r(1871),i=r(6285),a=r(4239),o=r(43);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=n(Object.prototype,"__proto__","set"))(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return a(r),o(n),i(r)?(t?e(r,n):r.__proto__=n,r):r}}():void 0)},4878:(e,t,r)=>{"use strict";var n=r(2623),i=r(3948);e.exports=n?{}.toString:function(){return"[object "+i(this)+"]"}},581:(e,t,r)=>{"use strict";var n=r(3930),i=r(2250),a=r(6285),o=TypeError;e.exports=function(e,t){var r,s;if("string"===t&&i(r=e.toString)&&!a(s=n(r,e)))return s;if(i(r=e.valueOf)&&!a(s=n(r,e)))return s;if("string"!==t&&i(r=e.toString)&&!a(s=n(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 n=r(6624);e.exports=function(){var e=n(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 n=r(3930),i=r(9724),a=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")||!a(s,e)?t:n(o,e)}},4239:(e,t,r)=>{"use strict";var n=r(7136),i=TypeError;e.exports=function(e){if(n(e))throw new i("Can't call method on "+e);return e}},4840:(e,t,r)=>{"use strict";var n=r(2623),i=r(4284).f,a=r(1626),o=r(9724),s=r(4878),l=r(6264)("toStringTag");e.exports=function(e,t,r,d){var c=r?e:e&&e.prototype;c&&(o(c,l)||i(c,l,{configurable:!0,value:t}),d&&!n&&a(c,"toString",s))}},2522:(e,t,r)=>{"use strict";var n=r(5816),i=r(6499),a=n("keys");e.exports=function(e){return a[e]||(a[e]=i(e))}},6128:(e,t,r)=>{"use strict";var n=r(7376),i=r(5951),a=r(2532),o="__core-js_shared__",s=e.exports=i[o]||a(o,{});(s.versions||(s.versions=[])).push({version:"3.39.0",mode:n?"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 n=r(6128);e.exports=function(e,t){return n[e]||(n[e]=t||{})}},1470:(e,t,r)=>{"use strict";var n=r(1907),i=r(5482),a=r(160),o=r(4239),s=n("".charAt),l=n("".charCodeAt),d=n("".slice),c=function(e){return function(t,r){var n,c,u=a(o(t)),_=i(r),h=u.length;return _<0||_>=h?e?"":void 0:(n=l(u,_))<55296||n>56319||_+1===h||(c=l(u,_+1))<56320||c>57343?e?s(u,_):n:e?d(u,_,_+2):c-56320+(n-55296<<10)+65536}};e.exports={codeAt:c(!1),charAt:c(!0)}},5819:(e,t,r)=>{"use strict";var n=r(6833).PROPER,i=r(8828),a=r(6395);e.exports=function(e){return i((function(){return!!a[e]()||"
"!=="
"[e]()||n&&a[e].name!==e}))}},5993:(e,t,r)=>{"use strict";var n=r(1907),i=r(4239),a=r(160),o=r(6395),s=n("".replace),l=RegExp("^["+o+"]+"),d=RegExp("(^|[^"+o+"])["+o+"]+$"),c=function(e){return function(t){var r=a(i(t));return 1&e&&(r=s(r,l,"")),2&e&&(r=s(r,d,"$1")),r}};e.exports={start:c(1),end:c(2),trim:c(3)}},9846:(e,t,r)=>{"use strict";var n=r(798),i=r(8828),a=r(5951).String;e.exports=!!Object.getOwnPropertySymbols&&!i((function(){var e=Symbol("symbol detection");return!a(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},3467:(e,t,r)=>{"use strict";var n=r(3930),i=r(5582),a=r(6264),o=r(8055);e.exports=function(){var e=i("Symbol"),t=e&&e.prototype,r=t&&t.valueOf,s=a("toPrimitive");t&&!t[s]&&o(t,s,(function(e){return n(r,this)}),{arity:1})}},2595:(e,t,r)=>{"use strict";var n=r(5582),i=r(1907),a=n("Symbol"),o=a.keyFor,s=i(a.prototype.valueOf);e.exports=a.isRegisteredSymbol||function(e){try{return void 0!==o(s(e))}catch(e){return!1}}},9197:(e,t,r)=>{"use strict";for(var n=r(5816),i=r(5582),a=r(1907),o=r(5594),s=r(6264),l=i("Symbol"),d=l.isWellKnownSymbol,c=i("Object","getOwnPropertyNames"),u=a(l.prototype.valueOf),_=n("wks"),h=0,f=c(l),p=f.length;h<p;h++)try{var m=f[h];o(l[m])&&s(m)}catch(e){}e.exports=function(e){if(d&&d(e))return!0;try{for(var t=u(e),r=0,n=c(_),i=n.length;r<i;r++)if(_[n[r]]==t)return!0}catch(e){}return!1}},4411:(e,t,r)=>{"use strict";var n=r(9846);e.exports=n&&!!Symbol.for&&!!Symbol.keyFor},4849:(e,t,r)=>{"use strict";var n=r(5482),i=Math.max,a=Math.min;e.exports=function(e,t){var r=n(e);return r<0?i(r+t,0):a(r,t)}},7374:(e,t,r)=>{"use strict";var n=r(6946),i=r(4239);e.exports=function(e){return n(i(e))}},5482:(e,t,r)=>{"use strict";var n=r(1176);e.exports=function(e){var t=+e;return t!=t||0===t?0:n(t)}},3121:(e,t,r)=>{"use strict";var n=r(5482),i=Math.min;e.exports=function(e){var t=n(e);return t>0?i(t,9007199254740991):0}},9298:(e,t,r)=>{"use strict";var n=r(4239),i=Object;e.exports=function(e){return i(n(e))}},6028:(e,t,r)=>{"use strict";var n=r(3930),i=r(6285),a=r(5594),o=r(9367),s=r(581),l=r(6264),d=TypeError,c=l("toPrimitive");e.exports=function(e,t){if(!i(e)||a(e))return e;var r,l=o(e,c);if(l){if(void 0===t&&(t="default"),r=n(l,e,t),!i(r)||a(r))return r;throw new d("Can't convert object to primitive value")}return void 0===t&&(t="number"),s(e,t)}},470:(e,t,r)=>{"use strict";var n=r(6028),i=r(5594);e.exports=function(e){var t=n(e,"string");return i(t)?t:t+""}},2623:(e,t,r)=>{"use strict";var n={};n[r(6264)("toStringTag")]="z",e.exports="[object z]"===String(n)},160:(e,t,r)=>{"use strict";var n=r(3948),i=String;e.exports=function(e){if("Symbol"===n(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 n=r(1907),i=0,a=Math.random(),o=n(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+o(++i+a,36)}},1175:(e,t,r)=>{"use strict";var n=r(9846);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},8661:(e,t,r)=>{"use strict";var n=r(9447),i=r(8828);e.exports=n&&i((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},551:(e,t,r)=>{"use strict";var n=r(5951),i=r(2250),a=n.WeakMap;e.exports=i(a)&&/native code/.test(String(a))},366:(e,t,r)=>{"use strict";var n=r(2046),i=r(9724),a=r(560),o=r(4284).f;e.exports=function(e){var t=n.Symbol||(n.Symbol={});i(t,e)||o(t,e,{value:a.f(e)})}},560:(e,t,r)=>{"use strict";var n=r(6264);t.f=n},6264:(e,t,r)=>{"use strict";var n=r(5951),i=r(5816),a=r(9724),o=r(6499),s=r(9846),l=r(1175),d=n.Symbol,c=i("wks"),u=l?d.for||d:d&&d.withoutSetter||o;e.exports=function(e){return a(c,e)||(c[e]=s&&a(d,e)?d[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 n=r(1091),i=r(8828),a=r(1793),o=r(6285),s=r(9298),l=r(575),d=r(8024),c=r(5543),u=r(6968),_=r(7171),h=r(6264),f=r(798),p=h("isConcatSpreadable"),m=f>=51||!i((function(){var e=[];return e[p]=!1,e.concat()[0]!==e})),g=function(e){if(!o(e))return!1;var t=e[p];return void 0!==t?!!t:a(e)};n({target:"Array",proto:!0,arity:1,forced:!m||!_("concat")},{concat:function(e){var t,r,n,i,a,o=s(this),_=u(o,0),h=0;for(t=-1,n=arguments.length;t<n;t++)if(g(a=-1===t?o:arguments[t]))for(i=l(a),d(h+i),r=0;r<i;r++,h++)r in a&&c(_,h,a[r]);else d(h+1),c(_,h++,a);return _.length=h,_}})},9363:(e,t,r)=>{"use strict";var n=r(7374),i=r(2156),a=r(3742),o=r(4932),s=r(4284).f,l=r(183),d=r(9550),c=r(7376),u=r(9447),_="Array Iterator",h=o.set,f=o.getterFor(_);e.exports=l(Array,"Array",(function(e,t){h(this,{type:_,target:n(e),index:0,kind:t})}),(function(){var e=f(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=null,d(void 0,!0);switch(e.kind){case"keys":return d(r,!1);case"values":return d(t[r],!1)}return d([r,t[r]],!1)}),"values");var p=a.Arguments=a.Array;if(i("keys"),i("values"),i("entries"),!c&&u&&"values"!==p.name)try{s(p,"name",{value:"values"})}catch(e){}},8537:()=>{},9721:(e,t,r)=>{"use strict";var n=r(1091),i=r(5582),a=r(6024),o=r(3930),s=r(1907),l=r(8828),d=r(2250),c=r(5594),u=r(3427),_=r(6656),h=r(9846),f=String,p=i("JSON","stringify"),m=s(/./.exec),g=s("".charAt),v=s("".charCodeAt),y=s("".replace),b=s(1..toString),w=/[\uD800-\uDFFF]/g,E=/^[\uD800-\uDBFF]$/,S=/^[\uDC00-\uDFFF]$/,M=!h||l((function(){var e=i("Symbol")("stringify detection");return"[null]"!==p([e])||"{}"!==p({a:e})||"{}"!==p(Object(e))})),x=l((function(){return'"\\udf06\\ud834"'!==p("\udf06\ud834")||'"\\udead"'!==p("\udead")})),T=function(e,t){var r=u(arguments),n=_(t);if(d(n)||void 0!==e&&!c(e))return r[1]=function(e,t){if(d(n)&&(t=o(n,this,f(e),t)),!c(t))return t},a(p,null,r)},R=function(e,t,r){var n=g(r,t-1),i=g(r,t+1);return m(E,e)&&!m(S,i)||m(S,e)&&!m(E,n)?"\\u"+b(v(e,0),16):e};p&&n({target:"JSON",stat:!0,arity:3,forced:M||x},{stringify:function(e,t,r){var n=u(arguments),i=a(M?T:p,null,n);return x&&"string"==typeof i?y(i,w,R):i}})},7024:(e,t,r)=>{"use strict";var n=r(5951);r(4840)(n.JSON,"JSON",!0)},8172:()=>{},6750:(e,t,r)=>{"use strict";var n=r(1091),i=r(9447),a=r(4284).f;n({target:"Object",stat:!0,forced:Object.defineProperty!==a,sham:!i},{defineProperty:a})},5264:(e,t,r)=>{"use strict";var n=r(1091),i=r(9846),a=r(8828),o=r(7170),s=r(9298);n({target:"Object",stat:!0,forced:!i||a((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 n=r(1470).charAt,i=r(160),a=r(4932),o=r(183),s=r(9550),l="String Iterator",d=a.set,c=a.getterFor(l);o(String,"String",(function(e){d(this,{type:l,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=n(r,i),t.index+=e.length,s(e,!1))}))},929:(e,t,r)=>{"use strict";var n=r(1091),i=r(3930),a=r(1907),o=r(4239),s=r(2250),l=r(7136),d=r(2087),c=r(160),u=r(9367),_=r(663),h=r(7703),f=r(6264),p=r(7376),m=f("replace"),g=TypeError,v=a("".indexOf),y=a("".replace),b=a("".slice),w=Math.max;n({target:"String",proto:!0},{replaceAll:function(e,t){var r,n,a,f,E,S,M,x,T,R,k=o(this),A=0,C="";if(!l(e)){if((r=d(e))&&(n=c(o(_(e))),!~v(n,"g")))throw new g("`.replaceAll` does not allow non-global regexes");if(a=u(e,m))return i(a,e,k,t);if(p&&r)return y(c(k),e,t)}for(f=c(k),E=c(e),(S=s(t))||(t=c(t)),M=E.length,x=w(1,M),T=v(f,E);-1!==T;)R=S?c(t(E,T,f)):h(E,f,T,[],void 0,t),C+=b(f,A,T)+R,A=T+M,T=T+x>f.length?-1:v(f,E,T+x);return A<f.length&&(C+=b(f,A)),C}})},1995:()=>{},727:(e,t,r)=>{"use strict";var n=r(1091),i=r(5993).trim;n({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 n=r(1091),i=r(5951),a=r(3930),o=r(1907),s=r(7376),l=r(9447),d=r(9846),c=r(8828),u=r(9724),_=r(8280),h=r(6624),f=r(7374),p=r(470),m=r(160),g=r(5817),v=r(8075),y=r(2875),b=r(4443),w=r(5407),E=r(7170),S=r(3846),M=r(4284),x=r(2220),T=r(2574),R=r(8055),k=r(9251),A=r(5816),C=r(2522),F=r(8530),P=r(6499),I=r(6264),O=r(560),L=r(366),D=r(3467),U=r(4840),N=r(4932),W=r(726).forEach,B=C("hidden"),G="Symbol",j="prototype",H=N.set,V=N.getterFor(G),z=Object[j],$=i.Symbol,q=$&&$[j],Y=i.RangeError,X=i.TypeError,K=i.QObject,Z=S.f,Q=M.f,J=w.f,ee=T.f,te=o([].push),re=A("symbols"),ne=A("op-symbols"),ie=A("wks"),ae=!K||!K[j]||!K[j].findChild,oe=function(e,t,r){var n=Z(z,t);n&&delete z[t],Q(e,t,r),n&&e!==z&&Q(z,t,n)},se=l&&c((function(){return 7!==v(Q({},"a",{get:function(){return Q(this,"a",{value:7}).a}})).a}))?oe:Q,le=function(e,t){var r=re[e]=v(q);return H(r,{type:G,tag:e,description:t}),l||(r.description=t),r},de=function(e,t,r){e===z&&de(ne,t,r),h(e);var n=p(t);return h(r),u(re,n)?(r.enumerable?(u(e,B)&&e[B][n]&&(e[B][n]=!1),r=v(r,{enumerable:g(0,!1)})):(u(e,B)||Q(e,B,g(1,v(null))),e[B][n]=!0),se(e,n,r)):Q(e,n,r)},ce=function(e,t){h(e);var r=f(t),n=y(r).concat(fe(r));return W(n,(function(t){l&&!a(ue,r,t)||de(e,t,r[t])})),e},ue=function(e){var t=p(e),r=a(ee,this,t);return!(this===z&&u(re,t)&&!u(ne,t))&&(!(r||!u(this,t)||!u(re,t)||u(this,B)&&this[B][t])||r)},_e=function(e,t){var r=f(e),n=p(t);if(r!==z||!u(re,n)||u(ne,n)){var i=Z(r,n);return!i||!u(re,n)||u(r,B)&&r[B][n]||(i.enumerable=!0),i}},he=function(e){var t=J(f(e)),r=[];return W(t,(function(e){u(re,e)||u(F,e)||te(r,e)})),r},fe=function(e){var t=e===z,r=J(t?ne:f(e)),n=[];return W(r,(function(e){!u(re,e)||t&&!u(z,e)||te(n,re[e])})),n};d||(R(q=($=function(){if(_(q,this))throw new X("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 n=void 0===this?i:this;n===z&&a(r,ne,e),u(n,B)&&u(n[B],t)&&(n[B][t]=!1);var o=g(1,e);try{se(n,t,o)}catch(e){if(!(e instanceof Y))throw e;oe(n,t,o)}};return l&&ae&&se(z,t,{configurable:!0,set:r}),le(t,e)})[j],"toString",(function(){return V(this).tag})),R($,"withoutSetter",(function(e){return le(P(e),e)})),T.f=ue,M.f=de,x.f=ce,S.f=_e,b.f=w.f=he,E.f=fe,O.f=function(e){return le(I(e),e)},l&&(k(q,"description",{configurable:!0,get:function(){return V(this).description}}),s||R(z,"propertyIsEnumerable",ue,{unsafe:!0}))),n({global:!0,constructor:!0,wrap:!0,forced:!d,sham:!d},{Symbol:$}),W(y(ie),(function(e){L(e)})),n({target:G,stat:!0,forced:!d},{useSetter:function(){ae=!0},useSimple:function(){ae=!1}}),n({target:"Object",stat:!0,forced:!d,sham:!l},{create:function(e,t){return void 0===t?v(e):ce(v(e),t)},defineProperty:de,defineProperties:ce,getOwnPropertyDescriptor:_e}),n({target:"Object",stat:!0,forced:!d},{getOwnPropertyNames:he}),D(),U($,G),F[B]=!0},5084:()=>{},3313:(e,t,r)=>{"use strict";var n=r(1091),i=r(5582),a=r(9724),o=r(160),s=r(5816),l=r(4411),d=s("string-to-symbol-registry"),c=s("symbol-to-string-registry");n({target:"Symbol",stat:!0,forced:!l},{for:function(e){var t=o(e);if(a(d,t))return d[t];var r=i("Symbol")(t);return d[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 n=r(1091),i=r(9724),a=r(5594),o=r(4640),s=r(5816),l=r(4411),d=s("symbol-to-string-registry");n({target:"Symbol",stat:!0,forced:!l},{keyFor:function(e){if(!a(e))throw new TypeError(o(e)+" is not a symbol");if(i(d,e))return d[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 n=r(366),i=r(3467);n("toPrimitive"),i()},4810:(e,t,r)=>{"use strict";var n=r(5582),i=r(366),a=r(4840);i("toStringTag"),a(n("Symbol"),"Symbol")},3325:(e,t,r)=>{"use strict";r(366)("unscopables")},768:(e,t,r)=>{"use strict";var n=r(6264),i=r(4284).f,a=n("metadata"),o=Function.prototype;void 0===o[a]&&i(o,a,{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 n=r(9287),i=r(5951),a=r(4840),o=r(3742);for(var s in n)a(i[s],s),o[s]=o.Array},2222:(e,t,r)=>{"use strict";var n=r(6823);e.exports=n},4598:(e,t,r)=>{"use strict";var n=r(1042);e.exports=n},8251:(e,t,r)=>{"use strict";var n=r(1926);e.exports=n},4139:(e,t,r)=>{"use strict";var n=r(3842);r(2560),e.exports=n},7045:(e,t,r)=>{"use strict";var n=r(1730);r(2560),e.exports=n},70:(e,t,r)=>{"use strict";var n=r(1661);e.exports=n}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var a=t[n]={exports:{}};return e[n].call(a.exports,a,a.exports,r),a.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 n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},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:()=>Ao,BigLog_js:()=>Ho,Compute_Capture_Delay:()=>ko,Compute_WebSocket_Speed:()=>Ro,GetCscThreadNum:()=>ho,GetEncThreadNum:()=>fo,GetLogLevel_js:()=>mo,GetWebCodecsEncoderFallbackFlag_js:()=>ao,GetWebCodecsEncoderL1T2Flag_js:()=>io,IsSupportMultiThread:()=>ro,IsSupportMultiThreadForWebcodec:()=>co,JsMediaSDK_Log:()=>Oa,LOG_OUT:()=>vo,LimitWebCodecsDecoderTo360_js:()=>so,LimitWebCodecsEncoderTo360_js:()=>oo,MCMMonitor_Sharing_LOG:()=>Uo,Open_Sharing_WebSocket_Connect:()=>Ra,Pace_Sender:()=>xo,Recieve_Wb_Packet:()=>La,SAVE_IV:()=>Po,Send_Data_Codec:()=>go,Send_Out_Qos:()=>No,Send_Wb_Rtp_Packet:()=>Ua,Set_Share_Mode_js:()=>Vo,Sharing_Capture:()=>Co,Sharing_Decode:()=>po,SubScribeUpdateSharing:()=>Ja,Update_WebSokcet_Speed:()=>Fo,UserAgentIsTesla_js:()=>lo,UserWebCodecController_js:()=>Jo,Utf8ArrayToStr:()=>yo,checkWebCodecWhitelist_js:()=>Qo,decode_callback:()=>Qa,frame_callback_mouse_video_mode:()=>Za,frame_callback_video_mode:()=>Ka,freeWasmMemory:()=>Oo,getGraphicName:()=>uo,getNTPBaseTime:()=>es,getVendorName:()=>_o,getWasmMemory:()=>Io,hardcodecpunumber:()=>no,on_keyframe_request:()=>_s,on_keyframe_request_ex:()=>hs,on_share_encode_start:()=>ps,reportSenderNTPTime:()=>ts,responseSharingQosData:()=>$a,share_mouse_raw_data:()=>us,share_network_quality_callback:()=>Da,share_rtcp_raw_data:()=>cs,share_rtp_raw_data:()=>ds,sharing_decode_channel_change:()=>fs,sharing_qos_monitor:()=>Va,sharing_statistics_monitor:()=>za,sharing_websocket_on_close:()=>Fa,sharing_websocket_on_error:()=>Pa,sharing_websocket_on_message:()=>Ca,sharing_websocket_on_open:()=>ka,start_pace_sender:()=>To,wcl_trace_log:()=>Na});var t=r(4997),n=r(2321),i=r(2231);function a(e){return a="function"==typeof n&&"symbol"==typeof i?function(e){return typeof e}:function(e){return e&&"function"==typeof n&&e.constructor===n&&e!==n.prototype?"symbol":typeof e},a(e)}var o=r(9280);function s(e,r,n){return(r=function(e){var t=function(e){if("object"!=a(e)||!e)return e;var t=e[o];if(void 0!==t){var r=t.call(e,"string");if("object"!=a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==a(t)?t:t+""}(r))in e?t(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}const l=15,d=20,c=21,u=31,_=35,h=36,f=37,p=38,m=52,g=56,v=61,y=68,b=69,w=75,E=120,S=127,M=128,x=133,T=135,R=151,k=183,A=184,C=186,F=192,P=196,I=209,O=-14,L=-15,D="VIDEOSHARE_QOS_DATA",U="MEDIASDK_CACHE_INFO",N=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:n="",tags:i=[]}}=t;const a=n?`${i.join("|")}:${n}|----|`:"";switch(r){case"log":this._log(n,[...i,U]);break;case"warn":case"error":case"severityerror":case"directReport":e+=a}})),e&&this._directReport(e,[U]),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 n;e=this.getMessageFromErrorOrEvent(e,t),this._highFrequencyLogs[e]?this._highFrequencyLogs[e]+=1:this._highFrequencyLogs[e]=1,!((n=this._highFrequencyLogs[e])&n-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,n;this._instance&&(null===(n=(r=this._instance).directReport)||void 0===n||n.call(r,{msg:e},t))}clearHighFrequencyLogs(){this._highFrequencyLogs={}}};new Error;const W=new Map;function B(e,t="|"){return e?e.toString().replaceAll(/[,,]/g,t):""}const G="function"!=typeof importScripts;function j(e){postMessage({status:_,data:e})}function H(e,t=null){G?N.error(e,t):V(e,t)}function V(e,t=null){var r,n;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!==(n=null===(r=null==i?void 0:i.error)||void 0===r?void 0:r.stack)&&void 0!==n?n:null==i?void 0:i.stack),t=null}postMessage({status:v,errorMessage:e,errorEvent:t})}function z(e){postMessage({status:v,errorMessage:e,level:"low"})}function $(e){G?function(e,t){if(!function(e){const t=performance.now();return(!W.has(e)||t-W.get(e)>5e3)&&(W.set(e,t),!0)}(e))return;let r;try{r=B("object"==typeof t?JSON.stringify(t):t)}catch(e){r=B(t)}N.error(`NotifyUIError,event=${e},data=${r}`)}(-51,e):postMessage({status:-27,where:e})}function q(){return self.GROWABLE_HEAP_I8?self.GROWABLE_HEAP_I8():Module.HEAP8}function Y(){return self.GROWABLE_HEAP_U8?self.GROWABLE_HEAP_U8():Module.HEAPU8}function X(){return self.GROWABLE_HEAP_U32?self.GROWABLE_HEAP_U32():Module.HEAPU32}function K(){let e=this;this.promise=new Promise((function(t,r){e.reject=r,e.resolve=t}))}class Z{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15e5;this.uint8Map={},this.availableIndex=[],this.capacity=e,this.bytesPerElement=t,this.avaiableIndexMap={},this.deferedList=[];for(let r=0;r<e;r++)this.uint8Map[r]=new Uint8Array(t),this.availableIndex.push(r),this.avaiableIndexMap[r]=!0}increaseBufferSize(e){let t=this.bytesPerElement+e;this.bytesPerElement=t;for(let e=0;e<this.capacity;e++){let r=this.uint8Map[e],n=new Uint8Array(t);n.set(r,0),this.uint8Map[e]=n}}getCapacity(){return this.capacity}get(){if(this.availableIndex.length>0){let e=this.availableIndex.shift();return this.avaiableIndexMap[e]=!1,new Promise(((t,r)=>{t({index:e,uint8s:this.uint8Map[e]})}))}{let e=new K;return this.deferedList.push(e),e.promise}}getSync(){if(this.availableIndex.length>0){let e=this.availableIndex.shift();return this.avaiableIndexMap[e]=!1,{index:e,uint8s:this.uint8Map[e]}}return null}recycle(e){!0!==this.avaiableIndexMap[e]&&(this.avaiableIndexMap[e]=!0,this.availableIndex.push(e),this.deferedList.length>0)&&this.deferedList.shift().resolve(this.get())}}class Q{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),n=r>e?r:e;if(n+this.sharedBufferList.bytesPerElement>t)return Promise.reject("too big, more than maxBytesPerElement");this.sharedBufferList.increaseBufferSize(n)}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){V("Error in YuvWrap.recycle: ".concat(e))}}}const J=["","MOZ_","OP_","WEBKIT_"];function ee(e,t){for(var r=0;r<J.length;++r){var n=J[r]+t,i=e.getExtension(n);if(i)return i}}function te(e,t){e?e.send(t):V("websocket is null",new Error("message type ".concat(t[0])))}function re(e){return e&&"undefined"!=typeof atob?Uint8Array.from(atob(e),(e=>e.charCodeAt(0))):null}new Map,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 n=this.ssrcInfoMap.get(r);n&&n.lastTime&&e-n.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)}},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],n=r.timeList[r.timeList.length-1];if(n-t>=1e3){const i=Math.floor(1e3/((n-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)}};const ne=function(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;const a=n.width,o=n.height,s=a*o,l=s/4,d=t*r,c=d/4,u=t*n.y+n.x,_=t*n.y/4+n.x/2;let h;h=i?new Uint8Array(i,0,s+2*l):new Uint8Array(s+2*l);const f=e.buffer,p=e.byteOffset;if(t==n.width){const e=new Uint8Array(f,p+u,s);h.set(e,0);const t=new Uint8Array(f,p+d+_,l);h.set(t,s);const r=new Uint8Array(f,p+d+c+_,l);h.set(r,s+l)}else{let e=0,r=p+u;for(let n=0;n<o;n++){const n=new Uint8Array(f,r,a);h.set(n,e),e+=a,r+=t}let n=a/2,i=t/2,m=o/2;e=s,r=p+d+u;for(let t=0;t<m;t++){const t=new Uint8Array(f,r,n);h.set(t,e),e+=n,r+=i}e=s+l,r=p+d+c+_;for(let t=0;t<m;t++){const t=new Uint8Array(f,r,n);h.set(t,e),e+=n,r+=i}}return h},ie=1e3,ae=43,oe=44,se=45,le=0,de=3,ce={DESKTOP_SOURCE:0,UAC_SOURCE:1},ue={SHARE_REMOTE_CONTROL_UAC_MOUSE:144,SHARE_REMOTE_CONTROL_UAC_JPEG_FRAME:145},_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),he=["intel","nvidia","apple","amd","qualcomm","arm"],fe=.005,pe=class{_drawWatermarkWithShadow(e){let{ctx:t,textPos:r,opacity:n,name:i}=e;t.fillStyle="rgba(0, 0, 0, ".concat(n,")"),t.fillText(i,r.x,r.y),t.fillStyle="rgba(255, 255, 255, ".concat(n,")"),t.fillText(i,r.x+1,r.y+1)}_getTransformInfo(e){let t,{canvas:r,position:n}=e;if(1===n)t={x:r.width/2,y:0,rateRadio:0,maxWidth:r.width};else if(2===n)t={x:r.width/2,y:r.height,rateRadio:0,maxWidth:r.width};else if(4===n)t={x:0,y:r.height/2,rateRadio:Math.PI/2,maxWidth:r.height};else if(8===n)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:n,textWidth:i}=e;const a=this._getPaddingWidth({ctx:r,position:t,name:n});return 1===t?{x:-i.width/2,y:a}:2===t||4===t||8===t?{x:-i.width/2,y:-a}:{x:-i.width/2,y:r.measureText(n[0]).width/2}}_getPaddingWidth(e){let{ctx:t,position:r,name:n}=e;return[1,2,4,8].includes(r)?32:t.measureText(n[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:n,height:i,opacity:a=.15,position:o,convertToDataUrl:s=!1,transferToImage:l=!1}=e;if(!r||!n||!i)return;a=a||.15,n*=1,i*=1,t.width=n,t.height=i;let d=this._getTransformInfo({canvas:t,position:o});var c=t.getContext("2d");let u;if(c.clearRect(0,0,t.width,t.height),c.translate(d.x,d.y),c.rotate(d.rateRadio),this._setBaseLine({ctx:c,position:o}),c.lineWidth=1,c.imageSmoothingEnabled=!0,1==r.length){const e=d.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<d.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>d.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>d.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 _=this._calcTextPos({position:o,ctx:c,name:r,textWidth:u});var h;if(this._drawWatermarkWithShadow({ctx:c,name:r,opacity:a,textPos:_}),s)h=t.toDataURL();else if(l)h=t.transferToImageBitmap();else{var f=c.getImageData(0,0,c.canvas.width,c.canvas.height);h=new Uint8Array(f.data.buffer)}return c.rotate(-d.rateRadio),c.translate(-d.x,-d.y),h}Get_Repeated_WaterMarkRGBA(e){let{canvas:t,name:r,width:n,height:i,opacity:a=.15,position:o,convertToDataUrl:s=!1,transferToImage:l=!1}=e;if(!r||!n||!i)return;a=a||.15,n*=1,i*=1,t.width=n,t.height=i;const d=t.getContext("2d");d.clearRect(0,0,t.width,t.height),d.translate(n/2,i/2),d.rotate(-21*Math.PI/180),d.imageSmoothingEnabled=!0,d.font="".concat(32,"px 'Segoe UI'"),d.textBaseline="top";const c=d.measureText(r),u=.37*c.width;let _,h=0,f=-i;do{let e=h%2==0?u-n:-n;do{d.fillStyle="rgba(0, 0, 0, ".concat(a,")"),d.fillText(r,e,f),d.fillStyle="rgba(255, 255, 255, ".concat(a,")"),d.fillText(r,e+1,f+1),e+=c.width+u}while(e<n);f+=32+u,h++}while(f<i);if(s)_=t.toDataURL();else if(l)_=t.transferToImageBitmap();else{const e=d.getImageData(0,0,d.canvas.width,d.canvas.height);_=new Uint8Array(e.data.buffer)}return d.rotate(21*Math.PI/180),d.translate(-n/2,-i/2),_}};function me(){this.a=[],this.b=0,this.residue=null}me.prototype.getLength=function(){return this.a.length-this.b},me.prototype.isEmpty=function(){return 0==this.a.length},me.prototype.enqueue=function(e){this.a.push(e)},me.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},me.prototype.peek=function(){return 0<this.a.length?this.a[this.b]:void 0},me.prototype.clear=function(){this.a=[],this.b=0};const ge=me;function ve(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ye(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ve(Object(r),!0).forEach((function(t){s(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ve(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const be=8294400;function we(e,t){let r=e>>10;return t&&(r|=1<<23),r}function Ee(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 pe,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}Ee.prototype.Start_Draw=function(){return this.requestAnimation=!0,this.Start_Request_Animation_Frame()},Ee.prototype.Stop_Draw=function(){return this.requestAnimation=!1,this.lRTimeStamp=0,this.cATimeStamp=0,this.Stop_Request_Animation_Frame()},Ee.prototype.Start_Request_Animation_Frame=function(){return this.rAFID=requestAnimationFrame(this.requestF),this.rAFID},Ee.prototype.Stop_Request_Animation_Frame=function(){this.rAFID&&(cancelAnimationFrame(this.rAFID),this.rAFID=0)},Ee.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()},Ee.prototype.addRender=function(e,t,r,n,i,a){let o=this.sharingCanvasMap.get(i);if(!o&&n&&this.sharingCanvasMap.set(i,n),!(n=n||o))return!1;n!=o&&o&&n&&this.replaceCanvas(i,n);const s=i||"0";this.canvasLogicSize.has(s)||this.UpdateCanvasSize(s,n.width,n.height,!1);const l=we(e,r),d=this.renderarray.get(l);if(d){if(d.canvasId==i)return d.logicViewPort=a,d.viewport=a,d.zone=t,a&&this.updateViewPort(ye({ssrc:e,zone:t,ismainSession:r},a)),!1;this.removeRender(d.ssrc,d.zone,d.ismainSession)}n.canvasId=i;let c=this.renderManager.getRenderDisplay(n,i,10,this.Log_Error.bind(this),null);return!!c&&(this.renderarray.set(l,{ssrc:e,zone:t,ismainSession:r,display:c,logicViewPort:a,viewport:a,canvas:n,canvasId:i,renderInfo:{xratio:1,yratio:1,logic_w:0,logic_h:0,real_w:0,real_h:0},screenQueue:new ge,mouseQueue:new ge}),a&&this.updateViewPort(ye({ssrc:e,zone:t,ismainSession:r},a)),this.renderarray.size>1&&(this.sharingWidthAndHeightInfo={logicHeight:0,logicWidth:0}),!0)},Ee.prototype.getRender=function(e,t,r){if(null!=t){const r=we(e,t);return this.renderarray.get(r)}return Array.from(this.renderarray.values()).find((t=>t.ssrc>>10==e>>10))},Ee.prototype.removeRender=function(e,t,r){var n,i;const a=this.getRender(e,r);if(!a||a.zone!=t)return!1;const o=we(a.ssrc,a.ismainSession);this.renderarray.delete(o);try{for(;!a.screenQueue.isEmpty();){let e=a.screenQueue.dequeue();e.yuvdata&&e.yuvdata instanceof Q&&e.yuvdata.recycle(),e.dataptr&&Module._free(e.dataptr)}a.mouseQueue.clear()}catch(e){console.error("<<<< error",e)}null===(n=a.display)||void 0===n||null===(i=n.clearDisplay)||void 0===i||i.call(n),this.renderManager.recycleRenderDisplay(a.canvas,a.display,!1)},Ee.prototype.removeAllRender=function(){let e=[];this.renderarray.forEach(((t,r)=>{e.push(t)})),e.forEach((e=>{this.removeRender(e.ssrc,e.zone,e.ismainSession)}))},Ee.prototype.updateViewPort=function(e){const{ssrc:t,zone:r,isFromMainSession:n,rgba:i}=e,{x:a,y:o,width:s,height:l}=e,d=this.getRender(t,n);if(null!=d&&d.viewport&&(null==d?void 0:d.zone)==r){var c;const e=d.canvasId||"0",t=(null===(c=this.canvasrealSize.get(e))||void 0===c?void 0:c.ratio)||1;d.logicViewPort={x:a,y:o,width:s,height:l},d.viewport={x:Math.floor(a*t),y:Math.floor(o*t),width:Math.floor(s*t),height:Math.floor(l*t)}}},Ee.prototype._deleteOldCanvas=function(e,t){let r=[];return this.renderarray.forEach(((e,n)=>{e.canvasId==t&&r.push(e)})),r.forEach((e=>{this.removeRender(e.ssrc,e.zone,e.ismainSession)})),r},Ee.prototype.isHasRender=function(){return!!this.renderarray.size},Ee.prototype.isSharingCanvas=function(e){return!!this.sharingCanvasMap.get(e)},Ee.prototype.replaceCanvas=function(e,t){const r=this.sharingCanvasMap.get(e);if(r==t)return;let n=this._deleteOldCanvas(null,e);this.sharingCanvasMap.delete(e),this.renderManager.clearOffscreenCanvas(r),t?(this.sharingCanvasMap.set(e,t),n.forEach((r=>{const{ssrc:n,zone:i,ismainSession:a,viewport:o}=r;this.addRender(n,i,a,t,e,o)}))):(this.canvasLogicSize.delete(e),this.canvasrealSize.delete(e))},Ee.prototype.No_Bindthis_Interval=function(){let e=performance.now();this.calPacingTime(e),e-this.timestart>this.pacingtime&&(this.timestart=e,this.JsMediaSDK_SharingRender())},Ee.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)},Ee.prototype.render_monitor_log=function(e){this.jsMediaEngine?this.jsMediaEngine.Send_Render_Monitor_Log(e):postMessage({status:53,data:e})},Ee.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 n;const{display:i,screenQueue:a,mouseQueue:o,canvas:s}=e,l=e.ssrc>>10<<10;var d;if(!1===(null===(n=i.isAvaiable)||void 0===n?void 0:n.call(i)))return void(null===(d=i.restoreContext)||void 0===d||d.call(i));const c=a.dequeue(),u=o.dequeue();var _=e.viewport;if(_||(_={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,n=u.r_x*t,a=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,n,a,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 Q?(t=c.yuvdata.yuvdata,r=c.yuvdata):(t=c.yuvdata,r=null);var h=c.logic_h,f=c.logic_w,p=c.r_h,m=c.r_w;e.renderInfo.xratio=m/f,e.renderInfo.yratio=p/h;const n={top:c.r_x,left:c.r_y,height:c.r_h,width:c.r_w},a=_.width,o=_.height;this.Should_Update_Watermark(i,a,o)&&this.Update_Display_Watermark(i,a,o),i.drawNextOutputPictureFrame(c.width,c.height,n,t,null,c.yuv_limited,_),r&&r.recycle(),c.dataptr&&Module._free(c.dataptr)}else if(t&&i.isHasWholeFrame()){const e=_.width,t=_.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,_,!1)}this.UpdateSharingLogicWidthHeightInfo(l,e.canvasId,e.renderInfo,!1)})),t&&this.renderManager.renderFor(2)},Ee.prototype.setOnlyAcceptUISize=function(e){this.bOnlyAcceptUISize=e},Ee.prototype.updateOffscreenCanvasSize=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];const a=this.renderarray.size;if(void 0===e&&a>1&&(this.render_monitor_log("UASCANVASERROR:".concat(a)),this.Log_Error("Error updating OffscreenCanvas size > 1 canvasId is null")),!this.bOnlyAcceptUISize||n)try{this.UpdateCanvasSize(e,t,r,i,n),this.brefresh=!0}catch(e){this.Log_Error("Error updating OffscreenCanvas size",e)}},Ee.prototype.UpdateCanvasSize=function(e,t,r,n,i){var a;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 l=e||"0";this.canvasLogicSize.set(l,{width:t,height:r});const d="undefined"!=typeof DedicatedWorkerGlobalScope;let c={width:t,height:r,ratio:1};if(t*r>be&&d){const e=Math.sqrt(be/(t*r));c.width=Math.round(t*e),c.height=Math.round(r*e),c.ratio=e}this.canvasrealSize.set(l,c);const{width:u,height:_,ratio:h}=c;o.forEach((e=>{const t=null==e?void 0:e.logicViewPort;if(!i||!t)return;const{x:r,y:n,width:a,height:o}=t;e.viewport={x:Math.floor(r*h),y:Math.floor(n*h),width:Math.floor(a*h),height:Math.floor(o*h)}}));const f=null===(a=o[0])||void 0===a?void 0:a.canvas;var p;f&&f instanceof OffscreenCanvas&&(f.width!=u||f.height!=_)&&(f.width=u,f.height=_,null===(p=o[0].display)||void 0===p||p.resizeCanvasTo(u,_),n&&(this.brefresh=!0,this.JsMediaSDK_SharingRender()))},Ee.prototype.Change_Current_SSRC=function(e,t){this.currentshareactive=e,this.isFromMainSession=t;const r=we(e,t),n=this.renderarray.get(r);this.firstFrameForIOS=!1,n&&this.UpdateUserSharingInfo(n)},Ee.prototype.Set_WaterMark_Info=function(e){let{waterMarkCanvas:t,isCreateSharingWaterMark:r,sharingWaterMarkName:n,watermarkOpacity:i,watermarkRepeated:a,watermarkPosition:o}=e;this.Replace_WaterMark_Canvas(t),this.isCreateSharingWaterMark=r,this.sharingWaterMarkName=n,void 0!==a&&(this.isWaterMarkRepeatedEnable=!!a),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)}))},Ee.prototype.Replace_WaterMark_Canvas=function(e){this.waterMarkCanvas=e},Ee.prototype.Should_Watermark_Repeated=function(e,t){return this.isWaterMarkRepeatedEnable&&e>306&&t>202};const Se=function(e,t){if(e<640&&e){const r=640/e;e=640,t=Math.round(t*r)}return{width:e,height:t}};Ee.prototype.Update_Display_Watermark=function(e,t,r){if("function"==typeof OffscreenCanvas&&this.waterMarkCanvas instanceof OffscreenCanvas&&OffscreenCanvasRenderingContext2D&&!OffscreenCanvasRenderingContext2D.prototype.measureText)return;const n=t<512||r<288?16:this.watermarkPosition,i=this.Should_Watermark_Repeated(t,r),a=Se(t,r);t=a.width,r=a.height;const o=i?this.WaterMarkRGBA.Get_Repeated_WaterMarkRGBA({canvas:this.waterMarkCanvas,name:this.sharingWaterMarkName,width:t,height:r,opacity:this.waterMarkOpacity,position:n}):this.WaterMarkRGBA.Get_WaterMarkRGBA({canvas:this.waterMarkCanvas,name:this.sharingWaterMarkName,width:t,height:r,opacity:this.waterMarkOpacity,position:n});e.updateWatermark(t,r,o)},Ee.prototype.Should_Update_Watermark=function(e,t,r){if(!this.isCreateSharingWaterMark)return!1;let n=!1;const i=Se(t,r);i.width===e.getWatermarkWidth()&&i.height===e.getWatermarkHeight()||(n=!0);const a=this.Should_Watermark_Repeated(t,r);e.isSetWatermark()||(n=!0),a!==e.isWatermarkRepeated()&&(n=!0,e.setWatermarkRepeated(a)),this.waterMarkOpacity&&this.waterMarkOpacity!==e.getWatermarkOpacity()&&(n=!0,e.setWatermarkOpacity(this.waterMarkOpacity),this.waterMarkOpacity=e.getWatermarkOpacity());const o=t<512||r<288?16:this.watermarkPosition;return o!==e.getWatermarkPosition()&&(n=!0,e.setWatermarkPosition(o),this.watermarkPosition=e.getWatermarkPosition()),n},Ee.prototype.Put_Sharing_Data_From_Queue=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50;const r=we(e.ssrc,e.isFromMainSession);let n=this.renderarray.get(r);if(!n)return e.yuvdata instanceof Q&&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,n.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 a=n.screenQueue.getLength()-t;for(this.maxQueueLength=t;a>=0;){let e=n.screenQueue.dequeue();e.yuvdata instanceof Q&&e.yuvdata.recycle(),e.dataptr&&Module._free(e.dataptr),a--}const o=n.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(n))},Ee.prototype.UpdateUserSharingInfo=function(e){const t=e.ssrc>>10<<10,r=e.renderInfo;if(0==r.logic_w||0==r.logic_h)return;const n=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:m,logicWidth:r.logic_w,logicHeight:r.logic_h,absHeight:r.real_h,absWidth:r.real_w,nodeid:t,updateRemoteInfo:n}),n&&this.updateOffscreenCanvasSize(e.canvasId,r.logic_w,r.logic_h,!1,!0))},Ee.prototype.UpdateSharingLogicWidthHeightInfo=function(e,t,r,n){const i=1==this.renderarray.size,{logic_h:a,logic_w:o,real_w:s,real_h:l}=r;!i||this.sharingWidthAndHeightInfo.logicWidth==o&&this.sharingWidthAndHeightInfo.logicHeight==a||(this.updateOffscreenCanvasSize(t,o,a,!1,n),this.PubSub?PubSub.publish("SHARING_PARAM_INFO_FROM_SOCKET",{body:{width:o,height:a,logicWidth:o,logicHeight:a,absWidth:s,absHeight:l}}):postMessage({status:m,logicWidth:o,logicHeight:a,absWidth:s,absHeight:l,nodeid:e,updateRemoteInfo:i}),this.sharingWidthAndHeightInfo.logicWidth=o,this.sharingWidthAndHeightInfo.logicHeight=a)},Ee.prototype.Put_Mouse_Data_Into_Queue=function(e){const t=we(e.ssrc,e.isFromMainSession);let r=this.renderarray.get(t);if(r){r.mouseQueue.enqueue(e);for(var n=r.mouseQueue.getLength()-10;n>=0;)r.mouseQueue.dequeue(),n--}},Ee.prototype.Get_Current_QueueLength=function(){var e=we(this.currentshareactive,this.isFromMainSession);let t=this.renderarray.get(e);return t?t.screenQueue.getLength():0},Ee.prototype.SetcATimeStamp=function(e){this.cATimeStamp=e,this.asTime=performance.now()},Ee.prototype.Log_Error=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.globalTracingLogger?this.globalTracingLogger.error(e,t):V(e,t)},Ee.prototype.Log_DT=function(e){this.globalTracingLogger?this.globalTracingLogger.directReport(e):z(e)},Ee.prototype.setMode=function(e){this.Stop_Draw2(),this.renderMode=e},Ee.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())},Ee.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())},Ee.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)},Ee.prototype.stopRAFHealthCheck=function(){this.RAFLastTime=0,this.RAFhealthCheckInterval&&clearInterval(this.RAFhealthCheckInterval)},Ee.prototype.reDraw=function(){this.brefresh=!0,this.JsMediaSDK_SharingRender()},Ee.prototype.getUserIdVideo=function(e,t){const r=this.getRender(e,t),{canvasId:n,display:i,canvas:a,viewport:o}=r;if(!a||!i)return null;if(o){const{x:e,y:t,width:r,height:i}=o;return{canvasId:n,canvas:a,options:{x:e,y:t,width:r,height:i,displayWidth:r,displayHeight:i}}}const{width:s,height:l}=a;return{canvasId:n,canvas:a,options:{x:0,y:0,width:s,height:l,displayWidth:s,displayHeight:l}}};const Me=Ee,xe={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"},Te=((()=>{const e={};for(const t in xe)e[xe[t]]="WCL_"+t})(),e=>btoa(String.fromCharCode(...new Uint8Array(e))));class Re{constructor(e){s(this,"process",(async()=>{if(this.processList.length){const e=this.processList.splice(0,30),t=await this.encryptData(this.mergeBuffer(e));this.writeLog(Te(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(Te(t.buffer)),this.writeLog(this.EOL);const r=[e,this.iv];this.writeLog("h"),this.writeLog(this.EOL),this.writeLog(Te(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 n=0;for(const t of e)r.set(t,n),n+=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 ke{constructor(e){this.port=null,this.cache=[],this.stopCache=!1,e&&(this.logProcesser=new Re(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 n=new Uint8Array(r?t+1:t),i=q().subarray(e+0,e+t);return n.set(i,0,t),r&&(n[t]=10),n}return e.data}writeWasmLog(e,t){const r=this.getTime(),n=this.getLogData(e,t);this.logProcesser?this.logProcesser.addLogData(r,n):(this.writeLog(r),this.writeLog(n),this.writeLog("\n"))}}class Ae extends ke{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)}}function Ce(e){return e[0]<<24|e[1]<<16|e[2]<<8|e[3]}const Fe=function(e){return 21==e[4]&&0==e[13]},Pe=function(e){return 104==e[0]||16!=e[4]&&1!=e[5]?Ce(e.slice(19,23)):Ce(e.slice(15,19))},Ie=function(e){return 103==e[0]};class Oe{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 Le{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 De extends Le{constructor(e){super(e),this._count=0}onStart(){this._count=0}sample(){this._count++}getSamples(e){return[this._count]}}var Ue,Ne,We,Be,Ge,je,He=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 Oe({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};function Ve(){}function ze(e,t){let r=e;r.length<4||Ne&&Be(r,Ne,We,t)}function $e(e){}function qe(e,t){return!!Ne&&(e(Ne,t.ssrc,t.streamIndex,t.videoMode),!0)}function Ye(){return Ne}let Xe;He.prototype._capture_timeout_report=function(e,t,r,n){if(this._customer_callback){let i="".concat(t,",").concat(r,",").concat(n);this._customer_callback(e,i)}},He.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("|")),n="".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",n),this._customer_callback(this._tag+"FCLOSE",i)},He.prototype._timeout_report=function(){this._timeout_id=0,this._report()},He.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)))},He.prototype.closeSample=function(){this.close_frames++,this.close_total_frames++},He.prototype.setCloseTotalFrames=function(e){this.close_total_frames=e},He.prototype.captureTicket=function(){this._enabled&&this.capture_ticket_count++},He.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},He.prototype.ref=function(){this.ref_counts++},He.prototype.unref=function(){this.unref_counts++},He.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)},He.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 Ke=()=>Xe,Ze=function(e,t=""){if(e)return;const r=new Error(t);Ke().tracing.Log_Error(`Assert: ${t}`,r)},Qe=function(e){const t=new Error(e);Ke().tracing.Log_Error(`AssertWithFailed: ${e}`,t)};function Je(e,t){const r=Math.pow(10,t);return Math.floor(e*r)/r}function et(e,t){const r=Math.pow(10,t);return Math.ceil(e*r)/r}const tt={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},rt={NO_CONFIG:0,TAG_RENDERER_ON_CHROME:1,TAG_RENDERER_ON_SAFARI:2,TAG_RENDERER_ON_FIREFOX:4},nt=new class{constructor(){s(this,"_platformDesc",{supportGraphicsAcceleration:!1,supportVideoFrame:!1,supportMediaStreamTrackGenerator:!1,supportTransferableStream:!1,supportDrawWatermark:!1,supportVideoFrameInWorker:!1,supportVideoTrackGeneratorInWorker:!1,supportOffscreenCanvasInWorker:!1,supportImageBitmapRenderingInWorker:!1,supportTransferableTrackAcrossWork:!1,supportsRequestAnimationFrameInWork:!1}),s(this,"_inferedDesc",{supportVideoTagRenderer:!1}),s(this,"_analyzing_promise",null),s(this,"_main_analyzed",!1),s(this,"_remote_analyzed",!1),s(this,"_analyzedPromise",void 0),s(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 Ze(this._main_analyzed),this._platformDesc.supportGraphicsAcceleration}supportTransferableStream(){return Ze(this._main_analyzed),this._platformDesc.supportTransferableStream}supportDrawWatermark(){return Ze(this._main_analyzed),this._platformDesc.supportDrawWatermark}supportVideoTagRenderer(){return!!this._remote_analyzed&&this._inferedDesc.supportVideoTagRenderer}supportMediaStreamTrackGenerator(){return Ze(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 it=r(1265),at=r.n(it);const ot=new class{constructor(){s(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)||"",n=(null===(t=this._info.gpuinfo)||void 0===t?void 0:t.renderInfo)||"",i=r.toLowerCase(),a=n.toLowerCase(),o=e=>i.includes(e)||a.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=at()(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,n=this._derived.normalizedBrowser,i=!!this._info.isLowerPerformanceDevice,a=!!this._info.isSwiftShader;return e.some((e=>{var o;if("string"!=typeof e)return!1;const s=at()(e).call(e).toLowerCase();if("low-device"===s)return i;if("swift-shader"===s)return a;const[l,d,c]=s.split("/");if(!l||!d)return!1;const u=at()(l).call(l),_=at()(d).call(d),h=at()(o=c||"").call(o);return!(u&&u!==t||_&&!r.includes(_)&&!_.includes(r)||h&&h!==n)}))}},st=new class{constructor(){s(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}),s(this,"_configDone",!1),s(this,"_configDonePromise",void 0),s(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 n=e.disableVideoTagOnEdge;"true"===n&&this.setDisableVideoTagOnEdge(n)}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=ot.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;ot.isBlink()?(t=!!(e&rt.TAG_RENDERER_ON_CHROME),ot.isEdge()&&this._desc.disableVideoTagOnEdge&&(t=!1)):ot.isWebkit()?t=!!(e&rt.TAG_RENDERER_ON_SAFARI):ot.isFirefox()&&(t=!!(e&rt.TAG_RENDERER_ON_FIREFOX)),this._desc.isEnableWasmTagRenderer=t,this._tryResetDerivedConfigIfNeeded()}isEnableFallbackToTagRender(){return this._desc.isEnableFallbackToTagRender}setFallbackToTagRenderFlags(e){let t=!1;ot.isBlink()?t=!!(e&tt.FALLBACK_TO_TAG_RENDERER_ON_CHROME):ot.isWebkit()?t=!!(e&tt.FALLBACK_TO_TAG_RENDERER_ON_SAFARI):ot.isFirefox()&&(t=!!(e&tt.FALLBACK_TO_TAG_RENDERER_ON_FIREFOX)),t||ot.isLowerPerformanceDevice()&&(t=!!(e&tt.LOWER_PERFORMANCE_DEVICE)),this._desc.isEnableFallbackToTagRender=t,this._tryResetDerivedConfigIfNeeded()}canUseSsrcStream(){return!!this._configDone&&(void 0!==this._desc.canUseSsrcStream?this._desc.canUseSsrcStream:nt.supportVideoTagRenderer()?nt.supportGraphicsAcceleration()&&!ot.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("."),n=e.toString().split("."),i=r.length,a=n.length,o=Math.min(i,a);for(let e=0;e<o;e++){const t=parseInt(r[e],10),i=parseInt(n[e],10);if(t!==i)return i>t}return a>=i}_logWasmFrameOnPosMismatch(e){Ke().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,ot.isChrome()?this._desc.chromeYuvLeftTopPaddingFixVer&&this._versionGreaterThan(ot.browserVersionInfo().chrome,this._desc.chromeYuvLeftTopPaddingFixVer)&&(this._desc.shouldCropWasmFrameOnPosMismatch=!1):ot.isSafari()&&this._desc.safariYuvPaddingFixVer&&this._versionGreaterThan(ot.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){Ke().tracing.Log_DT("[vtagq] WasmFrameOnSizeMismatch: ".concat(e?"Crop":"No Crop"))}shouldCropWasmFrameOnSizeMismatchOnly(){return!!this._configDone&&(void 0!==this._desc.shouldCropWasmFrameOnSizeMismatchOnly?this._desc.shouldCropWasmFrameOnSizeMismatchOnly:this.isUseSsrcStream()&&ot.isWebkit()?(ot.isSafari()&&this._desc.safariYuvPaddingFixVer&&this._versionGreaterThan(ot.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)&&(st.shouldCropWasmFrameOnSizeMismatchOnly()||st.shouldCropWasmFrameOnPosMismatch()&&(0!=r.x||0!=r.y))}getAVStreamMode(){return this._configDone?(void 0!==this._desc.avStreamMode||(nt.supportTransferableStream()?this._desc.avStreamMode="writable-stream":nt.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}},lt={mgr:null,config:st,capabilities:nt,userAgent:ot,tracing:{add_monitor(e){j(e)},globaltracing_error(e,t=null){V(e,t)},Log_Error(e,t=null){H(e,t)},Log_DT(e){var t;t=e,G?N.directReport(t):z(t)}},graphics:{create_webgl_context_failed_monitor(e){$(e)},calculateUVCoord:(e,t,r,n)=>function(e,t,r,n){if(!e||!t||!r)return null;const i=t.width/t.height;let a=t.width,o=t.height;if(t.width>e.width||t.height>e.height){const r=e.width/t.width,n=e.height/t.height,i=Math.min(r,n);a*=i,o*=i}let s=0,l=0;e.width/e.height>i?(l=Math.floor(e.height/o)*o,s=Math.floor(l*i/a)*a,s>e.width&&(s=Math.floor(e.width/a)*a,l=Math.floor(s/i/o)*o)):(s=Math.floor(e.width/a)*a,l=Math.floor(s/i/o)*o,l>e.height&&(l=Math.floor(e.height/o)*o,s=Math.floor(l*i/a)*a));let d=0,c=0,u=0,_=0,h={x:c,y:d,w:u,h:_};0==n?(d=1-(d+(o-1)/e.height),c=t.left/e.width,_=1-t.top/e.height,u=c+a/e.width,h.x=c,h.y=1-_,h.w=u,h.h=1-d):1==n?(c=1-(d+(o-1)/e.height),u=1-t.top/e.height,d=t.left/e.width,_=c+a/e.width):2==n?(d=t.top/e.height,c=t.left/e.width,_=d+(o-1)/e.height,u=c+a/e.width):3==n&&(c=t.top/e.height,u=d+(o-1)/e.height,d=t.left/e.width,_=c+a/e.width);let f=[],p=[{x:u,y:_},{x:u,y:d},{x:c,y:d},{x:u,y:_},{x:c,y:_},{x:c,y:d}];for(let e=0;e<p.length;++e){let t={u:p[e].x,v:p[e].y};f.push(t)}let m=[];for(let e=0;e<f.length;++e){let t=f[e];m.push(t.u),m.push(t.v)}return{uvCoords:m,uvRect:h}}(e,t,r,n),calculateUVCoordsForMultiView:(e,t,r,n,i,a)=>function(e,t,r,n,i,a){let o=0,s=0,l=0,d=0,c={x:s,y:o,w:l,h:d};if(e){const e=1==i||3==i?t.height/t.width:t.width/t.height,a=n.left||0,c=n.top||0;if(n.width/n.height>e){const t=n.height*e;o=c/r.height,s=(Math.round((n.width-t)/2)+a)/r.width,d=o+(n.height-1)/r.height,l=s+t/r.width}else{const t=n.width/e;o=(Math.round((n.height-t)/2)+c)/r.height,s=a/r.width,d=o+(t-1)/r.height,l=s+n.width/r.width}0==i?(o=1-(o+(n.height-1)/r.height),s=n.left/r.width,d=1-n.top/r.height,l=s+n.width/r.width):1==i?(s=1-(o+(n.height-1)/r.height),l=1-n.top/r.height,o=n.left/r.width,d=s+n.width/r.width):2==i?(o=n.top/r.height,s=n.left/r.width,d=o+(n.height-1)/r.height,l=s+n.width/r.width):3==i&&(s=n.top/r.height,l=o+(n.height-1)/r.height,o=n.left/r.width,d=s+n.width/r.width)}else{const e=n.width/n.height;let t=n.width,a=n.height;if(n.width>r.width||n.height>r.height){const e=r.width/n.width,i=r.height/n.height,o=Math.min(e,i);t*=o,a*=o}let u=0,_=0;r.width/r.height>e?(_=Math.floor(r.height/a)*a,u=Math.floor(_*e/t)*t,u>r.width&&(u=Math.floor(r.width/t)*t,_=Math.floor(u/e/a)*a)):(u=Math.floor(r.width/t)*t,_=Math.floor(u/e/a)*a,_>r.height&&(_=Math.floor(r.height/a)*a,u=Math.floor(_*e/t)*t)),0==i?(o=1-(o+(a-1)/r.height),s=n.left/r.width,d=1-n.top/r.height,l=s+t/r.width,c.x=s,c.y=1-d,c.w=l,c.h=1-o,n.height>n.width&&(s=et(s,2),l=Je(l,2))):1==i?(s=1-(o+(a-1)/r.height),l=1-n.top/r.height,o=n.left/r.width,d=s+t/r.width):2==i?(o=n.top/r.height,s=n.left/r.width,d=o+(a-1)/r.height,l=s+t/r.width):3==i&&(s=n.top/r.height,l=o+(a-1)/r.height,o=n.left/r.width,d=s+t/r.width)}let u=[],_=[{x:l,y:d},{x:l,y:o},{x:s,y:o},{x:l,y:d},{x:s,y:d},{x:s,y:o}];for(let e=0;e<_.length;++e){let t=null;if(a){let r=-1*Math.abs(_[e].x);_[e].x=r,t={u:_[e].x+1,v:_[e].y}}else t={u:_[e].x,v:_[e].y};u.push(t)}let h=[];for(let e=0;e<u.length;++e){let t=u[e];h.push(t.u),h.push(t.v)}return{uvCoords:h,uvRect:c}}(e,t,r,n,i,a),calculateRenderRect:(e,t)=>function(e,t){let r=0,n=0,i=0,a=0;const o=t.width/t.height;return e.width/e.height>o?(n=e.height,r=n*o,i=(e.width-r)/2,a=0):(r=e.width,n=r/o,i=0,a=(e.height-n)/2),r<=e.canvas.width&&(i=(e.canvas.width-r)/2),n<=e.canvas.height&&(a=(e.canvas.height-n)/2),{x:i,y:a,width:r,height:n}}(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=""){Ze(e,t)},assertWithFailed(e){Qe(e)},abstractMethod(){!function(){const e=new Error("call abstract method!");Ke().tracing.Log_Error("AbstractMethod!",e)}()},unreachable(){!function(){const e=new Error("Unreachable code reached!");Ke().tracing.Log_Error("Unreachable!",e)}()}}},dt=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 n;const i=URL.createObjectURL(t);return Ze("function"==typeof importScripts),importScripts(i),n=globalThis.__dyn_modules__[e],n&&"function"==typeof n.init&&(n.init(lt,r),this.moduleCache.set(e,n)),n}catch(t){H(`[DynModuleMgr] loadModuleFromBlob Error: ${e}`,t)}}getModule(e){return this.moduleCache.get(e)||void 0}};function ct(e,t,r){ut(e,t),t.set(e,r)}function ut(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _t(e,t,r){return e.set(ft(e,t),r),r}function ht(e,t){return e.get(ft(e,t))}function ft(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 pt=new WeakMap,mt=new WeakMap,gt=new WeakMap,vt=new WeakMap,yt=new WeakSet;function bt(){return!0}function wt(){if(ht(gt,this)){let e={};return e.architecture=ht(gt,this).architecture,e.vendor=ht(gt,this).vendor,e}return null}async function Et(){if(!navigator.gpu)return _t(pt,this,1),!1;const e=await navigator.gpu.requestAdapter();return e?await e.requestDevice()?("function"==typeof e.requestAdapterInfo?(_t(gt,this,await e.requestAdapterInfo()),ht(gt,this)&&console.log("adapter info: ".concat(ht(gt,this).architecture,", ").concat(ht(gt,this).vendor))):"info"in e&&_t(gt,this,e.info),_t(pt,this,_e),!0):(_t(pt,this,3),!1):(_t(pt,this,2),!1)}function St(e){if(!e)return!1;const t=e.vendor;return-1!==he.indexOf(t)}function Mt(e,t,r){return xt.produce(e,t,r)}class xt{static produce(e,t,r){let n=null;return 2===e&&(n=dt.getModule("webgpu_renderer_dynmod").exports.createWebGPURenderer(t,r)),n}}const Tt=class{constructor(){var e;ut(this,e=yt),e.add(this),ct(this,pt,_e),ct(this,mt,1),ct(this,gt,null),ct(this,vt,new Map)}async evaluate(e){if(_t(mt,this,1),!ft(yt,this,bt).call(this))return ht(mt,this);if(!e.allowedOnTargetPlatforms)return ht(mt,this);if(!e.allowedOnTargetBrowsers)return ht(mt,this);if(!await ft(yt,this,Et).call(this))return ht(mt,this);const t=ft(yt,this,wt).call(this);if(!ft(yt,this,St).call(this,t))return ht(mt,this);let r=new OffscreenCanvas(1,1);return r.getContext("webgpu")?(r=null,_t(mt,this,2),ht(mt,this)):(r=null,ht(mt,this))}acquireRenderer(e,t){let r=null;return arguments.length>2&&void 0!==arguments[2]&&arguments[2]&&ht(vt,this).clear(),ht(vt,this).has(e)&&(r=ht(vt,this).get(e),r&&(e&&(r.setCanvas(e),r.initialize(e)),t&&r.setDevice(t.acquireGPUDevice()))),null==r&&(r=ft(yt,this,Mt).call(this,ht(mt,this),e,t),r&&ht(vt,this).set(e,r)),r}rendererReinitialize(){if(ht(vt,this))for(const[e,t]of ht(vt,this))t&&t.initialize(e)}rendererUnconfigureGPUContext(){if(ht(vt,this))for(const[e,t]of ht(vt,this))t&&t.unconfigureGPUContext()}getRendererType(){return ht(mt,this)}loadRenderModuleFromBlob(e,t){t&&(2===e?dt.loadModuleFromBlob("webgpu_renderer_dynmod",t):Qe("Invalid render module for ".concat(e)))}setRendererType(e){_t(mt,this,e)}isWebGPURendererType(){return 2===ht(mt,this)}isWebGLRendererType(){return 1===ht(mt,this)}isWebGL2RendererType(){return 3===ht(mt,this)}cleanup(){for(const[e,t]of ht(vt,this))t&&t.cleanup();ht(vt,this).clear()}};function Rt(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 kt=new WeakSet;function At(e){e.forEach((e=>{e.consumePendingGPUEvents()}))}function Ct(e){return!e||0==e.length||-1==e.findIndex((e=>!!e&&(!!e.getTextureLayerByZIndex(0)&&e.isRenderingStateReady())))}const Ft=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=kt),t.add(e)}render(e,t){e?e.isGPUDeviceReady()?t&&0!=t.length?(Rt(kt,this,At).call(this,t),Rt(kt,this,Ct).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 Pt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function It(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Pt(Object(r),!0).forEach((function(t){s(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}let Ot=new Map,Lt=[];function Dt(e){e.preventDefault()}function Ut(e,t,r,n,i,a,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,Ut.prototype.ROTATION_CLOCK0=0,Ut.prototype.ROTATION_CLOCK90=1,Ut.prototype.ROTATION_CLOCK180=2,Ut.prototype.ROTATION_CLOCK270=3,this.webGLResources=a,a||(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(a);var l=new ArrayBuffer(4);this.dummpyCursor=new Uint8Array(l),this.dummpyWaterMark=new Uint8Array(l),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=-1,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=fe,this.viewport_rect=null}Ut.prototype.isLocalDisplay=function(){return 0==this.textureindex},Ut.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}},Ut.prototype.webGLContextLostSimulate=function(){const e=ee(this.contextGL,"WEBGL_lose_context");null==e||e.loseContext()},Ut.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,$("WebGLRestoreTimeout")),this.canvasElement.restoreTimeoutId=0}),1500),null===(t=this.canvasElement)||void 0===t||t.loseContextExtension.restoreContext())}catch(e){H("webgl restoreContext exception",e)}},Ut.prototype.webgGLContextLostCallback=function(e){z("webglcontextlost event: canvas listener size=".concat(Lt.length,", canvas id: ").concat(this.canvasID,", , ids:").concat(Lt.join())),e.preventDefault(),this.contextGL.glInitSucceed=0,this.contextOptions&&this.contextOptions.webglcontextlostCallback&&this.contextOptions.webglcontextlostCallback(e,this.contextOptions.params)},Ut.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=Lt.indexOf(this.canvasID);Lt.splice(r,1),Ot.delete(e)}},Ut.prototype.webGLContextRestoredCallback=function(e){var t,r;z("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)},Ut.prototype.webGLContextLostProtect=function(){this.canvasElement&&!this.canvasElement.loseContextExtension&&(this.canvasElement.loseContextExtension=ee(this.contextGL,"WEBGL_lose_context"));let e=this.canvasElement,t=Ot.get(e);t&&this.removeEventListener(e,t),Ot.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===Lt.indexOf(this.canvasID)&&(Lt.push(this.canvasID),Lt.length>4&&z("webglcanvas listener size=".concat(Lt.length,", ids:").concat(Lt.join())))},Ut.prototype.isWebGL=function(){return this.contextGL},Ut.prototype.isAvaiable=function(){return this.contextGL&&!this.contextGL.isContextLost()&&this.contextGL.glInitSucceed},Ut.prototype.initContextGL=function(){for(var e,t,r,n=this.canvasElement,i=null,a=["webgl","experimental-webgl","moz-webgl","webkit-3d"],o=0;!i&&o<a.length;){var s=a[o];try{if(Ke().config.isEnableCanvasCtxOptionsOpt()){let e={depth:!1,stencil:!1,antialias:!1,alpha:this.isEnableCanvasAlphaChannel};if(this.contextOptions){let t=It(It({},this.contextOptions),e);i=n.getContext(s,t)}else i=n.getContext(s,e)}else i=this.contextOptions?n.getContext(s,this.contextOptions):n.getContext(s)}catch(e){i=null}i&&"function"==typeof i.getParameter||(i=null),++o}if(this.contextGL=i,!i||i.isContextLost())return H("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 $("InitWebGLFail");i.glInitSucceed=0},Ut.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()||z("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()||z("webgl Fragment shader failed to compile: "+e.getShaderInfoLog(r));var n=e.createProgram();e.attachShader(n,t),e.attachShader(n,r),e.linkProgram(n),e.getProgramParameter(n,e.LINK_STATUS)||e.isContextLost()||z("webgl Program failed to compile: "+e.getProgramInfoLog(n)),e.useProgram(n),this.shaderProgram=n},Ut.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 n=e.getAttribLocation(t,"vertexPos");e.enableVertexAttribArray(n),e.vertexAttribPointer(n,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 a=e.getAttribLocation(t,"texturePos");if(e.enableVertexAttribArray(a),e.vertexAttribPointer(a,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},Ut.prototype.initTextures=function(e){var t=this.contextGL,r=this.shaderProgram;t.pixelStorei(t.UNPACK_ALIGNMENT,1);var n=this.initTexture();this.yTextureRef=n,this.oyTextureRef=n;var i=this.initTexture();this.uTextureRef=i,this.ouTextureRef=i;var a=this.initTexture();this.vTextureRef=a,this.ovTextureRef=a,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(),l=t.getUniformLocation(r,"cursorSampler");if(t.uniform1i(l,4),this.cursorTextureRef=s,this.cursorSamplerRef=l,this.cursorInfoRef=t.getUniformLocation(r,"cursorInfo"),this.initmask){t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,1);var d=this.initTexture(),c=t.getUniformLocation(r,"maskSampler");t.uniform1i(c,4),this.maskTextureRef=d}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")},Ut.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 n=t.getUniformLocation(r,"uSampler");t.uniform1i(n,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 n=t.getUniformLocation(r,"ySampler");t.uniform1i(n,0);let i=t.getUniformLocation(r,"uSampler");t.uniform1i(i,0);let a=t.getUniformLocation(r,"vSampler");t.uniform1i(a,0)}else if(2==e){let e=t.getUniformLocation(r,"ySampler");t.uniform1i(e,0);let n=t.getUniformLocation(r,"uSampler");t.uniform1i(n,1);let i=t.getUniformLocation(r,"vSampler");t.uniform1i(i,0)}let n=t.getUniformLocation(r,"previewVideoSampler");t.uniform1i(n,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 a=t.getUniformLocation(r,"cursorSampler");t.uniform1i(a,0);let o=t.getUniformLocation(this.shaderProgram,"waterMarkSampler");t.uniform1i(o,5)},Ut.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},Ut.prototype.clearDisplay=function(){var e=this.contextGL;e&&(e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT))},Ut.prototype.cleanup=function(){let e=this.canvasElement,t=Ot.get(e);if(t&&this.removeEventListener(e,t),e.defaultContextLostHandler||(e.defaultContextLostHandler=Dt,e.addEventListener("webglcontextlost",Dt,{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}},Ut.prototype.updataVertexInfoForSharing=function(){const[e,t,r,n]=this.vertexPos,i=this.webglVertexPos[0],a=this.webglVertexPos[3];if(e!=i||a!=n){this.webglVertexPos[0]=e,this.webglVertexPos[1]=t,this.webglVertexPos[2]=r,this.webglVertexPos[3]=n;var o=new Float32Array([r,t,e,t,r,n,e,n,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)}},Ut.prototype.updateTextureInfoForSharing=function(){const[e,t,r,n]=this.texturePos,i=this.webglTexturePos[0],a=this.webglTexturePos[3];if(e!=i||a!=n){this.webglTexturePos[0]=e,this.webglTexturePos[1]=t,this.webglTexturePos[2]=r,this.webglTexturePos[3]=n;var o=new Float32Array([r,t,e,t,r,n,e,n,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)}},Ut.prototype.updateVertexInfoForMultiView=function(e,t,r,n,i){var a,o,s,l,d=this.contextGL;if(this.isUseFillMode({width:r,height:n,rotation:i}))a=0,o=0,s=1,l=1;else{var c=i==this.ROTATION_CLOCK90||i==this.ROTATION_CLOCK270?n:r,u=i==this.ROTATION_CLOCK90||i==this.ROTATION_CLOCK270?r:n,_=c/u*t;_>e?(a=0,s=1,l=1-(o=(t-u/c*e)/2/t)):(o=0,l=1,s=1-(a=(e-_)/2/e))}a=2*a-1,s=2*s-1,o=1-2*o,l=1-2*l;var h=new Float32Array([s,o,a,o,s,l,a,l,1,1,-1,1,1,-1,-1,-1]);this.viewPostion=h,d.bindBuffer(d.ARRAY_BUFFER,this.vertexPosBuffer),d.bufferData(d.ARRAY_BUFFER,h,d.DYNAMIC_DRAW)},Ut.prototype.getViewPosition=function(){let e=[0,0,1,1];if(!this.viewPostion)return e;const t=this.viewPostion[0],r=this.viewPostion[1],n=this.viewPostion[2],i=this.viewPostion[5];return e[0]=(1-r)/2,e[1]=(1+n)/2,e[2]=(1-i)/2,e[3]=(1+t)/2,e},Ut.prototype.updateTextureInfoForMultiView=function(e,t,r,n,i,a,o){var s,l,d,c,u=this.contextGL;if(this.isUseFillMode({width:r.width,height:r.height,rotation:n})){const i=n==this.ROTATION_CLOCK90||n==this.ROTATION_CLOCK270?o/a:a/o,u=r.left||0,_=r.top||0;if(r.width/r.height>i){const n=r.height*i;s=_/t,l=(Math.round((r.width-n)/2)+u)/e,d=(_+r.height)/t,c=l+n/e}else{const n=r.width/i;d=(s=(Math.round((r.height-n)/2)+_)/t)+n/t,c=(l=u/e)+r.width/e}}else s=et(r.top/t,2),l=et(r.left/e,2),d=Je((r.top+r.height)/t,2),c=Je((r.width+r.left)/e,2);var _=[l,s,c,s,c,d,l,d];n==this.ROTATION_CLOCK90&&(_.unshift(_[6],_[7]),_=_.slice(0,8)),n==this.ROTATION_CLOCK180&&(_.unshift(_[4],_[5],_[6],_[7]),_=_.slice(0,8)),n==this.ROTATION_CLOCK270&&(_.push(_[0],_[1]),_=_.slice(2,10));var h=_[0],f=_[1];if(_[0]=_[2],_[1]=_[3],_[2]=h,_[3]=f,i)if(n==this.ROTATION_CLOCK90||n==this.ROTATION_CLOCK270){let e=_[1];_[1]=_[3],_[3]=e,e=_[5],_[5]=_[7],_[7]=e}else _[0]=1-_[0],_[2]=1-_[2],_[4]=1-_[4],_[6]=1-_[6];var p=new Float32Array([..._,1,0,0,0,1,1,0,1]);u.bindBuffer(u.ARRAY_BUFFER,this.texturePosBuffer),u.bufferData(u.ARRAY_BUFFER,p,u.DYNAMIC_DRAW)},Ut.prototype.drawNextOutputPictureFrame=function(e,t,r,n,i){let a=!(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 l=this.contextGL,d=this.yTextureRef,c=this.uTextureRef,u=this.vTextureRef;l.enable(l.BLEND),l.blendFunc(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA),i=i||this.ROTATION_CLOCK0;var _=(r=r||{top:0,left:0,width:e,height:t}).width!=this.croppingParams.width||r.height!=this.croppingParams.height,h=(r.top!=this.croppingParams.top||(r.left,this.croppingParams.left),o.width!=this.viewWidth||o.height!=this.viewHeight),f=(e!=this.textureWidth||this.textureHeight,i!=this.picRotation);(_||h||f)&&function(e,t,r,n,i){let a=i.width,o=i.height;var s,l,d,c,u=n==e.ROTATION_CLOCK90||n==e.ROTATION_CLOCK270?r:t,_=n==e.ROTATION_CLOCK90||n==e.ROTATION_CLOCK270?t:r,h=u/_*o;h>a?(s=0,d=1,c=1-(l=(o-_/u*a)/2/o)):(l=0,c=1,d=1-(s=(a-h)/2/a)),s=parseFloat((2*s-1).toFixed(3)),d=parseFloat((2*d-1).toFixed(3)),l=parseFloat((1-2*l).toFixed(3)),c=parseFloat((1-2*c).toFixed(3)),e.vertexPos=[s,l,d,c]}(this,r.width,r.height,i,o),this.updataVertexInfoForSharing(),function(e,t,r,n,i){var a=n.top/r,o=n.left/t,s=(n.top+n.height)/r,l=(n.left+n.width)/t,d=[o,a,l,a,l,s,o,s];i==e.ROTATION_CLOCK90&&(d.unshift(d[6],d[7]),d=d.slice(0,8)),i==e.ROTATION_CLOCK180&&(d.unshift(d[4],d[5],d[6],d[7]),d=d.slice(0,8)),i==e.ROTATION_CLOCK270&&(d.push(d[0],d[1]),d=d.slice(2));var c=d[0],u=d[1];d[0]=d[2],d[1]=d[3],d[2]=c,d[3]=u;var _=new Float32Array([...d,1,0,0,0,1,1,0,1]),h=e.contextGL;h.bindBuffer(h.ARRAY_BUFFER,e.texturePosBuffer),h.bufferData(h.ARRAY_BUFFER,_,h.DYNAMIC_DRAW)}(this,e,t,r,i);let p=a?0:1;p!=this.colorRange&&(l.uniform1i(this.colorRangeRef,p),this.colorRange=p),l.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),l.uniform4fv(this.ul_viewport_rect,this.viewport_rect),l.uniform1i(this.onlyRGBARef,0),l.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=n,g=e*t;if(l.activeTexture(l.TEXTURE0),l.bindTexture(l.TEXTURE_2D,d),s){var v=m.subarray(0,g);l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE,e,t,0,l.LUMINANCE,l.UNSIGNED_BYTE,v)}var y=e/2*t/2;if(l.activeTexture(l.TEXTURE1),l.bindTexture(l.TEXTURE_2D,c),s){var b=m.subarray(g,g+y);l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE,e/2,t/2,0,l.LUMINANCE,l.UNSIGNED_BYTE,b)}var w=y;if(l.activeTexture(l.TEXTURE2),l.bindTexture(l.TEXTURE_2D,u),s){var E=m.subarray(g+y,g+y+w);l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE,e/2,t/2,0,l.LUMINANCE,l.UNSIGNED_BYTE,E)}l.activeTexture(l.TEXTURE0+4),l.bindTexture(l.TEXTURE_2D,this.cursorTextureRef),this.hasCursor?l.uniform1i(this.cursorFlagRef,1):s&&l.texImage2D(l.TEXTURE_2D,0,l.RGBA,1,1,0,l.RGBA,l.UNSIGNED_BYTE,this.dummpyCursor),l.uniform4f(this.cursorInfoRef,this.cx,this.cy,this.cw,this.ch),this.render(),this.hasWholeFrame=1},Ut.prototype.updateCursor=function(e,t,r,n){if(this.isAvaiable()){var i=this.contextGL;e<=0||t<=0||!r||r.length!=e*t*4||n!=this.lastcursorSyncId&&(this.lastcursorSyncId=n,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)}},Ut.prototype.updateCursorPosInfo=function(e,t,r,n,i){if(e&&this.hasCursor){let e=t/this.croppingParams.width,a=r/this.croppingParams.height,o=n/this.croppingParams.width,s=i/this.croppingParams.height;this.cx=e,this.cy=a,this.cw=o,this.ch=s}else this.cx=0,this.cy=0,this.cw=0,this.ch=0},Ut.prototype.isHasWholeFrame=function(){return this.hasWholeFrame},Ut.prototype.updateWatermark=function(e,t,r){if(this.isAvaiable()){var n=this.contextGL;e<=0||t<=0||!r||r.length!=e*t*4||(this.hasWaterMark=1,this.watermarkWidth=e,this.watermarkHeight=t,n.activeTexture(n.TEXTURE0+5),n.bindTexture(n.TEXTURE_2D,this.waterMarkTextureRef),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,this.watermarkWidth,this.watermarkHeight,0,n.RGBA,n.UNSIGNED_BYTE,r))}},Ut.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))}},Ut.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)}},Ut.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=fe,this.viewport_rect=null},Ut.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()}},Ut.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})},Ut.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)}},Ut.prototype.isRGBAMode=function(e){return-1!==[le,de].indexOf(e)},Ut.prototype.updateRemoteVideoTextures=function(e,t,r,n,i){let a=!(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 l=this.contextGL,d=this.yTextureRef,c=this.uTextureRef,u=this.vTextureRef;l.enable(l.BLEND),l.blendFunc(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA);const _=this.isRGBAMode(this.videoMode);if(e<=0||t<=0||!n||!n.length||n.length!=e*t*3/2&&!_||r&&(r.top<0||r.left<0||r.left+r.width>e||r.top+r.height>t))return!1;let h=a?0:1;if(this.colorRange=h,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(l.bindTexture(l.TEXTURE_2D,d),_)return void l.texImage2D(l.TEXTURE_2D,0,l.RGBA,e,t,0,l.RGBA,l.UNSIGNED_BYTE,n);var f=n,p=e*t,m=f.subarray(0,p);l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE,e,t,0,l.LUMINANCE,l.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=f.subarray(p,p+g);if(l.bindTexture(l.TEXTURE_2D,c),v){l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE,e/2,t/2,0,l.LUMINANCE,l.UNSIGNED_BYTE,y);var b=f.subarray(p+g,p+g+v);l.bindTexture(l.TEXTURE_2D,u),l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE,e/2,t/2,0,l.LUMINANCE,l.UNSIGNED_BYTE,b)}else l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE_ALPHA,e/2,t/2,0,l.LUMINANCE_ALPHA,l.UNSIGNED_BYTE,y);return!0},Ut.prototype.updateRemoteVideoTexturesImageBitmap=function(e,t,r,n,i){let a=!(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,n),!a)return;o.bindTexture(o.TEXTURE_2D,this.yTextureRef);const s=o.RGBA,l=o.RGBA,d=o.UNSIGNED_BYTE;o.texImage2D(o.TEXTURE_2D,0,s,l,d,r)},Ut.prototype.updateSelfMaskImage=function(e,t,r){if(!(e<=0||t<=0)&&r&&r.length==e*t*4&&this.isAvaiable()){var n=this.contextGL;n.bindTexture(n.TEXTURE_2D,this.maskTextureRef),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,e,t,0,n.RGBA,n.UNSIGNED_BYTE,r)}},Ut.prototype.VideoFlip=function(){if(this.isAvaiable()){var e=this.contextGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,1)}},Ut.prototype.drawRemoteVideo=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.isAvaiable())return;var r=this.contextGL;let n=this.isRGBAMode(this.videoMode)?1:0;r.uniform1i(this.colorRangeRef,this.colorRange),this.setUniformFlag(n,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()},Ut.prototype.readPixelsSyncRequest=function(e,t,r,n){if(this.isAvaiable()){var i,a=this.contextGL;return this.destination&&this.destination.length==r*n*4||(this.destination=new Uint8Array(r*n*4)),i=this.destination,a.flush(),a.readPixels(e,t,r,n,a.RGBA,a.UNSIGNED_BYTE,i),i}},Ut.prototype.updateSelfVideoTextures=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=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=a,Object.assign(this.croppingParams,n),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))}},Ut.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 n=this.contextGL;this.setUniformFlag(1,this.hasCursor,this.videoMode),this.updateTextureInfoForMultiView(this.textureWidth,this.textureHeight,this.croppingParams,this.rotation,r,e.width,e.height),n.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),n.uniform4fv(this.ul_viewport_rect,this.viewport_rect),t?(n.enable(n.BLEND),n.blendFunc(n.ZERO,n.ZERO),this.updateVertexInfoForMultiView(e.width,e.height,e.width,e.height,this.ROTATION_CLOCK0)):(n.enable(n.BLEND),n.blendFunc(n.SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA),this.updateVertexInfoForMultiView(e.width,e.height,this.croppingParams.width,this.croppingParams.height,this.rotation)),this.BindTextures(le),this.render()}},Ut.prototype.isSetWatermark=function(){return this.hasWaterMark},Ut.prototype.setWatermarkFlag=function(e){this.hasWaterMark=e,e||(this.setWatermarkRepeated(!1),this.setWatermarkOpacity(),this.setWatermarkPosition(16))},Ut.prototype.setUniformFlag=function(e,t,r){if(this.isAvaiable()){var n=this.contextGL;n.uniform1i(this.onlyRGBARef,e),n.uniform1i(this.bgraModeRef,e&&r===de?1:0),n.uniform1i(this.cursorFlagRef,t),e||n.uniform1i(this.yuvmodeRef,r)}},Ut.prototype.setVideoMode=function(e){this.videoMode=e},Ut.prototype.getVideoMode=function(e){return this.videoMode},Ut.prototype.setWatermarkRepeated=function(e){this.watermarkRepeated=e},Ut.prototype.isWatermarkRepeated=function(){return!!this.watermarkRepeated},Ut.prototype.setWatermarkOpacity=function(e){this.watermarkOpacity=e||.15},Ut.prototype.getWatermarkOpacity=function(){return this.watermarkOpacity},Ut.prototype.setWatermarkPosition=function(e){this.watermarkPosition=e||16},Ut.prototype.getWatermarkPosition=function(){return this.watermarkPosition},Ut.prototype.setMultiView=function(e){return this.isMultiView=e},Ut.prototype.getRepeatedWatermarkUniformValue=function(){return this.isMultiView?30:7},Ut.prototype.getRepeatedWatermarkTextureValue=function(e){return this.isMultiView?e.TEXTURE30:e.TEXTURE7},Ut.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},Ut.prototype.getFillMode=function(){return this.fillMode},Ut.prototype.getFillModeForResolution=function(){return this.fillModeForResolution},Ut.prototype.getTextureIndex=function(){return this.textureindex},Ut.prototype.getTextureWidth=function(){return this.textureWidth},Ut.prototype.getTextureHeight=function(){return this.textureHeight},Ut.prototype.getRotation=function(){return this.rotation},Ut.prototype.getCroppingParams=function(){return this.croppingParams},Ut.prototype.getIndex=function(){return this.textureindex},Ut.prototype.getWatermarkWidth=function(){return this.watermarkWidth},Ut.prototype.getWatermarkHeight=function(){return this.watermarkHeight},Ut.prototype.getWatermarkOpacity=function(){return this.watermarkOpacity},Ut.prototype.getAttachedCanvas=function(){return this.canvasElement},Ut.prototype.getCanvasId=function(){return this.canvasID},Ut.prototype.resizeCanvasTo=function(e,t){this.contextGL.canvas.width=e,this.contextGL.canvas.height=t},Ut.prototype.isUseFillMode=function(e){let{width:t,height:r,rotation:n}=e;if(!this.fillMode)return!1;if(!this.fillModeForResolution)return!0;if(!t||!r)return!1;const i=n===this.ROTATION_CLOCK90||n==this.ROTATION_CLOCK270?r/t:t/r;return(Array.isArray(this.fillModeForResolution)?this.fillModeForResolution:[this.fillModeForResolution]).some((e=>Math.abs(i-e)<.01))},Ut.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},Ut.prototype.setAntialiasWidth=function(e){(e<=0||e>=1)&&(e=fe),this.aa_width=e};const Nt=Ut;class Wt{getVideoRenderDisplay(e,t,r,n,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 Bt(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 Gt(e,t){return e.get(Ht(e,t))}function jt(e,t,r){return e.set(Ht(e,t),r),r}function Ht(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 Vt=new WeakMap,zt=new WeakMap;class $t extends Wt{constructor(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];super(),Bt(this,Vt,new Map),Bt(this,zt,!1),jt(zt,this,e)}setCanvasAlphaChannelEnability(e){jt(zt,this,e)}createVideoRenderDisplay(e,t,r){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i=null,a=null,o=null,s=!1;return n&&(i=n.forceNoGL,a=n.contextOptions,o=n.webGLResources,s=n.initMask),new Nt(e,t,r,i,a,o,s,Gt(zt,this))}getVideoRenderDisplay(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,a=Gt(Vt,this).get(e);if(!a){let n=[];a=[n,[]],Gt(Vt,this).set(e,a);let o=new Nt(e,t,0,void 0,void 0,void 0,void 0,Gt(zt,this));o.setMultiView(!0),i&&i.set(e,o);let s=1;for(;s<=r;s++){const r=new Nt(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,Gt(zt,this));r.setMultiView(!0),n.push(r)}}let o,s=Gt(Vt,this).get(e),l=s[0],d=s[1];if(s&&l[0]&&(o=l.pop(),d.push(o)),!o){const e=s?"".concat(s.length):"undefined",t=l?"".concat(l.length):"undefined";n("No Display obtained from VideoRender.Get_Display. canvasRenderArray:".concat(e," unusedRenderArray:").concat(t))}return o}onWebglContextLostForMulti(e,t){const{canvas:r}=t;let n=Gt(Vt,this).get(r);var[i,a,o]=n;[...i,...a].forEach((e=>e.clear()))}onRestoredFromLostForMulti(e,t){if(!t)return;const{canvas:r}=t;let n=Gt(Vt,this).get(r);var[i,a,o]=n;const s=[...i,...a];let l=s.find((e=>e.isLocalDisplay()));l.webglVertexPos=[0,0,0,0],l.webglTexturePos=[0,0,0,0],o.args={program:l.shaderProgram,contextgl:l.contextGL,vBuffer:l.vertexPosBuffer,tBuffer:l.texturePosBuffer,webglVertexPos:l.webglVertexPos,webglTexturePos:l.webglTexturePos},s.forEach((e=>{e!=l&&e.reinit(o.args)}))}getRenderDisplay(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=Gt(Vt,this).get(e);if(!n){let i=[],a={canvasId:t,size:1,args:{}};n=[i,[],a],Gt(Vt,this).set(e,n);const o={webglcontextlostCallback:this.onWebglContextLostForMulti.bind(this),webglcontextrestoredCallback:this.onRestoredFromLostForMulti.bind(this),params:{canvas:e,rendercanvasID:t}};let s=new Nt(e,t,0,void 0,o,void 0,void 0,Gt(zt,this));r&&r.set(e,s),i.push(s),a.args={program:s.shaderProgram,contextgl:s.contextGL,vBuffer:s.vertexPosBuffer,tBuffer:s.texturePosBuffer,webglVertexPos:s.webglVertexPos,webglTexturePos:s.webglTexturePos}}if(!n[0].length){const r=new Nt(e,t,n[2].size,void 0,void 0,n[2].args,void 0,Gt(zt,this));n[2].size++,n[0].push(r)}let i=n[0].pop();return n[1].push(i),i}recycleRenderDisplay(e,t,r){t.setWatermarkFlag(0),t.setVideoMode(-1),t.clear(r);let n=Gt(Vt,this).get(e);if(n){let e=n[0],r=n[1];r&&r.some((function(e,n){if(e===t)return r.splice(n,1),!0})),e.push(t)}}onRestoredFromContextLost(e,t,r,n,i){let a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,o=Gt(Vt,this).get(r);(!o||o.length<2)&&i("canvasRenderArray:".concat(o,", length:").concat(null==o?void 0:o.length));let s=a.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&&(Gt(Vt,this).delete(r),Gt(Vt,this).set(t,o),a&&(a.delete(r),a.set(t,s))),null}}getRenderDisplayMap(){return Gt(Vt,this)}cleanup(e,t){var r;null==t||null===(r=t.cleanup)||void 0===r||r.call(t,null);for(const[e,t]of Gt(Vt,this)){const e=t[0],r=t[1];for(const t of e)t.cleanup();for(const e of r)e.cleanup()}jt(Vt,this,new Map)}cleanupByCanvas(e){if(Gt(Vt,this).get(e)){let t=Gt(Vt,this).get(e);if(t){let r=t[0],n=t[1];n.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=[],n=[],Gt(Vt,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 qt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Yt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qt(Object(r),!0).forEach((function(t){s(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}let Xt=new Map,Kt=[];function Zt(e){e.preventDefault()}function Qt(e,t,r,n,i,a,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,Qt.prototype.ROTATION_CLOCK0=0,Qt.prototype.ROTATION_CLOCK90=1,Qt.prototype.ROTATION_CLOCK180=2,Qt.prototype.ROTATION_CLOCK270=3,this.webGLResources=a,a||(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(a);var l=new ArrayBuffer(4);this.dummpyCursor=new Uint8Array(l),this.dummpyWaterMark=new Uint8Array(l),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=-1,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=fe,this.uv_rect=null}Qt.prototype.isLocalDisplay=function(){return 0==this.textureindex},Qt.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}},Qt.prototype.webGLContextLostSimulate=function(){let e="undefined"==typeof window?self:window;e.webGLEXTSimulate=e.webGLEXTSimulate||[],e.webGLEXTSimulate.push(ee(this.contextGL,"WEBGL_lose_context"))},Qt.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,$("WebGL2RestoreTimeout")),this.canvasElement.restoreTimeoutId=0}),1500),this.canvasElement.loseContextExtension.restoreContext())}catch(e){H("webgl restoreContext exception2",e)}},Qt.prototype.webgGLContextLostCallback=function(e){z("webglcontextlost2 event: canvas listener size=".concat(Kt.length,", canvas id: ").concat(this.canvasID,", , ids:").concat(Kt.join())),e.preventDefault(),this.contextGL.glInitSucceed=0,this.contextOptions&&this.contextOptions.webglcontextlostCallback&&this.contextOptions.webglcontextlostCallback(e,this.contextOptions.params)},Qt.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=Kt.indexOf(this.canvasID);Kt.splice(r,1),Xt.delete(e)}},Qt.prototype.webGLContextRestoredCallback=function(e){var t,r;z("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)},Qt.prototype.webGLContextLostProtect=function(){this.canvasElement&&!this.canvasElement.loseContextExtension&&(this.canvasElement.loseContextExtension=ee(this.contextGL,"WEBGL_lose_context"));let e=this.canvasElement,t=Xt.get(e);t&&this.removeEventListener(e,t),Xt.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===Kt.indexOf(this.canvasID)&&(Kt.push(this.canvasID),Kt.length>4&&z("webgl2canvas listener size=".concat(Kt.length,", ids:").concat(Kt.join())))},Qt.prototype.isWebGL2=function(){return this.contextGL},Qt.prototype.isAvaiable=function(){return this.contextGL&&!this.contextGL.isContextLost()&&this.contextGL.glInitSucceed},Qt.prototype.initContextGL=function(){for(var e,t,r,n=this.canvasElement,i=null,a=["webgl2"],o=0;!i&&o<a.length;){var s=a[o];try{if(Ke().config.isEnableCanvasCtxOptionsOpt()){let e={depth:!1,stencil:!1,antialias:!1,alpha:this.isEnableCanvasAlphaChannel};if(this.contextOptions){let t=Yt(Yt({},this.contextOptions),e);i=n.getContext(s,t)}else i=n.getContext(s,e)}else i=this.contextOptions?n.getContext(s,this.contextOptions):n.getContext(s)}catch(e){i=null}i&&"function"==typeof i.getParameter||(i=null),++o}if(this.contextGL=i,!i||i.isContextLost())return H("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 $("initWebGL2Fail");i.glInitSucceed=0},Qt.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()||z("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()||z("webgl2 Fragment shader failed to compile: "+e.getShaderInfoLog(r));var n=e.createProgram();e.attachShader(n,t),e.attachShader(n,r),e.linkProgram(n),e.getProgramParameter(n,e.LINK_STATUS)||e.isContextLost()||z("webgl2 Program failed to compile: "+e.getProgramInfoLog(n)),e.useProgram(n),this.shaderProgram=n},Qt.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 n=e.getAttribLocation(t,"vertexPos");e.enableVertexAttribArray(n),e.vertexAttribPointer(n,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 a=e.getAttribLocation(t,"texturePos");if(e.enableVertexAttribArray(a),e.vertexAttribPointer(a,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},Qt.prototype.initTextures=function(e){var t=this.contextGL,r=this.shaderProgram;t.pixelStorei(t.UNPACK_ALIGNMENT,1);var n=this.initTexture();this.yTextureRef=n,this.oyTextureRef=n;var i=this.initTexture();this.uTextureRef=i,this.ouTextureRef=i;var a=this.initTexture();this.vTextureRef=a,this.ovTextureRef=a,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(),l=t.getUniformLocation(r,"cursorSampler");if(t.uniform1i(l,4),this.cursorTextureRef=s,this.cursorSamplerRef=l,this.cursorInfoRef=t.getUniformLocation(r,"cursorInfo"),this.initmask){t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,1);var d=this.initTexture(),c=t.getUniformLocation(r,"maskSampler");t.uniform1i(c,4),this.maskTextureRef=d}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")},Qt.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 n=t.getUniformLocation(r,"uSampler");t.uniform1i(n,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 n=t.getUniformLocation(r,"ySampler");t.uniform1i(n,0);let i=t.getUniformLocation(r,"uSampler");t.uniform1i(i,0);let a=t.getUniformLocation(r,"vSampler");t.uniform1i(a,0)}else if(2==e){let e=t.getUniformLocation(r,"ySampler");t.uniform1i(e,0);let n=t.getUniformLocation(r,"uSampler");t.uniform1i(n,1);let i=t.getUniformLocation(r,"vSampler");t.uniform1i(i,0)}let n=t.getUniformLocation(r,"previewVideoSampler");t.uniform1i(n,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 a=t.getUniformLocation(r,"cursorSampler");t.uniform1i(a,0);let o=t.getUniformLocation(this.shaderProgram,"waterMarkSampler");t.uniform1i(o,5)},Qt.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},Qt.prototype.clearDisplay=function(){var e=this.contextGL;e&&(e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT))},Qt.prototype.cleanup=function(){let e=this.canvasElement,t=Xt.get(e);if(t&&this.removeEventListener(e,t),e.defaultContextLostHandler||(e.defaultContextLostHandler=Zt,e.addEventListener("webglcontextlost",Zt,{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}},Qt.prototype.updateVertexInfoForSharing=function(){const[e,t,r,n]=this.vertexPos,i=this.webglVertexPos[0],a=this.webglVertexPos[3];if(e!=i||a!=n){this.webglVertexPos[0]=e,this.webglVertexPos[1]=t,this.webglVertexPos[2]=r,this.webglVertexPos[3]=n;var o=new Float32Array([r,t,e,t,r,n,e,n,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)}},Qt.prototype.updateTextureInfoForSharing=function(){const[e,t,r,n]=this.texturePos,i=this.webglTexturePos[0],a=this.webglTexturePos[3];if(e!=i||a!=n){this.webglTexturePos[0]=e,this.webglTexturePos[1]=t,this.webglTexturePos[2]=r,this.webglTexturePos[3]=n;var o=new Float32Array([r,t,e,t,r,n,e,n,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)}},Qt.prototype.updateVertexInfoForMultiView=function(e,t,r,n,i){var a,o,s,l,d=this.contextGL;if(this.isUseFillMode({width:r,height:n,rotation:i}))a=0,o=0,s=1,l=1;else{var c=i==this.ROTATION_CLOCK90||i==this.ROTATION_CLOCK270?n:r,u=i==this.ROTATION_CLOCK90||i==this.ROTATION_CLOCK270?r:n,_=c/u*t;_>e?(a=0,s=1,l=1-(o=(t-u/c*e)/2/t)):(o=0,l=1,s=1-(a=(e-_)/2/e))}a=2*a-1,s=2*s-1,o=1-2*o,l=1-2*l;var h=new Float32Array([s,o,a,o,s,l,a,l,1,1,-1,1,1,-1,-1,-1]);this.viewPostion=h,d.bindBuffer(d.ARRAY_BUFFER,this.vertexPosBuffer),d.bufferData(d.ARRAY_BUFFER,h,d.DYNAMIC_DRAW)},Qt.prototype.updateTextureInfoForMultiView=function(e,t,r,n,i,a,o){var s,l,d,c,u=this.contextGL;if(this.isUseFillMode({width:r.width,height:r.height,rotation:n})){const i=n==this.ROTATION_CLOCK90||n==this.ROTATION_CLOCK270?o/a:a/o,u=r.left||0,_=r.top||0;if(r.width/r.height>i){const n=r.height*i;s=_/t,l=(Math.round((r.width-n)/2)+u)/e,d=(_+r.height)/t,c=l+n/e}else{const n=r.width/i;d=(s=(Math.round((r.height-n)/2)+_)/t)+n/t,c=(l=u/e)+r.width/e}}else s=et(r.top/t,2),l=et(r.left/e,2),d=Je((r.top+r.height)/t,2),c=Je((r.width+r.left)/e,2);var _=[l,s,c,s,c,d,l,d];n==this.ROTATION_CLOCK90&&(_.unshift(_[6],_[7]),_=_.slice(0,8)),n==this.ROTATION_CLOCK180&&(_.unshift(_[4],_[5],_[6],_[7]),_=_.slice(0,8)),n==this.ROTATION_CLOCK270&&(_.push(_[0],_[1]),_=_.slice(2,10));var h=_[0],f=_[1];if(_[0]=_[2],_[1]=_[3],_[2]=h,_[3]=f,i)if(n==this.ROTATION_CLOCK90||n==this.ROTATION_CLOCK270){let e=_[1];_[1]=_[3],_[3]=e,e=_[5],_[5]=_[7],_[7]=e}else _[0]=1-_[0],_[2]=1-_[2],_[4]=1-_[4],_[6]=1-_[6];var p=new Float32Array([..._,1,0,0,0,1,1,0,1]);u.bindBuffer(u.ARRAY_BUFFER,this.texturePosBuffer),u.bufferData(u.ARRAY_BUFFER,p,u.DYNAMIC_DRAW)},Qt.prototype.getViewPosition=function(){let e=[0,0,1,1];if(!this.viewPostion)return e;const t=this.viewPostion[0],r=this.viewPostion[1],n=this.viewPostion[2],i=this.viewPostion[5];return e[0]=(1-r)/2,e[1]=(1+n)/2,e[2]=(1-i)/2,e[3]=(1+t)/2,e},Qt.prototype.drawNextOutputPictureFrame=function(e,t,r,n,i){let a=!(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 l=this.contextGL,d=this.yTextureRef,c=this.uTextureRef,u=this.vTextureRef;l.enable(l.BLEND),l.blendFunc(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA),i=i||this.ROTATION_CLOCK0;var _=(r=r||{top:0,left:0,width:e,height:t}).width!=this.croppingParams.width||r.height!=this.croppingParams.height,h=(r.top!=this.croppingParams.top||(r.left,this.croppingParams.left),o.width!=this.viewWidth||o.height!=this.viewHeight),f=(e!=this.textureWidth||this.textureHeight,i!=this.picRotation);(_||h||f)&&function(e,t,r,n,i){e.contextGL;let a=i.width,o=i.height;var s,l,d,c,u=n==e.ROTATION_CLOCK90||n==e.ROTATION_CLOCK270?r:t,_=n==e.ROTATION_CLOCK90||n==e.ROTATION_CLOCK270?t:r,h=u/_*o;h>a?(s=0,d=1,c=1-(l=(o-_/u*a)/2/o)):(l=0,c=1,d=1-(s=(a-h)/2/a)),s=parseFloat((2*s-1).toFixed(3)),d=parseFloat((2*d-1).toFixed(3)),l=parseFloat((1-2*l).toFixed(3)),c=parseFloat((1-2*c).toFixed(3)),e.vertexPos=[s,l,d,c]}(this,r.width,r.height,i,o),this.updateVertexInfoForSharing(),function(e,t,r,n,i){var a=n.top/r,o=n.left/t,s=(n.height+n.top)/r,l=(n.left+n.width)/t,d=[o,a,l,a,l,s,o,s];i==e.ROTATION_CLOCK90&&(d.unshift(d[6],d[7]),d=d.slice(0,8)),i==e.ROTATION_CLOCK180&&(d.unshift(d[4],d[5],d[6],d[7]),d=d.slice(0,8)),i==e.ROTATION_CLOCK270&&(d.push(d[0],d[1]),d=d.slice(2));var c=d[0],u=d[1];d[0]=d[2],d[1]=d[3],d[2]=c,d[3]=u;var _=new Float32Array([...d,1,0,0,0,1,1,0,1]),h=e.contextGL;h.bindBuffer(h.ARRAY_BUFFER,e.texturePosBuffer),h.bufferData(h.ARRAY_BUFFER,_,h.DYNAMIC_DRAW)}(this,e,t,r,i);let p=a?0:1;p!=this.colorRange&&(l.uniform1i(this.colorRangeRef,p),this.colorRange=p),l.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),l.uniform4fv(this.ul_viewport_rect,this.viewport_rect),l.uniform1i(this.onlyRGBARef,0),l.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=n,g=e*t;if(l.activeTexture(l.TEXTURE0),l.bindTexture(l.TEXTURE_2D,d),s){var v=m.subarray(0,g);l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE,e,t,0,l.LUMINANCE,l.UNSIGNED_BYTE,v)}var y=e/2*t/2;if(l.activeTexture(l.TEXTURE1),l.bindTexture(l.TEXTURE_2D,c),s){var b=m.subarray(g,g+y);l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE,e/2,t/2,0,l.LUMINANCE,l.UNSIGNED_BYTE,b)}var w=y;if(l.activeTexture(l.TEXTURE2),l.bindTexture(l.TEXTURE_2D,u),s){var E=m.subarray(g+y,g+y+w);l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE,e/2,t/2,0,l.LUMINANCE,l.UNSIGNED_BYTE,E)}l.activeTexture(l.TEXTURE0+4),l.bindTexture(l.TEXTURE_2D,this.cursorTextureRef),l.uniform1i(this.cursorSamplerRef,4),this.hasCursor?l.uniform1i(this.cursorFlagRef,1):s&&l.texImage2D(l.TEXTURE_2D,0,l.RGBA,1,1,0,l.RGBA,l.UNSIGNED_BYTE,this.dummpyCursor),l.uniform4f(this.cursorInfoRef,this.cx,this.cy,this.cw,this.ch),this.render(),this.hasWholeFrame=1},Qt.prototype.updateCursor=function(e,t,r,n){if(this.isAvaiable()){var i=this.contextGL;e<=0||t<=0||!r||r.length!=e*t*4||n!=this.lastcursorSyncId&&(this.lastcursorSyncId=n,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)}},Qt.prototype.updateCursorPosInfo=function(e,t,r,n,i){if(e&&this.hasCursor){let e=t/this.croppingParams.width,a=r/this.croppingParams.height,o=n/this.croppingParams.width,s=i/this.croppingParams.height;this.cx=e,this.cy=a,this.cw=o,this.ch=s}else this.cx=0,this.cy=0,this.cw=0,this.ch=0},Qt.prototype.isHasWholeFrame=function(){return this.hasWholeFrame},Qt.prototype.updateWatermark=function(e,t,r){if(this.isAvaiable()){var n=this.contextGL;e<=0||t<=0||!r||r.length!=e*t*4||(this.hasWaterMark=1,this.watermarkWidth=e,this.watermarkHeight=t,n.activeTexture(n.TEXTURE0+5),n.bindTexture(n.TEXTURE_2D,this.waterMarkTextureRef),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,this.watermarkWidth,this.watermarkHeight,0,n.RGBA,n.UNSIGNED_BYTE,r))}},Qt.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))}},Qt.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)}},Qt.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=fe,this.viewport_rect=null},Qt.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()}},Qt.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})},Qt.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)}},Qt.prototype.isRGBAMode=function(e){return-1!==[le,de].indexOf(e)},Qt.prototype.updateRemoteVideoTextures=function(e,t,r,n,i){let a=!(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 l=this.contextGL,d=this.yTextureRef,c=this.uTextureRef,u=this.vTextureRef;l.enable(l.BLEND),l.blendFunc(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA);const _=this.isRGBAMode(this.videoMode);if(e<=0||t<=0||!n||!n.length||n.length!=e*t*3/2&&!_||r&&(r.top<0||r.left<0||r.left+r.width>e||r.top+r.height>t))return!1;let h=a?0:1;if(this.colorRange=h,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(l.bindTexture(l.TEXTURE_2D,d),_)return void l.texImage2D(l.TEXTURE_2D,0,l.RGBA,e,t,0,l.RGBA,l.UNSIGNED_BYTE,n);var f=n,p=e*t,m=f.subarray(0,p);l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE,e,t,0,l.LUMINANCE,l.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=f.subarray(p,p+g);if(l.bindTexture(l.TEXTURE_2D,c),v){l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE,e/2,t/2,0,l.LUMINANCE,l.UNSIGNED_BYTE,y);var b=f.subarray(p+g,p+g+v);l.bindTexture(l.TEXTURE_2D,u),l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE,e/2,t/2,0,l.LUMINANCE,l.UNSIGNED_BYTE,b)}else l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE_ALPHA,e/2,t/2,0,l.LUMINANCE_ALPHA,l.UNSIGNED_BYTE,y);return!0},Qt.prototype.updateRemoteVideoTexturesImageBitmap=function(e,t,r,n,i){let a=!(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,n),!a)return;o.bindTexture(o.TEXTURE_2D,this.yTextureRef);const s=o.RGBA,l=o.RGBA,d=o.UNSIGNED_BYTE;o.texImage2D(o.TEXTURE_2D,0,s,l,d,r)},Qt.prototype.updateSelfMaskImage=function(e,t,r){if(!(e<=0||t<=0)&&r&&r.length==e*t*4&&this.isAvaiable()){var n=this.contextGL;n.bindTexture(n.TEXTURE_2D,this.maskTextureRef),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,e,t,0,n.RGBA,n.UNSIGNED_BYTE,r)}},Qt.prototype.VideoFlip=function(){if(this.isAvaiable()){var e=this.contextGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,1)}},Qt.prototype.drawRemoteVideo=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.isAvaiable())return;var r=this.contextGL;let n=this.isRGBAMode(this.videoMode)?1:0;r.uniform1i(this.colorRangeRef,this.colorRange),this.setUniformFlag(n,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()},Qt.prototype.readPixelsSyncRequest=function(e,t,r,n){if(this.isAvaiable()){var i,a=this.contextGL;return this.destination&&this.destination.length==r*n*4||(this.destination=new Uint8Array(r*n*4)),i=this.destination,a.flush(),a.readPixels(e,t,r,n,a.RGBA,a.UNSIGNED_BYTE,i),i}},Qt.prototype.updateSelfVideoTextures=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=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=a,Object.assign(this.croppingParams,n),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))}},Qt.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 n=this.contextGL;this.setUniformFlag(1,this.hasCursor,this.videoMode),this.updateTextureInfoForMultiView(this.textureWidth,this.textureHeight,this.croppingParams,this.rotation,r,e.width,e.height),n.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),n.uniform4fv(this.ul_viewport_rect,this.viewport_rect),t?(n.enable(n.BLEND),n.blendFunc(n.ZERO,n.ZERO),this.updateVertexInfoForMultiView(e.width,e.height,e.width,e.height,this.ROTATION_CLOCK0)):(n.enable(n.BLEND),n.blendFunc(n.SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA),this.updateVertexInfoForMultiView(e.width,e.height,this.croppingParams.width,this.croppingParams.height,this.rotation)),this.BindTextures(le),this.render()}},Qt.prototype.isSetWatermark=function(){return this.hasWaterMark},Qt.prototype.setWatermarkFlag=function(e){this.hasWaterMark=e,e||(this.setWatermarkRepeated(!1),this.setWatermarkOpacity(),this.setWatermarkPosition(16))},Qt.prototype.setUniformFlag=function(e,t,r){if(this.isAvaiable()){var n=this.contextGL;n.uniform1i(this.onlyRGBARef,e),n.uniform1i(this.bgraModeRef,e&&r===de?1:0),n.uniform1i(this.cursorFlagRef,t),e||n.uniform1i(this.yuvmodeRef,r)}},Qt.prototype.setVideoMode=function(e){this.videoMode=e},Qt.prototype.getVideoMode=function(e){return this.videoMode},Qt.prototype.setWatermarkRepeated=function(e){this.watermarkRepeated=e},Qt.prototype.isWatermarkRepeated=function(){return!!this.watermarkRepeated},Qt.prototype.setWatermarkOpacity=function(e){this.watermarkOpacity=e||.15},Qt.prototype.getWatermarkOpacity=function(){return this.watermarkOpacity},Qt.prototype.setWatermarkPosition=function(e){this.watermarkPosition=e||16},Qt.prototype.getWatermarkPosition=function(){return this.watermarkPosition},Qt.prototype.setMultiView=function(e){return this.isMultiView=e},Qt.prototype.getRepeatedWatermarkUniformValue=function(){return this.isMultiView?30:7},Qt.prototype.getRepeatedWatermarkTextureValue=function(e){return this.isMultiView?e.TEXTURE30:e.TEXTURE7},Qt.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},Qt.prototype.getFillMode=function(){return this.fillMode},Qt.prototype.getFillModeForResolution=function(){return this.fillModeForResolution},Qt.prototype.getTextureIndex=function(){return this.textureindex},Qt.prototype.getIndex=function(){return this.textureindex},Qt.prototype.getWatermarkWidth=function(){return this.watermarkWidth},Qt.prototype.getWatermarkHeight=function(){return this.watermarkHeight},Qt.prototype.getTextureWidth=function(){return this.textureWidth},Qt.prototype.getTextureHeight=function(){return this.textureHeight},Qt.prototype.getRotation=function(){return this.rotation},Qt.prototype.getCroppingParams=function(){return this.croppingParams},Qt.prototype.getWatermarkOpacity=function(){return this.watermarkOpacity},Qt.prototype.getAttachedCanvas=function(){return this.canvasElement},Qt.prototype.getCanvasId=function(){return this.canvasID},Qt.prototype.resizeCanvasTo=function(e,t){this.contextGL.canvas.width=e,this.contextGL.canvas.height=t},Qt.prototype.isUseFillMode=function(e){let{width:t,height:r,rotation:n}=e;if(!this.fillMode)return!1;if(!this.fillModeForResolution)return!0;if(!t||!r)return!1;const i=n===this.ROTATION_CLOCK90||n==this.ROTATION_CLOCK270?r/t:t/r;return(Array.isArray(this.fillModeForResolution)?this.fillModeForResolution:[this.fillModeForResolution]).some((e=>Math.abs(i-e)<.01))},Qt.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},Qt.prototype.setAntialiasWidth=function(e){(e<=0||e>=1)&&(e=fe),this.aa_width=e};const Jt=Qt;function er(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 tr(e,t){return e.get(nr(e,t))}function rr(e,t,r){return e.set(nr(e,t),r),r}function nr(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 ir=new WeakMap,ar=new WeakMap;class or extends Wt{constructor(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];super(),er(this,ir,new Map),er(this,ar,!1),rr(ar,this,e)}setCanvasAlphaChannelEnability(e){rr(ar,this,e)}createVideoRenderDisplay(e,t,r){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i=null,a=null,o=null,s=!1;return n&&(i=n.forceNoGL,a=n.contextOptions,o=n.webGLResources,s=n.initMask),new Jt(e,t,r,i,a,o,s,tr(ar,this))}getVideoRenderDisplay(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,a=tr(ir,this).get(e);if(!a){let n=[];a=[n,[]],tr(ir,this).set(e,a);let o=new Jt(e,t,0,void 0,void 0,void 0,void 0,tr(ar,this));o.setMultiView(!0),i&&i.set(e,o);let s=1;for(;s<=r;s++){const r=new Jt(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,tr(ar,this));r.setMultiView(!0),n.push(r)}}let o,s=tr(ir,this).get(e),l=s[0],d=s[1];if(s&&l[0]&&(o=l.pop(),d.push(o)),!o){const e=s?"".concat(s.length):"undefined",t=l?"".concat(l.length):"undefined";n("No Display obtained from VideoRender.Get_Display. canvasRenderArray:".concat(e," unusedRenderArray:").concat(t))}return o}onWebglContextLostForMulti(e,t){const{canvas:r}=t;let n=tr(ir,this).get(r);var[i,a,o]=n;[...i,...a].forEach((e=>e.clear()))}onRestoredFromLostForMulti(e,t){if(!t)return;const{canvas:r}=t;let n=tr(ir,this).get(r);var[i,a,o]=n;const s=[...i,...a];let l=s.find((e=>e.isLocalDisplay()));l.webglVertexPos=[0,0,0,0],l.webglTexturePos=[0,0,0,0],o.args={program:l.shaderProgram,contextgl:l.contextGL,vBuffer:l.vertexPosBuffer,tBuffer:l.texturePosBuffer,webglVertexPos:l.webglVertexPos,webglTexturePos:l.webglTexturePos},s.forEach((e=>{e!=l&&e.reinit(o.args)}))}getRenderDisplay(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=tr(ir,this).get(e);if(!n){let i=[],a={canvasId:t,size:1,args:{}};n=[i,[],a],tr(ir,this).set(e,n);const o={webglcontextlostCallback:this.onWebglContextLostForMulti.bind(this),webglcontextrestoredCallback:this.onRestoredFromLostForMulti.bind(this),params:{canvas:e,rendercanvasID:t}};let s=new Jt(e,t,0,void 0,o,void 0,void 0,tr(ar,this));r&&r.set(e,s),i.push(s),a.args={program:s.shaderProgram,contextgl:s.contextGL,vBuffer:s.vertexPosBuffer,tBuffer:s.texturePosBuffer,webglVertexPos:s.webglVertexPos,webglTexturePos:s.webglTexturePos}}if(!n[0].length){const r=new Jt(e,t,n[2].size,void 0,void 0,n[2].args,void 0,tr(ar,this));n[2].size++,n[0].push(r)}let i=n[0].pop();return n[1].push(i),i}recycleRenderDisplay(e,t,r){t.setWatermarkFlag(0),t.setVideoMode(-1),t.clear(r);let n=tr(ir,this).get(e);if(n){let e=n[0],r=n[1];r&&r.some((function(e,n){if(e===t)return r.splice(n,1),!0})),e.push(t)}}onRestoredFromContextLost(e,t,r,n,i){let a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,o=tr(ir,this).get(r);(!o||o.length<2)&&i("canvasRenderArray:".concat(o,", length:").concat(null==o?void 0:o.length));let s=a.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&&(tr(ir,this).delete(r),tr(ir,this).set(t,o),a&&(a.delete(r),a.set(t,s))),null}}getRenderDisplayMap(){return tr(ir,this)}cleanup(e,t){var r;null==t||null===(r=t.cleanup)||void 0===r||r.call(t);for(const[e,t]of tr(ir,this)){const e=t[0],r=t[1];for(const t of e)t.cleanup();for(const e of r)e.cleanup()}rr(ir,this,new Map)}cleanupByCanvas(e){if(tr(ir,this).get(e)){let t=tr(ir,this).get(e);if(t){let r=t[0],n=t[1];n.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=[],n=[],tr(ir,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 sr(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 lr(e,t){return e.get(cr(e,t))}function dr(e,t,r){return e.set(cr(e,t),r),r}function cr(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 ur=new WeakMap,_r=new WeakMap,hr=new WeakMap,fr=new WeakMap,pr=new WeakMap;const mr=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];sr(this,ur,null),sr(this,_r,null),sr(this,hr,null),sr(this,fr,null),sr(this,pr,!1),dr(pr,this,e)}setGPUResourceMgrGetter(e){dr(fr,this,e)}isEnableCanvasAlphaChannel(){return lr(pr,this)}setCanvasAlphaChannelEnability(e){dr(pr,this,e),lr(ur,this)&&lr(ur,this).setCanvasAlphaChannelEnability(e),lr(_r,this)&&lr(_r,this).setCanvasAlphaChannelEnability(e)}getWebGLRenderDisplayMgr(){return lr(ur,this)||(dr(ur,this,new $t(lr(pr,this))),j("[Render] getWebGLRenderDisplayMgr")),lr(ur,this)}getWebGL2RenderDisplayMgr(){return lr(_r,this)||dr(_r,this,new or(lr(pr,this))),lr(_r,this)}getWebGPURenderDisplayMgr(){if(!lr(hr,this)){const e=dt.getModule("webgpu_renderer_dynmod");dr(hr,this,e.exports.createWebGPURenderDisplayMgr()),lr(hr,this).setGPUResourceMgrGetter(lr(fr,this).call(this,2))}return lr(hr,this)}getRenderDisplayMgr(e){switch(e){case 1:return this.getWebGLRenderDisplayMgr();case 3:return this.getWebGL2RenderDisplayMgr();case 2:return this.getWebGPURenderDisplayMgr();case 4:return Qe("VIDEO_TAG has no RenderDisplayMgr!"),null;default:return null}}getVideoRenderDisplay(e,t,r,n,i){let a=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,n,i,o);return s&&2===e&&(s.addRenderer(a),s.attachCanvas(t,r),s.setGPUResMgr(lr(fr,this).call(this,e))),s}getRenderDisplay(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,a=this.getRenderDisplayMgr(e).getRenderDisplay(t,r,i);return a&&2===e&&(a.addRenderer(n),a.attachCanvas(t,r),a.setGPUResMgr(lr(fr,this).call(this,e))),a}createVideoRenderDisplay(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,o=this.getRenderDisplayMgr(e).createVideoRenderDisplay(t,r,n,i,a);return o&&2===e&&(o.addRenderer(i),o.attachCanvas(t,r),o.setGPUResMgr(lr(fr,this).call(this,e))),o}recycleRenderDisplay(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];switch(e){case 2:lr(hr,this)&&lr(hr,this).recycleRenderDisplay(r,n,i);break;case 1:lr(ur,this)&&lr(ur,this).recycleRenderDisplay(t,r,i);break;case 3:lr(_r,this)&&lr(_r,this).recycleRenderDisplay(t,r,i);break;case 4:Qe("VIDEO_TAG has no display")}}collectInUseRenderDisplays(e,t){let r=null;return 2===e&&lr(hr,this)&&(r=lr(hr,this).collectInUseRenderDisplays(t)),r}collectInUseRenderDisplaysByCanvas(e,t,r){let n=null;return 2===e&&lr(hr,this)&&(n=lr(hr,this).collectInUseRenderDisplaysByCanvas(t,r)),n}getRenderDisplayMap(e,t){if(1===e){if(lr(ur,this))return lr(ur,this).getRenderDisplayMap()}else if(2===e){if(lr(hr,this))return lr(hr,this).getRenderDisplayMap(t)}else if(3===e&&lr(_r,this))return lr(_r,this).getRenderDisplayMap(t);return null}onRestoredFromContextLost(e,t,r,n,i){let a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null;return lr(ur,this)?lr(ur,this).onRestoredFromContextLost(e,t,r,n,i,a):lr(_r,this)?lr(_r,this).onRestoredFromContextLost(e,t,r,n,i,a):null}cleanup(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];null!==lr(ur,this)&&lr(ur,this).cleanup(e,t),lr(_r,this)&&lr(_r,this).cleanup(e,t),null!==lr(hr,this)&&lr(hr,this).cleanup(t,r)}cleanupByCanvas(e){null!==lr(ur,this)&&lr(ur,this).cleanupByCanvas(e),null!==lr(_r,this)&&lr(_r,this).cleanupByCanvas(e),null!==lr(hr,this)&&lr(hr,this).cleanupByCanvas(e)}};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 vr(e,t){return e.get(br(e,t))}function yr(e,t,r){return e.set(br(e,t),r),r}function br(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 wr=new WeakMap,Er=new WeakMap,Sr=new WeakMap,Mr=new WeakMap,xr=new WeakMap;var Tr=r(7201),Rr=r.n(Tr);function kr(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 Oe({tag:"jitter",interval:3e4,reportcallback:this._qos_report_timeout.bind(this)}),this._qos_report_samples=[],this._cureen_qos_report=0}kr.prototype._qos_report_timeout=function(e,t,r,n){if(this._customer_callback){let i="".concat(e,",").concat(t,",").concat(r,",").concat(n);this._customer_callback(this._tag+"TimeOut",i)}},kr.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=Rr()(t).call(t,",","|"),r=Rr()(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))},kr.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=[])},kr.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)},kr.prototype.stop=function(){this._enable&&(clearInterval(this._interval_id),this._interval_id=0,this._enable=!1)},kr.prototype.sample=function(e){if(this._enable&&(this._current_count++,this._enable_advanced)){if(Fe(e))return void this._cureen_qos_report++;if(Ie(e)){let t=Pe(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 Ar{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:n,size:i,time:a}=this.presamples,o=t-a,s=this.sendsize-r,l=this.dropsize-n,d=e-i;if(o>150&&s>5e3){const r=100*l/s,n=8e3*(s-l-d)/(o*(this.presamples.nosendcount+1)),i=8e3*s/o,a=8e3*(e+l+Math.max(d/2,0)),c=0==n?5e3:a/n;if(0==n?this.presamples.nosendcount++:(this.presamples.nosendcount=0,this.presamples.dckbps=n),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=n||this.presamples.dckbps/(this.presamples.nosendcount+1),_=u/this.presamples.smoothsend;if(this.overusetime>700&&_<.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 Cr{constructor(e,t,r,n,i,a){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=Cr.UNINIT,this.target_thread=n,this.transfered=!1,this._listener=null,this.transportlists=[],this._send_statistic=null,this.report_monitor_func=()=>{},this.bsuppend=!1,this.mgr=a,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===Cr.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!=Cr.DISCONNECT&&this._clear(),this._status=Cr.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==Cr.UNINIT&&this._onopen()}_onmessage2(e){this._status==Cr.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=Cr.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 kr({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 kr({tag:t,report_call:e})}this._send_statistic.start(),this._recv_statistic.start(),this.enableSendStatic=3==this.type,this.sendStatic=new Ar(this,this.datachannel),this.enableSendStatic&&this.sendStatic.start()}var r;t!=Cr.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=Cr.DISCONNECT;let r=this.disconnectedFn;this._clear(),t!=Cr.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 n=this.datachannel;this.datachannel=null,null===(e=this._send_statistic)||void 0===e||e.stop(),null===(t=this._recv_statistic)||void 0===t||t.stop(),null===(r=this.sendStatic)||void 0===r||r.stop(),null==n||n.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 c:this.report_monitor_func(t.tag,t.data)}}}s(Cr,"UNINIT",0),s(Cr,"CONNECTED",1),s(Cr,"DISCONNECT",2);class Fr{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]:"",n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=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=(a-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,a-8),this.byteLength=a,this.label=r,this.usingOneElementBuffer=n,o&&(this.wasmMemory=o),n&&(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 ge);this.dataBuffer.getLength()>0&&this.available_write()>0;){let e=this.dataBuffer.dequeue();e&&this.push(e)}let n=this.dataBuffer.getLength();if(e){if(this.available_write()>0&&0==n)return this.push(e),!0;if(!t)return!1;this.dataBuffer.enqueue(e),++n}if(n>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)),n>=1e3&&(N.warn("Cached data in SAB reached critical value, will be cleared"),this.dataBuffer.clear(),r&&r("vqslclear")),n>0&&r){let e=performance.now();(!this.monitorpace||e-this.monitorpace>2e4)&&(this.monitorpace=e,r&&r("vqsl"+n))}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 n=(t+1)%this.capacity;return Atomics.store(this.write_ptr,0,n),!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,n,i,a=new Uint32Array(this.buf,this.offset+t*this._BYTES_PER_ELEMENT+8,1);if(e){r=this.oneElementBuffer?new Uint8Array(this.oneElementBuffer,0,a[0]):new Uint8Array(a[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+a[0]),n=t*this._BYTES_PER_ELEMENT+8+4+this.storageUint8sByteOffset,i=t*this._BYTES_PER_ELEMENT+8+4+a[0]+this.storageUint8sByteOffset;return e&&Atomics.store(this.read_ptr,0,(t+1)%this.capacity),e?r:{bCopyData:e,uint8s:r,begin:n,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 Pr{constructor(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:50,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:80;if(!(e instanceof Fr))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=n,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 Ir(e,t,r){if(!e)return;let n=Br.dataTransportMgr;n.type===Or.THREAD_MAIN?(n.setSabBuffer(e,t,r),e.remote.postMessage({cmd:T,transportId:e.id,sender:r,reciver:t})):(e.setSabBuffer(t,r),n.mainThread.postMessage({cmd:T,transportId:e.id,sender:r,reciver:t}))}class Or{constructor(e){let t=e||{};this.type=t.type||Or.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:n}=e.data,i=this.transportlists.find((e=>e.id===r));if(i||t==x)switch(t){case x:this.addRemoteTransport(e.data,null);break;case 136:i.setMsgPort(n||new Gr);break;case T:i.setSabBuffer(e.data.sender,e.data.reciver);break;case 132:i.remote=null,this.removeTransport(i)}}_onrecvsubthreadlistener(e,t){let{cmd:r,transportId:n}=t.data,i=this.transportlists.find((e=>e.id===n));switch(r){case x:this.addRemoteTransport(t.data,e);break;case T: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:x,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,n,i,a;(null!==(r=e.sabInfo)&&void 0!==r&&r.sender||null!==(n=e.sabInfo)&&void 0!==n&&n.reciver)&&t.postMessage({cmd:T,transportId:e.id,sender:null===(i=e.sabInfo)||void 0===i?void 0:i.sender,reciver:null===(a=e.sabInfo)||void 0===a?void 0:a.reciver})}addRemoteTransport(e,t){let{transportId:r,port:n,transportType:i}=e,a=this.createMsgSocketTransport(i,r);var o;a.id=r,a.remote=t,a.portInfo=n,n?a.setMsgPort(a.portInfo):this.bindMessageChannel(a),n&&(null===(o=this.onRemoteTransportFn)||void 0===o||o.call(this,a))}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 Br({mgr:this,sock:new Nr,type:e,local:!0,id:t}),r}bindMessageChannel(e){if(this.type!=Or.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==Or.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 n=this.transportlists[r];n.remote===e&&t.push(n)}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],n=1==r.target_thread;if(r.type==e&&n)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 n,i,a,o;e.target_thread!=r&&0!=r&&(this.type==Or.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!==(n=e.sabInfo)&&void 0!==n&&n.sender||null!==(i=e.sabInfo)&&void 0!==i&&i.reciver)&&e.setSabBuffer(null===(a=e.sabInfo)||void 0===a?void 0:a.sender,null===(o=e.sabInfo)||void 0===o?void 0:o.reciver)))}closeTransportForTargetThread(e){0!=e.target_thread&&1!=e.target_thread&&this.type==Or.THREAD_MAIN&&this.closeRemoteTransportRPC(e,e.target_thread),e.target_thread=0}}s(Or,"THREAD_MAIN",1),s(Or,"THREAD_SUB",2);const Lr={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},Dr=e=>{};class Ur{constructor(){this.onmessage=Dr,this.status=Ur.CLOSED,this.onopen=Dr,this.onclose=Dr,this.onwer=null}send(e){}delete(){this.onmessage=Dr,this.onopen=Dr,this.onclose=Dr,this.close()}sendVideo(e,t){}sendWasm(e){}sendCommand(e){}open(){this.status=Ur.OPEN,this.onopen()}close(){this.status=Ur.CLOSED,this.onclose()}isReady(){return!1}}s(Ur,"OPEN",1),s(Ur,"CLOSED",2);class Nr extends Ur{constructor(){super({}),this.sab={},this.port=null,this.onmessage=Dr,this.sender=Dr,this.videoSender=Dr,this.reciver=Dr,this.wasmSender=Dr,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=Dr,this.sender=Dr,this.videoSender=Dr,this.reciver=Dr,this.wasmSender=Dr;let{consumer:r}=(null===(e=this.sab)||void 0===e?void 0:e.reciver)||{};null==r||r.setDataCallback(Dr),null==r||r.cancelConsume(),this.sab={},this.port&&(this.port.onmessage=Dr),null===(t=this.port)||void 0===t||t.close()}catch(e){}}open(){this.status!=Ur.OPEN||this.onopen()}close(){this.status=Ur.CLOSED,this.delete(),this.onclose()}_onmessage(e){let{cmd:t,data:r}=e.data;switch(t){case M:this.reciver();break;case S:this.onmessage(r,0);break;case 129:this.status=r,this.status==Ur.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:n}=e||{};r?n?(this.sender=e=>{r.enqueue(e)},this.wasmSender=e=>{r.enqueue(e)},this.videoSender=(e,t)=>{if(!r.enqueueSafe([e,t],!1)){let n=new Uint8Array(t.length+e.length);n.set(e,0),n.set(t,e.length),r.enqueueSafe(n)}}):(this.sender=e=>{r.enqueue(e),this.port.postMessage({cmd:M})},this.wasmSender=e=>{r.enqueue(e),this.port.postMessage({cmd:M})},this.videoSender=(e,t)=>{if(!r.enqueueSafe([e,t],!1)){let n=new Uint8Array(t.length+e.length);n.set(e,0),n.set(t,e.length),r.enqueueSafe(n)}this.port.postMessage({cmd:M})}):(this.sender=e=>{this.port.postMessage({cmd:S,data:e},[e.buffer])},this.wasmSender=e=>{let t=new Uint8Array(e.length);t.set(e,0),this.port.postMessage({cmd:S,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:S,data:r},[r.buffer])});let{sabqueue:i,consumer:a,useCopy:o,interval:s,offset:l}=t||{};if(a&&(a.cancelConsume(),a=null),i){const e=o?e=>{this.onmessage(e,0)}:l?e=>{this.onmessage(e.uint8s,e.begin)}:e=>{this.onmessage(e.uint8s,0)};let r=null,n=Br.dataTransportMgr.monitorlogfn;if(s&&n){var d;let e=new Oe({tag:"WCL_M,VDRB"+(null===(d=this.onwer)||void 0===d?void 0:d.type),interval:1e4,reportcallback:jr});r=e.timeoutReport.bind(e)}a=new Pr(i,e,r),t.consumer=a,s?a.consume(s,o):this.reciver=()=>{a.consumeAll(o)}}}setMsgPort(e){e!=this.port&&(this.port&&(this.port.onmessage=Dr,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:n,offset:i,length:a,useOneElement:o}=e,s=new Fr(i>0?t.buffer:t,void 0,void 0,!!o,i,a,i>0?t:null);this.sab.sender={sabqueue:s,interval:n,useCopy:r,offset:i}}if(null!=t&&t.sab){var r;let{sab:e,useCopy:n,interval:i,offset:a,length:o,useOneElement:s}=t,l=new Fr(a>0?e.buffer:e,void 0,void 0,!!s,a,o,a>0?e:null),{consumer:d}=(null===(r=this.sab)||void 0===r?void 0:r.reciver)||{};d&&(d.cancelConsume(),this.sab.reciver.consumer=null,this.sab.reciver.sabqueue=null),this.sab.reciver={sabqueue:l,interval:i,useCopy:n,offset:a}}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 Wr{constructor(){}TransportListChange(e,t){}}class Br{constructor(e){this.onmessage=Dr,this.onopen=Dr,this.onclose=Dr,this.oncommand=Dr,this.type=e.type,this.id=e.id||Math.floor(performance.now())<<10|e.type,this.sock=e.sock||new Ur,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=Br.dataTransportMgr;e.createTransport(this),!this.local&&e&&e.mainThread&&e.type==Or.THREAD_SUB&&e.createRemoteTransportRPC(this,e.mainThread)}_close(){let e=Br.dataTransportMgr;const t=e.transportIsExit(this);!this.local&&t&&e.type==Or.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 Nr))throw new Error("tansport sock is not a MsgQueueSocket");this.sock.setMsgPort(e)}setSabBuffer(e,t){if(!(this.sock instanceof Nr))throw new Error("tansport sock is not a MsgQueueSocket");this.sock.setSabBuffer(e,t)}setStatus(e){this.sock instanceof Nr&&this.sock.setStatus(e)}}s(Br,"UDP",0),s(Br,"TCP",1),s(Br,"RLB_UDP",2),s(Br,"dataTransportMgr",null);class Gr{constructor(e){this.sock=null,this.onmessage=Dr}isReady(){return!1}send(){}sendVideo(){}sendCommand(){}setStatus(e){}}function jr(e,t,r,n){var i;null===(i=Or.monitorlogfn)||void 0===i||i.call(Or,e,"".concat(t,",").concat(r,",").concat(n))}class Hr extends Wr{constructor(){super()}TransportListChange(e,t){}TransportStatus(e,t,r){}DataChannelStatus(e,t){}}class Vr extends Wr{constructor(e){super(),this.transportMap={},this.type=e.type,this.mgr=e,this.channellists=[],this.channelListeners=[]}addDataChannel(e){if(e instanceof Cr){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((n=>{n.TransportStatus(e,r,t)})),this.channelListeners.forEach((r=>{r.TransportListChange(e,t)}))}removeDataChannel(e){if(!(e instanceof Cr))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 Hr?-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)})))}))}}s(Vr,"target",null);class zr{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},n=this._recvheartbeat.bind(this,r);r.listener=n,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()})}),zr.INTREVAL_TIME_MS));const r=()=>{this._interval=setTimeout((()=>{r();let e=zr.instance,t=Object.keys(e.monitorworkers),n=Date.now();t.forEach((t=>{let r=e.monitorworkers[t];r.timeoutcount>5?n-r.lastedtimestamp>zr.HEART_TIMEOUT_MS&&(e.timeoutcallbackfn(r.id,n-r.lastedtimestamp),r.lastedtimestamp=n):(r.timeoutcount++,r.worker.postMessage({command:138}))}))}),zr.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){}}}s(zr,"INTREVAL_TIME_MS",3e3),s(zr,"HEART_TIMEOUT_MS",15e3),s(zr,"MAX_HEART_TIMEOUT_MS",3e4),s(zr,"instance",null);class $r{constructor(e,t,r,n){var i;this.url=e,this.onopen=()=>{},this.onclose=()=>{},this.oncommand=()=>{},this.transportopened=!1,this.websockClosed=!1,this.dataTransport=(i=t,new Br({sock:new Nr,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=!!n}_dataTransportCommand(e){let{cmd:t}=e;182!=t||this.websockClosed||(this.websocketopen=!0,this.onopen()),t==k&&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)&&Ir(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&&Ir(this.dataTransport,e,t)}sendCmdData(e){const t={cmd:198,data:new Uint8Array(e)};this.dataTransport.sendCommand(t)}}var qr,Yr,Xr,Kr,Zr,Qr,Jr,en,tn;!function(e){e[e.Unknow=0]="Unknow",e[e.MediaCommand=1]="MediaCommand",e[e.P2PControl=2]="P2PControl",e[e.MeshControl=3]="MeshControl"}(qr||(qr={})),function(e){e[e.normal=0]="normal",e[e.child=1]="child",e[e.parent=2]="parent",e[e.invalid=31]="invalid"}(Yr||(Yr={})),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"}(Xr||(Xr={})),function(e){e[e.Unknow=0]="Unknow",e[e.Offer=1]="Offer",e[e.Answer=2]="Answer"}(Kr||(Kr={})),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"}(Zr||(Zr={})),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"}(Qr||(Qr={})),(tn=Jr||(Jr={})).INIT_PROCESSOR="init_processor",tn.UNINIT_PROCESSOR="uninit_processor",tn.INIT_OUTPUT_CANVAS="init_output_canvas",tn.OUTPUT_WRITABLE_STREAM="output_writable_stream",tn.INPUT_READABLE_STREAM="input_readable_stream",tn.FRAME_DATA="frame_data",tn.START_REQUEST_FRAME="start_request_frame",tn.STOP_REQUEST_FRAME="stop_request_frame",tn.REQUEST_FRAME="request_frame",tn.FRAME_CALLBACK="frame_callback",tn.RESOLUTION_CHANGE="RESOLUTION_CHANGE",tn.PROCESSOR_WORKER_ERROR="PROCESSOR_WORKER_ERROR",tn.PROCESSOR_STOP_COMPLETE="PROCESSOR_STOP_COMPLETE",en||(en={});class rn{constructor(e,t,r){this.port=e,this.name=t,this.VideoFrameNeeded=r}setStream(e){const t=e.getVideoTracks()[0],r=t.getSettings(),{frameRate:n=24}=r;this.trackProcessor=new MediaStreamTrackProcessor({track:t});const i=this.trackProcessor.readable;this.port.postMessage({cmd:Jr.INPUT_READABLE_STREAM,frameRate:Math.min(n,24),readableStream:i,processorName:this.name},[i]),this.port.postMessage({cmd:Jr.START_REQUEST_FRAME,frameRate:n,processorName:this.name,VideoFrameNeeded:this.VideoFrameNeeded})}removeStream(){this.port.postMessage({cmd:Jr.STOP_REQUEST_FRAME,processorName:this.name})}destroy(){this.removeStream()}}class nn{constructor(e,t,r=!1,n=!1){this.port=e,this.name=t,this.isIOSDevice=r,this.VideoFrameNeeded=n,this.onMessage=e=>{if(e.data.cmd===Jr.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:Jr.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:Jr.START_REQUEST_FRAME,frameRate:Math.min(r,24),processorName:this.name,VideoFrameNeeded:this.VideoFrameNeeded})}removeStream(){this.port.postMessage({cmd:Jr.STOP_REQUEST_FRAME,processorName:this.name})}destroy(){this.port.removeEventListener("message",this.onMessage)}}class an{constructor(e,t){this.trackGenerator=new MediaStreamTrackGenerator({kind:"video"});const r=this.trackGenerator.writable;e.postMessage({cmd:Jr.OUTPUT_WRITABLE_STREAM,writableStream:r,processorName:t},[r]),this.stream=new MediaStream([this.trackGenerator])}getStream(){return this.stream}}class on{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 sn{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 ln=function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{l(n.next(e))}catch(e){a(e)}}function s(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}l((n=n.apply(e,t||[])).next())}))};class dn{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,n,i;if(e.data.cmd===Jr.FRAME_CALLBACK)if(this.frameCallback)this.frameCallback(e.data.frame);else if(this instanceof cn)if(this.getOutPutCanvas())null===(r=e.data.frame)||void 0===r||r.close();else{const r=e.data.frame;if(r instanceof VideoFrame){const n=r.displayWidth,i=r.displayHeight,a=this.getTargetGenerator();if(a instanceof on){const e=a.getStreamingCanvas();e.width!==n&&(e.width=n),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,n,i),t.drawImage(e,0,0,n,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===(n=e.data.frame)||void 0===n||n.close();else e.data.cmd===Jr.PROCESSOR_STOP_COMPLETE?this instanceof cn&&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 n=this.getOutPutCanvas();n?this.port.postMessage({cmd:Jr.INIT_OUTPUT_CANVAS,canvas:n,processorName:e},[n]):this.port.postMessage({cmd:Jr.INIT_OUTPUT_CANVAS,processorName:e})}init(){this.port.postMessage({cmd:Jr.INIT_PROCESSOR,processorName:this.processorName})}addCallback(e){this.callback=e}removeCallback(){this.callback=null}uninit(){this.port.postMessage({cmd:Jr.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 ln(this,void 0,void 0,(function*(){}))}onFrame(e){throw new Error("Method not implemented.")}addFrameCallback(e){throw new Error("Method not implemented.")}removeFrameCallback(){}}class cn extends dn{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 nn(this.port,this.processorName,!1,!0):"function"==typeof MediaStreamTrackProcessor?new rn(this.port,this.processorName,!0):new nn(this.port,this.processorName,!1,!0)),this.targetGenerator||(this.targetGenerator=!0===r?new on(this.port,this.processorName,t):"function"==typeof MediaStreamTrackGenerator?new an(this.port,this.processorName):new on(this.port,this.processorName,t))}uninit(){var e,t,r,n;null===(t=null===(e=this.originGenerator)||void 0===e?void 0:e.destroy)||void 0===t||t.call(e),null===(n=null===(r=this.targetGenerator)||void 0===r?void 0:r.destroy)||void 0===n||n.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 ln(this,void 0,void 0,(function*(){this.originGenerator.removeStream(),this.endCompleteDeferred||(this.endCompleteDeferred=new sn),yield this.endCompleteDeferred.promise}))}resolveEndCompleteDeferred(){this.endCompleteDeferred&&this.endCompleteDeferred.resolve(),this.endCompleteDeferred=null}addFrameCallback(e){this.frameCallback=e}getTargetGenerator(){return this.targetGenerator}}class un extends dn{constructor(e,t,r){super(e,t,r),this.processorName=e,this.port=t,this.config=r}onFrame(e){this.port.postMessage({cmd:Jr.FRAME_DATA,frame:e,processorName:this.processorName})}addFrameCallback(e){this.frameCallback=e}removeFrameCallback(){this.frameCallback=null}}var _n=function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{l(n.next(e))}catch(e){a(e)}}function s(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}l((n=n.apply(e,t||[])).next())}))};class hn{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 cn))}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 _n(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 n=this.shareCallbackMap.get(e);n&&t.addCallback(n),this.shareProcessorAgentMap.set(e,t)}static stopProcessor(e){return _n(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)}}function fn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}hn.shareProcessorAgentMap=new Map,hn.shareProcessorOptionsMap=new Map,hn.shareFrameCallbackMap=new Map,hn.shareCallbackMap=new Map;const pn=r(1668);var mn;self.wasmSuccessEvent=12,self.wasmFailEvent=-12,self.downloadAndInstantiateWebAssembly=async function(e,t){try{const r=await new Promise(((e,t)=>{const r=n=>{let i=n.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 n=await WebAssembly.instantiate(r,e);n.instance?(self.wasmModuleToShare=n.module,t(n.instance)):(self.wasmModuleToShare=r,t(n))}catch(e){j("IF"),V("E:H Failed to download and instantiate WASM file: ".concat(wasmUrl),e)}},self.onunhandledrejection=e=>{V("Unhandled rejection in worker: ".concat(JSON.stringify(e.reason)),e.reason instanceof Error?e.reason:null)};var gn,vn,yn,bn,wn,En,Sn,Mn,xn,Tn,Rn,kn,An,Cn,Fn,Pn,In,On,Ln,Dn,Un,Nn,Wn,Bn,Gn,jn,Hn,Vn,zn,$n,qn,Yn,Xn,Kn,Zn=150,Qn=new Map,Jn=!1,ei=!1,ti=0,ri=0,ni=0,ii=!1;const ai=new class{constructor(e){gr(this,wr,""),gr(this,Er,new Tt),gr(this,Sr,new mr),gr(this,Mr,new Ft),gr(this,xr,null),yr(wr,this,e),vr(Sr,this).setGPUResourceMgrGetter((()=>this.getWebGPUResMgr()))}isEnableCanvasAlphaChannel(){return vr(Sr,this).isEnableCanvasAlphaChannel()}setCanvasAlphaChannelEnability(e){vr(Sr,this).setCanvasAlphaChannelEnability(e)}async evalRendererType(e){const t=await vr(Er,this).evaluate(e);console.log("[RenderManager] rendererType is ".concat(t))}getVideoRenderDisplay(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;const a=vr(Er,this).getRendererType(),o=vr(Er,this).acquireRenderer(e,this.getWebGPUResMgr(a));return vr(Sr,this).getVideoRenderDisplay(a,e,t,r,n,o,i)}getRenderDisplay(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;const a=vr(Er,this).getRendererType(),o=vr(Er,this).acquireRenderer(e,vr(xr,this));return vr(Sr,this).getRenderDisplay(a,e,t,o,i)}createWebGLVideoRenderDisplay(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return vr(Er,this).isWebGL2RendererType()?vr(Sr,this).getWebGL2RenderDisplayMgr().createVideoRenderDisplay(e,t,r,null,n):vr(Er,this).isWebGLRendererType()?vr(Sr,this).getWebGLRenderDisplayMgr().createVideoRenderDisplay(e,t,r,null,n):(Qe("Can not create webgl display!!"),null)}createVideoRenderDisplay(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;const i=vr(Er,this).getRendererType(),a=vr(Er,this).acquireRenderer(e,this.getWebGPUResMgr(i));return vr(Sr,this).createVideoRenderDisplay(i,e,t,r,a,n)}recycleRenderDisplay(e,t,r){const n=vr(Er,this).getRendererType();vr(Sr,this).recycleRenderDisplay(n,e,t,this.getWebGPUResMgr(n),r)}renderFor(e){if(vr(Er,this).isWebGPURendererType()){const t=vr(Er,this).getRendererType(),r=vr(Sr,this).collectInUseRenderDisplays(t,e);r&&r.forEach((e=>{const r=vr(Er,this).acquireRenderer(e.canvas,this.getWebGPUResMgr(t));vr(Mr,this).render(r,e.renderDisplays)}))}}renderWith(e){if(vr(Er,this).isWebGPURendererType()){const t=e.getAttachedCanvas();if(t){const r=vr(Er,this).getRendererType(),n=vr(Er,this).acquireRenderer(t,this.getWebGPUResMgr(r)),i=[];i.push(e),vr(Mr,this).render(n,i)}}}getRenderDisplayMap(e){const t=vr(Er,this).getRendererType();return vr(Sr,this).getRenderDisplayMap(t,e)}onRestoredFromContextLost(e,t,r,n,i){let a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null;return vr(Er,this).isWebGLRendererType()||vr(Er,this).isWebGL2RendererType()?vr(Sr,this).onRestoredFromContextLost(e,t,r,n,i,a):null}destroyUnusedVideoFrame(e){"undefined"!=typeof VideoFrame&&e instanceof VideoFrame&&vr(Er,this).isWebGPURendererType()&&e.close()}getRendererProvider(){return vr(Er,this)}getRenderDisplayManager(){return vr(Sr,this)}getWebGPUResMgr(e){if(vr(xr,this))return vr(xr,this);if(2===e){const e=dt.getModule("webgpu_renderer_dynmod");yr(xr,this,e.exports.createWebGPUResManager()),vr(xr,this).addRendererProviderModule(vr(Er,this)),vr(xr,this).setLabel(vr(wr,this))}return vr(xr,this)}cleanup(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];vr(Er,this)&&vr(Er,this).cleanup(),vr(Sr,this)&&vr(Sr,this).cleanup(e,t,r),r||vr(xr,this)&&vr(xr,this).cleanup()}clearOffscreenCanvas(e){vr(Sr,this)&&vr(Sr,this).cleanupByCanvas(e)}}("sharing"),oi="meetingNumber";var si,li,di,ci,ui=null,_i=new class{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}}(-129,!0);self.onWasmModuleReady=()=>{mn=Module.cwrap("_Sharing_Encode","number",["number","number","number","number","number","number"]),wn=Module.cwrap("_Sharing_Encode_Mouse_Data","number",["number","number","number"]),gn=Module.cwrap("_Sharing_Encode_Uninit","number",["number"]),vn=Module.cwrap("_Sharing_Encode_Try_Analysis","number",["number","array","number"]),yn=Module.cwrap("_Sharing_Encode_Try_Analysis","number",["number","number","number"]),bn=Module.cwrap("_Sharing_Encode_Init","number",["number","number","number","number","number","number","boolean","boolean","boolean"]),En=Module.cwrap("_Sharing_Set_Data_Encryption","number",["number","number"]),On=Module.cwrap("_Request_Sharing_Qos_Data","number",["number","boolean","boolean"]),Sn=Module.cwrap("_Sharing_Pause_Encode","number",["number"]),Module.cwrap("_Sharing_Stop_Encode","number",["number"]),Mn=Module.cwrap("_Sharing_Resume_Encode","number",["number"]),xn=Module.cwrap("_Sharing_Websocket_Speed","number",["number","number"]),Tn=Module.cwrap("_Add_Sharing_Cooker_info","number",["number","number","number","number"]),kn=Module.cwrap("_Get_Sharing_Meat_Weight","number",["number"]),Rn=Module.cwrap("_Remove_Sharing_Cooker_Info","number",["number","number"]),An=Module.cwrap("_Set_Sharing_Encryption_Key_Directly","number",["number","number","number","number"]),Cn=Module.cwrap("_Add_Roster_Info_Directly","number",["number","number","number","number"]),Fn=Module.cwrap("_Add_Rev_Channel","number",["number","number","number","number"]),Pn=Module.cwrap("_Remove_Rev_Channel","number",["number","number"]),In=Module.cwrap("_update_sharing_uplink_bandwidth_limitation_by_server","number",["number","number"]),Dn=Module.cwrap("_set_annotation_action","number",["number","number","number","number"]),Nn=Module.cwrap("_collect_sharing_monitor_info","number",["number","boolean","boolean"]),Wn=Module.cwrap("_Change_Connect_Type_For_Sharing","number",["number","number"]),Bn=Module.cwrap("_request_nack_t_periodically_for_sharing_qos","number",["number"]),li=Module.cwrap("_Jpeg_Init","number",[]),Module.cwrap("_Jpeg_Uninit","number",["number"]),di=Module.cwrap("_Jpeg_HeardInfo","number",["number","number","number"]),ci=Module.cwrap("_Jpeg_Decode","number",["number","number","number","number","number","number"]),Ln=Module.cwrap("_set_sharing_network_info","number",["number","boolean","boolean","number","number","number","number","number","number","number"]),zn=Module.cwrap("_set_mmr_signature_info","number",["number","number","array","number"]),$n=Module.cwrap("_set_singature_info","number",["number","number","number"]),qn=Module.cwrap("_set_meeting_uuid_for_signature","number",["number","number","string","number"]),Yn=Module.cwrap("_update_signagure_verify_action","number",["number","number","boolean"]),Kn=Module.cwrap("_set_sharing_statistics_flag","number",["number","boolean"]),Xn=Module.cwrap("_set_sharing_bandwidth_alloc","number",["number","boolean","number","number"]),Module._malloc=function(){let e=Module.asm.malloc.apply(null,arguments);return e||ii||(ii=!0,j("MEMERR:SHARE-".concat(Qi,"-").concat(wasmMemory.buffer.byteLength,"-").concat(arguments[0])),V("memry malloc error",new Error("memry malloc error SHARE-".concat(Qi,"-").concat(wasmMemory.buffer.byteLength,"-").concat(arguments[0])))),e},"undefined"!=typeof _malloc&&(_malloc=Module._malloc)};var hi,fi,pi,mi,gi,vi,yi,bi,wi,Ei,Si,Mi=0,xi=null,Ti=0,Ri=0,ki=0,Ai=8e5,Ci=null,Fi=null,Pi=null,Ii=null,Oi=null,Li=!1,Di=!1,Ui=!1,Ni=null,Wi=!1,Bi=0,Gi=0,ji=0,Hi=0,Vi=new ge,zi=(new ge,0),$i=2e4,qi=!1,Yi=!1,Xi=null,Ki=null,Zi=null,Qi=!1,Ji=new ge,ea=ae,ta=!1,ra=!1,na=1,ia=!1,aa=0,oa=new class{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}}},sa=!1,la=ce.DESKTOP_SOURCE,da=0,ca=null,ua=null,_a=0,ha=null,fa=0,pa=null,ma=0,ga=0,va=!1,ya=[],ba=[],wa=[],Ea=0;function Sa(e,t){postMessage({status:c,data:"".concat(e,":").concat(t)})}function Ma(e,t){j("".concat(e,":").concat(t,":F"))}var xa=new Oe({tag:"WCL_M,ASRENDER_ERR",interval:1e4,reportcallback:function(e,t,r,n){Sa(e,"".concat(t,",").concat(r,",").concat(n))}}),Ta=new He({tag:"WCL,AS",report_call:Sa});function Ra(e){if(j("WSURL:false:".concat(e.replace(/(\/media\/)\d+/,"$1".concat(oi)))),Ci)return void Ci.resetURL(e);const t=Lr.SHARE_ENCODE;var r=new $r(e,t);return r.setOnMessage(Ca),r.onopen=ka,r.onclose=Fa,r.oncommand=Ia,Ci=r,r}function ka(){postMessage({status:l})}Ta.threshold=300;let Aa=!0;function Ca(e){let t;if(e instanceof Uint8Array){if(t=e,!(t.length<4))if(37!==t[0]){if(102!=t[0]){if(t[0]==ue.SHARE_REMOTE_CONTROL_UAC_JPEG_FRAME){if(!Jn||!Pi||la!=ce.UAC_SOURCE)return;let e,r=0;if(Aa?(e=pn.inflate(Buffer.from(t.subarray(4,t.length)),{windowBits:31}),r=e.length):r=t.length-4,r>_a&&(ua&&Module._free(ua),_a=3*r/2,ua=Module._malloc(_a)),!ua)return _a=0,void console.error("Couldn't allocate memory");let n=Aa?e:t.subarray(4,t.length);writeArrayToMemory(n,ua);let i=di(ca,ua,r);if(!i)return;let a=65535&i,o=i>>16&65535,s=a*o*4;if(s>fa&&(ha&&Module._free(ha),fa=s,ha=Module._malloc(s)),!ha)return fa=0,void console.error("Couldn't allocate memory");if(da++,i=ci(ca,ua,r,o,a,ha),0!=i)return;return ss(o,a),1!=bi&&(bi=1),void mn(Pi,ha,s,o,a,bi)}if(t[0]!=ue.SHARE_REMOTE_CONTROL_UAC_MOUSE)if(111!=t[0])if(109!=t[0])if(0==t[0])Ci&&Ci.send(t);else if(Pi)if(Di){if(t instanceof Uint8Array){Vi.enqueue(t);let e=Vi.dequeue();for(;e;)vn(Pi,e,e.length),e=Vi.dequeue()}}else po(t.buffer);else t instanceof Uint8Array&&0!=t[0]&&Vi.enqueue(t);else Ii&&vn(Ii,t,t.length);else 1==t[4]?(j("UAC_START"),da=0,ca||(ca=li()),la=ce.UAC_SOURCE):(j("UAC_STOP"),j("UAC_ASCAPTURE:".concat(da)),la=ce.DESKTOP_SOURCE,Ui=!0,ha&&Module._free(ha),ha=null,fa=0,ua&&Module._free(ua),ua=null,_a=0,pa&&Module._free(pa),pa=null,ma=0);else if(Pi&&Jn&&la==ce.UAC_SOURCE){if(t.length>ma&&(pa&&Module._free(pa),ma=3*t.length/2,pa=Module._malloc(ma)),!pa)return void(ma=0);writeArrayToMemory(t,pa),wn(Pi,pa,t.length)}}}else postMessage({status:R,data:t})}else V("sharing_websocket_on_message: Unsupported data type ".concat(e instanceof Object?typeof e.data:typeof e))}function Fa(e){Oa("sharing_websocket_on_close")}function Pa(e){Oa("sharing_websocket_on_error")}function Ia(e){const{cmd:t}=e;switch(t){case A:{const{rtt:t,jitter:r,avg_loss:n,max_loss:i,bandwidth:a,rate:o,issend:s,ismain:l,lost_packet_num:d}=e;let c=l?Ye():Pi;c&&Ln(c,s,l,t,r,n,i,a,o,d);break}case k:postMessage({status:L}),V("NetWork is Bad, Don't to reconnect the serer!");break;case P:{const{type:t,networkLevel:r,bwLevel:n}=e;postMessage({status:I,isUplink:0===t,networkLevel:r,bwLevel:n});break}case C:{const{bandwidth:t,lostrate:r,issend:n}=e;Pi&&Xn(Pi,n,t,r);break}}}function Oa(e){console.log(e)}function La(e,t){var r=new Uint8Array(t),n=q().subarray(e+0,e+t);r.set(n,0,t),postMessage({status:E,data:r},[r.buffer])}function Da(e,t,r){postMessage({status:I,isUplink:0===e,networkLevel:t,bwLevel:r})}function Ua(e,t,r){var n=new Uint8Array(r+8),i=q().subarray(t+0,t+r);n.set(i,8),n[0]=109;var a=new Uint32Array(1);a[0]=e;var o=new Uint8Array(a.buffer);n.set(o,4),te(Ci,n),_i.setRtpPackets()}function Na(e,t){Bo&&Bo.writeWasmLog(e,t)}var Wa,Ba,Ga={sharingqosIntervalId:0,sharingmonitorPanelFlag:!1,panelpollingInterval:0},ja={sharingStatisticsFlag:!1},Ha=!0;function Va(){Ga.sharingqosIntervalId&&clearInterval(Ga.sharingqosIntervalId),Ga.sharingmonitorPanelFlag&&(Ga.sharingqosIntervalId=setInterval((()=>{if(Qi&&!Ha&&Pi)On(Pi,!0);else if(!Qi&&(!qi||Yi)){let e=va?Ye():Pi;e&&On(e,!1)}}),Ga.panelpollingInterval||ie))}function za(e){Qi&&Pi?Kn(e):Qi||Kn(e)}function $a(e,t,r,n,i,a,o,s,l){Ga.sharingmonitorPanelFlag&&postMessage({status:D,data:{width:e,height:t,fps:r,rtt:n,jitter:i,avg_loss:a,max_loss:o,bandwidth:s,rate:l}})}var qa=new Map,Ya=-1,Xa=-1;function Ka(e,t,r,n,i,a,o,s,l,d,c,u,_,f){let p=!(f==Pi);va=p,qa.get(n)||(qa.set(n,!0),postMessage({status:b,ssrc:n}));var g=q().subarray(e+0,e+t),v=Y().subarray(r,r+8),y=0;for(let e=0;e<8;e++)y+=v[e]*Math.pow(256,e);var w=n,E=i,S=a;if(st.isUseSsrcStream()){let e=g;st.shouldCropWasmFrame(i,a,{x:o,y:s,width:l,height:d})&&(e=ne(g,i,a,{x:o,y:s,width:l,height:d}),E=l,S=d,o=0,s=0),$o.pushSharingVideoData(n,e,"I420",E,S,{left:o,top:s,width:l,height:d});const t=1===$o.getSinksCount("sharing");t?c==Ya&&u==Xa||(postMessage({status:m,logicWidth:c,logicHeight:u,absWidth:l,absHeight:d,updateRemoteInfo:t}),Ya=c,Xa=u):(Ya=-1,Xa=-1)}else if(qi){if(!Yi)return;if(t>Wa)return void xa.timeoutReport(0,performance.now());let e=new Q(Ba);if(e.storeSync(g)){var M={yuvdata:e,ntptime:y,ssrc:w,width:E,height:S,r_x:o,r_y:s,r_w:l,r_h:d,logic_w:c,logic_h:u,yuv_limited:_,isFromMainSession:p};Zi&&Zi.Put_Sharing_Data_From_Queue(M,5)}}else{const e=new Uint8Array(g);postMessage({status:h,data:e,sharing_timestamp:y,sharing_ssrc:w,sharing_width:E,sharing_height:S,rendering_x:o,rendering_y:s,rendering_w:l,rendering_h:d,logic_w:c,logic_h:u,yuv_limited:_,isFromMainSession:p},[e.buffer])}}function Za(e,t,r,n,i,a,o,s,l,d,c,u){const _=new Uint8Array(t);var h=q().subarray(e+0,e+t);_.set(h,0);var p=n,m=i,g=a;let v=!(u==Pi);const y=c>>>0;if(st.isUseSsrcStream())$o.pushRemoteCursorFrame(p,_,m,g,y),$o.pushRemoteCursorPosition(p,o,s,l,d);else if(qi){if(Zi){var b={type:"mouse_data",buffer:_,ntptime:r,ssrc:p,width:m,height:g,r_x:o,r_y:s,mLogic_w:l,mLogic_h:d,sync_id:y,isFromMainSession:v};Zi.Put_Mouse_Data_Into_Queue(b)}}else postMessage({status:f,data:_,mouse_timestamp:r,mouse_ssrc:p,mouse_width:m,mouse_height:g,mouse_x:o,mouse_y:s,mLogic_w:l,mLogic_h:d,sync_id:y,isFromMainSession:v},[_.buffer])}function Qa(e,t,r,n){postMessage({status:p,ssrc:e,size:t,isFromMainSession:!(r==Pi),videomode:n})}function Ja(e){_i.setSubForMe(e)}function eo(e,t,r,n){if(Qi||++ti%24e4==0&&postMessage({status:c,data:"WCL_M,RTCPSN"+ti}),t&&r){if(ra&&(77==e[0]||79==e[0])&&!ta){ea=oe;for(var i=0;i<na;i++)PThread.allocateUnusedWorker(),PThread.loadWasmModuleToWorker(PThread.unusedWorkers[i],(function(){++aa==na&&(ea=se)}));ta=!0}if(ea==ae)n?yn(t,n,e.length):r(t,e,e.length);else if(ea===oe)Ji.enqueue(e);else if(ea===se){let n=Ji.dequeue();for(;n;)r(t,n,n.length),n=Ji.dequeue();r(t,e,e.length)}}}function to(e){if(e.ssid!=gi&&Pi&&(gn(Pi),Pi=null),!Pi){let t,r=yi;t=r?r.length:0;let n=0;if(n=Io(r),Pi=bn(e.ssid,0,0,n,t,ga,!1,!0,!1),function(){var e;const t={cmd:197,appid:2,enable:!0};null===(e=Ci)||void 0===e||e.sendCommand(t)}(),Oo(n),!Pi)return void postMessage({status:O});gi=e.ssid,Ei&&Do(Pi,Ei.updateParams.userId,Ei.updateParams.sn,Ei.updateParams.encryptKey,Ei.updateParams.encryptType),En(Pi,Wi?1:0)}Ui=!0,wi?wi&&oa.reader&&Ni&&(Ni=null):postMessage({status:d}),To()}function ro(){return ra?1:0}function no(){return navigator.hardwareConcurrency||1}function io(){return 1}function ao(){return 1}function oo(){return!1}function so(){return!1}function lo(){return!1}function co(){return 0}function uo(){return Hn}function _o(){return Vn}function ho(){return 1}function fo(){return 3}function po(e){e instanceof ArrayBuffer&&eo(new Uint8Array(e),Pi,vn)}function mo(){return 1}function go(e,t){var r=new Uint8Array(t),n=q().subarray(e+0,e+t);r.set(n,0,t)}function vo(e,t){Bo&&Bo.writeWasmLog(e,t)}function yo(e){var t,r,n,i,a,o;for(t="",n=e.length,r=0;r<n;)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:a=e[r++],t+=String.fromCharCode((31&i)<<6|63&a);break;case 14:a=e[r++],o=e[r++],t+=String.fromCharCode((15&i)<<12|(63&a)<<6|63&o)}return t}var bo=0,wo=Zn,Eo=!1,So=0;const Mo=5;function xo(e){if(0!==bo?(wo=performance.now()-bo)>=Zn&&(bo=performance.now()):bo=performance.now(),("over_run"===e||wo+Mo>=Zn)&&Ui&&!Ha)Ui=!Ui,wi&&oa.reader?(Ni&&(Ni=null),oa.reader.read().then((async function(e){let{done:t,value:r}=e;if(t)return V("sharing capture videoframe is done status"),void(Ui=!0);let n={data:r};Eo=!1,clearTimeout(So),So=0,await Lo(n),Eo&&(So=setTimeout((()=>{Eo=!1,So=0,xo("over_run")}),0))})).catch((e=>{Ui=!0,V("Error trying to process sharing frame",e)}))):Ni?(Co(Ni),Ni=null):postMessage({status:d});else{Eo=Eo||!Ui&&wo>=Zn;let t=performance.now();if(ri&&ni&&ji&&t-ri>3e3){if(ri=t,la!=ce.DESKTOP_SOURCE)return;mn(Pi,ji,ni,Bi,Gi,bi),j("SHARING_STATUS:c=".concat(Ui,",p=").concat(Ha,",r=").concat(e||"unknown"))}}}function To(){zi||(zi=setInterval((function(){xo()}),40))}function Ro(e){var t;if(xi){var r=(new Date).getTime()/1e3;if((t=r-xi)>10){var n=Ti-Ci.socket.bufferedAmount;0==Ci.socket.bufferedAmount?(ki=ki?.8*ki+.2*Ai:Ai,Pi&&xn(Pi,ki)):(Ri=8*n/(1*t),ki=ki?.8*ki+.2*Ri:Ai,Pi&&xn(Pi,ki)),Ti-=n,xi=r}}else Ti=0,xi=(new Date).getTime()/1e3,Pi&&xn(Pi,Ai);Ti+=e.length}function ko(){var e=Mi+Ti-$i/2;return 0==Hi||e<=0?0:Hi>0?e/Hi:void 0}function Ao(e,t){var r=new Uint8Array(t),n=q().subarray(e+0,e+t);r.set(n,0,t),postMessage({status:u,data:yo(r)})}function Co(e){!Li&&e?postMessage({status:d,data:e.data},[e.data.buffer]):postMessage({status:d})}function Fo(e){Hi=Hi?(Hi+e)/2:e}function Po(e,t){vi||(vi=setInterval((function(){Pi&&kn(Pi)}),6e4));let r=new Uint8Array(t),n=q().subarray(e+0,e+t);r.set(n,0,t),yi=r,postMessage({status:g,data:r})}function Io(e){if(!e)return 0;let t=Module._malloc(e.length);return Y().subarray(t,t+e.length).set(e,0,e.length),t}function Oo(e){e&&Module._free(e)}async function Lo(e){if((arguments.length>1&&void 0!==arguments[1]?arguments[1]:ce.DESKTOP_SOURCE)<la){if(e&&e.data&&e.data.format)try{e.data.close()}catch(e){}return void V("UAC sharing capture format error")}if(ri=performance.now(),Ta.captureSample(),ea==ae||ea==se);else if(ea==oe)return Ui=!0,void(e.data&&wi&&(Ta.closeSample(),e.data.close()));const t=e&&e.data&&wi;if(!Pi)return void(t&&e.data.close());let r={data:null,width:0,height:0};if(t){let t=e.data,r=null,n=0,i=0,a=0,o=0,l=0,d=0,c=0,u=function(e){let t={rect:{x:0,y:0,width:0,height:0}};return e.visibleRect.left%2!=0?t.rect.x=e.visibleRect.left-1:t.rect.x=e.visibleRect.left,e.visibleRect.top%2!=0?t.rect.y=e.visibleRect.top-1:t.rect.y=e.visibleRect.top,e.visibleRect.width%2!=0?t.rect.width=e.visibleRect.width-1:t.rect.width=e.visibleRect.width,e.visibleRect.height%2!=0?t.rect.height=e.visibleRect.height-1:t.rect.height=e.visibleRect.height,t}(t);"I420"==t.format?(2!=bi&&(bi=2),o=u.rect.width,l=u.rect.height,d=o,c=l,n=o*l,i=o*l/4,a=o*l/4,ni=o*l*3/2,ss(d,c)&&(ji&&Module._free(ji),ji=Module._malloc(ni)),r=Y().subarray(ji,ji+ni),await t.copyTo(r,u),Pi&&mn(Pi,ji,ni,Bi,Gi,bi)):"NV12"==t.format?(3!=bi&&(bi=3),o=u.rect.width,l=u.rect.height,d=o,c=l,n=o*l,i=o*l/2,ni=o*l*3/2,ss(d,c)&&(ji&&Module._free(ji),ji=Module._malloc(ni)),r=Y().subarray(ji,ji+ni),await t.copyTo(r,u),Pi&&mn(Pi,ji,ni,Bi,Gi,bi)):"BGRA"==t.format||"RGBA"==t.format?(o=u.rect.width,l=u.rect.height,d=o,c=l,ni=o*l*4,ss(d,c),ji&&Module._free(ji),ji=Module._malloc(ni),r=Y().subarray(ji,ji+ni),await t.copyTo(r,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?fn(Object(r),!0).forEach((function(t){s(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},u)),bi=4,"RGBA"==t.format&&(bi=1),Pi&&mn(Pi,ji,ni,Bi,Gi,bi)):t.format&&(console.log("dataformat:",t.format,"is not supported"),sa||(sa=!0,postMessage({status:w,format:t.format}))),Ta.closeSample(),t.close()}else r=e;r&&r.data&&Pi&&(ss(r.width,r.height)&&(ji&&Module._free(ji),ji=Module._malloc(4*Bi*Gi)),1!=bi&&(bi=1),Y().subarray(ji,ji+4*Bi*Gi).set(r.data,0,r.data.length),mn(Pi,ji,r.data.length,Bi,Gi,bi)),Ui=!0,r&&r.data&&(Ni=r)}function Do(e,t,r,n,i){let a=Io(n);An(e,a,n.length,i),Oo(a),a=Io(r),Cn(e,t,a,r.length),Oo(a)}function Uo(e,t){var r=q().subarray(e+0,e+t);postMessage({status:c,data:yo(r)})}function No(e,t,r,n,i,a,o){let s=new Uint8Array(r+4),l=Y().subarray(t+0,t+r);s[0]=n,s[1]=i,o!=Pi&&null!=Pi&&(s[1]=2|s[1]),s.set(l,4),te(o!=Pi&&null!=Pi?Fi:Ci,s)}function Wo(e,t){if(e){if(37===e[0]){let t=new Uint8Array(e);return void postMessage({status:R,data:t})}eo(e,Pi,vn,t)}}var Bo=null;var Go=0;self.addEventListener("message",(function(e){var t,r,n,i,a,o,s,l=e.data;switch(l.command){case 1:j("STARTMEDIA:".concat(function(e){let t=e.confId,r=!!e.isPreviewMode?1:0;return r|=Ko()?2:0,"".concat(t,":").concat(r)}(l)));try{if(Un||(Un=setInterval((()=>{let e=va?Ye():Pi;Jn&&e&&Nn(e,!!Qi)}),1e3)),l.isPreviewMode)break;Ko()||(Xo=!1,j("RSTHOLD")),function(e){let t=e;if(Go=e._id,Ea=e.currentTime-performance.now(),Hn=e.graphicalname,Vn=e.vendorname,hi=e.meetingnumb+"",fi=e.meetingid,na=e.multiThreadNum,ga=e.uplimit?e.uplimit:0,Qi=!!e.encode,mi=e.confId,Di=Qi,t.isSafari,Li=!!e.isChromeOrEdge,ra=na>1,Xe=lt,ot.init(e.renderUserAgentInfo),nt.init(e.renderCapabilitiesDesc),st.init(e.renderConfigDesc),4===e.rendererType&&(st.setIsUseSsrcStream(!0),!Qi)){const t=dt.loadModuleFromBlob("wasm_ssrc_stream_service_dynmod",e.wasmSsrcStreamServiceDynmodBlob);zo=t,$o=zo.exports.getWasmSsrcStreamPublisher(),zo.exports.setRegistryServicePort(e.registryServicePort),zo.exports.exposeService("sharing")}}(l),qo||(o=Qi?xe.SHARING_ENCODE:xe.SHARING_DECODE,Bo||null===(s=Bo=function(){let e=!1;try{e=!1}catch(e){}return e?new Ae:null}())||void 0===s||s.init({workerType:o}),qo=!0),function(e){ai.getRendererProvider().setRendererType(e.rendererType),e.rendererDynModBlob&&ai.getRendererProvider().loadRenderModuleFromBlob(e.rendererType,e.rendererDynModBlob),ai.setCanvasAlphaChannelEnability(e.isEnableCanvasAlphaChannel),ai.getRendererProvider().isWebGPURendererType()&&ai.getWebGPUResMgr(2).initialize()}(l),function(e){if(!e.websocket_ip_address)return;let t=e.websocket_ip_address+"&mode=1";var r,n;Qi&&(t=e.websocket_ip_address.slice(0,e.websocket_ip_address.length-42)+"s"+e.websocket_ip_address.slice(e.websocket_ip_address.length-41,e.websocket_ip_address.length)+"&mode=2"),Qi?!Qi||(r=Ci,!(n=t)||r&&r.url==n)||Ra(t):function(e){if(Qi)return;if(j("WSURL:false:".concat(e.replace(/(\/media\/)\d+/,"$1".concat(oi)))),Ci)return void Ci.resetURL(e);let t=new $r(e,Lr.SHARE_DECODE);t.setOnMessage(Wo),t.onopen=ka,t.onclose=Fa,t.oncommand=Ia,Ci=t,(ns.sender||ns.reciver)&&Ci.setSabBuffer(ns.sender,ns.reciver)}(t)}(l),Qi||(Ba||(Ba=new Z(5,Wa=15728640)),Yo()),postMessage({status:Pi||Qi?16:O})}catch(e){postMessage({status:O}),V("sharing startr media error",e)}break;case 2:Un&&(clearInterval(Un),Un=null),Pi&&gn(Pi),Pi=null,Oi&&gn(Oi),Oi=null,close();break;case"ENCRYPT":Wi=l.encrypt,Pi&&En(Pi,Wi?1:0);break;case 11:Ga.panelpollingInterval=l.data.pollingInterval,Ga.sharingmonitorPanelFlag=l.data.enable,Va();break;case 160:ja.sharingStatisticsFlag=l.data.enable,za(ja.sharingStatisticsFlag);break;case"start_share_processor":hn.startProcessor(l.name,new un(l.name,si));break;case"share_processor_message_port":si=l.data;break;case"stop_share_processor":hn.stopProcessor(l.name);break;case"startSharingEncode":Jn=!0,bi=1,wi=!!l.isSupportMediaStreamTrackProcessor,ra&&ea==ae?function(e){if(ra&&!ta){ea=oe;for(var t=0;t<na;t++)PThread.allocateUnusedWorker(),PThread.loadWasmModuleToWorker(PThread.unusedWorkers[t],(function(){++aa==na&&(ea=se,ta=!0,to(e))}))}}(l):to(l),Ta.start(),Ha=!1,l.isWhiteboardSharing||_i.startCheck();break;case"stopsharingencode":oa.closeReadStream();break;case"frameStream":oa.setReadStream(l.data);break;case 12:oa.createReadStream(l.data);break;case"encodeSharingFrame":l&&Lo(l);break;case"pause":Pi&&Sn(Pi),Ui=!1,bo=0,Ha=!0,_i.stopCheck();break;case"stopsharing":Zo();break;case"resume":Pi&&Mn(Pi),Lo({data:null}),bo=0,Ha=!1,_i.startCheck();break;case"SOCKET_RECONNECT":self.IS_DISABLE_SOCKET_RECONNECT=!0===l.disable;break;case"SharingPlayStatus":Yi=l.isSharingPlayWork;break;case 16:{var d;j("ASCANVAS:".concat(l.ssrc,":").concat(l.isFromMainSession,":").concat(l.rendercanvasID,":").concat(!!l.canvas)),Yi=!0,qi=!0;const e=l.isCreateSharingWaterMark,t=l.sharingWaterMarkName;if(pi=l.ssrc,Ki||(Ki=new OffscreenCanvas(0,0)),ui||(ui=new De({timeout:3e4,tag:"ASRENDER",callback:Ma})),Zi||((Zi=new Me(Object.assign({},{Notify_APPUI:null,PubSub:null,jsMediaEngine:null,renderManager:ai}))).statisticObj=ui,self.SharingRenderObj=Zi),Zi.addRender(l.ssrc,l.zone,l.isFromMainSession,l.canvas,l.rendercanvasID,l.viewPort),Zi.Change_Current_SSRC(pi,l.isFromMainSession),Zi.Set_WaterMark_Info({waterMarkCanvas:Ki,isCreateSharingWaterMark:e,sharingWaterMarkName:t,watermarkOpacity:l.watermarkOpacity,watermarkRepeated:l.watermarkRepeated,watermarkPosition:l.watermarkPosition}),Xi&&clearInterval(Xi),!st.isUseSsrcStream()){var c=Zi.No_Bindthis_Interval.bind(Zi);Xi=setInterval(c,50),self.sharingRenderInterval=Xi}null===(d=Zi.statisticObj)||void 0===d||d.start()}break;case 15:{var u;const{ssrc:e,zone:t=0,isFromMainSession:r}=l;var _;e?Zi.removeRender(e,t,r):Zi.removeAllRender(),null!==(u=Zi)&&void 0!==u&&u.isHasRender()&&e||(Jn=!1,Yi=!1,null===(_=Zi)||void 0===_||null===(_=_.statisticObj)||void 0===_||_.stop(),Xi&&(clearInterval(Xi),Xi=null),jn&&(clearInterval(jn),jn=0),qa=new Map)}break;case 19:qa.delete(l.ssrc);break;case 14:var h;null===(h=Zi)||void 0===h||h.updateViewPort(l);break;case 17:j("ASU:".concat(l.ssrc,":").concat(!!l.isFromMainSession)),pi=l.ssrc,Zi||(Zi=new Me(Object.assign({},{Notify_APPUI:null,PubSub:null,jsMediaEngine:null,renderManager:ai}))),Zi.Change_Current_SSRC(pi,l.isFromMainSession);break;case 129:{let e=l.data.userNodeList;e&&e.forEach((e=>{let t=parseInt(e.userid);if(e.bremove)return void(Pi&&Rn(Pi,t));let r=e.sn;if(16!=r.length&&32!=r.length)return;let n=Io(r);if(Pi){let e=!1;Qi&&mi!=t||(e=!0),e&&Tn(Pi,t,n,r.length)}Oo(n)}));break}case 18:{const{id:e,width:t,height:r}=l.data;Zi&&(Zi.setOnlyAcceptUISize(!0),Zi.updateOffscreenCanvasSize(e,t,r,!0));break}case"BUILD_MS_CHANNEL_IN_BO":t=is,r=l.data,n=eo,i=vn,Ue=t(r,Ve,ze,$e),Be=n,We=i;break;case"SHARING_REMOVE_REV_CHANNEL_TYPE":{let e=l.data;j("ASD:".concat(e.ssrc,":").concat(!!e.isFromMainSession)),e.isFromMainSession?Ne&&os(Ne,e.ssrc):Pi&&os(Pi,e.ssrc)}break;case 157:{let e=l.data;j("ASC:".concat(e.ssrc,":").concat(!!e.isFromMainSession)),e.isFromMainSession?Ye()?qe(as,e):ya.push(e):Pi?as(Pi,e.ssrc,e.streamIndex,e.videoMode):ba.push(e)}break;case 9:{let e=l.data;if(e.isFromMainSession)Oi=function(e,t,r,n,i){if(Ge=n,je=i,e){Ne=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 n=Ge(r.encryptKey);return t(Ne,n,r.encryptKey.length,r.encryptType),je(n),Ne}return 0}(bn,An,e.updateParams,Io,Oo),ya.length>0&&(V("retry add recv channel for master share"),ya.forEach((e=>{qe(as,e)})),ya=[]),Wn(Oi,2);else if(Ei=e,Di)Pi&&Do(Pi,Ei.updateParams.userId,Ei.updateParams.sn,Ei.updateParams.encryptKey,Ei.updateParams.encryptType);else if(Pi){let t=Io(e.updateParams.encryptKey);An(Pi,t,e.updateParams.encryptKey.length,e.updateParams.encryptType),Oo(t)}}break;case 10:{let e=l.data;if(e.isFromMainSession)!function(e,t){if(Ne&&t.body){if(t.body.add){let r=0,n=t.body.add;for(;r<n.length;r++){let t=Ge(n[r].sn);e(Ne,n[r].userid,t,n[r].sn.length),je(t)}}t.body.remove}}(Cn,e);else if(Pi&&e.body){if(e.body.add){let t=0,r=e.body.add;for(;t<r.length;t++){let e=Io(r[t].sn);Cn(Pi,r[t].userid,e,r[t].sn.length),Oo(e)}}e.body.remove}}break;case"SWITCH_WATER_MARK_FLAG":if(st.setIsSharingHasWaterMark(l.isCreateSharingWaterMark),st.setSharingWatermarkInfo({name:l.videoWaterMarkName,opacity:l.watermarkOpacity,repeated:l.watermarkRepeated,position:l.watermarkPosition}),Zi){const e=l.isCreateSharingWaterMark;e&&(Ki||(Ki=new OffscreenCanvas(0,0)));const t=l.sharingWaterMarkName||"";Zi.Set_WaterMark_Info({waterMarkCanvas:Ki,isCreateSharingWaterMark:e,sharingWaterMarkName:t,watermarkOpacity:l.watermarkOpacity,watermarkRepeated:l.watermarkRepeated,watermarkPosition:l.watermarkPosition})}break;case"startVideoEncode":ga/=2,Pi&&In(Pi,ga);break;case"stopVideoEncode":ga*=2,Pi&&In(Pi,ga);break;case 127:{var f;const{canvas:e,canvasId:t}=l.data||{};if(e&&null!==(f=Zi)&&void 0!==f&&f.isSharingCanvas(t)){Zi.replaceCanvas(t,e);break}}break;case 128:{var p;const e=l.rendercanvasID;var m;null!==(p=Zi)&&void 0!==p&&p.isSharingCanvas(e)&&(null===(m=Zi)||void 0===m||m.replaceCanvas(e,null));break}case 13:Jn=!0,jn||(jn=setInterval((()=>{Bn(Pi)}),50)),ei||(ei=!0,"function"==typeof SharedArrayBuffer&&wasmMemory.buffer instanceof SharedArrayBuffer&&function(){const e=601508;Gn||(null!=(Gn=Module._malloc(e))?(Atomics.store(X().subarray(Gn/4,Gn/4+e),0,0),Atomics.store(X().subarray(Gn/4,Gn/4+e),1,0),ns.reciver={sab:wasmMemory,offset:Gn,length:e,interval:10,useCopy:!1,useOneElement:!1},!Qi&&Ci&&Ci.setSabBuffer(null,ns.reciver)):console.log("malloc failed"))}());break;case"WHITEBOARD_JOIN_MESSAGE":if(Ii||Do(Ii=bn(l.nodeId,"1","1",0,0,0,!1,!0,!1),l.nodeId,l.sn,l.encryptKey,2),!Qn.get(l.dcsId)){Qn.set(l.dcsId,!0);let e=Io(l.EncodedSn);Cn(Ii,l.dcsId,e,l.EncodedSn.length),Oo(e),En(Ii,1)}if(Ii){Dn(Ii,0,l.dcsId,0);let e=Io(l.data);Dn(Ii,1,e,l.data.length),Oo(e)}break;case"audioTimestamp":Zi&&Zi.SetcATimeStamp(l.data);break;case"vsport":Si&&(Si.close(),Si=null),(Si=e.ports[0]).onmessage=function(e){Zi&&Zi.SetcATimeStamp(e.data)};break;case 130:{let e=l.data||{},t=!!e.hold;j("HOLD:".concat(t,":").concat(e.userid,":").concat(e.reinit)),t?function(e){if(Xo)return;if(mi&&e.userid&&e.userid>>10!=mi>>10)return void j("HOLDINVALID");Xo=!0,Qi&&Zo();let t=Pi;Pi=null,t&&gn(t),Ii&&(gn(Ii),Ii=null),Qn.clear()}(e):(a=e,Xo&&(Xo=!1,a.reinit&&(mi=a.userid,Pi||0==Go||(Yo(),postMessage({status:Pi||Qi?16:O})))))}break;case"SEND_ANNOTATION_PDU":var g;l.data instanceof Uint8Array&&(null===(g=Ci)||void 0===g||g.send(l.data));break;case 133:!function(e){let t=e.content_type,r=e.cmd,n=e.type;"PDU"==t&&(r=re(r),4==n&&Ca(r))}(l.data);break;case 139:{const{ssrc:e,type:t,id:r}=l;!function(e,t,r,n){let i={id:n,status:138,success:!1};try{const{canvasId:r,options:n}=(null==e?void 0:e.getUserIdVideo(t))||{};i.success=!!r,i.data={canvasId:r,options:n},postMessage(i)}catch(e){postMessage(i)}}(Zi,e,0,r);break}case 144:(jo=l.data)!=Yr.child&&Yn(Pi,2,!1);break;case 147:{const{type:e,meetinguuid:t,mmrsigkey:r}=l;if(jo==Yr.child&&Pi){const n=2==e||1==e;if(qn(Pi,2,t,t.length),2==e){let e=re(r);zn(Pi,2,e,e.length)}$n(Pi,2,e),Yn(Pi,2,n)}else Pi&&Yn(Pi,2,!1);break}case"SWITCH_SHARING_TYPE":{let e=l.data;Zn=3===e?40:150,zi&&xo();break}}}));var jo=Yr.normal;function Ho(){return!1}function Vo(e){console.log(">>> Set_Share_Mode_js")}let zo,$o;var qo=!1;function Yo(){if(!Ko())return;if(gi==mi&&Pi)return;Pi&&(gn(Pi),Pi=null),Pi=bn(mi,hi,fi,0,0,ga,!1,!1,!1);let e=Ei;if(e&&Pi){let t=Io(e.updateParams.encryptKey);An(Pi,t,e.updateParams.encryptKey.length,e.updateParams.encryptType),Oo(t),gi=mi}ba.length>0&&(V("retry add recv channel for share decode"),ba.forEach((e=>{as(Pi,e.ssrc,e.streamIndex,e.videoMode)})),ba=[])}var Xo=!1;function Ko(){return!Xo}function Zo(){Ta.stop(),vi&&(clearInterval(vi),vi=null),Pi&&new ge,zi&&(clearInterval(zi),zi=0),Ui=!1,Mi=0,bo=0,ni=0,ri=0,ia=!0,Ha=!1,Jn=!1,la=ce.DESKTOP_SOURCE,ea!=ae&&setTimeout((function(){ia&&(PThread.terminateAllThreads(),ta=!1,ea=ae,aa=0,console.log("terminate multiple threads"))}),6e5),_i.stopCheck()}function Qo(){return-1}function Jo(){return!1}function es(){return Ea}function ts(e,t){j("TO:"+Ea+", CT:"+performance.now()+", NT:"+(e>>>0)+","+(t>>>0))}var rs,ns={};function is(e,t,r,n){if(Qi)return null;if(j("WSURL:false:".concat(e.replace(/(\/media\/)\d+/,"$1".concat(oi)))),Fi)return Fi.resetURL(e),i.setOnMessage(r),Fi.onopen=t,Fi.onclose=n,Fi;let i=new $r(e,Lr.MSHARE_DECODE);return i.setOnMessage(r),i.onopen=t,i.onclose=n,i.oncommand=Ia,Fi=i,i}function as(e,t,r,n){-1!=wa.findIndex((r=>r.handle==e&&r.ssrc==t))&&(os(e,t),V("Duplicate add sharing recv ".concat(t))),Fn(e,t,r,n),j("ASCHANNEL:".concat(t,":").concat(r)),wa.push({ssrc:t,index:r,videoMode:n,handle:e})}function os(e,t){let r=wa.findIndex((r=>r.handle==e&&r.ssrc==t));-1!=r&&wa.splice(r,1),Pn(e,t),j("RMASCHANNEL:".concat(t))}function ss(e,t){return(Bi!=e||Gi!=t)&&(postMessage({status:y,width:e,height:t}),Bi=e,Gi=t,!0)}!function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;try{const t="undefined"!=typeof DedicatedWorkerGlobalScope;if(Br.dataTransportMgr)return;let r=new Or({type:t?Or.THREAD_SUB:Or.THREAD_MAIN,remote:t?self:null});Br.dataTransportMgr=r,r.monitorlogfn=e,Vr.target||(Vr.target=new Vr(r),r.addTransportListChangeListener(Vr.target)),t&&self.addEventListener("message",r._onrecvmainthreadlistener.bind(r))}catch(e){console.error("<<<< InitDataTransportModule",e)}}(),rs=self,zr.instance||(zr.instance=new zr),zr.instance.start(rs);let ls=function(){let e=0;try{const t="function"==typeof MediaStreamTrack,r="function"==typeof MediaStreamTrackProcessor,n="function"==typeof VideoTrackGenerator;if(e|="function"==typeof OffscreenCanvas?1:0,e|=r&&t?4:0,e|=n&&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 ds(e,t,r){var n;_i.setRtpPackets();let i=new Uint8Array(4+t);var a=Y().subarray(e,e+t);i[0]=r,i.set(a,4),null===(n=Ci)||void 0===n||n.send(i)}function cs(e,t,r,n){var i,a;let o=new Uint8Array(4+t);var s=Y().subarray(e,e+t);o[0]=r,o.set(s,4),n==Pi?null===(i=Ci)||void 0===i||i.send(o):null===(a=Ue)||void 0===a||a.send(o)}function us(e,t,r){var n,i;let a=new Uint8Array(4+t);var o=Y().subarray(e,e+t);a[0]=r,a.set(o,4),handle==Pi?null===(n=Ci)||void 0===n||n.send(a):null===(i=Ue)||void 0===i||i.send(a)}function _s(e,t,r){var n,i,a=Y().subarray(e,e+t);let o=new Uint8Array(t);o.set(a,0),r==Pi?null===(n=Ci)||void 0===n||n.send(o):null===(i=Ue)||void 0===i||i.send(o)}function hs(e,t,r){var n,i,a=Y().subarray(e,e+t);let o=new Uint8Array(t);o.set(a,0),r==Pi?null===(n=Ci)||void 0===n||n.send(o):null===(i=Ue)||void 0===i||i.send(o)}function fs(e,t,r,n){let i={ismain:n!=Pi,cmd:F,mode:r};Ci.sendCommand&&Ci.sendCommand(i)}function ps(e,t){}self.postMessage({status:139,data:ls}),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,d=t.extraDataLen,a=t.Width,i=t.Height,r=new Uint8Array(d),c=GROWABLE_HEAP_U8().subarray(o,o+d);return r.set(c),_free(o),WebcodecDecoders[e].configure(r,a,i),"configured"==WebcodecDecoders[e].videoDecoder.state?0:(globalTracingError("Failed to configure VideoDecoder, state:"+WebcodecDecoders[e].videoDecoder.state+", width:"+a+", height:"+i+",config_data:"+r),-1)}case"decode":{let e=t.id,o=t.NewIDR,d=t.buffer,a=t.vclBufferSize,i=(t.vclNalCount,t.ssrc),r=GROWABLE_HEAP_U8().subarray(d,d+a),c=new Uint8Array(a);c.set(r),WebcodecDecoders[e].decode(c,o,i)}}}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,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}_report(e){let t=performance.now();this.enabled=!1;let o=Math.round((t-this.startTs)/1e3*10)/10,d=Math.round(this.totalCodecTime/1e3*10)/10,a=d>0?d:o,i=Math.round(this.inputIndex/a*10)/10,r=Math.round(this.outputIndex/a*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:i,outavgFps:r,elapsed:o,codeced:d,errCode:this.errCode,subCode:webcodec_encode_subcode,configIdx:e,deltaTimeout:this.frameTimeoutCount,keyTimeout:this.keyFrameTimeoutCount,retried:!retry_flag,l1t2:l1t2_flag})}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={},initializedJS=!1,pendingNotifiedProxyingQueues=[],enableVBWasmBackend=0,codecMRG=new CodecMRG;Module.codecMRG=codecMRG;var multiThreadFlag,model,tfjsUrl,vbBaseUrl,prob,mask,firstpayload,afnModel,frame=null,modelArtifacts={},IOhandle={};IOhandle.load=function(){return modelArtifacts},IOhandle.save=function(){};var baseModel,afnModelArtifacts={},afnIOHandle={},baseModelArtifacts={},baseIOHandle={};let tfInitPromise,webcodecDecodeFlag=!1,webcodecEncodeFlag=!1;afnIOHandle.load=function(){return afnModelArtifacts},afnIOHandle.save=function(){},baseIOHandle.load=function(){return baseModelArtifacts},baseIOHandle.save=function(){};var decHAOption,dualModelOKCount=0,tfLoad=!1;let webcodecDecodeWorkerMSC,decodeThreadSSRC,l1t2_flag=1,retry_flag=!1,webcodec_encode_subcode=0,wasmDecodeWorkerMSC=null;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"))))}))}}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()})}var chunk,err=threadPrintErr;self.alert=threadAlert,Module.instantiateWasm=(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=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,"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("cancel"===e.data.cmd)Module._pthread_self()&&Module.__emscripten_thread_exit(-1);else if("setimmediate"===e.data.target);else if("processProxyingQueue"===e.data.cmd)initializedJS?Module.executeNotifiedProxyingQueue(e.data.queue):pendingNotifiedProxyingQueues.push(e.data.queue);else if("videoframe"===e.data.cmd)frame&&(frame.close(),postMessage({cmd:"video_un_ref"})),frame=e.data.data;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("VideoEncodeConfigure"===e.data.cmd){var o=e.data.Width,d=e.data.Height,a=e.data.id,i=e.data.Bitrate,r=e.data.Framerate,c=e.data.buffer;Module.codecMRG.configEncodeWebCodec(a,i,r,o,d,c)}else if("VideoEncodeInit"===e.data.cmd){let t=e.data.id;var n=e.data.context;Module.codecMRG.initEncodeWebCodec(t,n)}else if("VideoEncode"===e.data.cmd){var s=e.data.videoFrameId,l=e.data.dataLength;let t=e.data.id;var u=e.data.NewIDR,h=e.data.rawData,f=e.data.timeout;Module.codecMRG.encodeVideoFrame(t,s,u,h,l,f)}else if("CloseVideoEncode"===e.data.cmd)Module.codecMRG.closeVideoEncode();else if("multiThreadFlag"===e.data.cmd)multiThreadFlag=e.data.multiThreadFlag;else if("vbObj0"===e.data.cmd){tfjsUrl=e.data.tfjsUrl,vbBaseUrl=e.data.vbBaseUrl;var m=e.data.modelJSON;if(modelArtifacts.modelTopology=m.modelTopology,modelArtifacts.format=m.format,modelArtifacts.generatedBy=m.generatedBy,modelArtifacts.convertedBy=m.convertedBy,m.weightsManifest)for(var b=0;b<m.weightsManifest.length;b++)modelArtifacts.weightSpecs=m.weightsManifest[b].weights;m.trainingConfig&&(modelArtifacts.trainingConfig=m.trainingConfig),m.userDefinedMetadata&&(modelArtifacts.userDefinedMetadata=m.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),d=new Float32Array(36864),a=tf.tensor4d(t,[1,144,256,3],"float32"),i=tf.tensor4d(o,[1,144,256,3],"float32"),r=tf.tensor4d(d,[1,144,256,1],"float32");afnModel.predict([a,i,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("vbFlag"==e.data.cmd)enableVBWasmBackend=e.data.enableVBWasmBackend;else if("vb"==e.data.cmd)multiThreadFlag=!1;else if("webcodec"==e.data.cmd)noExitRuntime=!0,decHAOption=e.data.decHAOption;else if("webcodecfailed"==e.data.cmd){let t=e.data.encode,o=e.data.id,d=e.data.code;t?codecMRG?.webcodecFailed(o,d):WebcodecDecoders[o]?.failed()}else if("webcodecRetry"==e.data.cmd){let t=e.data.id,o=e.data.errCode;Module.encAdditionalConfig=Module.encRetryConfig,Module.codecMRG.webcodecRetry(t,Module.encRetryConIdx,o)}else err("worker.js received unknown command "+e.data.cmd),err(e.data)}catch(e){throw postMessage({cmd:"tCrashed",data:e.toString()}),Module.__emscripten_thread_crashed,e}};var WebcodecDecoders=[];function WebcodecDecoder(e){this.id=e,this.videoDecoder=null,this.context=null,this.decodeOutputIndex=0,this.ssrc=0,this.continuoustimeout=0,this.timeoutCount=0,this.timeout=MAX_TIMEOUT_MS,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("error closing 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 InitVideoDecoder_js(e,t){return wasmDecodeWorkerMSC?(wasmDecodeWorkerMSC.postMessage({cmd:"init",id:e,context:t}),0):-1}function VideoDecoderConfigure_js(e,t,o,d,a){if(wasmDecodeWorkerMSC){let r=_malloc(o);if(!r)return-1;var i=GROWABLE_HEAP_U8().subarray(t,t+o);return writeArrayToMemory(i,r),wasmDecodeWorkerMSC.postMessage({cmd:"configure",id:e,buffer:r,extraDataLen:o,Width:d,Height:a}),0}return-1}function VideoDecoder_js(e,t,o,d,a){return wasmDecodeWorkerMSC?(wasmDecodeWorkerMSC.postMessage({cmd:"decode",id:e,buffer:t,vclBufferSize:o,NewIDR:d,vclNalCount:a,ssrc:decodeThreadSSRC}),0):-1}function GetEncThreadNum(){return 1}function GetCscThreadNum(){return 1}function js_info_from_wcl(e,t,o){var d=new Uint8Array(o),a=GROWABLE_HEAP_I8().subarray(t+0,t+o);d.set(a,0,o),postMessage({cmd:"js_info_from_wcl",data:d},[d.buffer])}function decode_callback(e,t){postMessage({cmd:"size",ssrc:e,size:t})}function frame_callback(e,t,o,d,a,i,r,c,n,s,l,u){var h=d;h=h>>10<<10,postMessage({cmd:"decoded",status:0,yuvdataptr:e,yuvdata:e,yuvlength:t,ntptime:0,ssrc:h,width:a,height:i,r_x:r,r_y:c,r_w:n,r_h:s,rotation:l,yuv_limited:u})}function frame_callback_webcodec(e,t,o,d,a,i,r,c,n,s,l,u){postMessage({cmd:"decoded_webcodec_render",status:0,id:e,iFrameNum:t,timestamp:o,ssrc:d,format_width:a,format_height:i,rendering_x:r,rendering_y:c,rendering_width:n,rendering_height:s,rotation:l,yuv_limited:u})}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 d={codec:"avc1.640028",description:e,codedWidth:t,codedHeight:o,optimizeForLatency:!0,hardwareAcceleration:decHAOption||"prefer-hardware"};this.videoDecoder.configure(d),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)};var encodereclaim=0;function WebcodecEncoder(e){this.id=e,this.handle=null,this.context=null,this.bsBuffer=null,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 on_psl_mix_share_info_changed(e,t,o,d,a){postMessage({cmd:"on_psl_mix_share_info_changed",shared_source_id:e,rect_x_norm:t,rect_y_norm:o,rect_cx_norm:d,rect_cy_norm:a})}function js_info_from_wcl_video_data(e,t,o,d,a,i){var r=new Uint8Array(o+4),c=GROWABLE_HEAP_I8().subarray(t+0,t+o);r[0]=d,r[1]=a,r.set(c,4,o),postMessage({cmd:"js_info_from_wcl_video_data",ssrc:e,data:r,is_sent_by_data:i},[r.buffer])}function processed_capture_data_callback(e,t,o,d,a,i,r,c,n,s){postMessage({cmd:"processed_capture_data_callback",ssrc:e,data:t,len_of_data:o,format_width:d,format_height:a,valid_x:i,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){postMessage({cmd:"APP_Troubleshoting_Info",data:e,len:t})}function IsSupportMultiThread(){return multiThreadFlag?1:0}function hardcodecpunumber(){return navigator.hardwareConcurrency||1}function setCurrentThreadSsrc_js(e){decodeThreadSSRC=e}function execute(e,t,o,d){if(model)try{var a=new Float32Array(GROWABLE_HEAP_U8().buffer,e,t),i=tf.tensor4d(a,[1,144,256,3],"float32"),r=model.predict(i),c=Float32Array.from(r.as1D(36864).arraySync());return GROWABLE_HEAP_F32().set(c,o>>2),i.dispose(),r.dispose(),0}catch(e){return globalTracingError("Multi Thread VB error",e),-1}}function execute_base(e,t,o,d){return tf.tidy((()=>{var a=new Float32Array(wasmMemory.buffer,e,t),i=tf.tensor4d(a,[1,144,256,3],"float32"),r=baseModel.predict(i);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,d>>2)})),0}function execute_afn(e,t,o,d,a){return tf.tidy((()=>{var i=new Float32Array(GROWABLE_HEAP_U8().buffer,e,d),r=new Float32Array(GROWABLE_HEAP_U8().buffer,t,d),c=new Float32Array(GROWABLE_HEAP_U8().buffer,o,d/3),n=tf.tensor4d(i,[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,a>>2)})),0}function MCMMonitor_Video_LOG(e,t){var o=new Uint8Array(t),d=GROWABLE_HEAP_I8().subarray(e+0,e+t);o.set(d),postMessage({cmd:"MCM_VIDEO_LOG",data:o},[o.buffer])}function wcl_trace_log(e,t){var o=new Uint8Array(t),d=GROWABLE_HEAP_I8().subarray(e+0,e+t);o.set(d,0,t),postMessage({cmd:"wcl_trace_log",data:o},[o.buffer])}function WebCodecsEncoderFail_js(e,t,o=0){let d=0==e&&4===t&&Module.supportHWEncRetry&&Module.encAddConIdx<Module.encRetryConIdx,a=webcodec_encode_subcode;if(d){Module.encAddConIdx=Module.encRetryConIdx,Module.encAdditionalConfig=Module.encRetryConfig;try{let e=JSON.stringify(Module.encAdditionalConfig);l1t2_flag=e.includes("L1T2")?1:0}catch(e){}Module.codecMRG.webcodecRetry(e,Module.encAddConIdx,t)}else postMessage({cmd:"WCEF",data:e,code:t,subCode:a,retry:d,inHWThread:o})}function WebCodecsDecoderFail_js(e){postMessage({cmd:"WCDF",data:e})}function UserWebCodecController_js(){return Module.isAndroid}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.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){encodereclaim=e&&-1!==e.toString().indexOf("reclaimed"),frame&&(frame.close(),frame=null),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())},WebcodecEncoder.prototype.configure=function(e,t,o,d,a){try{if((encodereclaim||this.retryFlag)&&("closed"!=this.handle.state&&this.handle.close(),this.handle=new VideoEncoder({output:this.EncodedVideoChunkOutputCallback.bind(this),error:this.onEncoderError.bind(this)}),encodereclaim&&(encodereclaim=0)),this.config={bitrate:e,framerate:t,width:o,height:d,buffer:a},this.handle){let i={...{bitrate:e,width:o,height:d,avc:{format:"annexb"},framerate:t,hardwareAcceleration:"no-preference",latencyMode:"realtime"},...Module.encAdditionalConfig};this.handle.configure(i),this.bsBuffer=a}}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,d,a){if(this.callbackInvoked=!1,(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,a),this.webcodecStatus.isFailed||!this._checkTimoutRatio())return this._stopTimeout(),this.webcodecStatus.isFailed||WebCodecsEncoderFail_js(this.id,4,!0),this.callback(this.context,1,0),frame.close(),frame=null,void postMessage({cmd:"video_un_ref"});if(this.handle){var i={keyFrame:!1};webcodecEncodeFlag||(webcodecEncodeFlag=!0,postMessage({cmd:"WCES"})),this.webcodecStatus.inputInc(t),this.webcodecStatus.inputTS=frame.timestamp,this.webcodecStatus.inputIndex%200==0&&postMessage({cmd:"THWEC"}),1==t&&(i.keyFrame=!0,this.chunkArr=[],this.lastKeyTS=frame.timestamp),this.timing.push({captureTS:frame.timestamp,encodeTS:Math.round(performance.now()),isKeyFrame:t}),this.handle.encode(frame,i),this.FeedbackEncodeChunk(),frame.close(),frame=null,postMessage({cmd:"video_un_ref"})}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)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),!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,d,a,i){var r=this.encodeCodecHandles.get(e);r&&r.configure(t,o,d,a,i)},CodecMRG.prototype.getEncodeConfig=function(e){var t=this.encodeCodecHandles.get(e);return t?t.getConfig():{}},CodecMRG.prototype.encodeVideoFrame=function(e,t,o,d,a,i){var r=this.encodeCodecHandles.get(e);r&&r.encode(t,o,d,a,i)},CodecMRG.prototype.webcodecFailed=function(e,t){var o=this.encodeCodecHandles.get(e);o&&o.failed(t)},CodecMRG.prototype.webcodecRetry=function(e,t,o){var d=this.encodeCodecHandles.get(e);d&&d.retry(t,o)},CodecMRG.prototype.closeVideoEncode=function(){var e=this.encodeCodecHandles.get(0);e&&e.close()},CodecMRG.prototype.clear_encodestate=function(){this.encodeCodecHandles&&this.encodeCodecHandles.clear()};'],{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.mt.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={556368:$0=>{console.log("Video Version: ",$0)},556405:($0,$1,$2)=>{js_info_from_wcl($0,$1,$2)},556439:$0=>{change_capture_resolution($0)},556474:($0,$1,$2,$3,$4,$5,$6,$7,$8,$9)=>{processed_capture_data_callback($0,$1,$2,$3,$4,$5,$6,$7,$8,$9)},556551:($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)},556621:($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)},556700:($0,$1)=>{decode_callback($0,$1)},556729:($0,$1,$2)=>{js_info_from_wcl($0,$1,$2)},556763:($0,$1)=>{video_rtp_data($0,$1)},556788:($0,$1,$2)=>{video_rtcp_data($0,$1,$2)},556818:($0,$1,$2,$3,$4,$5)=>{js_info_from_wcl_video_data($0,$1,$2,$3,$4,$5)},556875:$0=>{Exit_Thread($0)},556893:$0=>{return Before_Create_Thread($0)},556930:$0=>{return Before_Create_Thread($0)},556967:($0,$1)=>{APP_Troubleshoting_Info($0,$1)},557001:($0,$1,$2)=>{network_quality_callback($0,$1,$2)},557041:($0,$1)=>{MCMMonitor_Video_LOG($0,$1)},557071:($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)},557161:($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)},557253:$0=>{SubScribeUpdateVideo($0)},557281:($0,$1)=>{send_data($0,$1)},557304:$0=>{SubScribeUpdateVideo($0)},557332:($0,$1,$2,$3,$4,$5,$6,$7,$8,$9)=>{responseVideoQosData($0,$1,$2,$3,$4,$5,$6,$7,$8,$9)},557393:($0,$1)=>{SAVE_IV($0,$1)},557411:()=>{return Date.now()},557434:()=>{return getNTPBaseTime()},557463:()=>{return performance.now()},557493:($0,$1)=>{reportSenderNTPTime($0,$1)},557526:($0,$1)=>{Update_Required_Bandwidth($0,$1)},557562:$0=>{Update_Video_Hd_Info($0)},557590:($0,$1,$2,$3,$4)=>{on_psl_mix_share_info_changed($0,$1,$2,$3,$4)},557642:$0=>{console.log("Sharing Version: ",$0)},557681:($0,$1)=>{share_rtp_data($0,$1)},557706:($0,$1,$2)=>{SAVE_IV($0,$1,$2)},557728:($0,$1,$2)=>{share_rtp_raw_data($0,$1,$2)},557761:($0,$1,$2,$3)=>{share_rtcp_data($0,$1,$2,$3)},557794:($0,$1,$2,$3)=>{share_rtcp_raw_data($0,$1,$2,$3)},557831:($0,$1,$2,$3)=>{share_mouse_data($0,$1,$2,$3)},557866:($0,$1,$2)=>{share_mouse_raw_data($0,$1,$2)},557901:($0,$1,$2)=>{APP_Troubleshoting_Info($0,$1,$2)},557939:($0,$1,$2,$3)=>{decode_callback($0,$1,$2,$3)},557976:($0,$1,$2)=>{on_keyframe_request($0,$1,$2)},558013:($0,$1,$2)=>{on_keyframe_request_ex($0,$1,$2)},558053:($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)},558144:($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)},558231:($0,$1)=>{MCMMonitor_Sharing_LOG($0,$1)},558263:($0,$1,$2,$3,$4,$5,$6)=>{Send_Out_Qos($0,$1,$2,$3,$4,$5,$6)},558308:$0=>{SubScribeUpdateSharing($0)},558338:$0=>{SubScribeUpdateSharing($0)},558368:$0=>{Update_WebSokcet_Speed($0)},558400:($0,$1,$2,$3,$4,$5,$6,$7,$8,$9)=>{responseSharingQosData($0,$1,$2,$3,$4,$5,$6,$7,$8,$9)},558463:($0,$1)=>{SAVE_IV($0,$1)},558481:$0=>{console.error("tjDecompressHeader3 error %d ",$0)},558534:$0=>{console.error("tjDecompress2 error %d ",$0)},558581:($0,$1)=>{on_share_encode_start($0,$1)},558613:($0,$1)=>{on_share_encode_start($0,$1)},558645:($0,$1,$2,$3)=>{sharing_decode_channel_change($0,$1,$2,$3)},558692:($0,$1,$2,$3)=>{sharing_decode_channel_change($0,$1,$2,$3)},558739:($0,$1)=>{Update_Required_Bandwidth($0,$1)},558775:($0,$1,$2)=>{Send_Wb_Rtp_Packet($0,$1,$2)},558806:($0,$1)=>{Recieve_Wb_Packet($0,$1)},558833:($0,$1)=>{video_hw_retry_info($0,$1)},558866:$0=>{release_video_receiving_channle($0)},558906:()=>{videocodec_create_helpthread()},558940:($0,$1)=>{video_hw_retry_info($0,$1)},558973:()=>{console.error("_do_sharing_controller_decode: start")},559029:()=>{console.error("_do_sharing_controller_decode: waiting msg ")},559092:$0=>{console.error("_do_sharing_controller_decode: ",$0)},559147:($0,$1,$2)=>{console.error("_do_sharing_controller_decode: Try_Analysis ",$0,$1,$2)},559222:()=>{console.error("_do_sharing_controller_decode: main session _Set_Sharing_Encryption_Key_Directly ")},559323:()=>{console.error("_do_sharing_controller_decode: _Set_Sharing_Encryption_Key_Directly ")},559411:()=>{console.error("SHARING_DECODE_NETWORK_INFO WCLSharing is null")},559477:()=>{console.error("SHARING_DECODE_REQUEST_CHECK_ONE_TYPE WCLSharing is null")},559553:($0,$1)=>{console.error("SHARING_DECODE_MEDIA_DATA WCLSharing is null",$0,$1)},559626:($0,$1)=>{console.error("SHARING_DECODE_MEDIA_DATA type unknwon",$0,$1)},559693:($0,$1)=>{wcl_sharing_inited($0,$1)},559722:($0,$1)=>{COMMIT_PRINT($0,$1)},559744:()=>{return Module.getRandomValue()},559780:()=>{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"}}}},560502:()=>{videoencode_create_helpthread()},560537:($0,$1)=>{LOG_OUT($0,$1)},560558:($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.mt.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 n=r=>{let i=r.data;"wasmMemory"===i.command&&(Module.wasmMemory=i.data,e.removeEventListener("message",n),t())};e.addEventListener("message",n)}))}().then((()=>{importScripts(objectUrl),URL.revokeObjectURL(objectUrl)}));
|
|
3
|
+
//# sourceMappingURL=https://d1cdksi819e9z7.cloudfront.net/sourcemap/sharing_m.min.js-82fdcfecb48b0109dd2f.map
|